Jay
2025-02-18 154b38709aa8151222382240392f120ae5542a69
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java
@@ -80,12 +80,29 @@
    @Override
    public List<MmPredictItemRespVO> getDoubleOutPutsByItemNos(List<String> itemNos) {
        if (CollectionUtils.isEmpty(itemNos)) {
        List<Integer> resultType = new ArrayList<Integer>(){{
           add(3);
        }};
        return getOutPutsByItemNosAndResultType(itemNos,resultType);
    }
    @Override
    public List<MmPredictItemRespVO> getArrayOutPutsByItemNos(List<String> itemNos) {
        List<Integer> resultType = new ArrayList<Integer>(){{
            add(1);
            add(2);
        }};
        return getOutPutsByItemNosAndResultType(itemNos,resultType);
    }
    public List<MmPredictItemRespVO> getOutPutsByItemNosAndResultType(List<String> itemNos,List<Integer> resultType) {
        if (CollectionUtils.isEmpty(itemNos) || CollectionUtils.isEmpty(resultType)) {
            return new ArrayList<>();
        }
        Map<String, Object> params = new HashMap(1);
        params.put("itemNos", itemNos);
        List<MmPredictItemRespVO> list = mmPredictItemDao.getDoubleOutPutsByItemNos(params);
        params.put("resultType", resultType);
        List<MmPredictItemRespVO> list = mmPredictItemDao.getOutPutsByItemNosAndResultType(params);
        return list;
    }
@@ -135,6 +152,10 @@
            entity.setPointid(mmPredictItemDto.getPointId());
            entity.setResultName(mmPredictItemDto.getMmPredictItem().getItemname());
            entity.setResultstr("result");
            //累计配置
            entity.setIscumulant(mmPredictItemDto.getIscumulant());
            entity.setCumuldivisor(mmPredictItemDto.getCumuldivisor());
            entity.setCumulpoint(mmPredictItemDto.getCumulpoint());
            mergeItemOutput.add(entity);
            mmPredictItemDto.setMmItemOutputList(mergeItemOutput);
        }
@@ -187,10 +208,20 @@
                entity.setPointid(mmPredictItemDto.getPointId());
                entity.setResultName(mmPredictItemDto.getMmPredictItem().getItemname());
                entity.setResultstr("result");
                //累计配置
                entity.setIscumulant(mmPredictItemDto.getIscumulant());
                entity.setCumuldivisor(mmPredictItemDto.getCumuldivisor());
                entity.setCumulpoint(mmPredictItemDto.getCumulpoint());
                mmItemOutputList.add(entity);
                mmPredictItemDto.setMmItemOutputList(mmItemOutputList);
            } else {
                mmPredictItemDto.getMmItemOutputList().forEach(e -> e.setPointid(mmPredictItemDto.getPointId()));
                mmPredictItemDto.getMmItemOutputList().forEach(entity -> {
                    entity.setPointid(mmPredictItemDto.getPointId());
                    //累计配置
                    entity.setIscumulant(mmPredictItemDto.getIscumulant());
                    entity.setCumuldivisor(mmPredictItemDto.getCumuldivisor());
                    entity.setCumulpoint(mmPredictItemDto.getCumulpoint());
                });
            }
        }
        DmModuleItemEntity dmModuleItem = mmPredictItemDto.getDmModuleItem();
@@ -249,6 +280,10 @@
            mmPredictItemDto.setMmPredictMergeItem(mmPredictMergeItemService.getByItemid(id));
            if (!CollectionUtils.isEmpty(mmPredictItemDto.getMmItemOutputList())) {
                mmPredictItemDto.setPointId(mmPredictItemDto.getMmItemOutputList().get(0).getPointid());
                //累计配置
                mmPredictItemDto.setIscumulant(mmPredictItemDto.getMmItemOutputList().get(0).getIscumulant());
                mmPredictItemDto.setCumuldivisor(mmPredictItemDto.getMmItemOutputList().get(0).getCumuldivisor());
                mmPredictItemDto.setCumulpoint(mmPredictItemDto.getMmItemOutputList().get(0).getCumulpoint());
            }
        }
        return mmPredictItemDto;