|
@@ -66,7 +66,7 @@ public class LeanModelStatistics {
|
|
|
@Scheduled(cron = "0 0 03 * * *")
|
|
|
// @Scheduled(fixedDelay = 1000)
|
|
|
public void t2(){
|
|
|
- changeProportion();
|
|
|
+// changeProportion();
|
|
|
} // 1ms
|
|
|
public void changeProportion(){
|
|
|
log.info("变更占比");
|
|
@@ -113,7 +113,7 @@ public class LeanModelStatistics {
|
|
|
|
|
|
@Scheduled(fixedDelay = 500)
|
|
|
public void t3(){
|
|
|
- deviceStatistics("500");
|
|
|
+// deviceStatistics("500");
|
|
|
} // 1ms
|
|
|
// 设备启停统计数据
|
|
|
public void deviceStatistics(String freq) {
|
|
@@ -324,7 +324,10 @@ public class LeanModelStatistics {
|
|
|
} else if("month". equals(fpgLeanModeInfo.getTotalUnit())){ // 月
|
|
|
finalDatestr = new SimpleDateFormat("yyyy-MM").format(fpgGatherData.getCreateTime());
|
|
|
} else if("real_time". equals(fpgLeanModeInfo.getTotalUnit())){ // 实时
|
|
|
- finalDatestr = new SimpleDateFormat("yyyy-MM-dd HH:ii:ss").format(fpgGatherData.getCreateTime());
|
|
|
+ fpgLeanModeInfo.setProportion(2);
|
|
|
+ fpgLeanModeInfo.setElectricCurrent(2);
|
|
|
+ fpgLeanModeInfo.setRunTime(2);
|
|
|
+ finalDatestr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(fpgGatherData.getCreateTime());
|
|
|
}
|
|
|
String dayDate = new SimpleDateFormat("yyyy-MM-dd").format(fpgGatherData.getCreateTime());
|
|
|
String classs = "";
|
|
@@ -341,6 +344,15 @@ public class LeanModelStatistics {
|
|
|
classs = "center";
|
|
|
}
|
|
|
}
|
|
|
+ // 重组对象
|
|
|
+ FpgStatiscsModelData fpgStatiscsModelData = new FpgStatiscsModelData(fpgGatherData, fpgLeanModeInfo, finalDatestr, dayDate, classs, curentDate, curentDate);
|
|
|
+ // 实时统计直接插入
|
|
|
+ if("real_time". equals(fpgLeanModeInfo.getTotalUnit())){
|
|
|
+ fpgStatiscsModelData.setSelectricCurrent(fpgGatherData.getRunCurrent());
|
|
|
+ fpgStatiscsModelData.setPower(fpgGatherData.getActivePower());
|
|
|
+ mongoTemplate.insert(fpgStatiscsModelData, "leanmodel_" + fpgLeanModeInfo.getLeanModelCode());
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 定义尖峰平谷
|
|
|
AtomicReference<String> jfpgStr = new AtomicReference<>("");
|
|
|
// 判断尖峰平谷时段
|
|
@@ -350,8 +362,6 @@ public class LeanModelStatistics {
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
|
- // 重组对象
|
|
|
- FpgStatiscsModelData fpgStatiscsModelData = new FpgStatiscsModelData(fpgGatherData, fpgLeanModeInfo, finalDatestr, dayDate, classs, curentDate, curentDate);
|
|
|
// 组合mongodb条件
|
|
|
Query query = new Query();
|
|
|
query.addCriteria(Criteria.where("devicePointId").is(fpgGatherData.getDevicePointId())).addCriteria(Criteria.where("dates").is(dayDate)).addCriteria(Criteria.where("datestr").is(finalDatestr));
|