| | |
| | | |
| | | @Autowired |
| | | private StScheduleModelSettingService stScheduleModelSettingService; |
| | | |
| | | @Autowired |
| | | private MmPredictAutoAdjustConfigService autoAdjustService; |
| | | private int HOUR_MINS = 60; |
| | | |
| | | @Override |
| | |
| | | PredictItemTreeDTO chd = new PredictItemTreeDTO(); |
| | | chd.setLabel(item1.getItemName()); |
| | | chd.setId(item1.getId()); |
| | | chd.setDisabled(true); |
| | | List<PredictItemTreeDTO> chd1 = new ArrayList<>(); |
| | | List<MmItemOutputEntity> outList = mmItemOutputService.getByItemid(item1.getId()); |
| | | if (!CollectionUtils.isEmpty(outList)) { |
| | |
| | | |
| | | if (!CollectionUtils.isEmpty(dataView.getCurData())) { |
| | | List<Double> curList = dataView.getCurData().stream().map(t -> { |
| | | return new Double(t[1].toString()); |
| | | }).collect(Collectors.toList()); |
| | | dataView.setPreMax(new BigDecimal(curList.stream().mapToDouble(Double::doubleValue).max().getAsDouble()).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | dataView.setPreMin(new BigDecimal(curList.stream().mapToDouble(Double::doubleValue).min().getAsDouble()).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | dataView.setPreLast(new BigDecimal(curList.get(curList.size() - 1)).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | dataView.setPreCumulant(new BigDecimal(curList.stream().mapToDouble(Double::doubleValue).sum()).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | try { |
| | | return new Double(t[1].toString()); |
| | | } catch (NumberFormatException e) { |
| | | return null; |
| | | } |
| | | }).filter(Objects::nonNull).collect(Collectors.toList()); |
| | | if (!curList.isEmpty()) { |
| | | dataView.setPreMax(new BigDecimal(curList.stream().mapToDouble(Double::doubleValue).max().getAsDouble()).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | dataView.setPreMin(new BigDecimal(curList.stream().mapToDouble(Double::doubleValue).min().getAsDouble()).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | dataView.setPreLast(new BigDecimal(curList.get(curList.size() - 1)).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | dataView.setPreCumulant(new BigDecimal(curList.stream().mapToDouble(Double::doubleValue).sum()).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | } else { |
| | | dataView.setPreMax(null); |
| | | dataView.setPreMin(null); |
| | | dataView.setPreLast(null); |
| | | dataView.setPreCumulant(null); |
| | | } |
| | | } |
| | | |
| | | String alarmObj = chartParams.get(CommonConstant.ALARM_OBJ); |
| | |
| | | } |
| | | List<String[]> itemNos = reqVO.getItemNos(); |
| | | for (String[] itemNo : itemNos) { |
| | | String key = itemNo[0] + "_" + itemNo[1] + "_" + itemNo[2]; |
| | | String key = itemNo[0] + "," + itemNo[1] + "," + itemNo[2]; |
| | | ItemVO predictItem = mmPredictItemService.getItemByItemNo(itemNo[0]); |
| | | if (predictItem == null || predictItem.getLastTime() == null) { |
| | | result.put(key, BigDecimal.ZERO); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ScheduleSuggestRespDTO> getLastSuggest(Map<String, Object> params) { |
| | | return stScheduleSuggestService.getLastSuggest(params); |
| | | public Boolean ignoreSuggest(StAlarmAndSuggestReqVO reqVO) { |
| | | return stScheduleSuggestService.ignoreSuggest(reqVO); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean autoAdjustByCode(MmPredictAutoAdjustReqVO reqVO) { |
| | | return autoAdjustService.autoAdjustByCode(reqVO.getConfigCode(), reqVO.getAdjustStartTime()); |
| | | public List<ScheduleSuggestRespDTO> getLastSuggest(Map<String, Object> params) { |
| | | return stScheduleSuggestService.getLastSuggest(params); |
| | | } |
| | | |
| | | private Date[] calResultTime(ItemVO predictItem, Date startTimeReq, Date endTimeReq, int lengthLeft, int lengthRight) { |