xieshengjie il y a 3 ans
Parent
commit
3e13104dc2
20 fichiers modifiés avec 613 ajouts et 305 suppressions
  1. 21 0
      common/src/main/java/com/gyee/common/contant/Contant.java
  2. 16 14
      web/monitor-web/src/main/java/com/gyee/monitor/contant/MatrixContant.java
  3. 20 0
      web/monitor-web/src/main/java/com/gyee/monitor/controller/auto/WindpowerstationpointnewController.java
  4. 20 0
      web/monitor-web/src/main/java/com/gyee/monitor/controller/auto/WindturbinetestingpointnewController.java
  5. 1 1
      web/monitor-web/src/main/java/com/gyee/monitor/controller/matrix/MatrixController.java
  6. 10 13
      web/monitor-web/src/main/java/com/gyee/monitor/init/CacheContext.java
  7. 16 0
      web/monitor-web/src/main/java/com/gyee/monitor/mapper/auto/WindpowerstationpointnewMapper.java
  8. 16 0
      web/monitor-web/src/main/java/com/gyee/monitor/mapper/auto/WindturbinetestingpointnewMapper.java
  9. 78 0
      web/monitor-web/src/main/java/com/gyee/monitor/model/auto/Windpowerstationpointnew.java
  10. 81 0
      web/monitor-web/src/main/java/com/gyee/monitor/model/auto/Windturbinetestingpointnew.java
  11. 16 0
      web/monitor-web/src/main/java/com/gyee/monitor/service/auto/IWindpowerstationpointnewService.java
  12. 16 0
      web/monitor-web/src/main/java/com/gyee/monitor/service/auto/IWindturbinetestingpointnewService.java
  13. 20 0
      web/monitor-web/src/main/java/com/gyee/monitor/service/auto/impl/WindpowerstationpointnewServiceImpl.java
  14. 20 0
      web/monitor-web/src/main/java/com/gyee/monitor/service/auto/impl/WindturbinetestingpointnewServiceImpl.java
  15. 51 78
      web/monitor-web/src/main/java/com/gyee/monitor/service/matrix/MatrixService.java
  16. 186 181
      web/monitor-web/src/main/java/com/gyee/monitor/util/realtimesource/EdosUtil.java
  17. 17 16
      web/monitor-web/src/main/java/com/gyee/monitor/util/realtimesource/IEdosUtil.java
  18. 4 0
      web/monitor-web/src/main/resources/application-dev.yml
  19. 2 0
      web/monitor-web/src/main/resources/application-test.yml
  20. 2 2
      web/monitor-web/src/main/resources/application.yml

+ 21 - 0
common/src/main/java/com/gyee/common/contant/Contant.java

@@ -34,4 +34,25 @@ public class Contant {
     public static String CYDLB="CYDLB";//场用电量
     public static String CYDLY="CYDLY";//月场用电量
     public static String CYDLN="CYDLN";//年场用电量
+
+
+    public static final String TPOINT_WP_XDTS = "XDTS";// 限电台数
+    public static final String TPOINT_WP_YXTS = "YXTS";// 运行台数
+    public static final String TPOINT_WP_DJTS = "DJTS"; // 待机台数
+    public static final String TPOINT_WP_WHTJ = "WHTJ";// 维护台数
+    public static final String TPOINT_WP_GZTJ = "GZTJ";// 故障台数
+    public static final String TPOINT_WP_TXZD = "TXZD";// 离线台数
+    public static final String TPOINT_WP_DWSLTS = "DWSLNUM";// 受累台数
+    public static final String TPOINT_WP_HJSLTS = "HJSLNUM";// 受累台数
+    public static final String TPOINT_WT_YCGL = "FCFGCDQ0001";// 预测功率
+    public static final String TPOINT_WP_BZGL = "ZBZGL";// 保证功率
+    public static final String TPOINT_WP_YFGL = "ZZSGL";// 应发功率
+    public static final String TPOINT_WP_SJGL = "SSZGL";// 实际功率
+    public static final String TPOINT_WP_AGC = "AGC002";// agc
+    public static final String TPOINT_WP_CXGL = "AGC001";// 出线功率
+
+    public static final String TPOINT_WP_MATRIX = "XDTS,YXTS,DJTS,WHTJ,GZTJ,TXZD,DWSLNUM,HJSLNUM,FCFGCDQ0001,ZBZGL,ZZSGL,SSZGL,AGC002,AGC001";
+
+
+    public static final String TPOINT_WT_FJZT = "FJZT" ;
 }

+ 16 - 14
web/monitor-web/src/main/java/com/gyee/monitor/contant/MatrixContant.java

@@ -8,21 +8,23 @@ package com.gyee.monitor.contant;
  */
 public class MatrixContant {
 
-    public static final String TPOINT_WT_XDTS = "XDTS";// 限电台数
-    public static final String TPOINT_WT_YXTS = "YXTS";// 运行台数
-    public static final String TPOINT_WT_DJTS = "DJTS"; // 待机台数
-    public static final String TPOINT_WT_WHTJ = "WHTJ";// 维护台数
-    public static final String TPOINT_WT_GZTJ = "GZTJ";// 故障台数
-    public static final String TPOINT_WT_TXZD = "TXZD";// 离线台数
-//    public static final String TPOINT_WT_SLTS = "SLTS";// 受累台数
-//    public static final String TPOINT_WT_YCGL = "YCGL";// 受累台数
-    public static final String TPOINT_WT_BZGL = "ZBZGL";// 受累台数
-    public static final String TPOINT_WT_YFGL = "ZZSGL";// 受累台数
-    public static final String TPOINT_WT_SJGL = "SSZGL";// 受累台数
-    public static final String TPOINT_WT_AGC = "AGC002";// 受累台数
-    public static final String TPOINT_WT_CXGL = "AGC001";// 受累台数
+    public static final String TPOINT_WP_XDTS = "XDTS";// 限电台数
+    public static final String TPOINT_WP_YXTS = "YXTS";// 运行台数
+    public static final String TPOINT_WP_DJTS = "DJTS"; // 待机台数
+    public static final String TPOINT_WP_WHTJ = "WHTJ";// 维护台数
+    public static final String TPOINT_WP_GZTJ = "GZTJ";// 故障台数
+    public static final String TPOINT_WP_TXZD = "TXZD";// 离线台数
+    public static final String TPOINT_WP_DWSLTS = "DWSLNUM";// 受累台数
+    public static final String TPOINT_WP_HJSLTS = "HJSLNUM";// 受累台数
+    public static final String TPOINT_WT_YCGL = "FCFGCDQ0001";// 预测功率
+    public static final String TPOINT_WP_BZGL = "ZBZGL";// 保证功率
+    public static final String TPOINT_WP_YFGL = "ZZSGL";// 应发功率
+    public static final String TPOINT_WP_SJGL = "SSZGL";// 实际功率
+    public static final String TPOINT_WP_AGC = "AGC002";// agc
+    public static final String TPOINT_WP_CXGL = "AGC001";// 出线功率
+
+    public static final String TPOINT_WP_MATRIX = "XDTS,YXTS,DJTS,WHTJ,GZTJ,TXZD,DWSLNUM,HJSLNUM,FCFGCDQ0001,ZBZGL,ZZSGL,SSZGL,AGC002,AGC001";
 
-    public static final String TPOINT_WT_MATRIX = "XDTS,YXTS,DJTS,WHTJ,GZTJ,TXZD,ZBZGL,ZZSGL,SSZGL,AGC002,AGC001";
 
     public static final String TPOINT_WT_FJZT = "FJZT" ;
 }

+ 20 - 0
web/monitor-web/src/main/java/com/gyee/monitor/controller/auto/WindpowerstationpointnewController.java

@@ -0,0 +1,20 @@
+package com.gyee.monitor.controller.auto;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-03-15
+ */
+@RestController
+@RequestMapping("//windpowerstationpointnew")
+public class WindpowerstationpointnewController {
+
+}

+ 20 - 0
web/monitor-web/src/main/java/com/gyee/monitor/controller/auto/WindturbinetestingpointnewController.java

@@ -0,0 +1,20 @@
+package com.gyee.monitor.controller.auto;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-03-15
+ */
+@RestController
+@RequestMapping("//windturbinetestingpointnew")
+public class WindturbinetestingpointnewController {
+
+}

+ 1 - 1
web/monitor-web/src/main/java/com/gyee/monitor/controller/matrix/MatrixController.java

@@ -25,7 +25,7 @@ public class MatrixController {
     @CrossOrigin(origins = "*", maxAge = 3600)
     public R matrixDatas()  {
 
-        Map<String, Object> resultMap = matrixService.matrixDatas();
+        Map<String, Map<String,Double>> resultMap = matrixService.matrixDatas();
         if (StringUtils.isNotNull(resultMap)) {
             return R.ok(resultMap.size()).data(resultMap);
         }else{

+ 10 - 13
web/monitor-web/src/main/java/com/gyee/monitor/init/CacheContext.java

@@ -2,10 +2,7 @@ package com.gyee.monitor.init;
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.TypeReference;
-import com.gyee.monitor.model.auto.Windpowerstation;
-import com.gyee.monitor.model.auto.Windpowerstationtestingpoint;
-import com.gyee.monitor.model.auto.Windturbine;
-import com.gyee.monitor.model.auto.Windturbinetestingpointai;
+import com.gyee.monitor.model.auto.*;
 import com.gyee.monitor.service.auto.IWindpowerstationService;
 import com.gyee.monitor.service.auto.IWindturbineService;
 import com.gyee.monitor.util.redis.RedisService;
@@ -38,23 +35,23 @@ public class CacheContext implements CommandLineRunner {
     @Resource
     private IWindturbineService windturbineService;
 
-    public static Map<String, Map<String, Windturbinetestingpointai>> wtPointmap = new HashMap<>();// 风电机测点AI表
-    public static Map<String, Map<String, Windpowerstationtestingpoint>> wpPointmap = new HashMap<>();//场站测点
-    public static List<Windpowerstation> wpls = new ArrayList<Windpowerstation>(); // 风电场LIST集合
+    public static Map<String, Map<String, Windturbinetestingpointnew>> wtPointmap = new HashMap<>();// 风电机测点AI表
+    public static Map<String, Map<String, Windpowerstationpointnew>> wpPointmap = new HashMap<>();//场站测点
+    public static List<Windpowerstation> wpls = new ArrayList<>(); // 风电场LIST集合
     public static List<Windturbine> wtls = new ArrayList<Windturbine>(); // 风电机LIST集合
     @Override
     public void run(String... args) throws Exception {
         log.info("-------------------------------缓存开始--------------------------------------");
-        wpls = windpowerstationService.list().stream().filter(i->!i.getId().equals("SY_FDC")).collect(Collectors.toList());
+        wpls = windpowerstationService.list().stream().collect(Collectors.toList());
 
-        wtls = windturbineService.list().stream().filter(i->!i.getWindpowerstationid().equals("SY_FDC")).collect(Collectors.toList());
+        wtls = windturbineService.list().stream().collect(Collectors.toList());
 
-        String wpString = redisService.get("WP");
-        wpPointmap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Map<String, Windpowerstationtestingpoint>>>() {
+        String wpString = redisService.get("PRODUCT-WP");
+        wpPointmap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
         });
 
-        String wtString = redisService.get("WT");
-        wtPointmap = JSONObject.parseObject(wtString, new TypeReference<Map<String, Map<String, Windturbinetestingpointai>>>() {
+        String wtString = redisService.get("PRODUCT-WT");
+        wtPointmap = JSONObject.parseObject(wtString, new TypeReference<Map<String, Map<String, Windturbinetestingpointnew>>>() {
         });
         log.info("-------------------------------缓存结束--------------------------------------");
     }

+ 16 - 0
web/monitor-web/src/main/java/com/gyee/monitor/mapper/auto/WindpowerstationpointnewMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.monitor.mapper.auto;
+
+import com.gyee.monitor.model.auto.Windpowerstationpointnew;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-03-15
+ */
+public interface WindpowerstationpointnewMapper extends BaseMapper<Windpowerstationpointnew> {
+
+}

+ 16 - 0
web/monitor-web/src/main/java/com/gyee/monitor/mapper/auto/WindturbinetestingpointnewMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.monitor.mapper.auto;
+
+import com.gyee.monitor.model.auto.Windturbinetestingpointnew;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-03-15
+ */
+public interface WindturbinetestingpointnewMapper extends BaseMapper<Windturbinetestingpointnew> {
+
+}

+ 78 - 0
web/monitor-web/src/main/java/com/gyee/monitor/model/auto/Windpowerstationpointnew.java

@@ -0,0 +1,78 @@
+package com.gyee.monitor.model.auto;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-03-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WINDPOWERSTATIONPOINTNEW")
+public class Windpowerstationpointnew extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("ID")
+    private String id;
+
+    @TableField("CODE")
+    private String code;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("MODEL")
+    private String model;
+
+    @TableField("VALUEUNIT")
+    private String valueunit;
+
+    @TableField("ENGLISHNAME")
+    private String englishname;
+
+    @TableField("TYPEID")
+    private String typeid;
+
+    @TableField("MODELID")
+    private String modelid;
+
+    @TableField("MAXVAL")
+    private BigDecimal maxval;
+
+    @TableField("MINVAL")
+    private BigDecimal minval;
+
+    @TableField("REASONABLEMAXVAL")
+    private BigDecimal reasonablemaxval;
+
+    @TableField("REASONABLEMINVAL")
+    private BigDecimal reasonableminval;
+
+    @TableField("UNIFORMCODE")
+    private String uniformcode;
+
+    @TableField("SHORTID")
+    private String shortid;
+
+    @TableField("LONGID")
+    private String longid;
+
+    @TableField("WINDPOWERSTATIONID")
+    private String windpowerstationid;
+
+    @TableField("REALTIMEID")
+    private String realtimeid;
+
+
+}

+ 81 - 0
web/monitor-web/src/main/java/com/gyee/monitor/model/auto/Windturbinetestingpointnew.java

@@ -0,0 +1,81 @@
+package com.gyee.monitor.model.auto;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-03-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WINDTURBINETESTINGPOINTNEW")
+public class Windturbinetestingpointnew extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("ID")
+    private String id;
+
+    @TableField("CODE")
+    private String code;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("MODEL")
+    private String model;
+
+    @TableField("VALUEUNIT")
+    private String valueunit;
+
+    @TableField("ENGLISHNAME")
+    private String englishname;
+
+    @TableField("TYPEID")
+    private String typeid;
+
+    @TableField("MODELID")
+    private String modelid;
+
+    @TableField("MAXVAL")
+    private BigDecimal maxval;
+
+    @TableField("MINVAL")
+    private BigDecimal minval;
+
+    @TableField("REASONABLEMAXVAL")
+    private BigDecimal reasonablemaxval;
+
+    @TableField("REASONABLEMINVAL")
+    private BigDecimal reasonableminval;
+
+    @TableField("WINDTURBINEID")
+    private String windturbineid;
+
+    @TableField("UNIFORMCODE")
+    private String uniformcode;
+
+    @TableField("SHORTID")
+    private String shortid;
+
+    @TableField("LONGID")
+    private String longid;
+
+    @TableField("WINDPOWERSTATIONID")
+    private String windpowerstationid;
+
+    @TableField("REALTIMEID")
+    private String realtimeid;
+
+
+}

+ 16 - 0
web/monitor-web/src/main/java/com/gyee/monitor/service/auto/IWindpowerstationpointnewService.java

@@ -0,0 +1,16 @@
+package com.gyee.monitor.service.auto;
+
+import com.gyee.monitor.model.auto.Windpowerstationpointnew;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-03-15
+ */
+public interface IWindpowerstationpointnewService extends IService<Windpowerstationpointnew> {
+
+}

+ 16 - 0
web/monitor-web/src/main/java/com/gyee/monitor/service/auto/IWindturbinetestingpointnewService.java

@@ -0,0 +1,16 @@
+package com.gyee.monitor.service.auto;
+
+import com.gyee.monitor.model.auto.Windturbinetestingpointnew;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-03-15
+ */
+public interface IWindturbinetestingpointnewService extends IService<Windturbinetestingpointnew> {
+
+}

+ 20 - 0
web/monitor-web/src/main/java/com/gyee/monitor/service/auto/impl/WindpowerstationpointnewServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.monitor.service.auto.impl;
+
+import com.gyee.monitor.model.auto.Windpowerstationpointnew;
+import com.gyee.monitor.mapper.auto.WindpowerstationpointnewMapper;
+import com.gyee.monitor.service.auto.IWindpowerstationpointnewService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-03-15
+ */
+@Service
+public class WindpowerstationpointnewServiceImpl extends ServiceImpl<WindpowerstationpointnewMapper, Windpowerstationpointnew> implements IWindpowerstationpointnewService {
+
+}

+ 20 - 0
web/monitor-web/src/main/java/com/gyee/monitor/service/auto/impl/WindturbinetestingpointnewServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.monitor.service.auto.impl;
+
+import com.gyee.monitor.model.auto.Windturbinetestingpointnew;
+import com.gyee.monitor.mapper.auto.WindturbinetestingpointnewMapper;
+import com.gyee.monitor.service.auto.IWindturbinetestingpointnewService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-03-15
+ */
+@Service
+public class WindturbinetestingpointnewServiceImpl extends ServiceImpl<WindturbinetestingpointnewMapper, Windturbinetestingpointnew> implements IWindturbinetestingpointnewService {
+
+}

+ 51 - 78
web/monitor-web/src/main/java/com/gyee/monitor/service/matrix/MatrixService.java

@@ -1,15 +1,18 @@
 package com.gyee.monitor.service.matrix;
 
-import com.gyee.common.vo.matrix.MatrixVo;
-import com.gyee.monitor.contant.MatrixContant;
+import com.gyee.common.contant.Contant;
+import com.gyee.common.model.PointData;
 import com.gyee.monitor.init.CacheContext;
 import com.gyee.monitor.model.auto.Windpowerstation;
-import com.gyee.monitor.model.auto.Windpowerstationtestingpoint;
-import com.gyee.monitor.model.auto.Windturbinetestingpointai;
-import com.gyee.monitor.util.realtimesource.EdosUtil;
+import com.gyee.monitor.model.auto.Windpowerstationpointnew;
+import com.gyee.monitor.model.auto.Windturbine;
+import com.gyee.monitor.model.auto.Windturbinetestingpointnew;
 import com.gyee.monitor.util.realtimesource.IEdosUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.*;
 
 /**
@@ -21,92 +24,62 @@ import java.util.*;
 @Service
 public class MatrixService {
 
-    private IEdosUtil edosUtil = new EdosUtil();
+    private Log log = LogFactory.getLog(MatrixService.class);
+    @Resource
+    private IEdosUtil edosUtil;
 
 
-    public Map<String,Object> matrixDatas(){
-        Map<String,Object> resultMap = new HashMap<>();
-        List<MatrixVo>  fclist = new ArrayList<>();
-        Map<String, Map<String, Windpowerstationtestingpoint>> wpPointmap = CacheContext.wpPointmap;
-        Map<String, Map<String, Windturbinetestingpointai>> wtPointmap = CacheContext.wtPointmap;
+    public Map<String,Map<String,Double>> matrixDatas()  {
+        Map<String,Map<String,Double>> resultMap = new HashMap<>();
+        Map<String,Double> wpMap = Collections.synchronizedMap(new HashMap<>());
+        Map<String,Double> wtMap = Collections.synchronizedMap(new HashMap<>());
+        Map<String, Map<String, Windpowerstationpointnew>> wpPointmap = CacheContext.wpPointmap;
+        Map<String, Map<String, Windturbinetestingpointnew>> wtPointmap = CacheContext.wtPointmap;
 
         List<Windpowerstation> wpls = CacheContext.wpls;
-        wpls.stream().forEach(wp->{
-            Map<String, Windpowerstationtestingpoint> stringWindpowerstationtestingpointMap = wpPointmap.get(wp.getId());
-            MatrixVo vo = new MatrixVo();
-            vo.setWpid(wp.getId());
-            String yxcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_YXTS).getCode();
-            String djcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_DJTS).getCode();
-            String xdcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_XDTS).getCode();
-            String gzcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_GZTJ).getCode();
-            String whcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_WHTJ).getCode();
-            String lxcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_TXZD).getCode();
-//            String slcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_SLTS).getCode();
-            String bzcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_BZGL).getCode();
-            String yfcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_YFGL).getCode();
-            String sjcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_SJGL).getCode();
-            String agccode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_AGC).getCode();
-            String cxcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_CXGL).getCode();
+        wpls.parallelStream().forEach(wp-> {
+            List<String> pointList = new ArrayList<>();
+            Map<String,String> pointMap = new HashMap<>();
+            Map<String, Windpowerstationpointnew> stringWindpowerstationtestingpointMap = wpPointmap.get(wp.getId());
+            String[] wppoints = Contant.TPOINT_WP_MATRIX.split(",");
+            Arrays.stream(wppoints).forEach(uniformcode -> {
+                Windpowerstationpointnew windpowerstationtestingpoint = stringWindpowerstationtestingpointMap.get(uniformcode);
+                if (!windpowerstationtestingpoint.getCode().trim().equals("INITIAL")){
+                    pointList.add(windpowerstationtestingpoint.getCode());
+                    pointMap.put(windpowerstationtestingpoint.getCode(),wp.getId()+"_"+uniformcode);
+                }
+            });
             try {
-                vo.setYxts((int) edosUtil.getRealData(yxcode).getPointValueInDouble());
-                vo.setGzts((int) edosUtil.getRealData(gzcode).getPointValueInDouble());
-                vo.setWhts((int) edosUtil.getRealData(whcode).getPointValueInDouble());
-                vo.setXdts((int) edosUtil.getRealData(xdcode).getPointValueInDouble());
-//                vo.setSlts((int) edosUtil.getRealData(slcode).getPointValueInDouble());
-                vo.setLxts((int) edosUtil.getRealData(lxcode).getPointValueInDouble());
-                vo.setDjts((int) edosUtil.getRealData(djcode).getPointValueInDouble());
-                vo.setBzgl(edosUtil.getRealData(bzcode).getPointValueInDouble());
-                vo.setYfgl(edosUtil.getRealData(yfcode).getPointValueInDouble());
-                vo.setSjgl(edosUtil.getRealData(sjcode).getPointValueInDouble());
-                vo.setAgc(edosUtil.getRealData(agccode).getPointValueInDouble());
-                vo.setCxgl(edosUtil.getRealData(cxcode).getPointValueInDouble());
-                fclist.add(vo);
+                List<PointData> realData = edosUtil.getRealData(pointList);
+                realData.parallelStream().forEach(i -> {
+                    wpMap.put(pointMap.get(i.getEdnaId()), i.getPointValueInDouble());
+                });
             } catch (Exception e) {
                 e.printStackTrace();
             }
         });
-        Map<String, Windpowerstationtestingpoint> stringWindpowerstationtestingpointMap = wpPointmap.get("0");
-        MatrixVo vo = new MatrixVo();
-        vo.setWpid("-1");
-        String yxcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_YXTS).getCode();
-        String djcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_DJTS).getCode();
-        String xdcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_XDTS).getCode();
-        String gzcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_GZTJ).getCode();
-        String whcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_WHTJ).getCode();
-        String lxcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_TXZD).getCode();
-//        String slcode = stringWindpowerstationtestingpointMap.get(MatrixContant.TPOINT_WT_SLTS).getCode();
-
+        resultMap.put("wp",wpMap);
+        List<Windturbine> wtls = CacheContext.wtls;
+        List<String> synchronizedList = Collections.synchronizedList(new ArrayList<>());
+        Map<String,String> synchronizedMap = Collections.synchronizedMap(new HashMap<>());
+        wtls.parallelStream().forEach(wt->{
+            Windturbinetestingpointnew windturbinetestingpointnew = wtPointmap.get(wt.getId()).get(Contant.TPOINT_WT_FJZT);
+            if (!windturbinetestingpointnew.getCode().trim().equals("INITIAL")){
+                synchronizedList.add(windturbinetestingpointnew.getCode());
+                synchronizedMap.put(windturbinetestingpointnew.getCode(),wt.getId());
+            }else{
+                log.info(windturbinetestingpointnew);
+            }
+        });
         try {
-            vo.setYxts((int) edosUtil.getRealData(yxcode).getPointValueInDouble());
-            vo.setGzts((int) edosUtil.getRealData(gzcode).getPointValueInDouble());
-            vo.setWhts((int) edosUtil.getRealData(whcode).getPointValueInDouble());
-            vo.setXdts((int) edosUtil.getRealData(xdcode).getPointValueInDouble());
-//            vo.setSlts((int) edosUtil.getRealData(slcode).getPointValueInDouble());
-            vo.setLxts((int) edosUtil.getRealData(lxcode).getPointValueInDouble());
-            vo.setDjts((int) edosUtil.getRealData(djcode).getPointValueInDouble());
-
-            fclist.add(vo);
+            List<PointData> realData = edosUtil.getRealData(synchronizedList);
+            realData.parallelStream().forEach(i -> {
+                wtMap.put(synchronizedMap.get(i.getEdnaId()), i.getPointValueInDouble());
+            });
         } catch (Exception e) {
             e.printStackTrace();
         }
-        resultMap.put("wpinfo",fclist);
-
-
-        List<MatrixVo> fjlist = new ArrayList<>();
-        CacheContext.wtls.stream().forEach(wt->{
-            MatrixVo fjvo = new MatrixVo();
-            Map<String, Windturbinetestingpointai> stringWindturbinetestingpointaiMap = wtPointmap.get(wt.getId());
-            Windturbinetestingpointai windturbinetestingpointai = stringWindturbinetestingpointaiMap.get(MatrixContant.TPOINT_WT_FJZT);
-            try {
-                fjvo.setStaus((int) edosUtil.getRealData(windturbinetestingpointai).getPointValueInDouble());
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            fjlist.add(fjvo);
-        });
-
-        resultMap.put("wtinfo",fjlist);
-
+        resultMap.put("wt",wtMap);
         return resultMap;
     }
 }

+ 186 - 181
web/monitor-web/src/main/java/com/gyee/monitor/util/realtimesource/EdosUtil.java

@@ -7,10 +7,11 @@ import com.gyee.common.model.DNAStatVal;
 import com.gyee.common.model.DNAVal;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
-import com.gyee.monitor.model.auto.Windpowerstationtestingpoint;
-import com.gyee.monitor.model.auto.Windturbinetestingpointai;
+import com.gyee.monitor.model.auto.Windpowerstationpointnew;
+import com.gyee.monitor.model.auto.Windturbinetestingpointnew;
 import com.gyee.monitor.util.realtimesource.timeseries.ErrorRequest;
 import com.gyee.monitor.util.realtimesource.timeseries.JsonObjectHelper;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
@@ -25,9 +26,12 @@ import java.util.*;
 public class EdosUtil implements IEdosUtil {
 
     private RestTemplate restTemplate =new RestTemplate();
-    private static String baseURL = "http://10.83.68.205:8011/ts";
+    @Value("${golden.baseURL}")
+    private String baseURL;
+    //    private static String baseURL = "http://10.155.32.4:8011/ts";
+//    private static String baseURL = "http://10.65.79.30:8019/ts";
     @Override
-    public PointData getRealData(Windpowerstationtestingpoint point) throws Exception {
+    public PointData getRealData(Windpowerstationpointnew point) throws Exception {
         try {
             Optional<String> keys = Optional.ofNullable(point.getCode());
             Optional<String> thingType = Optional.ofNullable("station");
@@ -46,7 +50,7 @@ public class EdosUtil implements IEdosUtil {
 
             ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
             JSONObject jsonArray = resp.getBody();
-             if (StringUtils.isNotEmpty(jsonArray)){
+            if (StringUtils.isNotEmpty(jsonArray)){
                 List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray);
                 if (list.size() > 0)
                     return list.get(0);
@@ -67,7 +71,7 @@ public class EdosUtil implements IEdosUtil {
 
 
     @Override
-    public List<PointData> getHistoryDatasSnap(Windpowerstationtestingpoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
+    public List<PointData> getHistoryDatasSnap(Windpowerstationpointnew point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
         Optional<String> tagName = Optional.ofNullable(point.getCode());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
         Optional<String> thingType = Optional.ofNullable(point.getModelid());
@@ -113,53 +117,53 @@ public class EdosUtil implements IEdosUtil {
                 if(snapList.isEmpty())
                 {
 
-                	getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
+                    getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
                 }else
                 {
-                	 for (PointData snapItem : snapList) {
-
-                         long subTime = snapItem.getPointTime() - pried;
-                         //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
-                         // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
-                         // 则代表该时间节点快照有效,否则为0
-                         String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
-                         ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-                         JSONObject jsonObjectSection = sectionResp.getBody();
-
-                         if (jsonObjectSection != null) {
-                             List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-                             if (sectionlist.size() > 0) {
-                                 if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
-                                     resultList.add(snapItem);
-                                 }
-                                 else{
-                                     PointData data = new PointData();
-                                     data.setEdnaId(point.getCode());
-                                     data.setPointTime(snapItem.getPointTime());
-                                     data.setPointValue("0");
-                                     data.setPointName("1");
-                                     data.setPointValueInDouble(0.0);
-                                     resultList.add(data);
-                                 }
-                             } else {
-                                 PointData data = new PointData();
-                                 data.setEdnaId(point.getCode());
-                                 data.setPointTime(snapItem.getPointTime());
-                                 data.setPointValue("0");
-                                 data.setPointName("1");
-                                 data.setPointValueInDouble(0.0);
-                                 resultList.add(data);
-                             }
-                         } else {
-                             PointData data = new PointData();
-                             data.setEdnaId(point.getCode());
-                             data.setPointTime(snapItem.getPointTime());
-                             data.setPointValue("0");
-                             data.setPointName("1");
-                             data.setPointValueInDouble(0.0);
-                             resultList.add(data);
-                         }
-                     }
+                    for (PointData snapItem : snapList) {
+
+                        long subTime = snapItem.getPointTime() - pried;
+                        //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
+                        // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
+                        // 则代表该时间节点快照有效,否则为0
+                        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
+                        ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+                        JSONObject jsonObjectSection = sectionResp.getBody();
+
+                        if (jsonObjectSection != null) {
+                            List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+                            if (sectionlist.size() > 0) {
+                                if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+                                    resultList.add(snapItem);
+                                }
+                                else{
+                                    PointData data = new PointData();
+                                    data.setEdnaId(point.getCode());
+                                    data.setPointTime(snapItem.getPointTime());
+                                    data.setPointValue("0");
+                                    data.setPointName("1");
+                                    data.setPointValueInDouble(0.0);
+                                    resultList.add(data);
+                                }
+                            } else {
+                                PointData data = new PointData();
+                                data.setEdnaId(point.getCode());
+                                data.setPointTime(snapItem.getPointTime());
+                                data.setPointValue("0");
+                                data.setPointName("1");
+                                data.setPointValueInDouble(0.0);
+                                resultList.add(data);
+                            }
+                        } else {
+                            PointData data = new PointData();
+                            data.setEdnaId(point.getCode());
+                            data.setPointTime(snapItem.getPointTime());
+                            data.setPointValue("0");
+                            data.setPointName("1");
+                            data.setPointValueInDouble(0.0);
+                            resultList.add(data);
+                        }
+                    }
                 }
 
 
@@ -182,52 +186,52 @@ public class EdosUtil implements IEdosUtil {
     }
 
 
-	private void getHistsnapSameTiem(String pointid, Long beginDate, Long pried,
-			List<PointData> resultList) {
-		long subTime =beginDate - pried;
-		  String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + beginDate + "000";
-		  ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-		  JSONObject jsonObjectSection = sectionResp.getBody();
-		  if (jsonObjectSection != null) {
-		      List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-		      if (sectionlist.size() > 0) {
-		          if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=beginDate){
-		              resultList.add(sectionlist.get(0));
-		          }
-		          else{
-		              PointData data = new PointData();
-		              data.setEdnaId(pointid);
-		              data.setPointTime(sectionlist.get(0).getPointTime());
-		              data.setPointValue("0");
-		              data.setPointName("1");
-		              data.setPointValueInDouble(0.0);
-		              resultList.add(data);
-		          }
-		      } else {
-		          PointData data = new PointData();
-		          data.setEdnaId(pointid);
-		          if (sectionlist!=null && sectionlist.size()>0){
-                      data.setPointTime(sectionlist.get(0).getPointTime());
-                  }
-		          data.setPointValue("0");
-		          data.setPointName("1");
-		          data.setPointValueInDouble(0.0);
-		          resultList.add(data);
-		      }
-		  } else {
-		      PointData data = new PointData();
-		      data.setEdnaId(pointid);
-		      data.setPointTime(beginDate);
-		      data.setPointValue("0");
-		      data.setPointName("1");
-		      data.setPointValueInDouble(0.0);
-		      resultList.add(data);
-		  }
-	}
+    private void getHistsnapSameTiem(String pointid, Long beginDate, Long pried,
+                                     List<PointData> resultList) {
+        long subTime =beginDate - pried;
+        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + beginDate + "000";
+        ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+        JSONObject jsonObjectSection = sectionResp.getBody();
+        if (jsonObjectSection != null) {
+            List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+            if (sectionlist.size() > 0) {
+                if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=beginDate){
+                    resultList.add(sectionlist.get(0));
+                }
+                else{
+                    PointData data = new PointData();
+                    data.setEdnaId(pointid);
+                    data.setPointTime(sectionlist.get(0).getPointTime());
+                    data.setPointValue("0");
+                    data.setPointName("1");
+                    data.setPointValueInDouble(0.0);
+                    resultList.add(data);
+                }
+            } else {
+                PointData data = new PointData();
+                data.setEdnaId(pointid);
+                if (sectionlist!=null && sectionlist.size()>0){
+                    data.setPointTime(sectionlist.get(0).getPointTime());
+                }
+                data.setPointValue("0");
+                data.setPointName("1");
+                data.setPointValueInDouble(0.0);
+                resultList.add(data);
+            }
+        } else {
+            PointData data = new PointData();
+            data.setEdnaId(pointid);
+            data.setPointTime(beginDate);
+            data.setPointValue("0");
+            data.setPointName("1");
+            data.setPointValueInDouble(0.0);
+            resultList.add(data);
+        }
+    }
 
 
     @Override
-    public List<PointData> getHistoryDatasRaw(Windpowerstationtestingpoint point, Long beginDate, Long endDate) throws Exception {
+    public List<PointData> getHistoryDatasRaw(Windpowerstationpointnew point, Long beginDate, Long endDate) throws Exception {
         Optional<String> tagName = Optional.ofNullable(point.getCode());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
         Optional<String> thingType = Optional.ofNullable(point.getModelid());
@@ -273,8 +277,8 @@ public class EdosUtil implements IEdosUtil {
     }
 
     @Override
-    public PointData getRealData(Windturbinetestingpointai point) throws Exception {
-        Optional<String> keys = Optional.ofNullable(point.getId());
+    public PointData getRealData(Windturbinetestingpointnew point) throws Exception {
+        Optional<String> keys = Optional.ofNullable(point.getCode());
         Optional<String> thingType = Optional.ofNullable(point.getModelid());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
         Optional<String> uniformCodes = Optional.ofNullable(point.getUniformcode());
@@ -294,7 +298,7 @@ public class EdosUtil implements IEdosUtil {
             }
             ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
             JSONObject jsonArray = resp.getBody();
-             if (StringUtils.isNotEmpty(jsonArray)){
+            if (StringUtils.isNotEmpty(jsonArray)){
                 List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray);
                 if (list.size() > 0)
                     return list.get(0);
@@ -315,14 +319,14 @@ public class EdosUtil implements IEdosUtil {
     }
 
     @Override
-    public List<PointData> getHistoryDatasSnap(Windturbinetestingpointai point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
+    public List<PointData> getHistoryDatasSnap(Windturbinetestingpointnew point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
         if (point==null){
             System.out.println(1111);
 
         }else if(point.getId()==null){
             System.out.println(222);
         }
-        Optional<String> tagName = Optional.ofNullable(point.getId());
+        Optional<String> tagName = Optional.ofNullable(point.getCode());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
         Optional<String> thingType = Optional.ofNullable(point.getModelid());
         Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
@@ -367,10 +371,10 @@ public class EdosUtil implements IEdosUtil {
                 if(snapList.isEmpty())
                 {
 
-                	getHistsnapSameTiem(point.getId(), beginDate, pried, resultList);
+                    getHistsnapSameTiem(point.getId(), beginDate, pried, resultList);
                 }else
                 {
-                	for (PointData snapItem : snapList) {
+                    for (PointData snapItem : snapList) {
                         long subTime = snapItem.getPointTime() - pried;
                         //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
                         // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
@@ -382,7 +386,7 @@ public class EdosUtil implements IEdosUtil {
                         if (jsonObjectSection != null) {
                             List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
                             if (sectionlist.size() > 0) {
-                                    resultList.add(snapItem);
+                                resultList.add(snapItem);
 
                             } else {
                                 PointData data = new PointData();
@@ -422,8 +426,8 @@ public class EdosUtil implements IEdosUtil {
 
 
     @Override
-    public List<PointData> getHistoryDatasRaw(Windturbinetestingpointai point, Long beginDate, Long endDate) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point.getId());
+    public List<PointData> getHistoryDatasRaw(Windturbinetestingpointnew point, Long beginDate, Long endDate) throws Exception {
+        Optional<String> tagName = Optional.ofNullable(point.getCode());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
         Optional<String> thingType = Optional.ofNullable(point.getModelid());
         Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
@@ -477,7 +481,7 @@ public class EdosUtil implements IEdosUtil {
 
             ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
             JSONObject jsonArray = resp.getBody();
-             if (StringUtils.isNotEmpty(jsonArray)){
+            if (StringUtils.isNotEmpty(jsonArray)){
                 List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray);
                 if (list.size() > 0)
                     return list.get(0);
@@ -552,7 +556,7 @@ public class EdosUtil implements IEdosUtil {
                     }
                     pointData.setPointValue(pointValue);
                     pointData.setPointValueInDouble(Double.parseDouble(pointValue));
-                   // System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
+                    // System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
                 }
                 return result;
 
@@ -637,7 +641,7 @@ public class EdosUtil implements IEdosUtil {
                     pointData.setPointValue(pointValue);
 
                     pointData.setPointValueInDouble(Double.parseDouble(pointValue));
-                  //  System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
+                    //  System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
                 }
                 return result;
 
@@ -669,7 +673,7 @@ public class EdosUtil implements IEdosUtil {
                 return null;
             ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
             JSONObject jsonArray = resp.getBody();
-             if (StringUtils.isNotEmpty(jsonArray)){
+            if (StringUtils.isNotEmpty(jsonArray)){
                 Iterator<String> sIterator = jsonArray.keySet().iterator();
                 Map<String, Double> resultMap = new HashMap();
                 while (sIterator.hasNext()) {
@@ -705,41 +709,41 @@ public class EdosUtil implements IEdosUtil {
     }
 
 
-	  @Override
-	    public List<PointData> getHistoryDatasSnap(String pointid, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
-	        Optional<String> tagName = Optional.ofNullable(pointid);
-	        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
-	        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
-
-	        //通过时间区间和时间间隔获取点数
-	        Long finalInterval;
-	        if (pried != null)
-	            finalInterval = pried;
-	        else if (count != null)
-	            finalInterval = (endDate - beginDate) / count;
-	        else
-	            return ErrorRequest.RequestListError(pointid);
-	        Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
-
-	        try {
-	            String url = baseURL + "/history/snap?null=0";
-	            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-	            if (tagName.isPresent())
-	                url = url + "&tagName=" + tagName.get();
-
-	            if (startTs.isPresent())
-	                url = url + "&startTs=" + startTs.get();
-	            if (endTs.isPresent())
-	                url = url + "&endTs=" + endTs.get();
-	            if (interval.isPresent())
-	                url = url + "&interval=" + interval.get();
-
-	            ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
-	            JSONArray jsonArray = resp.getBody();
-	            if (jsonArray != null) {
-	                List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray,tagName.get());
-	                List<PointData> resultList = new ArrayList<>();
-	                return list;
+    @Override
+    public List<PointData> getHistoryDatasSnap(String pointid, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
+        Optional<String> tagName = Optional.ofNullable(pointid);
+        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
+        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
+
+        //通过时间区间和时间间隔获取点数
+        Long finalInterval;
+        if (pried != null)
+            finalInterval = pried;
+        else if (count != null)
+            finalInterval = (endDate - beginDate) / count;
+        else
+            return ErrorRequest.RequestListError(pointid);
+        Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
+
+        try {
+            String url = baseURL + "/history/snap?null=0";
+            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+            if (tagName.isPresent())
+                url = url + "&tagName=" + tagName.get();
+
+            if (startTs.isPresent())
+                url = url + "&startTs=" + startTs.get();
+            if (endTs.isPresent())
+                url = url + "&endTs=" + endTs.get();
+            if (interval.isPresent())
+                url = url + "&interval=" + interval.get();
+
+            ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
+            JSONArray jsonArray = resp.getBody();
+            if (jsonArray != null) {
+                List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray,tagName.get());
+                List<PointData> resultList = new ArrayList<>();
+                return list;
 //
 //	                if(list.isEmpty())
 //	                {
@@ -793,20 +797,20 @@ public class EdosUtil implements IEdosUtil {
 //	                }
 //
 //	                return resultList;
-	            } else {
-	                return ErrorRequest.RequestListError(pointid);
-	            }
+            } else {
+                return ErrorRequest.RequestListError(pointid);
+            }
 
-	        } catch (HttpClientErrorException exception) {
-	            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-	                System.out.println("404请求错误");
-	                return ErrorRequest.RequestListError(pointid);
-	            } else {
-	                throw exception;
-	            }
-	        }
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestListError(pointid);
+            } else {
+                throw exception;
+            }
+        }
 
-	    }
+    }
 
 
     @Override
@@ -844,8 +848,8 @@ public class EdosUtil implements IEdosUtil {
     }
 
     @Override
-    public List<PointData> getHistStat(Windturbinetestingpointai point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point.getId());
+    public List<PointData> getHistStat(Windturbinetestingpointnew point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
+        Optional<String> tagName = Optional.ofNullable(point.getCode());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
         Optional<String> thingType = Optional.ofNullable(point.getModelid());
         Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
@@ -906,7 +910,7 @@ public class EdosUtil implements IEdosUtil {
     }
 
     @Override
-    public List<PointData> getHistStat(Windpowerstationtestingpoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
+    public List<PointData> getHistStat(Windpowerstationpointnew point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
         Optional<String> tagName = Optional.ofNullable(point.getCode());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
         Optional<String> thingType = Optional.ofNullable(point.getModelid());
@@ -1113,14 +1117,14 @@ public class EdosUtil implements IEdosUtil {
             if (StringUtils.isNotEmpty(jsonObject) && !jsonObject.isEmpty()){
                 return JsonObjectHelper.phraseDNAVal(jsonObject,tagNames);
             } else {
-            	  DNAVal[] errorResult = new DNAVal[tagNames.length];
-                  for(int i=0;i<tagNames.length;i++)
-                  {
-                  	 DNAVal val = new DNAVal();
-                       val.Status = 0;
-                       errorResult[i] = val;
-                  }
-                  return errorResult;
+                DNAVal[] errorResult = new DNAVal[tagNames.length];
+                for(int i=0;i<tagNames.length;i++)
+                {
+                    DNAVal val = new DNAVal();
+                    val.Status = 0;
+                    errorResult[i] = val;
+                }
+                return errorResult;
             }
 
         } catch (HttpClientErrorException exception) {
@@ -1129,9 +1133,9 @@ public class EdosUtil implements IEdosUtil {
                 DNAVal[] errorResult = new DNAVal[tagNames.length];
                 for(int i=0;i<tagNames.length;i++)
                 {
-                	 DNAVal val = new DNAVal();
-                     val.Status = 0;
-                     errorResult[i] = val;
+                    DNAVal val = new DNAVal();
+                    val.Status = 0;
+                    errorResult[i] = val;
                 }
                 return errorResult;
             } else {
@@ -1236,29 +1240,30 @@ public class EdosUtil implements IEdosUtil {
             JSONObject jsonObject = resp.getBody();
             if (StringUtils.isNotEmpty(jsonObject) && !jsonObject.isEmpty())
             {
-            	 return JsonObjectHelper.phraseDNAVal(jsonObject,nameList);
+                return JsonObjectHelper.phraseDNAVal(jsonObject,nameList);
             }
             else {
                 DNAVal[] errorResult = new DNAVal[nameList.length];
                 for(int i=0;i<nameList.length;i++)
                 {
-                	 DNAVal val = new DNAVal();
-                     val.Status = 0;
-                     errorResult[i] = val;
+                    DNAVal val = new DNAVal();
+                    val.Status = 0;
+                    errorResult[i] = val;
                 }
                 return errorResult;
             }
         } catch (Exception e) {
-        	  DNAVal[] errorResult = new DNAVal[nameList.length];
-              for(int i=0;i<nameList.length;i++)
-              {
-              	 DNAVal val = new DNAVal();
-                   val.Status = 0;
-                   errorResult[i] = val;
-              }
-              return errorResult;
+            DNAVal[] errorResult = new DNAVal[nameList.length];
+            for(int i=0;i<nameList.length;i++)
+            {
+                DNAVal val = new DNAVal();
+                val.Status = 0;
+                errorResult[i] = val;
+            }
+            return errorResult;
         }
     }
 
 
+
 }

+ 17 - 16
web/monitor-web/src/main/java/com/gyee/monitor/util/realtimesource/IEdosUtil.java

@@ -4,8 +4,8 @@ package com.gyee.monitor.util.realtimesource;
 import com.gyee.common.model.DNAStatVal;
 import com.gyee.common.model.DNAVal;
 import com.gyee.common.model.PointData;
-import com.gyee.monitor.model.auto.Windpowerstationtestingpoint;
-import com.gyee.monitor.model.auto.Windturbinetestingpointai;
+import com.gyee.monitor.model.auto.Windpowerstationpointnew;
+import com.gyee.monitor.model.auto.Windturbinetestingpointnew;
 
 import java.util.List;
 import java.util.Map;
@@ -13,13 +13,13 @@ import java.util.Map;
 
 public interface IEdosUtil {
 
-	/**
-	 * 通过风场测点获得测点实时数据
-	 * @param point 只是用了code字段,作为唯一标识
-	 * @return
-	 * @throws Exception
-	 */
-    public PointData getRealData(Windpowerstationtestingpoint point) throws Exception;
+    /**
+     * 通过风场测点获得测点实时数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @return
+     * @throws Exception
+     */
+    public PointData getRealData(Windpowerstationpointnew point) throws Exception;
 
     /**
      * 通过风场测点获得测点历史快照数据
@@ -31,7 +31,7 @@ public interface IEdosUtil {
      * @return
      * @throws Exception
      */
-    public List<PointData> getHistoryDatasSnap(Windpowerstationtestingpoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
+    public List<PointData> getHistoryDatasSnap(Windpowerstationpointnew point, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
 
     /**
      * 通过风场测点获得测点历史存储数据,存多少取多少
@@ -41,7 +41,7 @@ public interface IEdosUtil {
      * @return
      * @throws Exception
      */
-    public List<PointData> getHistoryDatasRaw(Windpowerstationtestingpoint point, Long beginDate, Long endDate) throws Exception;
+    public List<PointData> getHistoryDatasRaw(Windpowerstationpointnew point, Long beginDate, Long endDate) throws Exception;
 
     /**
      * 通过风机测点获得测点实时数据
@@ -49,7 +49,7 @@ public interface IEdosUtil {
      * @return
      * @throws Exception
      */
-    public PointData getRealData(Windturbinetestingpointai point) throws Exception;
+    public PointData getRealData(Windturbinetestingpointnew point) throws Exception;
 
     /**
      * 通过风机测点获得历史快照
@@ -61,7 +61,7 @@ public interface IEdosUtil {
      * @return
      * @throws Exception
      */
-    public List<PointData> getHistoryDatasSnap(Windturbinetestingpointai point, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
+    public List<PointData> getHistoryDatasSnap(Windturbinetestingpointnew point, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
 
     /**
      * 通过风机测点获得测点历史存储数据,存多少取多少
@@ -71,7 +71,7 @@ public interface IEdosUtil {
      * @return
      * @throws Exception
      */
-    public List<PointData> getHistoryDatasRaw(Windturbinetestingpointai point, Long beginDate, Long endDate) throws Exception;
+    public List<PointData> getHistoryDatasRaw(Windturbinetestingpointnew point, Long beginDate, Long endDate) throws Exception;
 
 
     /**
@@ -138,7 +138,7 @@ public interface IEdosUtil {
      * @return
      * @throws Exception
      */
-    public List<PointData> getHistStat(Windturbinetestingpointai point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
+    public List<PointData> getHistStat(Windturbinetestingpointnew point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
 
     /**
      * 通过风场测点获得测点指定时间周期的统计数据
@@ -151,7 +151,7 @@ public interface IEdosUtil {
      * @return
      * @throws Exception
      */
-    public List<PointData> getHistStat(Windpowerstationtestingpoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
+    public List<PointData> getHistStat(Windpowerstationpointnew point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
 
     /**
      * 通过全局点名获得测点指定时间周期的统计数据
@@ -230,4 +230,5 @@ public interface IEdosUtil {
      */
     public DNAVal[] getHistMatrix(String[] nameList, int tTime) throws Exception;
 
+
 }

+ 4 - 0
web/monitor-web/src/main/resources/application-dev.yml

@@ -97,3 +97,7 @@ logging:
     com.example: debug
 
 
+golden:
+  baseURL: http://192.168.2.205:8011/ts
+
+

+ 2 - 0
web/monitor-web/src/main/resources/application-test.yml

@@ -97,3 +97,5 @@ logging:
     com.example: debug
 
 
+golden:
+  baseURL: http://10.83.68.205:8011/ts

+ 2 - 2
web/monitor-web/src/main/resources/application.yml

@@ -1,4 +1,4 @@
 spring:
   profiles:
-#    active: dev
-    active: test
+    active: dev
+#    active: test