鞍钢鲅鱼圈能源管控系统后端代码
潘志宝
7 天以前 eb23bc41da0a27d1aada95744e0262e8cb4f0385
ansteel-biz/src/main/java/com/iailab/module/ansteel/job/task/RunPeakValleyFlatTask.java
@@ -53,6 +53,7 @@
                //计算昨日总电耗
                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();
@@ -72,11 +73,11 @@
                //下发昨日峰/谷累积量
                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);
@@ -86,8 +87,8 @@
                monthDto.setPointNo(entry.getValue().get(0).getPointNoMonth());
                double percentMonth = totalValueMonth == 0 ? 0 : valueMonth / totalValueMonth * 100;
                monthDto.setValue(percentMonth);
                logger.info("name:"+entry.getValue().get(0).getName()+";value:"+value+";valueMonth:"+valueMonth+";totalValueMonth:"+totalValueMonth);
                dataPointApi.writePointRealValue(monthDto);
            });
        } catch (Exception ex) {
            logger.error("runPeakValleyFlatTask运行异常", ex);
@@ -102,6 +103,7 @@
        }
        //根据配置获取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);