|
@@ -3,6 +3,7 @@ package com.gyee.runeconomy.service.agc;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.lang.TypeReference;
|
|
|
+import cn.hutool.core.util.NumberUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -295,7 +296,7 @@ public class AgcDeviateService {
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
- public Page<PowerLossesDTO> getAgcxd(long startTs, long endTs,int pageNum, int pageSize) {
|
|
|
+ public Page<PowerLossesDTO> getAgcxd(long startTs, long endTs, int pageNum, int pageSize) {
|
|
|
|
|
|
LocalDateTime startDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(startTs), ZoneId.systemDefault());
|
|
|
LocalDateTime endDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(endTs), ZoneId.systemDefault());
|
|
@@ -384,6 +385,27 @@ public class AgcDeviateService {
|
|
|
factory.afterPropertiesSet();
|
|
|
factory.resetConnection();
|
|
|
|
|
|
+ for (String s : map.keySet()) {
|
|
|
+ List<SpeedPowerAnalysis> list = map.get(s);
|
|
|
+ List<Double> actuatedPower = list.get(0).getActuatedPower();
|
|
|
+ List<Double> theoreticalPower = list.get(0).getTheoreticalPower();
|
|
|
+ if (null == actuatedPower || null == theoreticalPower || 0 == actuatedPower.size() || 0 == theoreticalPower.size()) {
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ int length = actuatedPower.size();
|
|
|
+ if (actuatedPower.size() != theoreticalPower.size()) {
|
|
|
+ length = Math.min(actuatedPower.size(), theoreticalPower.size());
|
|
|
+ }
|
|
|
+ for (int i = 0; i < length; i++) {
|
|
|
+ if (theoreticalPower.get(i) < actuatedPower.get(i)) {
|
|
|
+ double act = 0.0;
|
|
|
+ if (actuatedPower.get(i) > 0) {
|
|
|
+ act = actuatedPower.get(i) * 1.001;
|
|
|
+ }
|
|
|
+ theoreticalPower.set(i, NumberUtil.round(act, 2).doubleValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return map;
|
|
|
}
|
|
|
|