| | |
| | | dto.setValue(value/totalValue*100); |
| | | dataPointApi.writePointRealValue(dto); |
| | | |
| | | //计算前三十日累积量 |
| | | double value30 = 0; |
| | | for (int i = 1; i < 31; i++) { |
| | | if(entry.getValue().get(0).getPointNoMonth()!=null){ |
| | | //计算前三十日累积量 |
| | | value30 = value30 + getSumValue(entry.getValue(), i, calendar); |
| | | double value30 = 0; |
| | | for (int i = 1; i < 31; i++) { |
| | | //计算前三十日累积量 |
| | | value30 = value30 + getSumValue(entry.getValue(), i, calendar); |
| | | } |
| | | |
| | | //计算前三十日总电耗 |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.add(Calendar.DAY_OF_YEAR, -30); |
| | | Date startTimeMonth = calendar.getTime(); |
| | | double totalValueMonth = getSumValueTotal(entry.getValue().get(0).getPowerNo(), startTimeMonth,endTime); |
| | | |
| | | //下发前三十日占比 |
| | | ApiPointValueWriteDTO monthDto = new ApiPointValueWriteDTO(); |
| | | monthDto.setPointNo(entry.getValue().get(0).getPointNoMonth()); |
| | | monthDto.setValue(value30/totalValueMonth*100); |
| | | dataPointApi.writePointRealValue(monthDto); |
| | | } |
| | | |
| | | //计算前三十日总电耗 |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.add(Calendar.DAY_OF_YEAR, -30); |
| | | Date startTimeMonth = calendar.getTime(); |
| | | double totalValueMonth = getSumValueTotal(entry.getValue().get(0).getPowerNo(), startTimeMonth,endTime); |
| | | |
| | | //下发前三十日占比 |
| | | ApiPointValueWriteDTO monthDto = new ApiPointValueWriteDTO(); |
| | | monthDto.setPointNo(entry.getValue().get(0).getPointNoMonth()); |
| | | monthDto.setValue(value30/totalValueMonth*100); |
| | | dataPointApi.writePointRealValue(monthDto); |
| | | }); |
| | | } catch (Exception ex) { |
| | | logger.error("runPeakValleyFlatTask运行异常"); |