|
@@ -35,20 +35,34 @@ public class EquipmentInfo15minuteService {
|
|
|
/**
|
|
|
* 计算设备15分钟信息
|
|
|
*/
|
|
|
- public void calLineInfoMinute15(Date recordDate) throws Exception {
|
|
|
+ public void calEquipmentInfo15minute(Date recordDate) throws Exception {
|
|
|
Calendar c=Calendar.getInstance();
|
|
|
c.setTime(recordDate);
|
|
|
|
|
|
+ int minute= c.get(Calendar.MINUTE);
|
|
|
+ if(minute>=0 && minute<15){
|
|
|
+ c.set(Calendar.MINUTE,0);
|
|
|
+ }
|
|
|
+ else if(minute>=15 && minute<30)
|
|
|
+ {
|
|
|
+ c.set(Calendar.MINUTE,15);
|
|
|
+ }else if(minute>=30 && minute<45){
|
|
|
+ c.set(Calendar.MINUTE,30);
|
|
|
+ }else if(minute>=45 ){
|
|
|
+ c.set(Calendar.MINUTE,45);
|
|
|
+ }
|
|
|
+ c.set(Calendar.SECOND,0);
|
|
|
Date end=c.getTime();
|
|
|
c.add(Calendar.MINUTE,-15);
|
|
|
Date begin= DateUtils.truncate(c.getTime());
|
|
|
|
|
|
QueryWrapper<ProEconEquipmentInfo15minute> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.ge("record_date",DateUtils.truncate(recordDate));
|
|
|
+ queryWrapper.ge("record_date",recordDate);
|
|
|
+
|
|
|
//判断是否有重复记录,先删除重复记录
|
|
|
List<String> idls = proEconEquipmentInfo15minuteService.list(queryWrapper)
|
|
|
.stream()
|
|
|
-// .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
|
|
|
+// .filter(i -> i.getRecordDate().compareTo(recordDate)==0
|
|
|
// && CacheContext.wtmap.containsKey(i.getWindturbineId())
|
|
|
// )
|
|
|
.map(ProEconEquipmentInfo15minute::getId)
|
|
@@ -72,7 +86,7 @@ public class EquipmentInfo15minuteService {
|
|
|
pewp.setLineId(wt.getLineId());
|
|
|
pewp.setProjectId(wt.getProjectId());
|
|
|
pewp.setRegionId(wt.getRegionId());
|
|
|
- pewp.setRecordDate(DateUtils.truncate(recordDate));
|
|
|
+ pewp.setRecordDate(recordDate);
|
|
|
|
|
|
|
|
|
|
|
@@ -336,8 +350,6 @@ public class EquipmentInfo15minuteService {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|