Browse Source

feat(all): 我乐工厂

1 修改我乐工厂回传逻辑
pre-production
zhaoqiaobo 1 week ago
parent
commit
605d5137e1
  1. 5
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/entity/FactoryNodePushEntity.java
  2. 20
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java

5
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 = "订单号") @ApiModelProperty(value = "订单号")
private String orderCode; private String orderCode;
/**
* 包条码
*/
@ApiModelProperty(value = "包条码")
private String packageCode;
/** /**
* 运单号 * 运单号
*/ */

20
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java

@ -173,11 +173,17 @@ public class NodeDataPushListener {
// value 按包件分组 包含则数量+1 // value 按包件分组 包含则数量+1
// 分拨中心回传所有包件,其他节点回传当前操作的包件 // 分拨中心回传所有包件,其他节点回传当前操作的包件
if (isArrival) { if (isArrival) {
List<DeliveryNoteEntity> collect2 = factoryList.stream() // List<DeliveryNoteEntity> collect2 = factoryList.stream()
.filter(data -> data.getCrmSo().equals(orderCode)) // .filter(data -> data.getCrmSo().equals(orderCode))
.filter(data -> data.getShipmentSplitNo().equals(shipmentSplitNo)) // .filter(data -> data.getShipmentSplitNo().equals(shipmentSplitNo))
.collect(Collectors.toList()); // .collect(Collectors.toList());
snMap = collect2.stream().collect(Collectors.toMap(DeliveryNoteEntity::getSn, s -> Convert.toInt(s.getQty()))); List<DeliveryNoteEntity> checkList = deliveryNoteService.list(Wrappers.<DeliveryNoteEntity>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() FactoryNodePushEntity entity1 = FactoryNodePushEntity.builder()
.orderCode(orderCode).statusName(needSendNode.getStatus()).opTime(entries.getStr("operatorTime")).content(needSendNode.getValue()) .orderCode(orderCode).statusName(needSendNode.getStatus()).opTime(entries.getStr("operatorTime")).content(needSendNode.getValue())
.waybillCode(waybillNumber).siteLevel(needSendNode.getSiteLecel(isArrival)).warehouse(sendData.getWarehouseName()) .waybillCode(waybillNumber).siteLevel(needSendNode.getSiteLecel(isArrival)).warehouse(sendData.getWarehouseName())
@ -186,9 +192,11 @@ public class NodeDataPushListener {
.receivable(0).receipts(0) .receivable(0).receipts(0)
.type(needSendNode.getValue()) .type(needSendNode.getValue())
.typeCode(needSendNode.getCode()) .typeCode(needSendNode.getCode())
.packageCode(deliveryNoteEntity.getSn())
.build(); .build();
pushEntities.add(entity1); pushEntities.add(entity1);
factoryNodeAllPushEntity.setPackageCode(collect2.stream().map(DeliveryNoteEntity::getSn).collect(Collectors.joining(","))); }
factoryNodeAllPushEntity.setPackageCode(checkList.stream().map(DeliveryNoteEntity::getSn).collect(Collectors.joining(",")));
} else { } else {
for (PushData data : value) { for (PushData data : value) {
if (snMap.containsKey(data.getPackageCode())) { if (snMap.containsKey(data.getPackageCode())) {

Loading…
Cancel
Save