From f7a333bb5af595bfd42fd1c5198cf1d967886a40 Mon Sep 17 00:00:00 2001 From: aikai Date: Fri, 25 Oct 2024 12:02:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8E=82=E5=A4=A7=E5=B1=8F=E6=95=B0?= =?UTF-8?q?=E6=8D=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/screendata/ScreenDataServiceImpl.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/service/screendata/ScreenDataServiceImpl.java b/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/service/screendata/ScreenDataServiceImpl.java index 97db4dbe..a9c7d9a8 100644 --- a/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/service/screendata/ScreenDataServiceImpl.java +++ b/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/service/screendata/ScreenDataServiceImpl.java @@ -286,8 +286,8 @@ public class ScreenDataServiceImpl implements ScreenDataService { // List extras = screenFactoryExtraService.list(); // List list = factoryDataOverviewService.list(); //获取工厂列表 - - List factoryList = factoryInfoService.getFactoryList(Collections.singletonList(factoryId)); + List factoryIds = factoryId == null ? Collections.emptyList() : Collections.singletonList(factoryId); + List factoryList = factoryInfoService.getFactoryList(factoryIds); Map factoryMap = factoryList.stream().collect(Collectors.toMap(FactoryInfoDO::getId, v -> v)); // ---------------------------------- 用户 ---------------------------------- // -- 通过工厂id获取部门列表 -> 再通过部门列表获取用户列表 @@ -327,7 +327,7 @@ public class ScreenDataServiceImpl implements ScreenDataService { } vo.setFactoryKilnList(factoryKilnList); // ---------------------------------- 打包线 ---------------------------------- - List factoryPackingLineDOS = factoryPackingLineService.getFactoryPackingLineByFactoryId(Collections.singletonList(factoryId)); + List factoryPackingLineDOS = factoryPackingLineService.getFactoryPackingLineByFactoryId(factoryIds); Map> factoryPackingLineMap = factoryPackingLineDOS.stream().collect(Collectors.groupingBy(FactoryPackingLineDO::getFactoryId)); vo.setDbxNum(factoryPackingLineDOS.size()); List FactoryPackingLineList = new ArrayList<>(); @@ -344,8 +344,8 @@ public class ScreenDataServiceImpl implements ScreenDataService { List forkliftList = new ArrayList<>(); List forkliftOilTypeIds = assetsTypeApi.getAssetsTypeIdsByCode(AssetsTypeCodeEnum.FORKLIFT_OIL).getData(); List forkliftElectricityTypeIds = assetsTypeApi.getAssetsTypeIdsByCode(AssetsTypeCodeEnum.FORKLIFT_ELECTRICITY).getData(); - List factoryForkliftOil = factoryForkliftMapper.getFactoryForkliftByFactoryIdAndTypeIds(Collections.singletonList(factoryId), forkliftOilTypeIds); - List forkliftElectricity = factoryForkliftMapper.getFactoryForkliftByFactoryIdAndTypeIds(Collections.singletonList(factoryId), forkliftElectricityTypeIds); + List factoryForkliftOil = factoryForkliftMapper.getFactoryForkliftByFactoryIdAndTypeIds(factoryIds, forkliftOilTypeIds); + List forkliftElectricity = factoryForkliftMapper.getFactoryForkliftByFactoryIdAndTypeIds(factoryIds, forkliftElectricityTypeIds); vo.setForkliftTotal(factoryForkliftOil.size() + forkliftElectricity.size()); // -- 插入未分配数量 @@ -390,14 +390,14 @@ public class ScreenDataServiceImpl implements ScreenDataService { // ---------------------------------- 托盘 ---------------------------------- List trayAssetsTypeIds = assetsTypeApi.getAssetsTypeIdsByCode(AssetsTypeCodeEnum.TRAY).getData(); - List trayList = screenDataMapper.getAssetsNumByFactoryIdAndTypeIds(Collections.singletonList(factoryId), trayAssetsTypeIds); + List trayList = screenDataMapper.getAssetsNumByFactoryIdAndTypeIds(factoryIds, trayAssetsTypeIds); vo.setTpNum(trayList.stream().mapToInt(AssetsStockVO::getStock).sum()); vo.setTrayList(trayList); // ---------------------------------- 绑带 ---------------------------------- List strapsAssetsTypeIds = assetsTypeApi.getAssetsTypeIdsByCode(AssetsTypeCodeEnum.STRAPS).getData(); - List strapsList = screenDataMapper.getAssetsNumByFactoryIdAndTypeIds(Collections.singletonList(factoryId), strapsAssetsTypeIds); + List strapsList = screenDataMapper.getAssetsNumByFactoryIdAndTypeIds(factoryIds, strapsAssetsTypeIds); vo.setBdNum(strapsList.stream().mapToInt(AssetsStockVO::getStock).sum()); vo.setStrapsList(strapsList);