Browse Source

feat(all): 修改志邦回传逻辑

1 到达仓库节点由网点卸车确认换为卸车扫描
2 到达仓库节点一个发货车次一个订单一个操作只传一次
2 送货抵达节点由签收前自动推换为末端仓卸车确认
dist.1.3.0
zhaoqiaobo 9 months ago
parent
commit
a356188986
  1. 9
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/entity/ZbFactoryNodePushEntity.java
  2. 3
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/NodeNeedEnums.java
  3. 10
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/ZbomNodeMappingEnums.java
  4. 5
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mapper/OrderPackageMapper.java
  5. 8
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mapper/OrderPackageMapper.xml
  6. 44
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java
  7. 5
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/service/IOrderPackageService.java
  8. 9
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/service/impl/OrderPackageServiceImpl.java

9
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;
/**
* 仓库
*/

3
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, "末端仓卸车确认"),

10
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),
/**
* 在途 -- 三方中转发车
*/

5
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<ZbOrderPackageEntity> {
List<NodeDataDTO> findOrderCodebypackageCodes(@Param("packageList") List<String> packageCodeList);
List<NodeDataDTO> findOrderCodebypackageCodes(@Param("packageList") List<JSONObject> packageCodeList);
void updateSignForStatus(@Param("packageCodeList") List<String> packageCodeList);
List<NoSignNumberDTO> findNoSignNumber(@Param("packageCodeList") List<String> packageCodeList);
List<NoSignNumberDTO> findNoSignNumber(@Param("packageCodeList") List<JSONObject> packageCodeList);
List<OrderPackageDTO> findByPackageCodes(@Param("packageCodeList") List<String> packageCodeList);

8
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 (
<foreach collection="packageList" index="ind" item="item">
<if test="ind == 0">
select #{item} pid
select #{item.packageCode} pid
</if>
<if test="ind != 0">
union all
select #{item} pid
select #{item.packageCode} pid
</if>
</foreach>
) packageCodeIds where packageCodeIds.pid = t.package_code)
@ -51,11 +51,11 @@
select 1 from (
<foreach collection="packageCodeList" index="ind" item="item">
<if test="ind == 0">
select #{item} pid
select #{item.packageCode} pid
</if>
<if test="ind != 0">
union all
select #{item} pid
select #{item.packageCode} pid
</if>
</foreach>
) packageCodeIds where packageCodeIds.pid = tt.package_code)

44
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<String> packageCodeList = getBizData(entries);
if (CollUtil.isNotEmpty(packageCodeList)) {
// List<String> packageCodeList = getBizData(entries);
List<JSONObject> 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<NodeDataDTO> orders = orderPackageService.findOrderCodebypackageCodes(packageCodeList);
List<NodeDataDTO> orders = orderPackageService.findOrderCodebypackageCodes(content);
Map<String, NodeDataDTO> 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<String, NodeDataDTO> stringNodeDataDTOEntry : nodeDataMap.entrySet()) {
NodeDataDTO value = stringNodeDataDTOEntry.getValue();
// 卸车入库只发推一次
List<ZbFactoryNodePushEntity> list = nodePushService.list(Wrappers.<ZbFactoryNodePushEntity>lambdaQuery()
.eq(ZbFactoryNodePushEntity::getPlatformOrderCode, orderCode)
.eq(ZbFactoryNodePushEntity::getWorkNode, node)
.eq(ZbFactoryNodePushEntity::getWarehouseName, warehouseName)
.eq(ZbFactoryNodePushEntity::getDepartCode, value.getDepartCode())
);
// 已经推送过了就不再推了
if(CollUtil.isNotEmpty(list)){
return;
}
}
}
}
// 签收节点获取组装未签收数据
Map<String, Integer> noSignNumberMap = null;
if (EnumUtil.equals(WorkNodeEnums.CLERK_REVIEW, node)) {
noSignNumberMap = getNoSignNumber(packageCodeList);
noSignNumberMap = getNoSignNumber(content);
}
// 获取历史发送的节点数据
List<ZbFactoryNodeOrderEntity> 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<String, Integer> getNoSignNumber(List<String> packageCodeList) {
private Map<String, Integer> getNoSignNumber(List<JSONObject> content) {
// 根据运单号和自编码分组查询出未签收的数量
List<NoSignNumberDTO> noSignNumberDTOS = orderPackageService.findNoSignNumber(packageCodeList);
List<NoSignNumberDTO> noSignNumberDTOS = orderPackageService.findNoSignNumber(content);
log.info("未签收数据:{}", JSONUtil.toJsonStr(noSignNumberDTOS));
Map<String, Integer> noSignNumberMap = new HashMap<>();
if (CollUtil.isNotEmpty(noSignNumberDTOS)) {
@ -371,16 +395,16 @@ public class ZbomNodeDataPushListener {
}
@Nullable
private List<String> getBizData(JSONObject entries) {
private List<JSONObject> getBizData(JSONObject entries) {
List<JSONObject> content = entries.getBeanList("content", JSONObject.class);
List<String> packageCodeList = null;
List<JSONObject> 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);
}
}
}

5
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<ZbOrderPackageEntity> {
List<NodeDataDTO> findOrderCodebypackageCodes(List<String> packageCodeList);
List<NodeDataDTO> findOrderCodebypackageCodes(List<JSONObject> content);
void updateSignForStatus(List<String> packageCodeList);
List<NoSignNumberDTO> findNoSignNumber(List<String> packageCodeList);
List<NoSignNumberDTO> findNoSignNumber(List<JSONObject> content);
List<OrderPackageDTO> findByPackageCodes(List<String> packageCodeList);
}

9
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<OrderPackageMapper, ZbOrderPackageEntity> implements IOrderPackageService {
@Override
public List<NodeDataDTO> findOrderCodebypackageCodes(List<String> packageCodeList) {
List<NodeDataDTO> orders = this.baseMapper.findOrderCodebypackageCodes(packageCodeList);
public List<NodeDataDTO> findOrderCodebypackageCodes(List<JSONObject> content) {
List<NodeDataDTO> orders = this.baseMapper.findOrderCodebypackageCodes(content);
return orders;
}
@ -48,8 +49,8 @@ public class OrderPackageServiceImpl extends BaseServiceImpl<OrderPackageMapper,
}
@Override
public List<NoSignNumberDTO> findNoSignNumber(List<String> packageCodeList) {
return this.baseMapper.findNoSignNumber(packageCodeList);
public List<NoSignNumberDTO> findNoSignNumber(List<JSONObject> content) {
return this.baseMapper.findNoSignNumber(content);
}
@Override

Loading…
Cancel
Save