|
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -45,43 +46,32 @@ public class PerformanceCurvefittingController {
|
|
|
public R curvefittinglist(@RequestParam(value = "companys",required = true) String companys,
|
|
|
@RequestParam(value = "type",required = true) String type,
|
|
|
@RequestParam(value = "wpids",required = false) String wpids,
|
|
|
- @RequestParam(value = "projectids",required = false) String projectids,
|
|
|
- @RequestParam(value = "lineids",required = false) String lineids,
|
|
|
- @RequestParam(value = "squareids",required = false) String squareids,
|
|
|
@RequestParam(value = "windturbineids",required = false) String windturbineids,
|
|
|
@RequestParam(value = "dateType", required = false) String dateType
|
|
|
) {
|
|
|
Map<String, List<CurveVo>> curvefitting = null;
|
|
|
+ if(StringUtils.isEmpty(type)) type = "-2";
|
|
|
+ if(StringUtils.isEmpty(dateType)) dateType = "1";
|
|
|
try {
|
|
|
- /*if (StringUtils.isNotEmpty(windturbineids)) {
|
|
|
+ if (StringUtils.isNotEmpty(windturbineids)) {
|
|
|
|
|
|
- } else if (StringUtils.isNotEmpty(squareids)) {
|
|
|
- CacheContext.proBasicOrganizeTrees.stream().filter(sql->squareids.contains(sql.getParentCode()))
|
|
|
- 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", "");
|
|
|
+ windturbineids = CacheContext.organizeEquipmentList.stream().filter(oe -> wpids.contains(oe.getWindpowerstationId()))
|
|
|
+ .map(oe -> oe.getWindturbineId()).collect(Collectors.joining(","));
|
|
|
} else if (StringUtils.isNotEmpty(companys)) {
|
|
|
String[] split = companys.split(",");
|
|
|
if (companys.contains("RGN")) {
|
|
|
for (String s : split) {
|
|
|
- if (s.endsWith("RGN")) {
|
|
|
- companys = s;
|
|
|
+ if(s.endsWith("RGN")){
|
|
|
+ windturbineids = CacheContext.organizeEquipmentList.stream().filter(oe -> s.equals(oe.getRegionId()))
|
|
|
+ .map(oe -> oe.getWindturbineId()).collect(Collectors.joining(","));
|
|
|
}
|
|
|
}
|
|
|
- qw.eq("region_id", companys);
|
|
|
} else {
|
|
|
- qw.in("company_id", Arrays.asList(split));
|
|
|
+ windturbineids = CacheContext.organizeEquipmentList.stream().filter(oe -> companys.contains(oe.getCompanyId()))
|
|
|
+ .map(oe -> oe.getWindturbineId()).collect(Collectors.joining(","));
|
|
|
}
|
|
|
- }*/
|
|
|
-
|
|
|
+ }
|
|
|
|
|
|
curvefitting = performanceCurvefittingService.curveFittingList(windturbineids, type, dateType);
|
|
|
return R.data(ResultMsg.ok(curvefitting));
|