|
@@ -50,12 +50,13 @@ public class WindPowerInfo3Service {
|
|
|
List<ProEconPowerstationInfoDay3> fdls = map.get("fd");
|
|
|
List<ProEconPowerstationInfoDay3> gfls = map.get("gf");
|
|
|
|
|
|
- if (wpinfo.getForeignKeyId().equals("-1")) {
|
|
|
+ if (wpinfo.getForeignKeyId().contains("-1")) {
|
|
|
fdls.add(wpinfo);
|
|
|
- } else if (wpinfo.getForeignKeyId().equals("-2")) {
|
|
|
+ } else if (wpinfo.getForeignKeyId().contains("-2")) {
|
|
|
gfls.add(wpinfo);
|
|
|
+ }else if (wpinfo.getForeignKeyId().contains("0")) {
|
|
|
+ qbls.add(wpinfo);
|
|
|
}
|
|
|
- qbls.add(wpinfo);
|
|
|
} else {
|
|
|
Map<String, List<ProEconPowerstationInfoDay3>> map = new HashMap<>();
|
|
|
|
|
@@ -63,11 +64,11 @@ public class WindPowerInfo3Service {
|
|
|
List<ProEconPowerstationInfoDay3> gfls = new ArrayList<>();
|
|
|
List<ProEconPowerstationInfoDay3> fdls = new ArrayList<>();
|
|
|
|
|
|
- if (wpinfo.getForeignKeyId().equals("-1")) {
|
|
|
+ if (wpinfo.getForeignKeyId().contains("-1")) {
|
|
|
fdls.add(wpinfo);
|
|
|
- } else if (wpinfo.getForeignKeyId().equals("-2")) {
|
|
|
+ } else if (wpinfo.getForeignKeyId().contains("-2")) {
|
|
|
gfls.add(wpinfo);
|
|
|
- } else if (wpinfo.getForeignKeyId().equals("0")) {
|
|
|
+ } else if (wpinfo.getForeignKeyId().contains("0")) {
|
|
|
qbls.add(wpinfo);
|
|
|
}
|
|
|
map.put("qb", qbls);
|
|
@@ -107,19 +108,19 @@ public class WindPowerInfo3Service {
|
|
|
gf.setRegionId(cp.getId());
|
|
|
|
|
|
gf.setRecordDate(DateUtils.truncate(recordDate));
|
|
|
- gf.setForeignKeyId("-2");
|
|
|
+ gf.setForeignKeyId(cp.getId()+"-2");
|
|
|
gf.setLocation(Location.rg.getValue());
|
|
|
|
|
|
fd.setRegionId(cp.getId());
|
|
|
|
|
|
fd.setRecordDate(DateUtils.truncate(recordDate));
|
|
|
- fd.setForeignKeyId("-1");
|
|
|
+ fd.setForeignKeyId(cp.getId()+"-1");
|
|
|
fd.setLocation(Location.rg.getValue());
|
|
|
|
|
|
qb.setRegionId(cp.getId());
|
|
|
|
|
|
qb.setRecordDate(DateUtils.truncate(recordDate));
|
|
|
- qb.setForeignKeyId("0");
|
|
|
+ qb.setForeignKeyId(cp.getId()+"0");
|
|
|
qb.setLocation(Location.rg.getValue());
|
|
|
|
|
|
Initial.initial(qb);
|
|
@@ -230,20 +231,20 @@ public class WindPowerInfo3Service {
|
|
|
gf.setRegionId(cp.getRegionId());
|
|
|
gf.setCompanyId(cp.getId());
|
|
|
gf.setRecordDate(DateUtils.truncate(recordDate));
|
|
|
- gf.setForeignKeyId("-2");
|
|
|
+ gf.setForeignKeyId(cp.getId()+"-2");
|
|
|
gf.setLocation(Location.cp.getValue());
|
|
|
|
|
|
|
|
|
fd.setRegionId(cp.getRegionId());
|
|
|
fd.setCompanyId(cp.getId());
|
|
|
fd.setRecordDate(DateUtils.truncate(recordDate));
|
|
|
- fd.setForeignKeyId("-1");
|
|
|
+ fd.setForeignKeyId(cp.getId()+"-1");
|
|
|
fd.setLocation(Location.cp.getValue());
|
|
|
|
|
|
qb.setRegionId(cp.getRegionId());
|
|
|
qb.setCompanyId(cp.getId());
|
|
|
qb.setRecordDate(DateUtils.truncate(recordDate));
|
|
|
- qb.setForeignKeyId("0");
|
|
|
+ qb.setForeignKeyId(cp.getId()+"0");
|
|
|
qb.setLocation(Location.cp.getValue());
|
|
|
|
|
|
Initial.initial(qb);
|
|
@@ -398,6 +399,7 @@ public class WindPowerInfo3Service {
|
|
|
proEconPowerstationInfoDay3Service.removeByIds(idls);
|
|
|
|
|
|
}
|
|
|
+ List<ProEconPowerstationInfoDay3> dayls=new ArrayList<>();
|
|
|
for (ProBasicPowerstation wp : CacheContext.wpls) {
|
|
|
if (CacheContext.wppointmap.containsKey(wp.getId())) {
|
|
|
// Map<String, ProBasicPowerstationPoint> pointmap=CacheContext.wppointmap.get(wp.getId());
|
|
@@ -407,7 +409,7 @@ public class WindPowerInfo3Service {
|
|
|
pewp.setRegionId(wp.getRegionId());
|
|
|
pewp.setCompanyId(wp.getCompanyId());
|
|
|
pewp.setRecordDate(DateUtils.truncate(recordDate));
|
|
|
- pewp.setForeignKeyId("0");
|
|
|
+ pewp.setForeignKeyId(wp.getId());
|
|
|
pewp.setWindpowerstationId(wp.getId());
|
|
|
pewp.setLocation(Location.wp.getValue());
|
|
|
|
|
@@ -430,13 +432,14 @@ public class WindPowerInfo3Service {
|
|
|
calSimple(pewp, end, begin, CacheContext.wpwtmap.get(wp.getId()), pepidls);
|
|
|
//*******************************************年信息统计*********************************************************/
|
|
|
// wpinfodayls.add(pewp);
|
|
|
- proEconPowerstationInfoDay3Service.save(pewp);
|
|
|
+ dayls.add(pewp);
|
|
|
+ // proEconPowerstationInfoDay3Service.save(pewp);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ proEconPowerstationInfoDay3Service.saveBatch(dayls);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -462,6 +465,7 @@ public class WindPowerInfo3Service {
|
|
|
proEconPowerstationInfoDay3Service.removeByIds(idls);
|
|
|
|
|
|
}
|
|
|
+ List<ProEconPowerstationInfoDay3> dayls=new ArrayList<>();
|
|
|
for (ProBasicProject pj : CacheContext.pjls) {
|
|
|
// if(CacheContext.wppointmap.containsKey(pj.getId()))
|
|
|
// {
|
|
@@ -474,7 +478,7 @@ public class WindPowerInfo3Service {
|
|
|
pewp.setCompanyId(wp.getCompanyId());
|
|
|
}
|
|
|
Initial.initial(pewp);
|
|
|
- pewp.setForeignKeyId("0");
|
|
|
+ pewp.setForeignKeyId(pj.getId());
|
|
|
pewp.setWindpowerstationId(pj.getWindpowerstationId());
|
|
|
pewp.setProjectId(pj.getId());
|
|
|
pewp.setLocation(Location.pj.getValue());
|
|
@@ -498,13 +502,14 @@ public class WindPowerInfo3Service {
|
|
|
calDetiall(pewp, end, begin, CacheContext.pjwtmap.get(pj.getId()), pepidls);
|
|
|
|
|
|
calSimple(pewp, end, begin, CacheContext.pjwtmap.get(pj.getId()), pepidls);
|
|
|
- proEconPowerstationInfoDay3Service.save(pewp);
|
|
|
+ dayls.add(pewp);
|
|
|
+ // proEconPowerstationInfoDay3Service.save(pewp);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ proEconPowerstationInfoDay3Service.saveBatch(dayls);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -530,6 +535,7 @@ public class WindPowerInfo3Service {
|
|
|
proEconPowerstationInfoDay3Service.removeByIds(idls);
|
|
|
|
|
|
}
|
|
|
+ List<ProEconPowerstationInfoDay3> dayls=new ArrayList<>();
|
|
|
for (ProBasicLine ln : CacheContext.lnls) {
|
|
|
// if(CacheContext.linepointmap.containsKey(ln.getId()))
|
|
|
// {
|
|
@@ -547,7 +553,7 @@ public class WindPowerInfo3Service {
|
|
|
|
|
|
}
|
|
|
Initial.initial(pewp);
|
|
|
- pewp.setForeignKeyId("0");
|
|
|
+ pewp.setForeignKeyId(ln.getId());
|
|
|
pewp.setLineId(ln.getId());
|
|
|
pewp.setLocation(Location.ln.getValue());
|
|
|
pewp.setProjectId(ln.getProjectId());
|
|
@@ -570,13 +576,14 @@ public class WindPowerInfo3Service {
|
|
|
}
|
|
|
calDetiall(pewp, end, begin, CacheContext.lnwtmap.get(ln.getId()), pepidls);
|
|
|
calSimple(pewp, end, begin, CacheContext.lnwtmap.get(ln.getId()), pepidls);
|
|
|
- proEconPowerstationInfoDay3Service.save(pewp);
|
|
|
+ dayls.add(pewp);
|
|
|
+ // proEconPowerstationInfoDay3Service.save(pewp);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
// }
|
|
|
-
|
|
|
+ proEconPowerstationInfoDay3Service.saveBatch(dayls);
|
|
|
}
|
|
|
|
|
|
private void calDetiall(ProEconPowerstationInfoDay3 pewp, Date end, Date begin, List<ProBasicEquipment> wtls, List<ProEconPowerstationInfoDay3> pepidls) throws Exception {
|