diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java b/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java index f3c21af39..dadf2e5ca 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java @@ -424,7 +424,7 @@ public abstract class FanoutConstants { /** * 异常审核 - * @see org.springblade.common.model.ReservationVO + * @see org.springblade.common.model.AbnormalPackageVO */ interface DeliveryAbnormalReview { diff --git a/blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java b/blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java index ab912cee3..b3877ef89 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java +++ b/blade-biz-common/src/main/java/org/springblade/common/model/PackageData.java @@ -162,6 +162,7 @@ public class PackageData implements Serializable { private Long finalNodeId; private String finalNodeName; + private Integer examine; } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml index 976703731..48af6a82f 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml @@ -246,11 +246,14 @@ left join logpm_warehouse_waybill lww on lww.id = lta.waybill_id left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id 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 t1.create_time < t2.create_time - WHERE t2.scan_code IS NULL + 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 < 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 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 > '2024-10-22 00:00:00' @@ -316,8 +319,11 @@ 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 t1.create_time < t2.create_time - WHERE t2.scan_code IS NULL + 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 < 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 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 > '2024-10-22 00:00:00' @@ -2775,10 +2781,19 @@ else '未知' end isOverTime from logpm_trunkline_advance_detail ltad 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_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 logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_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 ( + 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 < 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 where ltad.create_time > '2024-10-22 00:00:00' and lww.document_making_time > '2024-10-22 00:00:00' and lww.departure_warehouse_id != lww.destination_warehouse_id @@ -2879,7 +2894,16 @@ 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_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 < 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 where ltad.create_time > '2024-10-22 00:00:00' and lww.document_making_time > '2024-10-22 00:00:00' diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java index 5946e2af6..17d636f55 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java @@ -547,17 +547,20 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { } + Map parcelMap = new HashMap<>(); List addList = new ArrayList<>(); List noUnloadList = trunklineCarsLoadScanService.findUnloadCheckAbnormalNoUnloadList(loadId, warehouseId); //把noUnloadList中所有元素的scanCode放入一个List List scanCodeList = noUnloadList.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toList()); - FindParamterDTO findParamterDTO = new FindParamterDTO(); - findParamterDTO.setOrderPackageCodeList(scanCodeList); - findParamterDTO.setWarehouseId(warehouseId); - List parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO); - //把parcelListEntityList转化成以orderPackageCode作为key的Map - Map parcelMap = parcelListEntityList.stream() - .collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, Function.identity())); + if(CollUtil.isNotEmpty(scanCodeList)){ + FindParamterDTO findParamterDTO = new FindParamterDTO(); + findParamterDTO.setOrderPackageCodeList(scanCodeList); + findParamterDTO.setWarehouseId(warehouseId); + List parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO); + //把parcelListEntityList转化成以orderPackageCode作为key的Map + parcelMap = parcelListEntityList.stream() + .collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, Function.identity())); + } for (TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity : noUnloadList) { String loadCode = trunklineCarsLoadScanEntity.getLoadCode(); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index 8aa67349c..e4a5a7055 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -13570,11 +13570,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl advanceMap = new HashMap<>(); //把allAdvanceDetailList中所有advanceId放入一个Set集合 Set advanceIdSet = allAdvanceDetailList.stream().map(TrunklineAdvanceDetailEntity::getAdvanceId).collect(Collectors.toSet()); - List advanceEntities = advanceService.findListByIds(new ArrayList<>(advanceIdSet)); - //把advanceEntities转化成id为key的Map - Map advanceMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity())); + if(CollUtil.isNotEmpty(advanceIdSet)){ + List advanceEntities = advanceService.findListByIds(new ArrayList<>(advanceIdSet)); + //把advanceEntities转化成id为key的Map + advanceMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity())); + } + //把allAdvanceDetailList转化成orderPackageCode为key的Map @@ -13586,6 +13590,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodeList = new ArrayList<>(); Set orderPackageCodeSet = new HashSet<>(); + Map finalAdvanceMap = advanceMap; carsLoadScanEntities.forEach(carsLoadScanEntity -> { String orderPackageCode = carsLoadScanEntity.getScanCode(); Date unloadTime = carsLoadScanEntity.getUnloadTime(); @@ -13610,7 +13615,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl