diff --git a/beneficiation/src/main/resources/application.yml b/beneficiation/src/main/resources/application.yml
index ac92adb9..1ac895fc 100644
--- a/beneficiation/src/main/resources/application.yml
+++ b/beneficiation/src/main/resources/application.yml
@@ -1,6 +1,6 @@
spring:
profiles:
- active: test
- include: common, util-test
+ active: prod
+ include: common, util-prod
diff --git a/cloudutil/src/main/resources/application-util-prod.yml b/cloudutil/src/main/resources/application-util-prod.yml
index 189c4bef..6fd2ea14 100644
--- a/cloudutil/src/main/resources/application-util-prod.yml
+++ b/cloudutil/src/main/resources/application-util-prod.yml
@@ -22,7 +22,7 @@ eureka:
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/
# defaultZone: http://admin:admin@81.70.54.64:7010/eureka/
- defaultZone: http://admin:admin@192.144.182.42:7010/eureka/
+ defaultZone: http://admin:admin@121.36.3.207:7010/eureka/
instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server
diff --git a/cloudutil/src/main/resources/application-util-test.yml b/cloudutil/src/main/resources/application-util-test.yml
index 5401183c..3429f03e 100644
--- a/cloudutil/src/main/resources/application-util-test.yml
+++ b/cloudutil/src/main/resources/application-util-test.yml
@@ -83,7 +83,7 @@ eureka:
# 指定eureka server通信地址,注意/eureka/小尾巴不能少
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/
# defaultZone: http://admin:admin@49.232.6.143:7010/eureka/
- defaultZone: http://admin:admin@192.168.0.99:7010/eureka/
+ defaultZone: http://admin:admin@192.168.31.13:7010/eureka/
# defaultZone: http://admin:admin@test.tall.wiki:7010/eureka/
instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server
diff --git a/game/src/main/resources/application-prod.yml b/game/src/main/resources/application-prod.yml
index 25d923e2..21a31e26 100644
--- a/game/src/main/resources/application-prod.yml
+++ b/game/src/main/resources/application-prod.yml
@@ -32,7 +32,7 @@ swagger:
enable: true
eureka:
instance:
- ip-address: 192.144.182.42
+ ip-address: 121.36.3.207
gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/
diff --git a/game/src/main/resources/application-prodsd.yml b/game/src/main/resources/application-prodsd.yml
index ebd7485c..4e218684 100644
--- a/game/src/main/resources/application-prodsd.yml
+++ b/game/src/main/resources/application-prodsd.yml
@@ -31,7 +31,7 @@ swagger:
enable: true
eureka:
instance:
- ip-address: 81.70.54.64
+ ip-address: 121.36.3.207
gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/
diff --git a/game/src/main/resources/application.yml b/game/src/main/resources/application.yml
index 6c2249b0..d082c0ea 100644
--- a/game/src/main/resources/application.yml
+++ b/game/src/main/resources/application.yml
@@ -1,4 +1,4 @@
spring:
profiles:
- active: prodapi
+ active: prod
include: common, util-prod
\ No newline at end of file
diff --git a/ht/src/main/resources/application-prod.yml b/ht/src/main/resources/application-prod.yml
index c3cc8976..d14db72c 100644
--- a/ht/src/main/resources/application-prod.yml
+++ b/ht/src/main/resources/application-prod.yml
@@ -39,5 +39,5 @@ ht:
name: 认知功能评测云平台系统
eureka:
instance:
- ip-address: 81.70.54.64
+ ip-address: 121.36.3.207
diff --git a/mt/src/main/resources/application-dev.yml b/mt/src/main/resources/application-dev.yml
index 646ecd0c..45fd1c45 100644
--- a/mt/src/main/resources/application-dev.yml
+++ b/mt/src/main/resources/application-dev.yml
@@ -8,7 +8,7 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
- host: 81.70.54.64
+ host: 121.36.3.207
password: 111111
port: 5672
username: admin
diff --git a/mt/src/main/resources/application.yml b/mt/src/main/resources/application.yml
index a47f2a7b..1ac895fc 100644
--- a/mt/src/main/resources/application.yml
+++ b/mt/src/main/resources/application.yml
@@ -1,6 +1,6 @@
spring:
profiles:
- active: dev
- include: common, util-dev
+ active: prod
+ include: common, util-prod
diff --git a/ocr/pom.xml b/ocr/pom.xml
new file mode 100644
index 00000000..b9200524
--- /dev/null
+++ b/ocr/pom.xml
@@ -0,0 +1,35 @@
+
+
+
+ ccsenscloud
+ com.ccsens
+ 1.0-SNAPSHOT
+
+ 4.0.0
+
+ ocr
+
+
+
+
+ cloudutil
+ com.ccsens
+ 1.0-SNAPSHOT
+
+
+
+ util
+ com.ccsens
+ 1.0-SNAPSHOT
+
+
+
+ org.bytedeco.javacpp-presets
+ opencv
+ 4.0.1-1.4.4
+
+
+
+
\ No newline at end of file
diff --git a/ocr/src/main/java/com/ccsens/orc/OcrApplication.java b/ocr/src/main/java/com/ccsens/orc/OcrApplication.java
new file mode 100644
index 00000000..d1c1c8e2
--- /dev/null
+++ b/ocr/src/main/java/com/ccsens/orc/OcrApplication.java
@@ -0,0 +1,24 @@
+package com.ccsens.orc;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.servlet.ServletComponentScan;
+import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.scheduling.annotation.EnableAsync;
+
+/**
+ * @description:
+ * @author: whj
+ * @time: 2021/3/17 15:41
+ */
+
+@MapperScan(basePackages = {"com.ccsens.ocr.persist.*"})
+@ServletComponentScan
+@EnableAsync
+//开启断路器功能
+@EnableCircuitBreaker
+@EnableFeignClients(basePackages = "com.ccsens.cloudutil.feign")
+@SpringBootApplication(scanBasePackages = "com.ccsens")
+public class OcrApplication {
+}
diff --git a/ocr/src/main/resources/application-common.yml b/ocr/src/main/resources/application-common.yml
new file mode 100644
index 00000000..c27ac934
--- /dev/null
+++ b/ocr/src/main/resources/application-common.yml
@@ -0,0 +1,28 @@
+logging:
+ level:
+ com:
+ favorites: DEBUG
+ org:
+ hibernate: ERROR
+ springframework:
+ web: DEBUG
+mybatis:
+ config-location: classpath:mybatis/mybatis-config.xml
+ mapper-locations: classpath*:mapper_*/*.xml
+ type-aliases-package: com.ccsens.ht.bean
+server:
+ tomcat:
+ uri-encoding: UTF-8
+spring:
+ http:
+ encoding:
+ charset: UTF-8
+ enabled: true
+ force: true
+ log-request-details: true
+ servlet:
+ multipart:
+ max-file-size: 10MB
+ max-request-size: 100MB
+
+
diff --git a/ocr/src/main/resources/application-dev.yml b/ocr/src/main/resources/application-dev.yml
new file mode 100644
index 00000000..8cb2dc85
--- /dev/null
+++ b/ocr/src/main/resources/application-dev.yml
@@ -0,0 +1,41 @@
+server:
+ port: 7030
+ servlet:
+ context-path: /v1.0
+spring:
+ snowflake:
+ datacenterId: 1
+ workerId: 1
+ application:
+ name: tall
+ datasource:
+ type: com.alibaba.druid.pool.DruidDataSource
+ rabbitmq:
+ host: 192.168.0.99
+ password: guest
+ port: 5672
+ username: guest
+ redis:
+ database: 0
+ host: 127.0.0.1
+ jedis:
+ pool:
+ max-active: 200
+ max-idle: 10
+ max-wait: -1ms
+ min-idle: 0
+ password: ''
+ port: 6379
+ timeout: 1000ms
+swagger:
+ enable: true
+
+gatewayUrl: https://test.tall.wiki/gateway/
+notGatewayUrl: /home/staticrec/logo.png
+smsCode: 0
+wx:
+ prefixUrl: https://test.tall.wiki/wxconfigurer-api/
+file:
+ path: /home/cloud/tall/uploads/
+ domain: http://localhost:7030/v1.0/
+ imgDomain: http://localhost:7030/v1.0/uploads
\ No newline at end of file
diff --git a/ocr/src/main/resources/application-greenvalley.yml b/ocr/src/main/resources/application-greenvalley.yml
new file mode 100644
index 00000000..fa815963
--- /dev/null
+++ b/ocr/src/main/resources/application-greenvalley.yml
@@ -0,0 +1,39 @@
+server:
+ port: 7030
+ servlet:
+ context-path: /v1.0
+spring:
+ snowflake:
+ datacenterId: 1
+ workerId: 1
+ application:
+ name: tall
+ datasource:
+ type: com.alibaba.druid.pool.DruidDataSource
+ rabbitmq:
+ host: 127.0.0.1
+ password: admin
+ port: 5672
+ username: 111111
+ redis:
+ database: 0
+ host: 127.0.0.1
+ jedis:
+ pool:
+ max-active: 200
+ max-idle: 10
+ max-wait: -1ms
+ min-idle: 0
+ password: ''
+ port: 6379
+ timeout: 1000ms
+swagger:
+ enable: true
+eureka:
+ instance:
+ ip-address: 82.156.116.247
+gatewayUrl: http://82.156.116.247 /gateway/
+notGatewayUrl: http://82.156.116.247 /
+file:
+ domain: http://82.156.116.247 /gateway/tall/v1.0/
+ imgDomain: http://82.156.116.247 /gateway/tall/v1.0/uploads
\ No newline at end of file
diff --git a/ocr/src/main/resources/application-prod.yml b/ocr/src/main/resources/application-prod.yml
new file mode 100644
index 00000000..48426ae3
--- /dev/null
+++ b/ocr/src/main/resources/application-prod.yml
@@ -0,0 +1,48 @@
+server:
+ port: 7030
+ servlet:
+ context-path: /v1.0
+spring:
+ snowflake:
+ datacenterId: 1
+ workerId: 1
+ application:
+ name: tall
+ datasource:
+ type: com.alibaba.druid.pool.DruidDataSource
+ rabbitmq:
+ host: 127.0.0.1
+ password: 111111
+ port: 5672
+ username: admin
+ redis:
+ database: 0
+ host: 127.0.0.1
+ jedis:
+ pool:
+ max-active: 200
+ max-idle: 10
+ max-wait: -1ms
+ min-idle: 0
+# password: ''
+ password: 'areowqr!@43ef'
+ port: 6379
+ timeout: 1000ms
+swagger:
+ enable: false
+eureka:
+ instance:
+ # www.tall.wiki
+# ip-address: 140.143.228.3
+# ip-address: 81.70.54.64
+ ip-address: 192.144.182.42
+
+gatewayUrl: https://www.tall.wiki/gateway/
+notGatewayUrl: https://www.tall.wiki/
+smsCode: 1
+wx:
+ prefixUrl: https://www.tall.wiki/wxconfigurer-api/
+file:
+ path: /home/cloud/tall/uploads/
+ domain: https://www.tall.wiki/gateway/tall/v1.0/
+ imgDomain: https://www.tall.wiki/gateway/tall/v1.0/uploads
\ No newline at end of file
diff --git a/ocr/src/main/resources/application-prodapi.yml b/ocr/src/main/resources/application-prodapi.yml
new file mode 100644
index 00000000..c0e64083
--- /dev/null
+++ b/ocr/src/main/resources/application-prodapi.yml
@@ -0,0 +1,44 @@
+server:
+ port: 7031
+ servlet:
+ context-path: /v1.0
+spring:
+ snowflake:
+ datacenterId: 3
+ workerId: 3
+ application:
+ name: tall
+ datasource:
+ type: com.alibaba.druid.pool.DruidDataSource
+ rabbitmq:
+ host: www.tall.wiki
+ password: 111111
+ port: 5672
+ username: admin
+ redis:
+ database: 0
+ host: www.tall.wiki
+ jedis:
+ pool:
+ max-active: 200
+ max-idle: 10
+ max-wait: -1ms
+ min-idle: 0
+ password: 'areowqr!@43ef'
+ port: 6379
+ timeout: 1000ms
+swagger:
+ enable: false
+eureka:
+ instance:
+ ip-address: 129.28.149.79
+
+gatewayUrl: https://www.tall.wiki/gateway/
+notGatewayUrl: https://www.tall.wiki/
+smsCode: 1
+wx:
+ prefixUrl: https://www.tall.wiki/wxconfigurer-api/
+file:
+ path: /home/cloud/tall/uploads/
+ domain: https://www.tall.wiki/gateway/tall/v1.0/
+ imgDomain: https://www.tall.wiki/gateway/tall/v1.0/uploads
\ No newline at end of file
diff --git a/ocr/src/main/resources/application-prodsd.yml b/ocr/src/main/resources/application-prodsd.yml
new file mode 100644
index 00000000..b3d23b27
--- /dev/null
+++ b/ocr/src/main/resources/application-prodsd.yml
@@ -0,0 +1,44 @@
+server:
+ port: 7031
+ servlet:
+ context-path: /v1.0
+spring:
+ snowflake:
+ datacenterId: 2
+ workerId: 2
+ application:
+ name: tall
+ datasource:
+ type: com.alibaba.druid.pool.DruidDataSource
+ rabbitmq:
+ host: www.tall.wiki
+ password: 111111
+ port: 5672
+ username: admin
+ redis:
+ database: 0
+ host: www.tall.wiki
+ jedis:
+ pool:
+ max-active: 200
+ max-idle: 10
+ max-wait: -1ms
+ min-idle: 0
+ password: 'areowqr!@43ef'
+ port: 6379
+ timeout: 1000ms
+swagger:
+ enable: false
+eureka:
+ instance:
+ ip-address: 121.36.3.207
+
+gatewayUrl: https://www.tall.wiki/gateway/
+notGatewayUrl: https://www.tall.wiki/
+smsCode: 1
+wx:
+ prefixUrl: https://www.tall.wiki/wxconfigurer-api/
+file:
+ path: /home/cloud/tall/uploads/
+ domain: https://www.tall.wiki/gateway/tall/v1.0/
+ imgDomain: https://www.tall.wiki/gateway/tall/v1.0/uploads
\ No newline at end of file
diff --git a/ocr/src/main/resources/application-test.yml b/ocr/src/main/resources/application-test.yml
new file mode 100644
index 00000000..de3527c1
--- /dev/null
+++ b/ocr/src/main/resources/application-test.yml
@@ -0,0 +1,51 @@
+server:
+ port: 7030
+ servlet:
+ context-path: /v1.0
+spring:
+ snowflake:
+ datacenterId: 1
+ workerId: 1
+ application:
+ name: tall
+ datasource:
+ type: com.alibaba.druid.pool.DruidDataSource
+ rabbitmq:
+ host: 127.0.0.1
+# host: api.ccsens.com
+ password: 111111
+ port: 5672
+ username: admin
+ redis:
+ database: 0
+ host: 127.0.0.1
+ jedis:
+ pool:
+ max-active: 200
+ max-idle: 10
+ max-wait: -1ms
+ min-idle: 0
+ password: ''
+ port: 6379
+ timeout: 1000ms
+swagger:
+ enable: true
+eureka:
+ instance:
+ ip-address: 192.168.0.99
+# ip-address: 49.233.89.188
+#gatewayUrl: http://192.168.0.99/gateway/
+#notGatewayUrl: http://192.168.0.99/
+gatewayUrl: https://test.tall.wiki/gateway/
+notGatewayUrl: https://test.tall.wiki/
+smsCode: 0
+wx:
+ prefixUrl: https://www.tall.wiki/wxconfigurer-api/
+file:
+ path: /home/cloud/tall/uploads/
+ domain: https://test.tall.wiki/gateway/tall/v1.0/
+ imgDomain: https://test.tall.wiki/gateway/tall/v1.0/uploads
+
+#file:
+# domain: http://192.168.0.99/gateway/tall/v1.0/
+# imgDomain: http://192.168.0.99/gateway/tall/v1.0/uploads
\ No newline at end of file
diff --git a/ocr/src/main/resources/application.yml b/ocr/src/main/resources/application.yml
new file mode 100644
index 00000000..b5408a3a
--- /dev/null
+++ b/ocr/src/main/resources/application.yml
@@ -0,0 +1,5 @@
+spring:
+ profiles:
+ active: dev
+ include: util-dev,common
+
diff --git a/ocr/src/main/resources/banner.txt b/ocr/src/main/resources/banner.txt
new file mode 100644
index 00000000..759c9b00
--- /dev/null
+++ b/ocr/src/main/resources/banner.txt
@@ -0,0 +1,21 @@
+// _ooOoo_
+// o8888888o
+// 88" . "88
+// (| -_- |)
+// O\ = /O
+// ____/`---'\____
+// . ' \\| |// `.
+// / \\||| : |||// \
+// / _||||| -:- |||||- \
+// | | \\\ - /// | |
+// | \_| ''\---/'' | |
+// \ .-\__ `-` ___/-. /
+// ___`. .' /--.--\ `. . __
+// ."" '< `.___\_<|>_/___.' >'"".
+// | | : `- \`.;`\ _ /`;.`/ - ` : | |
+// \ \ `-. \_ __\ /__ _/ .-` / /
+// ======`-.____`-.___\_____/___.-`____.-'======
+// `=---='
+//
+// .............................................
+// 佛祖保佑 永无BUG
\ No newline at end of file
diff --git a/ocr/src/main/resources/logback-spring.xml b/ocr/src/main/resources/logback-spring.xml
new file mode 100644
index 00000000..f3348e34
--- /dev/null
+++ b/ocr/src/main/resources/logback-spring.xml
@@ -0,0 +1,196 @@
+
+
+
+
+
+
+
+
+
+ logback
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ info
+
+
+ ${CONSOLE_LOG_PATTERN}
+
+ UTF-8
+
+
+
+
+
+
+
+
+
+ ${log.path}/log_debug.log
+
+
+ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
+ UTF-8
+
+
+
+
+ ${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log
+
+ 100MB
+
+
+ 15
+
+
+
+ debug
+ ACCEPT
+ DENY
+
+
+
+
+
+
+ ${log.path}/log_info.log
+
+
+ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
+ UTF-8
+
+
+
+
+ ${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log
+
+ 100MB
+
+
+ 15
+
+
+
+ info
+ ACCEPT
+ DENY
+
+
+
+
+
+
+ ${log.path}/log_warn.log
+
+
+ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
+ UTF-8
+
+
+
+ ${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log
+
+ 100MB
+
+
+ 15
+
+
+
+ warn
+ ACCEPT
+ DENY
+
+
+
+
+
+
+
+ ${log.path}/log_error.log
+
+
+ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
+ UTF-8
+
+
+
+ ${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log
+
+ 100MB
+
+
+ 15
+
+
+
+ ERROR
+ ACCEPT
+ DENY
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ocr/src/test/java/com/ccsens/orc/test/OrcTest.java b/ocr/src/test/java/com/ccsens/orc/test/OrcTest.java
new file mode 100644
index 00000000..cc01df11
--- /dev/null
+++ b/ocr/src/test/java/com/ccsens/orc/test/OrcTest.java
@@ -0,0 +1,61 @@
+package com.ccsens.orc.test;
+
+import org.junit.Test;
+import org.opencv.core.Core;
+import org.opencv.core.CvType;
+import org.opencv.core.Mat;
+import org.opencv.core.Size;
+import org.opencv.imgcodecs.Imgcodecs;
+import org.opencv.imgproc.Imgproc;
+
+/**
+ * @description:
+ * @author: whj
+ * @time: 2021/3/17 17:45
+ */
+public class OrcTest {
+
+ @Test
+ public void test01(){
+ // 加载资源
+ System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
+
+ //创建3px*3px的8UC1(8个位的无符号(8U)单通道(C1)整数)
+// Mat hello = Mat.eye(3,3, CvType.CV_8UC1);
+// System.out.println(hello.dump());
+ //加载图片
+ Mat mat = Imgcodecs.imread("D:\\img\\0df7f58ea9d3a61019596094eb35003.png");
+ // 加载图片并灰度图像
+// Mat mat = Imgcodecs.imread("D:\\img\\0df7f58ea9d3a61019596094eb35003.png", Imgcodecs.IMREAD_GRAYSCALE);
+// System.out.println(mat.width() + "*" + mat.height() + "," + mat.type());
+// System.out.println(mat);
+ // 输出图片
+// Imgcodecs.imwrite("D:\\img\\1.png", mat);
+ // 截取图像
+// Mat submat = mat.submat(50, 300, 60, 250);
+// Imgcodecs.imwrite("D:\\img\\1.png", submat);
+ // 模糊图片 模糊子图片后,父模块也跟着模糊了
+// Imgproc.blur(submat, submat, new Size(25.0,25.0));
+// System.out.println(submat);
+// Imgcodecs.imwrite("D:\\img\\blur.png", mat);
+ // 黑白化
+ Imgproc.cvtColor(mat, mat, Imgproc.COLOR_RGB2GRAY);
+ /*
+ 高亮显示轮廓
+ ■源矩阵
+ ■目标矩阵
+ ■低阈值,使用150.0
+ ■高阈值,通常是低阈值的2倍或3倍
+ ■光圈,3~7之间的一个奇数,我们使用3。光圈值越大,被检测到的轮廓越多
+ ■L2梯度,暂时设置为true
+ */
+ Imgproc.Canny(mat, mat, 150,300,5, true);
+ // 反色操作
+ Core.bitwise_not(mat, mat);
+ // 将反色结果作为掩膜
+ Mat bg = Imgcodecs.imread("D:\\img\\e2669de7219943b8ac37f79dd8fef2f8.png");
+ Imgproc.resize(bg, bg, mat.size());
+ bg.copyTo(mat,mat);
+ Imgcodecs.imwrite("D:\\img\\1.png", mat);
+ }
+}
diff --git a/pom.xml b/pom.xml
index 625987e1..886f407b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,9 +9,9 @@
cloudutil
util
tall
-
-
-
+ ht
+ game
+ mt
wisdomcar
beneficiation
@@ -20,6 +20,7 @@
tcm
+ ocr
diff --git a/tall/src/main/resources/application-prodsd.yml b/tall/src/main/resources/application-prodsd.yml
index 1177ad28..fc50b900 100644
--- a/tall/src/main/resources/application-prodsd.yml
+++ b/tall/src/main/resources/application-prodsd.yml
@@ -31,7 +31,7 @@ swagger:
enable: false
eureka:
instance:
- ip-address: 81.70.54.64
+ ip-address: 121.36.3.207
gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/
diff --git a/tall/src/main/resources/application-test.yml b/tall/src/main/resources/application-test.yml
index 0d2c66c4..c6f9600e 100644
--- a/tall/src/main/resources/application-test.yml
+++ b/tall/src/main/resources/application-test.yml
@@ -32,7 +32,7 @@ swagger:
enable: true
eureka:
instance:
- ip-address: 192.168.0.99
+ ip-address: 127.0.0.1
# ip-address: 49.233.89.188
#gatewayUrl: http://192.168.0.99/gateway/
#notGatewayUrl: http://192.168.0.99/
diff --git a/tall/src/main/resources/application.yml b/tall/src/main/resources/application.yml
index ebc544af..ee27f352 100644
--- a/tall/src/main/resources/application.yml
+++ b/tall/src/main/resources/application.yml
@@ -3,3 +3,4 @@ spring:
active: test
include: util-test,common
+
diff --git a/util/src/main/java/com/ccsens/util/PoiUtil.java b/util/src/main/java/com/ccsens/util/PoiUtil.java
index ddb69837..654acf07 100644
--- a/util/src/main/java/com/ccsens/util/PoiUtil.java
+++ b/util/src/main/java/com/ccsens/util/PoiUtil.java
@@ -186,7 +186,6 @@ public class PoiUtil {
if(ObjectUtil.isNull(cell.value)) {
log.info("单元格内容为空:{}", cell.value);
}else {
- log.info("单元格内容:{}", cell.value);
if (cell.value.length() <= 14 && cell.value.matches("\\d+")) {
newCell.setCellValue(Long.parseLong(cell.value));
} else {
diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/RecordDto.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/RecordDto.java
index 2a8b0fdc..c0c265ef 100644
--- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/RecordDto.java
+++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/RecordDto.java
@@ -26,6 +26,9 @@ public class RecordDto {
private Long startTime;
@ApiModelProperty("结束时间, 默认当前时间")
private Long endTime;
+ @ApiModelProperty("数据类型 0开始 1体重 2rfid, 3称重一 4称重二 5称重三 6称重四 7震动 8剂量")
+ private byte[] types = {1,2};
+
// @ApiModelProperty("当前页,默认1")
// private int pageNum=1;
// @ApiModelProperty("每页数量,默认100")
@@ -55,6 +58,8 @@ public class RecordDto {
private Long startTime;
@ApiModelProperty("结束时间, 默认当前时间")
private Long endTime;
+ @ApiModelProperty("数据类型 0开始 1体重 2rfid, 3称重一 4称重二 5称重三 6称重四 7震动 8剂量")
+ private byte[] types = {1,2};
{
endTime = System.currentTimeMillis();
diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/RecordVo.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/RecordVo.java
index 2a0259e4..1dad8cd8 100644
--- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/RecordVo.java
+++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/RecordVo.java
@@ -1,12 +1,9 @@
package com.ccsens.wisdomcar.bean.vo;
-import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
-import java.util.Date;
-
/**
* @description: 数据记录
* @author: whj
@@ -21,7 +18,7 @@ public class RecordVo {
@ApiModelProperty("时间")
private Long time;
@ApiModelProperty("类型:1体重 2rfid")
- private Byte type;
+ private byte type;
private String value;
private String name;
}
diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/WisdomCarRecordDao.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/WisdomCarRecordDao.java
index 41f5dbe1..97e5d3f1 100644
--- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/WisdomCarRecordDao.java
+++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/WisdomCarRecordDao.java
@@ -20,4 +20,15 @@ public interface WisdomCarRecordDao extends WisdomCarRecordMapper {
* @return 称重和rfid记录
*/
List queryWeightAndRfid(@Param("carId") Long carId, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
+
+ /**
+ * 根据类型查询平车记录
+ * @param carId 平车ID
+ * @param startTime 开始时间
+ * @param endTime 结束时间
+ * @param type 数据类型
+ * @return 记录
+ */
+ List queryRecords(@Param("carId") Long carId, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("type") byte type);
+
}
diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java
index 52ddfa1e..9498902a 100644
--- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java
+++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java
@@ -151,9 +151,56 @@ public class RecordService implements IRecordService{
@Override
public List queryWeightAndRfid(RecordDto.WeightAndRfid param, Long userId) {
- List list = queryWeightAndRfid(param.getCarId(), param.getStartTime(), param.getEndTime());
+ List list = queryRecord(param.getCarId(), param.getStartTime(), param.getEndTime(), param.getTypes());
return list;
}
+ private List queryRecord(Long carId, Long startTime, Long endTime, byte[] types) {
+ List records = new ArrayList<>();
+ if (types == null || types.length == 0) {
+ log.info("没有输入查询记录类型,直接返回");
+ return records;
+ }
+
+ for (byte type : types) {
+ List list = wisdomCarRecordDao.queryRecords(carId, startTime, endTime, type);
+ RecordVo.WeightAndRfid prev = null;
+ for (int i = 0; i < list.size(); i++) {
+ RecordVo.WeightAndRfid cur = list.get(i);
+ if (i == 0) {
+ records.add(cur);
+ prev = cur;
+ continue;
+ }
+ // i > 0 && cur.type == prev.type
+ //称重
+ if (cur.getType() == Constant.CAR_RECORD_WEIGHT) {
+ // 重量差大于10KG或时间间隔大于10分钟,保留
+ if (Math.abs(Integer.parseInt(cur.getValue()) - Integer.parseInt(prev.getValue())) > weightMinus
+ || Math.abs(cur.getTime() - prev.getTime()) > timeMinus) {
+ records.add(cur);
+ prev = cur;
+ }
+ continue;
+ }
+ // 非称重 值不重复 或 非称重 值重复 最后一条数据
+ if(!cur.getValue().equals(prev.getValue()) || i == list.size() -1){
+ records.add(cur);
+
+ } else if (!cur.getValue().equals(list.get(i+1).getValue()) ) {
+ // 非称重 值重复 非最后一条数据
+ // 判断与下一个是否一致,一致,则不保留第一个和最后一个
+ records.add(cur);
+ }
+ prev = cur;
+ }
+ }
+ if (types.length > 1) {
+ log.info("重新排序");
+ Collections.sort(records, (o1, o2) -> (int) (o1.getTime() - o2.getTime()));
+ }
+ return records;
+ }
+
/**
* 查询数据
@@ -218,7 +265,7 @@ public class RecordService implements IRecordService{
@Override
public Workbook exportWeightAndRfid(RecordDto.WeightAndRfidExport param) {
log.info("数据导出:{}", param);
- List list = queryWeightAndRfid(param.getCarId(), param.getStartTime(), param.getEndTime());
+ List list = queryRecord(param.getCarId(), param.getStartTime(), param.getEndTime(), param.getTypes());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 参数封装
List> rows = new ArrayList<>();
@@ -246,7 +293,18 @@ public class RecordService implements IRecordService{
Date time = new Date();
time.setTime(record.getTime());
row.add(new PoiUtil.PoiUtilCell(sdf.format(time)));
- row.add(new PoiUtil.PoiUtilCell(record.getType() == Constant.CAR_RECORD_WEIGHT ? "称重" : "rfid"));
+ String type = "称重";
+ switch (record.getType()) {
+ case Constant.CAR_RECORD_WEIGHT: type = "称重";break;
+ case Constant.CAR_RECORD_RFID: type = "rfid";break;
+ case Constant.WEIGHT_SENSOR_1: type = "称重1";break;
+ case Constant.WEIGHT_SENSOR_2: type = "称重2";break;
+ case Constant.WEIGHT_SENSOR_3: type = "称重3";break;
+ case Constant.WEIGHT_SENSOR_4: type = "称重4";break;
+ case Constant.SHAKE_SENSOR: type = "震动";break;
+ case Constant.THROMBOLYTIC: type = "剂量";break;
+ }
+ row.add(new PoiUtil.PoiUtilCell(type));
row.add(new PoiUtil.PoiUtilCell(record.getType() == Constant.CAR_RECORD_WEIGHT ? new BigDecimal(record.getValue()).divide(new BigDecimal(1000), 3).toString() + "Kg" : record.getName()));
rows.add(row);
}
diff --git a/wisdomcar/src/main/resources/application-test.yml b/wisdomcar/src/main/resources/application-test.yml
index 9af9b909..55574b45 100644
--- a/wisdomcar/src/main/resources/application-test.yml
+++ b/wisdomcar/src/main/resources/application-test.yml
@@ -28,7 +28,7 @@ swagger:
enable: true
eureka:
instance:
- ip-address: 192.168.0.99
+ ip-address: 127.0.0.1
file:
path: /home/cloud/wisdomcar/uploads/
signUpUrl: https://test.tall.wiki/compete/
diff --git a/wisdomcar/src/main/resources/mapper_dao/WisdomCarRecordDao.xml b/wisdomcar/src/main/resources/mapper_dao/WisdomCarRecordDao.xml
index a292f581..dada4965 100644
--- a/wisdomcar/src/main/resources/mapper_dao/WisdomCarRecordDao.xml
+++ b/wisdomcar/src/main/resources/mapper_dao/WisdomCarRecordDao.xml
@@ -11,4 +11,31 @@
) t
order by time
+
\ No newline at end of file