From 11de396b84dd265d9b50272e9c354ec3ce8a8dde Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Mon, 13 Jun 2022 14:49:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2=EF=BC=8C?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E8=AF=A6=E6=83=85=EF=BC=8C=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inout/WareHouseController.java | 17 +++-- .../entity/basic/BussinessTypeEntity.java | 2 +- .../admin/res/basic/BussinessTypResponse.java | 3 + .../admin/res/inout/WarehouseResponse.java | 4 + .../inventory/InvPreProductDetailService.java | 3 + .../inventory/InvProductDetailService.java | 3 + .../impl/InvPreProductDetailServiceImpl.java | 16 ++++ .../impl/InvProductDetailServiceImpl.java | 8 ++ .../admin/thread/IoTransInoutService.java | 76 ++++++++++++++++++- .../mybatis/mapper/basic/BussinessTypeDao.xml | 14 ++-- 10 files changed, 130 insertions(+), 16 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java index 93f51bf..7bb5623 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java @@ -439,7 +439,7 @@ public class WareHouseController { if (udiEntity == null) { String sptmtodi = systemParamConfigService.selectValueByParamKey(Constant.SPTM_TO_DI); - if(sptmtodi.equals("1")){ + if (sptmtodi.equals("1")) { if (code.length() == 13) { UdiInfoEntity udiInfoEntity = udiInfoService.findBySptm(code); if (udiInfoEntity != null) { @@ -581,9 +581,16 @@ public class WareHouseController { if (StrUtil.isEmpty(udiEntity.getSerialNo()) && StrUtil.isEmpty(udiEntity.getBatchNo())) { return ResultVOUtils.error(500, "批次号不能为空!"); } - BaseResponse checkOriginCodeRes = checkOriginCode(udiEntity); - if (checkOriginCodeRes != null) - return checkOriginCodeRes; + +// String isCheck = systemParamConfigService.selectValueByParamKey("code_fill_check"); + + //三期校验 + if (bussinessTypeEntity.isCodeFillCheck()) { + BaseResponse checkOriginCodeRes = checkOriginCode(udiEntity); + if (checkOriginCodeRes != null) + return checkOriginCodeRes; + } + //过期提醒: SystemParamConfigEntity expireParamConfigEntity = systemParamConfigService.selectByParamKey("expire_date_tip"); @@ -893,7 +900,7 @@ public class WareHouseController { //校验条码的完整性 String errMsg = ""; UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectByNameCode(udiEntity.getUdi()); - if(udiRelevanceResponse == null){ + if (udiRelevanceResponse == null) { return ResultVOUtils.error(501, "耗材字典不存在此产品!"); } if (StrUtil.isEmpty(udiEntity.getBatchNo()) && !udiRelevanceResponse.isAllowNoBatch()) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java index 2cd29a4..c386f07 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java @@ -65,6 +65,6 @@ public class BussinessTypeEntity { private boolean scanPreIn; private boolean vailInv; - + private boolean codeFillCheck; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java index 6019757..8d832ef 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java @@ -64,4 +64,7 @@ public class BussinessTypResponse { private boolean ullageFill; private boolean scanPreIn; private boolean vailInv; + + + private boolean codeFillCheck; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/inout/WarehouseResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/inout/WarehouseResponse.java index 1886fa8..6b325ff 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/inout/WarehouseResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/inout/WarehouseResponse.java @@ -17,4 +17,8 @@ public class WarehouseResponse { private String fromCorp; private Integer count; private String orderId; + private String batchNo; + private String produceDate; + private String expireDate; + private String serialNo; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreProductDetailService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreProductDetailService.java index e4ba7a2..86f31a9 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreProductDetailService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvPreProductDetailService.java @@ -9,6 +9,9 @@ import java.util.List; public interface InvPreProductDetailService { + List findByCode(String code); + + List findByOriginCode(String code); List filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvProductDetailService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvProductDetailService.java index 2ecfe33..0a1a320 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvProductDetailService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/InvProductDetailService.java @@ -12,6 +12,9 @@ public interface InvProductDetailService { List findByCode(String code); + + List findByOriginCode(String code); + List filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest); List filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreProductDetailServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreProductDetailServiceImpl.java index f15a595..d393e1f 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreProductDetailServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreProductDetailServiceImpl.java @@ -26,6 +26,22 @@ public class InvPreProductDetailServiceImpl implements InvPreProductDetailServic @Resource InvPreProductDetailDao invPreProductDetailDao; + @Override + public List findByCode(String code) { + FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); + filterInvProductDetailRequest.setCode(code); + List invProductDetailEntities = invPreProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest); + return invProductDetailEntities; + } + + @Override + public List findByOriginCode(String code) { + FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); + filterInvProductDetailRequest.setOriginCode(code); + List invProductDetailEntities = invPreProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest); + return invProductDetailEntities; + } + @Override public List filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) { if (filterInvProductDetailRequest == null) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvProductDetailServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvProductDetailServiceImpl.java index c163efe..8f24aad 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvProductDetailServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvProductDetailServiceImpl.java @@ -31,6 +31,14 @@ public class InvProductDetailServiceImpl implements InvProductDetailService { return invProductDetailEntities; } + @Override + public List findByOriginCode(String code) { + FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); + filterInvProductDetailRequest.setOriginCode(code); + List invProductDetailEntities = invProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest); + return invProductDetailEntities; + } + @Override public List filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) { if (filterInvProductDetailRequest == null) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java index ef19194..fa9ffd2 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java @@ -14,6 +14,7 @@ import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity; import com.glxp.sale.admin.entity.inout.*; +import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; import com.glxp.sale.admin.entity.inventory.InvProductEntity; import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity; import com.glxp.sale.admin.entity.udid.UdiEntity; @@ -28,10 +29,10 @@ import com.glxp.sale.admin.service.basic.*; import com.glxp.sale.admin.service.info.CompanyProductRelevanceService; import com.glxp.sale.admin.service.info.CompanyService; import com.glxp.sale.admin.service.inout.*; -import com.glxp.sale.admin.service.inventory.InvPreProductService; -import com.glxp.sale.admin.service.inventory.InvProductService; -import com.glxp.sale.admin.service.inventory.InvWarehouseService; +import com.glxp.sale.admin.service.inventory.*; import com.glxp.sale.admin.util.*; +import com.glxp.sale.common.res.BaseResponse; +import com.glxp.sale.common.util.ResultVOUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -407,7 +408,14 @@ public class IoTransInoutService { insertList.clear(); return; } - + //三期校验 + String checkOriginMsg = checkOriginCode(warehouseEntity, bussinessTypeEntity); + if (StrUtil.isNotEmpty(checkOriginMsg)) { + orderService.updateOrderStatus(warehouseEntity.getOrderId(), ConstantStatus.ORDER_STATUS_FAIL); + orderService.updateRemark(orderEntity.getId(), checkOriginMsg); + insertList.clear(); + return; + } //校验是否是当前供应商 if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) { @@ -483,6 +491,66 @@ public class IoTransInoutService { } } + @Resource + InvPreProductDetailService invPreProductDetailService; + @Resource + InvProductDetailService invProductDetailService; + + public String checkOriginCode(WarehouseEntity warehouseEntity, BussinessTypeEntity bussinessTypeEntity) { + + UdiEntity udiEntity = FilterUdiUtils.getGS1Udi(warehouseEntity.getCode()); + //校验条码的完整性 + String errMsg = ""; + UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectByNameCode(udiEntity.getUdi()); + if (udiRelevanceResponse == null) { + return "耗材字典不存在此产品"; + } + if (bussinessTypeEntity.isAdvanceType()) { + List invPreProductDetailEntitys = invPreProductDetailService.findByOriginCode(warehouseEntity.getCode()); + if (CollUtil.isNotEmpty(invPreProductDetailEntitys)) { + InvProductDetailEntity invProductDetailEntity = invPreProductDetailEntitys.get(invPreProductDetailEntitys.size()-1); + if (StrUtil.isEmpty(warehouseEntity.getBatchNo())) { + warehouseEntity.setBatchNo(invProductDetailEntity.getBatchNo()); + } + if (StrUtil.isEmpty(warehouseEntity.getProduceDate())) { + warehouseEntity.setProduceDate(invProductDetailEntity.getProductionDate()); + } + if (StrUtil.isEmpty(warehouseEntity.getExpireDate())) { + warehouseEntity.setExpireDate(invProductDetailEntity.getExpireDate()); + } + } + } else { + List invProductDetailEntities = invProductDetailService.findByOriginCode(warehouseEntity.getCode()); + if (CollUtil.isNotEmpty(invProductDetailEntities)) { + InvProductDetailEntity invProductDetailEntity = invProductDetailEntities.get(invProductDetailEntities.size()-1); + if (StrUtil.isEmpty(warehouseEntity.getBatchNo())) { + warehouseEntity.setBatchNo(invProductDetailEntity.getBatchNo()); + } + if (StrUtil.isEmpty(warehouseEntity.getProduceDate())) { + warehouseEntity.setProduceDate(invProductDetailEntity.getProductionDate()); + } + if (StrUtil.isEmpty(warehouseEntity.getExpireDate())) { + warehouseEntity.setExpireDate(invProductDetailEntity.getExpireDate()); + } + } + } + + if (StrUtil.isEmpty(warehouseEntity.getBatchNo()) && !udiRelevanceResponse.isAllowNoBatch()) { + errMsg = errMsg + ",批次号"; + } + if (StrUtil.isEmpty(warehouseEntity.getProduceDate()) && !udiRelevanceResponse.isAllowNoProduct()) { + errMsg = errMsg + ",生产日期"; + } + if (StrUtil.isEmpty(warehouseEntity.getExpireDate()) && !udiRelevanceResponse.isAllowNoExpire()) { + errMsg = errMsg + ",失效日期"; + } + + if (StrUtil.isNotEmpty(errMsg)) { + return "UDI码" + warehouseEntity.getCode() + "产品三期缺失请补齐" + errMsg.substring(1) + ""; + } + return null; + } + //转入正式表后,更换单据状态,等待校验或已完成 public void transStatus(String orderId) { //todo 改成等待校验,选择校验 diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml index e8f9491..0857094 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml @@ -10,7 +10,7 @@ basic_bussiness_type.enable,basic_bussiness_type.remark,basic_bussiness_type.mainAction, basic_bussiness_type.thirdSysFk,basic_bussiness_type.localAction,basic_bussiness_type.secCheckEnable, basic_bussiness_type.checkUdims,basic_bussiness_type.checkPdaEd,basic_bussiness_type.checkPdaUn,basic_bussiness_type.checkPc, - basic_bussiness_type.checkWebNew,basic_bussiness_type.checkChange, + basic_bussiness_type.checkWebNew,basic_bussiness_type.checkChange,basic_bussiness_type.codeFillCheck, basic_bussiness_type.secCheckUdims, basic_bussiness_type.secCheckPdaEd, basic_bussiness_type.secCheckPdaUn, basic_bussiness_type.secCheckWebNew, basic_bussiness_type.secCheckChange, basic_bussiness_type.ullageFill, basic_bussiness_type.scanPreIn, basic_bussiness_type.vailInv, @@ -124,7 +124,7 @@ basic_bussiness_type.enable,basic_bussiness_type.remark,basic_bussiness_type.mainAction, basic_bussiness_type.thirdSysFk,basic_bussiness_type.localAction,basic_bussiness_type.secCheckEnable, basic_bussiness_type.checkUdims,basic_bussiness_type.checkPdaEd,basic_bussiness_type.checkPdaUn,basic_bussiness_type.checkPc, - basic_bussiness_type.checkWebNew,basic_bussiness_type.checkChange, + basic_bussiness_type.checkWebNew,basic_bussiness_type.checkChange,basic_bussiness_type.codeFillCheck, basic_bussiness_type.secCheckUdims, basic_bussiness_type.secCheckPdaEd, basic_bussiness_type.secCheckPdaUn, basic_bussiness_type.secCheckWebNew, basic_bussiness_type.secCheckChange, basic_bussiness_type.ullageFill, basic_bussiness_type.scanPreIn, basic_bussiness_type.vailInv, @@ -181,7 +181,7 @@ ,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew, secCheckChange,corpType,basic_bussiness_type.storageCode,checkBalacne, secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime,prefix - ,ullageFill,scanPreIn,vailInv) + ,ullageFill,scanPreIn,vailInv,codeFillCheck) values ( #{action}, @@ -219,7 +219,7 @@ #{prefix}, #{ullageFill}, #{scanPreIn}, - #{vailInv} + #{vailInv},#{codeFillCheck} ) @@ -234,7 +234,7 @@ checkUdims,checkPdaEd,checkPdaUn,checkPc,checkWebNew,checkChange ,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew, secCheckChange,corpType,storageCode,checkBalacne,secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime,prefix - ,ullageFill,scanPreIn,vailInv) + ,ullageFill,scanPreIn,vailInv,codeFillCheck) values ( #{index}, @@ -273,7 +273,7 @@ #{prefix}, #{ullageFill}, #{scanPreIn}, - #{vailInv} + #{vailInv},#{codeFillCheck} ) @@ -317,6 +317,8 @@ scanPreIn=#{scanPreIn}, vailInv=#{vailInv}, prefix=#{prefix}, + codeFillCheck=#{codeFillCheck}, + thirdSysFk=#{thirdSysFk}, WHERE id = #{id}