解决单据录入的时候,商品条码被修改的bug
This commit is contained in:
@@ -335,6 +335,9 @@ public class ExceptionConstants {
|
|||||||
//多属性商品不能输入库存,建议进行盘点录入
|
//多属性商品不能输入库存,建议进行盘点录入
|
||||||
public static final int MATERIAL_SKU_BEGIN_STOCK_FAILED_CODE = 8000025;
|
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 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不存在,请重新选择";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单据信息
|
* 单据信息
|
||||||
|
|||||||
@@ -420,6 +420,10 @@ public class DepotItemService {
|
|||||||
depotItem.setHeaderId(headerId);
|
depotItem.setHeaderId(headerId);
|
||||||
String barCode = rowObj.getString("barCode");
|
String barCode = rowObj.getString("barCode");
|
||||||
MaterialExtend materialExtend = materialExtendService.getInfoByBarCode(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.setMaterialId(materialExtend.getMaterialId());
|
||||||
depotItem.setMaterialExtendId(materialExtend.getId());
|
depotItem.setMaterialExtendId(materialExtend.getId());
|
||||||
depotItem.setMaterialUnit(rowObj.getString("unit"));
|
depotItem.setMaterialUnit(rowObj.getString("unit"));
|
||||||
|
|||||||
@@ -382,9 +382,10 @@ public class MaterialExtendService {
|
|||||||
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||||
List<MaterialExtend> list = materialExtendMapper.selectByExample(example);
|
List<MaterialExtend> list = materialExtendMapper.selectByExample(example);
|
||||||
if(list!=null && list.size()>0) {
|
if(list!=null && list.size()>0) {
|
||||||
materialExtend = list.get(0);
|
return list.get(0);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return materialExtend;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user