From 530d02b14bfb9a17ae6401c1e03ca7495445f202 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Mon, 18 Dec 2023 12:03:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=AF=B9=E8=80=81=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=9A=84=E7=AB=99=E5=AD=98=E5=8D=95=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionReservationServiceImpl.java | 8 ++++- .../service/impl/AsyncDataServiceImpl.java | 3 +- .../service/impl/OuPaiFactoryServiceImpl.java | 16 +++++----- .../src/main/resources/application.yml | 2 +- .../java/com/logpm/factory/TestService.java | 30 +++++++++++++++++++ 5 files changed, 47 insertions(+), 12 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index 40e244dec..5292dfbcd 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -1257,8 +1257,14 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl { + log.info(">>>> debug1 {}",l.getStocklistId()); DistributionStockListEntity stockListEntity = distributionStockListService.getById(l.getStocklistId()); - stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - l.getReservationNum()); + log.info(">>>> debug2 {}",stockListEntity); + log.info(">>>> debug3 {}",l.getReservationNum()); + + if(stockListEntity.getQuantityStock() != null && stockListEntity.getQuantityStock()!=0){ + stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - l.getReservationNum()); + } hashSet.add(stockListEntity.getOrderCode()); stockListId.append(stockListEntity.getId()).append(","); //这里需要将库存品信息和配送进行信息绑定 diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java index ecbf2d7ac..9715a737e 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java @@ -451,6 +451,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService { if (ObjectUtils.isNull(advanceEntitys)) { + AdvanceEntity advanceEntity = new AdvanceEntity(); advanceEntity.setOrderSelfNum(StringUtil.isBlank(factoryOrderEntity.getSelfCode()) ? "" : factoryOrderEntity.getSelfCode()); //订单自编号 advanceEntity.setSiteName(receivingOrderEntity.getFromWarehouseName()); // 基地 TODO 需要映射 @@ -466,7 +467,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService { advanceEntity.setFirstPackCode(""); //一级品类 advanceEntity.setDealerName(factoryOrderEntity.getShopName()); //商场名称 advanceEntity.setDealerCode(factoryOrderEntity.getShopCode()); //商场编码 - advanceEntity.setDueDate(""); // 交期 + advanceEntity.setDueDate(""); /// 交期 advanceEntity.setIsOpai(0); //是否干仓配 advanceEntity.setOrderNum("");//MSCS订单号 可以为空 advanceEntity.setCarrierName("汇通");//承运商 可以为空 diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java index c1e8d0b3a..c36854006 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java @@ -104,7 +104,8 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService { // 对返回i的数据进行处理 按照 发车单-->订单-->包件 完成保存 handleData(code); if (ObjectUtils.isNotNull(code)) { - asyncDataService.handlerOuPaiDataToHt(code); + // 暂停推送 +// asyncDataService.handlerOuPaiDataToHt(code); } return code; @@ -739,10 +740,9 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService { String selfCode = orderEntity.getString("SelfCode");//订单自编码 //先查询是否存在订单自编码 // -// factoryOrderService.selectEntityBySelfCode(selfCode,receivingId); - - - FactoryOrderEntity factoryOrderEntity = new FactoryOrderEntity(); + FactoryOrderEntity factoryOrderEntity = factoryOrderService.selectEntityBySelfCode(selfCode, receivingId); + if(Objects.isNull(factoryOrderEntity)){ + factoryOrderEntity = new FactoryOrderEntity(); factoryOrderEntity.setCode(orderEntity.getString("Code")); factoryOrderEntity.setSelfCode(selfCode); factoryOrderEntity.setContractNumber(orderEntity.getString("ContractNumber")); @@ -838,16 +838,14 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService { factoryOrderEntity.setReceiptStatus(0); factoryOrderEntity.setPushStatus(0); factoryOrderEntity.setTurnStatus(0); - - // - - boolean save = factoryOrderService.save(factoryOrderEntity); if (!save) { log.error("############handleData: 保存订单失败 selfCode={}", selfCode); throw new CustomerException(403, "保存订单失败"); } + } + //保存订单成功,继续保存包件 Long orderId = factoryOrderEntity.getId(); String packageCode = packageEntity.getString("Code"); diff --git a/blade-service/logpm-factory/src/main/resources/application.yml b/blade-service/logpm-factory/src/main/resources/application.yml index 245dc4cfd..e5d26d37f 100644 --- a/blade-service/logpm-factory/src/main/resources/application.yml +++ b/blade-service/logpm-factory/src/main/resources/application.yml @@ -46,5 +46,5 @@ xxl: ip: 127.0.0.1 logpath: ../data/applogs/logpm-factory-xxljob/jobhandler logretentiondays: -1 - port: 7018 + port: 7019 diff --git a/blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java b/blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java index 1d5870c70..445b242a5 100644 --- a/blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java +++ b/blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java @@ -19,7 +19,9 @@ import com.logpm.factory.listener.OrderStatusLogListener; import com.logpm.factory.oupai.entity.FactoryPackageEntity; import com.logpm.factory.oupai.entity.OpOrderStatusLogEntity; import com.logpm.factory.oupai.service.IFactoryPackageService; +import com.logpm.factory.oupai.service.IOuPaiFactoryDataService; import com.logpm.factory.oupai.service.impl.OuPaiFactoryServiceImpl; +import com.logpm.factory.oupai.vo.OuPaiDataPushVO; import com.logpm.factory.pan.service.IPanFactoryDataService; import com.logpm.factory.props.ZbFactoryProperties; import com.logpm.factory.snm.bean.Resp; @@ -93,6 +95,9 @@ public class TestService { @Autowired private ZbFactoryProperties zbFactoryProperties; + @Autowired + private IOuPaiFactoryDataService ouPaiFactoryDataService; + @Autowired private ZbCategoryContrastMapper zbCategoryContrastMapper; @Test @@ -781,6 +786,31 @@ public class TestService { + } + + + @Test + public void test18(){ + + // 本地测试 推送服务器 + /** + * {"event":3,"key": + * "fdee4693-5321-4713-9ce8-aec9581011ec", + * "orderCode":"SH20231217-1053", + * "typeName":"ReceivingOrder", + * "warehouseName":"汇通南充仓"} + */ + OuPaiDataPushVO ouPaiDataPushVO = new OuPaiDataPushVO(); + ouPaiDataPushVO.setEvent(3); + ouPaiDataPushVO.setOrderCode("SH20231217-1053"); + ouPaiDataPushVO.setKey("fdee4693-5321-4713-9ce8-aec9581011ec"); + ouPaiDataPushVO.setTypeName("ReceivingOrder"); + ouPaiDataPushVO.setWarehouseName("汇通南充仓"); + + ouPaiFactoryDataService.saveData(ouPaiDataPushVO); + + + }