|
@@ -101,27 +101,27 @@ public class HeartReportHandler extends SimpleChannelInboundHandler<HeartReportI
|
|
String deviceNo = ctx.channel().attr(LapiAttrKeys.DEVICE_NO).get();
|
|
String deviceNo = ctx.channel().attr(LapiAttrKeys.DEVICE_NO).get();
|
|
|
|
|
|
if(StringUtils.isNotEmpty(deviceNo)){
|
|
if(StringUtils.isNotEmpty(deviceNo)){
|
|
- log.warn(deviceNo + "已离线");
|
|
|
|
-
|
|
|
|
- new Thread(()->{
|
|
|
|
- try {
|
|
|
|
- //防止channelRead0和channelInactive同时发生
|
|
|
|
- Thread.sleep(1000);
|
|
|
|
- } catch (InterruptedException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- SysLog sysLog = new SysLog();
|
|
|
|
- sysLog.setPointcut(deviceNo);
|
|
|
|
- sysLog.setUrl("/LAPI/V1.0/PACS/Controller/HeartReportInfo");
|
|
|
|
- sysLog.setRemark("设备离线");
|
|
|
|
- SocketAddress remoteAddress = ctx.channel().remoteAddress();
|
|
|
|
- sysLog.setRemoteIp(remoteAddress.toString());
|
|
|
|
- sysLog.setCreateTime(new Date());
|
|
|
|
- sysLogService.insert(sysLog);
|
|
|
|
-
|
|
|
|
- deviceInfoService.updateByDeviceNo(deviceNo,false);
|
|
|
|
- }).start();
|
|
|
|
|
|
+ log.warn(deviceNo + "channelInactive");
|
|
|
|
+
|
|
|
|
+// new Thread(()->{
|
|
|
|
+// try {
|
|
|
|
+// //防止channelRead0和channelInactive同时发生
|
|
|
|
+// Thread.sleep(1000);
|
|
|
|
+// } catch (InterruptedException e) {
|
|
|
|
+// e.printStackTrace();
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// SysLog sysLog = new SysLog();
|
|
|
|
+// sysLog.setPointcut(deviceNo);
|
|
|
|
+// sysLog.setUrl("/LAPI/V1.0/PACS/Controller/HeartReportInfo");
|
|
|
|
+// sysLog.setRemark("设备离线");
|
|
|
|
+// SocketAddress remoteAddress = ctx.channel().remoteAddress();
|
|
|
|
+// sysLog.setRemoteIp(remoteAddress.toString());
|
|
|
|
+// sysLog.setCreateTime(new Date());
|
|
|
|
+// sysLogService.insert(sysLog);
|
|
|
|
+//
|
|
|
|
+// deviceInfoService.updateByDeviceNo(deviceNo,false);
|
|
|
|
+// }).start();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|