diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java index 4ff39bf5f..aa6953dcd 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java @@ -52,14 +52,14 @@ public interface IWarehouseGoodsAllocationClient { * 跟新货位缓存 */ @GetMapping(TOP+ "/updateAllocationCache") - Boolean updateAllocationCache(@RequestParam("ids") String ids); + Boolean updateAllocationCache(@RequestParam String ids); /** * 查询货位信息 */ @GetMapping(TOP+ "/getAllocationInforByIds") - List getAllocationInforByIds(@RequestParam("ids") String [] ids); + List getAllocationInforByIds(@RequestParam String [] ids); @GetMapping(TOP+ "/findByAllocationQrCode") diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionClientMessageServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionClientMessageServiceImpl.java index f9255258b..a79d2d724 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionClientMessageServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionClientMessageServiceImpl.java @@ -93,7 +93,7 @@ public class DistributionClientMessageServiceImpl extends BaseServiceImpl allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(ids); - for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) { - if (distributionStockupStockListVO.getAllocationList() == null) { - distributionStockupStockListVO.setAllocationList(new ArrayList<>()); + if(!Func.isEmpty(ids)){ + List allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(ids); + for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) { + if (distributionStockupStockListVO.getAllocationList() == null) { + distributionStockupStockListVO.setAllocationList(new ArrayList<>()); + } + Map map = new HashMap<>(); + map.put("id", allocationInforById.getId()); + map.put("name", allocationInforById.getQrCode()); + distributionStockupStockListVO.getAllocationList().add(map); } - Map map = new HashMap<>(); - map.put("id", allocationInforById.getId()); - map.put("name", allocationInforById.getQrCode()); - distributionStockupStockListVO.getAllocationList().add(map); } + } return distributionStockupStockListVO; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java index e1dae9455..4c88104aa 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java @@ -1115,15 +1115,18 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl collect = locationStockListInformation.stream().map(WarehouseUpdownGoodsEntity::getAllocationId).map(String::valueOf).collect(Collectors.toList()); String[] array = collect.stream().toArray(String[]::new); - List allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(array); - Map collected = allocationInforByIds.stream().collect(Collectors.toMap(WarehouseGoodsAllocationEntity::getId, WarehouseGoodsAllocationEntity::getQrCode)); - for (WarehouseUpdownGoodsEntity updownGoodsEntity : locationStockListInformation) { - Map map = new HashMap<>(); - map.put("allocationId", updownGoodsEntity.getAllocationId()); - map.put("allocationName", collected.get(updownGoodsEntity.getAllocationId())); - map.put("handleQuantity", updownGoodsEntity.getNum()); - mapList.add(map); + if(!Func.isEmpty(array)){ + List allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(array); + Map collected = allocationInforByIds.stream().collect(Collectors.toMap(WarehouseGoodsAllocationEntity::getId, WarehouseGoodsAllocationEntity::getQrCode)); + for (WarehouseUpdownGoodsEntity updownGoodsEntity : locationStockListInformation) { + Map map = new HashMap<>(); + map.put("allocationId", updownGoodsEntity.getAllocationId()); + map.put("allocationName", collected.get(updownGoodsEntity.getAllocationId())); + map.put("handleQuantity", updownGoodsEntity.getNum()); + mapList.add(map); + } } + } return R.data(mapList); } 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 dc0789f9b..146b4ce5c 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 @@ -1291,17 +1291,20 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(ids); - for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) { - if (i.getAllocationList() == null) { - i.setAllocationList(new ArrayList<>()); + if(!Func.isEmpty(ids)){ + List allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(ids); + for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) { + if (i.getAllocationList() == null) { + i.setAllocationList(new ArrayList<>()); + } + Map map = new HashMap<>(); + map.put("id", allocationInforById.getId()); + map.put("name", allocationInforById.getQrCode()); + i.getAllocationList().add(map); } - Map map = new HashMap<>(); - map.put("id", allocationInforById.getId()); - map.put("name", allocationInforById.getQrCode()); - i.getAllocationList().add(map); } + } }); return list; @@ -1335,17 +1338,19 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl strings = new HashSet(CollUtil.newArrayList(ids)); String res = strings.stream().map(Object::toString).collect(Collectors.joining(",")); String[] newIds = res.split(","); - - List allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(newIds); - for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) { - if (distributionStockupStockListVO.getAllocationList() == null) { - distributionStockupStockListVO.setAllocationList(new ArrayList<>()); + if(!Func.isEmpty(newIds)){ + List allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(newIds); + for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) { + if (distributionStockupStockListVO.getAllocationList() == null) { + distributionStockupStockListVO.setAllocationList(new ArrayList<>()); + } + Map map = new HashMap<>(); + map.put("id", allocationInforById.getId()); + map.put("name", allocationInforById.getQrCode()); + distributionStockupStockListVO.getAllocationList().add(map); } - Map map = new HashMap<>(); - map.put("id", allocationInforById.getId()); - map.put("name", allocationInforById.getQrCode()); - distributionStockupStockListVO.getAllocationList().add(map); } + } @@ -6048,18 +6053,21 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(allocationIds); - if (!allocationInforByIds.isEmpty()) { - List> mapList = new ArrayList<>(); - for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) { - Map map = new HashMap<>(); - map.put("id", allocationInforById.getId()); - map.put("name", allocationInforById.getQrCode()); - mapList.add(map); + if(!Func.isEmpty(allocationIds)){ + List allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(allocationIds); + if (!allocationInforByIds.isEmpty()) { + List> mapList = new ArrayList<>(); + for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) { + Map map = new HashMap<>(); + map.put("id", allocationInforById.getId()); + map.put("name", allocationInforById.getQrCode()); + mapList.add(map); + } + detailVO.setAllocationList(mapList); } - detailVO.setAllocationList(mapList); } + } } @@ -6079,18 +6087,22 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl strings = new HashSet(CollUtil.newArrayList(ids)); String res = strings.stream().map(Object::toString).collect(Collectors.joining(",")); String[] newIds = res.split(","); - List allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(newIds); - if (!allocationInforByIds.isEmpty()) { - List> mapList = new ArrayList<>(); - for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) { - Map map = new HashMap<>(); - map.put("id", allocationInforById.getId()); - map.put("name", allocationInforById.getQrCode()); - mapList.add(map); + if(!Func.isEmpty(newIds)){ + List allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(newIds); + if (!allocationInforByIds.isEmpty()) { + List> mapList = new ArrayList<>(); + for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) { + Map map = new HashMap<>(); + map.put("id", allocationInforById.getId()); + map.put("name", allocationInforById.getQrCode()); + mapList.add(map); + } + inventoryDetailVO.setAllocationList(mapList); } - inventoryDetailVO.setAllocationList(mapList); } + + } }