Ver código fonte

风速功率曲线问题处理

wangb 1 mês atrás
pai
commit
b4c1607c7c

+ 5 - 1
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/agc/AgcDeviateService.java

@@ -363,7 +363,11 @@ public class AgcDeviateService {
             List<ProBasicEquipmentPoint> proBasicEquipmentPoints = CacheContext.pointNewMap.get(wtId);
             List<ProBasicEquipmentPoint> speedPoint = proBasicEquipmentPoints.stream().filter(p -> p.getUniformCode().equals("AI066")).collect(Collectors.toList());
             List<PointData> historyspeedDatas = edosUtil.getHistoryDatasSnap(speedPoint.get(0).getNemCode(), startTs, endTs, interval);
-            List<Double> speedDatas = historyspeedDatas.stream().map(PointData::getPointValueInDouble).collect(Collectors.toList());
+            List<Double> speedDatas = historyspeedDatas.stream()
+                    .map(point->{
+                        double value = point.getPointValueInDouble();
+                        return  NumberUtil.round(value, 2).doubleValue();
+                    }).collect(Collectors.toList());
             spa.setWindSpeed(speedDatas);
             List<Long> time = historyspeedDatas.stream().map(PointData::getPointTime).collect(Collectors.toList());
             spa.setTime(time);

+ 14 - 10
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/TurbineInfoDayServiceImpl.java

@@ -15,7 +15,7 @@ import java.util.List;
 
 /**
  * <p>
- *  服务实现类
+ * 服务实现类
  * </p>
  *
  * @author author
@@ -85,12 +85,16 @@ public class TurbineInfoDayServiceImpl extends ServiceImpl<TurbineInfoDayMapper,
 
     @Override
     public List<TurbineInfoDay> getTurbineMonthList(String windpowerstationId, LocalDate startDate, LocalDate endDate) {
+        int dayOfMonth = endDate.getDayOfMonth();
         QueryWrapper<TurbineInfoDay> qw = new QueryWrapper<>();
         qw.eq("station_id", windpowerstationId)
-                .ge("record_date", startDate)
-                .lt("record_date", endDate)
-                .groupBy("turbine_id",
-                        "to_char(record_date, 'yyyy-MM')" )
+                .ge("record_date", startDate);
+        if (dayOfMonth == 1) {
+            qw.le("record_date", endDate);
+        }else {
+            qw.lt("record_date", endDate);
+        }
+        qw.groupBy("turbine_id", "to_char(record_date, 'yyyy-MM')")
                 .orderByAsc("turbine_id")
                 .select(
                         "turbine_id",
@@ -131,7 +135,7 @@ public class TurbineInfoDayServiceImpl extends ServiceImpl<TurbineInfoDayMapper,
                         "AVG(bll) as bll",
                         "SUM(score) as score",
                         "AVG(glyzxxs) as glyzxxs"
-                        );
+                );
         return baseMapper.selectList(qw);
     }
 
@@ -139,8 +143,8 @@ public class TurbineInfoDayServiceImpl extends ServiceImpl<TurbineInfoDayMapper,
     public List<TurbineInfoDay> getTurbineInfoDayList(String wpid, String kssj) throws ParseException {
         QueryWrapper<TurbineInfoDay> qw = new QueryWrapper<>();
         Date kssjDate = new SimpleDateFormat("yyyy-MM-dd").parse(kssj);
-        qw.lambda().eq(TurbineInfoDay::getTurbineId,wpid);
-        qw.lambda().eq(TurbineInfoDay::getRecordDate,kssjDate);
+        qw.lambda().eq(TurbineInfoDay::getTurbineId, wpid);
+        qw.lambda().eq(TurbineInfoDay::getRecordDate, kssjDate);
         List<TurbineInfoDay> list = baseMapper.selectList(qw);
         return list;
     }
@@ -150,8 +154,8 @@ public class TurbineInfoDayServiceImpl extends ServiceImpl<TurbineInfoDayMapper,
         QueryWrapper<TurbineInfoDay> qw = new QueryWrapper<>();
         Date kssjDate = new SimpleDateFormat("yyyy-MM-dd").parse(kssj);
         Date jssjDate = new SimpleDateFormat("yyyy-MM-dd").parse(jssj);
-        qw.lambda().eq(TurbineInfoDay::getTurbineId,wtid);
-        qw.lambda().between(TurbineInfoDay::getRecordDate,kssjDate,jssjDate);
+        qw.lambda().eq(TurbineInfoDay::getTurbineId, wtid);
+        qw.lambda().between(TurbineInfoDay::getRecordDate, kssjDate, jssjDate);
         List<TurbineInfoDay> list = baseMapper.selectList(qw);
         return list;
     }