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

socket 接口修改 gengdidi

parent d5f664c5
......@@ -37,14 +37,14 @@ public class WebSocketController {
public void send(int alarmId){
try {
DeviceAlarmVo alarm = itDeviceAlarmService.selectTDeviceAlarmById(alarmId);
JSONObject json = new JSONObject();
json.put("alarmInfo",alarm);
if(PIPE_TYPE.equals(alarm.getAlarmType())){
/*JSONObject json = new JSONObject();
json.put("alarmInfo",alarm);*/
/*if(PIPE_TYPE.equals(alarm.getAlarmType())){
json.put("deviceInfo",itPipeService.selectTPipeById(alarm.getDeviceId()));
}else{
json.put("deviceInfo",itDeviceInfoService.selectTDeviceInfoById(alarm.getDeviceId()));
}
webSocketServer.batchSendMessage(alarm.toString());
}*/
webSocketServer.batchSendMessage(JSONObject.toJSONString(alarm));
} catch (Exception e) {
log.error("wesocket发送失败!");
}
......
......@@ -167,4 +167,21 @@ public class DeviceAlarmVo extends BaseEntity
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