From 26439b9129db7e9793e59058c32a4873d3cae87c Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Fri, 10 Nov 2023 15:05:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=85=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DistributionStockupServiceImpl.java | 19 +++++-- .../api/WarehouseTaskApiController.java | 2 +- .../warehouse/service/ITaskQuestService.java | 4 ++ .../service/impl/TaskQuestServiceImpl.java | 53 +++++++++++++------ 4 files changed, 58 insertions(+), 20 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index 1fbbd1802..735144d71 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -1758,16 +1758,18 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list1 = new ArrayList<>(); + voList.forEach(i -> { //查询是否已备货 DistributionParcelListEntity byId = distributionParcelListService.getById(i.getParcelListId()); if(ObjectUtils.isNotNull(byId) && !byId.getOrderPackageStockupStatus().equals(OrderPackageStockupStatusConstant.yibeihu.getValue())){ DistributionStockEntity distributionStock = new DistributionStockEntity(); //修改包件备货状态 - DistributionParcelListEntity parcelList = new DistributionParcelListEntity(); - parcelList.setId(i.getParcelListId()); - parcelList.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.yibeihu.getValue()); - distributionParcelListService.updateById(parcelList); + +// DistributionParcelListEntity parcelList = new DistributionParcelListEntity(); +// parcelList.setId(i.getParcelListId()); +// parcelList.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.yibeihu.getValue()); +// distributionParcelListService.updateById(parcelList); //判断备货任务是否完成 if(one.getStockUpType().equals("3")){ @@ -1830,6 +1832,15 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl collect = voList.stream().map(DistributionStockPackageVO::getParcelListId).collect(Collectors.toList()); + boolean update = distributionParcelListService.update(Wrappers.lambdaUpdate() + .in(DistributionParcelListEntity::getId, collect) + .set(DistributionParcelListEntity::getOrderPackageStockupStatus, OrderPackageStockupStatusConstant.yibeihu.getValue()) + ); + if(!update){ + log.info("包件备货信息修改失败!!"); + throw new ServiceException("包件备货信息修改失败!!"); + } //判断备货任务是否完成 if(one.getStockUpType().equals("3")){ diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java index 4dac1f33a..bb0de6ccb 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java @@ -252,7 +252,7 @@ public class WarehouseTaskApiController { map.put("allocationCode",allocationCode); map.put("allNum",allNUm); map.put("finishNum",finishNUm); - map.put("list", ObjectUtils.isNotNull(list.getRecords()) ? list.getRecords() : null); + map.put("list", ObjectUtils.isNotNull(list) ? list.getRecords() : null); return R.data(map); }catch (CustomerException e){ log.warn(e.message); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java index 4edbb36cc..b0bcd8361 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java @@ -112,6 +112,10 @@ public interface ITaskQuestService extends BaseService { */ IPage allocationDetailByStock(IPage page,TaskSearchDTO taskSearchDTO); + /** + * 修改包件信息 + * @param taskSearchDTO + */ void updateQuestSetail(TaskSearchDTO taskSearchDTO); /** diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java index 13b157f4f..3a324cf4f 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java @@ -1140,13 +1140,16 @@ public class TaskQuestServiceImpl extends BaseServiceImpl questChildEntitys = taskQuestChildService.list(queryWrapper); List marketNames = null; - for (TaskQuestChildEntity childEntity : questChildEntitys) { - if (Objects.isNull(marketNames)) { - marketNames = new ArrayList<>(); + if(ObjectUtils.isNotNull(questChildEntitys) && !questChildEntitys.isEmpty()){ + for (TaskQuestChildEntity childEntity : questChildEntitys) { + if (Objects.isNull(marketNames)) { + marketNames = new ArrayList<>(); + } + marketNames.add(childEntity.getRefName()); } - marketNames.add(childEntity.getRefName()); + taskSearchDTO.setMarketNames(marketNames); } - taskSearchDTO.setMarketNames(marketNames); + //判断是否有明细数据存入 // QueryWrapper questDetailEntityQueryWrapper = new QueryWrapper<>(); @@ -1198,13 +1201,23 @@ public class TaskQuestServiceImpl extends BaseServiceImpl questChildEntitys = taskQuestChildService.list(queryWrapper); List marketNames = null; - for (TaskQuestChildEntity childEntity : questChildEntitys) { - if (Objects.isNull(marketNames)) { - marketNames = new ArrayList<>(); + + if(ObjectUtils.isNotNull(questChildEntitys) && !questChildEntitys.isEmpty()){ + for (TaskQuestChildEntity childEntity : questChildEntitys) { + if (Objects.isNull(marketNames)) { + marketNames = new ArrayList<>(); + } + marketNames.add(childEntity.getRefName()); } - marketNames.add(childEntity.getRefName()); + taskSearchDTO.setMarketNames(marketNames); } - taskSearchDTO.setMarketNames(marketNames); +// for (TaskQuestChildEntity childEntity : questChildEntitys) { +// if (Objects.isNull(marketNames)) { +// marketNames = new ArrayList<>(); +// } +// marketNames.add(childEntity.getRefName()); +// } +// taskSearchDTO.setMarketNames(marketNames); //判断是否有明细数据存入 // QueryWrapper questDetailEntityQueryWrapper = new QueryWrapper<>(); @@ -1256,13 +1269,23 @@ public class TaskQuestServiceImpl extends BaseServiceImpl questChildEntitys = taskQuestChildService.list(queryWrapper); List marketNames = null; - for (TaskQuestChildEntity childEntity : questChildEntitys) { - if (Objects.isNull(marketNames)) { - marketNames = new ArrayList<>(); + if(ObjectUtils.isNotNull(questChildEntitys) && !questChildEntitys.isEmpty()){ + for (TaskQuestChildEntity childEntity : questChildEntitys) { + if (Objects.isNull(marketNames)) { + marketNames = new ArrayList<>(); + } + marketNames.add(childEntity.getRefName()); } - marketNames.add(childEntity.getRefName()); + taskSearchDTO.setMarketNames(marketNames); } - taskSearchDTO.setMarketNames(marketNames); + +// for (TaskQuestChildEntity childEntity : questChildEntitys) { +// if (Objects.isNull(marketNames)) { +// marketNames = new ArrayList<>(); +// } +// marketNames.add(childEntity.getRefName()); +// } +// taskSearchDTO.setMarketNames(marketNames); //判断是否有明细数据存入 // QueryWrapper questDetailEntityQueryWrapper = new QueryWrapper<>();