| | |
| | | @Operation(summary = "获取物料精简列表(启用状态,用于下拉选择)") |
| | | public CommonResult<List<MdmItemRespVO>> getItemSimpleList() { |
| | | List<MdmItemDO> list = itemService.getItemSimpleList(); |
| | | return success(BeanUtils.toBean(list, MdmItemRespVO.class)); |
| | | List<MdmItemRespVO> respList = BeanUtils.toBean(list, MdmItemRespVO.class); |
| | | // 填充单位名称等关联字段,确保下拉选择后可带出单位等信息 |
| | | Map<Long, MdmUnitMeasureDO> unitMap = unitMeasureService.getUnitMeasureMap( |
| | | convertSet(respList, MdmItemRespVO::getUnitMeasureId)); |
| | | respList.forEach(resp -> { |
| | | MdmUnitMeasureDO unit = unitMap.get(resp.getUnitMeasureId()); |
| | | if (unit != null) { |
| | | resp.setUnitMeasureName(unit.getName()); |
| | | } |
| | | }); |
| | | return success(respList); |
| | | } |
| | | |
| | | /** |