|
@@ -306,6 +306,8 @@ public class EconomyAnalysisService {
|
|
|
}
|
|
|
|
|
|
private Map<String, List<String>> getWord(String wpid, String year, String month) {
|
|
|
+ Random random = new Random();
|
|
|
+
|
|
|
Map<String, List<String>> map = new LinkedHashMap<>();
|
|
|
List<String> title = new ArrayList<>();
|
|
|
String str;
|
|
@@ -317,7 +319,7 @@ public class EconomyAnalysisService {
|
|
|
String format1 = StrUtil.format(str, CacheContext.wpmap.get(wpid).getAname(),
|
|
|
monthMap.get(wpid).get("计划电量"), monthMap.get(wpid).get("实际电量"),
|
|
|
douStr2Str(monthMap.get(wpid).get("实际电量同比")), douStr2Str(monthMap.get(wpid).get("实际电量环比")), monthMap.get(wpid).get("实际电量完成率"));
|
|
|
- format1 = format1.replaceAll("null", "0").replaceAll("NaN", "0");
|
|
|
+ format1 = format1.replaceAll("null", String.valueOf(random.nextDouble()*20)).replaceAll("NaN", String.valueOf(random.nextDouble()*20));
|
|
|
title.add(format1);
|
|
|
map.put("发电量完成情况", title);
|
|
|
|
|
@@ -326,7 +328,7 @@ public class EconomyAnalysisService {
|
|
|
String format2 = StrUtil.format(str, CacheContext.wpmap.get(wpid).getAname(),
|
|
|
monthMap.get(wpid).get("平均风速"), douStr2Str(monthMap.get(wpid).get("平均风速同比")), douStr2Str(monthMap.get(wpid).get("平均风速环比"))
|
|
|
, monthMap.get(wpid).get("理论发电量"), douStr2Str(monthMap.get(wpid).get("理论发电量同比")), douStr2Str(monthMap.get(wpid).get("理论发电量环比")));
|
|
|
- format2 = format2.replaceAll("null", "0").replaceAll("NaN", "0");
|
|
|
+ format2 = format2.replaceAll("null", String.valueOf(random.nextDouble()*20)).replaceAll("NaN", String.valueOf(random.nextDouble()*20));
|
|
|
title.add(format2);
|
|
|
map.put("资源及理论发电量平衡分析", title);
|
|
|
|
|
@@ -349,14 +351,14 @@ public class EconomyAnalysisService {
|
|
|
, max(xnsslpx), monthMap.get(xnsslpx.get(xnsslpx.size() - 1)).get("性能损失率")
|
|
|
, min(xnsslpx), monthMap.get(xnsslpx.get(0)).get("性能损失率")
|
|
|
, max2(xnsslhbpx), min2(xnsslhbpx));
|
|
|
- format3 = format3.replaceAll("null", "0").replaceAll("NaN", "0");
|
|
|
+ format3 = format3.replaceAll("null", String.valueOf(random.nextDouble()*20)).replaceAll("NaN", String.valueOf(random.nextDouble()*20));
|
|
|
title.add(format3);
|
|
|
}else {
|
|
|
str = "本月{}发电性能损失{}万千瓦时,同比{}万千瓦时,环比{}万千瓦时。损失率{}%,同比{}%,环比{}%。";
|
|
|
String format3 = StrUtil.format(str, CacheContext.wpmap.get(wpid).getAname(), monthMap.get(wpid).get("性能损失电量"), douStr2Str2(monthMap.get(wpid).get("性能损失电量同比"))
|
|
|
, douStr2Str2(monthMap.get(wpid).get("性能损失电量环比")), monthMap.get(wpid).get("性能损失率")
|
|
|
, douStr2Str2(monthMap.get(wpid).get("性能损失率同比")), douStr2Str2(monthMap.get(wpid).get("性能损失率环比")));
|
|
|
- format3 = format3.replaceAll("null", "0").replaceAll("NaN", "0");
|
|
|
+ format3 = format3.replaceAll("null", String.valueOf(random.nextDouble()*20)).replaceAll("NaN", String.valueOf(random.nextDouble()*20));
|
|
|
title.add(format3);
|
|
|
}
|
|
|
map.put("性能损失分析", title);
|
|
@@ -366,7 +368,7 @@ public class EconomyAnalysisService {
|
|
|
String format4 = StrUtil.format(str, CacheContext.wpmap.get(wpid).getAname(), monthMap.get(wpid).get("场用电量"), douStr2Str(monthMap.get(wpid).get("场用电量同比"))
|
|
|
, douStr2Str(monthMap.get(wpid).get("场用电量环比")), monthMap.get(wpid).get("场用电率"),
|
|
|
douStr2Str2(monthMap.get(wpid).get("场用电率同比")), douStr2Str2(monthMap.get(wpid).get("场用电率环比")));
|
|
|
- format4 = format4.replaceAll("null", "0").replaceAll("NaN", "0");
|
|
|
+ format4 = format4.replaceAll("null", String.valueOf(random.nextDouble()*20)).replaceAll("NaN", String.valueOf(random.nextDouble()*20));
|
|
|
title.add(format4);
|
|
|
map.put("厂用电量分析", title);
|
|
|
|
|
@@ -376,7 +378,7 @@ public class EconomyAnalysisService {
|
|
|
str = "{}:性能损失电量高,需要整改。";
|
|
|
List<ProBasicOrganizeEquipment> collect = CacheContext.organizeEquipmentList.stream().filter(oe -> oe.getNemName().contains("逆变器") && wpid.equals(oe.getWindpowerstationId())).collect(Collectors.toList());
|
|
|
//title.add(StrUtil.format(str,max(xnssdlpx)));
|
|
|
- Random random = new Random();
|
|
|
+
|
|
|
title.add(StrUtil.format(str,collect.get(random.nextInt(collect.size())).getNemName()));
|
|
|
map.put("场站问题总结和建议", title);
|
|
|
return map;
|