dnc接口设备参数接收接口调整

master
zpl 3 years ago
parent 843b6f01a1
commit efde84df1d

@ -75,7 +75,8 @@ public class EdcDataResourceServiceImpl extends ServiceImpl<EdcDataResourceMappe
JSONObject jsonObject = JSONObject.parseObject(text); JSONObject jsonObject = JSONObject.parseObject(text);
String handle = jsonObject.getString("TRANID"); String handle = jsonObject.getString("TRANID");
String site = jsonObject.getString("SITE"); String site = jsonObject.getString("SITE");
String resource = jsonObject.getString("RESOURCE"); // String resource = jsonObject.getString("RESOURCE");
String resource = jsonObject.getString("equipmentId");
String sendTime = jsonObject.getString("SEND_TIME"); String sendTime = jsonObject.getString("SEND_TIME");
if (StringUtil.isBlank(site)) { if (StringUtil.isBlank(site)) {
throw BusinessException.build("站点不能为空!"); throw BusinessException.build("站点不能为空!");
@ -90,7 +91,7 @@ public class EdcDataResourceServiceImpl extends ServiceImpl<EdcDataResourceMappe
} }
// 参数列将参数存入MAP方便提取 // 参数列将参数存入MAP方便提取
String paramList = jsonObject.getString("PARAM_LIST"); /*String paramList = jsonObject.getString("PARAM_LIST");
JSONArray jsonArray = JSON.parseArray(paramList); JSONArray jsonArray = JSON.parseArray(paramList);
Map<String,String> map = new HashMap<>(); Map<String,String> map = new HashMap<>();
for (int i = 0; i < jsonArray.size(); i++) { for (int i = 0; i < jsonArray.size(); i++) {
@ -98,7 +99,7 @@ public class EdcDataResourceServiceImpl extends ServiceImpl<EdcDataResourceMappe
String paramVal = jsonObj.getString("PARAM_VAL"); String paramVal = jsonObj.getString("PARAM_VAL");
String param = jsonObj.getString("PARAM"); String param = jsonObj.getString("PARAM");
map.put(param,paramVal); map.put(param,paramVal);
} }*/
// 获取数据收集组HANDLE // 获取数据收集组HANDLE
String resourceBo = HandleEnum.RESOURCE.getHandle(site, "Z_EDC_DATA_RESOURCE"); String resourceBo = HandleEnum.RESOURCE.getHandle(site, "Z_EDC_DATA_RESOURCE");
String dcGroupBo = edcDataResourceMapper.getDcGroupBoByResourceBo(resourceBo); String dcGroupBo = edcDataResourceMapper.getDcGroupBoByResourceBo(resourceBo);
@ -116,11 +117,12 @@ public class EdcDataResourceServiceImpl extends ServiceImpl<EdcDataResourceMappe
throw BusinessException.build("数据收集组" + dcGroupBo + "未维护字段信息"); throw BusinessException.build("数据收集组" + dcGroupBo + "未维护字段信息");
} }
for (DcParameter dcParam:getParamList) { for (DcParameter dcParam:getParamList) {
String parameterName = dcParam.getParameterName(); String parameterName = dcParam.getDescription();
// 数据收集组---值-列 // 数据收集组---值-列
String dcValueMask = dcParam.getDcValueMask(); String dcValueMask = dcParam.getDcValueMask();
// json值 // json值
String value = map.get(parameterName); // String value = map.get(parameterName);
String value = jsonObject.getString(parameterName);
if (value == null){ if (value == null){
continue; continue;
} }

Loading…
Cancel
Save