|
@@ -75,9 +75,9 @@ public class BenchmarkingService {
|
|
|
// list = list.stream().filter(wp -> wp.getId().indexOf(finalType) >= 0).collect(Collectors.toList());
|
|
|
//}
|
|
|
|
|
|
- if("-1".equals(type)){
|
|
|
+ if ("-1".equals(type)) {
|
|
|
type = "F";
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
type = "G";
|
|
|
}
|
|
|
|
|
@@ -86,7 +86,7 @@ public class BenchmarkingService {
|
|
|
|
|
|
if (companyids.endsWith("RGN")) {
|
|
|
//list = list.stream().filter(wp -> companyids.contains(wp.getParentCode())).collect(Collectors.toList());
|
|
|
- list = CacheContext.proBasicOrganizeTrees.stream().filter(pbot->"STA".equals(pbot.getOrgType())&&finalType.equals(pbot.getEleType())).collect(Collectors.toList());
|
|
|
+ list = CacheContext.proBasicOrganizeTrees.stream().filter(pbot -> "STA".equals(pbot.getOrgType()) && finalType.equals(pbot.getEleType())).collect(Collectors.toList());
|
|
|
}
|
|
|
if (companyids.endsWith("FGS")) {
|
|
|
list = list.stream().filter(wp -> companyids.contains(wp.getParentCode())).collect(Collectors.toList());
|
|
@@ -128,7 +128,6 @@ public class BenchmarkingService {
|
|
|
qw.ge("record_date", DateUtils.parseDate(beginDate)).le("record_date", DateUtils.parseDate(endDate));
|
|
|
|
|
|
|
|
|
-
|
|
|
if (getype.equals("-1")) {
|
|
|
qw.like("windturbine_id", "_F_WT_");
|
|
|
} else if (getype.equals("-2")) {
|
|
@@ -150,7 +149,7 @@ public class BenchmarkingService {
|
|
|
|
|
|
if (companyid.contains("RGN")) {
|
|
|
for (String s : split) {
|
|
|
- if(s.endsWith("RGN")){
|
|
|
+ if (s.endsWith("RGN")) {
|
|
|
companyid = s;
|
|
|
}
|
|
|
}
|
|
@@ -560,11 +559,20 @@ public class BenchmarkingService {
|
|
|
qw.ge("record_date", DateUtils.parseDate(beginDate)).le("record_date", DateUtils.parseDate(endDate));
|
|
|
if (StringUtils.isNotEmpty(wpid)) {
|
|
|
qw.eq("windpowerstation_id", wpid);
|
|
|
- }
|
|
|
- if (companys.endsWith("RGN")) {
|
|
|
- qw.eq("region_id", companys);
|
|
|
- } else {
|
|
|
- qw.eq("company_id", companys);
|
|
|
+ } else if (StringUtils.isNotEmpty(companys)) {
|
|
|
+
|
|
|
+ String[] split = companys.split(",");
|
|
|
+
|
|
|
+ if (companys.contains("RGN")) {
|
|
|
+ for (String s : split) {
|
|
|
+ if (s.endsWith("RGN")) {
|
|
|
+ companys = s;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ qw.eq("region_id", companys);
|
|
|
+ } else {
|
|
|
+ qw.in("company_id", Arrays.asList(split));
|
|
|
+ }
|
|
|
}
|
|
|
if (type.equals("-1")) {
|
|
|
qw.like("windturbine_id", "_WT_");
|
|
@@ -618,11 +626,20 @@ public class BenchmarkingService {
|
|
|
if (StringUtils.isNotEmpty(wpids)) {
|
|
|
List<String> wpList = Arrays.asList(wpids.split(","));
|
|
|
qw.in("windpowerstation_id", wpList);
|
|
|
- }
|
|
|
- if (companys.endsWith("RGN")) {
|
|
|
- qw.eq("region_id", companys);
|
|
|
- } else {
|
|
|
- qw.eq("company_id", companys);
|
|
|
+ } else if (StringUtils.isNotEmpty(companys)) {
|
|
|
+
|
|
|
+ String[] split = companys.split(",");
|
|
|
+
|
|
|
+ if (companys.contains("RGN")) {
|
|
|
+ for (String s : split) {
|
|
|
+ if (s.endsWith("RGN")) {
|
|
|
+ companys = s;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ qw.eq("region_id", companys);
|
|
|
+ } else {
|
|
|
+ qw.in("company_id", Arrays.asList(split));
|
|
|
+ }
|
|
|
}
|
|
|
if (type.equals("-1")) {
|
|
|
qw.like("windturbine_id", "_WT_");
|
|
@@ -656,11 +673,20 @@ public class BenchmarkingService {
|
|
|
if (StringUtils.isNotEmpty(projectids)) {
|
|
|
List<String> projectList = Arrays.asList(projectids.split(","));
|
|
|
qw.in("project_id", projectList);
|
|
|
- }
|
|
|
- if (companys.endsWith("RGN")) {
|
|
|
- qw.eq("region_id", companys);
|
|
|
- } else {
|
|
|
- qw.eq("company_id", companys);
|
|
|
+ } else if (StringUtils.isNotEmpty(companys)) {
|
|
|
+
|
|
|
+ String[] split = companys.split(",");
|
|
|
+
|
|
|
+ if (companys.contains("RGN")) {
|
|
|
+ for (String s : split) {
|
|
|
+ if (s.endsWith("RGN")) {
|
|
|
+ companys = s;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ qw.eq("region_id", companys);
|
|
|
+ } else {
|
|
|
+ qw.in("company_id", Arrays.asList(split));
|
|
|
+ }
|
|
|
}
|
|
|
if (type.equals("-1")) {
|
|
|
qw.like("windturbine_id", "_WT_");
|
|
@@ -700,11 +726,20 @@ public class BenchmarkingService {
|
|
|
List<String> lineList = Arrays.asList(lineids.split(","));
|
|
|
qw.in("line_id", lineList);
|
|
|
|
|
|
- }
|
|
|
- if (companys.endsWith("RGN")) {
|
|
|
- qw.eq("region_id", companys);
|
|
|
- } else {
|
|
|
- qw.eq("company_id", companys);
|
|
|
+ } else if (StringUtils.isNotEmpty(companys)) {
|
|
|
+
|
|
|
+ String[] split = companys.split(",");
|
|
|
+
|
|
|
+ if (companys.contains("RGN")) {
|
|
|
+ for (String s : split) {
|
|
|
+ if (s.endsWith("RGN")) {
|
|
|
+ companys = s;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ qw.eq("region_id", companys);
|
|
|
+ } else {
|
|
|
+ qw.in("company_id", Arrays.asList(split));
|
|
|
+ }
|
|
|
}
|
|
|
if (type.equals("-1")) {
|
|
|
qw.like("windturbine_id", "_WT_");
|
|
@@ -940,7 +975,7 @@ public class BenchmarkingService {
|
|
|
public List<WxsslVo> gsdb(String companys, String type, String beginDate, String endDate, String target, String sort) {
|
|
|
QueryWrapper<ProEconEquipmentInfoDay1> qw = new QueryWrapper<>();
|
|
|
List<WxsslVo> resultList = new ArrayList<>();
|
|
|
- String sql=",sum(rfdl) rfdl,sum(rllfdl) rllfdl,avg(rpjfs) rpjfs,sum(rjxssdl) rjxssdl,sum(rcnsljxssdl) rcnsljxssdl,sum(rgzssdl) rgzssdl,sum(rcnslgzssdl) rcnslgzssdl,sum(rxdtjssdl) rxdtjssdl,sum(rxdjclssdl) rxdjclssdl,sum(rdjssdl) rdjssdl,sum(rqxjclssdl) rqxjclssdl,sum(rsdtjssdl) rsdtjssdl,sum(rxnssdl) rxnssdl,sum(rcwsldwssdl) rcwsldwssdl,sum(rcwsltqssdl) rcwsltqssdl";
|
|
|
+ String sql = ",sum(rfdl) rfdl,sum(rllfdl) rllfdl,avg(rpjfs) rpjfs,sum(rjxssdl) rjxssdl,sum(rcnsljxssdl) rcnsljxssdl,sum(rgzssdl) rgzssdl,sum(rcnslgzssdl) rcnslgzssdl,sum(rxdtjssdl) rxdtjssdl,sum(rxdjclssdl) rxdjclssdl,sum(rdjssdl) rdjssdl,sum(rqxjclssdl) rqxjclssdl,sum(rsdtjssdl) rsdtjssdl,sum(rxnssdl) rxnssdl,sum(rcwsldwssdl) rcwsldwssdl,sum(rcwsltqssdl) rcwsltqssdl";
|
|
|
qw.ge("record_date", DateUtils.parseDate(beginDate)).le("record_date", DateUtils.parseDate(endDate));
|
|
|
|
|
|
if (companys.endsWith("RGN")) {
|
|
@@ -990,12 +1025,20 @@ public class BenchmarkingService {
|
|
|
} else if (StringUtils.isNotEmpty(wpids)) {
|
|
|
List<String> wpList = Arrays.asList(wpids.split(","));
|
|
|
qw.in("windpowerstation_id", wpList).isNotNull("square_id").ne("square_id", "");
|
|
|
- }
|
|
|
+ } else if (StringUtils.isNotEmpty(companys)) {
|
|
|
|
|
|
- if (companys.endsWith("RGN")) {
|
|
|
- qw.eq("region_id", companys);
|
|
|
- } else {
|
|
|
- qw.eq("company_id", companys);
|
|
|
+ String[] split = companys.split(",");
|
|
|
+
|
|
|
+ if (companys.contains("RGN")) {
|
|
|
+ for (String s : split) {
|
|
|
+ if (s.endsWith("RGN")) {
|
|
|
+ companys = s;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ qw.eq("region_id", companys);
|
|
|
+ } else {
|
|
|
+ qw.in("company_id", Arrays.asList(split));
|
|
|
+ }
|
|
|
}
|
|
|
if (type.equals("-1")) {
|
|
|
qw.like("windturbine_id", "_WT_");
|
|
@@ -1017,14 +1060,14 @@ public class BenchmarkingService {
|
|
|
}
|
|
|
|
|
|
public List<ProBasicOrganizeTree> allList(String ids, String type) {
|
|
|
- if("-1".equals(type)){
|
|
|
+ if ("-1".equals(type)) {
|
|
|
type = "F";
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
type = "G";
|
|
|
}
|
|
|
|
|
|
String finalType1 = type;
|
|
|
- List<ProBasicOrganizeTree> list = CacheContext.proBasicOrganizeTrees.stream().filter(l -> ids.contains(l.getParentCode())&& finalType1.equals(l.getEleType())).collect(Collectors.toList());
|
|
|
+ List<ProBasicOrganizeTree> list = CacheContext.proBasicOrganizeTrees.stream().filter(l -> ids.contains(l.getParentCode()) && finalType1.equals(l.getEleType())).collect(Collectors.toList());
|
|
|
|
|
|
SortUtils.sort(list, "orderNum", SortUtils.ASC);
|
|
|
return list;
|
|
@@ -1033,4 +1076,63 @@ public class BenchmarkingService {
|
|
|
public List<ProBasicOrganizeTree> treeList(String type) {
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设备对标
|
|
|
+ */
|
|
|
+ public List<WxsslVo> sbdb(String companys, String type, String wpids, String projectids, String lineids, String squareids, String windturbineids, String beginDate, String endDate, String target, String sort) {
|
|
|
+ List<WxsslVo> resultList = new ArrayList<>();
|
|
|
+ QueryWrapper<ProEconEquipmentInfoDay1> qw = new QueryWrapper<>();
|
|
|
+ qw.select("windturbine_id,sum(rfdl) rfdl,sum(rllfdl) rllfdl,avg(rpjfs) rpjfs,sum(rjxssdl) rjxssdl,sum(rcnsljxssdl) rcnsljxssdl,sum(rgzssdl) rgzssdl,sum(rcnslgzssdl) rcnslgzssdl,sum(rxdtjssdl) rxdtjssdl,sum(rxdjclssdl) rxdjclssdl,sum(rdjssdl) rdjssdl,sum(rqxjclssdl) rqxjclssdl,sum(rsdtjssdl) rsdtjssdl,sum(rxnssdl) rxnssdl,sum(rcwsldwssdl) rcwsldwssdl,sum(rcwsltqssdl) rcwsltqssdl");
|
|
|
+
|
|
|
+ qw.ge("record_date", DateUtils.parseDate(beginDate)).le("record_date", DateUtils.parseDate(endDate));
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(windturbineids)) {
|
|
|
+ List<String> equipmentidsList = Arrays.asList(windturbineids.split(","));
|
|
|
+ qw.in("windturbine_id", equipmentidsList);
|
|
|
+ } else if (StringUtils.isNotEmpty(squareids)) {
|
|
|
+ List<String> squareidList = Arrays.asList(squareids.split(","));
|
|
|
+ qw.in("square_id", squareidList);
|
|
|
+ } else if (StringUtils.isNotEmpty(lineids)) {
|
|
|
+ List<String> lineList = Arrays.asList(lineids.split(","));
|
|
|
+ qw.in("line_id", lineList).isNotNull("square_id").ne("square_id", "");
|
|
|
+ } else if (StringUtils.isNotEmpty(projectids)) {
|
|
|
+ List<String> projectList = Arrays.asList(projectids.split(","));
|
|
|
+ qw.in("project_id", projectList).isNotNull("square_id").ne("square_id", "");
|
|
|
+ } else if (StringUtils.isNotEmpty(wpids)) {
|
|
|
+ List<String> wpList = Arrays.asList(wpids.split(","));
|
|
|
+ qw.in("windpowerstation_id", wpList).isNotNull("square_id").ne("square_id", "");
|
|
|
+ } else if (StringUtils.isNotEmpty(companys)) {
|
|
|
+ String[] split = companys.split(",");
|
|
|
+ if (companys.contains("RGN")) {
|
|
|
+ for (String s : split) {
|
|
|
+ if (s.endsWith("RGN")) {
|
|
|
+ companys = s;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ qw.eq("region_id", companys);
|
|
|
+ } else {
|
|
|
+ qw.in("company_id", Arrays.asList(split));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (type.equals("-1")) {
|
|
|
+ qw.like("windturbine_id", "_WT_");
|
|
|
+ } else {
|
|
|
+ qw.like("windturbine_id", "_IN_");
|
|
|
+ }
|
|
|
+ qw.groupBy("windturbine_id");
|
|
|
+ List<WxsslVo> wxsslVoList = getWxsslSortVos(qw, resultList, TYPE_WINDTURBINE);
|
|
|
+ if (StringUtils.isNotEmpty(target) && StringUtils.isNotEmpty(sort)) {
|
|
|
+ if (sort.equals("1")) {
|
|
|
+ SortUtils.sort(resultList, target, SortUtils.ASC);
|
|
|
+ } else {
|
|
|
+ SortUtils.sort(resultList, target, SortUtils.DESC);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ SortUtils.sort(resultList, "ordernum", SortUtils.ASC);
|
|
|
+ }
|
|
|
+ return wxsslVoList;
|
|
|
+ }
|
|
|
+
|
|
|
}
|