|
@@ -71,13 +71,13 @@ public class AllPostTopic implements BusinessAgreement<AllPostDto> { |
|
@@ -71,13 +71,13 @@ public class AllPostTopic implements BusinessAgreement<AllPostDto> { |
|
71
|
{
|
71
|
{
|
|
72
|
if(deviceDataConfigMap.containsKey(key))
|
72
|
if(deviceDataConfigMap.containsKey(key))
|
|
73
|
{
|
73
|
{
|
|
74
|
- log.info("点位{}",key);
|
74
|
+// log.info("点位{}",key);
|
|
75
|
String dttribute_value = object.get(key).toString();
|
75
|
String dttribute_value = object.get(key).toString();
|
|
76
|
String newDataValue= ByteUtil.changerTwoStr(dttribute_value);
|
76
|
String newDataValue= ByteUtil.changerTwoStr(dttribute_value);
|
|
77
|
|
77
|
|
|
78
|
DeviceDataConfig deviceDataConfig = deviceDataConfigMap.get(key);
|
78
|
DeviceDataConfig deviceDataConfig = deviceDataConfigMap.get(key);
|
|
79
|
String deviceInfoId = deviceDataConfig.getDeviceInfoId(topic.getClientid()); //根据点位协议解析到设备id
|
79
|
String deviceInfoId = deviceDataConfig.getDeviceInfoId(topic.getClientid()); //根据点位协议解析到设备id
|
|
80
|
- log.info("点位对应的设备id{}",deviceInfoId);
|
80
|
+// log.info("点位对应的设备id{}",deviceInfoId);
|
|
81
|
if(deviceInfoId.equals(topic.getClientid()))
|
81
|
if(deviceInfoId.equals(topic.getClientid()))
|
|
82
|
{
|
82
|
{
|
|
83
|
if(null != list && "SYS_AUTO".equals(key))
|
83
|
if(null != list && "SYS_AUTO".equals(key))
|
|
@@ -111,22 +111,22 @@ public class AllPostTopic implements BusinessAgreement<AllPostDto> { |
|
@@ -111,22 +111,22 @@ public class AllPostTopic implements BusinessAgreement<AllPostDto> { |
|
111
|
switch (PLCDataType.valueOf(deviceDataConfig.getPlc_data_type()))
|
111
|
switch (PLCDataType.valueOf(deviceDataConfig.getPlc_data_type()))
|
|
112
|
{
|
112
|
{
|
|
113
|
case 故障代码:
|
113
|
case 故障代码:
|
|
114
|
- log.info("故障代码{}",newDataValue);
|
114
|
+// log.info("故障代码{}",newDataValue);
|
|
115
|
if(newDataValue.equals(deviceDataConfig.getAlarmValue()))
|
115
|
if(newDataValue.equals(deviceDataConfig.getAlarmValue()))
|
|
116
|
{
|
116
|
{
|
|
117
|
newAlrmCode = deviceDataConfig.getAlarmCode();
|
117
|
newAlrmCode = deviceDataConfig.getAlarmCode();
|
|
118
|
}
|
118
|
}
|
|
119
|
break;
|
119
|
break;
|
|
120
|
case 控制柜状态:
|
120
|
case 控制柜状态:
|
|
121
|
- log.info("控制柜状态{}",newDataValue);
|
121
|
+// log.info("控制柜状态{}",newDataValue);
|
|
122
|
analysisData(data,deviceInfo,deviceDataConfig,newDataValue,topic);
|
122
|
analysisData(data,deviceInfo,deviceDataConfig,newDataValue,topic);
|
|
123
|
break;
|
123
|
break;
|
|
124
|
case 校准时间:
|
124
|
case 校准时间:
|
|
125
|
- log.info("校准时间{}",newDataValue);
|
125
|
+// log.info("校准时间{}",newDataValue);
|
|
126
|
analysisData(data,deviceInfo,deviceDataConfig,newDataValue,topic);
|
126
|
analysisData(data,deviceInfo,deviceDataConfig,newDataValue,topic);
|
|
127
|
break;
|
127
|
break;
|
|
128
|
default:
|
128
|
default:
|
|
129
|
- log.info("默认功能{}",newDataValue);
|
129
|
+// log.info("默认功能{}",newDataValue);
|
|
130
|
analysisData(data,deviceInfo,deviceDataConfig,newDataValue,topic);
|
130
|
analysisData(data,deviceInfo,deviceDataConfig,newDataValue,topic);
|
|
131
|
break;
|
131
|
break;
|
|
132
|
}
|
132
|
}
|
|
@@ -134,7 +134,7 @@ public class AllPostTopic implements BusinessAgreement<AllPostDto> { |
|
@@ -134,7 +134,7 @@ public class AllPostTopic implements BusinessAgreement<AllPostDto> { |
|
134
|
deviceInfo.setDataUpdateTime(DateUtils.getNowTimeMilly());
|
134
|
deviceInfo.setDataUpdateTime(DateUtils.getNowTimeMilly());
|
|
135
|
deviceInfo.setDeviceServiceIp(SysParameter.service_ip);
|
135
|
deviceInfo.setDeviceServiceIp(SysParameter.service_ip);
|
|
136
|
deviceInfo.setOnline("01");
|
136
|
deviceInfo.setOnline("01");
|
|
137
|
- log.info("设备信息{}",deviceInfo);
|
137
|
+// log.info("设备信息{}",deviceInfo);
|
|
138
|
}
|
138
|
}
|
|
139
|
}
|
139
|
}
|
|
140
|
private void analysisTime( JSONObject jsonObject,Map<String, DeviceDataConfig> deviceDataConfigMap,Topic topic,List<DeviceInfo> deviceInfoList)
|
140
|
private void analysisTime( JSONObject jsonObject,Map<String, DeviceDataConfig> deviceDataConfigMap,Topic topic,List<DeviceInfo> deviceInfoList)
|
|
@@ -252,7 +252,7 @@ public class AllPostTopic implements BusinessAgreement<AllPostDto> { |
|
@@ -252,7 +252,7 @@ public class AllPostTopic implements BusinessAgreement<AllPostDto> { |
|
252
|
jsonObject = GsonConstructor.get().fromJson(dataValue,JSONObject.class);
|
252
|
jsonObject = GsonConstructor.get().fromJson(dataValue,JSONObject.class);
|
|
253
|
}
|
253
|
}
|
|
254
|
String odlDataValue = (String) jsonObject.get(PLCDataType.valueOf(deviceDataConfig.getPlc_data_type()).sensorDataType);
|
254
|
String odlDataValue = (String) jsonObject.get(PLCDataType.valueOf(deviceDataConfig.getPlc_data_type()).sensorDataType);
|
|
255
|
- log.info("数据变化"+deviceDataConfig.getAttribute_name()+" "+odlDataValue+"-->"+newDataValue);
|
255
|
+// log.info("数据变化"+deviceDataConfig.getAttribute_name()+" "+odlDataValue+"-->"+newDataValue);
|
|
256
|
if(!newDataValue.equals(odlDataValue))
|
256
|
if(!newDataValue.equals(odlDataValue))
|
|
257
|
{
|
257
|
{
|
|
258
|
jsonObject.put(PLCDataType.valueOf(deviceDataConfig.getPlc_data_type()).sensorDataType,newDataValue); //更新数据
|
258
|
jsonObject.put(PLCDataType.valueOf(deviceDataConfig.getPlc_data_type()).sensorDataType,newDataValue); //更新数据
|