| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.qc.rqc; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.batch.MesWmBatchDO; |
| | | import cn.iocoder.yudao.module.mes.service.wm.batch.MesWmBatchService; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; |
| | | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| | |
| | | @RequestMapping("/mes/qc/rqc") |
| | | @Validated |
| | | public class MesQcRqcController { |
| | | |
| | | @Resource |
| | | private MesWmBatchService batchService; |
| | | |
| | | @Resource |
| | | private MesQcRqcService rqcService; |
| | |
| | | convertSet(list, MesQcRqcDO::getInspectorUserId)); |
| | | // 批量查询检验项指标 |
| | | Map<Long, String> indicatorSummaryMap = buildIndicatorSummaryMap(list); |
| | | Map<String, MesWmBatchDO> batchMap = new HashMap<>(); |
| | | for (String code : convertSet(list, MesQcRqcDO::getBatchCode)) { |
| | | if (code != null && !code.isBlank()) batchMap.put(code, batchService.getBatchByCode(code)); |
| | | } |
| | | // 拼装 VO |
| | | return BeanUtils.toBean(list, MesQcRqcRespVO.class, vo -> { |
| | | findAndThen(batchMap, vo.getBatchCode(), batch -> vo.setReelNo(batch.getReelNo())); |
| | | findAndThen(itemMap, vo.getItemId(), item -> { |
| | | vo.setItemCode(item.getCode()).setItemName(item.getName()).setItemSpecification(item.getSpecification()); |
| | | findAndThen(unitMeasureMap, item.getUnitMeasureId(), |