Commit 59cb4577d880622caff4f1324422bcbff559848b
1 parent
a1c14c49
✨ feat(mes): 添加计量单位名称到生产任务响应对象
Showing
2 changed files
with
10 additions
and
2 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/task/MesProTaskController.java
| @@ -217,6 +217,8 @@ public class MesProTaskController { | @@ -217,6 +217,8 @@ public class MesProTaskController { | ||
| 217 | new ArrayList<>(convertSet(list, MesProTaskDO::getProcessId))); | 217 | new ArrayList<>(convertSet(list, MesProTaskDO::getProcessId))); |
| 218 | Map<Long, MesMdItemDO> itemMap = itemService.getItemMap( | 218 | Map<Long, MesMdItemDO> itemMap = itemService.getItemMap( |
| 219 | convertSet(list, MesProTaskDO::getItemId)); | 219 | convertSet(list, MesProTaskDO::getItemId)); |
| 220 | + Map<Long, MesMdUnitMeasureDO> unitMeasureMap = unitMeasureService.getUnitMeasureMap( | ||
| 221 | + convertSet(itemMap.values(), MesMdItemDO::getUnitMeasureId)); | ||
| 220 | Map<Long, MesMdClientDO> clientMap = clientService.getClientMap( | 222 | Map<Long, MesMdClientDO> clientMap = clientService.getClientMap( |
| 221 | convertSet(list, MesProTaskDO::getClientId)); | 223 | convertSet(list, MesProTaskDO::getClientId)); |
| 222 | // 工序的 checkFlag:批量查询后构建 routeId -> processId -> checkFlag 的双层 Map | 224 | // 工序的 checkFlag:批量查询后构建 routeId -> processId -> checkFlag 的双层 Map |
| @@ -239,8 +241,11 @@ public class MesProTaskController { | @@ -239,8 +241,11 @@ public class MesProTaskController { | ||
| 239 | vo.setWorkstationCode(ws.getCode()).setWorkstationName(ws.getName())); | 241 | vo.setWorkstationCode(ws.getCode()).setWorkstationName(ws.getName())); |
| 240 | findAndThen(processMap, task.getProcessId(), p -> | 242 | findAndThen(processMap, task.getProcessId(), p -> |
| 241 | vo.setProcessName(p.getName())); | 243 | vo.setProcessName(p.getName())); |
| 242 | - findAndThen(itemMap, task.getItemId(), item -> | ||
| 243 | - vo.setItemCode(item.getCode()).setItemName(item.getName()).setItemSpecification(item.getSpecification())); | 244 | + findAndThen(itemMap, task.getItemId(), item -> { |
| 245 | + vo.setItemCode(item.getCode()).setItemName(item.getName()).setItemSpecification(item.getSpecification()); | ||
| 246 | + findAndThen(unitMeasureMap, item.getUnitMeasureId(), unit -> | ||
| 247 | + vo.setUnitMeasureName(unit.getName())); | ||
| 248 | + }); | ||
| 244 | findAndThen(clientMap, task.getClientId(), c -> | 249 | findAndThen(clientMap, task.getClientId(), c -> |
| 245 | vo.setClientName(c.getName())); | 250 | vo.setClientName(c.getName())); |
| 246 | findAndThen(routeProcessCheckFlagMap, task.getRouteId(), processCheckMap -> | 251 | findAndThen(routeProcessCheckFlagMap, task.getRouteId(), processCheckMap -> |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/task/vo/MesProTaskRespVO.java
| @@ -58,6 +58,9 @@ public class MesProTaskRespVO { | @@ -58,6 +58,9 @@ public class MesProTaskRespVO { | ||
| 58 | @Schema(description = "规格型号", example = "100x200mm") | 58 | @Schema(description = "规格型号", example = "100x200mm") |
| 59 | private String itemSpecification; | 59 | private String itemSpecification; |
| 60 | 60 | ||
| 61 | + @Schema(description = "计量单位名称", example = "个") | ||
| 62 | + private String unitMeasureName; | ||
| 63 | + | ||
| 61 | @Schema(description = "排产数量", example = "100.00") | 64 | @Schema(description = "排产数量", example = "100.00") |
| 62 | private BigDecimal quantity; | 65 | private BigDecimal quantity; |
| 63 | 66 |