Commit c1e012ed authored by 耿迪迪's avatar 耿迪迪

socket 接口修改 gengdidi

parent d5f664c5
...@@ -37,14 +37,14 @@ public class WebSocketController { ...@@ -37,14 +37,14 @@ public class WebSocketController {
public void send(int alarmId){ public void send(int alarmId){
try { try {
DeviceAlarmVo alarm = itDeviceAlarmService.selectTDeviceAlarmById(alarmId); DeviceAlarmVo alarm = itDeviceAlarmService.selectTDeviceAlarmById(alarmId);
JSONObject json = new JSONObject(); /*JSONObject json = new JSONObject();
json.put("alarmInfo",alarm); json.put("alarmInfo",alarm);*/
if(PIPE_TYPE.equals(alarm.getAlarmType())){ /*if(PIPE_TYPE.equals(alarm.getAlarmType())){
json.put("deviceInfo",itPipeService.selectTPipeById(alarm.getDeviceId())); json.put("deviceInfo",itPipeService.selectTPipeById(alarm.getDeviceId()));
}else{ }else{
json.put("deviceInfo",itDeviceInfoService.selectTDeviceInfoById(alarm.getDeviceId())); json.put("deviceInfo",itDeviceInfoService.selectTDeviceInfoById(alarm.getDeviceId()));
} }*/
webSocketServer.batchSendMessage(alarm.toString()); webSocketServer.batchSendMessage(JSONObject.toJSONString(alarm));
} catch (Exception e) { } catch (Exception e) {
log.error("wesocket发送失败!"); log.error("wesocket发送失败!");
} }
......
...@@ -167,4 +167,21 @@ public class DeviceAlarmVo extends BaseEntity ...@@ -167,4 +167,21 @@ public class DeviceAlarmVo extends BaseEntity
return dealStatus; return dealStatus;
} }
@Override
public String toString() {
return "DeviceAlarmVo{" +
"alarmId=" + alarmId +
", deviceId=" + deviceId +
", deviceType='" + deviceType + '\'' +
", deviceName='" + deviceName + '\'' +
", deviceCode='" + deviceCode + '\'' +
", iotNo='" + iotNo + '\'' +
", orderId='" + orderId + '\'' +
", alarmType='" + alarmType + '\'' +
", alarmValue='" + alarmValue + '\'' +
", startTime=" + startTime +
", endTime=" + endTime +
", dealStatus='" + dealStatus + '\'' +
'}';
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment