|
|
|
@ -39,6 +39,7 @@ public class EXAServiceImpl implements EXAService { |
|
|
|
private String EXA_IP; |
|
|
|
|
|
|
|
//根据测点名称测点描述模糊查询
|
|
|
|
|
|
|
|
/** |
|
|
|
* 根据测点名称测点描述模糊查询 |
|
|
|
* |
|
|
|
@ -47,7 +48,7 @@ public class EXAServiceImpl implements EXAService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public PageResult<EXAHttp> getEXAPage(EXAPageReqVO reqVO) throws IOException, URISyntaxException { |
|
|
|
List<EXAHttp> exaListAll = exaUtils.getPointInfo(EXA_IP,reqVO); |
|
|
|
List<EXAHttp> exaListAll = exaUtils.getPointInfo(EXA_IP, reqVO); |
|
|
|
Long total = Long.valueOf(exaListAll.size()); |
|
|
|
|
|
|
|
List<EXAHttp> exaList = getPartList(exaListAll, reqVO.getPageNo(), reqVO.getPageSize()); |
|
|
|
@ -67,7 +68,7 @@ public class EXAServiceImpl implements EXAService { |
|
|
|
|
|
|
|
list.forEach(entity -> { |
|
|
|
try { |
|
|
|
entity.setValue(exaUtils.getNowData(EXA_IP,entity.getItemName()).get(0)); |
|
|
|
entity.setValue(exaUtils.getNowData(EXA_IP, entity.getItemName()).get(0)); |
|
|
|
} catch (URISyntaxException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} catch (IOException e) { |
|
|
|
@ -86,8 +87,9 @@ public class EXAServiceImpl implements EXAService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public EXAResult getEXAListNowReal(EXANowListReqVO list) throws URISyntaxException, IOException { |
|
|
|
return exaUtils.getNowDataList(EXA_IP,list); |
|
|
|
return exaUtils.getNowDataList(EXA_IP, list); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据点号查询实时值 |
|
|
|
* |
|
|
|
@ -96,9 +98,10 @@ public class EXAServiceImpl implements EXAService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public String getEXANow(String itemName) throws URISyntaxException, IOException { |
|
|
|
return exaUtils.getNowData(EXA_IP,itemName).get(0); |
|
|
|
return exaUtils.getNowData(EXA_IP, itemName).get(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据点号查询历史值 |
|
|
|
* |
|
|
|
@ -106,9 +109,10 @@ public class EXAServiceImpl implements EXAService { |
|
|
|
* @return 分页结果 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<List<Double>> getEXAHistory(EXAHistoryReqVO exaHistoryReqVo) { |
|
|
|
return exaUtils.getHistory(EXA_IP,exaHistoryReqVo); |
|
|
|
public List<List<Double>> getEXAHistory(EXAHistoryReqVO exaHistoryReqVo) { |
|
|
|
return exaUtils.getHistory(EXA_IP, exaHistoryReqVo); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据多个点号查询历史值 |
|
|
|
* |
|
|
|
@ -116,23 +120,25 @@ public class EXAServiceImpl implements EXAService { |
|
|
|
* @return 分页结果 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<List<List<Double>>> getEXAHistorys(EXAHistoryReqVO exaHistoryReqVo) { |
|
|
|
return exaUtils.getHistorys(EXA_IP,exaHistoryReqVo); |
|
|
|
public List<List<List<Double>>> getEXAHistorys(EXAHistoryReqVO exaHistoryReqVo) { |
|
|
|
return exaUtils.getHistorys(EXA_IP, exaHistoryReqVo); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String createPoint(Point pointVo) throws IOException { |
|
|
|
return exaUtils.setPoint(EXA_IP,pointVo); |
|
|
|
public String createPoint(Point pointVo) throws IOException { |
|
|
|
return exaUtils.setPoint(EXA_IP, pointVo); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询EXA所有分组信息 |
|
|
|
* |
|
|
|
* @return 分页结果 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<List<String>> getEXAGroupInfo() throws URISyntaxException, IOException { |
|
|
|
public List<List<String>> getEXAGroupInfo() throws URISyntaxException, IOException { |
|
|
|
return exaUtils.getGroup(EXA_IP); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除EXA点号 |
|
|
|
* |
|
|
|
@ -140,14 +146,15 @@ public class EXAServiceImpl implements EXAService { |
|
|
|
* @return 分页结果 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public String deletePoint(String ItemName){ |
|
|
|
return exaUtils.deletePoint(EXA_IP,ItemName); |
|
|
|
public String deletePoint(String ItemName) { |
|
|
|
return exaUtils.deletePoint(EXA_IP, ItemName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 导入EXA点号 |
|
|
|
* |
|
|
|
* @param importPoints 导入点号列表 |
|
|
|
* @param importPoints 导入点号列表 |
|
|
|
* @param isUpdateSupport 是否支持更新 |
|
|
|
* @return 分页结果 |
|
|
|
*/ |
|
|
|
@ -164,15 +171,17 @@ public class EXAServiceImpl implements EXAService { |
|
|
|
.updateNames(new ArrayList<>()).failureNames(new LinkedHashMap<>()).build(); |
|
|
|
importPoints.forEach(importUser -> { |
|
|
|
try { |
|
|
|
String createResult=createPoint(importUser); |
|
|
|
String createResult = createPoint(importUser); |
|
|
|
EXAResult vo = JSON.parseObject(createResult, EXAResult.class); |
|
|
|
|
|
|
|
if(vo.ReturnValue.equals(1L)){ |
|
|
|
if (vo.ReturnValue.equals(1L)) { |
|
|
|
respVO.getCreateNames().add(importUser.getItemName()); |
|
|
|
} else if (vo.ReturnValue.equals(-19L)) { |
|
|
|
respVO.getFailureNames().put(importUser.getItemName(), "该点号已存在"); |
|
|
|
} else { |
|
|
|
respVO.getFailureNames().put(importUser.getItemName(), "未知错误"); |
|
|
|
} |
|
|
|
|
|
|
|
} catch (IOException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
throw exception(EXA_POINT_IMPORT_FAILED, importUser.getItemName(), e); |
|
|
|
} |
|
|
|
}); |
|
|
|
return respVO; |
|
|
|
|