diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java index d29087cf2..96afda9b4 100644 --- a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java @@ -173,47 +173,58 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { if (signListByWaybillNumber != null && !signListByWaybillNumber.isEmpty()) { //统计装车数量load_num - int loadNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getLoadNum).sum(); + int loadNum = signListByWaybillNumber.stream().filter(e -> e.getLoadNum() !=null).mapToInt(QualityDeliverEntity::getLoadNum).sum(); // 计划配送数 plan_num - int planNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getPlanNum).sum(); + int planNum = signListByWaybillNumber.stream().filter(e-> e.getPlanNum()!=null).mapToInt(QualityDeliverEntity::getPlanNum).sum(); // 计算签收数量sign_num - int signNum = signListByWaybillNumber.stream().mapToInt(QualityDeliverEntity::getSignNum).sum(); + int signNum = signListByWaybillNumber.stream().filter(e-> e.getSignNum()!=null).mapToInt(QualityDeliverEntity::getSignNum).sum(); // 配送装车 - QualityDeliverEntity qualityDeliverEntity = signListByWaybillNumber.get(0); if (loadNum != 0) { - nodeInfoVO = new NodeInfoVO(); - nodeInfoVO.setOperateName("配送装车"); - nodeInfoVO.setOperateNumber(loadNum + ""); - nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName()); - nodeInfoVO.setOperateTime(qualityDeliverEntity.getCreateTime()); - // 增加网点电话 - BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(qualityDeliverEntity.getWarehouseId()); - if (entityWarehouseId != null) { - nodeInfoVO.setOperateWarehousePhone(entityWarehouseId.getContactNumber()); + QualityDeliverEntity qualityDeliverEntity = signListByWaybillNumber.stream().filter(e -> e.getLoadTime() != null).findFirst().orElse(null); + if(qualityDeliverEntity != null){ + nodeInfoVO = new NodeInfoVO(); + nodeInfoVO.setOperateName("配送装车"); + nodeInfoVO.setOperateNumber(loadNum + ""); + nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName()); + nodeInfoVO.setOperateTime(qualityDeliverEntity.getLoadTime()); + // 增加网点电话 + BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(qualityDeliverEntity.getWarehouseId()); + if (entityWarehouseId != null) { + nodeInfoVO.setOperateWarehousePhone(entityWarehouseId.getContactNumber()); + } + + nodeInfoVOList.add(nodeInfoVO); } - nodeInfoVOList.add(nodeInfoVO); } - if (planNum != 0) { - nodeInfoVO = new NodeInfoVO(); - nodeInfoVO.setOperateName("配送签收"); - nodeInfoVO.setOperateNumber(signNum + "/" + loadNum); - nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName()); - nodeInfoVO.setOperateTime(qualityDeliverEntity.getCreateTime()); - // 增加网点电话 - BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(qualityDeliverEntity.getWarehouseId()); - if (entityWarehouseId != null) { - nodeInfoVO.setOperateWarehousePhone(entityWarehouseId.getContactNumber()); + if (signNum != 0) { + + QualityDeliverEntity qualityDeliverEntity = signListByWaybillNumber.stream().filter(e -> e.getSignTime() != null).findFirst().orElse(null); + + if(qualityDeliverEntity != null){ + nodeInfoVO = new NodeInfoVO(); + nodeInfoVO.setOperateName("配送签收"); + nodeInfoVO.setOperateNumber(signNum + "/" + loadNum); + nodeInfoVO.setOperateWarehouseName(qualityDeliverEntity.getWarehouseName()); + nodeInfoVO.setOperateTime(qualityDeliverEntity.getSignTime()); + // 增加网点电话 + BasicdataWarehouseEntity entityWarehouseId = basicdataWarehouseClient.getEntityWarehouseId(qualityDeliverEntity.getWarehouseId()); + if (entityWarehouseId != null) { + nodeInfoVO.setOperateWarehousePhone(entityWarehouseId.getContactNumber()); + } + nodeInfoVOList.add(nodeInfoVO); } - nodeInfoVOList.add(nodeInfoVO); + } } + //对nodeInfoVOList集合中的作业时间 按照 时间倒序排序 + nodeInfoVOList.sort(Comparator.comparing(NodeInfoVO::getOperateTime).reversed()); result.setNodeInfoVOList(nodeInfoVOList); // 配送签收 @@ -372,6 +383,13 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { } + + + //对nodeInfoVOList集合中的作业时间 按照 时间倒序排序 + nodeInfoVOList.sort(Comparator.comparing(NodeInfoVO::getOperateTime).reversed()); + + + result.setNodeInfoVOList(nodeInfoVOList); // 配送签收 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java index 9d8cc30d7..424d97e50 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java @@ -495,4 +495,6 @@ public interface DistributionSignforMapper extends BaseMapper + + + UPDATE logpm_distribution_signfor SET + signee_name = #{user.nickName}, + signee_id = #{user.userId}, + received_quantity = ( received_quantity + #{nub} ) + WHERE + is_deleted =0 and delivery_id = #{deliveryId} and reservation_id = #{reservationId} + + DELETE FROM logpm_distribution_signfor diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 32706b204..b11d4c9db 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -10641,7 +10641,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId); @@ -3894,16 +3896,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl 0) { - reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); + updateEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); } if (loadingNum == 0) { - reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); + updateEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); } } } @@ -3912,28 +3914,28 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl 0) { - reservationEntity.setSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getValue()); + updateEntity.setSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getValue()); } if (signingNum == 0) { - reservationEntity.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); + updateEntity.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); } if (stockUpStatus) { - reservationEntity.setStockStatus(ReservationStockupStatusConstant.yibeihuo.getValue()); + updateEntity.setStockStatus(ReservationStockupStatusConstant.yibeihuo.getValue()); } else { //判断是否都为完成签收 Integer stockNum = distributionStockMapper.selectStockNumByReservationId(reservationId); //判断当前客户是否签收完成了 if (stockNum > 0) { - reservationEntity.setStockStatus(ReservationStockupStatusConstant.daibeihuo.getValue()); + updateEntity.setStockStatus(ReservationStockupStatusConstant.daibeihuo.getValue()); } else { - reservationEntity.setStockStatus(ReservationStockupStatusConstant.weibeihuo.getValue()); + updateEntity.setStockStatus(ReservationStockupStatusConstant.weibeihuo.getValue()); } } if ((reservationEntity.getReservationNum() + reservationEntity.getReservationStockListNum()) == 0) { - reservationEntity.setReservationStatus(ReservationStatusConstant.yiquexiao.getValue()); + updateEntity.setReservationStatus(ReservationStatusConstant.yiquexiao.getValue()); } - this.updateById(reservationEntity); + this.updateById(updateEntity); } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index fd5b1563c..97a14bcea 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -4377,10 +4377,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl rePush(String param) throws Exception { + // 查出数据,回推工厂 + List list = factoryNodePushService.list(Wrappers.lambdaQuery() + .eq(FactoryNodePushEntity::getReserve1, "0").last(" limit 1")); + if (CollUtil.isNotEmpty(list)) { + FactoryNodePushEntity factoryNodePushEntity = list.get(0); + String content = factoryNodePushEntity.getContent(); + JSONObject entries = JSONUtil.parseObj(content); + entries.set("passSite", entries.getStr("endSite")); + entries.set("sendSite", entries.getStr("endSite")); + String url = jinPaiProperties.getOldSystemHost() + jinPaiProperties.getOldSystemArrivedUrl(); + log.info("字段缺失重新推送:{}", JSONUtil.toJsonStr(entries)); + String result = HttpUtil.post(url, JSONUtil.toJsonStr(entries)); + FactoryNodePushEntity factoryNodePushEntity1 = new FactoryNodePushEntity(); + factoryNodePushEntity1.setContent(JSONUtil.toJsonStr(entries)); + factoryNodePushEntity1.setId(factoryNodePushEntity.getId()); + factoryNodePushEntity1.setReserve1("1"); + factoryNodePushEntity1.setResultContent(result); + factoryNodePushService.updateById(factoryNodePushEntity1); + List list1 = factoryNodePushService.list(Wrappers.lambdaQuery() + .eq(FactoryNodePushEntity::getTransportNo, factoryNodePushEntity.getTransportNo()) + .eq(FactoryNodePushEntity::getOrderCode, factoryNodePushEntity.getOrderCode())); + if(CollUtil.isNotEmpty(list1)){ + for (FactoryNodePushEntity nodePushEntity : list1) { + String content1 = nodePushEntity.getContent(); + String url1 = jinPaiProperties.getOldSystemHost() + jinPaiProperties.getOldSystemAlreadyStockedUrl(); + log.info("字段缺失重新推送:{}", JSONUtil.toJsonStr(entries)); + String result1 = HttpUtil.post(url1, content1); + FactoryNodePushEntity factoryNodePushEntity2 = new FactoryNodePushEntity(); + factoryNodePushEntity2.setResultContent(result1); + factoryNodePushEntity2.setId(nodePushEntity.getId()); + factoryNodePushService.updateById(factoryNodePushEntity2); + } + } + } + return ReturnT.SUCCESS; + } + } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/NodeDataPushListener.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/NodeDataPushListener.java index 4369248d9..443ff971e 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/NodeDataPushListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/NodeDataPushListener.java @@ -250,9 +250,17 @@ public class NodeDataPushListener { js.set("doType", 32); js.set("doLocation", ""); js.set("doTime", entries.getStr("operatorTime")); - js.set("sendSite", filterDatum.getWaybillStartWarehouse()); + if (StrUtil.isNotEmpty(filterDatum.getWaybillStartWarehouse())) { + js.set("sendSite", filterDatum.getWaybillStartWarehouse()); + } else { + js.set("sendSite", filterDatum.getWarehouseName()); + } js.set("endSite", filterDatum.getWarehouseName()); - js.set("passSite", filterDatum.getDestinationWarehouse()); + if (StrUtil.isNotEmpty(filterDatum.getDestinationWarehouse())) { + js.set("passSite", filterDatum.getDestinationWarehouse()); + } else { + js.set("passSite", filterDatum.getWarehouseName()); + } js.set("doRemark", ""); js.set("reqSn", (RandomUtil.randomLong(100000000000000000L, 999999999999999999L)) + ""); js.set("syscode", "huitong"); @@ -297,9 +305,9 @@ public class NodeDataPushListener { .content(objects) .build(); factoryDataClient.sendMessage(SendMsg.builder() - .exchange(FactoryDataConstants.Mq.Exchanges.NODE_DATA_PUSH_DELAYED) - .routingKey(FactoryDataConstants.Mq.RoutingKeys.JP_NODE_DATA_PUSH) - .message(JSONUtil.toJsonStr(nodePushMsg, HutoolConfigUtil.jsonConfigByDataTimeFormat())) + .exchange(FactoryDataConstants.Mq.Exchanges.NODE_DATA_PUSH_DELAYED) + .routingKey(FactoryDataConstants.Mq.RoutingKeys.JP_NODE_DATA_PUSH) + .message(JSONUtil.toJsonStr(nodePushMsg, HutoolConfigUtil.jsonConfigByDataTimeFormat())) // 30-109秒随机 .delay(1000 * RandomUtil.randomInt(30, 110)) .build()); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java index cbd594d5d..dc3f75a02 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java @@ -108,6 +108,8 @@ public class AdvanceOrderMqServiceImpl implements IAdvanceOrderMqService { advanceEntity.setCreateUserName(AuthUtil.getNickName()); advanceService.save(advanceEntity); } else { + advanceEntity.setWaybillStatus(null); + advanceEntity.setWaybillNo(null); advanceService.updateById(advanceEntity); } } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 1bc8508a8..deb195aea 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -802,6 +802,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { //绑定订单和运单的关系 List advanceEntityList = advanceService.findListByIds(advanceIds); List waybillOrderEntities = new ArrayList<>(); + List updateAdvanceEntityList = new ArrayList<>(); Set orderCodeSet = new HashSet<>(); for (TrunklineAdvanceEntity advanceEntity : advanceEntityList) { orderCodeSet.add(advanceEntity.getOrderCode()); @@ -824,13 +825,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillOrderEntities.add(waybillOrderEntity); // orderCodes.add(advanceEntity.getOrderCode()); - advanceEntity.setWaybillStatus("1"); - advanceEntity.setWaybillNo(waybillNo); + TrunklineAdvanceEntity updateAdvanceEntity = new TrunklineAdvanceEntity(); + updateAdvanceEntity.setId(advanceId); + updateAdvanceEntity.setWaybillStatus("1"); + updateAdvanceEntity.setWaybillNo(waybillNo); + updateAdvanceEntityList.add(updateAdvanceEntity); } trunklineWaybillOrderService.saveBatch(waybillOrderEntities); //修改暂存单的状态为已开单 - advanceService.updateBatchById(advanceEntityList); + advanceService.updateBatchById(updateAdvanceEntityList); //更新暂存单包件的运单信息