|
@@ -41,7 +41,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
@Override
|
|
|
public PointData getRealData(ProBasicPowerstationPoint point) throws Exception {
|
|
|
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !point.getCode().startsWith(JKFC) && !point.getCode().startsWith(JKFJ))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !point.getNemCode().startsWith(JKFC) && !point.getNemCode().startsWith(JKFJ))
|
|
|
{
|
|
|
baseURL = V2Config.getBaseurl();
|
|
|
}else
|
|
@@ -49,13 +49,13 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
baseURL = V2Config.getHealthurl();
|
|
|
}
|
|
|
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !V2Config.getInitialcode().equals(point.getCode()))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !V2Config.getInitialcode().equals(point.getNemCode()))
|
|
|
{
|
|
|
try {
|
|
|
- Optional<String> keys = Optional.ofNullable(point.getCode());
|
|
|
+ Optional<String> keys = Optional.ofNullable(point.getNemCode());
|
|
|
Optional<String> thingType = Optional.ofNullable("station");
|
|
|
Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
|
|
|
- Optional<String> uniformCodes = Optional.ofNullable(point.getUniformcode());
|
|
|
+ Optional<String> uniformCodes = Optional.ofNullable(point.getUniformCode());
|
|
|
|
|
|
String url = baseURL + "/latest?null=0";
|
|
|
if (keys.isPresent())
|
|
@@ -74,14 +74,14 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
if (list.size() > 0)
|
|
|
return list.get(0);
|
|
|
else
|
|
|
- return ErrorRequest.RequestError(point.getCode());
|
|
|
+ return ErrorRequest.RequestError(point.getNemCode());
|
|
|
} else {
|
|
|
- return ErrorRequest.RequestError(point.getCode());
|
|
|
+ return ErrorRequest.RequestError(point.getNemCode());
|
|
|
}
|
|
|
} catch (HttpClientErrorException exception) {
|
|
|
if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
|
|
|
//System.out.println("404请求错误");
|
|
|
- return ErrorRequest.RequestError(point.getCode());
|
|
|
+ return ErrorRequest.RequestError(point.getNemCode());
|
|
|
} else {
|
|
|
throw exception;
|
|
|
}
|
|
@@ -89,7 +89,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
}else
|
|
|
{
|
|
|
PointData po=new PointData();
|
|
|
- po.setEdnaId(point.getCode());
|
|
|
+ po.setEdnaId(point.getNemCode());
|
|
|
po.setPointValueInDouble(0.0);
|
|
|
po.setPointTime(0l);
|
|
|
return po;
|
|
@@ -101,19 +101,19 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
@Override
|
|
|
public List<PointData> getHistoryDatasSnap(ProBasicPowerstationPoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
|
|
|
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !point.getCode().startsWith(JKFC) && !point.getCode().startsWith(JKFJ))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !point.getNemCode().startsWith(JKFC) && !point.getNemCode().startsWith(JKFJ))
|
|
|
{
|
|
|
baseURL = V2Config.getBaseurl();
|
|
|
}else
|
|
|
{
|
|
|
baseURL = V2Config.getHealthurl();
|
|
|
}
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !V2Config.getInitialcode().equals(point.getCode()))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !V2Config.getInitialcode().equals(point.getNemCode()))
|
|
|
{
|
|
|
- Optional<String> tagName = Optional.ofNullable(point.getCode());
|
|
|
+ Optional<String> tagName = Optional.ofNullable(point.getNemCode());
|
|
|
Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
|
|
|
Optional<String> thingType = Optional.ofNullable(point.getModelId());
|
|
|
- Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
|
|
|
+ Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
|
|
|
Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
|
|
|
Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
|
|
|
String pointid =tagName.get();
|
|
@@ -124,7 +124,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
else if (count != null)
|
|
|
finalInterval = (endDate - beginDate) / count;
|
|
|
else
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
|
|
|
|
|
|
try {
|
|
@@ -150,13 +150,13 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
|
|
|
JSONArray jsonArray = resp.getBody();
|
|
|
if (jsonArray != null) {
|
|
|
- List<PointData> snapList = JsonObjectHelper.phrasePointData(jsonArray, point.getCode());
|
|
|
+ List<PointData> snapList = JsonObjectHelper.phrasePointData(jsonArray, point.getNemCode());
|
|
|
List<PointData> resultList = new ArrayList<>();
|
|
|
|
|
|
if(snapList.isEmpty())
|
|
|
{
|
|
|
|
|
|
- getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
|
|
|
+ getHistsnapSameTiem(point.getNemCode(), beginDate, pried, resultList);
|
|
|
}else
|
|
|
{
|
|
|
if(StringUtils.notEmp(pointid) && !pointid.startsWith(JKFC) && !pointid.startsWith(JKFJ))
|
|
@@ -218,13 +218,13 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
|
|
|
|
|
|
} else {
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
}
|
|
|
|
|
|
} catch (HttpClientErrorException exception) {
|
|
|
if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
|
|
|
//System.out.println("404请求错误");
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
} else {
|
|
|
throw exception;
|
|
|
}
|
|
@@ -233,7 +233,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
{
|
|
|
List<PointData> pols=new ArrayList<>();
|
|
|
PointData po=new PointData();
|
|
|
- po.setEdnaId(point.getCode());
|
|
|
+ po.setEdnaId(point.getNemCode());
|
|
|
po.setPointValueInDouble(0.0);
|
|
|
po.setPointTime(0l);
|
|
|
pols.add(po);
|
|
@@ -296,19 +296,19 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
|
|
|
@Override
|
|
|
public List<PointData> getHistoryDatasRaw(ProBasicPowerstationPoint point, Long beginDate, Long endDate) throws Exception {
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !point.getCode().startsWith(JKFC) && !point.getCode().startsWith(JKFJ))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !point.getNemCode().startsWith(JKFC) && !point.getNemCode().startsWith(JKFJ))
|
|
|
{
|
|
|
baseURL = V2Config.getBaseurl();
|
|
|
}else
|
|
|
{
|
|
|
baseURL = V2Config.getHealthurl();
|
|
|
}
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !V2Config.getInitialcode().equals(point.getCode()))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !V2Config.getInitialcode().equals(point.getNemCode()))
|
|
|
{
|
|
|
- Optional<String> tagName = Optional.ofNullable(point.getCode());
|
|
|
+ Optional<String> tagName = Optional.ofNullable(point.getNemCode());
|
|
|
Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
|
|
|
Optional<String> thingType = Optional.ofNullable(point.getModelId());
|
|
|
- Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
|
|
|
+ Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
|
|
|
Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
|
|
|
Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
|
|
|
|
|
@@ -334,15 +334,15 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
|
|
|
JSONArray jsonArray = resp.getBody();
|
|
|
if (jsonArray != null)
|
|
|
- return JsonObjectHelper.phrasePointData(jsonArray, point.getCode());
|
|
|
+ return JsonObjectHelper.phrasePointData(jsonArray, point.getNemCode());
|
|
|
else {
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
}
|
|
|
|
|
|
} catch (HttpClientErrorException exception) {
|
|
|
if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
|
|
|
//System.out.println("404请求错误");
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
} else {
|
|
|
throw exception;
|
|
|
}
|
|
@@ -351,7 +351,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
{
|
|
|
List<PointData> pols=new ArrayList<>();
|
|
|
PointData po=new PointData();
|
|
|
- po.setEdnaId(point.getCode());
|
|
|
+ po.setEdnaId(point.getNemCode());
|
|
|
po.setPointValueInDouble(0.0);
|
|
|
po.setPointTime(0l);
|
|
|
pols.add(po);
|
|
@@ -362,19 +362,19 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
|
|
|
@Override
|
|
|
public PointData getRealData(ProBasicEquipmentPoint point) throws Exception {
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !point.getCode().startsWith(JKFC) && !point.getCode().startsWith(JKFJ))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !point.getNemCode().startsWith(JKFC) && !point.getNemCode().startsWith(JKFJ))
|
|
|
{
|
|
|
baseURL = V2Config.getBaseurl();
|
|
|
}else
|
|
|
{
|
|
|
baseURL = V2Config.getHealthurl();
|
|
|
}
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !V2Config.getInitialcode().equals(point.getCode()))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !V2Config.getInitialcode().equals(point.getNemCode()))
|
|
|
{
|
|
|
- Optional<String> keys = Optional.ofNullable(point.getCode());
|
|
|
+ Optional<String> keys = Optional.ofNullable(point.getNemCode());
|
|
|
Optional<String> thingType = Optional.ofNullable(point.getModelId());
|
|
|
Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
|
|
|
- Optional<String> uniformCodes = Optional.ofNullable(point.getUniformcode());
|
|
|
+ Optional<String> uniformCodes = Optional.ofNullable(point.getUniformCode());
|
|
|
|
|
|
try {
|
|
|
String url = baseURL + "/latest?null=0";
|
|
@@ -396,15 +396,15 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
if (list.size() > 0)
|
|
|
return list.get(0);
|
|
|
else
|
|
|
- return ErrorRequest.RequestError(point.getCode());
|
|
|
+ return ErrorRequest.RequestError(point.getNemCode());
|
|
|
} else {
|
|
|
- return ErrorRequest.RequestError(point.getCode());
|
|
|
+ return ErrorRequest.RequestError(point.getNemCode());
|
|
|
}
|
|
|
|
|
|
} catch (HttpClientErrorException exception) {
|
|
|
if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
|
|
|
//System.out.println("404请求错误");
|
|
|
- return ErrorRequest.RequestError(point.getCode());
|
|
|
+ return ErrorRequest.RequestError(point.getNemCode());
|
|
|
} else {
|
|
|
throw exception;
|
|
|
}
|
|
@@ -412,7 +412,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
}else
|
|
|
{
|
|
|
PointData po=new PointData();
|
|
|
- po.setEdnaId(point.getCode());
|
|
|
+ po.setEdnaId(point.getNemCode());
|
|
|
po.setPointValueInDouble(0.0);
|
|
|
po.setPointTime(0l);
|
|
|
return po;
|
|
@@ -422,19 +422,19 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
|
|
|
@Override
|
|
|
public List<PointData> getHistoryDatasSnap(ProBasicEquipmentPoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !point.getCode().startsWith(JKFC) && !point.getCode().startsWith(JKFJ))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !point.getNemCode().startsWith(JKFC) && !point.getNemCode().startsWith(JKFJ))
|
|
|
{
|
|
|
baseURL = V2Config.getBaseurl();
|
|
|
}else
|
|
|
{
|
|
|
baseURL = V2Config.getHealthurl();
|
|
|
}
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !V2Config.getInitialcode().equals(point.getCode()))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !V2Config.getInitialcode().equals(point.getNemCode()))
|
|
|
{
|
|
|
- Optional<String> tagName = Optional.ofNullable(point.getCode());
|
|
|
+ Optional<String> tagName = Optional.ofNullable(point.getNemCode());
|
|
|
Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
|
|
|
Optional<String> thingType = Optional.ofNullable(point.getModelId());
|
|
|
- Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
|
|
|
+ Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
|
|
|
Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
|
|
|
Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
|
|
|
|
|
@@ -446,7 +446,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
else if (count != null)
|
|
|
finalInterval = (endDate - beginDate) / count;
|
|
|
else
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
|
|
|
|
|
|
try {
|
|
@@ -472,13 +472,13 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
|
|
|
JSONArray jsonArray = resp.getBody();
|
|
|
if (jsonArray != null) {
|
|
|
- List<PointData> snapList = JsonObjectHelper.phrasePointData(jsonArray, point.getCode());
|
|
|
+ List<PointData> snapList = JsonObjectHelper.phrasePointData(jsonArray, point.getNemCode());
|
|
|
List<PointData> resultList = new ArrayList<>();
|
|
|
|
|
|
if(snapList.isEmpty())
|
|
|
{
|
|
|
|
|
|
- getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
|
|
|
+ getHistsnapSameTiem(point.getNemCode(), beginDate, pried, resultList);
|
|
|
}else
|
|
|
{
|
|
|
|
|
@@ -494,7 +494,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
//查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
|
|
|
// 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
|
|
|
// 则代表该时间节点快照有效,否则为0
|
|
|
- String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
|
|
|
+ String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + snapItem.getPointTime() + "000";
|
|
|
ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
|
|
|
JSONObject jsonObjectSection = sectionResp.getBody();
|
|
|
|
|
@@ -506,7 +506,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
}
|
|
|
else{
|
|
|
PointData data = new PointData();
|
|
|
- data.setEdnaId(point.getCode());
|
|
|
+ data.setEdnaId(point.getNemCode());
|
|
|
data.setPointTime(snapItem.getPointTime());
|
|
|
data.setPointValue("0");
|
|
|
data.setPointName("1");
|
|
@@ -515,7 +515,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
}
|
|
|
} else {
|
|
|
PointData data = new PointData();
|
|
|
- data.setEdnaId(point.getCode());
|
|
|
+ data.setEdnaId(point.getNemCode());
|
|
|
data.setPointTime(snapItem.getPointTime());
|
|
|
data.setPointValue("0");
|
|
|
data.setPointName("1");
|
|
@@ -524,7 +524,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
}
|
|
|
} else {
|
|
|
PointData data = new PointData();
|
|
|
- data.setEdnaId(point.getCode());
|
|
|
+ data.setEdnaId(point.getNemCode());
|
|
|
data.setPointTime(snapItem.getPointTime());
|
|
|
data.setPointValue("0");
|
|
|
data.setPointName("1");
|
|
@@ -539,12 +539,12 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
|
|
|
return resultList;
|
|
|
} else {
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
}
|
|
|
} catch (HttpClientErrorException exception) {
|
|
|
if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
|
|
|
//System.out.println("404请求错误");
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
} else {
|
|
|
throw exception;
|
|
|
}
|
|
@@ -553,7 +553,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
{
|
|
|
List<PointData> pols=new ArrayList<>();
|
|
|
PointData po=new PointData();
|
|
|
- po.setEdnaId(point.getCode());
|
|
|
+ po.setEdnaId(point.getNemCode());
|
|
|
po.setPointValueInDouble(0.0);
|
|
|
po.setPointTime(0l);
|
|
|
pols.add(po);
|
|
@@ -566,7 +566,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
@Override
|
|
|
public List<PointData> getHistoryDatasRaw(ProBasicEquipmentPoint point, Long beginDate, Long endDate) throws Exception {
|
|
|
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !point.getCode().startsWith(JKFC) && !point.getCode().startsWith(JKFJ))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !point.getNemCode().startsWith(JKFC) && !point.getNemCode().startsWith(JKFJ))
|
|
|
{
|
|
|
baseURL = V2Config.getBaseurl();
|
|
|
}else
|
|
@@ -574,12 +574,12 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
baseURL = V2Config.getHealthurl();
|
|
|
}
|
|
|
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !V2Config.getInitialcode().equals(point.getCode()))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !V2Config.getInitialcode().equals(point.getNemCode()))
|
|
|
{
|
|
|
- Optional<String> tagName = Optional.ofNullable(point.getCode());
|
|
|
+ Optional<String> tagName = Optional.ofNullable(point.getNemCode());
|
|
|
Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
|
|
|
Optional<String> thingType = Optional.ofNullable(point.getModelId());
|
|
|
- Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
|
|
|
+ Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
|
|
|
Optional<Long> startTs = Optional.ofNullable(beginDate);
|
|
|
Optional<Long> endTs = Optional.ofNullable(endDate);
|
|
|
try {
|
|
@@ -604,14 +604,14 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
|
|
|
JSONArray jsonArray = resp.getBody();
|
|
|
if (jsonArray != null)
|
|
|
- return JsonObjectHelper.phrasePointData(jsonArray, point.getCode());
|
|
|
+ return JsonObjectHelper.phrasePointData(jsonArray, point.getNemCode());
|
|
|
else {
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
}
|
|
|
} catch (HttpClientErrorException exception) {
|
|
|
if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
|
|
|
//System.out.println("404请求错误");
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
} else {
|
|
|
throw exception;
|
|
|
}
|
|
@@ -620,7 +620,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
{
|
|
|
List<PointData> pols=new ArrayList<>();
|
|
|
PointData po=new PointData();
|
|
|
- po.setEdnaId(point.getCode());
|
|
|
+ po.setEdnaId(point.getNemCode());
|
|
|
po.setPointValueInDouble(0.0);
|
|
|
po.setPointTime(0l);
|
|
|
pols.add(po);
|
|
@@ -1263,19 +1263,19 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
@Override
|
|
|
public List<PointData> getHistStat(ProBasicEquipmentPoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
|
|
|
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !point.getCode().startsWith(JKFC) && !point.getCode().startsWith(JKFJ))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !point.getNemCode().startsWith(JKFC) && !point.getNemCode().startsWith(JKFJ))
|
|
|
{
|
|
|
baseURL = V2Config.getBaseurl();
|
|
|
}else
|
|
|
{
|
|
|
baseURL = V2Config.getHealthurl();
|
|
|
}
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !V2Config.getInitialcode().equals(point.getCode()))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !V2Config.getInitialcode().equals(point.getNemCode()))
|
|
|
{
|
|
|
- Optional<String> tagName = Optional.ofNullable(point.getCode());
|
|
|
+ Optional<String> tagName = Optional.ofNullable(point.getNemCode());
|
|
|
Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
|
|
|
Optional<String> thingType = Optional.ofNullable(point.getModelId());
|
|
|
- Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
|
|
|
+ Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
|
|
|
Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
|
|
|
Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
|
|
|
|
|
@@ -1292,7 +1292,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
else if (count != null)
|
|
|
finalInterval = (endDate - beginDate) / count;
|
|
|
else
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
|
|
|
|
|
|
try {
|
|
@@ -1318,14 +1318,14 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
|
|
|
JSONArray jsonArray = resp.getBody();
|
|
|
if (jsonArray != null)
|
|
|
- return JsonObjectHelper.GeneralTsDataToPointDataByStat(jsonArray, point.getCode(), type);
|
|
|
+ return JsonObjectHelper.GeneralTsDataToPointDataByStat(jsonArray, point.getNemCode(), type);
|
|
|
else {
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
}
|
|
|
} catch (HttpClientErrorException exception) {
|
|
|
if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
|
|
|
//System.out.println("404请求错误");
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
} else {
|
|
|
throw exception;
|
|
|
}
|
|
@@ -1334,7 +1334,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
{
|
|
|
List<PointData> pols=new ArrayList<>();
|
|
|
PointData po=new PointData();
|
|
|
- po.setEdnaId(point.getCode());
|
|
|
+ po.setEdnaId(point.getNemCode());
|
|
|
po.setPointValueInDouble(0.0);
|
|
|
po.setPointTime(0l);
|
|
|
pols.add(po);
|
|
@@ -1345,19 +1345,19 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
|
|
|
@Override
|
|
|
public List<PointData> getHistStat(ProBasicPowerstationPoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !point.getCode().startsWith(JKFC) && !point.getCode().startsWith(JKFJ))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !point.getNemCode().startsWith(JKFC) && !point.getNemCode().startsWith(JKFJ))
|
|
|
{
|
|
|
baseURL = V2Config.getBaseurl();
|
|
|
}else
|
|
|
{
|
|
|
baseURL = V2Config.getHealthurl();
|
|
|
}
|
|
|
- if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getCode()) && !V2Config.getInitialcode().equals(point.getCode()))
|
|
|
+ if(StringUtils.notEmp(point) && StringUtils.notEmp(point.getNemCode()) && !V2Config.getInitialcode().equals(point.getNemCode()))
|
|
|
{
|
|
|
- Optional<String> tagName = Optional.ofNullable(point.getCode());
|
|
|
+ Optional<String> tagName = Optional.ofNullable(point.getNemCode());
|
|
|
Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
|
|
|
Optional<String> thingType = Optional.ofNullable(point.getModelId());
|
|
|
- Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
|
|
|
+ Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
|
|
|
Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
|
|
|
Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
|
|
|
//通过时间区间和时间间隔获取点数
|
|
@@ -1367,7 +1367,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
else if (count != null)
|
|
|
finalInterval = (endDate - beginDate) / count;
|
|
|
else
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
|
|
|
|
|
|
try {
|
|
@@ -1393,14 +1393,14 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
|
|
|
JSONArray jsonArray = resp.getBody();
|
|
|
if (jsonArray != null)
|
|
|
- return JsonObjectHelper.GeneralTsDataToPointDataByStat(jsonArray, point.getCode(), type);
|
|
|
+ return JsonObjectHelper.GeneralTsDataToPointDataByStat(jsonArray, point.getNemCode(), type);
|
|
|
else {
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
}
|
|
|
} catch (HttpClientErrorException exception) {
|
|
|
if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
|
|
|
//System.out.println("404请求错误");
|
|
|
- return ErrorRequest.RequestListError(point.getCode());
|
|
|
+ return ErrorRequest.RequestListError(point.getNemCode());
|
|
|
} else {
|
|
|
throw exception;
|
|
|
}
|
|
@@ -1409,7 +1409,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
|
|
|
{
|
|
|
List<PointData> pols=new ArrayList<>();
|
|
|
PointData po=new PointData();
|
|
|
- po.setEdnaId(point.getCode());
|
|
|
+ po.setEdnaId(point.getNemCode());
|
|
|
po.setPointValueInDouble(0.0);
|
|
|
po.setPointTime(0l);
|
|
|
pols.add(po);
|