diff --git a/detection/src/main/java/com/njcn/gather/detection/util/socket/web/WebSocketService.java b/detection/src/main/java/com/njcn/gather/detection/util/socket/web/WebSocketService.java index d53473c0..8ccf18e4 100644 --- a/detection/src/main/java/com/njcn/gather/detection/util/socket/web/WebSocketService.java +++ b/detection/src/main/java/com/njcn/gather/detection/util/socket/web/WebSocketService.java @@ -41,39 +41,39 @@ public class WebSocketService { @PostConstruct public void start() { - new Thread(() -> { - //可以自定义线程的数量 - bossGroup = new NioEventLoopGroup(); - // 默认创建的线程数量 = CPU 处理器数量 *2 - workerGroup = new NioEventLoopGroup(); - try { - ServerBootstrap serverBootstrap = new ServerBootstrap(); - serverBootstrap.group(bossGroup, workerGroup) - .channel(NioServerSocketChannel.class) - .handler(new LoggingHandler()) - //当前连接被阻塞的时候,BACKLOG代表的事 阻塞队列的长度 - .option(ChannelOption.SO_BACKLOG, 128) - .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000) - - //设置连接保持为活动状态 - .childOption(ChannelOption.SO_KEEPALIVE, true) - .childHandler(webSocketInitializer); - ChannelFuture future = serverBootstrap.bind(port).sync(); - future.addListener(f -> { - if (future.isSuccess()) { - System.out.println("webSocket服务启动成功"); - } else { - System.out.println("webSocket服务启动失败"); - } - }); - future.channel().closeFuture().sync(); - } catch (InterruptedException e) { - e.printStackTrace(); - } finally { - bossGroup.shutdownGracefully(); - workerGroup.shutdownGracefully(); - } - }).start(); +// new Thread(() -> { +// //可以自定义线程的数量 +// bossGroup = new NioEventLoopGroup(); +// // 默认创建的线程数量 = CPU 处理器数量 *2 +// workerGroup = new NioEventLoopGroup(); +// try { +// ServerBootstrap serverBootstrap = new ServerBootstrap(); +// serverBootstrap.group(bossGroup, workerGroup) +// .channel(NioServerSocketChannel.class) +// .handler(new LoggingHandler()) +// //当前连接被阻塞的时候,BACKLOG代表的事 阻塞队列的长度 +// .option(ChannelOption.SO_BACKLOG, 128) +// .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000) +// +// //设置连接保持为活动状态 +// .childOption(ChannelOption.SO_KEEPALIVE, true) +// .childHandler(webSocketInitializer); +// ChannelFuture future = serverBootstrap.bind(port).sync(); +// future.addListener(f -> { +// if (future.isSuccess()) { +// System.out.println("webSocket服务启动成功"); +// } else { +// System.out.println("webSocket服务启动失败"); +// } +// }); +// future.channel().closeFuture().sync(); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } finally { +// bossGroup.shutdownGracefully(); +// workerGroup.shutdownGracefully(); +// } +// }).start(); } diff --git a/device/src/main/java/com/njcn/gather/device/err/pojo/param/PqErrSysDtlsParam.java b/device/src/main/java/com/njcn/gather/device/err/pojo/param/PqErrSysDtlsParam.java index 897ae0c9..6aaa06d7 100644 --- a/device/src/main/java/com/njcn/gather/device/err/pojo/param/PqErrSysDtlsParam.java +++ b/device/src/main/java/com/njcn/gather/device/err/pojo/param/PqErrSysDtlsParam.java @@ -22,19 +22,15 @@ public class PqErrSysDtlsParam { private String type; @ApiModelProperty(value = "误差判断起始值", required = true) - @NotNull(message = DevValidMessage.START_VALUE_NOT_NULL) private Float startValue; @ApiModelProperty(value = "是否包含起始值", required = true) - @NotNull(message = DevValidMessage.START_FLAG_NOT_NULL) private Integer startFlag; @ApiModelProperty(value = "误差判断结束值", required = true) - @NotNull(message = DevValidMessage.END_VALUE_NOT_NULL) private Float endValue; @ApiModelProperty(value = "是否包含结束值", required = true) - @NotNull(message = DevValidMessage.END_FLAG_NOT_NULL) private Integer endFlag; // @ApiModelProperty(value = "单位", required = true) @@ -43,17 +39,14 @@ public class PqErrSysDtlsParam { // private String unit; @ApiModelProperty(value = "判断条件值类型", required = true) - @NotBlank(message = DevValidMessage.CONDITION_TYPE_NOT_BLANK) - @Pattern(regexp = PatternRegex.SYSTEM_ID, message = DevValidMessage.ERROR_VALUE_FORMAT_ERROR) - private String conditionType; + private Integer conditionType; @ApiModelProperty(value = "最大值误差", required = true) @NotNull(message = DevValidMessage.MAX_ERROR_VALUE_NOT_NULL) private Float maxErrorValue; @ApiModelProperty(value = "误差值类型", required = true) - @NotBlank(message = DevValidMessage.ERROR_VALUE_TYPE_NOT_BLANK) - @Pattern(regexp = PatternRegex.SYSTEM_ID, message = DevValidMessage.ERROR_VALUE_FORMAT_ERROR) - private String errorValueType; + @NotNull(message = DevValidMessage.ERROR_VALUE_TYPE_NOT_BLANK) + private Integer errorValueType; } diff --git a/device/src/main/java/com/njcn/gather/device/err/pojo/po/PqErrSysDtls.java b/device/src/main/java/com/njcn/gather/device/err/pojo/po/PqErrSysDtls.java index 90963dcd..03d9bd6e 100644 --- a/device/src/main/java/com/njcn/gather/device/err/pojo/po/PqErrSysDtls.java +++ b/device/src/main/java/com/njcn/gather/device/err/pojo/po/PqErrSysDtls.java @@ -56,7 +56,7 @@ public class PqErrSysDtls implements Serializable { /** * 判断条件值类型(包括值类型,绝对值、相对值) */ - private String conditionType; + private Integer conditionType; /** * 误差最大值 @@ -66,7 +66,7 @@ public class PqErrSysDtls implements Serializable { /** * 误差值类型 */ - private String errorValueType; + private Integer errorValueType; } diff --git a/device/src/main/java/com/njcn/gather/device/pojo/constant/DevValidMessage.java b/device/src/main/java/com/njcn/gather/device/pojo/constant/DevValidMessage.java index d49a881b..a0fea013 100644 --- a/device/src/main/java/com/njcn/gather/device/pojo/constant/DevValidMessage.java +++ b/device/src/main/java/com/njcn/gather/device/pojo/constant/DevValidMessage.java @@ -199,4 +199,6 @@ public interface DevValidMessage { String TIMECHECK_NOT_BLANK = "是否做守时检测不能为空"; String FACTOR_FLAG_NOT_BLANK = "是否支持系数校准不能为空"; + + String CONDITION_TYPE_FORMAT_ERROR = "判断条件类型格式错误,请检查conditionType参数"; }