| | |
| | | |
| | | private void saveScheduleSuggest(String title, String content, String scheduleObj, Date scheduleTime) { |
| | | if (StringUtils.isBlank(content)) { |
| | | logger.info(title + "调整值为空,不产生建议"); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | private void saveScheduleSuggest(String title, String content, String scheduleObj, Date scheduleTime, BigDecimal adjustValue, int adjustRate) { |
| | | if (StringUtils.isBlank(content)) { |
| | | logger.info(title + "调整值为空,不产生建议"); |
| | | return; |
| | | } |
| | | if (adjustValue == null || adjustValue.doubleValue() == 0) { |
| | | logger.info(title + "调整值为空,不产生建议"); |
| | | return; |
| | | } |
| | | if (gasAdjustMode.containsKey(scheduleObj) && gasAdjustMode.get(scheduleObj).equals(adjustValue.compareTo(BigDecimal.ZERO)) && |
| | | gasLastSugTime.containsKey(scheduleObj) && (scheduleTime.getTime() - gasLastSugTime.get(scheduleObj).getTime() <= Integer.valueOf(adjustRate).longValue() * 60 * 1000)) { |
| | | if (gasAdjustMode.containsKey(title) && gasAdjustMode.get(title).equals(adjustValue.compareTo(BigDecimal.ZERO)) && |
| | | gasLastSugTime.containsKey(title) && (scheduleTime.getTime() - gasLastSugTime.get(title).getTime() <= Integer.valueOf(adjustRate).longValue() * 60 * 1000)) { |
| | | logger.info("调整建议在有效期内"); |
| | | return; |
| | | } |
| | | gasAdjustMode.put(scheduleObj, adjustValue.compareTo(BigDecimal.ZERO)); |
| | | gasLastSugTime.put(scheduleObj, scheduleTime); |
| | | gasAdjustMode.put(title, adjustValue.compareTo(BigDecimal.ZERO)); |
| | | gasLastSugTime.put(title, scheduleTime); |
| | | |
| | | ScheduleSuggestRespDTO suggest = new ScheduleSuggestRespDTO(); |
| | | suggest.setTitle(title); |