diff --git a/casic-server/src/main/java/com/casic/missiles/modular/neutron/service/impl/NeutronOptServiceImpl.java b/casic-server/src/main/java/com/casic/missiles/modular/neutron/service/impl/NeutronOptServiceImpl.java index d51ee3c..51b03f3 100644 --- a/casic-server/src/main/java/com/casic/missiles/modular/neutron/service/impl/NeutronOptServiceImpl.java +++ b/casic-server/src/main/java/com/casic/missiles/modular/neutron/service/impl/NeutronOptServiceImpl.java @@ -69,15 +69,18 @@ List volList = (List) resultMap.get("vol"); if (volList != null && volList.size() > 0) { volList.forEach(vol -> { - JSONObject headerJson = new JSONObject(); - headerJson.put("msgKey", "detector_vol"); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("deviceIp", deviceIpPort); - jsonObject.put("vol", String.format("%.3f", (Double.valueOf(vol.getVolData6()) / 10000))); - jsonObject.put("time", vol.getCreateTime()); - headerJson.put("data", jsonObject); - webSocket.sendAllMessage(headerJson.toJSONString()); - log.info("推送电压数据" + headerJson.toJSONString()); + //过滤大于10万伏的数据,不往前端推送 + if(Double.valueOf(vol.getVolData6()) / 10000<10) { + JSONObject headerJson = new JSONObject(); + headerJson.put("msgKey", "detector_vol"); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("deviceIp", deviceIpPort); + jsonObject.put("vol", String.format("%.3f", (Double.valueOf(vol.getVolData6()) / 10000))); + jsonObject.put("time", vol.getCreateTime()); + headerJson.put("data", jsonObject); + webSocket.sendAllMessage(headerJson.toJSONString()); + log.info("推送电压数据" + headerJson.toJSONString()); + } vol.setIpPort(deviceIpPort.substring(1)); vol.setDetectorId(uid); }); diff --git a/casic-server/src/main/java/com/casic/missiles/modular/neutron/service/impl/NeutronOptServiceImpl.java b/casic-server/src/main/java/com/casic/missiles/modular/neutron/service/impl/NeutronOptServiceImpl.java index d51ee3c..51b03f3 100644 --- a/casic-server/src/main/java/com/casic/missiles/modular/neutron/service/impl/NeutronOptServiceImpl.java +++ b/casic-server/src/main/java/com/casic/missiles/modular/neutron/service/impl/NeutronOptServiceImpl.java @@ -69,15 +69,18 @@ List volList = (List) resultMap.get("vol"); if (volList != null && volList.size() > 0) { volList.forEach(vol -> { - JSONObject headerJson = new JSONObject(); - headerJson.put("msgKey", "detector_vol"); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("deviceIp", deviceIpPort); - jsonObject.put("vol", String.format("%.3f", (Double.valueOf(vol.getVolData6()) / 10000))); - jsonObject.put("time", vol.getCreateTime()); - headerJson.put("data", jsonObject); - webSocket.sendAllMessage(headerJson.toJSONString()); - log.info("推送电压数据" + headerJson.toJSONString()); + //过滤大于10万伏的数据,不往前端推送 + if(Double.valueOf(vol.getVolData6()) / 10000<10) { + JSONObject headerJson = new JSONObject(); + headerJson.put("msgKey", "detector_vol"); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("deviceIp", deviceIpPort); + jsonObject.put("vol", String.format("%.3f", (Double.valueOf(vol.getVolData6()) / 10000))); + jsonObject.put("time", vol.getCreateTime()); + headerJson.put("data", jsonObject); + webSocket.sendAllMessage(headerJson.toJSONString()); + log.info("推送电压数据" + headerJson.toJSONString()); + } vol.setIpPort(deviceIpPort.substring(1)); vol.setDetectorId(uid); }); diff --git a/casic-web/src/main/resources/config/application-dev.yml b/casic-web/src/main/resources/config/application-dev.yml index eb3f092..7b5edb4 100644 --- a/casic-web/src/main/resources/config/application-dev.yml +++ b/casic-web/src/main/resources/config/application-dev.yml @@ -4,10 +4,10 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/casic_robot_inspection?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&serverTimezone=UTC&&allowMultiQueries=true -# url: jdbc:mysql://111.198.10.15:11336/casic_robot_inspection?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&serverTimezone=UTC&&allowMultiQueries=true +# url: jdbc:mysql://localhost:3306/casic_robot_inspection?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&serverTimezone=UTC&&allowMultiQueries=true + url: jdbc:mysql://111.198.10.15:11336/casic_robot_inspection?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&serverTimezone=UTC&&allowMultiQueries=true username: root - password: 123456 + password: Casic203 druid: max-active: 50 min-idle: 20 diff --git a/casic-server/src/main/java/com/casic/missiles/modular/neutron/service/impl/NeutronOptServiceImpl.java b/casic-server/src/main/java/com/casic/missiles/modular/neutron/service/impl/NeutronOptServiceImpl.java index d51ee3c..51b03f3 100644 --- a/casic-server/src/main/java/com/casic/missiles/modular/neutron/service/impl/NeutronOptServiceImpl.java +++ b/casic-server/src/main/java/com/casic/missiles/modular/neutron/service/impl/NeutronOptServiceImpl.java @@ -69,15 +69,18 @@ List volList = (List) resultMap.get("vol"); if (volList != null && volList.size() > 0) { volList.forEach(vol -> { - JSONObject headerJson = new JSONObject(); - headerJson.put("msgKey", "detector_vol"); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("deviceIp", deviceIpPort); - jsonObject.put("vol", String.format("%.3f", (Double.valueOf(vol.getVolData6()) / 10000))); - jsonObject.put("time", vol.getCreateTime()); - headerJson.put("data", jsonObject); - webSocket.sendAllMessage(headerJson.toJSONString()); - log.info("推送电压数据" + headerJson.toJSONString()); + //过滤大于10万伏的数据,不往前端推送 + if(Double.valueOf(vol.getVolData6()) / 10000<10) { + JSONObject headerJson = new JSONObject(); + headerJson.put("msgKey", "detector_vol"); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("deviceIp", deviceIpPort); + jsonObject.put("vol", String.format("%.3f", (Double.valueOf(vol.getVolData6()) / 10000))); + jsonObject.put("time", vol.getCreateTime()); + headerJson.put("data", jsonObject); + webSocket.sendAllMessage(headerJson.toJSONString()); + log.info("推送电压数据" + headerJson.toJSONString()); + } vol.setIpPort(deviceIpPort.substring(1)); vol.setDetectorId(uid); }); diff --git a/casic-web/src/main/resources/config/application-dev.yml b/casic-web/src/main/resources/config/application-dev.yml index eb3f092..7b5edb4 100644 --- a/casic-web/src/main/resources/config/application-dev.yml +++ b/casic-web/src/main/resources/config/application-dev.yml @@ -4,10 +4,10 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/casic_robot_inspection?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&serverTimezone=UTC&&allowMultiQueries=true -# url: jdbc:mysql://111.198.10.15:11336/casic_robot_inspection?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&serverTimezone=UTC&&allowMultiQueries=true +# url: jdbc:mysql://localhost:3306/casic_robot_inspection?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&serverTimezone=UTC&&allowMultiQueries=true + url: jdbc:mysql://111.198.10.15:11336/casic_robot_inspection?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&serverTimezone=UTC&&allowMultiQueries=true username: root - password: 123456 + password: Casic203 druid: max-active: 50 min-idle: 20 diff --git a/casic-web/src/main/resources/config/application.yml b/casic-web/src/main/resources/config/application.yml index 85116ac..a2cafc3 100644 --- a/casic-web/src/main/resources/config/application.yml +++ b/casic-web/src/main/resources/config/application.yml @@ -42,10 +42,10 @@ session-invalidate-time: 86400 #session失效时间(只在单机环境下生效,,多机环境在SpringSessionConfig类中配置) 单位:秒 session-validation-interval: 900 #多久检测一次失效的session(只在单机环境下生效) 单位:秒 no-login-urls: /user/login,/kaptcha,/config/baseConfig - hikSdk: D:\workspace\server\keti\casic-robot-inspection\doc\hiklib\HCNetSDK.dll - hikPlay: D:\workspace\server\keti\casic-robot-inspection\doc\hiklib\PlayCtrl.dll + hikSdk: D:\code\robot\casic-robot-inspection\doc\hiklib\HCNetSDK.dll + hikPlay: D:\code\robot\casic-robot-inspection\doc\hiklib\PlayCtrl.dll algorithm: - path: D:\workspace\server\keti\casic-robot-inspection\casic-web\src\main\resources\config\path\ + path: D:\code\robot\casic-robot-inspection\casic-web\src\main\resources\config\path\ initPathName: init.exe planPathName: search.exe doc: