Browse Source

添加晋能数据权限过滤

shilin 1 year ago
parent
commit
5a90d4af7f

+ 16 - 4
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/bmk/BenchmarkingController.java

@@ -11,10 +11,7 @@ import com.gyee.common.vo.benchmark.FjjxbmxVo;
 import com.gyee.common.vo.benchmark.WxsslVo;
 import com.gyee.runeconomy.dto.R;
 import com.gyee.runeconomy.dto.ResultMsg;
-import com.gyee.runeconomy.model.auto.ProBasicCompany;
-import com.gyee.runeconomy.model.auto.ProBasicLine;
-import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
-import com.gyee.runeconomy.model.auto.ProBasicProject;
+import com.gyee.runeconomy.model.auto.*;
 import com.gyee.runeconomy.service.bmk.BenchmarkingService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -67,6 +64,21 @@ public class BenchmarkingController {
             return R.error(ResultMsg.error());
         }
     }
+
+
+    @GetMapping(value = "/subByCplist")
+    @ApiOperation(value = "升压站列表", notes = "升压站列表")
+    public R subByCplist(@RequestParam(value = "companyids", required = true) String companyids,
+                        @RequestParam(value = "type", required = false) String type) {
+
+        List<ProBasicSubStation> resultList = benchmarkingService.subByCplist(companyids,type);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
     @GetMapping(value = "/pjByWplist")
     @ApiOperation(value = "项目列表", notes = "项目列表")
     public R pjByWplist(@RequestParam(value = "wpids", required = true) String wpids)  {

+ 16 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java

@@ -63,6 +63,22 @@ public class BenchmarkingService {
 
         return result;
     }
+
+    public List<ProBasicSubStation> subByCplist(String companyids,String  type) {
+
+        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
+        List<ProBasicSubStation> list = tokenService.getSubwpls(request);
+
+
+        if (StringUtils.isNotEmpty(type) && !type.equals("0")){
+            String finalType  =  type.equals("-1") ? "_FDC" : "_GDC";
+            list = list.stream().filter(wp-> wp.getWindpowerstationId().indexOf(finalType) >= 0).collect(Collectors.toList());
+        }
+
+        SortUtils.sort(list,"orderNum",SortUtils.ASC);
+        return list;
+
+    }
     public List<ProBasicPowerstation> wpByCplist(String companyids,String  type) {
 
         HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();