diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/entity/ZbFactoryNodePushEntity.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/entity/ZbFactoryNodePushEntity.java index a950762b8..2c07f146b 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/entity/ZbFactoryNodePushEntity.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/entity/ZbFactoryNodePushEntity.java @@ -61,10 +61,15 @@ public class ZbFactoryNodePushEntity extends BaseEntity { @ApiModelProperty(name = "加盟商单号", notes = "") private String platformOrderCode; /** - * 节点 + * 志邦节点 */ - @ApiModelProperty(name = "节点", notes = "") + @ApiModelProperty(name = "志邦节点", notes = "") private String node; + /** + * 节点 + */ + @ApiModelProperty(name = "物流节点", notes = "") + private String workNode; /** * 仓库 */ diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/NodeNeedEnums.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/NodeNeedEnums.java index 8099f1181..8bd6c2f95 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/NodeNeedEnums.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/NodeNeedEnums.java @@ -14,7 +14,8 @@ import java.io.Serializable; public enum NodeNeedEnums implements Serializable { INITIAL_WAREHOUSE_DEPART(103040, "始发仓发车"), - TRANSFER_WAREHOUSE_UNLOADING(105020, "中转仓卸车确认"), + UNLOAD_INCOMING_WAREHOUSE(105010,"卸车入库"), + // TRANSFER_WAREHOUSE_UNLOADING(105020, "中转仓卸车确认"), TRANSFER_WAREHOUSE_DEPART(103080, "中转仓发车"), SIGN_DIRECT_SHIPPER(105030,"直发商家签收"), END_WAREHOUSE_UNLOADING(105040, "末端仓卸车确认"), diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/ZbomNodeMappingEnums.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/ZbomNodeMappingEnums.java index 1c2217bc3..9fccefe1a 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/ZbomNodeMappingEnums.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/ZbomNodeMappingEnums.java @@ -19,17 +19,19 @@ public enum ZbomNodeMappingEnums { */ STATION_DEPART(ZbomNodeEnums.STATION_DEPART, WorkNodeEnums.INITIAL_WAREHOUSE_DEPART, 1), /** - * 在途 -- 中转仓卸货确认 + * 在途 -- 卸车入库 */ - INTRANSIT_UNLOADING(ZbomNodeEnums.INTRANSIT, WorkNodeEnums.TRANSFER_WAREHOUSE_UNLOADING, 1), + // INTRANSIT_UNLOADING(ZbomNodeEnums.INTRANSIT, WorkNodeEnums.TRANSFER_WAREHOUSE_UNLOADING, 1), + INTRANSIT_UNLOADING(ZbomNodeEnums.INTRANSIT, WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE, 1), /** * 在途 -- 中转仓发车 */ INTRANSIT(ZbomNodeEnums.INTRANSIT, WorkNodeEnums.TRANSFER_WAREHOUSE_DEPART, 1), /** - * 在途 -- 末端仓卸货确认 + * 送货抵达 -- 末端仓卸货确认 */ - DELIVERY_ARRIVAL(ZbomNodeEnums.INTRANSIT, WorkNodeEnums.END_WAREHOUSE_UNLOADING, 1), + DELIVERY_ARRIVAL(ZbomNodeEnums.DELIVERY_ARRIVAL, WorkNodeEnums.END_WAREHOUSE_UNLOADING, 1), + // DELIVERY_ARRIVAL(ZbomNodeEnums.INTRANSIT, WorkNodeEnums.END_WAREHOUSE_UNLOADING, 1), /** * 在途 -- 三方中转发车 */ diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mapper/OrderPackageMapper.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mapper/OrderPackageMapper.java index 0c41af4c6..cdfe7c3b7 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mapper/OrderPackageMapper.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mapper/OrderPackageMapper.java @@ -16,6 +16,7 @@ */ package com.logpm.factorydata.zbom.mapper; +import cn.hutool.json.JSONObject; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.logpm.factorydata.zbom.entity.ZbOrderPackageEntity; import com.logpm.factorydata.zbom.vo.NoSignNumberDTO; @@ -35,11 +36,11 @@ import java.util.List; @Mapper public interface OrderPackageMapper extends BaseMapper { - List findOrderCodebypackageCodes(@Param("packageList") List packageCodeList); + List findOrderCodebypackageCodes(@Param("packageList") List packageCodeList); void updateSignForStatus(@Param("packageCodeList") List packageCodeList); - List findNoSignNumber(@Param("packageCodeList") List packageCodeList); + List findNoSignNumber(@Param("packageCodeList") List packageCodeList); List findByPackageCodes(@Param("packageCodeList") List packageCodeList); diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mapper/OrderPackageMapper.xml b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mapper/OrderPackageMapper.xml index 07669e4c4..cc27af552 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mapper/OrderPackageMapper.xml +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mapper/OrderPackageMapper.xml @@ -27,11 +27,11 @@ select 1 from ( - select #{item} pid + select #{item.packageCode} pid union all - select #{item} pid + select #{item.packageCode} pid ) packageCodeIds where packageCodeIds.pid = t.package_code) @@ -51,11 +51,11 @@ select 1 from ( - select #{item} pid + select #{item.packageCode} pid union all - select #{item} pid + select #{item.packageCode} pid ) packageCodeIds where packageCodeIds.pid = tt.package_code) diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java index a5f694dd9..9f60b4c4e 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java @@ -8,6 +8,7 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.factorydata.enums.BrandEnums; import com.logpm.factorydata.feign.IFactoryDataClient; import com.logpm.factorydata.vo.NodePushMsg; @@ -102,23 +103,44 @@ public class ZbomNodeDataPushListener { String node = entries.getStr("node"); WorkNodeEnums workNodeEnums = EnumUtil.fromString(WorkNodeEnums.class, node); // 2 获取业务数据 - List packageCodeList = getBizData(entries); - if (CollUtil.isNotEmpty(packageCodeList)) { + // List packageCodeList = getBizData(entries); + List content = entries.getBeanList("content", JSONObject.class); + if (CollUtil.isNotEmpty(content)) { + String warehouseName = content.get(0).getStr("warehouseName"); + String orderCode = content.get(0).getStr("orderCode"); // 根据运单号和自编码分组查询出对应的数量 - List orders = orderPackageService.findOrderCodebypackageCodes(packageCodeList); + List orders = orderPackageService.findOrderCodebypackageCodes(content); Map nodeDataMap = new HashMap<>(); if (CollUtil.isNotEmpty(orders)) { for (NodeDataDTO order : orders) { nodeDataMap.put(order.getDepartCode() + order.getPlatformOrderCode(), order); } } else { - log.error("【{}】节点【{}】未查到数据", StrUtil.toString(packageCodeList), node); + log.error("【{}】节点【{}】未查到数据", StrUtil.toString(content), node); return; } + if (CollUtil.isNotEmpty(nodeDataMap)) { + if (StrUtil.equals(node, NodeNeedEnums.UNLOAD_INCOMING_WAREHOUSE.getValue())) { + for (Map.Entry stringNodeDataDTOEntry : nodeDataMap.entrySet()) { + NodeDataDTO value = stringNodeDataDTOEntry.getValue(); + // 卸车入库只发推一次 + List list = nodePushService.list(Wrappers.lambdaQuery() + .eq(ZbFactoryNodePushEntity::getPlatformOrderCode, orderCode) + .eq(ZbFactoryNodePushEntity::getWorkNode, node) + .eq(ZbFactoryNodePushEntity::getWarehouseName, warehouseName) + .eq(ZbFactoryNodePushEntity::getDepartCode, value.getDepartCode()) + ); + // 已经推送过了就不再推了 + if(CollUtil.isNotEmpty(list)){ + return; + } + } + } + } // 签收节点获取组装未签收数据 Map noSignNumberMap = null; if (EnumUtil.equals(WorkNodeEnums.CLERK_REVIEW, node)) { - noSignNumberMap = getNoSignNumber(packageCodeList); + noSignNumberMap = getNoSignNumber(content); } // 获取历史发送的节点数据 List nodeOrderEntities = nodeOrderService.findHistoryNodeOrder(orders); @@ -178,6 +200,8 @@ public class ZbomNodeDataPushListener { .departCode(nodeConfirmParam.getDepartCode()) .platformOrderCode(nodeConfirmParam.getPlatformOrderCode()) .node(nodeConfirmParam.getNode()) + .workNode(node) + .warehouseName(warehouseName) .packageCode(packageCode) .content(body) .resultContent(result) @@ -357,9 +381,9 @@ public class ZbomNodeDataPushListener { } @NotNull - private Map getNoSignNumber(List packageCodeList) { + private Map getNoSignNumber(List content) { // 根据运单号和自编码分组查询出未签收的数量 - List noSignNumberDTOS = orderPackageService.findNoSignNumber(packageCodeList); + List noSignNumberDTOS = orderPackageService.findNoSignNumber(content); log.info("未签收数据:{}", JSONUtil.toJsonStr(noSignNumberDTOS)); Map noSignNumberMap = new HashMap<>(); if (CollUtil.isNotEmpty(noSignNumberDTOS)) { @@ -371,16 +395,16 @@ public class ZbomNodeDataPushListener { } @Nullable - private List getBizData(JSONObject entries) { + private List getBizData(JSONObject entries) { List content = entries.getBeanList("content", JSONObject.class); - List packageCodeList = null; + List packageCodeList = null; if (CollUtil.isNotEmpty(content)) { // 查询这次操作的所有包件和运单号 packageCodeList = new ArrayList<>(); for (JSONObject obj : content) { String packageCode = obj.getStr("packageCode"); if (StrUtil.isNotBlank(packageCode)) { - packageCodeList.add(packageCode); + // packageCodeList.add(packageCode); } } } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/service/IOrderPackageService.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/service/IOrderPackageService.java index ca4e7cf9c..e73b65609 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/service/IOrderPackageService.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/service/IOrderPackageService.java @@ -16,6 +16,7 @@ */ package com.logpm.factorydata.zbom.service; +import cn.hutool.json.JSONObject; import com.logpm.factorydata.zbom.entity.ZbOrderPackageEntity; import com.logpm.factorydata.zbom.vo.NoSignNumberDTO; import com.logpm.factorydata.zbom.vo.OrderPackageDTO; @@ -32,11 +33,11 @@ import java.util.List; */ public interface IOrderPackageService extends BaseService { - List findOrderCodebypackageCodes(List packageCodeList); + List findOrderCodebypackageCodes(List content); void updateSignForStatus(List packageCodeList); - List findNoSignNumber(List packageCodeList); + List findNoSignNumber(List content); List findByPackageCodes(List packageCodeList); } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/service/impl/OrderPackageServiceImpl.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/service/impl/OrderPackageServiceImpl.java index 71b8b1657..2627ca6af 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/service/impl/OrderPackageServiceImpl.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/service/impl/OrderPackageServiceImpl.java @@ -16,6 +16,7 @@ */ package com.logpm.factorydata.zbom.service.impl; +import cn.hutool.json.JSONObject; import com.logpm.factorydata.zbom.entity.ZbOrderPackageEntity; import com.logpm.factorydata.zbom.mapper.OrderPackageMapper; import com.logpm.factorydata.zbom.service.IOrderPackageService; @@ -37,8 +38,8 @@ import java.util.List; public class OrderPackageServiceImpl extends BaseServiceImpl implements IOrderPackageService { @Override - public List findOrderCodebypackageCodes(List packageCodeList) { - List orders = this.baseMapper.findOrderCodebypackageCodes(packageCodeList); + public List findOrderCodebypackageCodes(List content) { + List orders = this.baseMapper.findOrderCodebypackageCodes(content); return orders; } @@ -48,8 +49,8 @@ public class OrderPackageServiceImpl extends BaseServiceImpl findNoSignNumber(List packageCodeList) { - return this.baseMapper.findNoSignNumber(packageCodeList); + public List findNoSignNumber(List content) { + return this.baseMapper.findNoSignNumber(content); } @Override