Browse Source

国电山西遗留工作实现

xieshengjie 2 years ago
parent
commit
4468f5cf74
49 changed files with 3863 additions and 20 deletions
  1. 0 0
      web/gdsx-ghost/cd
  2. 9 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/contant/Contant.java
  3. 39 2
      web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/ghost/GhostController.java
  4. 23 10
      web/gdsx-ghost/src/main/java/com/gyee/ghost/init/CacheContext.java
  5. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/WindpowerstationtestingpointMapper.java
  6. 17 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/WindturbinetestingpointaiMapper.java
  7. 75 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Windpowerstationtestingpoint.java
  8. 81 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Windturbinetestingpointai.java
  9. 82 8
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/GhostService.java
  10. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IWindpowerstationtestingpointService.java
  11. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IWindturbinetestingpointaiService.java
  12. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/WindpowerstationtestingpointServiceImpl.java
  13. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/WindturbinetestingpointaiServiceImpl.java
  14. 48 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/ApiGolden.java
  15. 1267 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/EdosUtil.java
  16. 27 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/GoldenConfig.java
  17. 172 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/HttpClientUtil.java
  18. 233 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/IEdosUtil.java
  19. 789 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/MongoEdosUtil.java
  20. 34 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/StringUtil.java
  21. 28 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BaseTsQuery.java
  22. 38 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BasicTsData.java
  23. 29 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BasicTsPoint.java
  24. 24 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BlobTsData.java
  25. 22 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BlobWriteTsData.java
  26. 24 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BooleanTsData.java
  27. 19 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BooleanWriteTsData.java
  28. 18 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/Coordinate.java
  29. 26 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/CoordinateTsData.java
  30. 21 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/CoordinateWriteTsData.java
  31. 30 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/DoubleStatData.java
  32. 25 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/DoubleTsData.java
  33. 19 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/DoubleWriteTsData.java
  34. 38 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/ErrorRequest.java
  35. 27 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/GeneralTsData.java
  36. 8 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/Interpolation.java
  37. 206 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/JsonObjectHelper.java
  38. 24 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/LongTsData.java
  39. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/LongWriteTsData.java
  40. 24 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/StringTsData.java
  41. 34 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/StringUtil.java
  42. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/StringWriteTsData.java
  43. 15 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/TsData.java
  44. 15 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/TsDataType.java
  45. 12 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/TsPoint.java
  46. 36 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/TsPointData.java
  47. 23 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/TsPointDataList.java
  48. 17 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/TsQuery.java
  49. 37 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/vo/NatureVo.java

+ 0 - 0
web/gdsx-ghost/cd


+ 9 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/contant/Contant.java

@@ -0,0 +1,9 @@
+package com.gyee.ghost.contant;/*
+@author   谢生杰
+@date   2022/8/13-11:01
+*/
+
+public class Contant {
+
+    public static String NATURE_UNIFORMCODE = "AI010,AI022,AI130,AI067,AI036,AI198,AI178,FJZT,AI131";
+}

+ 39 - 2
web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/ghost/GhostController.java

@@ -11,6 +11,7 @@ import com.gyee.ghost.model.auto.Nature;
 import com.gyee.ghost.model.auto.Shutdownevent;
 import com.gyee.ghost.model.auto.Windpowerstation;
 import com.gyee.ghost.service.auto.GhostService;
+import com.gyee.ghost.vo.NatureVo;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -35,6 +36,13 @@ public class GhostController {
         }
     }
 
+    /**
+     * 运行分析
+     * @param wpid
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
     @GetMapping("/function")
     @ResponseBody
     @CrossOrigin(origins = "*", maxAge = 3600)
@@ -50,6 +58,13 @@ public class GhostController {
         }
     }
 
+    /**
+     * 性能分析,已更改,此功能不用
+     * @param wpid
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
     @GetMapping("/nature")
     @ResponseBody
     @CrossOrigin(origins = "*", maxAge = 3600)
@@ -66,14 +81,36 @@ public class GhostController {
     }
 
 
+    @GetMapping("/natureReal")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R natureReal(
+            @RequestParam(value = "wpid",required = true)String wpid){
+        List<NatureVo> resultList = ghostService.listNatureReal(wpid);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok((long) resultList.size()).data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    /**
+     * 停机事件
+     * @param wpid
+     * @param beginDate
+     * @param endDate
+     * @param type   2:故障   4:维护
+     * @return
+     */
     @GetMapping("/shutdownevent")
     @ResponseBody
     @CrossOrigin(origins = "*", maxAge = 3600)
     public R shutdownevent(
             @RequestParam(value = "wpid",required = true)String wpid,
             @RequestParam(value = "beginDate",required = true)String beginDate,
-            @RequestParam(value = "endDate",required = true)String endDate){
-        List<Shutdownevent> resultList = ghostService.shutdownevent(wpid,beginDate,endDate);
+            @RequestParam(value = "endDate",required = true)String endDate,
+            @RequestParam(value = "type",required = true)String type){
+        List<Shutdownevent> resultList = ghostService.shutdownevent(wpid,beginDate,endDate,type);
         if (StringUtils.isNotNull(resultList)) {
             return R.ok((long) resultList.size()).data(resultList);
         }else{

+ 23 - 10
web/gdsx-ghost/src/main/java/com/gyee/ghost/init/CacheContext.java

@@ -2,13 +2,12 @@ package com.gyee.ghost.init;
 
 
 
+import com.gyee.common.model.StringUtils;
 import com.gyee.ghost.model.auto.Stoptype;
 import com.gyee.ghost.model.auto.Windpowerstation;
 import com.gyee.ghost.model.auto.Windturbine;
-import com.gyee.ghost.service.auto.GhostService;
-import com.gyee.ghost.service.auto.IStoptypeService;
-import com.gyee.ghost.service.auto.IWindpowerstationService;
-import com.gyee.ghost.service.auto.IWindturbineService;
+import com.gyee.ghost.model.auto.Windturbinetestingpointai;
+import com.gyee.ghost.service.auto.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.CommandLineRunner;
@@ -29,16 +28,16 @@ import java.util.Map;
  */
 @Component
 public class CacheContext implements CommandLineRunner {
-    Logger logger = LoggerFactory.getLogger(CacheContext.class);
 
-    @Resource
-    private GhostService ghostService;
+
     @Resource
     private IWindturbineService windturbineService;
     @Resource
     private IWindpowerstationService windpowerstationService;
     @Resource
     private IStoptypeService stoptypeService;
+    @Resource
+    private IWindturbinetestingpointaiService windturbinetestingpointaiService;
 
     public static List<Windturbine> wtls = new ArrayList<>();
     public static Map<String,Windturbine> wtmap = new HashMap<>();
@@ -46,6 +45,8 @@ public class CacheContext implements CommandLineRunner {
     public static List<Windpowerstation> wpls = new ArrayList<>();
     public static Map<String,String> stopmap = new HashMap<>();
 
+    public static Map<String,Map<String, Windturbinetestingpointai>> wtpAimap = new HashMap();
+
 
     @Override
     public void run(String... args) throws Exception {
@@ -61,8 +62,20 @@ public class CacheContext implements CommandLineRunner {
             stopmap.put(stoptype.getId(),stoptype.getName());
         });
 
-        ghostService.saveNature("2022-08-01","2022-08-05");
-
-
+        List<Windturbinetestingpointai> WindturbinetestingpointaiList = windturbinetestingpointaiService.list();
+        Map<String, Windturbinetestingpointai> map = null;
+
+        if(StringUtils.isNotEmpty(WindturbinetestingpointaiList)){
+            for(Windturbinetestingpointai mp : WindturbinetestingpointaiList){
+                if(wtpAimap.containsKey(mp.getWindturbineid())){
+                    map = wtpAimap.get(mp.getWindturbineid());
+                    map.put(mp.getUniformcode(), mp);
+                }else{
+                    map = new HashMap<>();
+                    map.put(mp.getUniformcode(), mp);
+                    wtpAimap.put(mp.getWindturbineid(), map);
+                }
+            }
+        }
     }
 }

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/WindpowerstationtestingpointMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.mapper.auto;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.ghost.model.auto.Windpowerstationtestingpoint;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2021-12-14
+ */
+public interface WindpowerstationtestingpointMapper extends BaseMapper<Windpowerstationtestingpoint> {
+
+}

+ 17 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/WindturbinetestingpointaiMapper.java

@@ -0,0 +1,17 @@
+package com.gyee.ghost.mapper.auto;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.ghost.model.auto.Windturbinetestingpointai;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2021-12-14
+ */
+public interface WindturbinetestingpointaiMapper extends BaseMapper<Windturbinetestingpointai> {
+
+}

+ 75 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Windpowerstationtestingpoint.java

@@ -0,0 +1,75 @@
+package com.gyee.ghost.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 2021-12-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WINDPOWERSTATIONTESTINGPOINT")
+public class Windpowerstationtestingpoint extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("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/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Windturbinetestingpointai.java

@@ -0,0 +1,81 @@
+package com.gyee.ghost.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 2021-12-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WINDTURBINETESTINGPOINTAI")
+public class Windturbinetestingpointai 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;
+
+
+}

+ 82 - 8
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/GhostService.java

@@ -1,25 +1,26 @@
-package com.gyee.ghost.service.auto;/*
-@author   谢生杰
-@date   2022/8/3-15:52
-*/
-
+package com.gyee.ghost.service.auto;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+
 import com.gyee.common.model.StringUtils;
 import com.gyee.common.util.CommonUtils;
 import com.gyee.common.util.DateUtils;
 import com.gyee.common.util.DoubleUtils;
 import com.gyee.common.util.SortUtils;
+import com.gyee.ghost.contant.Contant;
 import com.gyee.ghost.init.CacheContext;
 import com.gyee.ghost.model.auto.*;
+import com.gyee.ghost.util.realtimesource.IEdosUtil;
+import com.gyee.ghost.vo.NatureVo;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.sql.Timestamp;
-import java.text.SimpleDateFormat;
+
 import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
+@Slf4j
 public class GhostService {
     @Resource
     private IWindturbineinfodayService windturbineinfodayService;
@@ -33,6 +34,8 @@ public class GhostService {
     private IInputoroutputspeedtotalService inputoroutputspeedtotalService;
     @Resource
     private IShutdowneventService shutdowneventService;
+    @Resource
+    private IEdosUtil edosUtil;
     /**
      * 存储fanoperation运行分析表
      */
@@ -237,7 +240,7 @@ public class GhostService {
         return resultList;
     }
 
-    public List<Shutdownevent> shutdownevent(String wpid, String beginDate, String endDate) {
+    public List<Shutdownevent> shutdownevent(String wpid, String beginDate, String endDate, String type) {
         List<Shutdownevent> resultList = new ArrayList<>();
         Map<String, String> stopmap = CacheContext.stopmap;
         Map<String, Windturbine> wtmap = CacheContext.wtmap;
@@ -248,6 +251,9 @@ public class GhostService {
         if (StringUtils.isNotEmpty(wpid)){
             qw.eq("windpowerstationid",wpid);
         }
+        if (StringUtils.isNotEmpty(type)){
+            qw.eq("statuscode",type);
+        }
         List<Shutdownevent> shutdowneventList = shutdowneventService.list(qw);
         shutdowneventList.stream().forEach(shutdownevent->{
             String stoptypeid = shutdownevent.getStoptypeid();
@@ -258,4 +264,72 @@ public class GhostService {
         SortUtils.sort(resultList,"stoptime",SortUtils.DESC);
         return resultList;
     }
+
+    public List<NatureVo> listNatureReal(String wpid) {
+        List<NatureVo> resultList = new ArrayList<>();
+        Map<String, Map<String, Windturbinetestingpointai>> wtpAimap = CacheContext.wtpAimap;
+        Map<String, Windturbine> wtmap = CacheContext.wtmap;
+        List<Windturbine> wtls = null;
+        if (StringUtils.isNotEmpty(wpid)) {
+            wtls = CacheContext.wtls.stream().filter(wt -> wt.getWindpowerstationid().equals(wpid)).collect(Collectors.toList());
+        }else{
+            wtls = CacheContext.wtls;
+        }
+        String[] natureUniformcode = Contant.NATURE_UNIFORMCODE.split(",");
+        wtls.stream().forEach(wt->{
+            Map<String,Double> wtDataMap = new HashMap<>();
+            Map<String, Windturbinetestingpointai> windturbinetestingpointaiMap = wtpAimap.get(wt.getId());
+            for (String uniformcode : natureUniformcode) {
+                try {
+                    Windturbinetestingpointai windturbinetestingpointai = windturbinetestingpointaiMap.get(uniformcode);
+                    if (windturbinetestingpointai!=null){
+                        Double value = edosUtil.getRealData(windturbinetestingpointai).getPointValueInDouble();
+                        wtDataMap.put(wt.getId()+"_"+uniformcode,DoubleUtils.keepPrecision(value,2));
+                    }else {
+                        System.out.println(wt.getId()+"----"+uniformcode);
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+
+            NatureVo vo = new NatureVo();
+            vo.setWindturbineId(wt.getId());
+            vo.setWindturbineName(wtmap.get(wt.getId()).getName());
+            vo.setWindDirection(wtDataMap.get(wt.getId()+"_AI010"));
+            vo.setSpeed(wtDataMap.get(wt.getId()+"_AI022"));
+            vo.setPower(wtDataMap.get(wt.getId()+"_AI130"));
+            vo.setPowerFactor(wtDataMap.get(wt.getId()+"_AI067"));
+            vo.setOppositeWindAngle(wtDataMap.get(wt.getId()+"_AI036"));
+            vo.setPowerLimit(wtDataMap.get(wt.getId()+"_AI198"));
+            vo.setSpeedLimit(wtDataMap.get(wt.getId()+"_AI178"));
+            String status = getStatus(wtDataMap.get(wt.getId()+"_FJZT"));
+            if (status == null){
+                log.info(wt.getId()+"*************");
+            }
+            vo.setStatus(status);
+            vo.setReactivePower(wtDataMap.get(wt.getId()+"_AI131"));
+            resultList.add(vo);
+        });
+        return resultList;
+    }
+
+    private String getStatus(Double value) {
+        if (value != null){
+            if (value == 0){
+                return "待机";
+            }else if(value == 5 || value == 6){
+                return "并网";
+            }else if(value == 2){
+                return "故障";
+            }else if(value == 3){
+                return "离线";
+            }else if(value == 4){
+                return "维护";
+            }else {
+                return "并网";
+            }
+        }
+        return null;
+    }
 }

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IWindpowerstationtestingpointService.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.service.auto;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.ghost.model.auto.Windpowerstationtestingpoint;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2021-12-14
+ */
+public interface IWindpowerstationtestingpointService extends IService<Windpowerstationtestingpoint> {
+
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IWindturbinetestingpointaiService.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.service.auto;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.ghost.model.auto.Windturbinetestingpointai;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2021-12-14
+ */
+public interface IWindturbinetestingpointaiService extends IService<Windturbinetestingpointai> {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/WindpowerstationtestingpointServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.service.auto.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.ghost.mapper.auto.WindpowerstationtestingpointMapper;
+import com.gyee.ghost.model.auto.Windpowerstationtestingpoint;
+import com.gyee.ghost.service.auto.IWindpowerstationtestingpointService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2021-12-14
+ */
+@Service
+public class WindpowerstationtestingpointServiceImpl extends ServiceImpl<WindpowerstationtestingpointMapper, Windpowerstationtestingpoint> implements IWindpowerstationtestingpointService {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/WindturbinetestingpointaiServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.service.auto.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.ghost.mapper.auto.WindturbinetestingpointaiMapper;
+import com.gyee.ghost.model.auto.Windturbinetestingpointai;
+import com.gyee.ghost.service.auto.IWindturbinetestingpointaiService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2021-12-14
+ */
+@Service
+public class WindturbinetestingpointaiServiceImpl extends ServiceImpl<WindturbinetestingpointaiMapper, Windturbinetestingpointai> implements IWindturbinetestingpointaiService {
+
+}

+ 48 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/ApiGolden.java

@@ -0,0 +1,48 @@
+/** 
+ * Project Name:nxfd2 
+ * File Name:ApiEdos.java 
+ * Package Name:com.gyee.frame.util
+ * Date:2016-7-25下午12:26:14 
+ * Copyright (c) 2016, chenzhou1025@126.com All Rights Reserved. 
+ * 
+ */
+
+package com.gyee.ghost.util.realtimesource;
+
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * ClassName:ApiEdos <br/>
+ * Function: TODO ADD FUNCTION. <br/>
+ * Reason: TODO ADD REASON. <br/>
+ * Date: 2016-7-25 下午12:26:14 <br/>
+ * 
+ * @author 石林
+ * @version
+ * @since JDK 1.6
+ * @see
+ */
+public class ApiGolden {
+
+    private static RestTemplate restTemplate = null;
+
+  
+    private ApiGolden() {
+
+    }
+
+    public static RestTemplate getInstance() {
+    	
+    	
+
+        if (restTemplate == null) {
+        	
+        	restTemplate = new RestTemplate();
+
+        }
+
+        return restTemplate;
+
+    }
+
+}

File diff suppressed because it is too large
+ 1267 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/EdosUtil.java


+ 27 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/GoldenConfig.java

@@ -0,0 +1,27 @@
+package com.gyee.ghost.util.realtimesource;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 读取项目相关配置
+ * 
+ * @author gyee
+ */
+
+@Configuration
+@ConfigurationProperties(prefix = "golden")
+public class GoldenConfig
+{
+    private static String baseURL;
+
+    public static String getBaseurl() {
+        return baseURL;
+    }
+
+    public  void setBaseurl(String baseURL) {
+        GoldenConfig.baseURL = baseURL;
+    }
+}
+
+

+ 172 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/HttpClientUtil.java

@@ -0,0 +1,172 @@
+package com.gyee.ghost.util.realtimesource;
+
+import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.params.HttpMethodParams;
+
+import java.io.*;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+/**
+ * @ClassName : HttpClientUtil
+ * @Author : xieshengjie
+ * @Date: 2021/12/22 15:52
+ * @Description :
+ */
+public class HttpClientUtil {
+    public static String doGet(String url) {
+        // 输入流
+        InputStream is = null;
+        BufferedReader br = null;
+        String result = null;
+        // 创建httpClient实例
+        HttpClient httpClient = new HttpClient();
+        // 设置http连接主机服务超时时间:15000毫秒
+        // 先获取连接管理器对象,再获取参数对象,再进行参数的赋值
+        httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(15000);
+        // 创建一个Get方法实例对象
+        GetMethod getMethod = new GetMethod(url);
+        // 设置get请求超时为60000毫秒
+        getMethod.getParams().setParameter(HttpMethodParams.SO_TIMEOUT, 60000);
+        // 设置请求重试机制,默认重试次数:3次,参数设置为true,重试机制可用,false相反
+        getMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(3, true));
+        try {
+            // 执行Get方法
+            int statusCode = httpClient.executeMethod(getMethod);
+            // 判断返回码
+            if (statusCode != HttpStatus.SC_OK) {
+                // 如果状态码返回的不是ok,说明失败了,打印错误信息
+                System.err.println("Method faild: " + getMethod.getStatusLine());
+            } else {
+                // 通过getMethod实例,获取远程的一个输入流
+                is = getMethod.getResponseBodyAsStream();
+                // 包装输入流
+                br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+
+                StringBuffer sbf = new StringBuffer();
+                // 读取封装的输入流
+                String temp = null;
+                while ((temp = br.readLine()) != null) {
+                    sbf.append(temp).append("\r\n");
+                }
+
+                result = sbf.toString();
+            }
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 关闭资源
+            if (null != br) {
+                try {
+                    br.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != is) {
+                try {
+                    is.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            // 释放连接
+            getMethod.releaseConnection();
+        }
+        return result;
+    }
+
+    public static String doPost(String url, Map<String, Object> paramMap) {
+        // 获取输入流
+        InputStream is = null;
+        BufferedReader br = null;
+        String result = null;
+        // 创建httpClient实例对象
+        HttpClient httpClient = new HttpClient();
+        // 设置httpClient连接主机服务器超时时间:15000毫秒
+        httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(15000);
+        // 创建post请求方法实例对象
+        PostMethod postMethod = new PostMethod(url);
+        // 设置post请求超时时间
+        postMethod.getParams().setParameter(HttpMethodParams.SO_TIMEOUT, 60000);
+
+        NameValuePair[] nvp = null;
+        // 判断参数map集合paramMap是否为空
+        if (null != paramMap && paramMap.size() > 0) {// 不为空
+            // 创建键值参数对象数组,大小为参数的个数
+
+            nvp = new NameValuePair[paramMap.size()];
+            // 循环遍历参数集合map
+            Set<Entry<String, Object>> entrySet = paramMap.entrySet();
+            // 获取迭代器
+            Iterator<Entry<String, Object>> iterator = entrySet.iterator();
+
+            int index = 0;
+            while (iterator.hasNext()) {
+                Entry<String, Object> mapEntry = iterator.next();
+                // 从mapEntry中获取key和value创建键值对象存放到数组中
+                try {
+                    nvp[index] = new NameValuePair(mapEntry.getKey(),
+                            new String(mapEntry.getValue().toString().getBytes("UTF-8"), "UTF-8"));
+                } catch (UnsupportedEncodingException e) {
+                    e.printStackTrace();
+                }
+                index++;
+            }
+        }
+        // 判断nvp数组是否为空
+        if (null != nvp && nvp.length > 0) {
+            // 将参数存放到requestBody对象中
+            postMethod.setRequestBody(nvp);
+        }
+        // 执行POST方法
+        try {
+            int statusCode = httpClient.executeMethod(postMethod);
+            // 判断是否成功
+            if (statusCode != HttpStatus.SC_OK) {
+                System.err.println("Method faild: " + postMethod.getStatusLine());
+            }
+            // 获取远程返回的数据
+            is = postMethod.getResponseBodyAsStream();
+            // 封装输入流
+            br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+
+            StringBuffer sbf = new StringBuffer();
+            String temp = null;
+            while ((temp = br.readLine()) != null) {
+                sbf.append(temp).append("\r\n");
+            }
+
+            result = sbf.toString();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 关闭资源
+            if (null != br) {
+                try {
+                    br.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != is) {
+                try {
+                    is.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            // 释放连接
+            postMethod.releaseConnection();
+        }
+        return result;
+    }
+}

+ 233 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/IEdosUtil.java

@@ -0,0 +1,233 @@
+package com.gyee.ghost.util.realtimesource;
+
+
+import com.gyee.common.model.DNAStatVal;
+import com.gyee.common.model.DNAVal;
+import com.gyee.common.model.PointData;
+import com.gyee.ghost.model.auto.Windpowerstationtestingpoint;
+import com.gyee.ghost.model.auto.Windturbinetestingpointai;
+
+import java.util.List;
+import java.util.Map;
+
+
+public interface IEdosUtil {
+
+	/**
+	 * 通过风场测点获得测点实时数据
+	 * @param point 只是用了code字段,作为唯一标识
+	 * @return
+	 * @throws Exception
+	 */
+    public PointData getRealData(Windpowerstationtestingpoint point) throws Exception;
+
+    /**
+     * 通过风场测点获得测点历史快照数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @param beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasSnap(Windpowerstationtestingpoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
+
+    /**
+     * 通过风场测点获得测点历史存储数据,存多少取多少
+     * @param point 只是用了code字段,作为唯一标识
+     * @param beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasRaw(Windpowerstationtestingpoint point, Long beginDate, Long endDate) throws Exception;
+
+    /**
+     * 通过风机测点获得测点实时数据
+     * @param point 只是用了id字段,作为唯一标识
+     * @return
+     * @throws Exception
+     */
+    public PointData getRealData(Windturbinetestingpointai point) throws Exception;
+
+    /**
+     * 通过风机测点获得历史快照
+     * @param point  只是用了id字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasSnap(Windturbinetestingpointai point, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
+
+    /**
+     * 通过风机测点获得测点历史存储数据,存多少取多少
+     * @param point 只是用了id字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasRaw(Windturbinetestingpointai point, Long beginDate, Long endDate) throws Exception;
+
+
+    /**
+     * 通过风机测点获得测点实时数据
+     * @param pointid 测点编号
+     * @return
+     * @throws Exception
+     */
+    public PointData getRealData(String pointid) throws Exception;
+
+    /**
+     * 通过全局点名获得测点实时数据 读取多个点
+     * @param pointids 测点的数组
+     * @return 列表集合
+     * @throws Exception
+     */
+    public List<PointData> getRealData(String... pointids) throws Exception;
+    /**
+     * 通过全局点名获得测点实时数据 读取多个点
+     * @param pointids 测点的列表
+     * @return 列表集合
+     * @throws Exception
+     */
+    public List<PointData> getRealData(List<String> pointids) throws Exception;
+    /**
+     * 通过全局点名获得测点实时数据 读取多个点
+     * @param pointids 测点的数组
+     * @return Map集合
+     * @throws Exception
+     */
+    public Map<String,Double> getRealDataMap(String... pointids) throws Exception;
+
+    /**
+     * 通过全局点名获得历史数据快照
+     * @param pointid  全局点名
+     * @param beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasSnap(String pointid, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
+
+    /**
+     * 通过风机测点获得测点历史存储数据,存多少取多少
+     * @param pointid 全局点名
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasRaw(String pointid, Long beginDate, Long endDate) throws Exception;
+
+
+    /**
+     * 通过风机测点获得测点指定时间周期的统计数据
+     * @param point 只是用了id字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @type 0、最大值。1、最小值。、平均值
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistStat(Windturbinetestingpointai point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
+
+    /**
+     * 通过风场测点获得测点指定时间周期的统计数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @type 0、最大值。1、最小值。、平均值
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistStat(Windpowerstationtestingpoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
+
+    /**
+     * 通过全局点名获得测点指定时间周期的统计数据
+     * @param pointid 全局点名
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @type 0、最大值。1、最小值。、平均值
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistStat(String pointid, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
+
+    /**
+     * 通过全局点名获得测点指定时间周期的统计数据 同时返回max、min、avg数据
+     * @param point 全局点名
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public DNAStatVal[] getHistStat(String point, Long beginDate, Long endDate, Integer pried) throws Exception;
+    /**
+     * 补录单点历史数据
+     * @param point 测点对象
+     * @return
+     * @throws Exception
+     */
+    public void updatePoint(PointData point) throws Exception;
+
+    /**
+     * 批量查询实时数据
+     * @param tagNames 测点字符串数组
+     * @return
+     * @throws Exception
+     */
+
+    public DNAVal[] getRealtimeTagValues(String... tagNames) throws Exception;
+
+    /**
+     * 批量插入历史数据
+     * @param pointls 测点对象集合
+     * @throws Exception
+     */
+    public void updatePoint(List<PointData> pointls) throws Exception;
+
+    /**
+     * 单点写入实时数据
+     * @param point 测点对象
+     * @throws Exception
+     */
+    public void sendSinglePoint(PointData point) throws Exception ;
+    /**
+     * 批量写入实时数据
+     * @param pointls 测点对象列表
+     * @throws Exception
+     */
+    public void sendMultiPoint(List<PointData> pointls) throws Exception ;
+
+    /**
+     * 通过两个字符串数组对象批量写入实时数据
+     * @param realvalue 插入值字符串数组
+     * @param pointls 存储对象数组对象
+     * @throws Exception
+     */
+
+    public void sendMultiPoint(String[] realvalue,DNAVal[] pointls) throws Exception;
+    /**
+     *
+     * @param nameList 测点名称列表集合
+     * @param tTime  时间点(秒级)
+     * @return
+     * @throws Exception
+     */
+    public DNAVal[] getHistMatrix(String[] nameList, int tTime) throws Exception;
+
+}

+ 789 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/MongoEdosUtil.java

@@ -0,0 +1,789 @@
+//package com.gyee.ghost.util.realtimesource;
+//
+//
+//import com.alibaba.fastjson.JSONArray;
+//import com.alibaba.fastjson.JSONObject;
+//import com.gyee.benchmarkinghistroy.model.auto.Windpowerstationtestingpoint;
+//import com.gyee.benchmarkinghistroy.model.auto.Windturbinetestingpointai;
+//import com.gyee.benchmarkinghistroy.util.realtimesource.timeseries.ErrorRequest;
+//import com.gyee.benchmarkinghistroy.util.realtimesource.timeseries.JsonObjectHelper;
+//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 org.springframework.http.HttpStatus;
+//import org.springframework.http.ResponseEntity;
+//import org.springframework.stereotype.Component;
+//import org.springframework.web.client.HttpClientErrorException;
+//import org.springframework.web.client.RestTemplate;
+//
+//import java.util.ArrayList;
+//import java.util.List;
+//import java.util.Map;
+//import java.util.Optional;
+//
+///**
+// */
+//@Component
+//public class MongoEdosUtil implements IEdosUtil {
+//
+//    private RestTemplate restTemplate =new RestTemplate();
+//    private static String baseURL = "http://192.168.2.216:8090/mogodb";
+//    @Override
+//    public PointData getRealData(Windpowerstationtestingpoint point) throws Exception {
+//        try {
+//            Optional<String> keys = Optional.ofNullable(point.getCode());
+//
+//
+//            String url = baseURL + "/getRealData.action?";
+//            if (keys.isPresent())
+//                url = url + "point=" + keys.get();
+//            String s = HttpClientUtil.doGet(url);
+//            JSONObject jsonObject=JSONObject.parseObject(s);
+//            PointData pointData = JSONObject.toJavaObject(jsonObject, PointData.class);
+//            return pointData;
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                return ErrorRequest.RequestError(point.getCode());
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//
+//
+//
+//    @Override
+//    public List<PointData> getHistoryDatasSnap(Windpowerstationtestingpoint 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());
+//        Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
+//        Optional<Long> startTs = Optional.ofNullable(beginDate);
+//        Optional<Long> endTs = Optional.ofNullable(endDate);
+//        Optional<Long> counts = Optional.ofNullable(count);
+//        Optional<Long> prieds = Optional.ofNullable(pried);
+//        //通过时间区间和时间间隔获取点数
+//
+//
+//        try {
+//            String url = baseURL + "/getHistoryDatasSnap.action?";
+//            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+//            if (tagName.isPresent())
+//                url = url + "point=" + tagName.get();
+//            if (startTs.isPresent())
+//                url = url + "&begin=" + startTs.get();
+//            if (endTs.isPresent())
+//                url = url + "&end=" + endTs.get();
+//            if (counts.isPresent())
+//                url = url + "&count=" + counts.get();
+//            if (prieds.isPresent())
+//                url = url + "&pried=" + prieds.get();
+//            String s = HttpClientUtil.doGet(url);
+//            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+//
+//            return pointDatas;
+//
+//
+//
+//
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                return ErrorRequest.RequestListError(point.getCode());
+//            } else {
+//                throw exception;
+//            }
+//        }
+//
+//    }
+//
+//
+//
+//
+//
+//    @Override
+//    public List<PointData> getHistoryDatasRaw(Windpowerstationtestingpoint 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());
+//        Optional<Long> startTs = Optional.ofNullable(beginDate);
+//        Optional<Long> endTs = Optional.ofNullable(endDate);
+//
+//        try {
+//            String url = baseURL + "/getHistoryDatasRaw.action?";
+//            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+//            if (tagName.isPresent())
+//                url = url + "point=" + tagName.get();
+//
+//
+//            if (startTs.isPresent())
+//                url = url + "&begin=" + startTs.get();
+//            if (endTs.isPresent())
+//                url = url + "&end=" + endTs.get();
+//
+//            String s = HttpClientUtil.doGet(url);
+//            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+//           return pointDatas;
+//
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                return ErrorRequest.RequestListError(point.getCode());
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public PointData getRealData(Windturbinetestingpointai point) throws Exception {
+//        Optional<String> keys = Optional.ofNullable(point.getId());
+//        Optional<String> thingType = Optional.ofNullable(point.getModelid());
+//        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
+//        Optional<String> uniformCodes = Optional.ofNullable(point.getUniformcode());
+//
+//        try {
+//            String url = baseURL + "/getRealData.action?";
+//            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+//            if (keys.isPresent())
+//                url = url + "point=" + keys.get();
+//
+//            String s = HttpClientUtil.doGet(url);
+//            JSONObject jsonObject=JSONObject.parseObject(s);
+//            PointData pointData = JSONObject.toJavaObject(jsonObject, PointData.class);
+//            return pointData;
+//
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                return ErrorRequest.RequestError(point.getId());
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public List<PointData> getHistoryDatasSnap(Windturbinetestingpointai point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
+//
+//        Optional<String> tagName = Optional.ofNullable(point.getId());
+//        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
+//        Optional<String> thingType = Optional.ofNullable(point.getModelid());
+//        Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
+//        Optional<Long> startTs = Optional.ofNullable(beginDate);
+//        Optional<Long> endTs = Optional.ofNullable(endDate);
+//        Optional<Long> counts = Optional.ofNullable(count);
+//        Optional<Long> prieds = Optional.ofNullable(pried);
+//        //通过时间区间和时间间隔获取点数
+//
+//        try {
+//            String url = baseURL + "/getHistoryDatasSnap.action?";
+//            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+//            if (tagName.isPresent())
+//                url = url + "point=" + tagName.get();
+//
+//            if (startTs.isPresent())
+//                url = url + "&begin=" + startTs.get();
+//            if (endTs.isPresent())
+//                url = url + "&end=" + endTs.get();
+//            if (counts.isPresent())
+//                url = url + "&count=" + counts.get();
+//            if (prieds.isPresent())
+//                url = url + "&pried=" + prieds.get();
+//
+//            String s = HttpClientUtil.doGet(url);
+//            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+//            return pointDatas;
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                return ErrorRequest.RequestListError(point.getId());
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//
+//    @Override
+//    public List<PointData> getHistoryDatasRaw(Windturbinetestingpointai point, Long beginDate, Long endDate) throws Exception {
+//        Optional<String> tagName = Optional.ofNullable(point.getId());
+//        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
+//        Optional<String> thingType = Optional.ofNullable(point.getModelid());
+//        Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
+//        Optional<Long> startTs = Optional.ofNullable(beginDate);
+//        Optional<Long> endTs = Optional.ofNullable(endDate);
+//        try {
+//            String url = baseURL + "/getHistoryDatasRaw.action?";
+//            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+//            if (tagName.isPresent())
+//                url = url + "point=" + tagName.get();
+//            if (startTs.isPresent())
+//                url = url + "&begin=" + startTs.get();
+//            if (endTs.isPresent())
+//                url = url + "&end=" + endTs.get();
+//
+//            String s = HttpClientUtil.doGet(url);
+//            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+//            return pointDatas;
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                return ErrorRequest.RequestListError(point.getId());
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public PointData getRealData(String pointid) throws Exception {
+//        Optional<String> keys = Optional.ofNullable(pointid);
+//        String url = baseURL + "/getRealData.action?";
+//        try {
+//            if (keys.isPresent())
+//                url = url + "point=" + keys.get();
+//            else
+//                return null;
+//
+//            String s = HttpClientUtil.doGet(url);
+//            JSONObject jsonObject=JSONObject.parseObject(s);
+//            PointData pointData = JSONObject.toJavaObject(jsonObject, PointData.class);
+//            return pointData;
+//
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                return ErrorRequest.RequestError(pointid);
+//            } else {
+//                return ErrorRequest.RequestError(pointid);
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public List<PointData> getRealData(String... pointids) throws Exception {
+//        String pointIdString = StringUtil.join(pointids, ",");
+//        Optional<String> keys = Optional.ofNullable(pointIdString);
+//        String url = baseURL + "/getRealData.action?1=1";
+//        try {
+//            if (keys.isPresent())
+//                url = url + "&point=" + keys.get();
+//            else {
+//                return ErrorRequest.RequestListError(pointids);
+//            }
+//            String s = HttpClientUtil.doGet(url);
+//            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+//            return pointDatas;
+//
+//
+//
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                return ErrorRequest.RequestListError(pointids);
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//
+//
+//    @Override
+//    public List<PointData> getRealData(List<String> pointids) throws Exception {
+//        String pointIdString = StringUtil.join(pointids.toArray(), ",");
+//        Optional<String> keys = Optional.ofNullable(pointIdString);
+//        String url = baseURL + "/getRealData.action?";
+//        try {
+//            if (keys.isPresent())
+//                url = url + "keys=" + keys.get();
+//            else {
+//                String[] arr = new String[pointids.size()];
+//                return ErrorRequest.RequestListError(pointids.toArray(arr));
+//            }
+//            String s = HttpClientUtil.doGet(url);
+//            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+//            return pointDatas;
+//
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                String[] arr = new String[pointids.size()];
+//                return ErrorRequest.RequestListError(pointids.toArray(arr));
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public Map<String, Double> getRealDataMap(String... pointids) throws Exception {
+//        return null;
+//    }
+//
+//
+//	  @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);
+//	        Optional<Long> endTs = Optional.ofNullable(endDate);
+//          Optional<Long> counts = Optional.ofNullable(count);
+//          Optional<Long> prieds = Optional.ofNullable(pried);
+//
+//
+//          try {
+//              String url = baseURL + "/getHistoryDatasSnap.action?";
+//              //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+//              if (tagName.isPresent())
+//                  url = url + "point=" + tagName.get();
+//
+//              if (startTs.isPresent())
+//                  url = url + "&begin=" + startTs.get();
+//              if (endTs.isPresent())
+//                  url = url + "&end=" + endTs.get();
+//              if (counts.isPresent())
+//                  url = url + "&count=" + counts.get();
+//              if (prieds.isPresent())
+//                  url = url + "&pried=" + prieds.get();
+//
+//
+//              String s = HttpClientUtil.doGet(url);
+//              List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+//              return pointDatas;
+//
+//
+//	        } catch (HttpClientErrorException exception) {
+//	            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//	                System.out.println("404请求错误");
+//	                return ErrorRequest.RequestListError(pointid);
+//	            } else {
+//	                throw exception;
+//	            }
+//	        }
+//
+//	    }
+//
+//
+//    @Override
+//    public List<PointData> getHistoryDatasRaw(String pointid, Long beginDate, Long endDate) throws Exception {
+//        Optional<String> tagName = Optional.ofNullable(pointid);
+//        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
+//        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
+//
+//        try {
+//            String url = baseURL + "/history/raw?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();
+//
+//            ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
+//
+//            JSONArray jsonArray = resp.getBody();
+//            if (jsonArray != null)
+//                return JsonObjectHelper.phrasePointData(jsonArray, 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;
+//            }
+//        }
+//    }
+//
+//    @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());
+//        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
+//        Optional<String> thingType = Optional.ofNullable(point.getModelid());
+//        Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
+//        Optional<Long> startTs = Optional.ofNullable(beginDate);
+//        Optional<Long> endTs = Optional.ofNullable(endDate);
+//        Optional<Long> counts = Optional.ofNullable(count);
+//        Optional<Long> prieds = Optional.ofNullable(pried);
+//        Optional<Integer> types = Optional.ofNullable(type);
+//
+//
+//        try {
+//            String url = baseURL + "/getHistStat.action?";
+//            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+//            if (tagName.isPresent())
+//                url = url + "point=" + tagName.get();
+//            if (startTs.isPresent())
+//                url = url + "&begin=" + startTs.get();
+//            if (endTs.isPresent())
+//                url = url + "&end=" + endTs.get();
+//            if (counts.isPresent())
+//                url = url + "&count=" + counts.get();
+//            if (prieds.isPresent())
+//                url = url + "&pried=" + prieds.get();
+//            if (types.isPresent())
+//                url = url + "&type=" + types.get();
+//
+//            String s = HttpClientUtil.doGet(url);
+//            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+//            return pointDatas;
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                return ErrorRequest.RequestListError(point.getId());
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public List<PointData> getHistStat(Windpowerstationtestingpoint 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());
+//        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
+//        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
+//        Optional<Long> counts = Optional.ofNullable(count);
+//        Optional<Long> prieds = Optional.ofNullable(pried);
+//        Optional<Integer> types = Optional.ofNullable(type);
+//
+//
+//        try {
+//            String url = baseURL + "/getHistStat.action?";
+//            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+//            if (tagName.isPresent())
+//                url = url + "point=" + tagName.get();
+//
+//            if (startTs.isPresent())
+//                url = url + "&begin=" + startTs.get();
+//            if (endTs.isPresent())
+//                url = url + "&end=" + endTs.get();
+//            if (counts.isPresent())
+//                url = url + "&count=" + counts.get();
+//            if (prieds.isPresent())
+//                url = url + "&pried=" + prieds.get();
+//            if (types.isPresent())
+//                url = url + "&type=" + types.get();
+//
+//            String s = HttpClientUtil.doGet(url);
+//            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+//            return pointDatas;
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                return ErrorRequest.RequestListError(point.getCode());
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public List<PointData> getHistStat(String pointid, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
+//        Optional<String> tagName = Optional.ofNullable(pointid);
+//        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
+//        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
+//        Optional<Long> counts = Optional.ofNullable(count);
+//        Optional<Long> prieds = Optional.ofNullable(pried);
+//        Optional<Integer> types = Optional.ofNullable(type);
+//
+//
+//        try {
+//            String url = baseURL + "/getHistStat.action?";
+//            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+//            if (tagName.isPresent())
+//                url = url + "point=" + tagName.get();
+//
+//            if (startTs.isPresent())
+//                url = url + "&begin=" + startTs.get();
+//            if (endTs.isPresent())
+//                url = url + "&end=" + endTs.get();
+//            if (counts.isPresent())
+//                url = url + "&count=" + counts.get();
+//            if (prieds.isPresent())
+//                url = url + "&pried=" + prieds.get();
+//            if (types.isPresent())
+//                url = url + "&type=" + types.get();
+//
+//            String s = HttpClientUtil.doGet(url);
+//            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+//            return pointDatas;
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                return ErrorRequest.RequestListError(pointid);
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public DNAStatVal[] getHistStat(String point, Long beginDate, Long endDate, Integer pried) throws Exception {
+//        Optional<String> tagName = Optional.ofNullable(point);
+//        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
+//        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
+//        //通过时间区间和时间间隔获取点数
+//        Optional<Integer> interval = Optional.ofNullable(pried);
+//
+//        try {
+//            String url = baseURL + "/history/stat?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();
+//
+//            //System.out.println(restTemplate.getForEntity(url, JSONArray.class));
+//            ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
+//            if (resp != null) {
+//                JSONArray jsonArray = resp.getBody();
+//                if (jsonArray == null || jsonArray.size() <= 0) {
+//                    DNAStatVal[] dnaVal = new DNAStatVal[1];
+//                    DNAVal errorData = new DNAVal();
+//                    errorData.Status = 0;
+//
+//                    DNAStatVal val = new DNAStatVal();
+//                    val.avg = errorData;
+//                    val.max = errorData;
+//                    val.min = errorData;
+//                    dnaVal[0] = val;
+//                    return dnaVal;
+//                } else {
+//                    return JsonObjectHelper.phraseDNAVal(jsonArray);
+//                }
+//            } else {
+//                return null;
+//            }
+//
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                DNAStatVal val = new DNAStatVal();
+//                DNAStatVal[] dnaVal = new DNAStatVal[1];
+//                DNAVal errorData = new DNAVal();
+//                errorData.Status = 0;
+//                val.avg = errorData;
+//                val.max = errorData;
+//                val.min = errorData;
+//                dnaVal[0] = val;
+//                return dnaVal;
+//
+//            } else {
+//                DNAStatVal val = new DNAStatVal();
+//                DNAStatVal[] dnaVal = new DNAStatVal[1];
+//                DNAVal errorData = new DNAVal();
+//                errorData.Status = 0;
+//                val.avg = errorData;
+//                val.max = errorData;
+//                val.min = errorData;
+//                dnaVal[0] = val;
+//                return dnaVal;
+//            }
+//        }
+//    }
+//
+//    private JSONObject convertPointData(PointData pd) {
+//        JSONObject jo = new JSONObject();
+//        jo.put("tagName", pd.getEdnaId());
+//        JSONObject joo = new JSONObject();
+//        joo.put("ts", pd.getPointTime()*1000);
+//        joo.put("status", 0);
+//        joo.put("doubleValue", pd.getPointValueInDouble());
+//        jo.put("tsData", joo);
+//        return jo;
+//    }
+//
+//    @Override
+//    public void updatePoint(PointData point) throws Exception {
+//        String url = baseURL + "/history";
+//        try {
+//            String result = restTemplate.postForObject(url, convertPointData(point), String.class);
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                return;
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public DNAVal[] getRealtimeTagValues(String... tagNames) throws Exception {
+//        String pointIdString = StringUtil.join(tagNames, ",");
+//        Optional<String> keys = Optional.ofNullable(pointIdString);
+//        String url = baseURL + "/latest?null=0";
+//        try {
+//            if (keys.isPresent())
+//                url = url + "&keys=" + keys.get();
+//            else
+//                return null;
+//
+//            ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
+//            JSONObject jsonObject = resp.getBody();
+//            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;
+//            }
+//
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//                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;
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public void updatePoint(List<PointData> pointls) throws Exception {
+//        String url = baseURL + "/history/batch";
+//        List<JSONObject> writeList = new ArrayList<>();
+//
+//        for (PointData entity : pointls) {
+//            writeList.add(convertPointData(entity));
+//        }
+//        try {
+//            String result = restTemplate.postForObject(url, writeList, String.class);
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                return;
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public void sendSinglePoint(PointData point) throws Exception {
+//        String url = baseURL + "/latest";
+//
+//
+//        try {
+//            String result = restTemplate.postForObject(url, convertPointData(point), String.class);
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                return;
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public void sendMultiPoint(List<PointData> pointls) throws Exception {
+//
+//        String url = baseURL + "/latest/batch";
+//        List<JSONObject> writeList = new ArrayList<>();
+//
+//        for (PointData entity : pointls) {
+//            writeList.add(convertPointData(entity));
+//        }
+//        try {
+//            String result = restTemplate.postForObject(url, writeList, String.class);
+//        } catch (HttpClientErrorException exception) {
+//            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                System.out.println("404请求错误");
+//            } else {
+//                throw exception;
+//            }
+//        }
+//    }
+//
+//    @Override
+//    public void sendMultiPoint(String[] realvalue, DNAVal[] pointls) throws Exception {
+//        String url = baseURL + "/latest/batch";
+//
+//        List<JSONObject> writeDataList = new ArrayList<>();
+//        if (realvalue != null && pointls != null & realvalue.length == pointls.length) {
+//            for (int i = 0; i < realvalue.length; i++) {
+//                PointData writeData = new PointData();
+//                writeData.setEdnaId(realvalue[i]);
+//                writeData.setPointValueInDouble(pointls[i].DValue);
+//                writeData.setPointTime((long)pointls[i].Time);
+//                JSONObject jsonObject=convertPointData(writeData);
+//                writeDataList.add(jsonObject);
+//            }
+//
+//            try {
+//                String result = restTemplate.postForObject(url, writeDataList, String.class);
+//            } catch (HttpClientErrorException exception) {
+//                if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+//                    System.out.println("404请求错误");
+//                } else {
+//                    throw exception;
+//                }
+//            }
+//        } else
+//            return;
+//    }
+//
+//    //多点切面数据
+//    @Override
+//    public DNAVal[] getHistMatrix(String[] nameList, int tTime) throws Exception {
+//        String tagNameString = StringUtil.join(nameList, ",");
+//        Long time = Long.valueOf(tTime);
+//        Optional<String> tagName = Optional.ofNullable(tagNameString);
+//        Optional<Long> ts = Optional.ofNullable(time * 1000);
+//        String url = baseURL + "/history/section?tagNames=" + tagName.get() + "&ts=" + ts.get();
+//        try {
+//            ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
+//            JSONObject jsonObject = resp.getBody();
+//            if (StringUtils.isNotEmpty(jsonObject) && !jsonObject.isEmpty())
+//            {
+//            	 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;
+//                }
+//                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;
+//        }
+//    }
+//
+//
+//}

+ 34 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/StringUtil.java

@@ -0,0 +1,34 @@
+package com.gyee.ghost.util.realtimesource;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * String辅助类
+ * 
+ */
+public class StringUtil extends StringUtils {
+	
+	/**
+	 * 非空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isNotBlank(Object obj) {
+		return !isBlank(obj);
+	}
+
+	/**
+	 * 为空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isBlank(Object obj) {
+		if (obj == null || StringUtils.isBlank(obj.toString())) {
+			return true;
+		}
+		return false;
+	}
+
+}

+ 28 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BaseTsQuery.java

@@ -0,0 +1,28 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+@Data
+public class BaseTsQuery implements TsQuery {
+
+    private final TsPoint tsPoint;
+    private final long startTs;
+    private final long endTs;
+    private final int interval;
+    private final int limit;
+    private final Interpolation interpolation;
+
+    public BaseTsQuery(TsPoint tsPoint, long startTs, long endTs, int interval, int limit, Interpolation interpolation) {
+        this.tsPoint = tsPoint;
+        this.startTs = startTs;
+        this.endTs = endTs;
+        this.interval = interval;
+        this.limit = limit;
+        this.interpolation = interpolation;
+    }
+
+    public BaseTsQuery(TsPoint tsPoint, long startTs, long endTs) {
+        this(tsPoint, startTs, endTs, 1, 1, Interpolation.RAW);
+    }
+
+}

+ 38 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BasicTsData.java

@@ -0,0 +1,38 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public abstract class BasicTsData implements TsData, Comparable<BasicTsData>{
+
+    private final long ts;
+
+    private final short status;
+
+    public BasicTsData(long ts, short status) {
+        this.ts = ts;
+        this.status = status;
+    }
+
+    public long getTs() {
+        return ts;
+    }
+
+    public short getStatus() {
+        return status;
+    }
+
+    @Override
+    public int compareTo(BasicTsData o) {
+        return Long.compare(ts, o.ts);
+    }
+
+    @Override
+    public String toString() {
+        return "BasicTsData{ts='" + ts +
+                "', status='" + this.getStatus() +
+                "'}";
+    }
+
+}
+

+ 29 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BasicTsPoint.java

@@ -0,0 +1,29 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class BasicTsPoint implements TsPoint {
+
+    private final String id;
+
+    private final TsDataType tsDataType;
+
+    public BasicTsPoint(String id,  TsDataType tsDataType) {
+        this.id = id;
+        this.tsDataType = tsDataType;
+    }
+
+    public String getId() { return id; }
+
+    public TsDataType getTsDataType() {return tsDataType; }
+
+    @Override
+    public String toString() {
+        return "BasicTsPoint{id='" + id +
+                "', dataType='" + this.getTsDataType() +
+                "'}";
+    }
+
+}
+

+ 24 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BlobTsData.java

@@ -0,0 +1,24 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+import java.util.Base64;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class BlobTsData extends BasicTsData {
+
+    private final byte[] blob;
+
+    public BlobTsData(long ts, short status, byte[] blob) {
+        super(ts, status);
+        this.blob = blob;
+    }
+
+    //public byte[] getBlob() { return  blob ;}
+
+    public String getBlobValue() {
+        return Base64.getEncoder().encodeToString(blob);
+    }
+
+}
+

+ 22 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BlobWriteTsData.java

@@ -0,0 +1,22 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+import java.util.Base64;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class BlobWriteTsData {
+    private String tagName;
+    private long ts;
+    private  byte[]blob;
+
+    public String getValue() {
+        return Base64.getEncoder().encodeToString(blob);
+    }
+
+}

+ 24 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BooleanTsData.java

@@ -0,0 +1,24 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class BooleanTsData extends BasicTsData {
+
+    private final boolean actualValue;
+
+    public BooleanTsData(long ts, short status, boolean actualValue) {
+        super(ts, status);
+        this.actualValue = actualValue;
+    }
+
+//    public boolean getActualValue() {
+//        return actualValue;
+//    }
+
+    public String getBooleanValue() {
+        return Boolean.toString(actualValue);
+    }
+
+}
+

+ 19 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/BooleanWriteTsData.java

@@ -0,0 +1,19 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class BooleanWriteTsData  {
+    private String tagName;
+    private long ts;
+    private boolean actualValue;
+
+    public boolean getValue() {
+        return this.actualValue;
+    }
+}

+ 18 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/Coordinate.java

@@ -0,0 +1,18 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+@Data
+@AllArgsConstructor
+public class Coordinate {
+
+    private double latitude;
+
+    private double longitude;
+
+}
+

+ 26 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/CoordinateTsData.java

@@ -0,0 +1,26 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class CoordinateTsData extends BasicTsData {
+
+    private final Coordinate coordinate;
+
+    public CoordinateTsData(long ts, short status, double latitude, double longitude) {
+        super(ts, status);
+        this.coordinate = new Coordinate(latitude, longitude);
+    }
+
+    public CoordinateTsData(long ts, short status, Coordinate coordinate) {
+        super(ts, status);
+        this.coordinate = coordinate;
+    }
+
+    public Coordinate getCoordinateValue() {
+        return coordinate;
+        //return String.format("{\"longitude\":%f,\"latitude\":\"%f\"}", longitude, latitude);
+    }
+
+}
+

+ 21 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/CoordinateWriteTsData.java

@@ -0,0 +1,21 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class CoordinateWriteTsData  {
+
+    private String tagName;
+    private long ts;
+    private  double latitude;
+    private  double longitude;
+
+    public double getLatitude() { return  latitude ;}
+    public double getLongitude() {return  longitude; }
+
+}

+ 30 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/DoubleStatData.java

@@ -0,0 +1,30 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class DoubleStatData {
+
+    private DoubleTsData avg;
+    private DoubleTsData max;
+    private DoubleTsData min;
+
+    public DoubleStatData(DoubleTsData avg, DoubleTsData max, DoubleTsData min) {
+        this.avg = avg;
+        this.max = max;
+        this.min = min;
+    }
+
+    public DoubleTsData getAvg() {
+        return avg;
+    }
+
+    public DoubleTsData getMax() {
+        return max;
+    }
+
+    public DoubleTsData getMin() {
+        return min;
+    }
+}
+

+ 25 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/DoubleTsData.java

@@ -0,0 +1,25 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class DoubleTsData extends BasicTsData {
+
+    private final double actualValue;
+
+    public DoubleTsData(long ts, short status, double actualValue) {
+        super(ts, status);
+        this.actualValue = actualValue;
+    }
+
+
+    public double getDoubleValue() {
+        return actualValue;
+    }
+
+//    public String getValue() {
+//        return Double.toString(actualValue);
+//    }
+
+}
+

+ 19 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/DoubleWriteTsData.java

@@ -0,0 +1,19 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class DoubleWriteTsData  {
+    private String tagName;
+    private long ts;
+    private double actualValue;
+
+    public double getValue() {
+        return this.actualValue;
+    }
+}

+ 38 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/ErrorRequest.java

@@ -0,0 +1,38 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+import com.gyee.common.model.PointData;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @descrition:接口请求失败返回操作类
+ * @author:Wanghs
+ * @date:2018-05-21
+ */
+public class ErrorRequest {
+
+    public static List<PointData> RequestListError(String pointId) {
+        List<PointData> dataList = new ArrayList<>();
+        return dataList;
+    }
+
+    public static List<PointData> RequestListError(String... pointId) {
+        List<PointData> dataList = new ArrayList<>();
+        return dataList;
+    }
+
+    public static PointData RequestError(String pointId) {
+        PointData data = new PointData();
+        data.setPointValueInDouble(0);
+        data.setPointName("0");
+        return data;
+    }
+
+    public static Map<String, Double> RequestMapError() {
+        Map<String, Double> resultMap = new HashMap();
+        return resultMap;
+    }
+}

+ 27 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/GeneralTsData.java

@@ -0,0 +1,27 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Optional;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class GeneralTsData implements TsData {
+
+    private long ts;
+    private short status;
+    private Optional<Double> doubleValue;
+    private Optional<Long> longValue;
+    private Optional<Boolean> booleanValue;
+    private Optional<String> stringValue;
+    private Optional<String> blobValue;
+    private Optional<Coordinate> coordinateValue;
+
+}
+

+ 8 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/Interpolation.java

@@ -0,0 +1,8 @@
+
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+public enum Interpolation {
+    SNAP,   // 历史快照数据
+    INTERPOLATION, //插值
+    RAW    //原始数据
+}

+ 206 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/JsonObjectHelper.java

@@ -0,0 +1,206 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.gyee.common.model.DNAStatVal;
+import com.gyee.common.model.DNAVal;
+import com.gyee.common.model.PointData;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+
+/**
+ * @descrition:JSONObject转实体辅助类
+ * @author:Wanghs
+ * @date:2018-05-10
+ */
+public class JsonObjectHelper {
+    public static List<PointData> phrasePointData(JSONArray jsonArray, String tagName) {
+        List<PointData> result = new ArrayList<>();
+
+        for (int i = 0; i < jsonArray.size(); i++) {
+            JSONObject tsData = jsonArray.getJSONObject(i);
+
+            Long ts = tsData.getLong("ts");
+            String pointValue = null;
+            if (tsData.containsKey("doubleValue")) {
+                pointValue = tsData.getString("doubleValue");
+            } else if (tsData.containsKey("booleanValue")) {
+                pointValue = tsData.getString("booleanValue");
+            } else if (tsData.containsKey("longValue")) {
+                pointValue = tsData.getString("longValue");
+            } else if (tsData.containsKey("stringValue")) {
+                pointValue = tsData.getString("stringValue");
+            }
+            PointData pointData = new PointData();
+            pointData.setEdnaId(tagName);
+            pointData.setPointName("1");
+            pointData.setPointTime(ts / 1000);
+            pointData.setPointValue(pointValue);
+            pointData.setPointValueInDouble(Double.parseDouble(pointValue));
+            //System.out.println("key= " + tagName + ", ts = " + ts + ", value = " + pointValue);
+            result.add(pointData);
+        }
+        return result;
+    }
+
+
+    public static List<PointData> phrasePointData(JSONObject jsonObject) {
+        List<PointData> result = new ArrayList<>();
+        Iterator<String> sIterator = jsonObject.keySet().iterator();
+        while (sIterator.hasNext()) {
+            // 获得key
+            String key = sIterator.next();
+            // 根据key获得value, value也可以是JSONObject,JSONArray,使用对应的参数接收即可
+            JSONObject jsonData = jsonObject.getJSONObject(key);
+            Long ts = 0l;
+
+            if (jsonData!=null){
+                ts  = jsonData.getLong("ts");
+                String pointValue = null;
+                if (jsonData.containsKey("doubleValue")) {
+                    pointValue = jsonData.getString("doubleValue");
+                } else if (jsonData.containsKey("booleanValue")) {
+                    pointValue = jsonData.getString("booleanValue");
+                } else if (jsonData.containsKey("longValue")) {
+                    pointValue = jsonData.getString("longValue");
+                } else if (jsonData.containsKey("stringValue")) {
+                    pointValue = jsonData.getString("stringValue");
+                }
+                PointData pointData = new PointData();
+                pointData.setEdnaId(key);
+                pointData.setPointName("1");
+                pointData.setPointValue(pointValue);
+                pointData.setPointTime(ts/1000);
+                if(pointValue.equals("false")  )
+                {
+                    pointData.setPointValueInDouble(0.0);
+                }else  if(pointValue.equals("true") )
+                {
+                    pointData.setPointValueInDouble(1.0);
+                }else
+                {
+                    pointData.setPointValueInDouble(Double.parseDouble(pointValue));
+                }
+
+                //  System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
+                result.add(pointData);
+            }
+        }
+        return result;
+    }
+    /**
+     * @param arry    DoubleStatData集合
+     * @param tagName 标签点名
+     * @param type    0、最大值。1、最小值。2、平均值
+     */
+    public static List<PointData> GeneralTsDataToPointDataByStat(JSONArray arry, String tagName, int type) {
+        List<PointData> result = new ArrayList<>();
+        for (int i = 0; i < arry.size(); i++) {
+            JSONObject jsonData = arry.getJSONObject(i);
+            PointData data = new PointData();
+            data.setEdnaId(tagName);
+            data.setPointName("1");
+            JSONObject avgData = null;
+            JSONObject maxData = null;
+            JSONObject minData = null;
+            if (jsonData.containsKey("avg")) {
+                avgData = jsonData.getJSONObject("avg");
+            }
+            if (jsonData.containsKey("max")) {
+                maxData = jsonData.getJSONObject("max");
+            }
+            if (jsonData.containsKey("min")) {
+                minData = jsonData.getJSONObject("min");
+            }
+            switch (type) {
+                case 0:
+                    data.setPointValue(String.valueOf(maxData.getString("doubleValue")));
+                    data.setPointValueInDouble(Double.valueOf(maxData.getString("doubleValue")));
+                    data.setPointTime(Long.valueOf(maxData.getString("ts")) / 1000);
+                    break;
+                case 1:
+                    data.setPointValue(String.valueOf(minData.getString("doubleValue")));
+                    data.setPointValueInDouble(Double.valueOf(minData.getString("doubleValue")));
+                    data.setPointTime(Long.valueOf(minData.getString("ts")) / 1000);
+                    break;
+                case 2:
+                    data.setPointValue(String.valueOf(avgData.getString("doubleValue")));
+                    data.setPointValueInDouble(Double.valueOf(avgData.getString("doubleValue")));
+                    data.setPointTime(Long.valueOf(avgData.getString("ts")) / 1000);
+                    break;
+                default:
+                    break;
+            }
+            result.add(data);
+        }
+        return result;
+    }
+
+    public static DNAVal[] phraseDNAVal(JSONObject jsonObject, String[] tagName) {
+        DNAVal[] arr = new DNAVal[jsonObject.size()];
+        List<DNAVal> list = new ArrayList<>();
+        Iterator<String> sIterator = jsonObject.keySet().iterator();
+
+        for (int i = 0; i < tagName.length; i++) {
+            // 获得key
+            String key = tagName[i];
+            // 根据key获得value, value也可以是JSONObject,JSONArray,使用对应的参数接收即可
+            JSONObject jsonData = jsonObject.getJSONObject(key);
+            DNAVal data = new DNAVal();
+            data.Time = Integer.parseInt(String.valueOf(Long.valueOf(jsonData.getString("ts")) / 1000));
+            data.Status = (short) jsonData.getShortValue("status");
+            data.DValue = (Double.valueOf(jsonData.getDoubleValue("doubleValue")));
+            list.add(data);
+        }
+
+        return list.toArray(arr);
+    }
+
+    public static DNAStatVal[] phraseDNAVal(JSONArray jsonArray) {
+
+        DNAStatVal[] arr = new DNAStatVal[jsonArray.size()];
+        List<DNAStatVal> list = new ArrayList<>();
+        for (int i = 0; i < jsonArray.size(); i++) {
+            JSONObject jsonData = jsonArray.getJSONObject(i);
+            JSONObject avgData = null;
+            JSONObject maxData = null;
+            JSONObject minData = null;
+            if (jsonData.containsKey("avg")) {
+                avgData = jsonData.getJSONObject("avg");
+            }
+            if (jsonData.containsKey("max")) {
+                maxData = jsonData.getJSONObject("max");
+            }
+            if (jsonData.containsKey("min")) {
+                minData = jsonData.getJSONObject("min");
+            }
+            DNAStatVal statVal = new DNAStatVal();
+
+            DNAVal avgVal = new DNAVal();
+            DNAVal maxVal = new DNAVal();
+            DNAVal minVal = new DNAVal();
+
+            avgVal.Time = Integer.valueOf(String.valueOf(Long.valueOf(avgData.getString("ts")) / 1000));
+            avgVal.DValue = Double.valueOf(avgData.getString("doubleValue"));
+
+            maxVal.Time =  Integer.valueOf(String.valueOf(Long.valueOf(maxData.getString("ts")) / 1000));
+            maxVal.DValue = Double.valueOf(maxData.getString("doubleValue"));
+
+            minVal.Time =  Integer.valueOf(String.valueOf(Long.valueOf(minData.getString("ts")) / 1000));
+            minVal.DValue = Double.valueOf(minData.getString("doubleValue"));
+
+            statVal.max = maxVal;
+            statVal.min = minVal;
+            statVal.avg = avgVal;
+
+            list.add(statVal);
+        }
+
+        return list.toArray(arr);
+    }
+
+}

+ 24 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/LongTsData.java

@@ -0,0 +1,24 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class LongTsData extends BasicTsData {
+
+    private final long actualValue;
+
+    public LongTsData(long ts, short status, long actualValue) {
+        super(ts, status);
+        this.actualValue = actualValue;
+    }
+
+    public long getLongValue() {
+        return actualValue;
+    }
+
+//    public String getValue() {
+//        return Long.toString(actualValue);
+//    }
+
+}
+

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/LongWriteTsData.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class LongWriteTsData  {
+
+    private String tagName;
+    private long ts;
+    private long actualValue;
+
+    public long getValue() {
+        return this.actualValue;
+    }
+}

+ 24 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/StringTsData.java

@@ -0,0 +1,24 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class StringTsData extends BasicTsData {
+
+    private final String actualValue;
+
+    public StringTsData(long ts, short status, String actualValue) {
+        super(ts, status);
+        this.actualValue = actualValue;
+    }
+
+//    public String getActualValue() {
+//        return actualValue;
+//    }
+
+    public String getStringValue() {
+        return actualValue;
+    }
+
+}
+

+ 34 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/StringUtil.java

@@ -0,0 +1,34 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * String辅助类
+ * 
+ */
+public class StringUtil extends StringUtils {
+	
+	/**
+	 * 非空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isNotBlank(Object obj) {
+		return !isBlank(obj);
+	}
+
+	/**
+	 * 为空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isBlank(Object obj) {
+		if (obj == null || StringUtils.isBlank(obj.toString())) {
+			return true;
+		}
+		return false;
+	}
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/StringWriteTsData.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:String类型写入实体类
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class StringWriteTsData  {
+    private String tagName;
+    private long ts;
+    private String actualValue;
+
+    public String getValue() {
+        return this.actualValue;
+    }
+
+}

+ 15 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/TsData.java

@@ -0,0 +1,15 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public interface TsData {
+
+    long getTs();
+
+    short getStatus();
+
+    //double getValue();
+
+}
+

+ 15 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/TsDataType.java

@@ -0,0 +1,15 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public enum TsDataType {
+    LONG,
+    DOUBLE,
+    BOOLEAN,
+    STRING,
+    BLOB,
+    COORDINATE
+
+}
+

+ 12 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/TsPoint.java

@@ -0,0 +1,12 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public interface TsPoint {
+
+    String getId();
+
+    TsDataType getTsDataType();
+}
+

+ 36 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/TsPointData.java

@@ -0,0 +1,36 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class TsPointData {
+
+    private String tagName;
+    private GeneralTsData tsData;
+
+    public TsDataType findDataType() {
+        if (tsData.getDoubleValue().isPresent())
+            return TsDataType.DOUBLE;
+        else if (tsData.getBooleanValue().isPresent())
+            return TsDataType.BOOLEAN;
+        else if (tsData.getLongValue().isPresent())
+            return TsDataType.LONG;
+        else if (tsData.getStringValue().isPresent())
+            return TsDataType.STRING;
+        else if (tsData.getBlobValue().isPresent())
+            return TsDataType.BLOB;
+        else if (tsData.getCoordinateValue().isPresent())
+            return TsDataType.COORDINATE;
+
+        return TsDataType.DOUBLE;
+    }
+}
+

+ 23 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/TsPointDataList.java

@@ -0,0 +1,23 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class TsPointDataList {
+
+    private String tagName;
+
+    private List<GeneralTsData> tsDataList;
+
+}
+

+ 17 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/util/realtimesource/timeseries/TsQuery.java

@@ -0,0 +1,17 @@
+package com.gyee.ghost.util.realtimesource.timeseries;
+
+public interface TsQuery {
+
+    TsPoint getTsPoint();
+
+    long getStartTs();
+
+    long getEndTs();
+
+    int getInterval();
+
+    int getLimit();
+
+    Interpolation getInterpolation();
+
+}

+ 37 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/vo/NatureVo.java

@@ -0,0 +1,37 @@
+package com.gyee.ghost.vo;/*
+@author   谢生杰
+@date   2022/8/13-10:26
+*/
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class NatureVo implements Serializable {
+    //风机编码
+    private String windturbineId;
+    //风机名称
+    private String windturbineName;
+    //风向
+    private Double windDirection;
+    //风速
+    private Double speed;
+    //功率
+    private Double power;
+    //功率因数
+    private Double powerFactor;
+    //对风角度
+    private Double oppositeWindAngle;
+    //功率限定值
+    private Double powerLimit;
+    //转速限定值
+    private Double speedLimit;
+    //状态
+    private String status;
+    //是否故障
+    private String fault;
+    //无功功率
+    private Double reactivePower;
+
+}