解决单据录入的时候,商品条码被修改的bug

This commit is contained in:
季圣华
2023-08-28 22:05:15 +08:00
parent 2e44512ae1
commit 3147afaa27
3 changed files with 10 additions and 2 deletions

View File

@@ -420,6 +420,10 @@ public class DepotItemService {
depotItem.setHeaderId(headerId);
String barCode = rowObj.getString("barCode");
MaterialExtend materialExtend = materialExtendService.getInfoByBarCode(barCode);
if(materialExtend == null) {
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_IS_NOT_EXIST_CODE,
String.format(ExceptionConstants.MATERIAL_BARCODE_IS_NOT_EXIST_MSG, barCode));
}
depotItem.setMaterialId(materialExtend.getMaterialId());
depotItem.setMaterialExtendId(materialExtend.getId());
depotItem.setMaterialUnit(rowObj.getString("unit"));

View File

@@ -382,9 +382,10 @@ public class MaterialExtendService {
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<MaterialExtend> list = materialExtendMapper.selectByExample(example);
if(list!=null && list.size()>0) {
materialExtend = list.get(0);
return list.get(0);
} else {
return null;
}
return materialExtend;
}
/**