|
@@ -22,7 +22,7 @@ import java.util.stream.Collectors;
|
|
@Service
|
|
@Service
|
|
public class WindPowerInfo6Service {
|
|
public class WindPowerInfo6Service {
|
|
|
|
|
|
-// private static final Logger logger = LoggerFactory.getLogger(WindPowerInfo1Service.class);
|
|
|
|
|
|
+ // private static final Logger logger = LoggerFactory.getLogger(WindPowerInfo1Service.class);
|
|
@Resource
|
|
@Resource
|
|
private IEdosUtil edosUtil;
|
|
private IEdosUtil edosUtil;
|
|
|
|
|
|
@@ -39,61 +39,55 @@ public class WindPowerInfo6Service {
|
|
public void calRegionInfoDay(Date recordDate) {
|
|
public void calRegionInfoDay(Date recordDate) {
|
|
|
|
|
|
List<ProEconPowerstationInfoDay6> wpinfodayls = proEconPowerstationInfoDay6Service.list().stream()
|
|
List<ProEconPowerstationInfoDay6> wpinfodayls = proEconPowerstationInfoDay6Service.list().stream()
|
|
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
|
|
|
|
|
|
+ .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
|
|
// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
|
|
// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
|
|
&& i.getLocation().equals(Location.cp.getValue()))
|
|
&& i.getLocation().equals(Location.cp.getValue()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
- if(!wpinfodayls.isEmpty())
|
|
|
|
- {
|
|
|
|
|
|
+ if (!wpinfodayls.isEmpty()) {
|
|
|
|
|
|
- Map<String, Map<String, List<ProEconPowerstationInfoDay6>>>rgmap=new HashMap<>();
|
|
|
|
|
|
+ Map<String, Map<String, List<ProEconPowerstationInfoDay6>>> rgmap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
+ for (ProEconPowerstationInfoDay6 wpinfo : wpinfodayls) {
|
|
|
|
|
|
|
|
+ if (rgmap.containsKey(wpinfo.getRegionId())) {
|
|
|
|
+ Map<String, List<ProEconPowerstationInfoDay6>> map = rgmap.get(wpinfo.getRegionId());
|
|
|
|
+ List<ProEconPowerstationInfoDay6> qbls = map.get("qb");
|
|
|
|
+ List<ProEconPowerstationInfoDay6> fdls = map.get("fd");
|
|
|
|
+ List<ProEconPowerstationInfoDay6> gfls = map.get("gf");
|
|
|
|
|
|
- for(ProEconPowerstationInfoDay6 wpinfo:wpinfodayls)
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- if(rgmap.containsKey(wpinfo.getRegionId()))
|
|
|
|
- {
|
|
|
|
- Map<String, List<ProEconPowerstationInfoDay6>> map=rgmap.get(wpinfo.getRegionId());
|
|
|
|
- List<ProEconPowerstationInfoDay6> qbls=map.get("qb");
|
|
|
|
- List<ProEconPowerstationInfoDay6> gfls=map.get("fd");
|
|
|
|
- List<ProEconPowerstationInfoDay6> fdls=map.get("gf");
|
|
|
|
-
|
|
|
|
- if(wpinfo.getForeignKeyId().equals("-1"))
|
|
|
|
- {
|
|
|
|
|
|
+ if (wpinfo.getForeignKeyId().equals("-1")) {
|
|
fdls.add(wpinfo);
|
|
fdls.add(wpinfo);
|
|
- }else if(wpinfo.getForeignKeyId().equals("-2")){
|
|
|
|
|
|
+ } else if (wpinfo.getForeignKeyId().equals("-2")) {
|
|
gfls.add(wpinfo);
|
|
gfls.add(wpinfo);
|
|
|
|
+ } else if (wpinfo.getForeignKeyId().equals("0")) {
|
|
|
|
+ qbls.add(wpinfo);
|
|
}
|
|
}
|
|
- qbls.add(wpinfo);
|
|
|
|
- }else
|
|
|
|
- {
|
|
|
|
- Map<String, List<ProEconPowerstationInfoDay6>> map=new HashMap<>();
|
|
|
|
|
|
|
|
- List<ProEconPowerstationInfoDay6> qbls=new ArrayList<>();
|
|
|
|
- List<ProEconPowerstationInfoDay6> gfls=new ArrayList<>();
|
|
|
|
- List<ProEconPowerstationInfoDay6> fdls=new ArrayList<>();
|
|
|
|
|
|
+ } else {
|
|
|
|
+ Map<String, List<ProEconPowerstationInfoDay6>> map = new HashMap<>();
|
|
|
|
|
|
- if(wpinfo.getForeignKeyId().equals("-1"))
|
|
|
|
- {
|
|
|
|
|
|
+ List<ProEconPowerstationInfoDay6> qbls = new ArrayList<>();
|
|
|
|
+ List<ProEconPowerstationInfoDay6> gfls = new ArrayList<>();
|
|
|
|
+ List<ProEconPowerstationInfoDay6> fdls = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ if (wpinfo.getForeignKeyId().equals("-1")) {
|
|
fdls.add(wpinfo);
|
|
fdls.add(wpinfo);
|
|
- }else if(wpinfo.getForeignKeyId().equals("-2")){
|
|
|
|
|
|
+ } else if (wpinfo.getForeignKeyId().equals("-2")) {
|
|
gfls.add(wpinfo);
|
|
gfls.add(wpinfo);
|
|
}
|
|
}
|
|
qbls.add(wpinfo);
|
|
qbls.add(wpinfo);
|
|
- map.put("qb",qbls);
|
|
|
|
- map.put("fd",fdls);
|
|
|
|
- map.put("gf",gfls);
|
|
|
|
- rgmap.put(wpinfo.getRegionId(),map);
|
|
|
|
|
|
+ map.put("qb", qbls);
|
|
|
|
+ map.put("fd", fdls);
|
|
|
|
+ map.put("gf", gfls);
|
|
|
|
+ rgmap.put(wpinfo.getRegionId(), map);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
//判断是否有重复记录,先删除重复记录
|
|
//判断是否有重复记录,先删除重复记录
|
|
List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
|
|
List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
|
|
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
|
|
|
|
|
|
+ .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
|
|
// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
|
|
// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
|
|
&& i.getLocation().equals(Location.rg.getValue())).map(ProEconPowerstationInfoDay6::getId)
|
|
&& i.getLocation().equals(Location.rg.getValue())).map(ProEconPowerstationInfoDay6::getId)
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -103,21 +97,20 @@ public class WindPowerInfo6Service {
|
|
proEconPowerstationInfoDay6Service.removeByIds(idls);
|
|
proEconPowerstationInfoDay6Service.removeByIds(idls);
|
|
|
|
|
|
}
|
|
}
|
|
- for(Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay6>>> entry:rgmap.entrySet()){
|
|
|
|
- Map<String, List<ProEconPowerstationInfoDay6>> map=entry.getValue();
|
|
|
|
- List<ProEconPowerstationInfoDay6> qbls=map.get("qb");
|
|
|
|
- List<ProEconPowerstationInfoDay6> gfls=map.get("fd");
|
|
|
|
- List<ProEconPowerstationInfoDay6> fdls=map.get("gf");
|
|
|
|
|
|
+ for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay6>>> entry : rgmap.entrySet()) {
|
|
|
|
+ Map<String, List<ProEconPowerstationInfoDay6>> map = entry.getValue();
|
|
|
|
+ List<ProEconPowerstationInfoDay6> qbls = map.get("qb");
|
|
|
|
+ List<ProEconPowerstationInfoDay6> fdls = map.get("fd");
|
|
|
|
+ List<ProEconPowerstationInfoDay6> gfls = map.get("gf");
|
|
// if(CacheContext.cpwpmap.size()==qbls.size())
|
|
// if(CacheContext.cpwpmap.size()==qbls.size())
|
|
// {
|
|
// {
|
|
|
|
|
|
- ProEconPowerstationInfoDay6 qb=new ProEconPowerstationInfoDay6();
|
|
|
|
- ProEconPowerstationInfoDay6 fd=new ProEconPowerstationInfoDay6();
|
|
|
|
- ProEconPowerstationInfoDay6 gf=new ProEconPowerstationInfoDay6();
|
|
|
|
|
|
+ ProEconPowerstationInfoDay6 qb = new ProEconPowerstationInfoDay6();
|
|
|
|
+ ProEconPowerstationInfoDay6 fd = new ProEconPowerstationInfoDay6();
|
|
|
|
+ ProEconPowerstationInfoDay6 gf = new ProEconPowerstationInfoDay6();
|
|
|
|
|
|
- if(CacheContext.rgmap.containsKey(entry.getKey()))
|
|
|
|
- {
|
|
|
|
- ProBasicRegion cp=CacheContext.rgmap.get(entry.getKey());
|
|
|
|
|
|
+ if (CacheContext.rgmap.containsKey(entry.getKey())) {
|
|
|
|
+ ProBasicRegion cp = CacheContext.rgmap.get(entry.getKey());
|
|
gf.setRegionId(cp.getId());
|
|
gf.setRegionId(cp.getId());
|
|
|
|
|
|
gf.setRecordDate(DateUtils.truncate(recordDate));
|
|
gf.setRecordDate(DateUtils.truncate(recordDate));
|
|
@@ -136,12 +129,15 @@ public class WindPowerInfo6Service {
|
|
qb.setForeignKeyId("0");
|
|
qb.setForeignKeyId("0");
|
|
qb.setLocation(Location.rg.getValue());
|
|
qb.setLocation(Location.rg.getValue());
|
|
|
|
|
|
|
|
+ Initial.initial(qb);
|
|
|
|
+ Initial.initial(fd);
|
|
|
|
+ Initial.initial(gf);
|
|
//计算区域级全部
|
|
//计算区域级全部
|
|
- calCp(qb,qbls);
|
|
|
|
|
|
+ calCp(qb, qbls);
|
|
//计算公司级风电场站
|
|
//计算公司级风电场站
|
|
- calCp(fd,fdls);
|
|
|
|
|
|
+ calCp(fd, fdls);
|
|
//计算公司级光电场站
|
|
//计算公司级光电场站
|
|
- calCp(gf,gfls);
|
|
|
|
|
|
+ calCp(gf, gfls);
|
|
|
|
|
|
proEconPowerstationInfoDay6Service.save(qb);
|
|
proEconPowerstationInfoDay6Service.save(qb);
|
|
proEconPowerstationInfoDay6Service.save(fd);
|
|
proEconPowerstationInfoDay6Service.save(fd);
|
|
@@ -156,9 +152,6 @@ public class WindPowerInfo6Service {
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -170,61 +163,53 @@ public class WindPowerInfo6Service {
|
|
public void calCompanyInfoDay(Date recordDate) {
|
|
public void calCompanyInfoDay(Date recordDate) {
|
|
|
|
|
|
List<ProEconPowerstationInfoDay6> wpinfodayls = proEconPowerstationInfoDay6Service.list().stream()
|
|
List<ProEconPowerstationInfoDay6> wpinfodayls = proEconPowerstationInfoDay6Service.list().stream()
|
|
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
|
|
|
|
|
|
+ .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
|
|
// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
|
|
// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
|
|
&& i.getLocation().equals(Location.wp.getValue()))
|
|
&& i.getLocation().equals(Location.wp.getValue()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
- if(!wpinfodayls.isEmpty())
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- Map<String, Map<String, List<ProEconPowerstationInfoDay6>>>cpmap=new HashMap<>();
|
|
|
|
|
|
+ if (!wpinfodayls.isEmpty()) {
|
|
|
|
|
|
|
|
+ Map<String, Map<String, List<ProEconPowerstationInfoDay6>>> cpmap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
+ for (ProEconPowerstationInfoDay6 wpinfo : wpinfodayls) {
|
|
|
|
|
|
- for(ProEconPowerstationInfoDay6 wpinfo:wpinfodayls)
|
|
|
|
- {
|
|
|
|
|
|
+ if (cpmap.containsKey(wpinfo.getCompanyId())) {
|
|
|
|
+ Map<String, List<ProEconPowerstationInfoDay6>> map = cpmap.get(wpinfo.getCompanyId());
|
|
|
|
+ List<ProEconPowerstationInfoDay6> qbls = map.get("qb");
|
|
|
|
+ List<ProEconPowerstationInfoDay6> fdls = map.get("fd");
|
|
|
|
+ List<ProEconPowerstationInfoDay6> gfls = map.get("gf");
|
|
|
|
|
|
- if(cpmap.containsKey(wpinfo.getCompanyId()))
|
|
|
|
- {
|
|
|
|
- Map<String, List<ProEconPowerstationInfoDay6>> map=cpmap.get(wpinfo.getCompanyId());
|
|
|
|
- List<ProEconPowerstationInfoDay6> qbls=map.get("qb");
|
|
|
|
- List<ProEconPowerstationInfoDay6> gfls=map.get("fd");
|
|
|
|
- List<ProEconPowerstationInfoDay6> fdls=map.get("gf");
|
|
|
|
-
|
|
|
|
- if(wpinfo.getWindpowerstationId().contains("FDC"))
|
|
|
|
- {
|
|
|
|
|
|
+ if (wpinfo.getWindpowerstationId().contains("FDC")) {
|
|
fdls.add(wpinfo);
|
|
fdls.add(wpinfo);
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
gfls.add(wpinfo);
|
|
gfls.add(wpinfo);
|
|
}
|
|
}
|
|
qbls.add(wpinfo);
|
|
qbls.add(wpinfo);
|
|
- }else
|
|
|
|
- {
|
|
|
|
- Map<String, List<ProEconPowerstationInfoDay6>> map=new HashMap<>();
|
|
|
|
|
|
+ } else {
|
|
|
|
+ Map<String, List<ProEconPowerstationInfoDay6>> map = new HashMap<>();
|
|
|
|
|
|
- List<ProEconPowerstationInfoDay6> qbls=new ArrayList<>();
|
|
|
|
- List<ProEconPowerstationInfoDay6> gfls=new ArrayList<>();
|
|
|
|
- List<ProEconPowerstationInfoDay6> fdls=new ArrayList<>();
|
|
|
|
|
|
+ List<ProEconPowerstationInfoDay6> qbls = new ArrayList<>();
|
|
|
|
+ List<ProEconPowerstationInfoDay6> gfls = new ArrayList<>();
|
|
|
|
+ List<ProEconPowerstationInfoDay6> fdls = new ArrayList<>();
|
|
|
|
|
|
- if(wpinfo.getWindpowerstationId().contains("FDC"))
|
|
|
|
- {
|
|
|
|
|
|
+ if (wpinfo.getWindpowerstationId().contains("FDC")) {
|
|
fdls.add(wpinfo);
|
|
fdls.add(wpinfo);
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
gfls.add(wpinfo);
|
|
gfls.add(wpinfo);
|
|
}
|
|
}
|
|
qbls.add(wpinfo);
|
|
qbls.add(wpinfo);
|
|
- map.put("qb",qbls);
|
|
|
|
- map.put("fd",fdls);
|
|
|
|
- map.put("gf",gfls);
|
|
|
|
- cpmap.put(wpinfo.getCompanyId(),map);
|
|
|
|
|
|
+ map.put("qb", qbls);
|
|
|
|
+ map.put("fd", fdls);
|
|
|
|
+ map.put("gf", gfls);
|
|
|
|
+ cpmap.put(wpinfo.getCompanyId(), map);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
//判断是否有重复记录,先删除重复记录
|
|
//判断是否有重复记录,先删除重复记录
|
|
List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
|
|
List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
|
|
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
|
|
|
|
|
|
+ .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
|
|
// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
|
|
// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
|
|
&& i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay6::getId)
|
|
&& i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay6::getId)
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -234,21 +219,20 @@ public class WindPowerInfo6Service {
|
|
proEconPowerstationInfoDay6Service.removeByIds(idls);
|
|
proEconPowerstationInfoDay6Service.removeByIds(idls);
|
|
|
|
|
|
}
|
|
}
|
|
- for(Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay6>>> entry:cpmap.entrySet()){
|
|
|
|
- Map<String, List<ProEconPowerstationInfoDay6>> map=entry.getValue();
|
|
|
|
- List<ProEconPowerstationInfoDay6> qbls=map.get("qb");
|
|
|
|
- List<ProEconPowerstationInfoDay6> gfls=map.get("fd");
|
|
|
|
- List<ProEconPowerstationInfoDay6> fdls=map.get("gf");
|
|
|
|
|
|
+ for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay6>>> entry : cpmap.entrySet()) {
|
|
|
|
+ Map<String, List<ProEconPowerstationInfoDay6>> map = entry.getValue();
|
|
|
|
+ List<ProEconPowerstationInfoDay6> qbls = map.get("qb");
|
|
|
|
+ List<ProEconPowerstationInfoDay6> fdls = map.get("fd");
|
|
|
|
+ List<ProEconPowerstationInfoDay6> gfls = map.get("gf");
|
|
// if(CacheContext.cpwpmap.size()==qbls.size())
|
|
// if(CacheContext.cpwpmap.size()==qbls.size())
|
|
// {
|
|
// {
|
|
|
|
|
|
- ProEconPowerstationInfoDay6 qb=new ProEconPowerstationInfoDay6();
|
|
|
|
- ProEconPowerstationInfoDay6 fd=new ProEconPowerstationInfoDay6();
|
|
|
|
- ProEconPowerstationInfoDay6 gf=new ProEconPowerstationInfoDay6();
|
|
|
|
|
|
+ ProEconPowerstationInfoDay6 qb = new ProEconPowerstationInfoDay6();
|
|
|
|
+ ProEconPowerstationInfoDay6 fd = new ProEconPowerstationInfoDay6();
|
|
|
|
+ ProEconPowerstationInfoDay6 gf = new ProEconPowerstationInfoDay6();
|
|
|
|
|
|
- if(CacheContext.cpmap.containsKey(entry.getKey()))
|
|
|
|
- {
|
|
|
|
- ProBasicCompany cp=CacheContext.cpmap.get(entry.getKey());
|
|
|
|
|
|
+ if (CacheContext.cpmap.containsKey(entry.getKey())) {
|
|
|
|
+ ProBasicCompany cp = CacheContext.cpmap.get(entry.getKey());
|
|
gf.setRegionId(cp.getRegionId());
|
|
gf.setRegionId(cp.getRegionId());
|
|
gf.setCompanyId(cp.getId());
|
|
gf.setCompanyId(cp.getId());
|
|
gf.setRecordDate(DateUtils.truncate(recordDate));
|
|
gf.setRecordDate(DateUtils.truncate(recordDate));
|
|
@@ -256,7 +240,6 @@ public class WindPowerInfo6Service {
|
|
gf.setLocation(Location.cp.getValue());
|
|
gf.setLocation(Location.cp.getValue());
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
fd.setRegionId(cp.getRegionId());
|
|
fd.setRegionId(cp.getRegionId());
|
|
fd.setCompanyId(cp.getId());
|
|
fd.setCompanyId(cp.getId());
|
|
fd.setRecordDate(DateUtils.truncate(recordDate));
|
|
fd.setRecordDate(DateUtils.truncate(recordDate));
|
|
@@ -269,12 +252,15 @@ public class WindPowerInfo6Service {
|
|
qb.setForeignKeyId("0");
|
|
qb.setForeignKeyId("0");
|
|
qb.setLocation(Location.cp.getValue());
|
|
qb.setLocation(Location.cp.getValue());
|
|
|
|
|
|
|
|
+ Initial.initial(qb);
|
|
|
|
+ Initial.initial(fd);
|
|
|
|
+ Initial.initial(gf);
|
|
//计算公司级全部场站
|
|
//计算公司级全部场站
|
|
- calCp(qb,qbls);
|
|
|
|
|
|
+ calCp(qb, qbls);
|
|
//计算公司级风电场站
|
|
//计算公司级风电场站
|
|
- calCp(fd,fdls);
|
|
|
|
|
|
+ calCp(fd, fdls);
|
|
//计算公司级光电场站
|
|
//计算公司级光电场站
|
|
- calCp(gf,gfls);
|
|
|
|
|
|
+ calCp(gf, gfls);
|
|
|
|
|
|
proEconPowerstationInfoDay6Service.save(qb);
|
|
proEconPowerstationInfoDay6Service.save(qb);
|
|
proEconPowerstationInfoDay6Service.save(fd);
|
|
proEconPowerstationInfoDay6Service.save(fd);
|
|
@@ -289,107 +275,104 @@ public class WindPowerInfo6Service {
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- private void calCp(ProEconPowerstationInfoDay6 pewp,List<ProEconPowerstationInfoDay6> ls) {
|
|
|
|
|
|
+ private void calCp(ProEconPowerstationInfoDay6 pewp, List<ProEconPowerstationInfoDay6> ls) {
|
|
|
|
|
|
- if(!ls.isEmpty())
|
|
|
|
- {
|
|
|
|
|
|
+ if (!ls.isEmpty()) {
|
|
//日发电量
|
|
//日发电量
|
|
// DoubleSummaryStatistics summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay1::getRfdl).summaryStatistics();
|
|
// DoubleSummaryStatistics summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay1::getRfdl).summaryStatistics();
|
|
// pewp.setRfdl(com.gyee.common.model.StringUtils.round(summaryStatistics.getSum(),2));
|
|
// pewp.setRfdl(com.gyee.common.model.StringUtils.round(summaryStatistics.getSum(),2));
|
|
|
|
|
|
-
|
|
|
|
- //* 日最大风速(测风塔)
|
|
|
|
- DoubleSummaryStatistics summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getRzdfscft).summaryStatistics();
|
|
|
|
- pewp.setRzdfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getMax(),2));
|
|
|
|
|
|
+
|
|
|
|
+ //* 日最大风速(测风塔)
|
|
|
|
+ DoubleSummaryStatistics summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getRzdfscft).summaryStatistics();
|
|
|
|
+ pewp.setRzdfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getMax(), 2));
|
|
|
|
|
|
// * 日最小风速(测风塔)
|
|
// * 日最小风速(测风塔)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getRzxfscft).summaryStatistics();
|
|
|
|
- pewp.setRzxfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getMin(),2));
|
|
|
|
-
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getRzxfscft).summaryStatistics();
|
|
|
|
+ pewp.setRzxfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getMin(), 2));
|
|
|
|
+
|
|
// * 日最大功率(出线)
|
|
// * 日最大功率(出线)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getRzdglcx).summaryStatistics();
|
|
|
|
- pewp.setRzdglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getMax(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getRzdglcx).summaryStatistics();
|
|
|
|
+ pewp.setRzdglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getMax(), 2));
|
|
|
|
|
|
// * 日最小功率(出线)
|
|
// * 日最小功率(出线)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getRzxglcx).summaryStatistics();
|
|
|
|
- pewp.setRzxglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getMin(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getRzxglcx).summaryStatistics();
|
|
|
|
+ pewp.setRzxglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getMin(), 2));
|
|
|
|
|
|
// * 日平均功率(出线)
|
|
// * 日平均功率(出线)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getRpjglcx).summaryStatistics();
|
|
|
|
- pewp.setRpjglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getAverage(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getRpjglcx).summaryStatistics();
|
|
|
|
+ pewp.setRpjglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getAverage(), 2));
|
|
|
|
|
|
// * 日平均风速(测风塔)
|
|
// * 日平均风速(测风塔)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getRpjfscft).summaryStatistics();
|
|
|
|
- pewp.setRpjfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getAverage(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getRpjfscft).summaryStatistics();
|
|
|
|
+ pewp.setRpjfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getAverage(), 2));
|
|
|
|
|
|
// * 月最大风速(测风塔)
|
|
// * 月最大风速(测风塔)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getYzdfscft).summaryStatistics();
|
|
|
|
- pewp.setYzdfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getMax(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getYzdfscft).summaryStatistics();
|
|
|
|
+ pewp.setYzdfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getMax(), 2));
|
|
|
|
|
|
// * 月最小风速(测风塔)
|
|
// * 月最小风速(测风塔)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getYzxfscft).summaryStatistics();
|
|
|
|
- pewp.setYzxfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getMin(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getYzxfscft).summaryStatistics();
|
|
|
|
+ pewp.setYzxfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getMin(), 2));
|
|
|
|
|
|
// * 月最大功率(出线)
|
|
// * 月最大功率(出线)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getYzdglcx).summaryStatistics();
|
|
|
|
- pewp.setYzdglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getMax(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getYzdglcx).summaryStatistics();
|
|
|
|
+ pewp.setYzdglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getMax(), 2));
|
|
|
|
|
|
// * 月最小功率(出线)
|
|
// * 月最小功率(出线)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getYzxglcx).summaryStatistics();
|
|
|
|
- pewp.setYzxglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getMin(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getYzxglcx).summaryStatistics();
|
|
|
|
+ pewp.setYzxglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getMin(), 2));
|
|
|
|
|
|
- // * 月平均功率(出线)
|
|
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getYpjglcx).summaryStatistics();
|
|
|
|
- pewp.setYpjglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getAverage(),2));
|
|
|
|
|
|
+ // * 月平均功率(出线)
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getYpjglcx).summaryStatistics();
|
|
|
|
+ pewp.setYpjglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getAverage(), 2));
|
|
|
|
|
|
// * 月平均风速(测风塔)
|
|
// * 月平均风速(测风塔)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getYpjfscft).summaryStatistics();
|
|
|
|
- pewp.setYpjfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getAverage(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getYpjfscft).summaryStatistics();
|
|
|
|
+ pewp.setYpjfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getAverage(), 2));
|
|
|
|
|
|
// * 年最大风速(测风塔)
|
|
// * 年最大风速(测风塔)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getNzdfscft).summaryStatistics();
|
|
|
|
- pewp.setNzdfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getMax(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getNzdfscft).summaryStatistics();
|
|
|
|
+ pewp.setNzdfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getMax(), 2));
|
|
|
|
|
|
// * 年最小风速(测风塔)
|
|
// * 年最小风速(测风塔)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getNzxfscft).summaryStatistics();
|
|
|
|
- pewp.setNzxfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getMin(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getNzxfscft).summaryStatistics();
|
|
|
|
+ pewp.setNzxfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getMin(), 2));
|
|
|
|
|
|
// * 年最大功率(出线)
|
|
// * 年最大功率(出线)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getNzdglcx).summaryStatistics();
|
|
|
|
- pewp.setNzdglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getMax(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getNzdglcx).summaryStatistics();
|
|
|
|
+ pewp.setNzdglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getMax(), 2));
|
|
|
|
|
|
// * 年最小功率(出线)
|
|
// * 年最小功率(出线)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getNzxglcx).summaryStatistics();
|
|
|
|
- pewp.setNzxglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getMin(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getNzxglcx).summaryStatistics();
|
|
|
|
+ pewp.setNzxglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getMin(), 2));
|
|
|
|
|
|
// * 年平均功率(出线)
|
|
// * 年平均功率(出线)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getNpjglcx).summaryStatistics();
|
|
|
|
- pewp.setNpjglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getAverage(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getNpjglcx).summaryStatistics();
|
|
|
|
+ pewp.setNpjglcx(com.gyee.common.model.StringUtils.round(summaryStatistics.getAverage(), 2));
|
|
|
|
|
|
// * 年平均风速(测风塔)
|
|
// * 年平均风速(测风塔)
|
|
- summaryStatistics=ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getNpjfscft).summaryStatistics();
|
|
|
|
- pewp.setNpjfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getAverage(),2));
|
|
|
|
|
|
+ summaryStatistics = ls.stream().mapToDouble(ProEconPowerstationInfoDay6::getNpjfscft).summaryStatistics();
|
|
|
|
+ pewp.setNpjfscft(com.gyee.common.model.StringUtils.round(summaryStatistics.getAverage(), 2));
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 计算场站日信息
|
|
* 计算场站日信息
|
|
*/
|
|
*/
|
|
public void calWindpowerInfoDay(Date recordDate) throws Exception {
|
|
public void calWindpowerInfoDay(Date recordDate) throws Exception {
|
|
- Calendar c=Calendar.getInstance();
|
|
|
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
c.setTime(recordDate);
|
|
c.setTime(recordDate);
|
|
|
|
|
|
- Date end=c.getTime();
|
|
|
|
|
|
+ Date end = c.getTime();
|
|
|
|
|
|
- Date begin= DateUtils.truncate(c.getTime());
|
|
|
|
|
|
+ Date begin = DateUtils.truncate(c.getTime());
|
|
|
|
|
|
|
|
|
|
// List<ProEconPowerstationInfoDay6> wpinfodayls=new ArrayList<>();
|
|
// List<ProEconPowerstationInfoDay6> wpinfodayls=new ArrayList<>();
|
|
@@ -397,7 +380,7 @@ public class WindPowerInfo6Service {
|
|
|
|
|
|
//判断是否有重复记录,先删除重复记录
|
|
//判断是否有重复记录,先删除重复记录
|
|
List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
|
|
List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
|
|
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
|
|
|
|
|
|
+ .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
|
|
&& CacheContext.wpmap.containsKey(i.getWindpowerstationId())
|
|
&& CacheContext.wpmap.containsKey(i.getWindpowerstationId())
|
|
&& i.getLocation().equals(Location.wp.getValue())).map(ProEconPowerstationInfoDay6::getId)
|
|
&& i.getLocation().equals(Location.wp.getValue())).map(ProEconPowerstationInfoDay6::getId)
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -407,13 +390,11 @@ public class WindPowerInfo6Service {
|
|
proEconPowerstationInfoDay6Service.removeByIds(idls);
|
|
proEconPowerstationInfoDay6Service.removeByIds(idls);
|
|
|
|
|
|
}
|
|
}
|
|
- for(ProBasicPowerstation wp:CacheContext.wpls)
|
|
|
|
- {
|
|
|
|
- if(CacheContext.wppointmap.containsKey(wp.getId()))
|
|
|
|
- {
|
|
|
|
- Map<String, ProBasicPowerstationPoint> pointmap=CacheContext.wppointmap.get(wp.getId());
|
|
|
|
|
|
+ for (ProBasicPowerstation wp : CacheContext.wpls) {
|
|
|
|
+ if (CacheContext.wppointmap.containsKey(wp.getId())) {
|
|
|
|
+ Map<String, ProBasicPowerstationPoint> pointmap = CacheContext.wppointmap.get(wp.getId());
|
|
|
|
|
|
- ProEconPowerstationInfoDay6 pewp=new ProEconPowerstationInfoDay6();
|
|
|
|
|
|
+ ProEconPowerstationInfoDay6 pewp = new ProEconPowerstationInfoDay6();
|
|
Initial.initial(pewp);
|
|
Initial.initial(pewp);
|
|
pewp.setRegionId(wp.getRegionId());
|
|
pewp.setRegionId(wp.getRegionId());
|
|
pewp.setCompanyId(wp.getCompanyId());
|
|
pewp.setCompanyId(wp.getCompanyId());
|
|
@@ -423,19 +404,18 @@ public class WindPowerInfo6Service {
|
|
pewp.setLocation(Location.wp.getValue());
|
|
pewp.setLocation(Location.wp.getValue());
|
|
|
|
|
|
//昨日的统计结果
|
|
//昨日的统计结果
|
|
- List<ProEconPowerstationInfoDay6> pepid1ls =new ArrayList<>();
|
|
|
|
- Calendar cl=Calendar.getInstance();
|
|
|
|
|
|
+ List<ProEconPowerstationInfoDay6> pepid1ls = new ArrayList<>();
|
|
|
|
+ Calendar cl = Calendar.getInstance();
|
|
cl.setTime(recordDate);
|
|
cl.setTime(recordDate);
|
|
- if(cl.get(Calendar.DAY_OF_MONTH)!=1)
|
|
|
|
-
|
|
|
|
- {
|
|
|
|
|
|
+ if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
|
|
pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
|
|
pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
|
|
.filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
|
|
.filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
|
|
|
|
+ && i.getLocation().equals(Location.wp.getValue())
|
|
&& i.getWindpowerstationId().equals(wp.getId())
|
|
&& i.getWindpowerstationId().equals(wp.getId())
|
|
- && i.getLocation().equals(Location.wp.getValue()))
|
|
|
|
|
|
+ )
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
}
|
|
}
|
|
- extracted(end, begin, pointmap, pewp,pepid1ls);
|
|
|
|
|
|
+ extracted(end, begin, pointmap, pewp, pepid1ls);
|
|
//*******************************************年信息统计*********************************************************/
|
|
//*******************************************年信息统计*********************************************************/
|
|
// wpinfodayls.add(pewp);
|
|
// wpinfodayls.add(pewp);
|
|
proEconPowerstationInfoDay6Service.save(pewp);
|
|
proEconPowerstationInfoDay6Service.save(pewp);
|
|
@@ -451,16 +431,16 @@ public class WindPowerInfo6Service {
|
|
* 计算项目日信息
|
|
* 计算项目日信息
|
|
*/
|
|
*/
|
|
public void calProjectInfoDay(Date recordDate) throws Exception {
|
|
public void calProjectInfoDay(Date recordDate) throws Exception {
|
|
- Calendar c=Calendar.getInstance();
|
|
|
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
c.setTime(recordDate);
|
|
c.setTime(recordDate);
|
|
|
|
|
|
- Date end=c.getTime();
|
|
|
|
|
|
+ Date end = c.getTime();
|
|
|
|
|
|
- Date begin= DateUtils.truncate(c.getTime());
|
|
|
|
|
|
+ Date begin = DateUtils.truncate(c.getTime());
|
|
|
|
|
|
//判断是否有重复记录,先删除重复记录
|
|
//判断是否有重复记录,先删除重复记录
|
|
List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
|
|
List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
|
|
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
|
|
|
|
|
|
+ .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
|
|
&& CacheContext.pjmap.containsKey(i.getProjectId())
|
|
&& CacheContext.pjmap.containsKey(i.getProjectId())
|
|
&& i.getLocation().equals(Location.pj.getValue())).map(ProEconPowerstationInfoDay6::getId)
|
|
&& i.getLocation().equals(Location.pj.getValue())).map(ProEconPowerstationInfoDay6::getId)
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -470,13 +450,16 @@ public class WindPowerInfo6Service {
|
|
proEconPowerstationInfoDay6Service.removeByIds(idls);
|
|
proEconPowerstationInfoDay6Service.removeByIds(idls);
|
|
|
|
|
|
}
|
|
}
|
|
- for(ProBasicProject pj:CacheContext.pjls)
|
|
|
|
- {
|
|
|
|
- if(CacheContext.wppointmap.containsKey(pj.getId()))
|
|
|
|
- {
|
|
|
|
- Map<String, ProBasicPowerstationPoint> pointmap=CacheContext.wppointmap.get(pj.getId());
|
|
|
|
-
|
|
|
|
- ProEconPowerstationInfoDay6 pewp=new ProEconPowerstationInfoDay6();
|
|
|
|
|
|
+ for (ProBasicProject pj : CacheContext.pjls) {
|
|
|
|
+ if (CacheContext.propointmap.containsKey(pj.getId())) {
|
|
|
|
+ Map<String, ProBasicPowerstationPoint> pointmap = CacheContext.propointmap.get(pj.getId());
|
|
|
|
+
|
|
|
|
+ ProEconPowerstationInfoDay6 pewp = new ProEconPowerstationInfoDay6();
|
|
|
|
+ if (CacheContext.wpmap.containsKey(pj.getWindpowerstationId())) {
|
|
|
|
+ ProBasicPowerstation wp = CacheContext.wpmap.get(pj.getWindpowerstationId());
|
|
|
|
+ pewp.setRegionId(wp.getRegionId());
|
|
|
|
+ pewp.setCompanyId(wp.getCompanyId());
|
|
|
|
+ }
|
|
Initial.initial(pewp);
|
|
Initial.initial(pewp);
|
|
pewp.setForeignKeyId("0");
|
|
pewp.setForeignKeyId("0");
|
|
pewp.setWindpowerstationId(pj.getWindpowerstationId());
|
|
pewp.setWindpowerstationId(pj.getWindpowerstationId());
|
|
@@ -485,19 +468,19 @@ public class WindPowerInfo6Service {
|
|
pewp.setRecordDate(DateUtils.truncate(recordDate));
|
|
pewp.setRecordDate(DateUtils.truncate(recordDate));
|
|
|
|
|
|
//昨日的统计结果
|
|
//昨日的统计结果
|
|
- List<ProEconPowerstationInfoDay6> pepid1ls =new ArrayList<>();
|
|
|
|
- Calendar cl=Calendar.getInstance();
|
|
|
|
|
|
+ List<ProEconPowerstationInfoDay6> pepid1ls = new ArrayList<>();
|
|
|
|
+ Calendar cl = Calendar.getInstance();
|
|
cl.setTime(recordDate);
|
|
cl.setTime(recordDate);
|
|
- if(cl.get(Calendar.DAY_OF_MONTH)!=1)
|
|
|
|
-
|
|
|
|
- {
|
|
|
|
|
|
+ if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
|
|
pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
|
|
pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
|
|
.filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
|
|
.filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
|
|
|
|
+ && i.getLocation().equals(Location.pj.getValue())
|
|
&& i.getProjectId().equals(pj.getId())
|
|
&& i.getProjectId().equals(pj.getId())
|
|
- && i.getLocation().equals(Location.pj.getValue()))
|
|
|
|
|
|
+
|
|
|
|
+ )
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
}
|
|
}
|
|
- extracted(end, begin, pointmap, pewp,pepid1ls);
|
|
|
|
|
|
+ extracted(end, begin, pointmap, pewp, pepid1ls);
|
|
|
|
|
|
|
|
|
|
proEconPowerstationInfoDay6Service.save(pewp);
|
|
proEconPowerstationInfoDay6Service.save(pewp);
|
|
@@ -508,22 +491,23 @@ public class WindPowerInfo6Service {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 计算线路日信息
|
|
* 计算线路日信息
|
|
*/
|
|
*/
|
|
public void calLineInfoDay(Date recordDate) throws Exception {
|
|
public void calLineInfoDay(Date recordDate) throws Exception {
|
|
- Calendar c=Calendar.getInstance();
|
|
|
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
c.setTime(recordDate);
|
|
c.setTime(recordDate);
|
|
|
|
|
|
- Date end=c.getTime();
|
|
|
|
|
|
+ Date end = c.getTime();
|
|
|
|
|
|
- Date begin= DateUtils.truncate(c.getTime());
|
|
|
|
|
|
+ Date begin = DateUtils.truncate(c.getTime());
|
|
|
|
|
|
//判断是否有重复记录,先删除重复记录
|
|
//判断是否有重复记录,先删除重复记录
|
|
List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
|
|
List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
|
|
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
|
|
|
|
|
|
+ .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
|
|
&& CacheContext.lnmap.containsKey(i.getLineId())
|
|
&& CacheContext.lnmap.containsKey(i.getLineId())
|
|
- && i.getLocation().equals(Location.ln.getValue()) ).map(ProEconPowerstationInfoDay6::getId)
|
|
|
|
|
|
+ && i.getLocation().equals(Location.ln.getValue())).map(ProEconPowerstationInfoDay6::getId)
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
if (idls.size() > 0) {
|
|
if (idls.size() > 0) {
|
|
@@ -531,13 +515,21 @@ public class WindPowerInfo6Service {
|
|
proEconPowerstationInfoDay6Service.removeByIds(idls);
|
|
proEconPowerstationInfoDay6Service.removeByIds(idls);
|
|
|
|
|
|
}
|
|
}
|
|
- for(ProBasicLine ln:CacheContext.lnls)
|
|
|
|
- {
|
|
|
|
- if(CacheContext.wppointmap.containsKey(ln.getId()))
|
|
|
|
- {
|
|
|
|
- Map<String, ProBasicPowerstationPoint> pointmap=CacheContext.wppointmap.get(ln.getId());
|
|
|
|
|
|
+ for (ProBasicLine ln : CacheContext.lnls) {
|
|
|
|
+ if (CacheContext.linepointmap.containsKey(ln.getId())) {
|
|
|
|
+ Map<String, ProBasicPowerstationPoint> pointmap = CacheContext.linepointmap.get(ln.getId());
|
|
|
|
+
|
|
|
|
+ ProEconPowerstationInfoDay6 pewp = new ProEconPowerstationInfoDay6();
|
|
|
|
+ if (CacheContext.pjmap.containsKey(ln.getProjectId())) {
|
|
|
|
+ ProBasicProject pj = CacheContext.pjmap.get(ln.getProjectId());
|
|
|
|
+ if (CacheContext.wpmap.containsKey(pj.getWindpowerstationId())) {
|
|
|
|
+ ProBasicPowerstation wp = CacheContext.wpmap.get(pj.getWindpowerstationId());
|
|
|
|
+ pewp.setRegionId(wp.getRegionId());
|
|
|
|
+ pewp.setCompanyId(wp.getCompanyId());
|
|
|
|
+ pewp.setWindpowerstationId(wp.getId());
|
|
|
|
+ }
|
|
|
|
|
|
- ProEconPowerstationInfoDay6 pewp=new ProEconPowerstationInfoDay6();
|
|
|
|
|
|
+ }
|
|
Initial.initial(pewp);
|
|
Initial.initial(pewp);
|
|
pewp.setForeignKeyId("0");
|
|
pewp.setForeignKeyId("0");
|
|
pewp.setLineId(ln.getId());
|
|
pewp.setLineId(ln.getId());
|
|
@@ -546,19 +538,18 @@ public class WindPowerInfo6Service {
|
|
pewp.setRecordDate(DateUtils.truncate(recordDate));
|
|
pewp.setRecordDate(DateUtils.truncate(recordDate));
|
|
|
|
|
|
//昨日的统计结果
|
|
//昨日的统计结果
|
|
- List<ProEconPowerstationInfoDay6> pepid1ls =new ArrayList<>();
|
|
|
|
- Calendar cl=Calendar.getInstance();
|
|
|
|
|
|
+ List<ProEconPowerstationInfoDay6> pepid1ls = new ArrayList<>();
|
|
|
|
+ Calendar cl = Calendar.getInstance();
|
|
cl.setTime(recordDate);
|
|
cl.setTime(recordDate);
|
|
- if(cl.get(Calendar.DAY_OF_MONTH)!=1)
|
|
|
|
-
|
|
|
|
- {
|
|
|
|
|
|
+ if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
|
|
pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
|
|
pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
|
|
.filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
|
|
.filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
|
|
|
|
+ && i.getLocation().equals(Location.ln.getValue())
|
|
&& i.getLineId().equals(ln.getId())
|
|
&& i.getLineId().equals(ln.getId())
|
|
- && i.getLocation().equals(Location.ln.getValue()))
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
+
|
|
|
|
+ ).collect(Collectors.toList());
|
|
}
|
|
}
|
|
- extracted(end, begin, pointmap, pewp,pepid1ls);
|
|
|
|
|
|
+ extracted(end, begin, pointmap, pewp, pepid1ls);
|
|
|
|
|
|
proEconPowerstationInfoDay6Service.save(pewp);
|
|
proEconPowerstationInfoDay6Service.save(pewp);
|
|
|
|
|
|
@@ -571,16 +562,13 @@ public class WindPowerInfo6Service {
|
|
|
|
|
|
private void extracted(Date end, Date begin, Map<String, ProBasicPowerstationPoint> pointmap, ProEconPowerstationInfoDay6 pewp, List<ProEconPowerstationInfoDay6> pepid1ls) throws Exception {
|
|
private void extracted(Date end, Date begin, Map<String, ProBasicPowerstationPoint> pointmap, ProEconPowerstationInfoDay6 pewp, List<ProEconPowerstationInfoDay6> pepid1ls) throws Exception {
|
|
//*******************************************日信息统计*********************************************************/
|
|
//*******************************************日信息统计*********************************************************/
|
|
- if(pointmap.containsKey(ContantXk.FCCFTFS70))
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- ProBasicPowerstationPoint point= pointmap.get(ContantXk.FCCFTFS70);
|
|
|
|
- if(StringUtils.notEmp(point.getNemCode()) && !point.getNemCode().equals(initialcode))
|
|
|
|
- {
|
|
|
|
- List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
|
|
|
|
- if(!pointls.isEmpty())
|
|
|
|
- {
|
|
|
|
- DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
|
|
|
|
|
|
+ if (pointmap.containsKey(ContantXk.FCCFTFS70)) {
|
|
|
|
+
|
|
|
|
+ ProBasicPowerstationPoint point = pointmap.get(ContantXk.FCCFTFS70);
|
|
|
|
+ if (StringUtils.notEmp(point.getNemCode()) && !point.getNemCode().equals(initialcode)) {
|
|
|
|
+ List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
|
|
|
|
+ if (!pointls.isEmpty()) {
|
|
|
|
+ DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
|
|
//日最大风速
|
|
//日最大风速
|
|
pewp.setRzdfscft(summaryStatistics.getMax());
|
|
pewp.setRzdfscft(summaryStatistics.getMax());
|
|
//日最小风速
|
|
//日最小风速
|
|
@@ -588,15 +576,12 @@ public class WindPowerInfo6Service {
|
|
//日平均风速
|
|
//日平均风速
|
|
pewp.setRpjfscft(summaryStatistics.getAverage());
|
|
pewp.setRpjfscft(summaryStatistics.getAverage());
|
|
}
|
|
}
|
|
- }else
|
|
|
|
- {
|
|
|
|
- if(pointmap.containsKey(ContantXk.SSPJFS))
|
|
|
|
- {
|
|
|
|
- point= pointmap.get(ContantXk.SSPJFS);
|
|
|
|
- List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
|
|
|
|
- if(!pointls.isEmpty())
|
|
|
|
- {
|
|
|
|
- DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
|
|
|
|
|
|
+ } else {
|
|
|
|
+ if (pointmap.containsKey(ContantXk.SSPJFS)) {
|
|
|
|
+ point = pointmap.get(ContantXk.SSPJFS);
|
|
|
|
+ List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
|
|
|
|
+ if (!pointls.isEmpty()) {
|
|
|
|
+ DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
|
|
//日最大风速
|
|
//日最大风速
|
|
pewp.setRzdfscft(summaryStatistics.getMax());
|
|
pewp.setRzdfscft(summaryStatistics.getMax());
|
|
//日最小风速
|
|
//日最小风速
|
|
@@ -609,14 +594,12 @@ public class WindPowerInfo6Service {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- }else if(pointmap.containsKey(ContantXk.SSPJFS))
|
|
|
|
- {
|
|
|
|
- ProBasicPowerstationPoint point= pointmap.get(ContantXk.SSPJFS);
|
|
|
|
|
|
+ } else if (pointmap.containsKey(ContantXk.SSPJFS)) {
|
|
|
|
+ ProBasicPowerstationPoint point = pointmap.get(ContantXk.SSPJFS);
|
|
|
|
|
|
- List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
|
|
|
|
- if(!pointls.isEmpty())
|
|
|
|
- {
|
|
|
|
- DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
|
|
|
|
|
|
+ List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
|
|
|
|
+ if (!pointls.isEmpty()) {
|
|
|
|
+ DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
|
|
//日最大风速
|
|
//日最大风速
|
|
pewp.setRzdfscft(summaryStatistics.getMax());
|
|
pewp.setRzdfscft(summaryStatistics.getMax());
|
|
//日最小风速
|
|
//日最小风速
|
|
@@ -628,16 +611,11 @@ public class WindPowerInfo6Service {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if(pointmap.containsKey(ContantXk.SSZGL))
|
|
|
|
- {
|
|
|
|
- ProBasicPowerstationPoint point= pointmap.get(ContantXk.SSZGL);
|
|
|
|
- List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
|
|
|
|
- if(!pointls.isEmpty())
|
|
|
|
- {
|
|
|
|
- DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
|
|
|
|
|
|
+ if (pointmap.containsKey(ContantXk.SSZGL)) {
|
|
|
|
+ ProBasicPowerstationPoint point = pointmap.get(ContantXk.SSZGL);
|
|
|
|
+ List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
|
|
|
|
+ if (!pointls.isEmpty()) {
|
|
|
|
+ DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
|
|
//日最大功率
|
|
//日最大功率
|
|
pewp.setRzdglcx(summaryStatistics.getMax());
|
|
pewp.setRzdglcx(summaryStatistics.getMax());
|
|
//日最小功率
|
|
//日最小功率
|
|
@@ -652,52 +630,43 @@ public class WindPowerInfo6Service {
|
|
|
|
|
|
//*******************************************月信息统计*********************************************************/
|
|
//*******************************************月信息统计*********************************************************/
|
|
|
|
|
|
- if(pepid1ls.isEmpty())
|
|
|
|
- {
|
|
|
|
|
|
+ if (pepid1ls.isEmpty()) {
|
|
setPowerandSpeedMonth(pewp);
|
|
setPowerandSpeedMonth(pewp);
|
|
- }else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
|
|
|
|
|
|
|
|
- ProEconPowerstationInfoDay6 pepid=pepid1ls.get(0);
|
|
|
|
|
|
+ ProEconPowerstationInfoDay6 pepid = pepid1ls.get(0);
|
|
|
|
|
|
//如果昨日大于今日最大功率
|
|
//如果昨日大于今日最大功率
|
|
- if(pepid.getYzdglcx()> pewp.getRzdglcx())
|
|
|
|
- {
|
|
|
|
|
|
+ if (pepid.getYzdglcx() > pewp.getRzdglcx()) {
|
|
pewp.setYzdglcx(pepid.getYzdglcx());
|
|
pewp.setYzdglcx(pepid.getYzdglcx());
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
pewp.setYzdglcx(pewp.getRzdglcx());
|
|
pewp.setYzdglcx(pewp.getRzdglcx());
|
|
}
|
|
}
|
|
//如果昨日大于今日最大风速
|
|
//如果昨日大于今日最大风速
|
|
- if(pepid.getYzdfscft()> pewp.getRzdfscft())
|
|
|
|
- {
|
|
|
|
|
|
+ if (pepid.getYzdfscft() > pewp.getRzdfscft()) {
|
|
pewp.setYzdfscft(pepid.getYzdfscft());
|
|
pewp.setYzdfscft(pepid.getYzdfscft());
|
|
- }else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
pewp.setYzdfscft(pewp.getRzdfscft());
|
|
pewp.setYzdfscft(pewp.getRzdfscft());
|
|
}
|
|
}
|
|
|
|
|
|
//如果昨日小于今日最小功率
|
|
//如果昨日小于今日最小功率
|
|
- if(pepid.getYzxglcx()< pewp.getRzxglcx())
|
|
|
|
- {
|
|
|
|
|
|
+ if (pepid.getYzxglcx() < pewp.getRzxglcx()) {
|
|
pewp.setYzxglcx(pepid.getYzxglcx());
|
|
pewp.setYzxglcx(pepid.getYzxglcx());
|
|
- }else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
pewp.setYzxglcx(pewp.getRzxglcx());
|
|
pewp.setYzxglcx(pewp.getRzxglcx());
|
|
}
|
|
}
|
|
//如果昨日小于今日最小风速
|
|
//如果昨日小于今日最小风速
|
|
- if(pepid.getYzxfscft()< pewp.getRzxfscft())
|
|
|
|
- {
|
|
|
|
|
|
+ if (pepid.getYzxfscft() < pewp.getRzxfscft()) {
|
|
pewp.setYzxfscft(pepid.getYzxfscft());
|
|
pewp.setYzxfscft(pepid.getYzxfscft());
|
|
- }else
|
|
|
|
- {
|
|
|
|
|
|
+ } else {
|
|
pewp.setYzxfscft(pewp.getRzxfscft());
|
|
pewp.setYzxfscft(pewp.getRzxfscft());
|
|
}
|
|
}
|
|
- double pjfs = BigDecimal.valueOf(pewp.getYpjfscft() + pepid.getRpjfscft()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
|
|
+ double pjfs = BigDecimal.valueOf(pewp.getYpjfscft() + pepid.getRpjfscft()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
|
|
pewp.setYzxfscft(pjfs);
|
|
pewp.setYzxfscft(pjfs);
|
|
|
|
|
|
- double pjgl = BigDecimal.valueOf(pewp.getYpjglcx() + pepid.getRpjglcx()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
|
|
+ double pjgl = BigDecimal.valueOf(pewp.getYpjglcx() + pepid.getRpjglcx()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
|
|
pewp.setYzxglcx(pjgl);
|
|
pewp.setYzxglcx(pjgl);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -706,10 +675,9 @@ public class WindPowerInfo6Service {
|
|
//*******************************************月信息统计*********************************************************/
|
|
//*******************************************月信息统计*********************************************************/
|
|
|
|
|
|
//*******************************************年信息统计*********************************************************/
|
|
//*******************************************年信息统计*********************************************************/
|
|
- if(pepid1ls.isEmpty())
|
|
|
|
- {
|
|
|
|
|
|
+ if (pepid1ls.isEmpty()) {
|
|
setPowerandSpeedYear(pewp);
|
|
setPowerandSpeedYear(pewp);
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
|
|
|
|
ProEconPowerstationInfoDay6 pepid = pepid1ls.get(0);
|
|
ProEconPowerstationInfoDay6 pepid = pepid1ls.get(0);
|
|
|
|
|