给组装拆卸、调拨单增加校验

This commit is contained in:
季圣华 2022-09-09 01:24:00 +08:00
parent aa72b0bce2
commit 62ef2b3983
3 changed files with 22 additions and 0 deletions

View File

@ -93,6 +93,8 @@ public class BusinessConstants {
public static final String SUB_TYPE_SALES_RETURN = "销售退货";
public static final String SUB_TYPE_TRANSFER = "调拨";
public static final String SUB_TYPE_REPLAY = "盘点复盘";
public static final String SUB_TYPE_ASSEMBLE = "组装单";
public static final String SUB_TYPE_DISASSEMBLE = "拆卸单";
/**
* 批量插入sql时最大的数据条数
* */

View File

@ -326,6 +326,12 @@ public class ExceptionConstants {
//比例格式错误
public static final int MATERIAL_RATIO_NOT_INTEGER_CODE = 8000016;
public static final String MATERIAL_RATIO_NOT_INTEGER_MSG = "第%s行比例格式错误";
//组装拆卸单不能选择批号或序列号商品
public static final int MATERIAL_ASSEMBLE_SELECT_ERROR_CODE = 80000017;
public static final String MATERIAL_ASSEMBLE_SELECT_ERROR_MSG = "抱歉,组装拆卸单不能选择批号或序列号商品:%s";
//调拨单不能选择批号或序列号商品
public static final int MATERIAL_TRANSFER_SELECT_ERROR_CODE = 80000018;
public static final String MATERIAL_TRANSFER_SELECT_ERROR_MSG = "抱歉,调拨单不能选择批号或序列号商品:%s";
/**
* 单据信息

View File

@ -406,6 +406,20 @@ public class DepotItemService {
depotItem.setMaterialExtendId(materialExtend.getId());
depotItem.setMaterialUnit(rowObj.getString("unit"));
Material material= materialService.getMaterial(depotItem.getMaterialId());
if (BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableSerialNumber()) ||
BusinessConstants.ENABLE_BATCH_NUMBER_ENABLED.equals(material.getEnableBatchNumber())) {
//组装拆卸单不能选择批号或序列号商品
if(BusinessConstants.SUB_TYPE_ASSEMBLE.equals(depotHead.getSubType()) ||
BusinessConstants.SUB_TYPE_DISASSEMBLE.equals(depotHead.getSubType())) {
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_ASSEMBLE_SELECT_ERROR_CODE,
String.format(ExceptionConstants.MATERIAL_ASSEMBLE_SELECT_ERROR_MSG, barCode));
}
//调拨单不能选择批号或序列号商品该场景走出库和入库单
if(BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) {
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_TRANSFER_SELECT_ERROR_CODE,
String.format(ExceptionConstants.MATERIAL_TRANSFER_SELECT_ERROR_MSG, barCode));
}
}
if (StringUtil.isExist(rowObj.get("snList"))) {
depotItem.setSnList(rowObj.getString("snList"));
if(StringUtil.isExist(rowObj.get("depotId"))) {