diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java index e9051a1d..6e53baa0 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java @@ -108,7 +108,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl wares = items.stream().filter(item -> item.getItemType().equals("02")).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(wares)) { + // 单位字典 + List recordTypeList = dictDataApi.getDictDataList(DICT_REPAIR_UNIT); + Map unitMap = recordTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue,DictDataRespDTO::getLabel)); + Set ids = wares.stream().map(DlRepairTitemReqVO::getPartId).collect(Collectors.toSet()); List repairWares = waresService.listByIds(ids); - items.forEach(item -> repairWares.stream().filter(i -> i.getId().equals(item.getPartId())).findFirst().ifPresent(item::setWare)); + items.forEach(item -> { + repairWares.stream().filter(i -> i.getId().equals(item.getPartId())).findFirst().ifPresent(item::setWare); + item.setItemUnit(unitMap.get(item.getItemUnit())); + }); } result.setWares(wares); // 取附加