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
@@ -152,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);
        }
@@ -175,7 +179,6 @@
    @Override
    public void update(MmPredictItemDTO mmPredictItemDto) {
        MmPredictItemEntity predictItem = mmPredictItemDto.getMmPredictItem();
        predictItem.setCumulpoint(predictItem.getCumulpoint() == null? "" : predictItem.getCumulpoint());
        predictItem.setUpdateTime(new Date());
        mmPredictItemDao.updateById(predictItem);
        MmItemTypeEntity itemType = mmItemTypeImpl.getById(predictItem.getItemtypeid());
@@ -205,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();
@@ -267,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;