| | |
| | | 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.*; |
| | |
| | | @Autowired |
| | | private MmPredictItemDao mmPredictItemDao; |
| | | |
| | | @Autowired |
| | | private DataPointApi dataPointApi; |
| | | |
| | | @Override |
| | | public PageResult<MmPredictItemRespVO> queryPage(MmPredictItemPageReqVO reqVO) { |
| | | IPage<MmPredictItemRespVO> page = mmPredictItemDao.selectPage(reqVO); |
| | | |
| | | return new PageResult<MmPredictItemRespVO>(page.getRecords(), page.getTotal()); |
| | | return new PageResult<MmPredictItemRespVO>(page.getRecords(), page.getTotal()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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(); |
| | |
| | | mmItemOutputService.saveMmItemOutput(mmItemOutput); |
| | | } |
| | | |
| | | @DSTransactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void update(MmPredictItemDTO mmPredictItemDto) { |
| | | MmPredictItemEntity predictItem = mmPredictItemDto.getMmPredictItem(); |
| | |
| | | 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)); |
| | |
| | | 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)); |
| | | } |
| | |
| | | @Override |
| | | public List<ItemVO> getByModuleId(String moduleId) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | |
| | | params.put("MODULEID",moduleId); |
| | | return mmPredictItemDao.getByModuleId(params); |
| | | } |
| | | |