Browse Source

Merge remote-tracking branch 'origin/pre-production'

master
zhenghaoyu 3 days ago
parent
commit
ea28a0b402
  1. 14
      blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java
  2. 1
      blade-biz-common/src/main/java/org/springblade/common/enums/BizOperationEnums.java
  3. 57
      blade-biz-common/src/main/java/org/springblade/common/model/AbnormalPackageVO.java
  4. 2
      blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java
  5. 1
      blade-biz-common/src/main/java/org/springblade/common/model/ReservationVO.java
  6. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionNodeWorkService.java
  7. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java
  8. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  9. 43
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  10. 30
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java
  11. 36
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml
  12. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java
  13. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

14
blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java

@ -421,6 +421,20 @@ public abstract class FanoutConstants {
} }
} }
/**
* 异常审核
* @see org.springblade.common.model.ReservationVO
*/
interface DeliveryAbnormalReview {
String EXCHANGE = "fanout.distribution.abnormal " + ModuleNameConstant.DEVAUTH;
interface QUEUE {
String REPORT = "fanout.distribution.DeliveryAbnormalReview.report" + ModuleNameConstant.DEVAUTH;
}
}
} }

1
blade-biz-common/src/main/java/org/springblade/common/enums/BizOperationEnums.java

@ -14,6 +14,7 @@ public enum BizOperationEnums implements IDict<Integer> {
MODIFY(2, "修改"), MODIFY(2, "修改"),
DELETE(3, "删除"), DELETE(3, "删除"),
REMOVE(4, "移除"), REMOVE(4, "移除"),
ABNORMAL(5, "异常"),
; ;
BizOperationEnums(Integer code, String value) { BizOperationEnums(Integer code, String value) {

57
blade-biz-common/src/main/java/org/springblade/common/model/AbnormalPackageVO.java

@ -0,0 +1,57 @@
package org.springblade.common.model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springblade.common.enums.PackageTypeEnums;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 提送数据
*
* @author zhaoqiaobo
* @create 2024-03-18 0:45
*/
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AbnormalPackageVO implements Serializable {
/**
* 审核状态 1-未审核 2-已审核 3-已驳回 4-已取消 5 - 拒签
*/
private Integer auditingStatus;
/**
* 包条码
*/
private String packageCode;
/**
* 车次号
*/
private String trainNumber;
/**
* 异常类型 1-装车异常(计划内 未装车)
* 2-计划异常(计划外进行装车)
* 3-签收异常(计划外未装车进行签收)
* 4-异常签收失败(满足异常签收但是进行拒签)
* 5-取消异常计划取消此次配送计划
*/
private Integer abnormalType;
/**
* 操作时间
*/
private Date auditingTime;
/**
* 审核操作人
*/
private String auditingUser;
private ReservationVO reservationVO;
}

2
blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java

@ -162,5 +162,7 @@ public class PackageData implements Serializable {
private Long finalNodeId; private Long finalNodeId;
private String finalNodeName; private String finalNodeName;
private Integer examine;
} }

1
blade-biz-common/src/main/java/org/springblade/common/model/ReservationVO.java

@ -86,4 +86,5 @@ public class ReservationVO {
} }

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionNodeWorkService.java

@ -144,4 +144,10 @@ public interface IDistributionNodeWorkService {
*/ */
void fail(); void fail();
/**
* 异常签收
*/
void abnormalDeliveryAbnormalReview(NodeFanoutMsg<AbnormalPackageVO> nodeFanoutMsg, BladeUser user);
} }

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java

@ -12,16 +12,7 @@ import com.logpm.factorydata.vo.PushData;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.WorkNodeEnums; import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.broadcast.FanoutConstants; import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.model.CarStartVO; import org.springblade.common.model.*;
import org.springblade.common.model.ConsigneeArriveVO;
import org.springblade.common.model.DistributionLoadVO;
import org.springblade.common.model.DistributionReCheckSignVO;
import org.springblade.common.model.DistributionSignforVO;
import org.springblade.common.model.DistributionTaskVO;
import org.springblade.common.model.FanoutMsg;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.ReservationVO;
import org.springblade.common.model.StockUpVO;
import org.springblade.common.model.workNode.DeliveryOfPickupPlanVO; import org.springblade.common.model.workNode.DeliveryOfPickupPlanVO;
import org.springblade.common.model.workNode.FinishDistributionTrainVO; import org.springblade.common.model.workNode.FinishDistributionTrainVO;
import org.springblade.common.model.workNode.PickUpByReCheckVO; import org.springblade.common.model.workNode.PickUpByReCheckVO;
@ -275,6 +266,17 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
} }
@Override
public void abnormalDeliveryAbnormalReview(NodeFanoutMsg<AbnormalPackageVO> nodeFanoutMsg, BladeUser user) {
try {
if (distributionProperties.getSendFanoutMsg()) {
rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryAbnormalReview.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
}
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", e);
}
}
@Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(value = 3000, multiplier = 1.5)) @Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(value = 3000, multiplier = 1.5))
private void sendFanoutMsg(FanoutMsg fanoutMsg) { private void sendFanoutMsg(FanoutMsg fanoutMsg) {

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -3686,6 +3686,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
packageData.setPackageCode(distributionReservationPackageEntity.getPacketBarCode()); packageData.setPackageCode(distributionReservationPackageEntity.getPacketBarCode());
packageData.setPackageType(PackageTypeEnums.CMP); packageData.setPackageType(PackageTypeEnums.CMP);
packageData.setNumber(1); packageData.setNumber(1);
packageData.setExamine(1);
packageDataList.add(packageData); packageDataList.add(packageData);
} }
} }
@ -3710,7 +3711,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
packageData.setWaybillNumber(byId.getWaybillNumber()); packageData.setWaybillNumber(byId.getWaybillNumber());
} }
packageData.setProductName(distributionReservationZeroPackageEntity.getCategoryName()); packageData.setProductName(distributionReservationZeroPackageEntity.getCategoryName());
packageDataList.add(packageData); packageDataList.add(packageData);
} }
} }

43
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -6881,8 +6881,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionReservationPackageService.save(reservationPackageEntity); distributionReservationPackageService.save(reservationPackageEntity);
Map<String, List> map = new HashMap<>(); Map<String, List> map = new HashMap<>();
map.put("1", Collections.singletonList(reservationPackageEntity)); map.put("1", Collections.singletonList(reservationPackageEntity));
NodeFanoutMsg<ReservationVO> nodeFanoutMsg = distributionReservationService.buildNodeFanoutMsgByReservation(reservationEntity, map, BizOperationEnums.ADD); NodeFanoutMsg<AbnormalPackageVO> nodeFanoutMsg = buildNodeFanoutMsgByAbnormalPackage(reservationEntity, map,distributionLoadscanAbnormalEntity);
distributionNodeWorkService.planReservation(nodeFanoutMsg,AuthUtil.getUser()); distributionNodeWorkService.abnormalDeliveryAbnormalReview(nodeFanoutMsg,AuthUtil.getUser());
//维护包件的预约状态 //维护包件的预约状态
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(distributionLoadscanAbnormalEntity.getPackageId()); DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(distributionLoadscanAbnormalEntity.getPackageId());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
@ -6902,6 +6902,45 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
trunklinePackageTrackLogClient.addPackageTrackLog(logList); trunklinePackageTrackLogClient.addPackageTrackLog(logList);
} }
private NodeFanoutMsg<AbnormalPackageVO> buildNodeFanoutMsgByAbnormalPackage(DistributionReservationEntity reservationEntity, Map<String, List> map,DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity) {
NodeFanoutMsg<AbnormalPackageVO> nodeFanoutMsg = new NodeFanoutMsg();
if (LoadingAbnormalTypeConstant.jihuayichang.getValue().equals(distributionLoadscanAbnormalEntity.getAbnormalType())){
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_ABNORMAL_LOADING);
}else if (LoadingAbnormalTypeConstant.qianshouyichang.getValue().equals(distributionLoadscanAbnormalEntity.getAbnormalType())){
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR);
}else {
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_ABNORMAL_LOADING);
}
nodeFanoutMsg.setNode(WorkNodeEnums.PLANNED_RESERVATION);
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setWarehouse(reservationEntity.getWarehouseName());
nodeFanoutMsg.setWarehouseId(reservationEntity.getWarehouseId());
nodeFanoutMsg.setTenantId(AuthUtil.getTenantId());
AbnormalPackageVO abnormalPackageVO = new AbnormalPackageVO();
abnormalPackageVO.setAbnormalType(distributionLoadscanAbnormalEntity.getAbnormalType());
abnormalPackageVO.setPackageCode(distributionLoadscanAbnormalEntity.getPackageCode());
abnormalPackageVO.setTrainNumber(distributionLoadscanAbnormalEntity.getTrainNumber());
abnormalPackageVO.setAuditingTime(distributionLoadscanAbnormalEntity.getAuditingTime());
abnormalPackageVO.setAuditingStatus(distributionLoadscanAbnormalEntity.getAuditingStatus());
abnormalPackageVO.setAuditingUser(distributionLoadscanAbnormalEntity.getAuditingUser());
ReservationVO reservationVO = distributionReservationService.getReservationVO(reservationEntity);
List<PackageData> packageDataList = new ArrayList<>();
List<DistributionReservationPackageEntity> list = map.get("1");
for (DistributionReservationPackageEntity distributionReservationPackageEntity : list) {
PackageData packageData = new PackageData();
packageData.setPackageCode(distributionReservationPackageEntity.getPacketBarCode());
packageData.setPackageType(PackageTypeEnums.CMP);
packageData.setNumber(1);
packageDataList.add(packageData);
}
abnormalPackageVO.setReservationVO(reservationVO);
reservationVO.setPackageDataList(packageDataList);
nodeFanoutMsg.setMain(abnormalPackageVO);
return nodeFanoutMsg;
}
@NotNull @NotNull
private static DistributionReservationPackageEntity getDistributionReservationPackageEntity(DistributionReservationEntity reservationEntity, DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity) { private static DistributionReservationPackageEntity getDistributionReservationPackageEntity(DistributionReservationEntity reservationEntity, DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity) {
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();

30
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java

@ -137,10 +137,9 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
} }
long packageAllowCount = getSplitOrderAllowCount(stockArticleId); long packageAllowCount = getSplitOrderAllowCount(stockArticleId);
long packageAllCount = getSplitOrderAllCount(stockArticleId);
if (packageAllowCount == 0 || packageAllCount == 1) { if (packageAllowCount == 0) {
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"包件数量不足,不允许拆单"); return R.fail("订单"+ distributionStockArticle.getOrderCode() +"可拆包件数量不足,不允许拆单");
} }
boolean exists = exists( boolean exists = exists(
@ -157,12 +156,8 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
.map(DistributionSplitOrderTaskEntity::getTaskNumber) .map(DistributionSplitOrderTaskEntity::getTaskNumber)
.mapToInt(Integer::intValue) .mapToInt(Integer::intValue)
.sum(); .sum();
long tipNumber = packageAllCount > packageAllowCount ? packageAllowCount : packageAllowCount - 1;
if (packageAllowCount < taskNumber) { if (packageAllowCount < taskNumber) {
return R.fail("拆单包件数量不足,请重新填写,目前可拆单数量:" + tipNumber); return R.fail("拆单包件数量不足,请重新填写,目前可拆单数量:" + packageAllowCount);
}
if (packageAllCount <= taskNumber) {
return R.fail("拆单数需要小于订单总数量,请重新填写,目前可拆单数量:" + tipNumber);
} }
taskLock(stockArticleId, () -> { taskLock(stockArticleId, () -> {
@ -272,7 +267,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
long count = distributionParcelListService.count( long count = distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery() Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getOrderPackageCode, packageCodes) .in(DistributionParcelListEntity::getOrderPackageCode, packageCodes)
.ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue()) .eq(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiruku.getValue())
.eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()) .eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue())
.eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) .eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
.eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue()) .eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue())
@ -968,24 +963,30 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
); );
HashMap<String, Object> res = new HashMap<>(); HashMap<String, Object> res = new HashMap<>();
DistributionSplitOrderTaskEntity task = getById(taskId);
res.put("packageList", PackageOrderList.getData()); res.put("packageList", PackageOrderList.getData());
res.put("logList", logList); res.put("logList", logList);
res.put("info", getById(taskId)); res.put("info", task);
res.put("allInfo", distributionSplitOrderAllTaskService.getById(task.getSplitOrderAllTaskId()));
return R.data(res); return R.data(res);
} }
public long getSplitOrderAllowCount(Long stockArticleId) { public long getSplitOrderAllowCount(Long stockArticleId) {
return distributionParcelListService.count( long splitOrderAllCount = getSplitOrderAllCount(stockArticleId);
long allowCount = distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery() Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getStockArticleId, stockArticleId) .in(DistributionParcelListEntity::getStockArticleId, stockArticleId)
.ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue()) .eq(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiruku.getValue())
.eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()) .eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue())
.eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) .eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
.eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue()) .eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue())
.eq(DistributionParcelListEntity::getIsTransfer, 0) .eq(DistributionParcelListEntity::getIsTransfer, 0)
); );
return allowCount >= splitOrderAllCount ? allowCount - 1 : allowCount;
} }
public long getSplitOrderAllCount(Long stockArticleId) { public long getSplitOrderAllCount(Long stockArticleId) {
@ -1020,10 +1021,9 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
} }
long packageAllowCount = getSplitOrderAllowCount(stockArticleId); long packageAllowCount = getSplitOrderAllowCount(stockArticleId);
long packageAllCount = getSplitOrderAllCount(stockArticleId);
if (packageAllowCount == 0 || packageAllCount == 1) { if (packageAllowCount == 0) {
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"包件数量不足,不允许拆单"); return R.fail("订单"+ distributionStockArticle.getOrderCode() +"可拆包件数量不足,不允许拆单");
} }
boolean exists = exists( boolean exists = exists(

36
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml

@ -249,8 +249,11 @@
SELECT SELECT
t1.* t1.*
FROM logpm_trunkline_cars_load_scan t1 FROM logpm_trunkline_cars_load_scan t1
LEFT JOIN logpm_trunkline_cars_load_scan t2 ON t1.scan_code = t2.scan_code AND t1.create_time &lt; t2.create_time LEFT JOIN logpm_trunkline_cars_load_scan t2 ON t1.scan_code = t2.scan_code
WHERE t2.scan_code IS NULL AND ((t2.warehouse_id IS NOT NULL AND t1.warehouse_id IS NULL)
OR(t1.warehouse_id IS NOT NULL and t2.warehouse_id IS NOT NULL AND t1.create_time &lt; t2.create_time))
WHERE
t2.scan_code IS NULL
) ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 ) ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where lta.create_time &gt; '2024-10-22 00:00:00' where lta.create_time &gt; '2024-10-22 00:00:00'
@ -316,8 +319,11 @@
SELECT SELECT
t1.* t1.*
FROM logpm_trunkline_cars_load_scan t1 FROM logpm_trunkline_cars_load_scan t1
LEFT JOIN logpm_trunkline_cars_load_scan t2 ON t1.scan_code = t2.scan_code AND t1.create_time &lt; t2.create_time LEFT JOIN logpm_trunkline_cars_load_scan t2 ON t1.scan_code = t2.scan_code
WHERE t2.scan_code IS NULL AND ((t2.warehouse_id IS NOT NULL AND t1.warehouse_id IS NULL)
OR(t1.warehouse_id IS NOT NULL and t2.warehouse_id IS NOT NULL AND t1.create_time &lt; t2.create_time))
WHERE
t2.scan_code IS NULL
) ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 ) ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where lta.create_time &gt; '2024-10-22 00:00:00' where lta.create_time &gt; '2024-10-22 00:00:00'
@ -2777,7 +2783,16 @@
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id
left join logpm_warehouse_warehouse waw on waw.id = ltad.warehouse_id left join logpm_warehouse_warehouse waw on waw.id = ltad.warehouse_id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ltad.order_package_code and ltcls.warehouse_id = ltad.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 left join (
SELECT
t1.*
FROM logpm_trunkline_cars_load_scan t1
LEFT JOIN logpm_trunkline_cars_load_scan t2 ON t1.scan_code = t2.scan_code
AND ((t2.warehouse_id IS NOT NULL AND t1.warehouse_id IS NULL)
OR(t1.warehouse_id IS NOT NULL and t2.warehouse_id IS NOT NULL AND t1.create_time &lt; t2.create_time))
WHERE
t2.scan_code IS NULL
) ltcls on ltcls.scan_code = ltad.order_package_code and ltcls.warehouse_id = ltad.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where ltad.create_time > '2024-10-22 00:00:00' where ltad.create_time > '2024-10-22 00:00:00'
and lww.document_making_time > '2024-10-22 00:00:00' and lww.document_making_time > '2024-10-22 00:00:00'
@ -2879,7 +2894,16 @@
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id
left join logpm_warehouse_warehouse waw on waw.id = ltad.warehouse_id left join logpm_warehouse_warehouse waw on waw.id = ltad.warehouse_id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ltad.order_package_code and ltcls.warehouse_id = ltad.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 left join (
SELECT
t1.*
FROM logpm_trunkline_cars_load_scan t1
LEFT JOIN logpm_trunkline_cars_load_scan t2 ON t1.scan_code = t2.scan_code
AND ((t2.warehouse_id IS NOT NULL AND t1.warehouse_id IS NULL)
OR(t1.warehouse_id IS NOT NULL and t2.warehouse_id IS NOT NULL AND t1.create_time &lt; t2.create_time))
WHERE
t2.scan_code IS NULL
) ltcls on ltcls.scan_code = ltad.order_package_code and ltcls.warehouse_id = ltad.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where ltad.create_time > '2024-10-22 00:00:00' where ltad.create_time > '2024-10-22 00:00:00'
and lww.document_making_time > '2024-10-22 00:00:00' and lww.document_making_time > '2024-10-22 00:00:00'

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java

@ -547,17 +547,20 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
} }
Map<String, DistributionParcelListEntity> parcelMap = new HashMap<>();
List<AftersalesAbnormalRecordEntity> addList = new ArrayList<>(); List<AftersalesAbnormalRecordEntity> addList = new ArrayList<>();
List<TrunklineCarsLoadScanEntity> noUnloadList = trunklineCarsLoadScanService.findUnloadCheckAbnormalNoUnloadList(loadId, warehouseId); List<TrunklineCarsLoadScanEntity> noUnloadList = trunklineCarsLoadScanService.findUnloadCheckAbnormalNoUnloadList(loadId, warehouseId);
//把noUnloadList中所有元素的scanCode放入一个List //把noUnloadList中所有元素的scanCode放入一个List
List<String> scanCodeList = noUnloadList.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toList()); List<String> scanCodeList = noUnloadList.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toList());
if(CollUtil.isNotEmpty(scanCodeList)){
FindParamterDTO findParamterDTO = new FindParamterDTO(); FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderPackageCodeList(scanCodeList); findParamterDTO.setOrderPackageCodeList(scanCodeList);
findParamterDTO.setWarehouseId(warehouseId); findParamterDTO.setWarehouseId(warehouseId);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO); List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
//把parcelListEntityList转化成以orderPackageCode作为key的Map //把parcelListEntityList转化成以orderPackageCode作为key的Map
Map<String, DistributionParcelListEntity> parcelMap = parcelListEntityList.stream() parcelMap = parcelListEntityList.stream()
.collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, Function.identity())); .collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, Function.identity()));
}
for (TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity : noUnloadList) { for (TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity : noUnloadList) {
String loadCode = trunklineCarsLoadScanEntity.getLoadCode(); String loadCode = trunklineCarsLoadScanEntity.getLoadCode();

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -13570,11 +13570,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
allAdvanceDetailList.addAll(advanceDetailEntityList); allAdvanceDetailList.addAll(advanceDetailEntityList);
}); });
Map<Long, TrunklineAdvanceEntity> advanceMap = new HashMap<>();
//把allAdvanceDetailList中所有advanceId放入一个Set集合 //把allAdvanceDetailList中所有advanceId放入一个Set集合
Set<Long> advanceIdSet = allAdvanceDetailList.stream().map(TrunklineAdvanceDetailEntity::getAdvanceId).collect(Collectors.toSet()); Set<Long> advanceIdSet = allAdvanceDetailList.stream().map(TrunklineAdvanceDetailEntity::getAdvanceId).collect(Collectors.toSet());
if(CollUtil.isNotEmpty(advanceIdSet)){
List<TrunklineAdvanceEntity> advanceEntities = advanceService.findListByIds(new ArrayList<>(advanceIdSet)); List<TrunklineAdvanceEntity> advanceEntities = advanceService.findListByIds(new ArrayList<>(advanceIdSet));
//把advanceEntities转化成id为key的Map //把advanceEntities转化成id为key的Map
Map<Long, TrunklineAdvanceEntity> advanceMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity())); advanceMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity()));
}
//把allAdvanceDetailList转化成orderPackageCode为key的Map //把allAdvanceDetailList转化成orderPackageCode为key的Map
@ -13586,6 +13590,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<String> orderPackageCodeList = new ArrayList<>(); List<String> orderPackageCodeList = new ArrayList<>();
Set<String> orderPackageCodeSet = new HashSet<>(); Set<String> orderPackageCodeSet = new HashSet<>();
Map<Long, TrunklineAdvanceEntity> finalAdvanceMap = advanceMap;
carsLoadScanEntities.forEach(carsLoadScanEntity -> { carsLoadScanEntities.forEach(carsLoadScanEntity -> {
String orderPackageCode = carsLoadScanEntity.getScanCode(); String orderPackageCode = carsLoadScanEntity.getScanCode();
Date unloadTime = carsLoadScanEntity.getUnloadTime(); Date unloadTime = carsLoadScanEntity.getUnloadTime();
@ -13610,7 +13615,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
updateScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode()); updateScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode());
updateScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId()); updateScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId());
updateScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo()); updateScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo());
TrunklineAdvanceEntity advanceEntity = advanceMap.get(advanceId); TrunklineAdvanceEntity advanceEntity = finalAdvanceMap.get(advanceId);
if(!Objects.isNull(advanceEntity)){ if(!Objects.isNull(advanceEntity)){
updateScanEntity.setCustomerName(advanceEntity.getCustomerName()); updateScanEntity.setCustomerName(advanceEntity.getCustomerName());
updateScanEntity.setCustomerTelephone(advanceEntity.getCustomerPhone()); updateScanEntity.setCustomerTelephone(advanceEntity.getCustomerPhone());

Loading…
Cancel
Save