Forráskód Böngészése

开发监视接口

xieshengjie 2 éve
szülő
commit
d7a9e6eff9
22 módosított fájl, 2121 hozzáadás és 15 törlés
  1. 1 1
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/config/GeneratorCodeConfig.java
  2. 167 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/CommonController.java
  3. 20 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/ProBasicWeatherStationController.java
  4. 47 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/AgcController.java
  5. 103 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/ComprehensiveController.java
  6. 85 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/DeviceDetailsController.java
  7. 88 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/MatrixController.java
  8. 66 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/StationMonitorController.java
  9. 48 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/StatusController.java
  10. 26 11
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/init/CacheContext.java
  11. 16 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/mapper/auto/ProBasicWeatherStationMapper.java
  12. 80 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/model/auto/ProBasicWeatherStation.java
  13. 16 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/IProBasicWeatherStationService.java
  14. 20 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProBasicWeatherStationServiceImpl.java
  15. 2 1
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconEquipmentInfoDay5ServiceImpl.java
  16. 82 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/AgcService.java
  17. 128 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/ComprehensiveService.java
  18. 104 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/DeviceDetailsService.java
  19. 633 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MatrixService.java
  20. 194 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/StationMonitorService.java
  21. 193 0
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/StatusService.java
  22. 2 2
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/specific/SpecificService.java

+ 1 - 1
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/config/GeneratorCodeConfig.java

@@ -39,7 +39,7 @@ public class GeneratorCodeConfig {
         // 全局配置
         GlobalConfig gc = new GlobalConfig();
         String projectPath = System.getProperty("user.dir");
-        gc.setOutputDir("D:\\workspace\\sis\\web\\runeconomy-xk\\src\\main\\java");
+        gc.setOutputDir("D:\\work\\workspaces\\sis\\web\\runeconomy-xk\\src\\main\\java");
         gc.setAuthor("wang");
         gc.setOpen(false);
         //实体属性 Swagger2 注解

+ 167 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/CommonController.java

@@ -0,0 +1,167 @@
+package com.gyee.runeconomy.controller;/*
+@author   谢生杰
+@date   2023/3/28-15:47
+*/
+
+import com.gyee.common.model.PointData;
+import com.gyee.common.model.StringUtils;
+import com.gyee.runeconomy.dto.R;
+import com.gyee.runeconomy.dto.ResultMsg;
+import com.gyee.runeconomy.init.CacheContext;
+import com.gyee.runeconomy.model.auto.ProBasicCompany;
+import com.gyee.runeconomy.model.auto.ProBasicEquipmentPoint;
+import com.gyee.runeconomy.model.auto.ProBasicPowerstationPoint;
+import com.gyee.runeconomy.util.DateUtils;
+import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.*;
+
+@Controller
+public class CommonController {
+    @Resource
+    private IEdosUtil edosUtil;
+
+
+    /**
+     * 查询公司
+     *
+     * @return
+     */
+    @GetMapping("/findCompanys")
+    @ResponseBody
+    @ApiOperation(value = "查询公司", notes = "查询公司")
+    public R findCompanys() throws Exception {
+
+        List<ProBasicCompany> cpls = CacheContext.cpls;
+
+        if (StringUtils.isNotNull(cpls)) {
+            return R.data(ResultMsg.ok(cpls));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+    /**
+     * 查询设备测点
+     *
+     * @return
+     */
+    @GetMapping("/findWtPoints")
+    @ResponseBody
+    @ApiOperation(value = "查询设备测点", notes = "查询设备测点")
+    public R findWtPoints(@RequestParam(value = "uniformcodes", required = true) String unifromcodes,
+                          @RequestParam(value = "wtid", required = true) String wtid) {
+
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+        Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wtid);
+
+        List<ProBasicEquipmentPoint> resultList = new ArrayList<>();
+
+        String[] split = unifromcodes.split(",");
+        Arrays.stream(split).forEach(s -> {
+            resultList.add(equipmentPointMap.get(s));
+        });
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
+    /**
+     * 查询场站测点
+     *
+     * @return
+     */
+    @GetMapping("/findWpPoints")
+    @ResponseBody
+    @ApiOperation(value = "查询场站测点", notes = "查询场站测点")
+    public R findWpPoints(@RequestParam(value = "uniformcodes", required = true) String unifromcodes,
+                          @RequestParam(value = "wpid", required = true) String wpid) {
+
+        Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
+        Map<String, ProBasicPowerstationPoint> powerstationPointMap = wppointmap.get(wpid);
+
+        List<ProBasicPowerstationPoint> resultList = new ArrayList<>();
+
+        String[] split = unifromcodes.split(",");
+        Arrays.stream(split).forEach(s -> {
+            resultList.add(powerstationPointMap.get(s));
+        });
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+    /**
+     * 查询调度场站测点
+     *
+     * @return
+     */
+    @GetMapping("/findSubPoints")
+    @ResponseBody
+    @ApiOperation(value = "查询调度场站测点", notes = "查询调度场站测点")
+    public R findSubPoints(@RequestParam(value = "uniformcodes", required = true) String unifromcodes,
+                          @RequestParam(value = "wpid", required = true) String wpid) {
+
+        Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = CacheContext.subwppointmap;
+        Map<String, ProBasicPowerstationPoint> powerstationPointMap = subwppointmap.get(wpid);
+
+        List<ProBasicPowerstationPoint> resultList = new ArrayList<>();
+
+        String[] split = unifromcodes.split(",");
+        Arrays.stream(split).forEach(s -> {
+            resultList.add(powerstationPointMap.get(s));
+        });
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
+    /**
+     * 查询测点曲线
+     *
+     * @return
+     */
+    @GetMapping("/findPointFitting")
+    @ResponseBody
+    @ApiOperation(value = "查询测点曲线", notes = "查询测点曲线")
+    public R findPointFitting(@RequestParam(value = "pointIds", required = true) String pointIds,
+                              @RequestParam(value = "begin", required = true) String begin,
+                              @RequestParam(value = "end", required = true) String end,
+                              @RequestParam(value = "interval", required = true) String interval) {
+        Date beginDate = DateUtils.parseDate1(begin);
+        Date endDate = DateUtils.parseDate1(end);
+        List<List<PointData>> resultList = new ArrayList<>();
+
+        String[] points = pointIds.split(",");
+        Arrays.stream(points).forEach(p -> {
+            try {
+                List<PointData> datasSnap = edosUtil.getHistoryDatasSnap(p, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, Long.parseLong(interval));
+                resultList.add(datasSnap);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        });
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+}

+ 20 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/ProBasicWeatherStationController.java

@@ -0,0 +1,20 @@
+package com.gyee.runeconomy.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 气象站名称 前端控制器
+ * </p>
+ *
+ * @author wang
+ * @since 2023-04-04
+ */
+@RestController
+@RequestMapping("//pro-basic-weather-station")
+public class ProBasicWeatherStationController {
+
+}

+ 47 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/AgcController.java

@@ -0,0 +1,47 @@
+package com.gyee.runeconomy.controller.monitor;/*
+@author   谢生杰
+@date   2023/4/3-17:15
+*/
+
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.vo.monitor.AgcVo;
+import com.gyee.runeconomy.dto.R;
+import com.gyee.runeconomy.dto.ResultMsg;
+import com.gyee.runeconomy.service.monitor.AgcService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/agc")
+@Api(value = "agc监视",tags =  "agc监视")
+public class AgcController {
+    @Resource
+    private AgcService agcService;
+
+    /**
+     * agc监视
+     * @return
+     */
+    @GetMapping("/monitor")
+    @ResponseBody
+    @ApiOperation(value = "AGC监视", notes = "AGC监视")
+    public R monitor(@RequestParam(value = "type",required = true) String type,
+                   @RequestParam(value = "company",required = true) String company) throws Exception {
+
+        List<AgcVo> resultList = agcService.monitor(company,type);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+}

+ 103 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/ComprehensiveController.java

@@ -0,0 +1,103 @@
+package com.gyee.runeconomy.controller.monitor;/*
+@author   谢生杰
+@date   2023/4/3-14:38
+*/
+
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.vo.monitor.CompreVo;
+import com.gyee.runeconomy.dto.R;
+import com.gyee.runeconomy.dto.ResultMsg;
+import com.gyee.runeconomy.model.auto.ProEconTestingPoint;
+import com.gyee.runeconomy.service.monitor.ComprehensiveService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/comprehensive")
+@Api(value = "综合指标/数据列表",tags =  "综合指标/数据列表")
+public class ComprehensiveController {
+    @Resource
+    private ComprehensiveService comprehensiveService;
+
+    /**
+     * 综合指标-指标查询
+     * @return
+     */
+    @GetMapping("/targets")
+    @ResponseBody
+    @ApiOperation(value = "综合指标-获取指标", notes = "综合指标-获取指标")
+    public R targets(@RequestParam(value = "type",required = true) String type)  {
+
+        List<ProEconTestingPoint> resultList = comprehensiveService.targets(type);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+
+    /**
+     * 数据指标-指标查询
+     * @return
+     */
+    @GetMapping("/wttargets")
+    @ResponseBody
+    @ApiOperation(value = "数据指标-获取指标", notes = "数据指标-获取指标")
+    public R wttargets(@RequestParam(value = "type",required = true) String type)  {
+
+        List<ProEconTestingPoint> resultList = comprehensiveService.wttargets(type);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+
+    /**
+     * 综合指标-列表查询
+     * @return
+     */
+    @GetMapping("/listing")
+    @ResponseBody
+    @ApiOperation(value = "综合指标-列表查询", notes = "综合指标-列表查询")
+    public R listing(@RequestParam(value = "type",required = true) String type,
+                   @RequestParam(value = "company",required = true) String company,
+                     @RequestParam(value = "targets",required = true) String targets) throws Exception {
+
+        List<CompreVo> resultList = comprehensiveService.listing(company,type,targets);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+
+    /**
+     * 数据指标-列表查询
+     * @return
+     */
+    @GetMapping("/wtlisting")
+    @ResponseBody
+    @ApiOperation(value = "数据指标-列表查询", notes = "数据指标-列表查询")
+    public R wtlisting(@RequestParam(value = "type",required = true) String type,
+                     @RequestParam(value = "company",required = true) String company,
+                       @RequestParam(value = "wpid",required = true) String wpid,
+                     @RequestParam(value = "targets",required = true) String targets) throws Exception {
+
+        List<CompreVo> resultList = comprehensiveService.wtlisting(company,type,targets,wpid);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+}

+ 85 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/DeviceDetailsController.java

@@ -0,0 +1,85 @@
+package com.gyee.runeconomy.controller.monitor;/*
+@author   谢生杰
+@date   2023/4/6-15:20
+*/
+
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.vo.monitor.AgcVo;
+import com.gyee.runeconomy.dto.R;
+import com.gyee.runeconomy.dto.ResultMsg;
+import com.gyee.runeconomy.model.auto.ProEconTestingPoint;
+import com.gyee.runeconomy.service.monitor.DeviceDetailsService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/detail")
+@Api(value = "设备详情",tags =  "设备详情")
+public class DeviceDetailsController {
+    @Resource
+    private DeviceDetailsService deviceDetailsService;
+
+    /**
+     * 左侧树形
+     * @return
+     */
+    @GetMapping("/tree")
+    @ResponseBody
+    @ApiOperation(value = "左侧树形", notes = "左侧树形")
+    public R tree(@RequestParam(value = "wpid",required = true) String wpid) throws Exception {
+
+        Map<String,Object> resultMap = deviceDetailsService.tree(wpid);
+        if (StringUtils.isNotNull(resultMap)) {
+            return R.data(ResultMsg.ok(resultMap));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+
+    /**
+     * 监测信息
+     * @return
+     */
+    @GetMapping("/info")
+    @ResponseBody
+    @ApiOperation(value = "监测信息", notes = "监测信息")
+    public R info(@RequestParam(value = "wtid",required = true) String wtid) throws Exception {
+
+        Map<String,Double> resultMap = deviceDetailsService.info(wtid);
+        if (StringUtils.isNotNull(resultMap)) {
+            return R.data(ResultMsg.ok(resultMap));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+
+    /**
+     * 获取统一编码
+     * @return
+     */
+    @GetMapping("/getuniformcode")
+    @ResponseBody
+    @ApiOperation(value = "获取统一编码", notes = "获取统一编码")
+    public R getuniformcode(@RequestParam(value = "part",required = true) String part,
+                            @RequestParam(value = "wtid",required = true) String wtid) throws Exception {
+
+        Map<String,List<ProEconTestingPoint>> resultMap = deviceDetailsService.getuniformcode(part,wtid);
+        if (StringUtils.isNotNull(resultMap)) {
+            return R.data(ResultMsg.ok(resultMap));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+
+}

+ 88 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/MatrixController.java

@@ -0,0 +1,88 @@
+package com.gyee.runeconomy.controller.monitor;/*
+@author   谢生杰
+@date   2023/3/28-8:43
+*/
+
+import com.gyee.common.model.StringUtils;
+import com.gyee.runeconomy.dto.R;
+import com.gyee.runeconomy.dto.ResultMsg;
+import com.gyee.runeconomy.service.monitor.MatrixService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/matrix")
+@Api(value = "矩阵",tags =  "矩阵")
+public class MatrixController {
+    @Resource
+    private MatrixService matrixService;
+
+
+    /**
+     * 基础矩阵
+     * @return
+     */
+    @GetMapping("/basic")
+    @ResponseBody
+    @ApiOperation(value = "基础矩阵", notes = "基础矩阵")
+    public R basic(@RequestParam(value = "type",required = true) String type,
+                      @RequestParam(value = "company",required = true) String company) throws Exception {
+
+        Map<String,Object> resultMap = matrixService.basic(company,type);
+        if (StringUtils.isNotNull(resultMap)) {
+            return R.data(ResultMsg.ok(resultMap));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+    /**
+     * 明细矩阵
+     * @return
+     */
+    @GetMapping("/detailed")
+    @ResponseBody
+    @ApiOperation(value = "明细矩阵", notes = "明细矩阵")
+    public R detailed(@RequestParam(value = "type",required = true) String type,
+                       @RequestParam(value = "company",required = true) String company) throws Exception {
+
+        Map<String,Object> resultMap = matrixService.matrixMX(company,type);
+        if (StringUtils.isNotNull(resultMap)) {
+            return R.data(ResultMsg.ok(resultMap));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+    /**
+     * 单场矩阵
+     * @return
+     */
+    @GetMapping("/single")
+    @ResponseBody
+    @ApiOperation(value = "单场矩阵", notes = "单场矩阵")
+    public R single(@RequestParam(value = "wpid",required = true) String wpid) throws Exception {
+
+        Map<String,Object> resultMap = matrixService.single(wpid);
+        if (StringUtils.isNotNull(resultMap)) {
+            return R.data(ResultMsg.ok(resultMap));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+
+
+
+}

+ 66 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/StationMonitorController.java

@@ -0,0 +1,66 @@
+package com.gyee.runeconomy.controller.monitor;/*
+@author   谢生杰
+@date   2023/4/12-8:39
+*/
+
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.vo.monitor.AgcVo;
+import com.gyee.runeconomy.dto.R;
+import com.gyee.runeconomy.dto.ResultMsg;
+import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
+import com.gyee.runeconomy.model.auto.ProEconPowerstationInfoDay1;
+import com.gyee.runeconomy.service.monitor.StationMonitorService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/station")
+@Api(value = "场站监视",tags =  "场站监视")
+public class StationMonitorController {
+    @Resource
+    private StationMonitorService stationMonitorService;
+
+    /**
+     * 场站数据
+     * @return
+     */
+    @GetMapping("/caldata")
+    @ResponseBody
+    @ApiOperation(value = "场站信息", notes = "场站信息")
+    public R caldata(@RequestParam(value = "wpid",required = true) String wpid) throws Exception {
+
+        Map<String,Object> resultMap = stationMonitorService.caldata(wpid);
+        if (StringUtils.isNotNull(resultMap)) {
+            return R.data(ResultMsg.ok(resultMap));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+    /**
+     * 场站每日电量
+     * @return
+     */
+    @GetMapping("/hisdata")
+    @ResponseBody
+    @ApiOperation(value = "场站每日电量", notes = "场站每日电量")
+    public R hisdata(@RequestParam(value = "wpid",required = true) String wpid) throws Exception {
+
+        List<ProEconPowerstationInfoDay1> resultList = stationMonitorService.hisdata(wpid);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+}

+ 48 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/monitor/StatusController.java

@@ -0,0 +1,48 @@
+package com.gyee.runeconomy.controller.monitor;/*
+@author   谢生杰
+@date   2023/4/4-9:50
+*/
+
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.vo.monitor.AgcVo;
+import com.gyee.common.vo.monitor.StatusVo;
+import com.gyee.runeconomy.dto.R;
+import com.gyee.runeconomy.dto.ResultMsg;
+import com.gyee.runeconomy.service.monitor.StatusService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Controller
+@RequestMapping("/status")
+@Api(value = "状态监视",tags =  "状态监视")
+public class StatusController {
+
+    @Resource
+    private StatusService statusService;
+
+    /**
+     * 状态监视
+     * @return
+     */
+    @GetMapping("/monitor")
+    @ResponseBody
+    @ApiOperation(value = "状态监视", notes = "状态监视")
+    public R monitor(@RequestParam(value = "type",required = true) String type,
+                     @RequestParam(value = "company",required = true) String company) throws Exception {
+
+        List<StatusVo> resultList = statusService.monitor(company,type);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        }else{
+            return R.error(ResultMsg.error());
+        }
+    }
+}

+ 26 - 11
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/init/CacheContext.java

@@ -51,6 +51,8 @@ public class CacheContext implements CommandLineRunner {
     @Resource
     private IProBasicSubStationService proBasicSubStationService;
     @Resource
+    private IProBasicWeatherStationService proBasicWeatherStationService;
+    @Resource
     private IProBasicSquareService proBasicSquareService;
     @Resource
     private IProBasicCompanyService proBasicCompanyService;
@@ -66,7 +68,7 @@ public class CacheContext implements CommandLineRunner {
     public static List<ProBasicProject> pjls = new ArrayList<>();
     public static List<ProBasicLine>  lnls = new ArrayList<>();
     public static List<ProBasicSubStation>  subwpls = new ArrayList<>();
-
+    public static List<ProBasicWeatherStation>  weawpls = new ArrayList<>();
     public static List<ProBasicSquare> sqls = new ArrayList<>();
     public static List<ProBasicPowerstation>  wpls = new ArrayList<>();
     public static List<ProBasicPowerstation>  zwpls = new ArrayList<>();
@@ -98,6 +100,7 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String,Map<String, ProBasicPowerstationPoint>> propointmap =new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> wppointmap =new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> subwppointmap =new HashMap<>();
+    public static Map<String,Map<String, ProBasicPowerstationPoint>> weatherwppointmap =new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> companypointmap =new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> regionpointmap =new HashMap<>();
 
@@ -232,16 +235,7 @@ public class CacheContext implements CommandLineRunner {
             }
         }
 
-        for(ProBasicPowerstation wp:wpls)
-        {
-            if (cpwpmap.containsKey(wp.getCompanyId())){
-                cpwpmap.get(wp.getCompanyId()).add(wp);
-            }else {
-                List<ProBasicPowerstation> wps = new ArrayList<>();
-                wps.add(wp);
-                cpwpmap.put(wp.getCompanyId(),wps);
-            }
-        }
+
 
 
         wtls = proBasicEquipmentService.list().stream().filter(i->i.getIsable()==1).collect(Collectors.toList());
@@ -390,6 +384,17 @@ public class CacheContext implements CommandLineRunner {
 
         });
 
+        weawpls = proBasicWeatherStationService.list().stream().filter(i-> i.getIsAble()==1).collect(Collectors.toList());
+        weawpls.stream().forEach(weather->{
+
+            String subString = redisService.get(weather.getId());
+            Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
+            });
+            weatherwppointmap.put(weather.getId(),stringWindpowerstationpointnewMap);
+
+
+        });
+
 
         lnls = proBasicLineService.list().stream().filter(i-> StringUtils.isNotNull(pjmap.get(i.getProjectId())) && i.getIsAble()==1).collect(Collectors.toList());
         lnls.stream().forEach(l->{
@@ -410,6 +415,16 @@ public class CacheContext implements CommandLineRunner {
 
         zwpls = proBasicWindpowerstationService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());;
         wpls = proBasicWindpowerstationService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());;
+        for(ProBasicPowerstation wp:wpls)
+        {
+            if (cpwpmap.containsKey(wp.getCompanyId())){
+                cpwpmap.get(wp.getCompanyId()).add(wp);
+            }else {
+                List<ProBasicPowerstation> wps = new ArrayList<>();
+                wps.add(wp);
+                cpwpmap.put(wp.getCompanyId(),wps);
+            }
+        }
         meterpoints = proBasicMeterPointService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());
         meterpoints.stream().forEach(meterpoint -> {
             meterpointMap.put(meterpoint.getId(),meterpoint);

+ 16 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/mapper/auto/ProBasicWeatherStationMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.runeconomy.mapper.auto;
+
+import com.gyee.runeconomy.model.auto.ProBasicWeatherStation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 气象站名称 Mapper 接口
+ * </p>
+ *
+ * @author wang
+ * @since 2023-04-04
+ */
+public interface ProBasicWeatherStationMapper extends BaseMapper<ProBasicWeatherStation> {
+
+}

+ 80 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/model/auto/ProBasicWeatherStation.java

@@ -0,0 +1,80 @@
+package com.gyee.runeconomy.model.auto;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 气象站名称
+ * </p>
+ *
+ * @author wang
+ * @since 2023-04-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProBasicWeatherStation extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    private String id;
+
+    /**
+     * 编码
+     */
+    private String nemCode;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 别名
+     */
+    private String aname;
+
+    /**
+     * 风场编号
+     */
+    private String windpowerstationId;
+
+    /**
+     * 顺序
+     */
+    private Integer orderNum;
+
+    /**
+     * 是否可用
+     */
+    private Integer isAble;
+
+    /**
+     * 备用1
+     */
+    private String spare1;
+
+    /**
+     * 备用2
+     */
+    private String spare2;
+
+    /**
+     * 备用3
+     */
+    private String spare3;
+
+    /**
+     * 备用4
+     */
+    private String spare4;
+
+    private Double capacity;
+
+
+}

+ 16 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/IProBasicWeatherStationService.java

@@ -0,0 +1,16 @@
+package com.gyee.runeconomy.service.auto;
+
+import com.gyee.runeconomy.model.auto.ProBasicWeatherStation;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 气象站名称 服务类
+ * </p>
+ *
+ * @author wang
+ * @since 2023-04-04
+ */
+public interface IProBasicWeatherStationService extends IService<ProBasicWeatherStation> {
+
+}

+ 20 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProBasicWeatherStationServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.runeconomy.service.auto.impl;
+
+import com.gyee.runeconomy.model.auto.ProBasicWeatherStation;
+import com.gyee.runeconomy.mapper.auto.ProBasicWeatherStationMapper;
+import com.gyee.runeconomy.service.auto.IProBasicWeatherStationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 气象站名称 服务实现类
+ * </p>
+ *
+ * @author wang
+ * @since 2023-04-04
+ */
+@Service
+public class ProBasicWeatherStationServiceImpl extends ServiceImpl<ProBasicWeatherStationMapper, ProBasicWeatherStation> implements IProBasicWeatherStationService {
+
+}

+ 2 - 1
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconEquipmentInfoDay5ServiceImpl.java

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.List;
 
 /**
@@ -23,7 +24,7 @@ import java.util.List;
 @Service
 public class ProEconEquipmentInfoDay5ServiceImpl extends ServiceImpl<ProEconEquipmentInfoDay5Mapper, ProEconEquipmentInfoDay5> implements IProEconEquipmentInfoDay5Service {
 
-    @Autowired
+    @Resource
     private ProEconEquipmentInfoDay5Mapper proEconEquipmentInfoDay5Mapper;
 
     @Override

+ 82 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/AgcService.java

@@ -0,0 +1,82 @@
+package com.gyee.runeconomy.service.monitor;/*
+@author   谢生杰
+@date   2023/4/3-17:16
+*/
+
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.vo.monitor.AgcVo;
+import com.gyee.runeconomy.init.CacheContext;
+import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
+import com.gyee.runeconomy.model.auto.ProBasicPowerstationPoint;
+import com.gyee.runeconomy.model.auto.ProBasicSubStation;
+import com.gyee.runeconomy.util.realtimesource.EdosUtil;
+import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+public class AgcService {
+    @Resource
+    private IEdosUtil edosUtil;
+
+
+    public List<AgcVo> monitor(String company, String type) {
+
+        List<AgcVo> resultList = new ArrayList<>();
+        List<ProBasicSubStation> subwpls = CacheContext.subwpls;
+        Map<String, ProBasicPowerstation> wpmap = CacheContext.wpmap;
+        Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = CacheContext.subwppointmap;
+        if (company.endsWith("ZGS")) {
+            subwpls.stream().filter(sub->wpmap.get(sub.getWindpowerstationId()).getCompanyId().equals(company)).collect(Collectors.toList());
+        }
+        if (type.equals("-1")) {
+            subwpls.stream().filter(sub->wpmap.get(sub.getWindpowerstationId()).getWindType().equals("-1")).collect(Collectors.toList());
+        } else if (type.equals("-2")) {
+            subwpls.stream().filter(sub->wpmap.get(sub.getWindpowerstationId()).getWindType().equals("-2")).collect(Collectors.toList());
+        }
+        subwpls.stream().forEach(sub->{
+            List<String> points = new ArrayList<>();
+            Map<String, ProBasicPowerstationPoint> powerstationPointMap = subwppointmap.get(sub.getId());
+            points.add(powerstationPointMap.get(ContantXk.TPOINT_WP_CXGL).getNemCode());
+            points.add(powerstationPointMap.get(ContantXk.TPOINT_WP_AGC).getNemCode());
+            points.add(powerstationPointMap.get(ContantXk.TPOINT_WP_YGSX).getNemCode());
+            points.add(powerstationPointMap.get(ContantXk.TPOINT_WP_YGXX).getNemCode());
+            points.add(powerstationPointMap.get(ContantXk.TPOINT_WP_YF).getNemCode());
+            points.add(powerstationPointMap.get(ContantXk.TPOINT_WP_TT).getNemCode());
+            points.add(powerstationPointMap.get(ContantXk.TPOINT_WP_JBS).getNemCode());
+            points.add(powerstationPointMap.get(ContantXk.TPOINT_WP_ZBS).getNemCode());
+            points.add(powerstationPointMap.get(ContantXk.TPOINT_WP_XDZT).getNemCode());
+            points.add(powerstationPointMap.get(ContantXk.TPOINT_WP_ZSGL).getNemCode());
+            points.add(powerstationPointMap.get(ContantXk.TPOINT_WP_YCGL).getNemCode());
+            List<PointData> realData = new ArrayList<>();
+            try {
+                realData = edosUtil.getRealData(points);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            AgcVo vo = new AgcVo();
+            vo.setWpid(sub.getId());
+            vo.setWpname(sub.getAname());
+            vo.setAgc001(realData.get(0).getPointValueInDouble());
+            vo.setAgc002(realData.get(1).getPointValueInDouble());
+            vo.setAgc003(realData.get(2).getPointValueInDouble());
+            vo.setAgc004(realData.get(3).getPointValueInDouble());
+            vo.setAgc005(realData.get(4).getPointValueInDouble());
+            vo.setAgc006(realData.get(5).getPointValueInDouble());
+            vo.setAgc007(realData.get(6).getPointValueInDouble());
+            vo.setAgc008(realData.get(7).getPointValueInDouble());
+            vo.setAgc009(realData.get(8).getPointValueInDouble());
+            vo.setAgc010(realData.get(9).getPointValueInDouble());
+            vo.setYcgl(realData.get(10).getPointValueInDouble());
+            resultList.add(vo);
+        });
+
+        return resultList;
+    }
+}

+ 128 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/ComprehensiveService.java

@@ -0,0 +1,128 @@
+package com.gyee.runeconomy.service.monitor;/*
+@author   谢生杰
+@date   2023/4/3-14:39
+*/
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.common.model.PointData;
+import com.gyee.common.vo.monitor.CompreVo;
+import com.gyee.runeconomy.init.CacheContext;
+import com.gyee.runeconomy.model.auto.*;
+import com.gyee.runeconomy.service.auto.IProEconTestingPointService;
+import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+public class ComprehensiveService {
+    @Resource
+    private IProEconTestingPointService proEconTestingPointService;
+    @Resource
+    private IEdosUtil edosUtil;
+
+
+    public List<ProEconTestingPoint> targets(String type) {
+        QueryWrapper<ProEconTestingPoint> qw = new QueryWrapper<>();
+        if (type.equals("-1")){
+            qw.select(" DISTINCT uniform_code,name ").lambda().eq(ProEconTestingPoint::getTypeId,"fcc");
+        }else if (type.equals("-2")){
+            qw.select(" DISTINCT uniform_code,name ").lambda().eq(ProEconTestingPoint::getTypeId,"gcc");
+        }else {
+            qw.select(" DISTINCT uniform_code,name ").lambda().in(ProEconTestingPoint::getTypeId,"gcc","fcc");
+        }
+
+        List<ProEconTestingPoint> list = proEconTestingPointService.list(qw);
+        return list;
+    }
+
+    public List<ProEconTestingPoint> wttargets(String type) {
+        QueryWrapper<ProEconTestingPoint> qw = new QueryWrapper<>();
+        qw.select(" DISTINCT uniform_code,name ").lambda().like(ProEconTestingPoint::getUniformCode,"AI");
+        if (type.equals("-1")){
+            qw.lambda().eq(ProEconTestingPoint::getTypeId,"F");
+        }else if(type.equals("-2")){
+            qw.lambda().eq(ProEconTestingPoint::getTypeId,"G");
+        }
+
+        List<ProEconTestingPoint> list = proEconTestingPointService.list(qw);
+
+
+        return list;
+
+    }
+
+    public List<CompreVo> listing(String company, String type, String targets) {
+
+        List<CompreVo> resultList = new ArrayList<>();
+        List<ProBasicPowerstation> wpls = CacheContext.wpls;
+        Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
+        if (company.endsWith("ZGS")) {
+            wpls = wpls.stream().filter(wp -> wp.getCompanyId().equals(company)).collect(Collectors.toList());
+        }
+        if (type.equals("-1")) {
+            wpls = wpls.stream().filter(wp -> wp.getWindType().equals("-1")).collect(Collectors.toList());
+        } else if (type.equals("-2")) {
+            wpls = wpls.stream().filter(wp -> wp.getWindType().equals("-2")).collect(Collectors.toList());
+        }
+        String[] targetArray = targets.split(",");
+
+        wpls.stream().forEach(wp->{
+            CompreVo vo = new CompreVo();
+            vo.setWpname(wp.getAname());
+            vo.setCapacity(wp.getJrCapacity()+wp.getJrwindCapacity());
+            List<String> targetList = new ArrayList<>();
+            Map<String, ProBasicPowerstationPoint> powerstationPointMap = wppointmap.get(wp.getId());
+            Arrays.stream(targetArray).forEach(t->{
+                if (powerstationPointMap.containsKey(t)){
+                    targetList.add(powerstationPointMap.get(t).getNemCode());
+                }
+            });
+            List<PointData> pointDataList = null;
+            try {
+                pointDataList = edosUtil.getRealData(targetList);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            vo.setDataList(pointDataList);
+            resultList.add(vo);
+        });
+        return resultList;
+
+    }
+
+    public List<CompreVo> wtlisting(String company, String type, String targets, String wpid) {
+        List<CompreVo> resultList = new ArrayList<>();
+        Map<String, List<ProBasicEquipment>> wpwtmap = CacheContext.wpwtmap;
+        Map<String, Double> modelpower = CacheContext.modelpower;
+        List<ProBasicEquipment> equipments = wpwtmap.get(wpid);
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+        String[] targetArray = targets.split(",");
+        equipments.stream().forEach(wt->{
+            CompreVo vo = new CompreVo();
+            vo.setWpname(wt.getAname());
+            vo.setCapacity(modelpower.get(wt.getId()));
+            List<String> targetList = new ArrayList<>();
+            Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
+            Arrays.stream(targetArray).forEach(t->{
+                targetList.add(equipmentPointMap.get(t).getNemCode());
+            });
+            List<PointData> pointDataList = null;
+            try {
+                pointDataList = edosUtil.getRealData(targetList);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            vo.setDataList(pointDataList);
+            resultList.add(vo);
+        });
+        return resultList;
+
+    }
+}

+ 104 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/DeviceDetailsService.java

@@ -0,0 +1,104 @@
+package com.gyee.runeconomy.service.monitor;/*
+@author   谢生杰
+@date   2023/4/6-15:30
+*/
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.vo.monitor.AgcVo;
+import com.gyee.runeconomy.init.CacheContext;
+import com.gyee.runeconomy.model.auto.*;
+import com.gyee.runeconomy.service.auto.IProEconTestingPointService;
+import com.gyee.runeconomy.util.StringUtils;
+import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+public class DeviceDetailsService {
+    @Resource
+    private IEdosUtil edosUtil;
+    @Resource
+    private IProEconTestingPointService proEconTestingPointService;
+
+    public Map<String,Object> tree(String wpid) {
+        Map<String,Object> proMap = new HashMap<>();
+        Map<String, List<ProBasicProject>> wppromap = CacheContext.wppromap;
+        Map<String, List<ProBasicLine>> prolinemap = CacheContext.prolinemap;
+        Map<String, List<ProBasicEquipment>> lnwtmap = CacheContext.lnwtmap;
+        List<ProBasicProject> projects = wppromap.get(wpid);
+        projects.stream().forEach(p->{
+            List<ProBasicLine> lines = prolinemap.get(p.getId());
+            Map<String,Object> lineMap = new HashMap<>();
+            lines.stream().forEach(line->{
+                List<ProBasicEquipment> equipments = lnwtmap.get(line.getId());
+                lineMap.put(line.getAname(),equipments);
+            });
+            proMap.put(p.getAname(),lineMap);
+        });
+        return proMap;
+    }
+
+    public Map<String, Double> info(String wtid) throws Exception {
+        Map<String, Double> resultMap = new HashMap<>();
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+        Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wtid);
+        List<String> codes = new ArrayList<>();
+        codes.add(equipmentPointMap.get(ContantXk.RFDL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.CJ_SSFS).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.CJ_FX).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.CJ_SSGL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.CJ_WGGL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.ZSGL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.BZGL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.CJ_SSZS).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.RGZSSDL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.RCNSLGZSSDL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.RJXSSDL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.RCNSLJXSSDL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.RDJSSDL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.RQXJCLSSDL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.RSDTJSSDL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.RXNSSDL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.RXDTJSSDL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.RXDJCLSSDL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.RCWSLDWSSDL).getNemCode());
+        codes.add(equipmentPointMap.get(ContantXk.RCWSLTQSSDL).getNemCode());
+        List<PointData> realData = edosUtil.getRealData(codes);
+        if (StringUtils.isNotEmpty(realData)){
+            resultMap.put("rfdl",realData.get(0).getPointValueInDouble());
+            resultMap.put("fs",realData.get(1).getPointValueInDouble());
+            resultMap.put("fx",realData.get(2).getPointValueInDouble());
+            resultMap.put("ssgl",realData.get(3).getPointValueInDouble());
+            resultMap.put("wggl",realData.get(4).getPointValueInDouble());
+            resultMap.put("llgl",realData.get(5).getPointValueInDouble());
+            resultMap.put("bzgl",realData.get(6).getPointValueInDouble());
+            resultMap.put("ylzs",realData.get(7).getPointValueInDouble());
+            resultMap.put("gzss",realData.get(8).getPointValueInDouble()+realData.get(9).getPointValueInDouble());
+            resultMap.put("jxss",realData.get(10).getPointValueInDouble()+realData.get(11).getPointValueInDouble());
+            resultMap.put("xnss",realData.get(12).getPointValueInDouble()+realData.get(13).getPointValueInDouble()+realData.get(14).getPointValueInDouble()+realData.get(15).getPointValueInDouble());
+            resultMap.put("xdss",realData.get(16).getPointValueInDouble()+realData.get(17).getPointValueInDouble());
+            resultMap.put("slss",realData.get(18).getPointValueInDouble()+realData.get(19).getPointValueInDouble());
+        }
+
+        return resultMap;
+    }
+
+    public Map<String,List<ProEconTestingPoint>> getuniformcode(String part,String wtid) {
+        Map<String,List<ProEconTestingPoint>> resultMap = new HashMap<>();
+        Map<String, ProBasicEquipment> wtmap = CacheContext.wtmap;
+        QueryWrapper<ProEconTestingPoint> qw = new QueryWrapper<>();
+        qw.lambda().eq(ProEconTestingPoint::getModel,wtmap.get(wtid).getModelId()).eq(ProEconTestingPoint::getLogicalUnitId,part);
+        List<ProEconTestingPoint> list = proEconTestingPointService.list(qw);
+        resultMap.put("AI",list.stream().filter(i->i.getUniformCode().startsWith("AI")).collect(Collectors.toList()));
+        resultMap.put("DI",list.stream().filter(i->i.getUniformCode().startsWith("DI")).collect(Collectors.toList()));
+        return resultMap;
+    }
+}

+ 633 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MatrixService.java

@@ -0,0 +1,633 @@
+package com.gyee.runeconomy.service.monitor;
+/*
+@author   谢生杰
+@date   2023/3/28-8:49
+*/
+
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.util.DoubleUtils;
+import com.gyee.common.vo.monitor.MatrixPowerVo;
+import com.gyee.common.vo.monitor.MatrixVo;
+import com.gyee.runeconomy.init.CacheContext;
+import com.gyee.runeconomy.model.auto.*;
+import com.gyee.runeconomy.util.StringUtils;
+import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+
+@Service
+public class MatrixService {
+    @Resource
+    private IEdosUtil edosUtil;
+
+    public Map<String, Object> matrixMX(String company, String type) throws Exception {
+        List<ProBasicPowerstation> wpls = CacheContext.wpls;
+
+        Map<String, Double> modelpower = CacheContext.modelpower;
+
+        if (company.endsWith("ZGS")) {
+            wpls = wpls.stream().filter(wp -> wp.getCompanyId().equals(company)).collect(Collectors.toList());
+        }
+        if (type.equals("-1")) {
+            wpls = wpls.stream().filter(wp -> wp.getWindType().equals("-1")).collect(Collectors.toList());
+        } else if (type.equals("-2")) {
+            wpls = wpls.stream().filter(wp -> wp.getWindType().equals("-2")).collect(Collectors.toList());
+        }
+
+        Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+        Map<String, List<ProBasicEquipment>> wpwtmap = CacheContext.wpwtmap;
+        Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = CacheContext.subwppointmap;
+
+        List<ProBasicSubStation> subwpls = CacheContext.subwpls;
+
+        List<MatrixPowerVo> powerVos = new ArrayList<>();
+        AtomicInteger jrts = new AtomicInteger();
+        AtomicInteger dfts = new AtomicInteger();
+        AtomicInteger sdtj = new AtomicInteger();
+        AtomicInteger zcyx = new AtomicInteger();
+        AtomicInteger jclyx = new AtomicInteger();
+        AtomicInteger gztj = new AtomicInteger();
+        AtomicInteger gzsl = new AtomicInteger();
+        AtomicInteger jxtj = new AtomicInteger();
+        AtomicInteger jxsl = new AtomicInteger();
+        AtomicInteger xdjcl = new AtomicInteger();
+        AtomicInteger xdtj = new AtomicInteger();
+        AtomicInteger dwsl = new AtomicInteger();
+        AtomicInteger hjsl = new AtomicInteger();
+        AtomicInteger lx = new AtomicInteger();
+        AtomicInteger wz = new AtomicInteger();
+        AtomicReference<Double> qf0 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> qf1 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> qf2 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> qf3 = new AtomicReference<>((double) 0);
+        AtomicReference<Double> qf4 = new AtomicReference<>((double) 0);
+        wpls.stream().forEach(wp -> {
+            List<MatrixVo> volist = new ArrayList<>();
+            List<String> wpPoints = new ArrayList<>();
+            List<String> wtPoints = new ArrayList<>();
+            Map<String, ProBasicPowerstationPoint> pointMap = wppointmap.get(wp.getId());
+            wpPoints.add(pointMap.get(ContantXk.DJTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.SDTJTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.XNTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.QXJCLTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.GZTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.CNSLGZTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.JXTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.CNSLJXTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.XDTJTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.XDJCLTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.CWSLDWTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.CWSLTQTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.LXTSMX).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.TXZDTSMX).getNemCode());
+            if (wp.getWindType().equals("-1")) {
+                wpPoints.add(pointMap.get(ContantXk.SSPJFS).getNemCode());
+            } else if (wp.getWindType().equals("-2")) {
+                wpPoints.add(pointMap.get(ContantXk.SSPJGZD).getNemCode());
+            }
+
+            wpPoints.add(pointMap.get(ContantXk.SSZBZGL).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.SSZNHGLZS).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.SSZGL).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.ZYCGL).getNemCode());
+            List<ProBasicEquipment> equipments = wpwtmap.get(wp.getId());
+            equipments.stream().forEach(wt -> {
+                Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
+                wtPoints.add(equipmentPointMap.get(ContantXk.MXZT).getNemCode());
+                wtPoints.add(equipmentPointMap.get(ContantXk.CJ_SSGL).getNemCode());
+                if (wt.getEquipmentCategory() == -1) {
+                    wtPoints.add(equipmentPointMap.get(ContantXk.CJ_SSFS).getNemCode());
+                    wtPoints.add(equipmentPointMap.get(ContantXk.CJ_SSZS).getNemCode());
+                } else if (wt.getEquipmentCategory() == -2) {
+                    wtPoints.add(equipmentPointMap.get(ContantXk.JLDL).getNemCode());
+                    wtPoints.add(equipmentPointMap.get(ContantXk.JLDY).getNemCode());
+                }
+                wtPoints.add(equipmentPointMap.get(ContantXk.SSQFZT).getNemCode());
+                wtPoints.add(equipmentPointMap.get(ContantXk.RQFDL).getNemCode());
+            });
+            try {
+                List<PointData> wpRealdatas = edosUtil.getRealData(wpPoints);
+                List<PointData> wtRealdatas = edosUtil.getRealData(wtPoints);
+                MatrixPowerVo powerVo = new MatrixPowerVo();
+                powerVo.setWpid(wp.getId());
+                powerVo.setWpname(wp.getAname());
+                if (wp.getWindType().equals("-1")){
+                    powerVo.setCzlx("-1");
+                }else if(wp.getWindType().equals("-2")){
+                    powerVo.setCzlx("-2");
+                }
+                powerVo.setJrts(wp.getJrwindQuantityHs() + wp.getJrwindQuantityLd() + wp.getJrquantityJz() + wp.getJrquantityZc());
+                powerVo.setDjts(wpRealdatas.get(0).getPointValueInDouble() + wpRealdatas.get(1).getPointValueInDouble());
+                powerVo.setBwts(wpRealdatas.get(2).getPointValueInDouble() + wpRealdatas.get(3).getPointValueInDouble());
+                powerVo.setGzts(wpRealdatas.get(4).getPointValueInDouble() + wpRealdatas.get(5).getPointValueInDouble());
+                powerVo.setJxts(wpRealdatas.get(6).getPointValueInDouble() + wpRealdatas.get(7).getPointValueInDouble());
+                powerVo.setXdts(wpRealdatas.get(8).getPointValueInDouble() + wpRealdatas.get(9).getPointValueInDouble());
+                powerVo.setSlts(wpRealdatas.get(10).getPointValueInDouble() + wpRealdatas.get(11).getPointValueInDouble());
+                powerVo.setLxts(wpRealdatas.get(12).getPointValueInDouble() + wpRealdatas.get(13).getPointValueInDouble());
+                powerVo.setSpped(wpRealdatas.get(13).getPointValueInDouble());
+                powerVo.setBzgl(wpRealdatas.get(14).getPointValueInDouble());
+                powerVo.setLlgl(wpRealdatas.get(15).getPointValueInDouble());
+                powerVo.setSjgl(wpRealdatas.get(16).getPointValueInDouble());
+                powerVo.setYcgl(wpRealdatas.get(17).getPointValueInDouble());
+
+                AtomicReference<Double> cxgl = new AtomicReference<>((double) 0);
+                AtomicReference<Double> agc = new AtomicReference<>((double) 0);
+                List<ProBasicSubStation> subStations = subwpls.stream().filter(sub -> sub.getWindpowerstationId().equals(wp.getId())).collect(Collectors.toList());
+                subStations.stream().forEach(sub->{
+                    Map<String, ProBasicPowerstationPoint> powerstationPointMap = subwppointmap.get(sub.getId());
+                    ProBasicPowerstationPoint cxglPoint = powerstationPointMap.get(ContantXk.TPOINT_WP_CXGL);
+
+                    ProBasicPowerstationPoint agcPoint = powerstationPointMap.get(ContantXk.TPOINT_WP_AGC);
+                    cxgl.updateAndGet(v -> {
+                        try {
+                            return new Double((double) (v + edosUtil.getRealData(cxglPoint).getPointValueInDouble()));
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        return v;
+                    });
+                    agc.updateAndGet(v -> {
+                        try {
+                            return new Double((double) (v + edosUtil.getRealData(agcPoint).getPointValueInDouble()));
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        return v;
+                    });
+                });
+                powerVo.setCxgl(cxgl.get());
+                powerVo.setAgc(agc.get());
+
+                jrts.addAndGet(powerVo.getJrts());
+                dfts.addAndGet((int) wpRealdatas.get(0).getPointValueInDouble());
+                sdtj.addAndGet((int) wpRealdatas.get(1).getPointValueInDouble());
+                zcyx.addAndGet((int) wpRealdatas.get(2).getPointValueInDouble());
+                jclyx.addAndGet((int) wpRealdatas.get(3).getPointValueInDouble());
+                gztj.addAndGet((int) wpRealdatas.get(4).getPointValueInDouble());
+                gzsl.addAndGet((int) wpRealdatas.get(5).getPointValueInDouble());
+                jxtj.addAndGet((int) wpRealdatas.get(6).getPointValueInDouble());
+                jxsl.addAndGet((int) wpRealdatas.get(7).getPointValueInDouble());
+                xdtj.addAndGet((int) wpRealdatas.get(8).getPointValueInDouble());
+                xdjcl.addAndGet((int) wpRealdatas.get(9).getPointValueInDouble());
+                dwsl.addAndGet((int) wpRealdatas.get(10).getPointValueInDouble());
+                hjsl.addAndGet((int) wpRealdatas.get(11).getPointValueInDouble());
+                lx.addAndGet((int) wpRealdatas.get(12).getPointValueInDouble());
+                wz.addAndGet((int) wpRealdatas.get(13).getPointValueInDouble());
+                int index = 6;
+                for (int j = 0; j < equipments.size(); j++) {
+                    MatrixVo vo = new MatrixVo();
+                    vo.setWtid(equipments.get(j).getId());
+                    vo.setWtname(equipments.get(j).getAname());
+                    vo.setStatus(wtRealdatas.get(j * index).getPointValueInDouble());
+                    vo.setPower(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 1).getPointValueInDouble(), 2));
+
+                    if (equipments.get(j).getEquipmentCategory() == -1) {
+                        vo.setSpeed(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 2).getPointValueInDouble(), 2));
+                        vo.setTransfer(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 3).getPointValueInDouble(), 2));
+                    } else if (equipments.get(j).getEquipmentCategory() == -2) {
+                        vo.setCurrent(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 2).getPointValueInDouble(), 2));
+                        vo.setVoltage(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 3).getPointValueInDouble(), 2));
+                    }
+                    vo.setSsqfzt(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 4).getPointValueInDouble(), 2));
+                    vo.setQfdl(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 5).getPointValueInDouble(), 2));
+                    vo.setRate(DoubleUtils.keepPrecision(modelpower.containsKey(equipments.get(j).getId())?vo.getPower() / modelpower.get(equipments.get(j).getId()) * 100:0, 2));
+                    volist.add(vo);
+                }
+                powerVo.setWtlist(volist);
+                qf0.updateAndGet(v -> new Double((double) (v + volist.stream().filter(i -> i.getSsqfzt().equals(0)).mapToDouble(MatrixVo::getQfdl).sum())));
+                qf1.updateAndGet(v -> new Double((double) (v + volist.stream().filter(i -> i.getSsqfzt().equals(1)).mapToDouble(MatrixVo::getQfdl).sum())));
+                qf2.updateAndGet(v -> new Double((double) (v + volist.stream().filter(i -> i.getSsqfzt().equals(2)).mapToDouble(MatrixVo::getQfdl).sum())));
+                qf3.updateAndGet(v -> new Double((double) (v + volist.stream().filter(i -> i.getSsqfzt().equals(3)).mapToDouble(MatrixVo::getQfdl).sum())));
+                qf4.updateAndGet(v -> new Double((double) (v + volist.stream().filter(i -> i.getSsqfzt().equals(4)).mapToDouble(MatrixVo::getQfdl).sum())));
+                powerVos.add(powerVo);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+
+        });
+
+        Map<String, Object> dataMap = new HashMap<>();
+        dataMap.put("jrts", jrts.doubleValue());
+        dataMap.put("dfts", dfts.doubleValue());
+        dataMap.put("sdtj", sdtj.doubleValue());
+        dataMap.put("djts", dfts.doubleValue() + sdtj.doubleValue());
+        dataMap.put("zcyx", zcyx.doubleValue());
+        dataMap.put("jclyx", jclyx.doubleValue());
+        dataMap.put("bwts", zcyx.doubleValue() + jclyx.doubleValue());
+        dataMap.put("gztj", gztj.doubleValue());
+        dataMap.put("gzsl", gzsl.doubleValue());
+        dataMap.put("gzts", gztj.doubleValue() + gzsl.doubleValue());
+        dataMap.put("jxtj", jxtj.doubleValue());
+        dataMap.put("jxsl", jxsl.doubleValue());
+        dataMap.put("jxts", jxtj.doubleValue() + jxsl.doubleValue());
+        dataMap.put("xdtj", xdtj.doubleValue());
+        dataMap.put("xdjcl", xdjcl.doubleValue());
+        dataMap.put("xdts", xdtj.doubleValue() + xdjcl.doubleValue());
+        dataMap.put("dwsl", dwsl.doubleValue());
+        dataMap.put("hjsl", hjsl.doubleValue());
+        dataMap.put("slts", dwsl.doubleValue() + hjsl.doubleValue());
+        dataMap.put("lx", lx.doubleValue());
+        dataMap.put("wz", wz.doubleValue());
+        dataMap.put("lxz", lx.doubleValue() + wz.doubleValue());
+        dataMap.put("qf0", DoubleUtils.keepPrecision(qf0.get(), 2));
+        dataMap.put("qf1", DoubleUtils.keepPrecision(qf1.get(), 2));
+        dataMap.put("qf2", DoubleUtils.keepPrecision(qf2.get(), 2));
+        dataMap.put("qf3", DoubleUtils.keepPrecision(qf3.get(), 2));
+        dataMap.put("qf4", DoubleUtils.keepPrecision(qf4.get(), 2));
+        dataMap.put("powerVos", powerVos);
+        return dataMap;
+    }
+
+
+
+
+    public Map<String, Object> basic(String company, String type) {
+
+        List<ProBasicPowerstation> wpls = CacheContext.wpls;
+
+
+        if (company.endsWith("ZGS")) {
+            wpls = wpls.stream().filter(wp -> wp.getCompanyId().equals(company)).collect(Collectors.toList());
+        }
+        if (type.equals("-1")) {
+            wpls = wpls.stream().filter(wp -> wp.getWindType().equals("-1")).collect(Collectors.toList());
+        } else if (type.equals("-2")) {
+            wpls = wpls.stream().filter(wp -> wp.getWindType().equals("-2")).collect(Collectors.toList());
+        }
+
+        Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+        Map<String, List<ProBasicEquipment>> wpwtmap = CacheContext.wpwtmap;
+        Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = CacheContext.subwppointmap;
+
+        List<ProBasicSubStation> subwpls = CacheContext.subwpls;
+
+        List<MatrixPowerVo> powerVos = new ArrayList<>();
+        AtomicInteger jrts = new AtomicInteger();
+        AtomicInteger djts = new AtomicInteger();
+        AtomicInteger bwts = new AtomicInteger();
+        AtomicInteger gzts = new AtomicInteger();
+        AtomicInteger jxts = new AtomicInteger();
+        AtomicInteger xdts = new AtomicInteger();
+        AtomicInteger slts = new AtomicInteger();
+        AtomicInteger lxts = new AtomicInteger();
+        AtomicInteger gfjrts = new AtomicInteger();
+        AtomicInteger gfdjts = new AtomicInteger();
+        AtomicInteger gfbwts = new AtomicInteger();
+        AtomicInteger gfgzts = new AtomicInteger();
+        AtomicInteger gfjxts = new AtomicInteger();
+        AtomicInteger gfxdts = new AtomicInteger();
+        AtomicInteger gfslts = new AtomicInteger();
+        AtomicInteger gflxts = new AtomicInteger();
+
+        wpls.stream().forEach(wp -> {
+            List<MatrixVo> volist = new ArrayList<>();
+            List<String> wpPoints = new ArrayList<>();
+            List<String> wtPoints = new ArrayList<>();
+            Map<String, ProBasicPowerstationPoint> pointMap = wppointmap.get(wp.getId());
+            wpPoints.add(pointMap.get(ContantXk.DJTS).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.YXTS).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.GZTJTS).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.JXTJTS).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.XDTS).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.SLTS).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.TXZDTS).getNemCode());
+
+            if (wp.getWindType().equals("-1")) {
+                wpPoints.add(pointMap.get(ContantXk.SSPJFS).getNemCode());
+            } else if (wp.getWindType().equals("-2")) {
+                wpPoints.add(pointMap.get(ContantXk.SSPJGZD).getNemCode());
+            }
+
+            wpPoints.add(pointMap.get(ContantXk.SSZBZGL).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.SSZNHGLZS).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.SSZGL).getNemCode());
+            wpPoints.add(pointMap.get(ContantXk.ZYCGL).getNemCode());
+            List<ProBasicEquipment> equipments = wpwtmap.get(wp.getId());
+            equipments.stream().forEach(wt -> {
+                Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
+                wtPoints.add(equipmentPointMap.get(ContantXk.SBZT).getNemCode());
+
+            });
+            try {
+                List<PointData> wpRealdatas = edosUtil.getRealData(wpPoints);
+                List<PointData> wtRealdatas = edosUtil.getRealData(wtPoints);
+                MatrixPowerVo powerVo = new MatrixPowerVo();
+                powerVo.setWpid(wp.getId());
+                powerVo.setWpname(wp.getAname());
+                if (wp.getWindType().equals("-1")){
+                    powerVo.setCzlx("-1");
+                }else if(wp.getWindType().equals("-2")){
+                    powerVo.setCzlx("-2");
+                }
+                powerVo.setJrts(wp.getJrwindQuantityHs() + wp.getJrwindQuantityLd() + wp.getJrquantityJz() + wp.getJrquantityZc());
+                powerVo.setDjts(wpRealdatas.get(0).getPointValueInDouble());
+                powerVo.setBwts(wpRealdatas.get(1).getPointValueInDouble());
+                powerVo.setGzts(wpRealdatas.get(2).getPointValueInDouble());
+                powerVo.setJxts(wpRealdatas.get(3).getPointValueInDouble());
+                powerVo.setXdts(wpRealdatas.get(4).getPointValueInDouble());
+                powerVo.setSlts(wpRealdatas.get(5).getPointValueInDouble());
+                powerVo.setLxts(wpRealdatas.get(6).getPointValueInDouble());
+                powerVo.setSpped(wpRealdatas.get(7).getPointValueInDouble());
+                powerVo.setBzgl(wpRealdatas.get(8).getPointValueInDouble());
+                powerVo.setLlgl(wpRealdatas.get(9).getPointValueInDouble());
+                powerVo.setSjgl(wpRealdatas.get(10).getPointValueInDouble());
+                powerVo.setYcgl(wpRealdatas.get(11).getPointValueInDouble());
+                AtomicReference<Double> cxgl = new AtomicReference<>((double) 0);
+                AtomicReference<Double> agc = new AtomicReference<>((double) 0);
+                List<ProBasicSubStation> subStations = subwpls.stream().filter(sub -> sub.getWindpowerstationId().equals(wp.getId())).collect(Collectors.toList());
+                subStations.stream().forEach(sub->{
+                    Map<String, ProBasicPowerstationPoint> powerstationPointMap = subwppointmap.get(sub.getId());
+                    ProBasicPowerstationPoint cxglPoint = powerstationPointMap.get(ContantXk.TPOINT_WP_CXGL);
+
+                    ProBasicPowerstationPoint agcPoint = powerstationPointMap.get(ContantXk.TPOINT_WP_AGC);
+                    cxgl.updateAndGet(v -> {
+                        try {
+                            return new Double((double) (v + edosUtil.getRealData(cxglPoint).getPointValueInDouble()));
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        return v;
+                    });
+                    agc.updateAndGet(v -> {
+                        try {
+                            return new Double((double) (v + edosUtil.getRealData(agcPoint).getPointValueInDouble()));
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        return v;
+                    });
+                });
+                powerVo.setCxgl(cxgl.get());
+                powerVo.setAgc(agc.get());
+
+                if (wp.getId().contains("_FDC_")){
+                    jrts.addAndGet(powerVo.getJrts());
+                    djts.addAndGet((int) wpRealdatas.get(0).getPointValueInDouble());
+                    bwts.addAndGet((int) wpRealdatas.get(1).getPointValueInDouble());
+                    gzts.addAndGet((int) wpRealdatas.get(2).getPointValueInDouble());
+                    jxts.addAndGet((int) wpRealdatas.get(3).getPointValueInDouble());
+                    xdts.addAndGet((int) wpRealdatas.get(4).getPointValueInDouble());
+                    slts.addAndGet((int) wpRealdatas.get(5).getPointValueInDouble());
+                    lxts.addAndGet((int) wpRealdatas.get(6).getPointValueInDouble());
+                }else if (wp.getId().contains("_GDC_")) {
+                    gfjrts.addAndGet(powerVo.getJrts());
+                    gfdjts.addAndGet((int) wpRealdatas.get(0).getPointValueInDouble());
+                    gfbwts.addAndGet((int) wpRealdatas.get(1).getPointValueInDouble());
+                    gfgzts.addAndGet((int) wpRealdatas.get(2).getPointValueInDouble());
+                    gfjxts.addAndGet((int) wpRealdatas.get(3).getPointValueInDouble());
+                    gfxdts.addAndGet((int) wpRealdatas.get(4).getPointValueInDouble());
+                    gfslts.addAndGet((int) wpRealdatas.get(5).getPointValueInDouble());
+                    gflxts.addAndGet((int) wpRealdatas.get(6).getPointValueInDouble());
+                }
+                for (int j = 0; j < equipments.size(); j++) {
+                    MatrixVo vo = new MatrixVo();
+                    vo.setWtid(equipments.get(j).getId());
+                    vo.setWtname(equipments.get(j).getAname());
+                    vo.setStatus(wtRealdatas.get(j).getPointValueInDouble());
+
+                    volist.add(vo);
+                }
+                powerVo.setWtlist(volist);
+
+                powerVos.add(powerVo);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+
+        });
+        Map<String, Object> dataMap = new HashMap<>();
+        dataMap.put("jrts", jrts.doubleValue());
+        dataMap.put("djts", djts.doubleValue());
+        dataMap.put("bwts", bwts.doubleValue());
+        dataMap.put("gzts", gzts.doubleValue());
+        dataMap.put("jxts", jxts.doubleValue());
+        dataMap.put("xdts", xdts.doubleValue());
+        dataMap.put("slts", slts.doubleValue());
+        dataMap.put("lxts", lxts.doubleValue());
+        dataMap.put("gfjrts", gfjrts.doubleValue());
+        dataMap.put("gfdjts", gfdjts.doubleValue());
+        dataMap.put("gfbwts", gfbwts.doubleValue());
+        dataMap.put("gfgzts", gfgzts.doubleValue());
+        dataMap.put("gfjxts", gfjxts.doubleValue());
+        dataMap.put("gfxdts", gfxdts.doubleValue());
+        dataMap.put("gfslts", gfslts.doubleValue());
+        dataMap.put("gflxts", gflxts.doubleValue());
+
+        dataMap.put("powerVos", powerVos);
+        return dataMap;
+
+    }
+
+    public Map<String, Object> single(String wpid) throws Exception {
+        Map<String, Object> resultMap = new HashMap<>();
+        Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
+        Map<String, ProBasicPowerstation> wpmap = CacheContext.wpmap;
+        Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = CacheContext.subwppointmap;
+        List<ProBasicSubStation> subwpls = CacheContext.subwpls;
+        Map<String, ProBasicPowerstationPoint> pointMap = wppointmap.get(wpid);
+        ProBasicPowerstation powerstation = wpmap.get(wpid);
+        List<String> wpPoints = new ArrayList<>();
+
+        wpPoints.add(pointMap.get(ContantXk.DJTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.SDTJTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.XNTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.QXJCLTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.GZTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.CNSLGZTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.JXTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.CNSLJXTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.XDTJTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.XDJCLTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.CWSLDWTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.CWSLTQTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.LXTSMX).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.TXZDTSMX).getNemCode());
+        if (powerstation.getWindType().equals("-1")) {
+            wpPoints.add(pointMap.get(ContantXk.SSPJFS).getNemCode());
+        } else if (powerstation.getWindType().equals("-2")) {
+            wpPoints.add(pointMap.get(ContantXk.SSPJGZD).getNemCode());
+        }
+        wpPoints.add(pointMap.get(ContantXk.SSZBZGL).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.SSZNHGLZS).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.SSZGL).getNemCode());
+        wpPoints.add(pointMap.get(ContantXk.ZYCGL).getNemCode());
+
+        List<PointData> realData = edosUtil.getRealData(wpPoints);
+        resultMap.put("jrts",powerstation.getJrquantityJz()+powerstation.getJrquantityJz()+powerstation.getJrwindQuantityLd()+powerstation.getJrwindQuantityHs());
+        resultMap.put("dfts",realData.get(0).getPointValueInDouble());
+        resultMap.put("sdtjts",realData.get(1).getPointValueInDouble());
+        resultMap.put("djts",realData.get(0).getPointValueInDouble()+realData.get(1).getPointValueInDouble());
+
+        resultMap.put("zcyxts",realData.get(2).getPointValueInDouble());
+        resultMap.put("jclyxts",realData.get(3).getPointValueInDouble());
+        resultMap.put("bwts",realData.get(2).getPointValueInDouble()+realData.get(3).getPointValueInDouble());
+
+        resultMap.put("gztjts",realData.get(4).getPointValueInDouble());
+        resultMap.put("gzslts",realData.get(5).getPointValueInDouble());
+        resultMap.put("gzts",realData.get(4).getPointValueInDouble()+realData.get(5).getPointValueInDouble());
+
+        resultMap.put("jxtjts",realData.get(6).getPointValueInDouble());
+        resultMap.put("jxslts",realData.get(7).getPointValueInDouble());
+        resultMap.put("jxts",realData.get(6).getPointValueInDouble()+realData.get(7).getPointValueInDouble());
+
+        resultMap.put("xdtjts",realData.get(8).getPointValueInDouble());
+        resultMap.put("xdjclts",realData.get(9).getPointValueInDouble());
+        resultMap.put("xdts",realData.get(8).getPointValueInDouble()+realData.get(9).getPointValueInDouble());
+
+        resultMap.put("dwslts",realData.get(10).getPointValueInDouble());
+        resultMap.put("hjslts",realData.get(11).getPointValueInDouble());
+        resultMap.put("slts",realData.get(10).getPointValueInDouble()+realData.get(11).getPointValueInDouble());
+
+        resultMap.put("lxts",realData.get(12).getPointValueInDouble());
+        resultMap.put("wzts",realData.get(13).getPointValueInDouble());
+        resultMap.put("lxzts",realData.get(12).getPointValueInDouble()+realData.get(13).getPointValueInDouble());
+
+        resultMap.put("speed",realData.get(14).getPointValueInDouble());
+        resultMap.put("bzgl",realData.get(15).getPointValueInDouble());
+        resultMap.put("llgl",realData.get(16).getPointValueInDouble());
+        resultMap.put("sjgl",realData.get(17).getPointValueInDouble());
+        resultMap.put("ycgl",realData.get(18).getPointValueInDouble());
+        AtomicReference<Double> cxgl = new AtomicReference<>((double) 0);
+        AtomicReference<Double> agc = new AtomicReference<>((double) 0);
+        List<ProBasicSubStation> subStations = subwpls.stream().filter(sub -> sub.getWindpowerstationId().equals(powerstation.getId())).collect(Collectors.toList());
+        subStations.stream().forEach(sub->{
+            Map<String, ProBasicPowerstationPoint> powerstationPointMap = subwppointmap.get(sub.getId());
+            ProBasicPowerstationPoint cxglPoint = powerstationPointMap.get(ContantXk.TPOINT_WP_CXGL);
+
+            ProBasicPowerstationPoint agcPoint = powerstationPointMap.get(ContantXk.TPOINT_WP_AGC);
+            cxgl.updateAndGet(v -> {
+                try {
+                    return new Double((double) (v + edosUtil.getRealData(cxglPoint).getPointValueInDouble()));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                return v;
+            });
+            agc.updateAndGet(v -> {
+                try {
+                    return new Double((double) (v + edosUtil.getRealData(agcPoint).getPointValueInDouble()));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                return v;
+            });
+        });
+        resultMap.put("cxgl",cxgl.get());
+        resultMap.put("agc",agc.get());
+
+        //期次
+        Map<String, List<ProBasicProject>> wppromap = CacheContext.wppromap;
+        List<ProBasicProject> projects = wppromap.get(wpid);
+        Map<String, Map<String, ProBasicPowerstationPoint>> propointmap = CacheContext.propointmap;
+        Map<String,Object> proMap = new HashMap<>();
+        projects.stream().forEach(p->{
+            List<String> procodes = new ArrayList<>();
+            Map<String, ProBasicPowerstationPoint> powerstationPointMap = propointmap.get(p.getId());
+            procodes.add(powerstationPointMap.get(ContantXk.DJTS).getNemCode());
+            procodes.add(powerstationPointMap.get(ContantXk.YXTS).getNemCode());
+            procodes.add(powerstationPointMap.get(ContantXk.GZTJTS).getNemCode());
+            procodes.add(powerstationPointMap.get(ContantXk.JXTJTS).getNemCode());
+            procodes.add(powerstationPointMap.get(ContantXk.XDTS).getNemCode());
+            procodes.add(powerstationPointMap.get(ContantXk.SLTS).getNemCode());
+            procodes.add(powerstationPointMap.get(ContantXk.TXZDTS).getNemCode());
+            if (powerstation.getWindType().equals("-1")){
+                procodes.add(powerstationPointMap.get(ContantXk.SSPJFS).getNemCode());
+            }else if (powerstation.getWindType().equals("-2")){
+                procodes.add(powerstationPointMap.get(ContantXk.SSPJGZD).getNemCode());
+            }
+            procodes.add(powerstationPointMap.get(ContantXk.SSZBZGL).getNemCode());
+            procodes.add(powerstationPointMap.get(ContantXk.SSZNHGLZS).getNemCode());
+            procodes.add(powerstationPointMap.get(ContantXk.SSZGL).getNemCode());
+            List<PointData> prodatas = null;
+            try {
+                prodatas = edosUtil.getRealData(procodes);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            if (StringUtils.isNotEmpty(prodatas)){
+                proMap.put("djts",prodatas.get(0).getPointValueInDouble());
+                proMap.put("bwts",prodatas.get(1).getPointValueInDouble());
+                proMap.put("gzts",prodatas.get(2).getPointValueInDouble());
+                proMap.put("jxts",prodatas.get(3).getPointValueInDouble());
+                proMap.put("xdts",prodatas.get(4).getPointValueInDouble());
+                proMap.put("slts",prodatas.get(5).getPointValueInDouble());
+                proMap.put("lxts",prodatas.get(6).getPointValueInDouble());
+                proMap.put("speed",prodatas.get(7).getPointValueInDouble());
+                proMap.put("bzgl",prodatas.get(8).getPointValueInDouble());
+                proMap.put("llgl",prodatas.get(9).getPointValueInDouble());
+                proMap.put("sjgl",prodatas.get(10).getPointValueInDouble());
+            }
+            //线路
+            Map<String, List<ProBasicLine>> prolinemap = CacheContext.prolinemap;
+            Map<String, List<ProBasicEquipment>> lnwtmap = CacheContext.lnwtmap;
+            Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+            Map<String, Double> modelpower = CacheContext.modelpower;
+            List<ProBasicLine> lines = prolinemap.get(p.getId());
+            Map<String,Object> lineMap = new HashMap<>();
+            lines.stream().forEach(line->{
+                List<ProBasicEquipment> equipments = lnwtmap.get(line.getId());
+                List<String> wtPoints = new ArrayList<>();
+                equipments.stream().forEach(wt->{
+                    Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
+                    wtPoints.add(equipmentPointMap.get(ContantXk.MXZT).getNemCode());
+                    wtPoints.add(equipmentPointMap.get(ContantXk.CJ_SSGL).getNemCode());
+                    if (wt.getEquipmentCategory() == -1) {
+                        wtPoints.add(equipmentPointMap.get(ContantXk.CJ_SSFS).getNemCode());
+                        wtPoints.add(equipmentPointMap.get(ContantXk.CJ_SSZS).getNemCode());
+                    } else if (wt.getEquipmentCategory() == -2) {
+                        wtPoints.add(equipmentPointMap.get(ContantXk.JLDL).getNemCode());
+                        wtPoints.add(equipmentPointMap.get(ContantXk.JLDY).getNemCode());
+                    }
+                    wtPoints.add(equipmentPointMap.get(ContantXk.SSQFZT).getNemCode());
+                    wtPoints.add(equipmentPointMap.get(ContantXk.RQFDL).getNemCode());
+                });
+                List<PointData> wtRealdatas = null;
+                try {
+                    wtRealdatas = edosUtil.getRealData(wtPoints);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                List<MatrixVo> volist = new ArrayList<>();
+                if (StringUtils.isNotEmpty(wtRealdatas)){
+                    int index = 6;
+                    for (int j = 0; j < equipments.size(); j++) {
+                        MatrixVo vo = new MatrixVo();
+                        vo.setWtid(equipments.get(j).getId());
+                        vo.setWtname(equipments.get(j).getAname());
+                        vo.setStatus(wtRealdatas.get(j * index).getPointValueInDouble());
+                        vo.setPower(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 1).getPointValueInDouble(), 2));
+
+                        if (equipments.get(j).getEquipmentCategory() == -1) {
+                            vo.setSpeed(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 2).getPointValueInDouble(), 2));
+                            vo.setTransfer(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 3).getPointValueInDouble(), 2));
+                        } else if (equipments.get(j).getEquipmentCategory() == -2) {
+                            vo.setCurrent(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 2).getPointValueInDouble(), 2));
+                            vo.setVoltage(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 3).getPointValueInDouble(), 2));
+                        }
+                        vo.setSsqfzt(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 4).getPointValueInDouble(), 2));
+                        vo.setQfdl(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 5).getPointValueInDouble(), 2));
+                        vo.setRate(DoubleUtils.keepPrecision(vo.getPower() / modelpower.get(equipments.get(j).getId()) * 100, 2));
+                        volist.add(vo);
+                    }
+                }
+                lineMap.put("lineInfo",line.getAname());
+                lineMap.put("wtDatas",volist);
+            });
+            proMap.put("lineData",lineMap);
+            proMap.put("proInfo",p.getAname());
+        });
+        resultMap.put("proDatas",proMap);
+
+        return resultMap;
+    }
+}

+ 194 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/StationMonitorService.java

@@ -0,0 +1,194 @@
+package com.gyee.runeconomy.service.monitor;/*
+@author   谢生杰
+@date   2023/4/12-8:59
+*/
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.util.DateUtils;
+import com.gyee.runeconomy.init.CacheContext;
+import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
+import com.gyee.runeconomy.model.auto.ProBasicPowerstationPoint;
+import com.gyee.runeconomy.model.auto.ProEconPowerstationInfoDay1;
+import com.gyee.runeconomy.service.auto.IProEconPowerstationInfoDay1Service;
+import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class StationMonitorService {
+    @Resource
+    private IEdosUtil edosUtil;
+    @Resource
+    private IProEconPowerstationInfoDay1Service proEconPowerstationInfoDay1Service;
+
+    public Map<String,Object> caldata(String wpid) throws Exception {
+        Map<String,Object> resultMap = new HashMap<>();
+        Map<String, ProBasicPowerstation> wpmap = CacheContext.wpmap;
+        Map<String, ProBasicPowerstationPoint> powerstationPointMap = CacheContext.wppointmap.get(wpid);
+        ProBasicPowerstation proBasicPowerstation = wpmap.get(wpid);
+        resultMap.put("jrts",proBasicPowerstation.getJrquantityJz()+proBasicPowerstation.getJrquantityZc()+proBasicPowerstation.getJrwindQuantityHs()+proBasicPowerstation.getJrwindQuantityLd());
+        List<String> points = new ArrayList<>();
+        points.add(powerstationPointMap.get(ContantXk.DJTS).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.DJTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.SDTJTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YXTS).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.XNTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.QXJCLTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.GZTJTS).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.GZTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.CNSLGZTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.JXTJTS).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.JXTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.CNSLJXTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.XDTS).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.XDTJTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.XDJCLTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.SLTS).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.CWSLDWTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.CWSLTQTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.TXZDTS).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.LXTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.TXZDTSMX).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.RFDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YFDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NFDL).getNemCode());
+        if (proBasicPowerstation.getWindType().equals("-1")){
+            points.add(powerstationPointMap.get(ContantXk.SSPJFS).getNemCode());
+            resultMap.put("czlx","风电场");
+            resultMap.put("jrrl",proBasicPowerstation.getJrwindCapacity());
+            resultMap.put("zzjrl",proBasicPowerstation.getWindCapacity());
+        }else {
+            points.add(powerstationPointMap.get(ContantXk.SSPJGZD).getNemCode());
+            resultMap.put("czlx","光电场");
+            resultMap.put("jrrl",proBasicPowerstation.getJrCapacity());
+            resultMap.put("zzjrl",proBasicPowerstation.getCapacity());
+        }
+        points.add(powerstationPointMap.get(ContantXk.SSZGL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YLYXS).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NLYXS).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.FNLYL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.SBKLYL).getNemCode());
+
+        points.add(powerstationPointMap.get(ContantXk.RGZSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.RCNSLGZSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.RJXSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.RCNSLJXSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.RDJSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.RQXJCLSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.RSDTJSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.RXNSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.RXDTJSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.RXDJCLSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.RCWSLDWSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.RCWSLTQSSDL).getNemCode());
+
+        points.add(powerstationPointMap.get(ContantXk.YGZSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YCNSLGZSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YJXSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YCNSLJXSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YDJSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YQXJCLSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YSDTJSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YXNSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YXDTJSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YXDJCLSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YCWSLDWSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.YCWSLTQSSDL).getNemCode());
+
+        points.add(powerstationPointMap.get(ContantXk.NGZSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NCNSLGZSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NJXSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NCNSLJXSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NDJSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NQXJCLSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NSDTJSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NXNSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NXDTJSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NXDJCLSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NCWSLDWSSDL).getNemCode());
+        points.add(powerstationPointMap.get(ContantXk.NCWSLTQSSDL).getNemCode());
+
+        points.add(powerstationPointMap.get(ContantXk.AQTS).getNemCode());
+
+        List<PointData> realData = edosUtil.getRealData(points);
+        resultMap.put("djts",realData.get(0).getPointValueInDouble());
+        resultMap.put("dfts",realData.get(1).getPointValueInDouble());
+        resultMap.put("sdtjts",realData.get(2).getPointValueInDouble());
+        resultMap.put("bwts",realData.get(3).getPointValueInDouble());
+        resultMap.put("fdts",realData.get(4).getPointValueInDouble());
+        resultMap.put("jclts",realData.get(5).getPointValueInDouble());
+        resultMap.put("gzts",realData.get(6).getPointValueInDouble());
+        resultMap.put("gztjts",realData.get(7).getPointValueInDouble());
+        resultMap.put("gzslts",realData.get(8).getPointValueInDouble());
+        resultMap.put("jxts",realData.get(9).getPointValueInDouble());
+        resultMap.put("jxtjts",realData.get(10).getPointValueInDouble());
+        resultMap.put("jxslts",realData.get(11).getPointValueInDouble());
+        resultMap.put("xdts",realData.get(12).getPointValueInDouble());
+        resultMap.put("xdtjts",realData.get(13).getPointValueInDouble());
+        resultMap.put("xdjclts",realData.get(14).getPointValueInDouble());
+        resultMap.put("slts",realData.get(15).getPointValueInDouble());
+        resultMap.put("sldwts",realData.get(16).getPointValueInDouble());
+        resultMap.put("slhjts",realData.get(17).getPointValueInDouble());
+        resultMap.put("lxts",realData.get(18).getPointValueInDouble());
+        resultMap.put("zclxts",realData.get(19).getPointValueInDouble());
+        resultMap.put("wzlxts",realData.get(20).getPointValueInDouble());
+        resultMap.put("rfdl",realData.get(21).getPointValueInDouble());
+        resultMap.put("yfdl",realData.get(22).getPointValueInDouble());
+        resultMap.put("nfdl",realData.get(23).getPointValueInDouble());
+        resultMap.put("sspjfsgzd",realData.get(24).getPointValueInDouble());
+        resultMap.put("yggl",realData.get(25).getPointValueInDouble());
+        resultMap.put("fhl",(proBasicPowerstation.getJrwindCapacity()+proBasicPowerstation.getJrCapacity())!=0?realData.get(25).getPointValueInDouble()/(proBasicPowerstation.getJrwindCapacity()+proBasicPowerstation.getJrCapacity()):0);
+        resultMap.put("ylyxs",realData.get(26).getPointValueInDouble());
+        resultMap.put("nlyxs",realData.get(27).getPointValueInDouble());
+        resultMap.put("yfgnlyl",realData.get(28).getPointValueInDouble());
+        resultMap.put("ysbklyl",realData.get(29).getPointValueInDouble());
+        resultMap.put("rgzssdl",realData.get(30).getPointValueInDouble()+realData.get(31).getPointValueInDouble());
+        resultMap.put("rwhssdl",realData.get(32).getPointValueInDouble()+realData.get(33).getPointValueInDouble());
+        resultMap.put("rxnssdl",realData.get(34).getPointValueInDouble()+realData.get(35).getPointValueInDouble()+realData.get(36).getPointValueInDouble()+realData.get(37).getPointValueInDouble());
+        resultMap.put("rxdssdl",realData.get(38).getPointValueInDouble()+realData.get(39).getPointValueInDouble());
+        resultMap.put("rslssdl",realData.get(40).getPointValueInDouble()+realData.get(41).getPointValueInDouble());
+
+        resultMap.put("ygzssdl",realData.get(42).getPointValueInDouble()+realData.get(43).getPointValueInDouble());
+        resultMap.put("ywhssdl",realData.get(44).getPointValueInDouble()+realData.get(45).getPointValueInDouble());
+        resultMap.put("yxnssdl",realData.get(46).getPointValueInDouble()+realData.get(47).getPointValueInDouble()+realData.get(48).getPointValueInDouble()+realData.get(49).getPointValueInDouble());
+        resultMap.put("yxdssdl",realData.get(50).getPointValueInDouble()+realData.get(51).getPointValueInDouble());
+        resultMap.put("yslssdl",realData.get(52).getPointValueInDouble()+realData.get(53).getPointValueInDouble());
+
+        resultMap.put("ngzssdl",realData.get(54).getPointValueInDouble()+realData.get(55).getPointValueInDouble());
+        resultMap.put("nwhssdl",realData.get(56).getPointValueInDouble()+realData.get(57).getPointValueInDouble());
+        resultMap.put("nxnssdl",realData.get(58).getPointValueInDouble()+realData.get(59).getPointValueInDouble()+realData.get(60).getPointValueInDouble()+realData.get(61).getPointValueInDouble());
+        resultMap.put("nxdssdl",realData.get(62).getPointValueInDouble()+realData.get(63).getPointValueInDouble());
+        resultMap.put("nslssdl",realData.get(64).getPointValueInDouble()+realData.get(65).getPointValueInDouble());
+
+        resultMap.put("aqts",realData.get(66).getPointValueInDouble());
+        resultMap.put("czmc",proBasicPowerstation.getAname());
+        resultMap.put("czlx",proBasicPowerstation.getModel());
+        resultMap.put("hzrl",proBasicPowerstation.getAppCapacity());
+        resultMap.put("zjrl",proBasicPowerstation.getConCapacity());
+        resultMap.put("bwrl",proBasicPowerstation.getGridCapacity());
+        resultMap.put("dzrl",proBasicPowerstation.getHoiCapacity());
+        resultMap.put("jwd",proBasicPowerstation.getLongitude()+","+proBasicPowerstation.getLatitude());
+        resultMap.put("spbwsj",proBasicPowerstation.getFirstGridTime());
+        resultMap.put("zctysj",proBasicPowerstation.getWholeGridTime());
+        resultMap.put("cftsl",proBasicPowerstation.getAnemoNumber());
+        resultMap.put("syzsl",proBasicPowerstation.getStationNumber());
+        resultMap.put("czwz",proBasicPowerstation.getAddress());
+        return resultMap;
+    }
+
+    public List<ProEconPowerstationInfoDay1> hisdata(String wpid) {
+
+        QueryWrapper<ProEconPowerstationInfoDay1> qw = new QueryWrapper<>();
+        qw.lambda().le(ProEconPowerstationInfoDay1::getRecordDate, DateUtils.today()).ge(ProEconPowerstationInfoDay1::getRecordDate, DateUtils.getMonthFirst(DateUtils.today()));
+        qw.lambda().eq(ProEconPowerstationInfoDay1::getForeignKeyId,wpid);
+        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.list(qw);
+        return list;
+    }
+}

+ 193 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/StatusService.java

@@ -0,0 +1,193 @@
+package com.gyee.runeconomy.service.monitor;/*
+@author   谢生杰
+@date   2023/4/4-9:53
+*/
+
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.vo.monitor.StatusVo;
+import com.gyee.runeconomy.init.CacheContext;
+import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
+import com.gyee.runeconomy.model.auto.ProBasicPowerstationPoint;
+import com.gyee.runeconomy.model.auto.ProBasicSubStation;
+import com.gyee.runeconomy.model.auto.ProBasicWeatherStation;
+import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+
+@Service
+public class StatusService {
+    @Resource
+    private IEdosUtil edosUtil;
+
+
+    public List<StatusVo> monitor(String company, String type) {
+        List<StatusVo> resultList = new ArrayList<>();
+        List<ProBasicPowerstation> wpls = CacheContext.wpls;
+        List<ProBasicSubStation> subwpls = CacheContext.subwpls;
+        List<ProBasicWeatherStation> weawpls = CacheContext.weawpls;
+        Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = CacheContext.subwppointmap;
+        Map<String, Map<String, ProBasicPowerstationPoint>> weatherwppointmap = CacheContext.weatherwppointmap;
+
+        Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
+        if (company.endsWith("ZGS")) {
+            wpls = wpls.stream().filter(wp -> wp.getCompanyId().equals(company)).collect(Collectors.toList());
+        }
+        if (type.equals("-1")) {
+            wpls = wpls.stream().filter(wp -> wp.getWindType().equals("-1")).collect(Collectors.toList());
+        } else if (type.equals("-2")) {
+            wpls = wpls.stream().filter(wp -> wp.getWindType().equals("-2")).collect(Collectors.toList());
+        }
+
+        wpls.stream().forEach(wp->{
+            StatusVo vo = new StatusVo();
+            vo.setWpname(wp.getAname());
+            vo.setType(wp.getWindType());
+            vo.setJrts(wp.getJrwindQuantityHs() + wp.getJrwindQuantityLd() + wp.getJrquantityJz() + wp.getJrquantityZc());
+            Map<String, ProBasicPowerstationPoint> powerstationPointMap = wppointmap.get(wp.getId());
+            ProBasicPowerstationPoint yxtsPoint = powerstationPointMap.get(ContantXk.YXTS);
+            ProBasicPowerstationPoint djtsPoint = powerstationPointMap.get(ContantXk.DJTS);
+            ProBasicPowerstationPoint gztsPoint = powerstationPointMap.get(ContantXk.GZTJTS);
+            ProBasicPowerstationPoint jxtsPoint = powerstationPointMap.get(ContantXk.JXTJTS);
+            ProBasicPowerstationPoint xdtsPoint = powerstationPointMap.get(ContantXk.XDTS);
+            ProBasicPowerstationPoint sltsPoint = powerstationPointMap.get(ContantXk.SLTS);
+            ProBasicPowerstationPoint lxtsPoint = powerstationPointMap.get(ContantXk.TXZDTS);
+            ProBasicPowerstationPoint swdlPoint = powerstationPointMap.get(ContantXk.RSWDL);
+            ProBasicPowerstationPoint agcPoint = powerstationPointMap.get(ContantXk.AGCJRZT);
+            ProBasicPowerstationPoint fjPoint = powerstationPointMap.get(ContantXk.SBJRZT);
+            ProBasicPowerstationPoint djlPoint = powerstationPointMap.get(ContantXk.DQJRZT);
+            ProBasicPowerstationPoint glPoint = powerstationPointMap.get(ContantXk.GLYCJRZT);
+            ProBasicPowerstationPoint qxzPoint = powerstationPointMap.get(ContantXk.QXZJRZT);
+            ProBasicPowerstationPoint czPoint = powerstationPointMap.get(ContantXk.CZZT);
+            double yxts = 0;
+            double djts = 0;
+            double gzts = 0;
+            double jxts = 0;
+            double xdts = 0;
+            double slts = 0;
+            double lxts = 0;
+            double swdl = 0;
+            double agc = 0;
+            double fj = 0;
+            double djl = 0;
+            double gl = 0;
+            double qxz = 0;
+            double qc = 0;
+
+            AtomicReference<Double> agc001 = new AtomicReference<>((double) 0);
+            AtomicReference<Double> agc002 = new AtomicReference<>((double) 0);
+            AtomicReference<Double> ycgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> fs = new AtomicReference<>((double) 0);
+            AtomicReference<Double> fx = new AtomicReference<>((double) 0);
+            try {
+                yxts = edosUtil.getRealData(yxtsPoint).getPointValueInDouble();
+                djts = edosUtil.getRealData(djtsPoint).getPointValueInDouble();
+                gzts = edosUtil.getRealData(gztsPoint).getPointValueInDouble();
+                jxts = edosUtil.getRealData(jxtsPoint).getPointValueInDouble();
+                xdts = edosUtil.getRealData(xdtsPoint).getPointValueInDouble();
+                slts = edosUtil.getRealData(sltsPoint).getPointValueInDouble();
+                lxts = edosUtil.getRealData(lxtsPoint).getPointValueInDouble();
+                swdl = edosUtil.getRealData(swdlPoint).getPointValueInDouble();
+                agc = edosUtil.getRealData(agcPoint).getPointValueInDouble();
+                fj = edosUtil.getRealData(fjPoint).getPointValueInDouble();
+                djl = edosUtil.getRealData(djlPoint).getPointValueInDouble();
+                gl = edosUtil.getRealData(glPoint).getPointValueInDouble();
+                qxz = edosUtil.getRealData(qxzPoint).getPointValueInDouble();
+                qc = edosUtil.getRealData(czPoint).getPointValueInDouble();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            vo.setYxts(yxts);
+            vo.setDjts(djts);
+            vo.setGzts(gzts);
+            vo.setJxts(jxts);
+            vo.setXdts(xdts);
+            vo.setSlts(slts);
+            vo.setLxts(lxts);
+            vo.setSwdl(swdl);
+            vo.setAgcjrzt(agc);
+            vo.setDjljrzt(djl);
+            vo.setFjjrzt(fj);
+            vo.setFggljrzt(gl);
+            vo.setQxzjrzt(qxz);
+            vo.setQcjrzt(qc);
+            List<ProBasicSubStation> subs = subwpls.stream().filter(sub -> sub.getWindpowerstationId().equals(wp.getId())).collect(Collectors.toList());
+            subs.stream().forEach(sub->{
+                Map<String, ProBasicPowerstationPoint> pointMap = subwppointmap.get(sub.getId());
+                ProBasicPowerstationPoint agc002Point = pointMap.get(ContantXk.TPOINT_WP_AGC);
+                ProBasicPowerstationPoint agc001Point = pointMap.get(ContantXk.TPOINT_WP_CXGL);
+                ProBasicPowerstationPoint ycglPoint = pointMap.get(ContantXk.TPOINT_WP_YCGL);
+                agc001.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getRealData(agc001Point).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                agc002.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getRealData(agc002Point).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                ycgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getRealData(ycglPoint).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+
+            });
+            vo.setAgc001(agc001.get()/subs.size());
+            vo.setAgc002(agc002.get()/subs.size());
+            vo.setYcgl(ycgl.get());
+            List<ProBasicWeatherStation> weas = weawpls.stream().filter(wea -> wea.getWindpowerstationId().equals(wp.getId())).collect(Collectors.toList());
+            weas.stream().forEach(wea->{
+                Map<String, ProBasicPowerstationPoint> pointMap = weatherwppointmap.get(wea.getId());
+                ProBasicPowerstationPoint fsPoint = null;
+                ProBasicPowerstationPoint fxPoint = null;
+                if (wp.getWindType().equals("-1")){
+                    fsPoint = pointMap.get(ContantXk.FCCFTFS10);
+                    fxPoint = pointMap.get(ContantXk.FCCFTFX10);
+                }else if (wp.getWindType().equals("-2")){
+                    fsPoint = pointMap.get(ContantXk.QXZFS);
+                    fxPoint = pointMap.get(ContantXk.QXZFX);
+                }
+                ProBasicPowerstationPoint finalFsPoint = fsPoint;
+                fs.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getRealData(finalFsPoint).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                ProBasicPowerstationPoint finalFxPoint = fxPoint;
+                fx.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getRealData(finalFxPoint).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+
+            });
+            vo.setQxzfs(fs.get());
+            vo.setQxzfx(fx.get());
+            resultList.add(vo);
+        });
+
+        return resultList;
+    }
+}

+ 2 - 2
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/specific/SpecificService.java

@@ -2818,7 +2818,7 @@ public class SpecificService {
             }
             vo.setYear(DateUtils.getYear(i.getRecordDate()));
             vo.setMonth(DateUtils.getMonth(i.getRecordDate()));
-            vo.setCurrent(DoubleUtils.keepPrecision(i.getYxtxlpr().doubleValue(),2));
+            vo.setCurrent(DoubleUtils.keepPrecision(i.getYlsl().doubleValue(),2));
             resultList.add(vo);
         });
         resultList.stream().forEach(i->{
@@ -2964,7 +2964,7 @@ public class SpecificService {
             }
             vo.setYear(DateUtils.getYear(i.getRecordDate()));
             vo.setMonth(DateUtils.getMonth(i.getRecordDate()));
-            vo.setCurrent(DoubleUtils.keepPrecision(i.getYxtxlpr().doubleValue(),2));
+            vo.setCurrent(DoubleUtils.keepPrecision(i.getYnbqzhxl().doubleValue(),2));
             resultList.add(vo);
         });
         resultList.stream().forEach(i->{