Browse Source

计算电量调整

xieshengjie 2 years ago
parent
commit
4bca346d61

+ 12 - 6
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/CycleCalculationService.java

@@ -31,7 +31,8 @@ public class CycleCalculationService {
     public void saveCyle() throws Exception {
 
         Date currentDate = DateUtils.getCurrentDate();
-
+        int day = DateUtils.getDay(currentDate);
+        int month = DateUtils.getMonth(currentDate);
         Date date = DateUtils.addMinutes(currentDate, -5);
         Date date15age = DateUtils.addMinutes(currentDate, -15);
 
@@ -168,7 +169,7 @@ public class CycleCalculationService {
                 double rfdl = ssfdl - zerofdl;
 
                 if (rfdl<0 || rfdl>modelpower.get(wt.getModelId())*24*1.5){
-                    double rfdlnew = 0;
+                    rfdl = 0;
                     List<PointData> ssglList = edosUtil.getHistoryDatasSnap(ssglPoint, samedayZero.getTime()/1000, currentDate.getTime()/1000, null, 600l);
                     int glSize = ssglList.size();
                     long samedayZeroTime = samedayZero.getTime();
@@ -176,17 +177,22 @@ public class CycleCalculationService {
                     for (int i = 0;i<ssglList.size();i++){
                         Long pointTime = ssglList.get(i).getPointTime()*1000;
                         double hours = (currentDate.getTime() - samedayZeroTime) / 1000 / 60 / 60;
-                        rfdlnew += hours*1/glSize*ssglList.get(i).getPointValueInDouble();
+                        rfdl += hours*1/glSize*ssglList.get(i).getPointValueInDouble();
                     }
-                    wtResultList.add(PointUtil.createPointData(date,rfdlnew,rfdlPoint.getNemCode(),rfdlPoint.getName()));
-                }else {
-                    wtResultList.add(PointUtil.createPointData(date,rfdl,rfdlPoint.getNemCode(),rfdlPoint.getName()));
                 }
+                wtResultList.add(PointUtil.createPointData(date,rfdl,rfdlPoint.getNemCode(),rfdlPoint.getName()));
 
 
                 double yfdl = ssfdl - monthfirstfdl;
+
+                if (yfdl<0 || yfdl>modelpower.get(wt.getModelId())*24*31*1.5){
+                    yfdl = rfdl*day;
+                }
                 wtResultList.add(PointUtil.createPointData(date,yfdl,yfdlPoint.getNemCode(),yfdlPoint.getName()));
                 double nfdl = ssfdl - yearfirstfdl;
+                if (nfdl<0 || nfdl>modelpower.get(wt.getModelId())*24*31*12*1.5){
+                    yfdl = yfdl*month;
+                }
                 wtResultList.add(PointUtil.createPointData(date,nfdl,nfdlPoint.getNemCode(),nfdlPoint.getName()));
                 double fdl15 = ssfdl - date15agofdl;
                 wtResultList.add(PointUtil.createPointData(date,fdl15,fdl15Point.getNemCode(),fdl15Point.getName()));

+ 4 - 1
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/CommonController.java

@@ -179,8 +179,11 @@ public class CommonController {
 
         String[] points = pointIds.split(",");
         Arrays.stream(points).forEach(p -> {
+            List<PointData> datasSnap = null;
             try {
-                List<PointData> datasSnap = edosUtil.getHistoryDatasSnap(p, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, Long.parseLong(interval));
+                if (!p.equals("INITIAL")){
+                    datasSnap = edosUtil.getHistoryDatasSnap(p, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, Long.parseLong(interval));
+                }
                 resultList.add(datasSnap);
             } catch (Exception e) {
                 e.printStackTrace();

+ 3 - 4
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/AgcService.java

@@ -10,7 +10,6 @@ import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
 import com.gyee.runeconomy.model.auto.ProBasicPowerstationPoint;
 import com.gyee.runeconomy.model.auto.ProBasicSubStation;
-import com.gyee.runeconomy.util.realtimesource.EdosUtil;
 import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
 import org.springframework.stereotype.Service;
 
@@ -33,12 +32,12 @@ public class AgcService {
         Map<String, ProBasicPowerstation> wpmap = CacheContext.wpmap;
         Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = CacheContext.subwppointmap;
         if (company.endsWith("ZGS")) {
-            subwpls.stream().filter(sub->wpmap.get(sub.getWindpowerstationId()).getCompanyId().equals(company)).collect(Collectors.toList());
+            subwpls = subwpls.stream().filter(sub->wpmap.get(sub.getWindpowerstationId()).getCompanyId().equals(company)).collect(Collectors.toList());
         }
         if (type.equals("-1")) {
-            subwpls.stream().filter(sub->wpmap.get(sub.getWindpowerstationId()).getWindType().equals("-1")).collect(Collectors.toList());
+            subwpls = subwpls.stream().filter(sub->wpmap.get(sub.getWindpowerstationId()).getWindType().equals("-1")).collect(Collectors.toList());
         } else if (type.equals("-2")) {
-            subwpls.stream().filter(sub->wpmap.get(sub.getWindpowerstationId()).getWindType().equals("-2")).collect(Collectors.toList());
+            subwpls = subwpls.stream().filter(sub->wpmap.get(sub.getWindpowerstationId()).getWindType().equals("-2")).collect(Collectors.toList());
         }
         subwpls.stream().forEach(sub->{
             List<String> points = new ArrayList<>();

+ 26 - 20
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MatrixService.java

@@ -74,6 +74,7 @@ public class MatrixService {
             List<MatrixVo> volist = new ArrayList<>();
             List<String> wpPoints = new ArrayList<>();
             List<String> wtPoints = new ArrayList<>();
+            List<String> wtPoints1 = new ArrayList<>();
             Map<String, ProBasicPowerstationPoint> pointMap = wppointmap.get(wp.getId());
             wpPoints.add(pointMap.get(ContantXk.DJTSMX).getNemCode());
             wpPoints.add(pointMap.get(ContantXk.SDTJTSMX).getNemCode());
@@ -103,20 +104,25 @@ public class MatrixService {
             equipments.stream().forEach(wt -> {
                 Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
                 wtPoints.add(equipmentPointMap.get(ContantXk.MXZT).getNemCode());
-                wtPoints.add(equipmentPointMap.get(ContantXk.CJ_SSGL).getNemCode());
+                wtPoints.add(equipmentPointMap.get(ContantXk.SSQFZT).getNemCode());
+                wtPoints.add(equipmentPointMap.get(ContantXk.RQFDL).getNemCode());
+            });
+            equipments.stream().forEach(wt -> {
+                Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
+                wtPoints1.add(equipmentPointMap.get(ContantXk.CJ_SSGL).getNemCode());
                 if (wt.getEquipmentCategory() == -1) {
-                    wtPoints.add(equipmentPointMap.get(ContantXk.CJ_SSFS).getNemCode());
-                    wtPoints.add(equipmentPointMap.get(ContantXk.CJ_SSZS).getNemCode());
+                    wtPoints1.add(equipmentPointMap.get(ContantXk.CJ_SSFS).getNemCode());
+                    wtPoints1.add(equipmentPointMap.get(ContantXk.CJ_SSZS).getNemCode());
                 } else if (wt.getEquipmentCategory() == -2) {
-                    wtPoints.add(equipmentPointMap.get(ContantXk.JLDL).getNemCode());
-                    wtPoints.add(equipmentPointMap.get(ContantXk.JLDY).getNemCode());
+                    wtPoints1.add(equipmentPointMap.get(ContantXk.JLDL).getNemCode());
+                    wtPoints1.add(equipmentPointMap.get(ContantXk.JLDY).getNemCode());
                 }
-                wtPoints.add(equipmentPointMap.get(ContantXk.SSQFZT).getNemCode());
-                wtPoints.add(equipmentPointMap.get(ContantXk.RQFDL).getNemCode());
+
             });
             try {
                 List<PointData> wpRealdatas = edosUtil.getRealData(wpPoints);
                 List<PointData> wtRealdatas = edosUtil.getRealData(wtPoints);
+                List<PointData> wtRealdatas1 = edosUtil.getRealData(wtPoints1);
                 MatrixPowerVo powerVo = new MatrixPowerVo();
                 powerVo.setWpid(wp.getId());
                 powerVo.setWpname(wp.getAname());
@@ -133,11 +139,11 @@ public class MatrixService {
                 powerVo.setXdts(wpRealdatas.get(8).getPointValueInDouble() + wpRealdatas.get(9).getPointValueInDouble());
                 powerVo.setSlts(wpRealdatas.get(10).getPointValueInDouble() + wpRealdatas.get(11).getPointValueInDouble());
                 powerVo.setLxts(wpRealdatas.get(12).getPointValueInDouble() + wpRealdatas.get(13).getPointValueInDouble());
-                powerVo.setSpped(wpRealdatas.get(13).getPointValueInDouble());
-                powerVo.setBzgl(wpRealdatas.get(14).getPointValueInDouble());
-                powerVo.setLlgl(wpRealdatas.get(15).getPointValueInDouble());
-                powerVo.setSjgl(wpRealdatas.get(16).getPointValueInDouble());
-                powerVo.setYcgl(wpRealdatas.get(17).getPointValueInDouble());
+                powerVo.setSpped(wpRealdatas.get(14).getPointValueInDouble());
+                powerVo.setBzgl(wpRealdatas.get(15).getPointValueInDouble());
+                powerVo.setLlgl(wpRealdatas.get(16).getPointValueInDouble());
+                powerVo.setSjgl(wpRealdatas.get(17).getPointValueInDouble());
+                powerVo.setYcgl(wpRealdatas.get(18).getPointValueInDouble());
 
                 AtomicReference<Double> cxgl = new AtomicReference<>((double) 0);
                 AtomicReference<Double> agc = new AtomicReference<>((double) 0);
@@ -182,23 +188,23 @@ public class MatrixService {
                 hjsl.addAndGet((int) wpRealdatas.get(11).getPointValueInDouble());
                 lx.addAndGet((int) wpRealdatas.get(12).getPointValueInDouble());
                 wz.addAndGet((int) wpRealdatas.get(13).getPointValueInDouble());
-                int index = 6;
+                int index = 3;
                 for (int j = 0; j < equipments.size(); j++) {
                     MatrixVo vo = new MatrixVo();
                     vo.setWtid(equipments.get(j).getId());
                     vo.setWtname(equipments.get(j).getAname());
                     vo.setStatus(wtRealdatas.get(j * index).getPointValueInDouble());
-                    vo.setPower(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 1).getPointValueInDouble(), 2));
+                    vo.setPower(DoubleUtils.keepPrecision(wtRealdatas1.get(j * index).getPointValueInDouble(), 2));
 
                     if (equipments.get(j).getEquipmentCategory() == -1) {
-                        vo.setSpeed(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 2).getPointValueInDouble(), 2));
-                        vo.setTransfer(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 3).getPointValueInDouble(), 2));
+                        vo.setSpeed(DoubleUtils.keepPrecision(wtRealdatas1.get(j * index + 1).getPointValueInDouble(), 2));
+                        vo.setTransfer(DoubleUtils.keepPrecision(wtRealdatas1.get(j * index + 2).getPointValueInDouble(), 2));
                     } else if (equipments.get(j).getEquipmentCategory() == -2) {
-                        vo.setCurrent(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 2).getPointValueInDouble(), 2));
-                        vo.setVoltage(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 3).getPointValueInDouble(), 2));
+                        vo.setCurrent(DoubleUtils.keepPrecision(wtRealdatas1.get(j * index + 1).getPointValueInDouble(), 2));
+                        vo.setVoltage(DoubleUtils.keepPrecision(wtRealdatas1.get(j * index + 2).getPointValueInDouble(), 2));
                     }
-                    vo.setSsqfzt(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 4).getPointValueInDouble(), 2));
-                    vo.setQfdl(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 5).getPointValueInDouble(), 2));
+                    vo.setSsqfzt(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 1).getPointValueInDouble(), 2));
+                    vo.setQfdl(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 2).getPointValueInDouble(), 2));
                     vo.setRate(DoubleUtils.keepPrecision(modelpower.containsKey(equipments.get(j).getId())?vo.getPower() / modelpower.get(equipments.get(j).getId()) * 100:0, 2));
                     volist.add(vo);
                 }

+ 4 - 2
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/StatusService.java

@@ -4,6 +4,7 @@ package com.gyee.runeconomy.service.monitor;/*
 */
 
 import com.gyee.common.contant.ContantXk;
+import com.gyee.common.util.SortUtils;
 import com.gyee.common.vo.monitor.StatusVo;
 import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
@@ -44,7 +45,7 @@ public class StatusService {
             wpls = wpls.stream().filter(wp -> wp.getWindType().equals("-2")).collect(Collectors.toList());
         }
 
-        wpls.stream().forEach(wp->{
+        wpls.parallelStream().forEach(wp->{
             StatusVo vo = new StatusVo();
             vo.setWpname(wp.getAname());
             vo.setType(wp.getWindType());
@@ -185,9 +186,10 @@ public class StatusService {
             });
             vo.setQxzfs(fs.get());
             vo.setQxzfx(fx.get());
+            vo.setOrderNum(wp.getOrderNum());
             resultList.add(vo);
         });
-
+        SortUtils.sort(resultList,"orderNum",SortUtils.ASC);
         return resultList;
     }
 }

+ 89 - 7
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/util/realtimesource/EdosUtil.java

@@ -28,9 +28,12 @@ import java.util.*;
 public class EdosUtil implements IEdosUtil {
 
     private RestTemplate restTemplate =new RestTemplate();
-    @Value("${db.url}")
+    @Value("${db.url1}")
     private String baseURL;
 
+    @Value("${db.url2}")
+    private String baseURL2;
+
     @Value("${initialcode}")
     private String initialcode;
     @Override
@@ -91,6 +94,9 @@ public class EdosUtil implements IEdosUtil {
         if(StringUtils.notEmp(point) && StringUtils.notEmp(point) && !initialcode.equals(point))
         {
             String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point + "&ts=" + date;
+            if(point.startsWith("GF-")){
+                rawUrl = baseURL2 + "/history/section?null=0&tagNames=" + point + "&ts=" + date;
+            }
 
             ResponseEntity<JSONObject> resp = restTemplate.getForEntity(rawUrl, JSONObject.class);
             JSONObject jsonArray = resp.getBody();
@@ -148,7 +154,12 @@ public class EdosUtil implements IEdosUtil {
 
         if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !initialcode.equals(point.getNemCode()))
         {
-            String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + date;
+            String rawUrl = "";
+            if(point.getTypeId().equals("G")){
+                rawUrl = baseURL2 + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + date;
+            }else {
+                rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + date;
+            }
 
             ResponseEntity<JSONObject> resp = restTemplate.getForEntity(rawUrl, JSONObject.class);
             JSONObject jsonArray = resp.getBody();
@@ -308,6 +319,10 @@ public class EdosUtil implements IEdosUtil {
 
         long subTime =beginDate - pried;
         String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + beginDate ;
+        if (pointid.startsWith("GF-")){
+            rawUrl = baseURL2 + "/history/section?null=0&tagNames=" + pointid + "&ts=" + beginDate ;
+        }
+
         ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
         JSONObject jsonObjectSection = sectionResp.getBody();
         if (jsonObjectSection != null) {
@@ -417,7 +432,13 @@ public class EdosUtil implements IEdosUtil {
             Optional<String> uniformCodes = Optional.ofNullable(point.getUniformCode());
 
             try {
-                String url = baseURL + "/latest?null=0";
+                String url = "";
+                if (point.getTypeId().equals("G")){
+                    url = baseURL2 + "/latest?null=0";
+                }else {
+                    url = baseURL + "/latest?null=0";
+                }
+
                 //tagName 或thingType,thingId,uniformCode可以确定一个标签点
                 if (keys.isPresent())
                     url = url + "&keys=" + keys.get();
@@ -482,7 +503,12 @@ public class EdosUtil implements IEdosUtil {
             Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
 
             try {
-                String url = baseURL + "/history/snap?null=0";
+                String url ="";
+                if (point.getTypeId().equals("G")){
+                    url = baseURL2 + "/history/snap?null=0";
+                }else {
+                    url = baseURL + "/history/snap?null=0";
+                }
                 //tagName 或thingType,thingId,uniformCode可以确定一个标签点
                 if (tagName.isPresent())
                     url = url + "&tagName=" + tagName.get();
@@ -518,7 +544,12 @@ public class EdosUtil implements IEdosUtil {
                             //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
                             // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
                             // 则代表该时间节点快照有效,否则为0
+
                             String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + snapItem.getPointTime() ;
+                            if (point.getTypeId().equals("G")){
+                                rawUrl = baseURL2 + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + snapItem.getPointTime() ;
+                            }
+
                             ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
                             JSONObject jsonObjectSection = sectionResp.getBody();
 
@@ -596,7 +627,12 @@ public class EdosUtil implements IEdosUtil {
             Optional<Long> startTs = Optional.ofNullable(beginDate);
             Optional<Long> endTs = Optional.ofNullable(endDate);
             try {
-                String url = baseURL + "/history/snap?null=0";
+                String url = "";
+                if (point.getTypeId().equals("G")){
+                    url = baseURL2 + "/history/snap?null=0";
+                }else {
+                    url = baseURL + "/history/snap?null=0";
+                }
                 //tagName 或thingType,thingId,uniformCode可以确定一个标签点
                 if (tagName.isPresent())
                     url = url + "&tagName=" + tagName.get();
@@ -649,6 +685,10 @@ public class EdosUtil implements IEdosUtil {
         {
             Optional<String> keys = Optional.ofNullable(pointid);
             String url = baseURL + "/latest?null=0";
+            if (pointid.startsWith("GF-")){
+                url = baseURL2 + "/latest?null=0";
+            }
+
             try {
                 if (keys.isPresent())
                     url = url + "&keys=" + keys.get();
@@ -693,6 +733,9 @@ public class EdosUtil implements IEdosUtil {
         String pointIdString = StringUtil.join(pointids, ",");
         Optional<String> keys = Optional.ofNullable(pointIdString);
         String url = baseURL + "/latest?null=0";
+        if (pointIdString.startsWith("GF-")){
+            url = baseURL2 + "/latest?null=0";
+        }
         try {
             if (keys.isPresent())
                 url = url + "&keys=" + keys.get();
@@ -784,6 +827,9 @@ public class EdosUtil implements IEdosUtil {
         String pointIdString = StringUtil.join(pointids.toArray(), ",");
         Optional<String> keys = Optional.ofNullable(pointIdString);
         String url = baseURL + "/latest?null=0";
+        if (pointIdString.startsWith("GF-")){
+            url = baseURL2 + "/latest?null=0";
+        }
         try {
             if (keys.isPresent())
                 url = url + "&keys=" + keys.get();
@@ -886,6 +932,9 @@ public class EdosUtil implements IEdosUtil {
                 String pointIdString = StringUtil.join(pointids, ",");
                 Optional<String> keys = Optional.ofNullable(pointIdString);
                 String url = baseURL + "/latest?null=0";
+                if (pointIdString.startsWith("GF-")){
+                    url = baseURL2 + "/latest?null=0";
+                }
                 try {
                     if (keys.isPresent())
                         url = url + "&keys=" + keys.get();
@@ -975,6 +1024,9 @@ public class EdosUtil implements IEdosUtil {
 
             try {
                 String url = baseURL + "/history/snap?null=0";
+                if (pointid.startsWith("GF-")){
+                    url = baseURL2 + "/history/snap?null=0";
+                }
                 //tagName 或thingType,thingId,uniformCode可以确定一个标签点
                 if (tagName.isPresent())
                     url = url + "&tagName=" + tagName.get();
@@ -1004,6 +1056,9 @@ public class EdosUtil implements IEdosUtil {
                             // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
                             // 则代表该时间节点快照有效,否则为0
                             String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() ;
+                            if (pointid.startsWith("GF-")){
+                                rawUrl = baseURL2 + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() ;
+                            }
                             ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
                             JSONObject jsonObjectSection = sectionResp.getBody();
 
@@ -1082,7 +1137,11 @@ public class EdosUtil implements IEdosUtil {
             Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
 
             try {
+
                 String url = baseURL + "/history/raw?null=0";
+                if (pointid.startsWith("GF-")){
+                    url = baseURL2 + "/history/raw?null=0";
+                }
                 //tagName 或thingType,thingId,uniformCode可以确定一个标签点
                 if (tagName.isPresent())
                     url = url + "&tagName=" + tagName.get();
@@ -1149,7 +1208,12 @@ public class EdosUtil implements IEdosUtil {
             Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
 
             try {
-                String url = baseURL + "/history/stat?null=0";
+                String url = "";
+                if (point.getTypeId().equals("G")){
+                    url = baseURL2 + "/history/stat?null=0";
+                }else {
+                    url = baseURL + "/history/stat?null=0";
+                }
                 //tagName 或thingType,thingId,uniformCode可以确定一个标签点
                 if (tagName.isPresent())
                     url = url + "&tagName=" + tagName.get();
@@ -1285,6 +1349,9 @@ public class EdosUtil implements IEdosUtil {
             Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
             try {
                 String url = baseURL + "/history/stat?null=0";
+                if (pointid.startsWith("GF-")){
+                    url = baseURL2 + "/history/stat?null=0";
+                }
                 //tagName 或thingType,thingId,uniformCode可以确定一个标签点
                 if (tagName.isPresent())
                     url = url + "&tagName=" + tagName.get();
@@ -1338,6 +1405,9 @@ public class EdosUtil implements IEdosUtil {
 
             try {
                 String url = baseURL + "/history/stat?null=0";
+                if (point.startsWith("GF-")){
+                    url = baseURL2 + "/history/stat?null=0";
+                }
                 //tagName 或thingType,thingId,uniformCode可以确定一个标签点
                 if (tagName.isPresent())
                     url = url + "&tagName=" + tagName.get();
@@ -1415,7 +1485,7 @@ public class EdosUtil implements IEdosUtil {
         JSONObject jo = new JSONObject();
         jo.put("tagName", pd.getEdnaId());
         JSONObject joo = new JSONObject();
-        joo.put("ts", pd.getPointTime()*1000);
+        joo.put("ts", pd.getPointTime());
         joo.put("status", 0);
         joo.put("doubleValue", pd.getPointValueInDouble());
         jo.put("tsData", joo);
@@ -1425,6 +1495,9 @@ public class EdosUtil implements IEdosUtil {
     @Override
     public void updatePoint(PointData point) throws Exception {
         String url = baseURL + "/history";
+        if (point.getEdnaId().startsWith("GF-")){
+            url = baseURL2 + "/history";
+        }
         try {
             String result = restTemplate.postForObject(url, convertPointData(point), String.class);
         } catch (HttpClientErrorException exception) {
@@ -1687,6 +1760,9 @@ public class EdosUtil implements IEdosUtil {
 
             try {
                 String url = baseURL + "/history/snap?null=0";
+                if (pointid.startsWith("GF-")){
+                    url = baseURL2 + "/history/snap?null=0";
+                }
                 //tagName 或thingType,thingId,uniformCode可以确定一个标签点
                 if (tagName.isPresent())
                     url = url + "&tagName=" + tagName.get();
@@ -1789,6 +1865,9 @@ public class EdosUtil implements IEdosUtil {
         Optional<String> tagName = Optional.ofNullable(tagNameString);
         Optional<Long> ts = Optional.ofNullable(time * 1000);
         String url = baseURL + "/history/section?tagNames=" + tagName.get() + "&ts=" + ts.get();
+        if (tagNameString.startsWith("GF-")){
+            url = baseURL2 + "/history/section?tagNames=" + tagName.get() + "&ts=" + ts.get();
+        }
         try {
             ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
             JSONObject jsonObject = resp.getBody();
@@ -1822,6 +1901,9 @@ public class EdosUtil implements IEdosUtil {
             Optional<String> tagName = Optional.ofNullable(tagNameString);
             Optional<Long> ts = Optional.ofNullable(time * 1000);
             String url = baseURL + "/history/section?tagNames=" + tagName.get() + "&ts=" + ts.get();
+            if (id.startsWith("GF-")){
+                url = baseURL2 + "/history/section?tagNames=" + tagName.get() + "&ts=" + ts.get();
+            }
             try {
                 ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
                 JSONObject jsonObject = resp.getBody();

+ 6 - 6
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/util/realtimesource/IEdosUtil.java

@@ -14,12 +14,12 @@ import java.util.Map;
 
 public interface IEdosUtil {
 
-	/**
-	 * 通过风场测点获得测点实时数据
-	 * @param point 只是用了code字段,作为唯一标识
-	 * @return
-	 * @throws Exception
-	 */
+    /**
+     * 通过风场测点获得测点实时数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @return
+     * @throws Exception
+     */
     public PointData getRealData(ProBasicPowerstationPoint point) throws Exception;