From f402e07d77dec9578aedf0ef71aa35d9f3fd3961 Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Tue, 14 Jun 2022 13:02:11 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/SpsSyncExportStatusController.java | 2 +- .../basic/SpsSyncUploadController.java | 3 ++- .../controller/basic/UdiInfoController.java | 11 +++++++++++ .../controller/inout/OrderController.java | 12 +++++++++++- .../controller/inout/WareHouseController.java | 13 ++++++------- .../sale/admin/dao/basic/EntrustReceDao.java | 2 ++ .../service/basic/EntrustReceService.java | 4 +++- .../basic/impl/EntrustReceServiceImpl.java | 5 +++++ .../thread/BasicBackUpdateProductService.java | 2 +- .../main/resources/application-pro.properties | 2 +- .../mybatis/mapper/basic/EntrustReceDao.xml | 18 ++++++++++++++++++ 11 files changed, 61 insertions(+), 13 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncExportStatusController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncExportStatusController.java index 90f2e64..66e602c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncExportStatusController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncExportStatusController.java @@ -148,7 +148,7 @@ public class SpsSyncExportStatusController { SpsSyncBusResponse spsSyncBusResponse = baseResponse.getData(); if (CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessLocalTypeEntities()) || CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessOriginTypeEntities()) - || CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessTypeEntities())) { + || CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessTypeEntities()) || CollUtil.isNotEmpty(spsSyncBusResponse.getEntrustReceEntities())) { BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByType(ConstantStatus.SYNC_BUS_TYPE); if (basicExportStatusTimeEntity != null) { if (StrUtil.isNotEmpty(basicExportStatusRequest.getSyncTime())) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncUploadController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncUploadController.java index bf8ee12..a6a0477 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncUploadController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncUploadController.java @@ -403,8 +403,9 @@ public class SpsSyncUploadController { entrustReceService.deleteAll(); for (EntrustReceEntity entrustReceEntity : syncDataResponse.getEntrustReceEntities()) { entrustReceEntity.setUpdateTime(null); - entrustReceService.insertEntrustRec(entrustReceEntity); + entrustReceService.replaceEntrustRec(entrustReceEntity); } + remark.append("委托验收设置:").append(syncDataResponse.getEntrustReceEntities().size()).append("条\n"); } batchSession.close(); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java index 59aafaa..0301e9c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java @@ -298,6 +298,17 @@ public class UdiInfoController { return ResultVOUtils.success(pageSimpleResponse); } + + @AuthRuleAnnotation("") + @GetMapping("/udiwms/basic/findByCode") + public BaseResponse findByCode(FilterUdiInfoRequest filterUdiInfoRequest) { + + UdiEntity udiEntity = FilterUdiUtils.getUdi(filterUdiInfoRequest.getUdiCode()); + UdiInfoEntity udiInfoEntity + = udiInfoService.findByNameCode(udiEntity.getUdi()); + return ResultVOUtils.success(udiInfoEntity); + } + /** * 新增第三方产品信息 * diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderController.java index aea035a..6aa2320 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderController.java @@ -17,6 +17,7 @@ import com.glxp.sale.admin.entity.basic.EntrustReceEntity; import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.inout.*; import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity; +import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; import com.glxp.sale.admin.entity.udid.UdiEntity; import com.glxp.sale.admin.req.basic.BasicEntrustRecRequest; import com.glxp.sale.admin.req.inout.*; @@ -30,6 +31,7 @@ import com.glxp.sale.admin.service.basic.EntrustReceService; import com.glxp.sale.admin.service.info.CompanyService; import com.glxp.sale.admin.service.inout.*; import com.glxp.sale.admin.service.inventory.InvWarehouseService; +import com.glxp.sale.admin.service.param.SystemParamConfigService; import com.glxp.sale.admin.thread.InvProductsTrService; import com.glxp.sale.admin.util.*; import com.glxp.sale.common.enums.ResultEnum; @@ -66,6 +68,8 @@ public class OrderController { @Resource BussinessTypeService bussinessTypeService; @Resource + SystemParamConfigService systemParamConfigService; + @Resource CompanyService companyService; @Value("${file_path}") private String filePath; @@ -364,7 +368,13 @@ public class OrderController { String supplementOrderNo = orderNo; supplementOrder.setOriginUllageSupNo(orderEntity.getId()); supplementOrder.setId(supplementOrderNo); - supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL); + + SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit"); + if ("1".equals(systemParamConfigEntity.getParamValue())) { + supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); //设置状态为补录单据 + } else { + supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL); //设置状态为补录单据 + } supplementOrder.setExportStatus(0); //设置导出状态为未导出 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 55f3065..9c530c3 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 @@ -644,7 +644,7 @@ public class WareHouseController { if (bussinessTypeEntity.isPreIn()) { if (StrUtil.isNotEmpty(udiEntity.getSerialNo())) { List invProductDetailEntities = invPreInProductDetailService.findByOriginCode(code); - if(CollUtil.isNotEmpty(invProductDetailEntities)){ + if (CollUtil.isNotEmpty(invProductDetailEntities)) { return ResultVOUtils.error(500, "条码已存在!"); } } @@ -851,18 +851,17 @@ public class WareHouseController { if (warehouseEntityList.get(i).getCode().equals(code)) { return drugCodeSelectEntity; } - - if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getNameCode()).equals(StrUtil.emptyIfNull(udiEntity.getUdi()))) { + UdiEntity originUdiEntity = FilterUdiUtils.getUdi(drugCodeSelectEntity.getCode()); + if (!StrUtil.emptyIfNull(originUdiEntity.getUdi()).equals(StrUtil.emptyIfNull(udiEntity.getUdi()))) { continue; } - - if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getBatchNo()).equals(StrUtil.emptyIfNull(udiEntity.getBatchNo()))) { + if (!StrUtil.emptyIfNull(originUdiEntity.getBatchNo()).equals(StrUtil.emptyIfNull(udiEntity.getBatchNo()))) { continue; } - if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getProduceDate()).equals(StrUtil.emptyIfNull(udiEntity.getProduceDate()))) { + if (!StrUtil.emptyIfNull(originUdiEntity.getProduceDate()).equals(StrUtil.emptyIfNull(udiEntity.getProduceDate()))) { continue; } - if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getExpireDate()).equals(StrUtil.emptyIfNull(udiEntity.getExpireDate()))) { + if (!StrUtil.emptyIfNull(originUdiEntity.getExpireDate()).equals(StrUtil.emptyIfNull(udiEntity.getExpireDate()))) { continue; } return drugCodeSelectEntity; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/EntrustReceDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/EntrustReceDao.java index 74af13e..bab63ff 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/EntrustReceDao.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/EntrustReceDao.java @@ -21,6 +21,8 @@ public interface EntrustReceDao { boolean insertEntrustRec(EntrustReceEntity ioOrderStatusEntity); + boolean replaceEntrustRec(EntrustReceEntity entrustReceEntity); + boolean deleteById(String id); boolean deleteAll(); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/EntrustReceService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/EntrustReceService.java index e9025f0..1f76b9b 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/EntrustReceService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/EntrustReceService.java @@ -19,7 +19,9 @@ public interface EntrustReceService { List filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); - boolean insertEntrustRec(EntrustReceEntity ioOrderStatusEntity); + boolean insertEntrustRec(EntrustReceEntity entrustReceEntity); + + boolean replaceEntrustRec(EntrustReceEntity entrustReceEntity); boolean deleteById(String id); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/EntrustReceServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/EntrustReceServiceImpl.java index 3765d94..376e7ac 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/EntrustReceServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/EntrustReceServiceImpl.java @@ -75,6 +75,11 @@ public class EntrustReceServiceImpl implements EntrustReceService { return entrustReceDao.insertEntrustRec(entrustReceEntity); } + @Override + public boolean replaceEntrustRec(EntrustReceEntity entrustReceEntity) { + return entrustReceDao.replaceEntrustRec(entrustReceEntity); + } + @Override public boolean deleteById(String id) { return entrustReceDao.deleteById(id); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicBackUpdateProductService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicBackUpdateProductService.java index 91245c0..528f60f 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicBackUpdateProductService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicBackUpdateProductService.java @@ -279,7 +279,7 @@ public class BasicBackUpdateProductService { SpsSyncBusResponse spsSyncBusResponse = baseResponse.getData(); if (CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessLocalTypeEntities()) || CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessOriginTypeEntities()) - || CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessTypeEntities())) { + || CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessTypeEntities()) || CollUtil.isNotEmpty(spsSyncBusResponse.getEntrustReceEntities())) { BasicExportStatusEntity busTypetatusEntity = new BasicExportStatusEntity(); busTypetatusEntity.setId(CustomUtil.getId()); busTypetatusEntity.setIdDatas(ConstantStatus.SYNC_BUS_TYPE); diff --git a/api-admin/src/main/resources/application-pro.properties b/api-admin/src/main/resources/application-pro.properties index db812f2..2ff29cf 100644 --- a/api-admin/src/main/resources/application-pro.properties +++ b/api-admin/src/main/resources/application-pro.properties @@ -1,7 +1,7 @@ # \u751F\u4EA7\u73AF\u5883 server.port=9996 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/spms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true +spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/spms_ph?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true spring.datasource.username=root #spring.datasource.password=root spring.datasource.password=123456 diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml index 99d24e3..41b010c 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml @@ -116,6 +116,24 @@ ) + + replace + INTO basic_entrust_accept(id,`action`, entrustInv, `entrustUser`, userId, updateTime, remark,entrustAction,finishRece,curInv) + values ( + #{id}, + #{action}, + #{entrustInv}, + #{entrustUser}, + #{userId}, + #{updateTime}, + #{remark}, + #{entrustAction}, + #{finishRece}, + #{curInv} + ) + + UPDATE basic_entrust_accept