From 605d5137e1ed581fccbb67262741d0ff8dd1e367 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Wed, 26 Mar 2025 16:25:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E6=88=91=E4=B9=90=E5=B7=A5?= =?UTF-8?q?=E5=8E=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 修改我乐工厂回传逻辑 --- .../olo/entity/FactoryNodePushEntity.java | 5 +++ .../olo/mq/NodeDataPushListener.java | 40 +++++++++++-------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/entity/FactoryNodePushEntity.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/entity/FactoryNodePushEntity.java index 11b05d506..005076a28 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/entity/FactoryNodePushEntity.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/entity/FactoryNodePushEntity.java @@ -79,6 +79,11 @@ public class FactoryNodePushEntity extends BaseEntity { */ @ApiModelProperty(value = "订单号") private String orderCode; + /** + * 包条码 + */ + @ApiModelProperty(value = "包条码") + private String packageCode; /** * 运单号 */ diff --git a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java index 4b9d6061f..847565949 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java @@ -173,22 +173,30 @@ public class NodeDataPushListener { // value 按包件分组 包含则数量+1 // 分拨中心回传所有包件,其他节点回传当前操作的包件 if (isArrival) { - List collect2 = factoryList.stream() - .filter(data -> data.getCrmSo().equals(orderCode)) - .filter(data -> data.getShipmentSplitNo().equals(shipmentSplitNo)) - .collect(Collectors.toList()); - snMap = collect2.stream().collect(Collectors.toMap(DeliveryNoteEntity::getSn, s -> Convert.toInt(s.getQty()))); - FactoryNodePushEntity entity1 = FactoryNodePushEntity.builder() - .orderCode(orderCode).statusName(needSendNode.getStatus()).opTime(entries.getStr("operatorTime")).content(needSendNode.getValue()) - .waybillCode(waybillNumber).siteLevel(needSendNode.getSiteLecel(isArrival)).warehouse(sendData.getWarehouseName()) - .receiveOrSend(needSendNode.getReceiveOrSend()) - .shipmentSpitCode(shipmentSplitNo).shipmentCode(collect.get(sendData.getPackageCode() + sendData.getOrderCode()).get(0).getShipmentNo()) - .receivable(0).receipts(0) - .type(needSendNode.getValue()) - .typeCode(needSendNode.getCode()) - .build(); - pushEntities.add(entity1); - factoryNodeAllPushEntity.setPackageCode(collect2.stream().map(DeliveryNoteEntity::getSn).collect(Collectors.joining(","))); + // List collect2 = factoryList.stream() + // .filter(data -> data.getCrmSo().equals(orderCode)) + // .filter(data -> data.getShipmentSplitNo().equals(shipmentSplitNo)) + // .collect(Collectors.toList()); + List checkList = deliveryNoteService.list(Wrappers.lambdaQuery() + .select(DeliveryNoteEntity::getSn, DeliveryNoteEntity::getQty) + .eq(DeliveryNoteEntity::getShipmentSplitNo, shipmentSplitNo) + .eq(DeliveryNoteEntity::getCrmSo, orderCode) + ); + snMap = checkList.stream().collect(Collectors.toMap(DeliveryNoteEntity::getSn, s -> Convert.toInt(s.getQty()))); + for (DeliveryNoteEntity deliveryNoteEntity : checkList) { + FactoryNodePushEntity entity1 = FactoryNodePushEntity.builder() + .orderCode(orderCode).statusName(needSendNode.getStatus()).opTime(entries.getStr("operatorTime")).content(needSendNode.getValue()) + .waybillCode(waybillNumber).siteLevel(needSendNode.getSiteLecel(isArrival)).warehouse(sendData.getWarehouseName()) + .receiveOrSend(needSendNode.getReceiveOrSend()) + .shipmentSpitCode(shipmentSplitNo).shipmentCode(collect.get(sendData.getPackageCode() + sendData.getOrderCode()).get(0).getShipmentNo()) + .receivable(0).receipts(0) + .type(needSendNode.getValue()) + .typeCode(needSendNode.getCode()) + .packageCode(deliveryNoteEntity.getSn()) + .build(); + pushEntities.add(entity1); + } + factoryNodeAllPushEntity.setPackageCode(checkList.stream().map(DeliveryNoteEntity::getSn).collect(Collectors.joining(","))); } else { for (PushData data : value) { if (snMap.containsKey(data.getPackageCode())) {