解决单据录入的时候,商品条码被修改的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

@ -335,6 +335,9 @@ public class ExceptionConstants {
//多属性商品不能输入库存建议进行盘点录入
public static final int MATERIAL_SKU_BEGIN_STOCK_FAILED_CODE = 8000025;
public static final String MATERIAL_SKU_BEGIN_STOCK_FAILED_MSG = "多属性商品%s不能输入库存建议进行盘点录入";
//商品条码不存在请重新选择
public static final int MATERIAL_BARCODE_IS_NOT_EXIST_CODE = 8000026;
public static final String MATERIAL_BARCODE_IS_NOT_EXIST_MSG = "商品条码%s不存在请重新选择";
/**
* 单据信息

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;
}
/**