|
@@ -10,13 +10,11 @@ import com.gyee.common.vo.specific.SpecificTarget;
|
|
|
import com.gyee.common.vo.specific.SpecificTargetVo;
|
|
|
import com.gyee.common.vo.specific.SpecificTopVo;
|
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
|
-import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
|
|
|
-import com.gyee.runeconomy.model.auto.ProEconPowerstationInfoDay1;
|
|
|
-import com.gyee.runeconomy.model.auto.ProEconPowerstationInfoDay4;
|
|
|
-import com.gyee.runeconomy.model.auto.ProEconPowerstationInfoDay5;
|
|
|
+import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconPowerstationInfoDay1Service;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconPowerstationInfoDay4Service;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconPowerstationInfoDay5Service;
|
|
|
+import com.gyee.runeconomy.service.auto.IProEconPowerstationInfoDay7Service;
|
|
|
import com.gyee.runeconomy.service.bmk.BenchmarkingService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -40,6 +38,8 @@ public class SpecificService {
|
|
|
@Resource
|
|
|
private IProEconPowerstationInfoDay5Service proEconPowerstationInfoDay5Service;
|
|
|
@Resource
|
|
|
+ private IProEconPowerstationInfoDay7Service proEconPowerstationInfoDay7Service;
|
|
|
+ @Resource
|
|
|
private BenchmarkingService benchmarkingService;
|
|
|
|
|
|
|
|
@@ -402,20 +402,29 @@ public class SpecificService {
|
|
|
String year = String.valueOf(Integer.parseInt(yearString) - 1);
|
|
|
String yearMonth = year+"-"+yearmonth.split("-")[1];
|
|
|
QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay7> qw1 = new QueryWrapper<>();
|
|
|
|
|
|
- qw.select("foreign_key_id,max(ymtbf) ymtbf,max(ymttr) ymttr,max(yfwjsl) yfwjsl,max(yztzhjsl) yztzhjsl,max(ygzxqjsl) ygzxqjsl");
|
|
|
+ qw.select("foreign_key_id,max(ymtbf) ymtbf,max(ymttr) ymttr,avg(rfwjsl) yfwjsl,avg(rztzhjsl) yztzhjsl,avg(rgzxqjsl) ygzxqjsl");
|
|
|
+ qw1.select("foreign_key_id,avg(rxtxlpr) yxtxlpr,avg(rlsl) ylsl,avg(rnbqzhxl) ynbqzhxl");
|
|
|
qw.eq("location","wp");
|
|
|
+ qw1.eq("location","wp");
|
|
|
if (type.endsWith("-1")){
|
|
|
qw.like("foreign_key_id","_FDC_");
|
|
|
+ qw1.like("foreign_key_id","_FDC_");
|
|
|
}else if (type.endsWith("-2")){
|
|
|
qw.like("foreign_key_id","_GDC_");
|
|
|
+ qw1.like("foreign_key_id","_GDC_");
|
|
|
}
|
|
|
if (companys.endsWith("ZGS")){
|
|
|
qw.in("foreign_key_id",CacheContext.wpls.stream().filter(wp->wp.getCompanyId().equals(companys)).map(wp->wp.getId()).collect(Collectors.toList()));
|
|
|
+ qw1.in("foreign_key_id",CacheContext.wpls.stream().filter(wp->wp.getCompanyId().equals(companys)).map(wp->wp.getId()).collect(Collectors.toList()));
|
|
|
}
|
|
|
qw.eq("to_char(record_date,'yyyy-MM')",yearMonth);
|
|
|
+ qw1.eq("to_char(record_date,'yyyy-MM')",yearMonth);
|
|
|
qw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ qw1.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
List<ProEconPowerstationInfoDay4> tqList = proEconPowerstationInfoDay4Service.list(qw);
|
|
|
+ List<ProEconPowerstationInfoDay7> tq1List = proEconPowerstationInfoDay7Service.list(qw1);
|
|
|
if (StringUtils.isNotEmpty(tqList)){
|
|
|
tqList.stream().forEach(i->{
|
|
|
Optional<SpecificCenterVo> optionMonth = monthresultList.stream().filter(j -> j.getWpid().equals(i.getWindpowerstationId())).findFirst();
|
|
@@ -423,9 +432,23 @@ public class SpecificService {
|
|
|
if (optionMonth.isPresent()){
|
|
|
leftVo.setTqmtbf(DoubleUtils.keepPrecision(i.getYmtbf().doubleValue(),2));
|
|
|
leftVo.setTqmttr(DoubleUtils.keepPrecision(i.getYmttr().doubleValue(),2));
|
|
|
- leftVo.setTqfwjsl(DoubleUtils.keepPrecision(i.getYfwjsl().doubleValue(),2));
|
|
|
- leftVo.setTqztzhl(DoubleUtils.keepPrecision(i.getYztzhjsl().doubleValue(),2));
|
|
|
- leftVo.setTqxqjsl(DoubleUtils.keepPrecision(i.getYgzxqjsl().doubleValue(),2));
|
|
|
+ if (type.equals("-1")){
|
|
|
+ leftVo.setTqfwjsl(DoubleUtils.keepPrecision(i.getYfwjsl().doubleValue(),2));
|
|
|
+ leftVo.setTqztzhl(DoubleUtils.keepPrecision(i.getYztzhjsl().doubleValue(),2));
|
|
|
+ leftVo.setTqxqjsl(DoubleUtils.keepPrecision(i.getYgzxqjsl().doubleValue(),2));
|
|
|
+ }else if (type.equals("-2")){
|
|
|
+ Optional<ProEconPowerstationInfoDay7> first = tq1List.stream().filter(d -> d.getForeignKeyId().equals(i.getForeignKeyId())).findFirst();
|
|
|
+ if (first.isPresent()){
|
|
|
+ ProEconPowerstationInfoDay7 proEconPowerstationInfoDay7 = first.get();
|
|
|
+ leftVo.setFwjsl(DoubleUtils.keepPrecision(proEconPowerstationInfoDay7.getYxtxlpr().doubleValue(),2));
|
|
|
+ leftVo.setZtzhl(DoubleUtils.keepPrecision(proEconPowerstationInfoDay7.getYlsl().doubleValue(),2));
|
|
|
+ leftVo.setXqjsl(DoubleUtils.keepPrecision(proEconPowerstationInfoDay7.getYnbqzhxl().doubleValue(),2));
|
|
|
+ }else {
|
|
|
+ leftVo.setFwjsl(0.0);
|
|
|
+ leftVo.setZtzhl(0.0);
|
|
|
+ leftVo.setXqjsl(0.0);
|
|
|
+ }
|
|
|
+ }
|
|
|
}else{
|
|
|
leftVo.setTqmtbf(0.0);
|
|
|
leftVo.setTqmttr(0.0);
|
|
@@ -462,19 +485,28 @@ public class SpecificService {
|
|
|
String yearString = yearmonth.split("-")[0];
|
|
|
String year = String.valueOf(Integer.parseInt(yearString) - 1);
|
|
|
QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
|
|
|
- qw.select("foreign_key_id,max(nmtbf) nmtbf,max(nmttr) nmttr,max(nfwjsl) nfwjsl,max(nztzhjsl) nztzhjsl,max(ngzxqjsl) ngzxqjsl");
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay7> qw1 = new QueryWrapper<>();
|
|
|
+ qw.select("foreign_key_id,max(nmtbf) nmtbf,max(nmttr) nmttr,avg(rfwjsl) nfwjsl,avg(rztzhjsl) nztzhjsl,avg(rgzxqjsl) ngzxqjsl");
|
|
|
+ qw1.select("foreign_key_id,avg(rxtxlpr) nxtxlpr,avg(rlsl) nlsl,avg(rnbqzhxl) nnbqzhxl");
|
|
|
qw.eq("location","wp");
|
|
|
+ qw1.eq("location","wp");
|
|
|
if (type.endsWith("-1")){
|
|
|
qw.like("foreign_key_id","_FDC_");
|
|
|
+ qw1.like("foreign_key_id","_FDC_");
|
|
|
}else if (type.endsWith("-2")){
|
|
|
qw.like("foreign_key_id","_GDC_");
|
|
|
+ qw1.like("foreign_key_id","_GDC_");
|
|
|
}
|
|
|
if (companys.endsWith("ZGS")){
|
|
|
qw.in("foreign_key_id",CacheContext.wpls.stream().filter(wp->wp.getCompanyId().equals(companys)).map(wp->wp.getId()).collect(Collectors.toList()));
|
|
|
+ qw1.in("foreign_key_id",CacheContext.wpls.stream().filter(wp->wp.getCompanyId().equals(companys)).map(wp->wp.getId()).collect(Collectors.toList()));
|
|
|
}
|
|
|
qw.eq("to_char(record_date,'yyyy')",year);
|
|
|
+ qw1.eq("to_char(record_date,'yyyy')",year);
|
|
|
qw.groupBy("to_char(record_date,'yyyy'),foreign_key_id");
|
|
|
+ qw1.groupBy("to_char(record_date,'yyyy'),foreign_key_id");
|
|
|
List<ProEconPowerstationInfoDay4> tqList = proEconPowerstationInfoDay4Service.list(qw);
|
|
|
+ List<ProEconPowerstationInfoDay7> tq1List = proEconPowerstationInfoDay7Service.list(qw1);
|
|
|
if (StringUtils.isNotEmpty(tqList)){
|
|
|
tqList.stream().forEach(i->{
|
|
|
Optional<SpecificCenterVo> optionYear = yearresultList.stream().filter(j -> j.getWpid().equals(i.getWindpowerstationId())).findFirst();
|
|
@@ -482,9 +514,23 @@ public class SpecificService {
|
|
|
SpecificCenterVo rightVo = optionYear.get();
|
|
|
rightVo.setTqmtbf(DoubleUtils.keepPrecision(i.getNmtbf().doubleValue(),2));
|
|
|
rightVo.setTqmttr(DoubleUtils.keepPrecision(i.getNmttr().doubleValue(),2));
|
|
|
- rightVo.setTqfwjsl(DoubleUtils.keepPrecision(i.getNfwjsl().doubleValue(),2));
|
|
|
- rightVo.setTqztzhl(DoubleUtils.keepPrecision(i.getNztzhjsl().doubleValue(),2));
|
|
|
- rightVo.setTqxqjsl(DoubleUtils.keepPrecision(i.getNgzxqjsl().doubleValue(),2));
|
|
|
+ if (type.equals("-1")){
|
|
|
+ rightVo.setTqfwjsl(DoubleUtils.keepPrecision(i.getNfwjsl().doubleValue(),2));
|
|
|
+ rightVo.setTqztzhl(DoubleUtils.keepPrecision(i.getNztzhjsl().doubleValue(),2));
|
|
|
+ rightVo.setTqxqjsl(DoubleUtils.keepPrecision(i.getNgzxqjsl().doubleValue(),2));
|
|
|
+ }else if (type.equals("-2")){
|
|
|
+ Optional<ProEconPowerstationInfoDay7> first = tq1List.stream().filter(d -> d.getForeignKeyId().equals(i.getForeignKeyId())).findFirst();
|
|
|
+ if (first.isPresent()){
|
|
|
+ ProEconPowerstationInfoDay7 proEconPowerstationInfoDay7 = first.get();
|
|
|
+ rightVo.setFwjsl(DoubleUtils.keepPrecision(proEconPowerstationInfoDay7.getNxtxlpr().doubleValue(),2));
|
|
|
+ rightVo.setZtzhl(DoubleUtils.keepPrecision(proEconPowerstationInfoDay7.getNlsl().doubleValue(),2));
|
|
|
+ rightVo.setXqjsl(DoubleUtils.keepPrecision(proEconPowerstationInfoDay7.getNnbqzhxl().doubleValue(),2));
|
|
|
+ }else {
|
|
|
+ rightVo.setFwjsl(0.0);
|
|
|
+ rightVo.setZtzhl(0.0);
|
|
|
+ rightVo.setXqjsl(0.0);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}else {
|
|
@@ -513,31 +559,53 @@ public class SpecificService {
|
|
|
*/
|
|
|
private void setCenterDyInfo(String companys,String type,String yearmonth, List<SpecificCenterVo> monthresultList) {
|
|
|
QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
|
|
|
-
|
|
|
- qw.select("foreign_key_id,max(ymtbf) ymtbf,max(ymttr) ymttr,max(yfwjsl) yfwjsl,max(yztzhjsl) yztzhjsl,max(ygzxqjsl) ygzxqjsl");
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay7> qw1 = new QueryWrapper<>();
|
|
|
+ qw.select("foreign_key_id,max(ymtbf) ymtbf,max(ymttr) ymttr,avg(rfwjsl) yfwjsl,avg(rztzhjsl) yztzhjsl,avg(rgzxqjsl) ygzxqjsl");
|
|
|
+ qw1.select("foreign_key_id,avg(rxtxlpr) yxtxlpr,avg(rlsl) ylsl,avg(rnbqzhxl) ynbqzhxl");
|
|
|
qw.eq("location","wp");
|
|
|
+ qw1.eq("location","wp");
|
|
|
if (type.endsWith("-1")){
|
|
|
qw.like("foreign_key_id","_FDC_");
|
|
|
+ qw1.like("foreign_key_id","_FDC_");
|
|
|
}else if (type.endsWith("-2")){
|
|
|
qw.like("foreign_key_id","_GDC_");
|
|
|
+ qw1.like("foreign_key_id","_GDC_");
|
|
|
}
|
|
|
|
|
|
if (companys.endsWith("ZGS")){
|
|
|
- List<String> collect = CacheContext.wpls.stream().filter(wp -> wp.getCompanyId().equals(companys)).map(wp -> wp.getId()).collect(Collectors.toList());
|
|
|
qw.in("foreign_key_id",CacheContext.wpls.stream().filter(wp -> wp.getCompanyId().equals(companys)).map(wp -> wp.getId()).collect(Collectors.toList()));
|
|
|
+ qw1.in("foreign_key_id",CacheContext.wpls.stream().filter(wp -> wp.getCompanyId().equals(companys)).map(wp -> wp.getId()).collect(Collectors.toList()));
|
|
|
}
|
|
|
qw.eq("to_char(record_date,'yyyy-MM')",yearmonth);
|
|
|
+ qw1.eq("to_char(record_date,'yyyy-MM')",yearmonth);
|
|
|
qw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ qw1.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
List<ProEconPowerstationInfoDay4> dyList = proEconPowerstationInfoDay4Service.list(qw);
|
|
|
+ List<ProEconPowerstationInfoDay7> dy1List = proEconPowerstationInfoDay7Service.list(qw1);
|
|
|
if (StringUtils.isNotEmpty(dyList)){
|
|
|
dyList.stream().forEach(i->{
|
|
|
SpecificCenterVo leftVo = new SpecificCenterVo();
|
|
|
leftVo.setWpid(i.getForeignKeyId());
|
|
|
leftVo.setMtbf(DoubleUtils.keepPrecision(i.getYmtbf().doubleValue(),2));
|
|
|
leftVo.setMttr(DoubleUtils.keepPrecision(i.getYmttr().doubleValue(),2));
|
|
|
- leftVo.setFwjsl(DoubleUtils.keepPrecision(i.getYfwjsl().doubleValue(),2));
|
|
|
- leftVo.setZtzhl(DoubleUtils.keepPrecision(i.getYztzhjsl().doubleValue(),2));
|
|
|
- leftVo.setXqjsl(DoubleUtils.keepPrecision(i.getYgzxqjsl().doubleValue(),2));
|
|
|
+ if (type.equals("-1")){
|
|
|
+ leftVo.setFwjsl(DoubleUtils.keepPrecision(i.getYfwjsl().doubleValue(),2));
|
|
|
+ leftVo.setZtzhl(DoubleUtils.keepPrecision(i.getYztzhjsl().doubleValue(),2));
|
|
|
+ leftVo.setXqjsl(DoubleUtils.keepPrecision(i.getYgzxqjsl().doubleValue(),2));
|
|
|
+ }else if (type.equals("-2")){
|
|
|
+ Optional<ProEconPowerstationInfoDay7> first = dy1List.stream().filter(d -> d.getForeignKeyId().equals(i.getForeignKeyId())).findFirst();
|
|
|
+ if (first.isPresent()){
|
|
|
+ ProEconPowerstationInfoDay7 proEconPowerstationInfoDay7 = first.get();
|
|
|
+ leftVo.setFwjsl(DoubleUtils.keepPrecision(proEconPowerstationInfoDay7.getYxtxlpr().doubleValue(),2));
|
|
|
+ leftVo.setZtzhl(DoubleUtils.keepPrecision(proEconPowerstationInfoDay7.getYlsl().doubleValue(),2));
|
|
|
+ leftVo.setXqjsl(DoubleUtils.keepPrecision(proEconPowerstationInfoDay7.getYnbqzhxl().doubleValue(),2));
|
|
|
+ }else {
|
|
|
+ leftVo.setFwjsl(0.0);
|
|
|
+ leftVo.setZtzhl(0.0);
|
|
|
+ leftVo.setXqjsl(0.0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
monthresultList.add(leftVo);
|
|
|
});
|
|
|
}else {
|
|
@@ -565,29 +633,51 @@ public class SpecificService {
|
|
|
|
|
|
|
|
|
QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
|
|
|
-
|
|
|
- qw.select("foreign_key_id,max(nmtbf) nmtbf,max(nmttr) nmttr,max(nfwjsl) nfwjsl,max(nztzhjsl) nztzhjsl,max(ngzxqjsl) ngzxqjsl");
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay7> qw1 = new QueryWrapper<>();
|
|
|
+ qw.select("foreign_key_id,max(nmtbf) nmtbf,max(nmttr) nmttr,avg(rfwjsl) nfwjsl,avg(rztzhjsl) nztzhjsl,avg(rgzxqjsl) ngzxqjsl");
|
|
|
+ qw1.select("foreign_key_id,avg(rxtxlpr) nxtxlpr,avg(rlsl) nlsl,avg(rnbqzhxl) nnbqzhxl");
|
|
|
qw.eq("location","wp");
|
|
|
+ qw1.eq("location","wp");
|
|
|
if (type.endsWith("-1")){
|
|
|
qw.like("foreign_key_id","_FDC_");
|
|
|
+ qw1.like("foreign_key_id","_FDC_");
|
|
|
}else if (type.endsWith("-2")){
|
|
|
qw.like("foreign_key_id","_GDC_");
|
|
|
+ qw1.like("foreign_key_id","_GDC_");
|
|
|
}
|
|
|
if (companys.endsWith("ZGS")){
|
|
|
qw.in("foreign_key_id",CacheContext.wpls.stream().filter(wp->wp.getCompanyId().equals(companys)).map(wp->wp.getId()).collect(Collectors.toList()));
|
|
|
+ qw1.in("foreign_key_id",CacheContext.wpls.stream().filter(wp->wp.getCompanyId().equals(companys)).map(wp->wp.getId()).collect(Collectors.toList()));
|
|
|
}
|
|
|
qw.eq("to_char(record_date,'yyyy')",yearmonth.split("-")[0]);
|
|
|
+ qw1.eq("to_char(record_date,'yyyy')",yearmonth.split("-")[0]);
|
|
|
qw.groupBy("to_char(record_date,'yyyy'),foreign_key_id");
|
|
|
+ qw1.groupBy("to_char(record_date,'yyyy'),foreign_key_id");
|
|
|
List<ProEconPowerstationInfoDay4> dyList = proEconPowerstationInfoDay4Service.list(qw);
|
|
|
+ List<ProEconPowerstationInfoDay7> dy1List = proEconPowerstationInfoDay7Service.list(qw1);
|
|
|
if (StringUtils.isNotEmpty(dyList)){
|
|
|
dyList.stream().forEach(i->{
|
|
|
SpecificCenterVo rightVo = new SpecificCenterVo();
|
|
|
rightVo.setWpid(i.getForeignKeyId());
|
|
|
rightVo.setMtbf(DoubleUtils.keepPrecision(i.getNmtbf().doubleValue(),2));
|
|
|
rightVo.setMttr(DoubleUtils.keepPrecision(i.getNmttr().doubleValue(),2));
|
|
|
- rightVo.setFwjsl(DoubleUtils.keepPrecision(i.getNfwjsl().doubleValue(),2));
|
|
|
- rightVo.setZtzhl(DoubleUtils.keepPrecision(i.getNztzhjsl().doubleValue(),2));
|
|
|
- rightVo.setXqjsl(DoubleUtils.keepPrecision(i.getNgzxqjsl().doubleValue(),2));
|
|
|
+ if (type.equals("-1")){
|
|
|
+ rightVo.setFwjsl(DoubleUtils.keepPrecision(i.getNfwjsl().doubleValue(),2));
|
|
|
+ rightVo.setZtzhl(DoubleUtils.keepPrecision(i.getNztzhjsl().doubleValue(),2));
|
|
|
+ rightVo.setXqjsl(DoubleUtils.keepPrecision(i.getNgzxqjsl().doubleValue(),2));
|
|
|
+ }else if (type.equals("-2")){
|
|
|
+ Optional<ProEconPowerstationInfoDay7> first = dy1List.stream().filter(d -> d.getForeignKeyId().equals(i.getForeignKeyId())).findFirst();
|
|
|
+ if (first.isPresent()){
|
|
|
+ ProEconPowerstationInfoDay7 proEconPowerstationInfoDay7 = first.get();
|
|
|
+ rightVo.setFwjsl(DoubleUtils.keepPrecision(proEconPowerstationInfoDay7.getNxtxlpr().doubleValue(),2));
|
|
|
+ rightVo.setZtzhl(DoubleUtils.keepPrecision(proEconPowerstationInfoDay7.getNlsl().doubleValue(),2));
|
|
|
+ rightVo.setXqjsl(DoubleUtils.keepPrecision(proEconPowerstationInfoDay7.getNnbqzhxl().doubleValue(),2));
|
|
|
+ }else {
|
|
|
+ rightVo.setFwjsl(0.0);
|
|
|
+ rightVo.setZtzhl(0.0);
|
|
|
+ rightVo.setXqjsl(0.0);
|
|
|
+ }
|
|
|
+ }
|
|
|
yearresultList.add(rightVo);
|
|
|
});
|
|
|
}else {
|
|
@@ -2517,4 +2607,441 @@ public class SpecificService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public List<SpecificTarget> xtxlList(String companys, String type, String year) {
|
|
|
+ //获取年份所有当月的数据
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay7> currentqw = new QueryWrapper<>();
|
|
|
+ currentqw.select("foreign_key_id,max(record_date) record_date,avg(yxtxlpr) yxtxlpr");
|
|
|
+ currentqw.eq("location","wp");
|
|
|
+ currentqw.eq("to_char(record_date,'yyyy')",year);
|
|
|
+ if (type.equals("-1")){
|
|
|
+ currentqw.like("foreign_key_id","_FDC_");
|
|
|
+ }else {
|
|
|
+ currentqw.like("foreign_key_id","_GDC_");
|
|
|
+ }
|
|
|
+ if (companys.endsWith("ZGS")){
|
|
|
+ currentqw.eq("company_id",companys);
|
|
|
+ }else {
|
|
|
+ currentqw.eq("region_id",companys);
|
|
|
+ }
|
|
|
+ currentqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ List<ProEconPowerstationInfoDay7> currentList = proEconPowerstationInfoDay7Service.list(currentqw);
|
|
|
+ currentqw.clear();
|
|
|
+ currentqw.select("foreign_key_id,max(record_date) record_date,avg(yxtxlpr) yxtxlpr");
|
|
|
+ currentqw.eq("foreign_key_id",companys+type);
|
|
|
+ currentqw.eq("to_char(record_date,'yyyy')",year);
|
|
|
+ currentqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ currentList.addAll(proEconPowerstationInfoDay7Service.list(currentqw));
|
|
|
+
|
|
|
+ int subYear = Integer.parseInt(year) - 1;
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay7> sameperiodqw = new QueryWrapper<>();
|
|
|
+ sameperiodqw.select("foreign_key_id,max(record_date) record_date,avg(yxtxlpr) yxtxlpr");
|
|
|
+ sameperiodqw.eq("location","wp");
|
|
|
+ if (type.equals("-1")){
|
|
|
+ currentqw.like("foreign_key_id","_FDC_");
|
|
|
+ }else {
|
|
|
+ currentqw.like("foreign_key_id","_GDC_");
|
|
|
+ }
|
|
|
+ if (companys.endsWith("ZGS")){
|
|
|
+ currentqw.eq("company_id",companys);
|
|
|
+ }else {
|
|
|
+ currentqw.eq("region_id",companys);
|
|
|
+ }
|
|
|
+ sameperiodqw.eq("to_char(record_date,'yyyy')",String.valueOf(subYear));
|
|
|
+ sameperiodqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ List<ProEconPowerstationInfoDay7> sameperiodList = proEconPowerstationInfoDay7Service.list(sameperiodqw);
|
|
|
+ sameperiodqw.clear();
|
|
|
+ sameperiodqw.select("foreign_key_id,max(record_date) record_date,avg(yxtxlpr) yxtxlpr");
|
|
|
+ sameperiodqw.eq("foreign_key_id",companys+type);
|
|
|
+ sameperiodqw.eq("to_char(record_date,'yyyy')",String.valueOf(subYear));
|
|
|
+ sameperiodqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ sameperiodList.addAll(proEconPowerstationInfoDay7Service.list(sameperiodqw));
|
|
|
+
|
|
|
+ //合并当月与同期数据为返回结果
|
|
|
+ List<SpecificTargetVo> resultList = new ArrayList<>();
|
|
|
+
|
|
|
+ currentList.stream().forEach(i->{
|
|
|
+ SpecificTargetVo vo = new SpecificTargetVo();
|
|
|
+ String wpid = i.getForeignKeyId();
|
|
|
+ vo.setWpid(wpid);
|
|
|
+ if(wpid.contains("_ZGS")){
|
|
|
+ vo.setWpname(CacheContext.cpmap.get(companys).getAname());
|
|
|
+ }else if(wpid.contains("_RGN")){
|
|
|
+ vo.setWpname(CacheContext.rgmap.get(companys).getAname());
|
|
|
+ }else{
|
|
|
+ vo.setWpname(CacheContext.wpmap.get(wpid).getAname());
|
|
|
+ }
|
|
|
+ vo.setYear(DateUtils.getYear(i.getRecordDate()));
|
|
|
+ vo.setMonth(DateUtils.getMonth(i.getRecordDate()));
|
|
|
+ vo.setCurrent(DoubleUtils.keepPrecision(i.getYxtxlpr().doubleValue(),2));
|
|
|
+ resultList.add(vo);
|
|
|
+ });
|
|
|
+ resultList.stream().forEach(i->{
|
|
|
+ Optional<ProEconPowerstationInfoDay7> optional = sameperiodList.stream()
|
|
|
+ .filter(j -> j.getForeignKeyId().equals(i.getWpid()) && String.valueOf(DateUtils.getMonth(j.getRecordDate())).equals(i.getMonth()))
|
|
|
+ .findFirst();
|
|
|
+ if (optional.isPresent()){
|
|
|
+ ProEconPowerstationInfoDay7 tqinfoday = optional.get();
|
|
|
+ i.setSameperiod(DoubleUtils.keepPrecision(tqinfoday.getYxtxlpr().doubleValue(),2));
|
|
|
+ i.setCompare(i.getCurrent().compareTo(i.getSameperiod()));
|
|
|
+ }else {
|
|
|
+ i.setSameperiod(0.0);
|
|
|
+ i.setCompare(0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ List<SpecificTarget> resultendList = new ArrayList<>();
|
|
|
+
|
|
|
+ Map<String,Map<Integer,SpecificTargetVo>> map = new HashMap<>();
|
|
|
+
|
|
|
+ resultList.stream().forEach(i->{
|
|
|
+ if (map.containsKey(i.getWpid())){
|
|
|
+ Map<Integer, SpecificTargetVo> integerListMap = map.get(i.getWpid());
|
|
|
+ if (!integerListMap.containsKey(i.getMonth())){
|
|
|
+ map.get(i.getWpid()).put(i.getMonth(),i);
|
|
|
+ }else {
|
|
|
+
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ Map<Integer,SpecificTargetVo> tempMap = new HashMap<>();
|
|
|
+ tempMap.put(i.getMonth(),i);
|
|
|
+ map.put(i.getWpid(),tempMap);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ Set<String> wpids = map.keySet();
|
|
|
+ if (StringUtils.isNotNull(wpids)){
|
|
|
+ wpids.stream().forEach(wpid->{
|
|
|
+ SpecificTarget vo = new SpecificTarget();
|
|
|
+ vo.setWpid(wpid);
|
|
|
+ int orderNum = 100;
|
|
|
+ if(wpid.contains("_ZGS")){
|
|
|
+ vo.setWpname(CacheContext.cpmap.get(companys).getAname());
|
|
|
+ }else if(wpid.contains("_RGN")){
|
|
|
+ vo.setWpname(CacheContext.rgmap.get(companys).getAname());
|
|
|
+ }else{
|
|
|
+ vo.setWpname(CacheContext.wpmap.get(wpid).getAname());
|
|
|
+ orderNum = CacheContext.wpmap.get(wpid).getOrderNum();
|
|
|
+ }
|
|
|
+ vo.setOrderNum(orderNum);
|
|
|
+ List<SpecificTargetVo> tempList = new ArrayList<>();
|
|
|
+
|
|
|
+ Map<Integer, SpecificTargetVo> listMap = map.get(wpid);
|
|
|
+ for(int x = 1;x<=12;x++){
|
|
|
+ if (listMap.containsKey(x)){
|
|
|
+ tempList.add(listMap.get(x));
|
|
|
+ }else {
|
|
|
+ SpecificTargetVo vo1 = new SpecificTargetVo();
|
|
|
+ vo1.setWpid(wpid);
|
|
|
+ if(wpid.contains("_ZGS")){
|
|
|
+ vo1.setWpname(CacheContext.cpmap.get(companys).getAname());
|
|
|
+ }else if(wpid.contains("_RGN")){
|
|
|
+ vo1.setWpname(CacheContext.rgmap.get(companys).getAname());
|
|
|
+ }else{
|
|
|
+ vo1.setWpname(CacheContext.wpmap.get(wpid).getAname());
|
|
|
+ }
|
|
|
+ vo1.setYear(Integer.parseInt(year));
|
|
|
+ vo1.setMonth(x);
|
|
|
+ tempList.add(vo1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ vo.setTargetList(tempList);
|
|
|
+ resultendList.add(vo);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ SortUtils.sort(resultendList,"orderNum",SortUtils.ASC);
|
|
|
+
|
|
|
+ return resultendList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<SpecificTarget> lslList(String companys, String type, String year) {
|
|
|
+ //获取年份所有当月的数据
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay7> currentqw = new QueryWrapper<>();
|
|
|
+ currentqw.select("foreign_key_id,max(record_date) record_date,avg(ylsl) ylsl");
|
|
|
+ currentqw.eq("location","wp");
|
|
|
+ currentqw.eq("to_char(record_date,'yyyy')",year);
|
|
|
+ if (type.equals("-1")){
|
|
|
+ currentqw.like("foreign_key_id","_FDC_");
|
|
|
+ }else {
|
|
|
+ currentqw.like("foreign_key_id","_GDC_");
|
|
|
+ }
|
|
|
+ if (companys.endsWith("ZGS")){
|
|
|
+ currentqw.eq("company_id",companys);
|
|
|
+ }else {
|
|
|
+ currentqw.eq("region_id",companys);
|
|
|
+ }
|
|
|
+ currentqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ List<ProEconPowerstationInfoDay7> currentList = proEconPowerstationInfoDay7Service.list(currentqw);
|
|
|
+ currentqw.clear();
|
|
|
+ currentqw.select("foreign_key_id,max(record_date) record_date,avg(ylsl) ylsl");
|
|
|
+ currentqw.eq("foreign_key_id",companys+type);
|
|
|
+ currentqw.eq("to_char(record_date,'yyyy')",year);
|
|
|
+ currentqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ currentList.addAll(proEconPowerstationInfoDay7Service.list(currentqw));
|
|
|
+
|
|
|
+ int subYear = Integer.parseInt(year) - 1;
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay7> sameperiodqw = new QueryWrapper<>();
|
|
|
+ sameperiodqw.select("foreign_key_id,max(record_date) record_date,avg(ylsl) ylsl");
|
|
|
+ sameperiodqw.eq("location","wp");
|
|
|
+ if (type.equals("-1")){
|
|
|
+ currentqw.like("foreign_key_id","_FDC_");
|
|
|
+ }else {
|
|
|
+ currentqw.like("foreign_key_id","_GDC_");
|
|
|
+ }
|
|
|
+ if (companys.endsWith("ZGS")){
|
|
|
+ currentqw.eq("company_id",companys);
|
|
|
+ }else {
|
|
|
+ currentqw.eq("region_id",companys);
|
|
|
+ }
|
|
|
+ sameperiodqw.eq("to_char(record_date,'yyyy')",String.valueOf(subYear));
|
|
|
+ sameperiodqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ List<ProEconPowerstationInfoDay7> sameperiodList = proEconPowerstationInfoDay7Service.list(sameperiodqw);
|
|
|
+ sameperiodqw.clear();
|
|
|
+ sameperiodqw.select("foreign_key_id,max(record_date) record_date,avg(ylsl) ylsl");
|
|
|
+ sameperiodqw.eq("foreign_key_id",companys+type);
|
|
|
+ sameperiodqw.eq("to_char(record_date,'yyyy')",String.valueOf(subYear));
|
|
|
+ sameperiodqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ sameperiodList.addAll(proEconPowerstationInfoDay7Service.list(sameperiodqw));
|
|
|
+
|
|
|
+ //合并当月与同期数据为返回结果
|
|
|
+ List<SpecificTargetVo> resultList = new ArrayList<>();
|
|
|
+
|
|
|
+ currentList.stream().forEach(i->{
|
|
|
+ SpecificTargetVo vo = new SpecificTargetVo();
|
|
|
+ String wpid = i.getForeignKeyId();
|
|
|
+ vo.setWpid(wpid);
|
|
|
+ if(wpid.contains("_ZGS")){
|
|
|
+ vo.setWpname(CacheContext.cpmap.get(companys).getAname());
|
|
|
+ }else if(wpid.contains("_RGN")){
|
|
|
+ vo.setWpname(CacheContext.rgmap.get(companys).getAname());
|
|
|
+ }else{
|
|
|
+ vo.setWpname(CacheContext.wpmap.get(wpid).getAname());
|
|
|
+ }
|
|
|
+ vo.setYear(DateUtils.getYear(i.getRecordDate()));
|
|
|
+ vo.setMonth(DateUtils.getMonth(i.getRecordDate()));
|
|
|
+ vo.setCurrent(DoubleUtils.keepPrecision(i.getYxtxlpr().doubleValue(),2));
|
|
|
+ resultList.add(vo);
|
|
|
+ });
|
|
|
+ resultList.stream().forEach(i->{
|
|
|
+ Optional<ProEconPowerstationInfoDay7> optional = sameperiodList.stream()
|
|
|
+ .filter(j -> j.getForeignKeyId().equals(i.getWpid()) && String.valueOf(DateUtils.getMonth(j.getRecordDate())).equals(i.getMonth()))
|
|
|
+ .findFirst();
|
|
|
+ if (optional.isPresent()){
|
|
|
+ ProEconPowerstationInfoDay7 tqinfoday = optional.get();
|
|
|
+ i.setSameperiod(DoubleUtils.keepPrecision(tqinfoday.getYxtxlpr().doubleValue(),2));
|
|
|
+ i.setCompare(i.getCurrent().compareTo(i.getSameperiod()));
|
|
|
+ }else {
|
|
|
+ i.setSameperiod(0.0);
|
|
|
+ i.setCompare(0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ List<SpecificTarget> resultendList = new ArrayList<>();
|
|
|
+
|
|
|
+ Map<String,Map<Integer,SpecificTargetVo>> map = new HashMap<>();
|
|
|
+
|
|
|
+ resultList.stream().forEach(i->{
|
|
|
+ if (map.containsKey(i.getWpid())){
|
|
|
+ Map<Integer, SpecificTargetVo> integerListMap = map.get(i.getWpid());
|
|
|
+ if (!integerListMap.containsKey(i.getMonth())){
|
|
|
+ map.get(i.getWpid()).put(i.getMonth(),i);
|
|
|
+ }else {
|
|
|
+
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ Map<Integer,SpecificTargetVo> tempMap = new HashMap<>();
|
|
|
+ tempMap.put(i.getMonth(),i);
|
|
|
+ map.put(i.getWpid(),tempMap);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ Set<String> wpids = map.keySet();
|
|
|
+ if (StringUtils.isNotNull(wpids)){
|
|
|
+ wpids.stream().forEach(wpid->{
|
|
|
+ SpecificTarget vo = new SpecificTarget();
|
|
|
+ vo.setWpid(wpid);
|
|
|
+ int orderNum = 100;
|
|
|
+ if(wpid.contains("_ZGS")){
|
|
|
+ vo.setWpname(CacheContext.cpmap.get(companys).getAname());
|
|
|
+ }else if(wpid.contains("_RGN")){
|
|
|
+ vo.setWpname(CacheContext.rgmap.get(companys).getAname());
|
|
|
+ }else{
|
|
|
+ vo.setWpname(CacheContext.wpmap.get(wpid).getAname());
|
|
|
+ orderNum = CacheContext.wpmap.get(wpid).getOrderNum();
|
|
|
+ }
|
|
|
+ vo.setOrderNum(orderNum);
|
|
|
+ List<SpecificTargetVo> tempList = new ArrayList<>();
|
|
|
+
|
|
|
+ Map<Integer, SpecificTargetVo> listMap = map.get(wpid);
|
|
|
+ for(int x = 1;x<=12;x++){
|
|
|
+ if (listMap.containsKey(x)){
|
|
|
+ tempList.add(listMap.get(x));
|
|
|
+ }else {
|
|
|
+ SpecificTargetVo vo1 = new SpecificTargetVo();
|
|
|
+ vo1.setWpid(wpid);
|
|
|
+ if(wpid.contains("_ZGS")){
|
|
|
+ vo1.setWpname(CacheContext.cpmap.get(companys).getAname());
|
|
|
+ }else if(wpid.contains("_RGN")){
|
|
|
+ vo1.setWpname(CacheContext.rgmap.get(companys).getAname());
|
|
|
+ }else{
|
|
|
+ vo1.setWpname(CacheContext.wpmap.get(wpid).getAname());
|
|
|
+ }
|
|
|
+ vo1.setYear(Integer.parseInt(year));
|
|
|
+ vo1.setMonth(x);
|
|
|
+ tempList.add(vo1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ vo.setTargetList(tempList);
|
|
|
+ resultendList.add(vo);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ SortUtils.sort(resultendList,"orderNum",SortUtils.ASC);
|
|
|
+
|
|
|
+ return resultendList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<SpecificTarget> zhxlList(String companys, String type, String year) {
|
|
|
+ //获取年份所有当月的数据
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay7> currentqw = new QueryWrapper<>();
|
|
|
+ currentqw.select("foreign_key_id,max(record_date) record_date,avg(ynbqzhxl) ynbqzhxl");
|
|
|
+ currentqw.eq("location","wp");
|
|
|
+ currentqw.eq("to_char(record_date,'yyyy')",year);
|
|
|
+ if (type.equals("-1")){
|
|
|
+ currentqw.like("foreign_key_id","_FDC_");
|
|
|
+ }else {
|
|
|
+ currentqw.like("foreign_key_id","_GDC_");
|
|
|
+ }
|
|
|
+ if (companys.endsWith("ZGS")){
|
|
|
+ currentqw.eq("company_id",companys);
|
|
|
+ }else {
|
|
|
+ currentqw.eq("region_id",companys);
|
|
|
+ }
|
|
|
+ currentqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ List<ProEconPowerstationInfoDay7> currentList = proEconPowerstationInfoDay7Service.list(currentqw);
|
|
|
+ currentqw.clear();
|
|
|
+ currentqw.select("foreign_key_id,max(record_date) record_date,avg(ynbqzhxl) ynbqzhxl");
|
|
|
+ currentqw.eq("foreign_key_id",companys+type);
|
|
|
+ currentqw.eq("to_char(record_date,'yyyy')",year);
|
|
|
+ currentqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ currentList.addAll(proEconPowerstationInfoDay7Service.list(currentqw));
|
|
|
+
|
|
|
+ int subYear = Integer.parseInt(year) - 1;
|
|
|
+ QueryWrapper<ProEconPowerstationInfoDay7> sameperiodqw = new QueryWrapper<>();
|
|
|
+ sameperiodqw.select("foreign_key_id,max(record_date) record_date,avg(ynbqzhxl) ynbqzhxl");
|
|
|
+ sameperiodqw.eq("location","wp");
|
|
|
+ if (type.equals("-1")){
|
|
|
+ currentqw.like("foreign_key_id","_FDC_");
|
|
|
+ }else {
|
|
|
+ currentqw.like("foreign_key_id","_GDC_");
|
|
|
+ }
|
|
|
+ if (companys.endsWith("ZGS")){
|
|
|
+ currentqw.eq("company_id",companys);
|
|
|
+ }else {
|
|
|
+ currentqw.eq("region_id",companys);
|
|
|
+ }
|
|
|
+ sameperiodqw.eq("to_char(record_date,'yyyy')",String.valueOf(subYear));
|
|
|
+ sameperiodqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ List<ProEconPowerstationInfoDay7> sameperiodList = proEconPowerstationInfoDay7Service.list(sameperiodqw);
|
|
|
+ sameperiodqw.clear();
|
|
|
+ sameperiodqw.select("foreign_key_id,max(record_date) record_date,avg(ynbqzhxl) ynbqzhxl");
|
|
|
+ sameperiodqw.eq("foreign_key_id",companys+type);
|
|
|
+ sameperiodqw.eq("to_char(record_date,'yyyy')",String.valueOf(subYear));
|
|
|
+ sameperiodqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
|
|
|
+ sameperiodList.addAll(proEconPowerstationInfoDay7Service.list(sameperiodqw));
|
|
|
+
|
|
|
+ //合并当月与同期数据为返回结果
|
|
|
+ List<SpecificTargetVo> resultList = new ArrayList<>();
|
|
|
+
|
|
|
+ currentList.stream().forEach(i->{
|
|
|
+ SpecificTargetVo vo = new SpecificTargetVo();
|
|
|
+ String wpid = i.getForeignKeyId();
|
|
|
+ vo.setWpid(wpid);
|
|
|
+ if(wpid.contains("_ZGS")){
|
|
|
+ vo.setWpname(CacheContext.cpmap.get(companys).getAname());
|
|
|
+ }else if(wpid.contains("_RGN")){
|
|
|
+ vo.setWpname(CacheContext.rgmap.get(companys).getAname());
|
|
|
+ }else{
|
|
|
+ vo.setWpname(CacheContext.wpmap.get(wpid).getAname());
|
|
|
+ }
|
|
|
+ vo.setYear(DateUtils.getYear(i.getRecordDate()));
|
|
|
+ vo.setMonth(DateUtils.getMonth(i.getRecordDate()));
|
|
|
+ vo.setCurrent(DoubleUtils.keepPrecision(i.getYxtxlpr().doubleValue(),2));
|
|
|
+ resultList.add(vo);
|
|
|
+ });
|
|
|
+ resultList.stream().forEach(i->{
|
|
|
+ Optional<ProEconPowerstationInfoDay7> optional = sameperiodList.stream()
|
|
|
+ .filter(j -> j.getForeignKeyId().equals(i.getWpid()) && String.valueOf(DateUtils.getMonth(j.getRecordDate())).equals(i.getMonth()))
|
|
|
+ .findFirst();
|
|
|
+ if (optional.isPresent()){
|
|
|
+ ProEconPowerstationInfoDay7 tqinfoday = optional.get();
|
|
|
+ i.setSameperiod(DoubleUtils.keepPrecision(tqinfoday.getYxtxlpr().doubleValue(),2));
|
|
|
+ i.setCompare(i.getCurrent().compareTo(i.getSameperiod()));
|
|
|
+ }else {
|
|
|
+ i.setSameperiod(0.0);
|
|
|
+ i.setCompare(0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ List<SpecificTarget> resultendList = new ArrayList<>();
|
|
|
+
|
|
|
+ Map<String,Map<Integer,SpecificTargetVo>> map = new HashMap<>();
|
|
|
+
|
|
|
+ resultList.stream().forEach(i->{
|
|
|
+ if (map.containsKey(i.getWpid())){
|
|
|
+ Map<Integer, SpecificTargetVo> integerListMap = map.get(i.getWpid());
|
|
|
+ if (!integerListMap.containsKey(i.getMonth())){
|
|
|
+ map.get(i.getWpid()).put(i.getMonth(),i);
|
|
|
+ }else {
|
|
|
+
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ Map<Integer,SpecificTargetVo> tempMap = new HashMap<>();
|
|
|
+ tempMap.put(i.getMonth(),i);
|
|
|
+ map.put(i.getWpid(),tempMap);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ Set<String> wpids = map.keySet();
|
|
|
+ if (StringUtils.isNotNull(wpids)){
|
|
|
+ wpids.stream().forEach(wpid->{
|
|
|
+ SpecificTarget vo = new SpecificTarget();
|
|
|
+ vo.setWpid(wpid);
|
|
|
+ int orderNum = 100;
|
|
|
+ if(wpid.contains("_ZGS")){
|
|
|
+ vo.setWpname(CacheContext.cpmap.get(companys).getAname());
|
|
|
+ }else if(wpid.contains("_RGN")){
|
|
|
+ vo.setWpname(CacheContext.rgmap.get(companys).getAname());
|
|
|
+ }else{
|
|
|
+ vo.setWpname(CacheContext.wpmap.get(wpid).getAname());
|
|
|
+ orderNum = CacheContext.wpmap.get(wpid).getOrderNum();
|
|
|
+ }
|
|
|
+ vo.setOrderNum(orderNum);
|
|
|
+ List<SpecificTargetVo> tempList = new ArrayList<>();
|
|
|
+
|
|
|
+ Map<Integer, SpecificTargetVo> listMap = map.get(wpid);
|
|
|
+ for(int x = 1;x<=12;x++){
|
|
|
+ if (listMap.containsKey(x)){
|
|
|
+ tempList.add(listMap.get(x));
|
|
|
+ }else {
|
|
|
+ SpecificTargetVo vo1 = new SpecificTargetVo();
|
|
|
+ vo1.setWpid(wpid);
|
|
|
+ if(wpid.contains("_ZGS")){
|
|
|
+ vo1.setWpname(CacheContext.cpmap.get(companys).getAname());
|
|
|
+ }else if(wpid.contains("_RGN")){
|
|
|
+ vo1.setWpname(CacheContext.rgmap.get(companys).getAname());
|
|
|
+ }else{
|
|
|
+ vo1.setWpname(CacheContext.wpmap.get(wpid).getAname());
|
|
|
+ }
|
|
|
+ vo1.setYear(Integer.parseInt(year));
|
|
|
+ vo1.setMonth(x);
|
|
|
+ tempList.add(vo1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ vo.setTargetList(tempList);
|
|
|
+ resultendList.add(vo);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ SortUtils.sort(resultendList,"orderNum",SortUtils.ASC);
|
|
|
+
|
|
|
+ return resultendList;
|
|
|
+ }
|
|
|
}
|