给批号和序列号增加限制判断(入库或者出库)

This commit is contained in:
季圣华
2022-07-11 21:31:58 +08:00
parent 9ebd4ac38c
commit 85a4f046b4

View File

@@ -407,21 +407,29 @@ public class DepotItemService {
depotHead.getNumber(), materialExtend.getMaterialId(), depotId, depotItem.getSnList());
}
} else {
//入库或出库
if(BusinessConstants.DEPOTHEAD_TYPE_IN.equals(depotHead.getType()) ||
BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())) {
//序列号不能为空
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableSerialNumber())) {
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_EMPTY_CODE,
String.format(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_EMPTY_MSG, barCode));
}
}
}
if (StringUtil.isExist(rowObj.get("batchNumber"))) {
depotItem.setBatchNumber(rowObj.getString("batchNumber"));
} else {
//入库或出库
if(BusinessConstants.DEPOTHEAD_TYPE_IN.equals(depotHead.getType()) ||
BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())) {
//批号不能为空
if (BusinessConstants.ENABLE_BATCH_NUMBER_ENABLED.equals(material.getEnableBatchNumber())) {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_BATCH_NUMBERE_EMPTY_CODE,
String.format(ExceptionConstants.DEPOT_HEAD_BATCH_NUMBERE_EMPTY_MSG, barCode));
}
}
}
if (StringUtil.isExist(rowObj.get("expirationDate"))) {
depotItem.setExpirationDate(rowObj.getDate("expirationDate"));
}