diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/modelmanagement/ModelManagementServiceImpl.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/modelmanagement/ModelManagementServiceImpl.java index a25e4148..ee2e6a35 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/modelmanagement/ModelManagementServiceImpl.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/modelmanagement/ModelManagementServiceImpl.java @@ -255,6 +255,13 @@ public class ModelManagementServiceImpl implements ModelManagementService { List commonDisasterDataList = disasterDataService.getDisasterDataList(reqVO); Map commonDisasterDataMap = commonDisasterDataList.stream().collect(Collectors.toMap(DisasterDataDO::getName, e -> e, (v1, v2) -> v1)); + List unit1List= sysDictService.getByTypeCode(CommonConstants.DICT_TYPE_CODE_4_1); // 吨 + Map unit1Map = unit1List.stream().filter(e -> e.getField2Code() != null).collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1)); + + List unit2List= sysDictService.getByTypeCode(CommonConstants.DICT_TYPE_CODE_4_2); // 包 + Map unit2Map = unit2List.stream().filter(e -> e.getField2Code() != null).collect(Collectors.toMap(SysDictDO::getField1Code, SysDictDO::getField1Name, (v1, v2) -> v1)); + + ModelManagementDO modelManagementDO = modelManagementMapper.selectById(id); if (modelManagementDO == null) { return null; @@ -296,6 +303,8 @@ public class ModelManagementServiceImpl implements ModelManagementService { List farmingOperationInputDOS = modelFarmingOperationInputMapper.selectByFarmingId(e.getId()); for (ModelFarmingOperationInputDO aDo : farmingOperationInputDOS) { aDo.setInputsName(dictMap.get(aDo.getInputsId())); + aDo.setUnitName(unit1Map.get(aDo.getUnit())); + aDo.setPackageUnitName(unit2Map.get(aDo.getPackageUnit())); } respVO.setFarmingOperationInputDOS(farmingOperationInputDOS); respVOS.add(respVO);