From ed4f78cccbb2cf672d6b3230069979288232ab4a Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期一, 04 十一月 2024 08:25:28 +0800 Subject: [PATCH] 计划数据 --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java | 52 +++++++++++++++++++++++++++++++++------------------- 1 files changed, 33 insertions(+), 19 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java index e8fc098..7c2a365 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java @@ -1,9 +1,12 @@ package com.iailab.module.model.mcs.pre.service.impl; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.data.api.point.DataPointApi; import com.iailab.module.model.mcs.pre.dao.MmPredictItemDao; import com.iailab.module.model.mcs.pre.dto.MmPredictItemDTO; import com.iailab.module.model.mcs.pre.entity.*; @@ -12,6 +15,7 @@ import com.iailab.module.model.mcs.pre.service.MmPredictItemService; import com.iailab.module.model.mcs.pre.service.MmSequenceNumService; import com.iailab.module.model.mcs.pre.vo.MmPredictItemPageReqVO; +import com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO; import com.iailab.module.model.mdk.vo.ItemVO; import com.iailab.module.model.mdk.vo.MergeItemVO; import org.apache.commons.lang3.StringUtils; @@ -55,26 +59,33 @@ @Autowired private MmPredictItemDao mmPredictItemDao; - @Override - public PageResult<MmPredictItemEntity> queryPage(MmPredictItemPageReqVO reqVO) { - return mmPredictItemDao.selectPage(reqVO); - } - -// @Override -// public void add(MmPredictItemEntity mmPredictItemEntity) { -// mmPredictItemDao.insert(mmPredictItemEntity); -// } - -// @Override -// public void update(MmPredictItemEntity mmPredictItemEntity) { -// mmPredictItemDao.updateById(mmPredictItemEntity); -// } + @Autowired + private DataPointApi dataPointApi; @Override - public List<MmPredictItemEntity> list() { - return mmPredictItemDao.selectList(new QueryWrapper<>()); + public PageResult<MmPredictItemRespVO> queryPage(MmPredictItemPageReqVO reqVO) { + IPage<MmPredictItemRespVO> page = mmPredictItemDao.selectPage(reqVO); + + return new PageResult<MmPredictItemRespVO>(page.getRecords(), page.getTotal()); } + @Override + public List<MmPredictItemRespVO> list(Map<String, Object> params) { + return mmPredictItemDao.queryList(params); + } + + @Override + public MmPredictItemEntity getById(String id) { + 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) { MmPredictItemEntity predictItem = mmPredictItemDto.getMmPredictItem(); @@ -125,6 +136,7 @@ mmItemOutputService.saveMmItemOutput(mmItemOutput); } + @DSTransactional(rollbackFor = Exception.class) @Override public void update(MmPredictItemDTO mmPredictItemDto) { MmPredictItemEntity predictItem = mmPredictItemDto.getMmPredictItem(); @@ -151,15 +163,16 @@ mmPredictMergeItemService.update(mMmPredictMergeItem); } DmModuleItemEntity dmModuleItem = mmPredictItemDto.getDmModuleItem(); - if(!"".equals(dmModuleItem.getId()) && dmModuleItem.getId() != null){ + if (!"".equals(dmModuleItem.getId()) && dmModuleItem.getId() != null) { dmModuleItemService.update(dmModuleItem); } MmItemOutputEntity mmItemOutput = mmPredictItemDto.getMmItemOutput(); - if(!"".equals(mmItemOutput.getId()) && dmModuleItem.getId() != null){ + if (!"".equals(mmItemOutput.getId()) && dmModuleItem.getId() != null) { mmItemOutputService.update(mmItemOutput); } } + @DSTransactional(rollbackFor = Exception.class) @Override public void deleteBatch(String[] itemIds) { mmPredictItemDao.deleteBatchIds(Arrays.asList(itemIds)); @@ -181,6 +194,7 @@ mmPredictItemDto.setMmPredictModel(mmPredictModel); 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())) { mmPredictItemDto.setMmPredictMergeItem(mmPredictMergeItemService.getByItemid(id)); } @@ -202,7 +216,7 @@ @Override public List<ItemVO> getByModuleId(String moduleId) { Map<String, Object> params = new HashMap<>(); - + params.put("MODULEID",moduleId); return mmPredictItemDao.getByModuleId(params); } -- Gitblit v1.9.3