From aa42d12b7bfd2496ee39064bc4b99a1096c8d7d5 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 1 Apr 2025 15:30:52 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=8D=B8=E8=BD=A6=E7=A1=AE=E8=AE=A4=EF=BC=8C?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CarsLoadController.java | 4 +++- .../impl/CarsLoadAsyncServiceImpl.java | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java index 05bfa2752..978d521a9 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java @@ -1093,12 +1093,14 @@ public class CarsLoadController { // return R.fail(405,"未知的发车类型"); // } - carsLoadService.unloadByLoadId(loadCarsDTO); + try{ //同步一次系统无编码数据 carsLoadService.syncNoSystemData(loadId, myCurrentWarehouse.getId(), myCurrentWarehouse.getName()); + carsLoadService.unloadByLoadId(loadCarsDTO); + carsLoadService.sendStationArrivedEnter(loadCarsDTO); }catch (Exception e){ 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 02b2cc3cd..5d1d81720 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 @@ -18,6 +18,7 @@ import com.logpm.basic.entity.BasicCarModelEntity; import com.logpm.basic.feign.IBasicCarModelClient; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; +import com.logpm.distribution.dto.FindParamterDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.feign.IDistributionParcelListClient; @@ -548,6 +549,16 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { 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())); + for (TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity : noUnloadList) { String loadCode = trunklineCarsLoadScanEntity.getLoadCode(); String waybillNo = trunklineCarsLoadScanEntity.getWaybillNo(); @@ -579,6 +590,14 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { abnormalRecordEntity.setRemark("无卸车记录"); abnormalRecordEntity.setIsZero(0); abnormalRecordEntity.setNum(1); + DistributionParcelListEntity distributionParcel = parcelMap.get(scanCode); + if(!Objects.isNull(distributionParcel)){ + abnormalRecordEntity.setAbnormalStatus(1); + abnormalRecordEntity.setDealTime(new Date()); + abnormalRecordEntity.setDealUserId(userId); + abnormalRecordEntity.setDealUserName(nickName); + abnormalRecordEntity.setRemark("无卸车记录,已入库,系统判定自动完结"); + } addList.add(abnormalRecordEntity); // abnormalRecordClient.addAbnormalRecord(abnormalRecordEntity); }