| | |
| | | //计算昨日总电耗 |
| | | Calendar cal = (Calendar) calendar.clone(); |
| | | cal.set(Calendar.MILLISECOND, 0); |
| | | cal.set(Calendar.SECOND, 0); |
| | | cal.set(Calendar.MINUTE, 0); |
| | | cal.set(Calendar.HOUR_OF_DAY, 0); |
| | | Date endTime = calendar.getTime(); |
| | |
| | | //下发昨日峰/谷累积量 |
| | | ApiPointValueWriteDTO totalDto = new ApiPointValueWriteDTO(); |
| | | percentDto.setPointNo(entry.getValue().get(0).getPointNoTotal()); |
| | | percentDto.setValue(value); |
| | | percentDto.setValue(totalValue); |
| | | dataPointApi.writePointRealValue(totalDto); |
| | | |
| | | //计算前三十日峰/谷累积量 |
| | | double valueMonth = getSumValueTotal(entry.getValue().get(0).getPointNoTotal(), monthStartTime, endTime); |
| | | double valueMonth = getSumValueTotal(entry.getValue().get(0).getPointNoTotal(), monthStartTime, startTime)+totalValue; |
| | | |
| | | //计算前三十日总电耗 |
| | | double totalValueMonth = getSumValueTotal(entry.getValue().get(0).getPowerNo(), monthStartTime, endTime); |
| | |
| | | double percentMonth = totalValueMonth == 0 ? 0 : valueMonth / totalValueMonth * 100; |
| | | monthDto.setValue(percentMonth); |
| | | dataPointApi.writePointRealValue(monthDto); |
| | | |
| | | }); |
| | | } catch (Exception ex) { |
| | | logger.error("runPeakValleyFlatTask运行异常", ex); |
| | |
| | | } |
| | | //根据配置获取startTime、endTime |
| | | cal.set(Calendar.MILLISECOND, 0); |
| | | cal.set(Calendar.SECOND, 0); |
| | | cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(timeSplit[0])); |
| | | cal.set(Calendar.MINUTE, Integer.parseInt(timeSplit[1])); |
| | | cal.add(Calendar.DAY_OF_YEAR, -ago); |