From f07c4a7c4890e0a2f01961b6ce4e863d572a1c7c Mon Sep 17 00:00:00 2001 From: anthonywj Date: Fri, 16 Dec 2022 10:07:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=8B=E5=89=8D=E4=BC=98=E5=8C=96=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BB=A3=E7=A0=81=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/StockOrderDetailController.java | 29 ++++++++++--------- .../business/StockQRCodeTextController.java | 17 ++++++++++- .../controller/inout/WareHouseController.java | 20 ++++++------- .../inout/utils/CheckOrderUtils.java | 11 +++++-- .../InvPreInProductDetailServiceImpl.java | 9 ++---- .../admin/thread/InvProductsTrService.java | 6 ++-- .../com/glxp/api/admin/util/DateUtil.java | 10 +++++++ .../main/resources/application-dev.properties | 6 ++-- .../mybatis/mapper/schedule/ScheduleDao.xml | 2 +- .../main/resources/schemas/schema_v2.1.sql | 5 ++-- 10 files changed, 72 insertions(+), 43 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderDetailController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderDetailController.java index 5a10fbaa..4cb55b8a 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderDetailController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderDetailController.java @@ -122,7 +122,8 @@ public class StockOrderDetailController { if (CollUtil.isNotEmpty(codeList)) { for (WarehouseEntity codeDetaiEntity : codeList) { if (StrUtil.trimToEmpty(codeDetaiEntity.getRelId()).equals(StrUtil.trimToEmpty(stockOrderDetailEntity.getRelId())) - && StrUtil.trimToEmpty(codeDetaiEntity.getBatchNo()).equals(StrUtil.trimToEmpty(stockOrderDetailEntity.getBatchNo())) + && + (StrUtil.isEmpty(codeDetaiEntity.getBatchNo()) || StrUtil.trimToEmpty(codeDetaiEntity.getBatchNo()).equals(StrUtil.trimToEmpty(stockOrderDetailEntity.getBatchNo()))) ) { StockOrderDetailEntity item = new StockOrderDetailEntity(); BeanUtils.copyProperties(stockOrderDetailEntity, item); @@ -594,23 +595,23 @@ public class StockOrderDetailController { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } //判断 - InvProductEntity invProductEntity=invProductService.selectExit(stockOrderDetailFilterRequest.getProductId()); - if(invProductEntity!=null){ - UdiInfoEntity udiInfoEntity= udiInfoService.findByNameCode(invProductEntity.getNameCode()); - if(udiInfoEntity!=null){ - if(udiInfoEntity.getScbssfbhph().equals("是")){ - if(stockOrderDetailFilterRequest.getBatchNo()==null){ - return ResultVOUtils.error(999,"批次号不能为空!"); + InvProductEntity invProductEntity = invProductService.selectExit(stockOrderDetailFilterRequest.getProductId()); + if (invProductEntity != null) { + UdiInfoEntity udiInfoEntity = udiInfoService.findByNameCode(invProductEntity.getNameCode()); + if (udiInfoEntity != null) { + if (udiInfoEntity.getScbssfbhph().equals("是")) { + if (stockOrderDetailFilterRequest.getBatchNo() == null) { + return ResultVOUtils.error(999, "批次号不能为空!"); } } - if(udiInfoEntity.getScbssfbhscrq().equals("是")){ - if(stockOrderDetailFilterRequest.getProductDate()==null){ - return ResultVOUtils.error(999,"生产日期不能为空!"); + if (udiInfoEntity.getScbssfbhscrq().equals("是")) { + if (stockOrderDetailFilterRequest.getProductDate() == null) { + return ResultVOUtils.error(999, "生产日期不能为空!"); } } - if(udiInfoEntity.getScbssfbhsxrq().equals("是")){ - if(stockOrderDetailFilterRequest.getExpireDate()==null){ - return ResultVOUtils.error(999,"失效日期不能为空!"); + if (udiInfoEntity.getScbssfbhsxrq().equals("是")) { + if (stockOrderDetailFilterRequest.getExpireDate() == null) { + return ResultVOUtils.error(999, "失效日期不能为空!"); } } } diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockQRCodeTextController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockQRCodeTextController.java index 2ab2c02b..61cdb9f5 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockQRCodeTextController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockQRCodeTextController.java @@ -45,6 +45,7 @@ import com.glxp.api.admin.service.inventory.StockPrintTempService; import com.glxp.api.admin.thread.IoTransInoutService; import com.glxp.api.admin.thread.JaspaperService; import com.glxp.api.admin.util.CustomUtil; +import com.glxp.api.admin.util.DateUtil; import com.glxp.api.admin.util.FileUtils; import com.glxp.api.admin.util.JasperUtils; import com.glxp.api.common.enums.ResultEnum; @@ -413,7 +414,14 @@ public class StockQRCodeTextController { stockOrderPrintEntity.setRemark1(systemPDFModuleEntity.getRemark1()); stockOrderPrintEntity.setRemark2(systemPDFModuleEntity.getRemark2()); stockOrderPrintEntity.setRemark3(systemPDFModuleEntity.getRemark3()); - stockOrderPrintEntity.setBillRemark(orderEntity.getPrintRemark()); + if (StrUtil.isNotEmpty(stockOrderPrintEntity.getProductDate())) { + stockOrderPrintEntity.setProductDate(DateUtil.formatExpireTime("20" + stockOrderPrintEntity.getProductDate())); + } + if (StrUtil.isNotEmpty(stockOrderPrintEntity.getExpireDate())) { + stockOrderPrintEntity.setExpireDate(DateUtil.formatExpireTime("20" + stockOrderPrintEntity.getExpireDate())); + } + + if (orderEntity != null) stockOrderPrintEntity.setBillRemark(orderEntity.getPrintRemark()); if (systemParamConfigEntity.getParamValue().equals("1")) { @@ -464,6 +472,13 @@ public class StockQRCodeTextController { StockOrderDetailEntity stockOrderDetailEntity = getDetailByRelBatch(stockOrderDetailEntities, stockOrderPrintEntity.getProductId(), stockOrderPrintEntity.getBatchNo()); if (stockOrderDetailEntity != null) { stockOrderPrintEntity.setPrice(stockOrderDetailEntity.getPrice()); + stockOrderPrintEntity.setZczbhhzbapzbh(stockOrderDetailEntity.getZczbhhzbapzbh()); + if (StrUtil.isNotEmpty(stockOrderDetailEntity.getProductDate())) { + stockOrderPrintEntity.setProductDate(DateUtil.formatExpireTime("20" + stockOrderDetailEntity.getProductDate())); + } + if (StrUtil.isNotEmpty(stockOrderDetailEntity.getExpireDate())) { + stockOrderPrintEntity.setExpireDate(DateUtil.formatExpireTime("20" + stockOrderDetailEntity.getExpireDate())); + } } stockOrderPrintEntity.setCount(stockOrderPrintEntity.getCount() * getActCount(stockOrderPrintEntity)); diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java index e9a8f82a..c68ea05d 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java @@ -928,20 +928,20 @@ public class WareHouseController { if (warehouseEntityList.get(i).getCode().equals(code)) { return drugCodeSelectEntity; } - UdiEntity originUdiEntity = FilterUdiUtils.getUdi(drugCodeSelectEntity.getCode()); - if (!StrUtil.emptyIfNull(originUdiEntity.getUdi()).equals(StrUtil.emptyIfNull(udiEntity.getUdi()))) { +// UdiEntity originUdiEntity = FilterUdiUtils.getUdi(drugCodeSelectEntity.getCode()); + if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getNameCode()).equals(StrUtil.emptyIfNull(udiEntity.getUdi()))) { continue; } - if (!StrUtil.emptyIfNull(originUdiEntity.getBatchNo()).toUpperCase(Locale.ROOT).equals(StrUtil.emptyIfNull(udiEntity.getBatchNo()).toUpperCase(Locale.ROOT))) { + if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getBatchNo()).toUpperCase(Locale.ROOT).equals(StrUtil.emptyIfNull(udiEntity.getBatchNo()).toUpperCase(Locale.ROOT))) { continue; } - if (!StrUtil.emptyIfNull(originUdiEntity.getProduceDate()).equals(StrUtil.emptyIfNull(udiEntity.getProduceDate()))) { + if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getProduceDate()).equals(StrUtil.emptyIfNull(udiEntity.getProduceDate()))) { continue; } - if (!StrUtil.emptyIfNull(originUdiEntity.getExpireDate()).equals(StrUtil.emptyIfNull(udiEntity.getExpireDate()))) { + if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getExpireDate()).equals(StrUtil.emptyIfNull(udiEntity.getExpireDate()))) { continue; } - if (!StrUtil.emptyIfNull(originUdiEntity.getSerialNo()).equals(StrUtil.emptyIfNull(udiEntity.getSerialNo()))) { + if (!StrUtil.emptyIfNull(drugCodeSelectEntity.getSerialNo()).equals(StrUtil.emptyIfNull(udiEntity.getSerialNo()))) { continue; } return drugCodeSelectEntity; @@ -1376,12 +1376,12 @@ public class WareHouseController { if (null == id) return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); WarehouseBussinessTypeEntity warehouseBussinessTypeEntity = warehouseBussinessTypeService.selectById(id); - FilterInvBusUserRequest filterInvBusUserRequest=new FilterInvBusUserRequest(); + FilterInvBusUserRequest filterInvBusUserRequest = new FilterInvBusUserRequest(); filterInvBusUserRequest.setScAction(warehouseBussinessTypeEntity.getAction()); filterInvBusUserRequest.setSubInvCode(warehouseBussinessTypeEntity.getCode()); - List invBusUserEntityList=invBusUserService.filterInvBusUser(filterInvBusUserRequest); - if(invBusUserEntityList.size()>0){ - return ResultVOUtils.error(999,"有用户关联该单据请先移除再进行删除!"); + List invBusUserEntityList = invBusUserService.filterInvBusUser(filterInvBusUserRequest); + if (invBusUserEntityList.size() > 0) { + return ResultVOUtils.error(999, "有用户关联该单据请先移除再进行删除!"); } InvSubWarehouseEntity invSubWarehouseEntity = diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/utils/CheckOrderUtils.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/utils/CheckOrderUtils.java index 9bd8e247..0d2bf9d3 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/utils/CheckOrderUtils.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/utils/CheckOrderUtils.java @@ -119,7 +119,7 @@ public class CheckOrderUtils { orderEntity.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_SUCCESS); orderEntity.setUpdateTime(new Date()); - + orderService.updateOrder(orderEntity); //更新业务单据为已校验 List erpIds = DataTransUtil.strToErpList(orderEntity.getErpFk()); @@ -138,9 +138,10 @@ public class CheckOrderUtils { } if (status.equals(ConstantStatus.SORDER_DELIVER)) { orderEntity.setReceiveStatus(1); + orderService.updateOrder(orderEntity); invProductsTrService.genInvProducts(orderEntity.getId()); } - orderService.updateOrder(orderEntity); + } else { for (ErpOrderEntity erpOrderEntity : vailOrderEntities) { @@ -280,6 +281,8 @@ public class CheckOrderUtils { return null; } else if (StrUtil.isEmpty(vailOrderEntity.getBatchNo()) && StrUtil.isEmpty(myErpOrder.getBatchNo())) { return null; + } else if (StrUtil.isEmpty(myErpOrder.getBatchNo())) { + return null; } else { return myErpOrder.getCoName() + "批次号不匹配!"; } @@ -292,6 +295,8 @@ public class CheckOrderUtils { return null; } else if (StrUtil.isEmpty(vailOrderEntity.getProductDate()) && StrUtil.isEmpty(myErpOrder.getProductDate())) { return null; + } else if (StrUtil.isEmpty(myErpOrder.getProductDate())) { + return null; } else { return myErpOrder.getCoName() + "生产日期不匹配!"; } @@ -305,6 +310,8 @@ public class CheckOrderUtils { return null; } else if (StrUtil.isEmpty(vailOrderEntity.getExpireDate()) && StrUtil.isEmpty(myErpOrder.getExpireDate())) { return null; + } else if (StrUtil.isEmpty(myErpOrder.getExpireDate())) { + return null; } else { return myErpOrder.getCoName() + "失效日期不匹配!"; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvPreInProductDetailServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvPreInProductDetailServiceImpl.java index 8d50dcfd..96577890 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvPreInProductDetailServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvPreInProductDetailServiceImpl.java @@ -119,14 +119,9 @@ public class InvPreInProductDetailServiceImpl implements InvPreInProductDetailSe if (CollUtil.isNotEmpty(datas)) { InvProductDetailEntity invProductDetailEntity = datas.get(0); - String bacthNo = null; - if (StrUtil.isEmpty(invProductDetailEntity.getBatchNo())) { - bacthNo = "empty"; - } else { - bacthNo = invProductDetailEntity.getBatchNo(); + for (int i = 1; i < datas.size(); i++) { + invProductDetailEntity.setCount(invProductDetailEntity.getCount() + datas.get(i).getCount()); } -// InvProductEntity invProductEntity = invPreInProductDao.selectByUuid(invProductDetailEntity.getProductIdFk(), bacthNo, invProductDetailEntity.getSupId(), invProductDetailEntity.getInvStorageCode(), invProductDetailEntity.getInvWarehouseCode()); -// invProductDetailEntity.setCount(invProductEntity.getInCount() - invProductEntity.getOutCount()); return invProductDetailEntity; } return null; diff --git a/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java b/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java index 868a2608..c72d0934 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/thread/InvProductsTrService.java @@ -320,7 +320,7 @@ public class InvProductsTrService { preiInList.add(warehouseEntity); } else if (warehouseEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 int lea = count - invCount; - warehouseEntity.setCount(lea / (warehouseEntity.getCount())); // + warehouseEntity.setCount(lea / (actCount)); preiInList.add(warehouseEntity); } } @@ -366,7 +366,7 @@ public class InvProductsTrService { inList.add(warehouseEntity); } else if (warehouseEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 int lea = count - invCount; - warehouseEntity.setCount(lea / (warehouseEntity.getCount())); // + warehouseEntity.setCount(lea / (actCount)); // inList.add(warehouseEntity); } } @@ -436,7 +436,7 @@ public class InvProductsTrService { prePutList.add(warehouseEntity); } else if (warehouseEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 int lea = count - invCount; - warehouseEntity.setCount(lea / (warehouseEntity.getCount())); // + warehouseEntity.setCount(lea / (actCount)); // prePutList.add(warehouseEntity); } } diff --git a/api-admin/src/main/java/com/glxp/api/admin/util/DateUtil.java b/api-admin/src/main/java/com/glxp/api/admin/util/DateUtil.java index 30866f5f..29078b1c 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/util/DateUtil.java +++ b/api-admin/src/main/java/com/glxp/api/admin/util/DateUtil.java @@ -543,4 +543,14 @@ public class DateUtil extends org.apache.commons.lang3.time.DateUtils { } return null; } + + public static String formatExpireTime(String str) { + try { + Date date = DateUtil.parseDate(str, "yyyyMMdd"); + return formatDate(date, "yyyy-MM-dd"); + } catch (ParseException e) { + e.printStackTrace(); + } + return str; + } } \ No newline at end of file diff --git a/api-admin/src/main/resources/application-dev.properties b/api-admin/src/main/resources/application-dev.properties index 33ee9eb0..8a813a25 100644 --- a/api-admin/src/main/resources/application-dev.properties +++ b/api-admin/src/main/resources/application-dev.properties @@ -1,8 +1,8 @@ -server.port=9991 +server.port=9992 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/udiwms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true +spring.datasource.jdbc-url=jdbc:mysql://192.168.0.66:3364/udiwms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true spring.datasource.username=root -spring.datasource.password=root +spring.datasource.password=Glxp@6066 spring.datasource.hikari.connection-timeout=60000 spring.datasource.hikari.maximum-pool-size=60 spring.datasource.hikari.minimum-idle=10 diff --git a/api-admin/src/main/resources/mybatis/mapper/schedule/ScheduleDao.xml b/api-admin/src/main/resources/mybatis/mapper/schedule/ScheduleDao.xml index 53bc185d..e55ebfc1 100644 --- a/api-admin/src/main/resources/mybatis/mapper/schedule/ScheduleDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/schedule/ScheduleDao.xml @@ -38,7 +38,7 @@ and customerId = #{customerId} - + limit 1 diff --git a/api-admin/src/main/resources/schemas/schema_v2.1.sql b/api-admin/src/main/resources/schemas/schema_v2.1.sql index 851ba98f..1776baf4 100644 --- a/api-admin/src/main/resources/schemas/schema_v2.1.sql +++ b/api-admin/src/main/resources/schemas/schema_v2.1.sql @@ -4,15 +4,16 @@ CALL Pro_Temp_ColumnWork ('basic_export_status','receiveStatus','varchar(255) ', CALL Pro_Temp_ColumnWork ('io_order','wzUploadStatus','varchar(255) ', 1); CALL Pro_Temp_ColumnWork ('io_order','wzUploadResult','varchar(255) ', 1); -INSERT ignore INTO scheduled(id, cronName, cron, customerId, remark) +INSERT ignore INTO sys_scheduled(id, cronName, cron, customerId, remark) VALUES (16, 'ScheduledDeletion', '0 0 2 1/1 * ? ', NULL, '删除30天数据'); -INSERT ignore INTO system_param_config ( id, parentId, paramName, paramKey, paramValue, paramStatus, paramType, paramExplain ) +INSERT ignore INTO sys_param_config ( id, parentId, paramName, paramKey, paramValue, paramStatus, paramType, paramExplain ) VALUES ( 20009, 0, '删除30天数据', 'ScheduledDeletion', '1', 1, 0, '1:是,0:否' ); + -- 创建表时必须 create table if not exists 表名