| | |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigSaveReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessageSaveReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO; |
| | | import com.iailab.module.model.mcs.sche.entity.StAdjustConfigDetEntity; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; |
| | | import com.iailab.module.model.mcs.sche.service.*; |
| | |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | //处理预测累计 |
| | | if (outPut.getIscumulant() != null && outPut.getIscumulant() == 1) { |
| | | /*if (StringUtils.isNotBlank(outPut.getCumulpoint())) { |
| | | dataView.setCumulantRealData(getHisData(outPut.getCumulpoint(), startTime, endTime)); |
| | | }*/ |
| | | List<Object[]> cumulantPreList = mmItemResultService.getData(outPut.getId() + CommonDict.CUMULANT_SUFFIX, startTime, endTime, DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND); |
| | | dataView.setCumulantPreData(cumulantPreList); |
| | | if (!CollectionUtils.isEmpty(cumulantPreList)) { |
| | | dataView.setCumulantPreLast(new BigDecimal(cumulantPreList.get(cumulantPreList.size() - 1)[1].toString()).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | } |
| | | } |
| | | |
| | | if (!CollectionUtils.isEmpty(dataView.getRealData())) { |
| | | Object[] rdo = dataView.getRealData().get(dataView.getRealData().size() - 1); |
| | | dataView.setCurrValue(new BigDecimal(rdo[1].toString())); |
| | |
| | | |
| | | String alarmObj = chartParams.get(CommonConstant.ALARM_OBJ); |
| | | if (StringUtils.isNotBlank(alarmObj)) { |
| | | List<AlarmMessageRespDTO> alarmList = ConvertUtils.sourceToTarget(mmPredictAlarmMessageService.getList(alarmObj, predictTime), AlarmMessageRespDTO.class); |
| | | String alarmTitle = chartParams.get(CommonConstant.ALARM_TITLE); |
| | | List<AlarmMessageRespDTO> alarmList = ConvertUtils.sourceToTarget(mmPredictAlarmMessageService.getList(alarmObj, predictTime, alarmTitle), AlarmMessageRespDTO.class); |
| | | dataView.setAlarmList(alarmList); |
| | | if (CollectionUtils.isEmpty(alarmList)) { |
| | | dataView.setAlarmMessage("暂无预警信息"); |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public MmItemOutputDTO getItemOutputByItemid(String itemid, String resultstr, String resultIndex) { |
| | | return ConvertUtils.sourceToTarget(mmItemOutputService.getByItemid(itemid,resultstr,resultIndex),MmItemOutputDTO.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<Object[]> getItemResult(PreItemResultReqVO reqVO) { |
| | | |
| | | return mmItemResultService.getData(reqVO.getOutputid(),reqVO.getStartTime(),reqVO.getEndTime(),reqVO.getTimeFormat()); |
| | | } |
| | | |
| | | @Override |
| | | public PredictItemVO getPredictItemByItemNo(String itemNo) { |
| | | return ConvertUtils.sourceToTarget(mmPredictItemService.getItemByItemNo(itemNo),PredictItemVO.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<Object[]> getItemResultLastPoint(PreItemResultReqVO reqVO) { |
| | | return mmItemResultLastPointService.getData(reqVO.getOutputid(),reqVO.getStartTime(),reqVO.getEndTime(),reqVO.getTimeFormat()); |
| | | } |
| | | |
| | | private Date[] calResultTime(ItemVO predictItem, Date startTimeReq, Date endTimeReq, int lengthLeft, int lengthRight) { |
| | | Date[] result = new Date[3]; |
| | | Date predictTime = predictItem.getLastTime(); |