|
@@ -110,6 +110,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
|
|
Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
|
|
Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
|
|
Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
|
|
Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
|
|
Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
|
|
|
|
+ String pointid =tagName.get();
|
|
//通过时间区间和时间间隔获取点数
|
|
//通过时间区间和时间间隔获取点数
|
|
Long finalInterval;
|
|
Long finalInterval;
|
|
if (pried != null)
|
|
if (pried != null)
|
|
@@ -152,52 +153,58 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
|
|
getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
|
|
}else
|
|
}else
|
|
{
|
|
{
|
|
- resultList=snapList;
|
|
|
|
-// resultList=snapList;
|
|
|
|
-// for (PointData snapItem : snapList) {
|
|
|
|
-//
|
|
|
|
-// long subTime = snapItem.getPointTime() - pried;
|
|
|
|
-// //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
|
|
|
|
-// // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
|
|
|
|
-// // 则代表该时间节点快照有效,否则为0
|
|
|
|
-// String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
|
|
|
|
-// ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
|
|
|
|
-// JSONObject jsonObjectSection = sectionResp.getBody();
|
|
|
|
-//
|
|
|
|
-// if (jsonObjectSection != null) {
|
|
|
|
-// List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
|
|
|
|
-// if (sectionlist.size() > 0) {
|
|
|
|
-// if(sectionlist.get(0).getPointTime()>=subTime&§ionlist.get(0).getPointTime()<=snapItem.getPointTime()){
|
|
|
|
-// resultList.add(snapItem);
|
|
|
|
-// }
|
|
|
|
-// else{
|
|
|
|
-// PointData data = new PointData();
|
|
|
|
-// data.setEdnaId(point.getCode());
|
|
|
|
-// data.setPointTime(0L);
|
|
|
|
-// data.setPointValue("0");
|
|
|
|
-// data.setPointName("1");
|
|
|
|
-// data.setPointValueInDouble(0.0);
|
|
|
|
-// resultList.add(data);
|
|
|
|
-// }
|
|
|
|
-// } else {
|
|
|
|
-// PointData data = new PointData();
|
|
|
|
-// data.setEdnaId(point.getCode());
|
|
|
|
-// data.setPointTime(0l);
|
|
|
|
-// data.setPointValue("0");
|
|
|
|
-// data.setPointName("1");
|
|
|
|
-// data.setPointValueInDouble(0.0);
|
|
|
|
-// resultList.add(data);
|
|
|
|
-// }
|
|
|
|
-// } else {
|
|
|
|
-// PointData data = new PointData();
|
|
|
|
-// data.setEdnaId(point.getCode());
|
|
|
|
-// data.setPointTime(0l);
|
|
|
|
-// data.setPointValue("0");
|
|
|
|
-// data.setPointName("1");
|
|
|
|
-// data.setPointValueInDouble(0.0);
|
|
|
|
-// resultList.add(data);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
|
|
+ if(StringUtils.notEmp(pointid) && !pointid.startsWith(JKFC) && !pointid.startsWith(JKFJ))
|
|
|
|
+ {
|
|
|
|
+ resultList=snapList;
|
|
|
|
+ }else
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ for (PointData snapItem : snapList) {
|
|
|
|
+
|
|
|
|
+ long subTime = snapItem.getPointTime() - pried;
|
|
|
|
+ //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
|
|
|
|
+ // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
|
|
|
|
+ // 则代表该时间节点快照有效,否则为0
|
|
|
|
+ String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + snapItem.getPointTime() + "000";
|
|
|
|
+ ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
|
|
|
|
+ JSONObject jsonObjectSection = sectionResp.getBody();
|
|
|
|
+
|
|
|
|
+ if (jsonObjectSection != null) {
|
|
|
|
+ List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
|
|
|
|
+ if (sectionlist.size() > 0) {
|
|
|
|
+ if(sectionlist.get(0).getPointTime()>=subTime&§ionlist.get(0).getPointTime()<=snapItem.getPointTime()){
|
|
|
|
+ resultList.add(snapItem);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ PointData data = new PointData();
|
|
|
|
+ data.setEdnaId(pointid);
|
|
|
|
+ data.setPointTime(snapItem.getPointTime());
|
|
|
|
+ data.setPointValue("0");
|
|
|
|
+ data.setPointName("1");
|
|
|
|
+ data.setPointValueInDouble(0.0);
|
|
|
|
+ resultList.add(data);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ PointData data = new PointData();
|
|
|
|
+ data.setEdnaId(pointid);
|
|
|
|
+ data.setPointTime(snapItem.getPointTime());
|
|
|
|
+ data.setPointValue("0");
|
|
|
|
+ data.setPointName("1");
|
|
|
|
+ data.setPointValueInDouble(0.0);
|
|
|
|
+ resultList.add(data);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ PointData data = new PointData();
|
|
|
|
+ data.setEdnaId(pointid);
|
|
|
|
+ data.setPointTime(snapItem.getPointTime());
|
|
|
|
+ data.setPointValue("0");
|
|
|
|
+ data.setPointName("1");
|
|
|
|
+ data.setPointValueInDouble(0.0);
|
|
|
|
+ resultList.add(data);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -424,6 +431,8 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
|
|
Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
|
|
Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
|
|
Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
|
|
Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
|
|
Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
|
|
|
|
+
|
|
|
|
+ String pointid =tagName.get();
|
|
//通过时间区间和时间间隔获取点数
|
|
//通过时间区间和时间间隔获取点数
|
|
Long finalInterval;
|
|
Long finalInterval;
|
|
if (pried != null)
|
|
if (pried != null)
|
|
@@ -467,50 +476,58 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
}else
|
|
}else
|
|
{
|
|
{
|
|
|
|
|
|
- resultList=snapList;
|
|
|
|
-// for (PointData snapItem : snapList) {
|
|
|
|
-// long subTime = snapItem.getPointTime() - pried;
|
|
|
|
-// //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
|
|
|
|
-// // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
|
|
|
|
-// // 则代表该时间节点快照有效,否则为0
|
|
|
|
-// String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
|
|
|
|
-// ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
|
|
|
|
-// JSONObject jsonObjectSection = sectionResp.getBody();
|
|
|
|
-//
|
|
|
|
-// if (jsonObjectSection != null) {
|
|
|
|
-// List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
|
|
|
|
-// if (sectionlist.size() > 0) {
|
|
|
|
-// if(sectionlist.get(0).getPointTime()>=subTime&§ionlist.get(0).getPointTime()<=snapItem.getPointTime()){
|
|
|
|
-// resultList.add(snapItem);
|
|
|
|
-// }
|
|
|
|
-// else{
|
|
|
|
-// PointData data = new PointData();
|
|
|
|
-// data.setEdnaId(point.getCode());
|
|
|
|
-// data.setPointTime(0L);
|
|
|
|
-// data.setPointValue("0");
|
|
|
|
-// data.setPointName("1");
|
|
|
|
-// data.setPointValueInDouble(0.0);
|
|
|
|
-// resultList.add(data);
|
|
|
|
-// }
|
|
|
|
-// } else {
|
|
|
|
-// PointData data = new PointData();
|
|
|
|
-// data.setEdnaId(point.getCode());
|
|
|
|
-// data.setPointTime(0l);
|
|
|
|
-// data.setPointValue("0");
|
|
|
|
-// data.setPointName("1");
|
|
|
|
-// data.setPointValueInDouble(0.0);
|
|
|
|
-// resultList.add(data);
|
|
|
|
-// }
|
|
|
|
-// } else {
|
|
|
|
-// PointData data = new PointData();
|
|
|
|
-// data.setEdnaId(point.getCode());
|
|
|
|
-// data.setPointTime(0l);
|
|
|
|
-// data.setPointValue("0");
|
|
|
|
-// data.setPointName("1");
|
|
|
|
-// data.setPointValueInDouble(0.0);
|
|
|
|
-// resultList.add(data);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
|
|
+ if(StringUtils.notEmp(pointid) && !pointid.startsWith(JKFC) && !pointid.startsWith(JKFJ))
|
|
|
|
+ {
|
|
|
|
+ resultList=snapList;
|
|
|
|
+ }else
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ for (PointData snapItem : snapList) {
|
|
|
|
+
|
|
|
|
+ long subTime = snapItem.getPointTime() - pried;
|
|
|
|
+ //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
|
|
|
|
+ // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
|
|
|
|
+ // 则代表该时间节点快照有效,否则为0
|
|
|
|
+ String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
|
|
|
|
+ ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
|
|
|
|
+ JSONObject jsonObjectSection = sectionResp.getBody();
|
|
|
|
+
|
|
|
|
+ if (jsonObjectSection != null) {
|
|
|
|
+ List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
|
|
|
|
+ if (sectionlist.size() > 0) {
|
|
|
|
+ if(sectionlist.get(0).getPointTime()>=subTime&§ionlist.get(0).getPointTime()<=snapItem.getPointTime()){
|
|
|
|
+ resultList.add(snapItem);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ PointData data = new PointData();
|
|
|
|
+ data.setEdnaId(point.getCode());
|
|
|
|
+ data.setPointTime(snapItem.getPointTime());
|
|
|
|
+ data.setPointValue("0");
|
|
|
|
+ data.setPointName("1");
|
|
|
|
+ data.setPointValueInDouble(0.0);
|
|
|
|
+ resultList.add(data);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ PointData data = new PointData();
|
|
|
|
+ data.setEdnaId(point.getCode());
|
|
|
|
+ data.setPointTime(snapItem.getPointTime());
|
|
|
|
+ data.setPointValue("0");
|
|
|
|
+ data.setPointName("1");
|
|
|
|
+ data.setPointValueInDouble(0.0);
|
|
|
|
+ resultList.add(data);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ PointData data = new PointData();
|
|
|
|
+ data.setEdnaId(point.getCode());
|
|
|
|
+ data.setPointTime(snapItem.getPointTime());
|
|
|
|
+ data.setPointValue("0");
|
|
|
|
+ data.setPointName("1");
|
|
|
|
+ data.setPointValueInDouble(0.0);
|
|
|
|
+ resultList.add(data);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -840,6 +857,8 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
}
|
|
}
|
|
|
|
|
|
ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
|
|
ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
|
|
|
|
+
|
|
|
|
+ // System.out.println("数据适配器"+url);
|
|
JSONObject jsonObject = resp.getBody();
|
|
JSONObject jsonObject = resp.getBody();
|
|
if (jsonObject != null) {
|
|
if (jsonObject != null) {
|
|
|
|
|
|
@@ -1098,50 +1117,58 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
}else
|
|
}else
|
|
{
|
|
{
|
|
|
|
|
|
- resultList=list;
|
|
|
|
-// for (PointData snapItem : list) {
|
|
|
|
-// long subTime = snapItem.getPointTime() - pried;
|
|
|
|
-// //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
|
|
|
|
-// // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
|
|
|
|
-// // 则代表该时间节点快照有效,否则为0
|
|
|
|
-// String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() + "000";
|
|
|
|
-// ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
|
|
|
|
-// JSONObject jsonObjectSection = sectionResp.getBody();
|
|
|
|
-//
|
|
|
|
-// if (jsonObjectSection != null) {
|
|
|
|
-// List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
|
|
|
|
-// if (sectionlist.size() > 0) {
|
|
|
|
-// if(sectionlist.get(0).getPointTime()>=subTime&§ionlist.get(0).getPointTime()<=snapItem.getPointTime()){
|
|
|
|
-// resultList.add(snapItem);
|
|
|
|
-// }
|
|
|
|
-// else{
|
|
|
|
-// PointData data = new PointData();
|
|
|
|
-// data.setEdnaId(pointid);
|
|
|
|
-// data.setPointTime(0L);
|
|
|
|
-// data.setPointValue("0");
|
|
|
|
-// data.setPointName("1");
|
|
|
|
-// data.setPointValueInDouble(0.0);
|
|
|
|
-// resultList.add(data);
|
|
|
|
-// }
|
|
|
|
-// } else {
|
|
|
|
-// PointData data = new PointData();
|
|
|
|
-// data.setEdnaId(pointid);
|
|
|
|
-// data.setPointTime(0l);
|
|
|
|
-// data.setPointValue("0");
|
|
|
|
-// data.setPointName("1");
|
|
|
|
-// data.setPointValueInDouble(0.0);
|
|
|
|
-// resultList.add(data);
|
|
|
|
-// }
|
|
|
|
-// } else {
|
|
|
|
-// PointData data = new PointData();
|
|
|
|
-// data.setEdnaId(pointid);
|
|
|
|
-// data.setPointTime(0l);
|
|
|
|
-// data.setPointValue("0");
|
|
|
|
-// data.setPointName("1");
|
|
|
|
-// data.setPointValueInDouble(0.0);
|
|
|
|
-// resultList.add(data);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
|
|
+ if(StringUtils.notEmp(pointid) && !pointid.startsWith(JKFC) && !pointid.startsWith(JKFJ))
|
|
|
|
+ {
|
|
|
|
+ resultList=list;
|
|
|
|
+ }else
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ for (PointData snapItem : list) {
|
|
|
|
+
|
|
|
|
+ long subTime = snapItem.getPointTime() - pried;
|
|
|
|
+ //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
|
|
|
|
+ // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
|
|
|
|
+ // 则代表该时间节点快照有效,否则为0
|
|
|
|
+ String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + snapItem.getPointTime() + "000";
|
|
|
|
+ ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
|
|
|
|
+ JSONObject jsonObjectSection = sectionResp.getBody();
|
|
|
|
+
|
|
|
|
+ if (jsonObjectSection != null) {
|
|
|
|
+ List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
|
|
|
|
+ if (sectionlist.size() > 0) {
|
|
|
|
+ if(sectionlist.get(0).getPointTime()>=subTime&§ionlist.get(0).getPointTime()<=snapItem.getPointTime()){
|
|
|
|
+ resultList.add(snapItem);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ PointData data = new PointData();
|
|
|
|
+ data.setEdnaId(pointid);
|
|
|
|
+ data.setPointTime(snapItem.getPointTime());
|
|
|
|
+ data.setPointValue("0");
|
|
|
|
+ data.setPointName("1");
|
|
|
|
+ data.setPointValueInDouble(0.0);
|
|
|
|
+ resultList.add(data);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ PointData data = new PointData();
|
|
|
|
+ data.setEdnaId(pointid);
|
|
|
|
+ data.setPointTime(snapItem.getPointTime());
|
|
|
|
+ data.setPointValue("0");
|
|
|
|
+ data.setPointName("1");
|
|
|
|
+ data.setPointValueInDouble(0.0);
|
|
|
|
+ resultList.add(data);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ PointData data = new PointData();
|
|
|
|
+ data.setEdnaId(pointid);
|
|
|
|
+ data.setPointTime(snapItem.getPointTime());
|
|
|
|
+ data.setPointValue("0");
|
|
|
|
+ data.setPointName("1");
|
|
|
|
+ data.setPointValueInDouble(0.0);
|
|
|
|
+ resultList.add(data);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
return resultList;
|
|
return resultList;
|