| | |
| | | package com.iailab.module.model.mcs.sche.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DSTransactional; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | |
| | | |
| | | @Override |
| | | public List<StSuggestSnapshotRecordRespVO> getListBySuggestId(String suggestId) { |
| | | return ConvertUtils.sourceToTarget(baseDao.selectList("suggest_id", suggestId), StSuggestSnapshotRecordRespVO.class); |
| | | QueryWrapper<StSuggestSnapshotRecordEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("suggest_id", suggestId); |
| | | queryWrapper.orderByAsc("sort"); |
| | | return ConvertUtils.sourceToTarget(baseDao.selectList(queryWrapper), StSuggestSnapshotRecordRespVO.class); |
| | | } |
| | | |
| | | @Override |
| | |
| | | snapshotRecordSaveReqVO.setDataType(confDet.getDataType()); |
| | | snapshotRecordSaveReqVO.setDataName(confDet.getDataName()); |
| | | snapshotRecordSaveReqVO.setScheduleTime(scheduleTime); |
| | | snapshotRecordSaveReqVO.setSort(confDet.getSort()); |
| | | //计算开始时间,开始时间为当前调度时间减去快照配置表配置的左侧时间长度 |
| | | LocalDateTime localStartDateTime = scheduleTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().minusMinutes(confDet.getLeftLength() == null ? 60 : confDet.getLeftLength()); |
| | | Date startTime = Date.from(localStartDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | snapshotRecordSaveReqVO.setStartTime(startTime); |
| | | //计算结束时间,结束时间为当前调度时间加上快照配置表配置的右侧时间长度 |
| | | LocalDateTime localEndDateTime = scheduleTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().plusMinutes(confDet.getRightLength() == null ? 60 : confDet.getLeftLength()); |
| | | LocalDateTime localEndDateTime = scheduleTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().plusMinutes(confDet.getRightLength() == null ? 60 : confDet.getRightLength()); |
| | | Date endTime = Date.from(localEndDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | snapshotRecordSaveReqVO.setEndTime(endTime); |
| | | this.create(snapshotRecordSaveReqVO); |
| | |
| | | if (valueList != null && !valueList.isEmpty()){ |
| | | for (ApiPointValueDTO apiPointValueDTO : valueList) { |
| | | Object[] data = new Object[2]; |
| | | data[0] = DateUtils.format(new Date(String.valueOf(apiPointValueDTO.getT())), DATE_TIME_PATTERN); |
| | | data[0] = DateUtils.format(apiPointValueDTO.getT(), DATE_TIME_PATTERN); |
| | | data[1] = apiPointValueDTO.getV(); |
| | | dataList.add(data); |
| | | } |
| | |
| | | if (valueList != null && !valueList.isEmpty()){ |
| | | for (ApiIndItemValueDTO apiIndItemValueDTO : valueList) { |
| | | Object[] data = new Object[2]; |
| | | data[0] = DateUtils.format(new Date(apiIndItemValueDTO.getDataTime()), DATE_TIME_PATTERN); |
| | | data[0] = apiIndItemValueDTO.getDataTime(); |
| | | data[1] = apiIndItemValueDTO.getDataValue(); |
| | | dataList.add(data); |
| | | } |