潘志宝
2024-11-15 9e844c4d7cd254a69accdf10dd09df962afceeb2
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java
@@ -75,12 +75,6 @@
        return  mmPredictItemDao.selectById(id);
    }
    @Override
    public List<Object[]> getHisData(String itemId, Date startTime, Date endTime) {
        List<Object[]> result = new ArrayList<>();
        return result;
    }
    @DSTransactional(rollbackFor = Exception.class)
    @Override
    public void add(MmPredictItemDTO mmPredictItemDto) {
@@ -127,8 +121,11 @@
        dmModuleItem.setItemid(predictItem.getId());
        dmModuleItemService.saveModuleItem(dmModuleItem);
        MmItemOutputEntity mmItemOutput = mmPredictItemDto.getMmItemOutput();
        mmItemOutput.setItemid(predictItem.getId());
        List<MmItemOutputEntity> mmItemOutput = mmPredictItemDto.getMmItemOutputList();
        mmItemOutput.forEach(e -> {
            e.setId(UUID.randomUUID().toString());
            e.setItemid(predictItem.getId());
        });
        mmItemOutputService.saveMmItemOutput(mmItemOutput);
    }
@@ -162,10 +159,13 @@
        if (!"".equals(dmModuleItem.getId()) && dmModuleItem.getId() != null) {
            dmModuleItemService.update(dmModuleItem);
        }
        MmItemOutputEntity mmItemOutput = mmPredictItemDto.getMmItemOutput();
        if (!"".equals(mmItemOutput.getId()) && dmModuleItem.getId() != null) {
            mmItemOutputService.update(mmItemOutput);
        }
        mmItemOutputService.deleteByItemId(predictItem.getId());
        List<MmItemOutputEntity> mmItemOutput = mmPredictItemDto.getMmItemOutputList();
        mmItemOutput.forEach(e -> {
            e.setId(UUID.randomUUID().toString());
            e.setItemid(predictItem.getId());
        });
        mmItemOutputService.saveMmItemOutput(mmItemOutput);
    }
    @DSTransactional(rollbackFor = Exception.class)
@@ -183,12 +183,12 @@
        MmPredictItemDTO mmPredictItemDto = BeanUtils.toBean(predictItem, MmPredictItemDTO.class);
        mmPredictItemDto.setMmPredictItem(predictItem);
        mmPredictItemDto.setDmModuleItem(dmModuleItemService.getByItemid(id));
        mmPredictItemDto.setMmItemOutput(mmItemOutputService.getByItemid(id));
        mmPredictItemDto.setMmItemOutputList(mmItemOutputService.getByItemid(id));
        MmItemTypeEntity itemType = mmItemTypeImpl.getById(predictItem.getItemtypeid());
        if (itemType != null && ItemTypeEnum.NORMAL_ITEM.getName().equals(itemType.getItemtypename())) {
            MmPredictModelEntity mmPredictModel = mmPredictModelService.getByItemid(id);
            mmPredictItemDto.setMmPredictModel(mmPredictModel);
            mmPredictItemDto.setMmModelArithSettingsList(mmModelArithSettingsService.getByModelid(mmPredictModel.getId()));
            mmPredictItemDto.setMmModelArithSettingsList(mmModelArithSettingsService.getByModelId(mmPredictModel.getId()));
            mmPredictItemDto.setMmModelParamList(mmModelParamService.getByModelid(mmPredictModel.getId()));
            mmPredictItemDto.setMmPredictMergeItem(new MmPredictMergeItemEntity());
        } else if (itemType != null && ItemTypeEnum.MERGE_ITEM.getName().equals(itemType.getItemtypename())) {