diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java b/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java index c550660cb..893277c0b 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java @@ -45,6 +45,7 @@ public enum WorkNodeEnums implements Serializable { SIGN_DIRECT_SHIPPER(105030,"直发商家签收"), END_WAREHOUSE_UNLOADING(105040, "末端仓卸车确认"), NO_STOCK_CAR(105050, "本车次少货"), + COST_SHARE(105060, "车次成本分摊"), SORTING_TRAYS(201010, "分拣打托"), UN_SORTING_TRAYS(201020, "包件解托"), 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 8a761b427..808b1b2e9 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 @@ -39,6 +39,18 @@ public abstract class FanoutConstants { } } + interface COSTSHARE { + // 交换机 + String EXCHANGE = "fanout.trunkline.costshare" + ModuleNameConstant.DEVAUTH; + + interface QUEUE { + + // 保存基础数据 + String REPORT_COSTSHARE = "fanout.trunkline.reportdata.report.costshare" + ModuleNameConstant.DEVAUTH; + + } + } + 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 48b9824b6..d16f466c5 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 @@ -2446,12 +2446,13 @@ public class CarsLoadController { return R.fail(405,"多仓权限无法操作,请选择仓库"); } loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId()); + loadCarsDTO.setWarehouseName(myCurrentWarehouse.getName()); if(Objects.isNull(loadId)){ log.warn(method+"配载id为空 loadId={}",loadId); return R.fail(405,"配载id为空"); } - return carsLoadService.costShareByLoadId(loadId); + return carsLoadService.costShareByLoadId(loadId,loadCarsDTO); }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java index 9e43d17ea..755bdd997 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java @@ -11,7 +11,7 @@ public interface ICarsLoadAsyncService { void saveCostShareRecord(Long loadId, TrunklineCarsLoadEntity carsLoadEntity, Long userId, String tenantId, String deptId); - void costShareByLoadId(Long loadId,TrunklineCarsLoadEntity carsLoadEntity); + void costShareByLoadId(Long loadId,TrunklineCarsLoadEntity carsLoadEntity,Long warehouseId,String warehouseName); void abnormalListStartCarByLoadIdAndWarehouseId(Long loadId, Long warehouseId,Long userId,Long deptId,String nickName,String tenantId,String warehouseName); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java index b5d92667f..7690c94e9 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java @@ -188,7 +188,7 @@ public interface ITrunklineCarsLoadService extends BaseService list, Long userId, String nickName, Long warehouseId, String warehouseName, TrunklineCarsLoadEntity carsLoadEntity) { + NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg(); + nodeFanoutMsg.setNode(WorkNodeEnums.COST_SHARE); + nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD); + nodeFanoutMsg.setOperator(nickName); + nodeFanoutMsg.setOperatorId(userId); + nodeFanoutMsg.setWarehouse(warehouseName); + nodeFanoutMsg.setWarehouseId(warehouseId); + nodeFanoutMsg.setOperatorTime(new Date()); + + //组装包件数据 + + JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(carsLoadEntity)); + +// List packageDataList = new ArrayList<>(); + +// list.forEach(costShareRecordEntity -> { +// PackageData packageData = new PackageData(); +// Integer productType = costShareRecordEntity.getProductType(); +// if(productType == 1){ +// +// }else if(productType == 2){ +// +// } +// +// +// packageData.setPackageCode(packageCode); +// packageData.setNumber(1); +// packageData.setPackageType(PackageTypeEnums.CMP); +// packageDataList.add(packageData); +// }); + + json.put("details", list); + + nodeFanoutMsg.setMain(json); + + FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.COSTSHARE.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build(); + + sendFanoutService.sendFanoutMsg(fanoutMsg); + } @LogpmAsync("asyncExecutor") 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 768a94ea9..531b61c9e 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 @@ -2316,6 +2316,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl linePhotoEntityList = carsLoadLinePhotoService.findListByLoadIdAndWarehouseId(loadId, null, null, null); Map> linePhotoMap = linePhotoEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadLineId)); @@ -2333,6 +2339,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl map = new HashMap<>(); map.put("carsLoadLineEntity",loadLineEntity); + map.put("nowWarehouseId",carsLoadEntity.getNowWarehouseId()); List trunklineCarsLoadLinePhotoEntities = linePhotoMap.get(loadLineId); @@ -9208,11 +9215,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl abnormalList = abnormalRecordClient.findAbnormalList(carsNo); + if(CollUtil.isNotEmpty(abnormalList)){ + log.warn("#################costShareByLoadId: 该车次还有异常列表未处理 loadId={}", loadId); + return R.fail(405, "该车次还有异常列表未处理"); + } + List noDataList = trunklineCarsLoadScanService.findListNoDataByLoadId(loadId); int size = noDataList.size(); if (size != 0) { @@ -9738,7 +9753,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl