|
@@ -136,50 +136,52 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
|
|
getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
|
|
}else
|
|
}else
|
|
{
|
|
{
|
|
- for (PointData snapItem : snapList) {
|
|
+ resultList=snapList;
|
|
-
|
|
+
|
|
- long subTime = snapItem.getPointTime() - pried;
|
|
+
|
|
-
|
|
+
|
|
-
|
|
+
|
|
-
|
|
+
|
|
- 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);
|
|
+
|
|
- }
|
|
+
|
|
- }
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -424,49 +426,51 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
|
|
getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
|
|
}else
|
|
}else
|
|
{
|
|
{
|
|
- for (PointData snapItem : snapList) {
|
|
+
|
|
- long subTime = snapItem.getPointTime() - pried;
|
|
+ resultList=snapList;
|
|
-
|
|
+
|
|
-
|
|
+
|
|
-
|
|
+
|
|
- 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);
|
|
+
|
|
- }
|
|
+
|
|
- }
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -611,7 +615,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
idls.add(str);
|
|
idls.add(str);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(!idls.isEmpty() )
|
|
+ if(!idls.isEmpty() )
|
|
{
|
|
{
|
|
String pointIdString = StringUtil.join(idls.toArray(), ",");
|
|
String pointIdString = StringUtil.join(idls.toArray(), ",");
|
|
Optional<String> keys = Optional.ofNullable(pointIdString);
|
|
Optional<String> keys = Optional.ofNullable(pointIdString);
|
|
@@ -626,32 +630,25 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
JSONObject jsonObject = resp.getBody();
|
|
JSONObject jsonObject = resp.getBody();
|
|
if (jsonObject != null) {
|
|
if (jsonObject != null) {
|
|
|
|
|
|
- int len = idls.size();
|
|
+ int len = pointids.length;
|
|
List<PointData> result = new ArrayList<>();
|
|
List<PointData> result = new ArrayList<>();
|
|
HashMap<String, PointData> pointDataHashMap = new HashMap<>();
|
|
HashMap<String, PointData> pointDataHashMap = new HashMap<>();
|
|
for (int i = 0; i < len; i++) {
|
|
for (int i = 0; i < len; i++) {
|
|
|
|
|
|
|
|
|
|
- PointData pd = new PointData();
|
|
+ if (pointDataHashMap.containsKey(pointids[i]) == false){
|
|
- pd.setPointName(pointids[i]);
|
|
+ PointData pd = new PointData();
|
|
- pd.setEdnaId(pointids[i]);
|
|
+ pd.setPointName(pointids[i]);
|
|
- pd.setPointValueInDouble(0.0);
|
|
+ pd.setEdnaId(pointids[i]);
|
|
- pd.setPointTime(0l);
|
|
+ pd.setPointValueInDouble(0.0);
|
|
- result.add(pd);
|
|
+ pd.setPointTime(0l);
|
|
-
|
|
+ result.add(pd);
|
|
- pointDataHashMap.put(pd.getPointName(), pd);
|
|
|
|
|
|
|
|
-
|
|
+ pointDataHashMap.put(pd.getPointName(), pd);
|
|
-
|
|
+ }
|
|
-
|
|
+ else{
|
|
-
|
|
+ result.add(pointDataHashMap.get(pointids[i]));
|
|
-
|
|
+ }
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
}
|
|
}
|
|
Iterator<String> sIterator = jsonObject.keySet().iterator();
|
|
Iterator<String> sIterator = jsonObject.keySet().iterator();
|
|
@@ -780,27 +777,19 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
HashMap<String, PointData> pointDataHashMap = new HashMap<>();
|
|
HashMap<String, PointData> pointDataHashMap = new HashMap<>();
|
|
for (int i = 0; i < len; i++) {
|
|
for (int i = 0; i < len; i++) {
|
|
|
|
|
|
- PointData pd = new PointData();
|
|
+ if (pointDataHashMap.containsKey(pointids.get(i)) == false){
|
|
- pd.setPointName(pointids.get(i));
|
|
+ PointData pd = new PointData();
|
|
- pd.setEdnaId(pointids.get(i));
|
|
+ pd.setPointName(pointids.get(i));
|
|
- pd.setPointValueInDouble(0.0);
|
|
+ pd.setEdnaId(pointids.get(i));
|
|
- pd.setPointTime(0l);
|
|
+ pd.setPointValueInDouble(0.0);
|
|
- result.add(pd);
|
|
+ pd.setPointTime(0l);
|
|
-
|
|
+ result.add(pd);
|
|
- pointDataHashMap.put(pd.getPointName(), pd);
|
|
|
|
-
|
|
|
|
|
|
|
|
-
|
|
+ pointDataHashMap.put(pd.getPointName(), pd);
|
|
-
|
|
+ }
|
|
-
|
|
+ else{
|
|
-
|
|
+ result.add(pointDataHashMap.get(pointids.get(i)));
|
|
-
|
|
+ }
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
Iterator<String> sIterator = jsonObject.keySet().iterator();
|
|
Iterator<String> sIterator = jsonObject.keySet().iterator();
|
|
while (sIterator.hasNext()) {
|
|
while (sIterator.hasNext()) {
|
|
@@ -1018,49 +1007,51 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
getHistsnapSameTiem(pointid, beginDate, pried, resultList);
|
|
getHistsnapSameTiem(pointid, beginDate, pried, resultList);
|
|
}else
|
|
}else
|
|
{
|
|
{
|
|
- for (PointData snapItem : list) {
|
|
+
|
|
- long subTime = snapItem.getPointTime() - pried;
|
|
+ resultList=list;
|
|
-
|
|
+
|
|
-
|
|
+
|
|
-
|
|
+
|
|
- 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);
|
|
+
|
|
- }
|
|
+
|
|
- }
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
return resultList;
|
|
return resultList;
|
|
@@ -1660,4 +1651,4 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-}
|
|
+}
|