From d16bbc689859fc1ea4a0d13a0636dce133ada6c2 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" <123456> Date: Thu, 31 Aug 2023 17:59:06 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E6=9C=80=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E6=97=B6=E9=97=B4=20=E5=92=8C=20=E5=AF=B9=20?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E7=8A=B6=E6=80=81=E5=92=8C=20=E6=94=B6?= =?UTF-8?q?=E8=B4=A7=E7=8A=B6=E6=80=81=E7=9A=84=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PanFactoryDataServiceImpl.java | 58 +++++++++++++++---- 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java index c71910a4d..b1fe8a953 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java @@ -484,20 +484,34 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { logger.warn("#################handleDataToPlatform: 保存订单信息失败 orderSelfNum={}", orderSelfNum); throw new CustomerException(405, "保存订单信息失败"); } - } else { - id = distributionStockArticleEntity.getId(); - String waybillNumber = distributionStockArticleEntity.getWaybillNumber(); - if(!waybillNumber.contains(waybillNoNum)){ - waybillNumber = waybillNumber+","+waybillNoNum; - } - distributionStockArticleEntity.setWaybillNumber(waybillNumber); - distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity); } - - //查询包件信息数据 + id = distributionStockArticleEntity.getId(); + //保存包件信息 saveOrderPackage(unitNo, distributionStockArticleEntity, id, basicdataWarehouseEntity, waybillNoNum); - //包件保存成功去修改订单的数量 - distributionStockArticleClient.addHandQuantity(id, 1); + + + + String waybillNumber = distributionStockArticleEntity.getWaybillNumber(); + if(!waybillNumber.contains(waybillNoNum)){ + waybillNumber = waybillNumber+","+waybillNoNum; + } + distributionStockArticleEntity.setWaybillNumber(waybillNumber); + + // 修改入库状态 + distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity().intValue()+1); + String orderStatus = checkDistributionStockArticleOrderStatus(distributionStockArticleEntity); + distributionStockArticleEntity.setOrderStatus(orderStatus); + + // 修改收货 + if(distributionStockArticleEntity.getOrderStatus().equals(OrderStatusConstant.ruku.getValue())){ + distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue()); + } + // 修改最新的入库时间 + distributionStockArticleEntity.setWarehouseEntryTimeEnd(new Date()); + distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity); + +// //包件保存成功去修改订单的数量 +// distributionStockArticleClient.addHandQuantity(id, 1); // todo 这里需要根据包件状态修改状态 logger.info("#################handleDataToPlatform: 数据处理完成"); } else { @@ -506,6 +520,26 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { } } + /** + * 根据订单的在库数联返回订单的状态 + * @param distributionStockArticleEntity + * @return + */ + private String checkDistributionStockArticleOrderStatus(DistributionStockArticleEntity distributionStockArticleEntity) { + + if(ObjectUtils.isNull(distributionStockArticleEntity)){ + return null; + } + if (distributionStockArticleEntity.getTotalNumber().equals(distributionStockArticleEntity.getHandQuantity())){ + // 如果订单总数 和在库件数一致 表示入库完成 + return OrderStatusConstant.ruku.getValue(); + } + return OrderStatusConstant.bufenruku.getValue(); + + + } + + /** * 根据客户ID 查询客户的配送类型 *