From ed054a2bf25f296fd8697f2663e34147b20d0be6 Mon Sep 17 00:00:00 2001 From: caixiang <939387484@qq.com> Date: Fri, 19 Jan 2024 10:14:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=91=9E=E6=98=8CSPC=20-=20=E5=AE=9A=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cnbm/admin/config/SecurityConfig.java | 1 + .../admin/service/impl/LoginServiceImpl.java | 8 ++-- .../src/main/resources/application-dev.yml | 14 +++++-- .../src/main/resources/application-prod.yml | 9 +++-- ym-gateway/src/main/resources/application.yml | 11 ++++-- .../com/cnbm/influx/config/InfluxClient.java | 4 +- .../java/com/cnbm/influx/param/BaseParam.java | 2 +- .../ProcessInspectionController.java | 38 ------------------- 8 files changed, 30 insertions(+), 57 deletions(-) diff --git a/ym-admin/src/main/java/com/cnbm/admin/config/SecurityConfig.java b/ym-admin/src/main/java/com/cnbm/admin/config/SecurityConfig.java index eb8dc4a..a0e5f4d 100644 --- a/ym-admin/src/main/java/com/cnbm/admin/config/SecurityConfig.java +++ b/ym-admin/src/main/java/com/cnbm/admin/config/SecurityConfig.java @@ -73,6 +73,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { "/webjars/**", "/websocket/**", "/influx/**", + "/spcData/**", // "/basic/**", // "/qualityPlanning/**", diff --git a/ym-admin/src/main/java/com/cnbm/admin/service/impl/LoginServiceImpl.java b/ym-admin/src/main/java/com/cnbm/admin/service/impl/LoginServiceImpl.java index 27468aa..86ccc39 100644 --- a/ym-admin/src/main/java/com/cnbm/admin/service/impl/LoginServiceImpl.java +++ b/ym-admin/src/main/java/com/cnbm/admin/service/impl/LoginServiceImpl.java @@ -52,10 +52,10 @@ public class LoginServiceImpl implements LoginService { @Override public Result login(HttpServletRequest request, LoginParam loginParam) { //验证码是否正确 - boolean flag = captchaService.validate(loginParam.getUuid(), loginParam.getCaptcha()); - if(!flag){ - return new Result<>().error(ErrorCode.CAPTCHA_ERROR, "验证码错误"); - } +// boolean flag = captchaService.validate(loginParam.getUuid(), loginParam.getCaptcha()); +// if(!flag){ +// return new Result<>().error(ErrorCode.CAPTCHA_ERROR, "验证码错误"); +// } UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginParam.getUsername(),loginParam.getPassword()); Authentication authenticate = authenticationManager.authenticate(authenticationToken); //登录日志 diff --git a/ym-gateway/src/main/resources/application-dev.yml b/ym-gateway/src/main/resources/application-dev.yml index e7cc7d1..ff3118b 100644 --- a/ym-gateway/src/main/resources/application-dev.yml +++ b/ym-gateway/src/main/resources/application-dev.yml @@ -2,9 +2,15 @@ spring: datasource: #MySQL driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://mysql.picaiba.com:30307/spc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true - username: root - password: 1qaz@WSX3edc$RFV +# url: jdbc:mysql://mysql.picaiba.com:30307/spc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true +# username: root +# password: 1qaz@WSX3edc$RFV + url: jdbc:mysql://172.16.21.131:3306/spc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + username: spcw + password: fxltsblXSSXYBY +# url: jdbc:mysql://172.16.21.131:3306/spc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true +# username: spcw +# password: fxltsblXSSXYBY # #Oracle # driver-class-name: oracle.jdbc.OracleDriver # url: jdbc:oracle:thin:@192.168.10.10:1521:xe @@ -77,4 +83,4 @@ spring: # writeTimeout: 5s # Write timeout for OkHttpClient. (Default: 10s) # connectTimeout: 5s # Connection timeout for OkHttpClient. (Default: 10s) - # management.health.influx.enabled=true # Whether to enable InfluxDB 2.x health check. \ No newline at end of file +# management.health.influx.enabled=true # Whether to enable InfluxDB 2.x health check. \ No newline at end of file diff --git a/ym-gateway/src/main/resources/application-prod.yml b/ym-gateway/src/main/resources/application-prod.yml index b443abc..2aa7b2e 100644 --- a/ym-gateway/src/main/resources/application-prod.yml +++ b/ym-gateway/src/main/resources/application-prod.yml @@ -2,9 +2,12 @@ spring: datasource: #MySQL driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://mysql.picaiba.com:30307/ym_pass?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true - username: root - password: 1qaz@WSX3edc$RFV +# url: jdbc:mysql://mysql.picaiba.com:30307/ym_pass?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true +# username: root +# password: 1qaz@WSX3edc$RFV + url: jdbc:mysql://172.16.21.131:3306/spc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + username: spcw + password: fxltsblXSSXYBY # #Oracle # driver-class-name: oracle.jdbc.OracleDriver # url: jdbc:oracle:thin:@192.168.10.10:1521:xe diff --git a/ym-gateway/src/main/resources/application.yml b/ym-gateway/src/main/resources/application.yml index 795bc1c..b7d8757 100644 --- a/ym-gateway/src/main/resources/application.yml +++ b/ym-gateway/src/main/resources/application.yml @@ -7,7 +7,7 @@ server: min-spare: 30 port: 8999 servlet: - context-path: /ym-spc + context-path: /spcserver session: cookie: http-only: true @@ -33,9 +33,12 @@ spring: enabled: true redis: database: 2 - host: 127.0.0.1 - port: 6379 - password: '' # 密码(默认为空) +# host: 127.0.0.1 +# port: 6379 +# password: '' + host: 172.16.21.99 + port: 6380 + password: '@WSXcde3' # 密码(默认为空) timeout: 6000ms # 连接超时时长(毫秒) jedis: pool: diff --git a/ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java b/ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java index d6dcfac..d5a3032 100644 --- a/ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java +++ b/ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java @@ -19,7 +19,7 @@ public enum InfluxClient { /** * influxdb 读写客户端,,如果write比较繁忙,后续可以考虑,维护 client一个线程池。 * */ - //Client("http://192.168.0.170:8086","lkBsC27QZr1W50BSPlGxpTqNNpwuUk5uz1dZZRPSPbCG5VmNDDUo8P3UkZIhGWwfJwkuz6ZGZ7Et4_KBaG3gHw==","qgs","qgs-bucket"), + //Client("http://192.168.0.171:8086","lkq32gtomiKd4nu-kwZVUBEbn1HLdigjRPfuA6p8c29KFfqRs8JcR3IDLDsKzVFA-TDHbG1W6EP3EcJKKqpDPg==","qgs","qgs-bucket"), //瑞昌-cdte spc-all-token Client("http://172.16.21.111:8086","XLTjiVj368gLL0j-hTcAS6HE17M7tY5fj3ipt1gXTjgVqdGRE5pEhpGMABzchYFZpmaQsGTUckR5Rs8Erz8nKQ==","qgs","qgs-bucket"), @@ -131,8 +131,6 @@ public enum InfluxClient { .addField("argValue", event.getArgValue()) .time(event.getTime().toEpochMilli(), WritePrecision.MS); } - - list.add(point); } writeApi.writePoints(list); diff --git a/ym-influx/src/main/java/com/cnbm/influx/param/BaseParam.java b/ym-influx/src/main/java/com/cnbm/influx/param/BaseParam.java index e1807bc..bc4a7e0 100644 --- a/ym-influx/src/main/java/com/cnbm/influx/param/BaseParam.java +++ b/ym-influx/src/main/java/com/cnbm/influx/param/BaseParam.java @@ -16,7 +16,7 @@ public class BaseParam implements Serializable { //page 信息可选 private PageInfo pageInfo; - @NotEmpty(message = "measurement 不能为空") + @NotEmpty(message = "measurement 不能为空, 设备名(一个设备一个measurement,一个表)") private String measurement; @NotNull(message = "查询时间段不能为空") diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/ProcessInspectionController.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/ProcessInspectionController.java index 10d588b..e064bad 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/ProcessInspectionController.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/ProcessInspectionController.java @@ -142,44 +142,6 @@ public class ProcessInspectionController { return R.ok("成功",xmrGraphData); } -// @PostMapping("/getBatchs") -// public R> getBatchs() throws InterruptedException { -// List list = new ArrayList<>(); -// Random r = new Random(); -// Instant instant = DataUtils.getBeforeDate(400).toInstant(); -// List res = new ArrayList<>(); -// -// QueryDataParam queryDataParam = new QueryDataParam(); -// queryDataParam.setBucket("qgs-bucket"); -// queryDataParam.setMeasurement("Weight"); -// List dropNames = new ArrayList<>(); -// dropNames.add("transationId"); -// dropNames.add("_value"); -// dropNames.add("_start"); -// dropNames.add("_stop"); -// dropNames.add("_time"); -// dropNames.add("_field"); -// dropNames.add("_measurement"); -// dropNames.add("inspectionSheetId"); -// dropNames.add("argName"); -// queryDataParam.setDropedTagNames(dropNames); -// -// queryDataParam.setTags(Arrays.asList(new Tag("argName","LTWeight"))); -// -// queryDataParam.setRange(new Range(DataUtils.getBeforeDate(100).toInstant(),Instant.now())); -//// queryDataParam.setPageInfo(new PageInfo(1,10)); -// List query = InfluxClient.Client.queryByGroup(queryDataParam); -// -// -// for (FluxTable fluxTable : query) { -// List records = fluxTable.getRecords(); -// if(records.size()!=0){ -// res.add((String) records.get(0).getValueByKey("batchNum")); -// continue; -// } -// } -// return R.ok(res); -// } @PostMapping("/NPGraphTest")