|
@@ -1,16 +1,20 @@
|
|
|
package com.gyee.runeconomy.controller.performacompare;
|
|
|
|
|
|
|
|
|
+import com.gyee.backconfig.model.auto.ProBasicOrganizeTree;
|
|
|
import com.gyee.runeconomy.dto.R;
|
|
|
import com.gyee.runeconomy.dto.ResultMsg;
|
|
|
import com.gyee.runeconomy.model.auto.ProEconWtPowerCurveFitting;
|
|
|
+import com.gyee.runeconomy.service.bmk.BenchmarkingService;
|
|
|
import com.gyee.runeconomy.service.performacompare.EquipmentPerformaCompareService;
|
|
|
+import com.gyee.runeconomy.util.StringUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
* <p>
|
|
@@ -28,13 +32,14 @@ public class EquipmentPerformaCompareController {
|
|
|
|
|
|
@Autowired
|
|
|
private EquipmentPerformaCompareService equipmentPerformaCompareService;
|
|
|
+ @Autowired
|
|
|
+ private BenchmarkingService benchmarkingService;
|
|
|
|
|
|
|
|
|
|
|
|
* 单机横向对比列表
|
|
|
+ *
|
|
|
* @param type 风场 -1 ;光伏 -2
|
|
|
- * @param dateType 日 1;月 2; 年 3
|
|
|
- * @param windturbineIds 设别ids
|
|
|
* @param date 日期
|
|
|
* @return
|
|
|
*/
|
|
@@ -43,23 +48,42 @@ public class EquipmentPerformaCompareController {
|
|
|
@CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
public R daydjhxdbtop(
|
|
|
@RequestParam(value = "type", required = true) String type,
|
|
|
- @RequestParam(value = "dateType", required = true) String dateType,
|
|
|
- @RequestParam(value = "windturbineIds", required = true) String windturbineIds,
|
|
|
- @RequestParam(value = "date", required = true) String date) {
|
|
|
+ @RequestParam(value = "companyid", required = true) String companyid,
|
|
|
+ @RequestParam(value = "wpids", required = true) String wpids,
|
|
|
+ @RequestParam(value = "projectids", required = true) String projectids,
|
|
|
+ @RequestParam(value = "lineids", required = true) String lineids,
|
|
|
+ @RequestParam(value = "wtids", required = true) String wtids,
|
|
|
+ @RequestParam(value = "date", required = true) String date,
|
|
|
+ @RequestParam(value = "target", required = false) String target,
|
|
|
+ @RequestParam(value = "sort", required = false) String sort) {
|
|
|
|
|
|
List<Object> objects = null;
|
|
|
try {
|
|
|
- objects = equipmentPerformaCompareService.getEquipmentPerformaCompareList(dateType, windturbineIds, date,type);
|
|
|
+ if (StringUtils.isNotEmpty(wtids)) {
|
|
|
+ wtids = wtids;
|
|
|
+ } else if (StringUtils.isNotEmpty(lineids)) {
|
|
|
+ wtids = benchmarkingService.wtByLnlist(lineids).stream().map(ProBasicOrganizeTree::getId).collect(Collectors.joining(","));
|
|
|
+ } else if (StringUtils.isNotEmpty(projectids)) {
|
|
|
+ wtids = benchmarkingService.lnByPjlist(projectids).stream().map(ProBasicOrganizeTree::getId).collect(Collectors.joining(","));
|
|
|
+ } else if (StringUtils.isNotEmpty(wpids)) {
|
|
|
+ wtids = benchmarkingService.pjByWplist(wpids).stream().map(ProBasicOrganizeTree::getId).collect(Collectors.joining(","));
|
|
|
+ } else if (StringUtils.isNotEmpty(companyid)) {
|
|
|
+ wtids = benchmarkingService.wpByCplist(companyid, type).stream().map(ProBasicOrganizeTree::getId).collect(Collectors.joining(","));
|
|
|
+ } else {
|
|
|
+ return R.data(ResultMsg.ok(objects));
|
|
|
+ }
|
|
|
+
|
|
|
+ objects = equipmentPerformaCompareService.getEquipmentPerformaCompareList(wtids, date, type);
|
|
|
return R.data(ResultMsg.ok(objects));
|
|
|
} catch (Exception e) {
|
|
|
return R.data(ResultMsg.error());
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
* 实际拟合曲线
|
|
|
+ *
|
|
|
* @param windturbineIds
|
|
|
* @return
|
|
|
*/
|
|
@@ -67,7 +91,7 @@ public class EquipmentPerformaCompareController {
|
|
|
@ResponseBody
|
|
|
@CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
public R getWtPowerCurveFittingList(
|
|
|
- @RequestParam(value = "windturbineIds", required = true) String windturbineIds ){
|
|
|
+ @RequestParam(value = "windturbineIds", required = true) String windturbineIds) {
|
|
|
|
|
|
Map<String, List<ProEconWtPowerCurveFitting>> map = null;
|
|
|
try {
|