diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSplitOrderTaskController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSplitOrderTaskController.java index 92d184845..08ea01f8e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSplitOrderTaskController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSplitOrderTaskController.java @@ -7,6 +7,7 @@ import com.logpm.distribution.entity.DistributionSplitOrderAllTaskEntity; import com.logpm.distribution.entity.DistributionSplitOrderTaskEntity; import com.logpm.distribution.service.IDistributionSplitOrderTaskService; import com.logpm.distribution.vo.DistributionSplitOrderAllTaskVO; +import com.logpm.distribution.vo.DistributionSplitOrderTaskVO; import com.logpm.distribution.vo.SplitPackageOrderVO; import lombok.AllArgsConstructor; import org.slf4j.Logger; @@ -97,7 +98,7 @@ public class DistributionSplitOrderTaskController { } @GetMapping("/task-list") - public R> taskList(Query query, DistributionSplitTaskSearchDTO distributionSplitTaskSearchDTO) { + public R> taskList(Query query, DistributionSplitTaskSearchDTO distributionSplitTaskSearchDTO) { return distributionSplitOrderTaskService.taskList(query, distributionSplitTaskSearchDTO); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java index 1901109be..81607ec5f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java @@ -81,30 +81,36 @@ public class DistributionStockArticleClient implements IDistributionStockArticle String key = orderCode + warehouseId; - Boolean exists = bladeRedis.exists(key); - if(exists){ - String idStr = bladeRedis.get(key); - if("1".equals(idStr)){ - return 1L; - }else{ - return Long.valueOf(idStr); - } - }else{ - bladeRedis.setEx(key,"1",30L); - DistributionStockArticleEntity distributionStockArticle = distributionStockArticleService.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); - if(ObjectUtils.isNotEmpty(distributionStockArticle)){ - bladeRedis.setEx(key,distributionStockArticle.getId(),30L); - return distributionStockArticle.getId(); + try{ + Boolean exists = bladeRedis.exists(key); + if(exists){ + String idStr = bladeRedis.get(key); + if("1".equals(idStr)){ + return 1L; + }else{ + return Long.valueOf(idStr); + } }else{ - boolean saveFlag = distributionStockArticleService.save(distributionStockArticleEntity); - if(saveFlag){ - bladeRedis.setEx(key,distributionStockArticleEntity.getId(),30L); - return distributionStockArticleEntity.getId(); + bladeRedis.setEx(key,"1",30L); + DistributionStockArticleEntity distributionStockArticle = distributionStockArticleService.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); + if(ObjectUtils.isNotEmpty(distributionStockArticle)){ + bladeRedis.setEx(key,distributionStockArticle.getId().toString(),30L); + return distributionStockArticle.getId(); }else{ - return 0L; + boolean saveFlag = distributionStockArticleService.save(distributionStockArticleEntity); + if(saveFlag){ + bladeRedis.setEx(key,distributionStockArticleEntity.getId().toString(),30L); + return distributionStockArticleEntity.getId(); + }else{ + return 0L; + } } } + }catch (Exception e){ + log.error("#######addData: 保存订单失败",e); + return 0L; } + } @Override diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSplitOrderTaskService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSplitOrderTaskService.java index 07710ab16..3362b6689 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSplitOrderTaskService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSplitOrderTaskService.java @@ -7,6 +7,7 @@ import com.logpm.distribution.dto.splitOrder.DistributionSplitTaskSearchDTO; import com.logpm.distribution.entity.DistributionSplitOrderAllTaskEntity; import com.logpm.distribution.entity.DistributionSplitOrderTaskEntity; import com.logpm.distribution.vo.DistributionSplitOrderAllTaskVO; +import com.logpm.distribution.vo.DistributionSplitOrderTaskVO; import com.logpm.distribution.vo.SplitPackageOrderVO; import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.support.Query; @@ -25,7 +26,7 @@ public interface IDistributionSplitOrderTaskService extends BaseService> taskList(Query query, DistributionSplitTaskSearchDTO distributionSplitTaskSearchDTO); + R> taskList(Query query, DistributionSplitTaskSearchDTO distributionSplitTaskSearchDTO); /** * 拆单总任务 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java index 6cee439d7..673907ea5 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java @@ -24,6 +24,7 @@ import com.logpm.distribution.service.IDistributionSplitOrderLogService; import com.logpm.distribution.service.IDistributionSplitOrderTaskService; import com.logpm.distribution.service.IDistributionStockArticleService; import com.logpm.distribution.vo.DistributionSplitOrderAllTaskVO; +import com.logpm.distribution.vo.DistributionSplitOrderTaskVO; import com.logpm.distribution.vo.SplitPackageOrderVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -33,6 +34,7 @@ import org.springblade.common.constant.order.OrderSplitStateConstant; import org.springblade.common.constant.order.OrderStatusConstant; import org.springblade.common.constant.orderpackage.*; import org.springblade.common.exception.CustomerException; +import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; @@ -40,7 +42,9 @@ import org.springblade.core.redis.lock.LockType; import org.springblade.core.redis.lock.RedisLockClient; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; +import org.springblade.system.cache.UserCache; import org.springblade.system.entity.User; +import org.springblade.system.feign.ISysClient; import org.springblade.system.feign.IUserClient; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -65,7 +69,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl> taskList(Query query, DistributionSplitTaskSearchDTO distributionSplitTaskSearchDTO) { + public R> taskList(Query query, DistributionSplitTaskSearchDTO distributionSplitTaskSearchDTO) { LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); if (distributionSplitTaskSearchDTO.getSplitOrderAllTaskId() != null) { queryWrapper.eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, distributionSplitTaskSearchDTO.getSplitOrderAllTaskId()); @@ -87,10 +91,31 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl page = Condition.getPage(query); - List list = list(page, queryWrapper); - page.setRecords(list); + IPage pageRes = Condition.getPage(query); + List list = list(page, queryWrapper); + List listVo = new ArrayList<>(); + if (list != null && !list.isEmpty()) { + Map userIdNameMap = getUserIdNameMap(list.stream().map(DistributionSplitOrderTaskEntity::getCreateUser).collect(Collectors.toList())); + + listVo = list.stream().map(item -> { + DistributionSplitOrderTaskVO distributionSplitOrderTaskVO = new DistributionSplitOrderTaskVO(); + BeanUtil.copyProperties(item, distributionSplitOrderTaskVO); + distributionSplitOrderTaskVO.setCreateUserName(userIdNameMap.get(item.getCreateUser())); + return distributionSplitOrderTaskVO; + }).collect(Collectors.toList()); + } + + pageRes.setRecords(listVo); + pageRes.setPages(page.getPages()); + pageRes.setTotal(page.getTotal()); + + return R.data(pageRes); + } - return R.data(page); + private Map getUserIdNameMap(List list) { + String createUserIds = list.stream().map((d) -> d + "").collect(Collectors.joining(",")); + List users = iUserClient.userInfoByIds(AuthUtil.getTenantId(), createUserIds).getData(); + return users.stream().collect(Collectors.toMap(User::getId, User::getName)); } @Transactional @@ -132,6 +157,15 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl { String allTaskNo = getAllTaskNo(); DistributionSplitOrderAllTaskEntity allTask = new DistributionSplitOrderAllTaskEntity(); @@ -141,10 +175,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpllambdaQuery() - .eq(DistributionStockArticleEntity::getId, task.getStockArticleId()) - .eq(DistributionStockArticleEntity::getIsDeleted, 1) - ); - if (oldStockArticle == null) { - return R.fail("订单错误,无法删除"); - } - oldStockArticle.setIsDeleted(0); - } - - List packageList = distributionParcelListService.list(Wrappers.lambdaQuery() - .eq(DistributionParcelListEntity::getStockArticleId, task.getNewStockArticleId())); - - if (packageList.stream().anyMatch(distributionParcelListEntity -> OrderPackageReservationStatusConstant.yiyueyue.getValue().equals(distributionParcelListEntity.getOrderPackageReservationStatus()))) { - return R.fail("新的订单包件已预约,无法删除"); + long count = count( + Wrappers.lambdaQuery() + .eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, task.getSplitOrderAllTaskId()) + .in(DistributionSplitOrderTaskEntity::getState, Arrays.asList(OrderSplitStateConstant.InProgress.getValue(), OrderSplitStateConstant.finish.getValue())) + ); + if (count == 1) { + return R.fail("总任务下只有一条任务,无法撤销"); } try { - - distributionParcelListService.update(Wrappers.lambdaUpdate() - .eq(DistributionParcelListEntity::getStockArticleId, task.getNewStockArticleId()) - .set(DistributionParcelListEntity::getStockArticleId, task.getStockArticleId()) - .set(DistributionParcelListEntity::getOrderCode, task.getOrderCode()) - ); - - if (newStockArticle != null) { - newStockArticle.setTotalNumber(0); - newStockArticle.setHandQuantity(0); - distributionStockArticleService.updateById(newStockArticle); - oldStockArticle.setTotalNumber(oldStockArticle.getTotalNumber() + newStockArticle.getTotalNumber()); - oldStockArticle.setHandQuantity(oldStockArticle.getHandQuantity() + newStockArticle.getHandQuantity()); - } - - distributionStockArticleService.updateById(oldStockArticle); - - distributionSplitOrderDetailService.update(Wrappers.lambdaUpdate() - .eq(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, taskId) - .set(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.cancel.getValue()) - .set(DistributionSplitOrderDetailEntity::getCancelUser, AuthUtil.getUser().getUserId()) - .set(DistributionSplitOrderDetailEntity::getCancelUsername, AuthUtil.getUser().getUserName()) - ); - distributionSplitOrderLogService.record(task, "取消拆单任务", AuthUtil.getUser().getUserName()); - - allTask.setNumber(allTask.getNumber() - 1); - allTask.setOrderPackageNumber(allTask.getOrderPackageNumber() - task.getTaskNumber()); - distributionSplitOrderAllTaskService.updateById(allTask); - - task.setIsDeleted(1); - task.setNumber(0); - updateById(task); - + cancelTask(task); return R.success("success"); } catch (Exception e) { log.error("取消拆单任务系统错误", e); @@ -607,6 +597,9 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpllambdaQuery() .in(DistributionSplitOrderDetailEntity::getOrderPackageCode, packageCodes) @@ -621,11 +614,6 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpllambdaUpdate() @@ -702,6 +690,10 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl cancelTask(Long taskId) { DistributionSplitOrderTaskEntity task = getById(taskId); - if (!task.getState().equals(OrderSplitStateConstant.InProgress.getValue())) { + if (!task.getState().equals(OrderSplitStateConstant.finish.getValue())) { return R.fail("任务未已完成,无法操作"); } DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(task.getSplitOrderAllTaskId()); @@ -739,19 +731,22 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl list = distributionSplitOrderAllTaskService.list(page, queryWrapper); - - String createUserIds = list.stream().map((d) -> d.getCreateUser() + "").collect(Collectors.joining(",")); - List users = iUserClient.userInfoByIds(AuthUtil.getTenantId(), String.join(",", createUserIds)).getData(); - Map userMap = users.stream().collect(Collectors.toMap(User::getId, u -> u)); - List listVo = list.stream().map(d -> { - DistributionSplitOrderAllTaskVO vo = new DistributionSplitOrderAllTaskVO(); - BeanUtil.copyProperties(d, vo); - vo.setCreateUserName(userMap.get(d.getCreateUser()).getName()); - return vo; - }).collect(Collectors.toList()); + List listVo = new ArrayList<>(); + if (list != null && !list.isEmpty()) { + Map userMap = getUserIdNameMap(list.stream().map(DistributionSplitOrderAllTaskEntity::getCreateUser).collect(Collectors.toList())); + Map allTaskIdPackageNumber = getAllTaskIdPackageNumber(list.stream().map(DistributionSplitOrderAllTaskEntity::getId).collect(Collectors.toList())); + listVo = list.stream().map(d -> { + DistributionSplitOrderAllTaskVO vo = new DistributionSplitOrderAllTaskVO(); + BeanUtil.copyProperties(d, vo); + vo.setCreateUserName(userMap.get(d.getCreateUser())); + vo.setSplitPackageNumber(allTaskIdPackageNumber.get(d.getId())); + return vo; + }).collect(Collectors.toList()); + } pageResult.setRecords(listVo); pageResult.setPages(page.getPages()); @@ -932,6 +929,22 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl getAllTaskIdPackageNumber(List taskIds){ + List> maps = baseMapper.selectMaps( + Wrappers.query() + .select("split_order_all_task_id", "SUM(number) as number") + .eq("split_order_all_task_id", taskIds) + .in("state", OrderSplitStateConstant.InProgress.getValue(), OrderSplitStateConstant.finish.getValue()) + .groupBy("split_order_all_task_id") + ); + + return maps.stream().collect(Collectors.toMap( + m -> Long.valueOf(m.get("split_order_all_task_id").toString()), + m -> Long.valueOf(m.get("number").toString()) + )); + } + + @Override public R getTaskDetail(Long taskId) { R> PackageOrderList = getPackageCodeByTaskId(taskId); @@ -944,6 +957,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl select GROUP_CONCAT(DISTINCT brand) brand, GROUP_CONCAT(DISTINCT train_number) trainNumber, - GROUP_CONCAT(DISTINCT order_code) orderCode, GROUP_CONCAT(DISTINCT dealer_code) dealerCode, GROUP_CONCAT(DISTINCT dealer_name) dealerName from logpm_trunkline_advance diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java index f745b77da..caa400dfc 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java @@ -206,5 +206,5 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper #{unloadTime} + and ltcls.unload_node_id != #{warehouseId} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java index 9e3f587ec..0e820d8fd 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java @@ -213,5 +213,5 @@ public interface ITrunklineCarsLoadScanService extends BaseService 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); } 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 4a47a2013..126bd274a 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 @@ -320,6 +320,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { String dealerName = null; String dealerCode = null; String brand = null; + Set orderCodeSet = new HashSet<>(); for (TrunklineAdvanceEntity advanceEntity : list) { if (StringUtil.isBlank(dealerName)) { dealerName = advanceEntity.getDealerName(); @@ -328,11 +329,13 @@ public class OpenOrderServiceImpl implements IOpenOrderService { if (StringUtil.isBlank(brand)) { brand = advanceEntity.getBrand(); } + orderCodeSet.add(advanceEntity.getOrderCode()); } OpenOrderVO openOrderVO = new OpenOrderVO(); //查询品牌 客户车次号 订单自编码 OpenOrderVO infoByIds = advanceService.selectInfoByIds(advanceIds); BeanUtil.copy(infoByIds, openOrderVO); + openOrderVO.setOrderCode(String.join(",", orderCodeSet)); openOrderVO.setAdvanceIds(advanceIds); BasicdataBrandEntity basicdataBrandEntity = basicdataBrandClient.findEntityByName(brand); if (!Objects.isNull(basicdataBrandEntity)) { @@ -4051,6 +4054,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { String dealerName = null; String brand = null; Integer totalNum = 0; + Set orderCodeSet = new HashSet<>(); for (TrunklineAdvanceEntity advanceEntity : list) { if (StringUtil.isBlank(dealerName)) { dealerName = advanceEntity.getDealerName(); @@ -4060,11 +4064,15 @@ public class OpenOrderServiceImpl implements IOpenOrderService { } totalNum = totalNum + advanceEntity.getTotalNum(); + + orderCodeSet.add(advanceEntity.getOrderCode()); + } OpenOrderVO openOrderVO = new OpenOrderVO(); //查询品牌 客户车次号 订单自编码 OpenOrderVO infoByIds = advanceService.selectInfoByIds(advanceIds); BeanUtil.copy(infoByIds, openOrderVO); + openOrderVO.setOrderCode(String.join(",", orderCodeSet)); openOrderVO.setAdvanceIds(advanceIds); //发站仓-----目前登录人的仓库 openOrderVO.setDepartureWarehouseName(basicdataWarehouseEntity.getName()); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java index bb6c2d751..31bb3629c 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java @@ -515,7 +515,7 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO); - parcelListEntityList.forEach(parcelListEntity -> { - PackageData packageData = new PackageData(); - packageData.setWaybillNumber(parcelListEntity.getWaybillNumber()); - packageData.setBrand(parcelListEntity.getBrandName()); - packageData.setPackageCode(parcelListEntity.getOrderPackageCode()); - packageData.setMaterialCode(parcelListEntity.getMaterialCode()); - packageData.setMaterialName(parcelListEntity.getMaterialName()); - packageData.setNumber(1); - packageData.setOrderCode(parcelListEntity.getOrderCode()); - packageData.setPackageType(PackageTypeEnums.CMP); - packageDataList.add(packageData); - }); +// FindParamterDTO findParamterDTO = new FindParamterDTO(); +// findParamterDTO.setOrderPackageCodeList(scanCodes); +// findParamterDTO.setWarehouseId(warehouseId); +// List parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO); +// parcelListEntityList.forEach(parcelListEntity -> { +// PackageData packageData = new PackageData(); +// packageData.setWaybillNumber(parcelListEntity.getWaybillNumber()); +// packageData.setBrand(parcelListEntity.getBrandName()); +// packageData.setPackageCode(parcelListEntity.getOrderPackageCode()); +// packageData.setMaterialCode(parcelListEntity.getMaterialCode()); +// packageData.setMaterialName(parcelListEntity.getMaterialName()); +// packageData.setNumber(1); +// packageData.setOrderCode(parcelListEntity.getOrderCode()); +// packageData.setPackageType(PackageTypeEnums.CMP); +// packageDataList.add(packageData); +// }); }else{ @@ -9803,19 +9801,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl tripartiteVONodeFanoutMsg = buildNodeFanoutMessage(carsLoadEntity, packageDataList, warehouseId); - if(!Objects.isNull(tripartiteVONodeFanoutMsg)){ - rabbitTemplate.convertAndSend(FanoutConstants.trunkline.tripartite.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(tripartiteVONodeFanoutMsg)); - } +// NodeFanoutMsg tripartiteVONodeFanoutMsg = buildNodeFanoutMessage(carsLoadEntity, packageDataList, warehouseId); +// if(!Objects.isNull(tripartiteVONodeFanoutMsg)){ +// rabbitTemplate.convertAndSend(FanoutConstants.trunkline.tripartite.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(tripartiteVONodeFanoutMsg)); +// } return R.success("签收成功"); } @@ -13543,6 +13541,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl scanCodeList = new ArrayList<>(scanCodeSet); + + 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())); + + List allAdvanceDetailList = new ArrayList<>(); int packageBatchSize = 500; @@ -13643,7 +13651,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl 0){ DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId); if(!Objects.isNull(parcelListEntity)){ @@ -13666,11 +13674,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl updateParceList = new ArrayList<>(); @@ -13717,6 +13725,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl