diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..50f4a19
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,161 @@
+
+
+ 4.0.0
+
+ com.casic
+ smartwell-demos
+ 1.0-SNAPSHOT
+
+
+
+
+ jdk-1.8
+
+ true
+ 1.8
+
+
+ 1.8
+ 1.8
+ 1.8
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ 2.4.5
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-jdbc
+ 2.4.5
+
+
+
+ mysql
+ mysql-connector-java
+ 8.0.16
+ compile
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.4.3
+
+
+
+ org.projectlombok
+ lombok
+ 1.18.20
+
+
+
+
+ com.alibaba
+ druid
+ 1.2.6
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.73
+
+
+
+ commons-codec
+ commons-codec
+ 1.14
+
+
+
+ redis.clients
+ jedis
+ 3.1.0
+ jar
+
+
+
+ org.springframework.data
+ spring-data-redis
+ 2.4.8
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 2.1.3.RELEASE
+
+ true
+
+ com.casic.CasicApplication
+ exec
+
+
+
+
+ repackage
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+
+
+ false
+
+
+
+
+
+
+
+ src/main/resources
+
+
+ /config/*/*
+ /config/*-*.yml
+
+ true
+
+
+ src/main/resources
+
+ **/*.xml
+
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..50f4a19
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,161 @@
+
+
+ 4.0.0
+
+ com.casic
+ smartwell-demos
+ 1.0-SNAPSHOT
+
+
+
+
+ jdk-1.8
+
+ true
+ 1.8
+
+
+ 1.8
+ 1.8
+ 1.8
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ 2.4.5
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-jdbc
+ 2.4.5
+
+
+
+ mysql
+ mysql-connector-java
+ 8.0.16
+ compile
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.4.3
+
+
+
+ org.projectlombok
+ lombok
+ 1.18.20
+
+
+
+
+ com.alibaba
+ druid
+ 1.2.6
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.73
+
+
+
+ commons-codec
+ commons-codec
+ 1.14
+
+
+
+ redis.clients
+ jedis
+ 3.1.0
+ jar
+
+
+
+ org.springframework.data
+ spring-data-redis
+ 2.4.8
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 2.1.3.RELEASE
+
+ true
+
+ com.casic.CasicApplication
+ exec
+
+
+
+
+ repackage
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+
+
+ false
+
+
+
+
+
+
+
+ src/main/resources
+
+
+ /config/*/*
+ /config/*-*.yml
+
+ true
+
+
+ src/main/resources
+
+ **/*.xml
+
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/casic/CasicApplication.java b/src/main/java/com/casic/CasicApplication.java
new file mode 100644
index 0000000..9afd0b9
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,28 @@
+package com.casic;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+
+/**
+ * SpringBoot方式启动类
+ *
+ * @author cz
+ * @Date 2022/09/08 14:28
+ */
+
+@Slf4j
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication
+public class CasicApplication {
+ public static void main(String[] args) {
+ log.info("CasicApplication is success!");
+ SpringApplication.run(CasicApplication.class, args);
+ }
+}
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..50f4a19
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,161 @@
+
+
+ 4.0.0
+
+ com.casic
+ smartwell-demos
+ 1.0-SNAPSHOT
+
+
+
+
+ jdk-1.8
+
+ true
+ 1.8
+
+
+ 1.8
+ 1.8
+ 1.8
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ 2.4.5
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-jdbc
+ 2.4.5
+
+
+
+ mysql
+ mysql-connector-java
+ 8.0.16
+ compile
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.4.3
+
+
+
+ org.projectlombok
+ lombok
+ 1.18.20
+
+
+
+
+ com.alibaba
+ druid
+ 1.2.6
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.73
+
+
+
+ commons-codec
+ commons-codec
+ 1.14
+
+
+
+ redis.clients
+ jedis
+ 3.1.0
+ jar
+
+
+
+ org.springframework.data
+ spring-data-redis
+ 2.4.8
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 2.1.3.RELEASE
+
+ true
+
+ com.casic.CasicApplication
+ exec
+
+
+
+
+ repackage
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+
+
+ false
+
+
+
+
+
+
+
+ src/main/resources
+
+
+ /config/*/*
+ /config/*-*.yml
+
+ true
+
+
+ src/main/resources
+
+ **/*.xml
+
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/casic/CasicApplication.java b/src/main/java/com/casic/CasicApplication.java
new file mode 100644
index 0000000..9afd0b9
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,28 @@
+package com.casic;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+
+/**
+ * SpringBoot方式启动类
+ *
+ * @author cz
+ * @Date 2022/09/08 14:28
+ */
+
+@Slf4j
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication
+public class CasicApplication {
+ public static void main(String[] args) {
+ log.info("CasicApplication is success!");
+ SpringApplication.run(CasicApplication.class, args);
+ }
+}
diff --git a/src/main/java/com/casic/config/CorsConfig.java b/src/main/java/com/casic/config/CorsConfig.java
new file mode 100644
index 0000000..7d19680
--- /dev/null
+++ b/src/main/java/com/casic/config/CorsConfig.java
@@ -0,0 +1,31 @@
+package com.casic.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+/**
+ * 基础框架 - 跨域请求配置
+ */
+@Configuration
+public class CorsConfig {
+ @Bean
+ public CorsFilter corsFilter() {
+ UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+ source.registerCorsConfiguration("/**", buildConfig());
+ return new CorsFilter(source);
+ }
+
+ private CorsConfiguration buildConfig() {
+ CorsConfiguration corsConfiguration = new CorsConfiguration();
+ // 1允许任何域名使用
+ corsConfiguration.addAllowedOrigin("*");
+ // 2允许任何头
+ corsConfiguration.addAllowedHeader("*");
+ // 3允许任何方法(post、get等)
+ corsConfiguration.addAllowedMethod("*");
+ return corsConfiguration;
+ }
+}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..50f4a19
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,161 @@
+
+
+ 4.0.0
+
+ com.casic
+ smartwell-demos
+ 1.0-SNAPSHOT
+
+
+
+
+ jdk-1.8
+
+ true
+ 1.8
+
+
+ 1.8
+ 1.8
+ 1.8
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ 2.4.5
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-jdbc
+ 2.4.5
+
+
+
+ mysql
+ mysql-connector-java
+ 8.0.16
+ compile
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.4.3
+
+
+
+ org.projectlombok
+ lombok
+ 1.18.20
+
+
+
+
+ com.alibaba
+ druid
+ 1.2.6
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.73
+
+
+
+ commons-codec
+ commons-codec
+ 1.14
+
+
+
+ redis.clients
+ jedis
+ 3.1.0
+ jar
+
+
+
+ org.springframework.data
+ spring-data-redis
+ 2.4.8
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 2.1.3.RELEASE
+
+ true
+
+ com.casic.CasicApplication
+ exec
+
+
+
+
+ repackage
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+
+
+ false
+
+
+
+
+
+
+
+ src/main/resources
+
+
+ /config/*/*
+ /config/*-*.yml
+
+ true
+
+
+ src/main/resources
+
+ **/*.xml
+
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/casic/CasicApplication.java b/src/main/java/com/casic/CasicApplication.java
new file mode 100644
index 0000000..9afd0b9
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,28 @@
+package com.casic;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+
+/**
+ * SpringBoot方式启动类
+ *
+ * @author cz
+ * @Date 2022/09/08 14:28
+ */
+
+@Slf4j
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication
+public class CasicApplication {
+ public static void main(String[] args) {
+ log.info("CasicApplication is success!");
+ SpringApplication.run(CasicApplication.class, args);
+ }
+}
diff --git a/src/main/java/com/casic/config/CorsConfig.java b/src/main/java/com/casic/config/CorsConfig.java
new file mode 100644
index 0000000..7d19680
--- /dev/null
+++ b/src/main/java/com/casic/config/CorsConfig.java
@@ -0,0 +1,31 @@
+package com.casic.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+/**
+ * 基础框架 - 跨域请求配置
+ */
+@Configuration
+public class CorsConfig {
+ @Bean
+ public CorsFilter corsFilter() {
+ UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+ source.registerCorsConfiguration("/**", buildConfig());
+ return new CorsFilter(source);
+ }
+
+ private CorsConfiguration buildConfig() {
+ CorsConfiguration corsConfiguration = new CorsConfiguration();
+ // 1允许任何域名使用
+ corsConfiguration.addAllowedOrigin("*");
+ // 2允许任何头
+ corsConfiguration.addAllowedHeader("*");
+ // 3允许任何方法(post、get等)
+ corsConfiguration.addAllowedMethod("*");
+ return corsConfiguration;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/controller/AlarmController.java b/src/main/java/com/casic/controller/AlarmController.java
new file mode 100644
index 0000000..957fc36
--- /dev/null
+++ b/src/main/java/com/casic/controller/AlarmController.java
@@ -0,0 +1,38 @@
+package com.casic.controller;
+
+import com.casic.model.AlarmConfigParam;
+import com.casic.service.AlarmService;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/alarm")
+public class AlarmController {
+
+ private final AlarmService alarmService;
+
+ public AlarmController(AlarmService alarmService) {
+ this.alarmService = alarmService;
+ }
+
+ @RequestMapping("/records")
+ public Object getAlarmRecord(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "currentIndex", required = true) Integer currentIndex,
+ @RequestParam(value = "devcode",required =false) String devcode,
+ @RequestParam(value = "pageSize", required = true) Integer pageSize) {
+ return alarmService.getAlarmRecord(deviceType,currentIndex,pageSize,devcode);
+ }
+
+ @RequestMapping("/batch/cancel")
+ public Object excuteAlramBatchCancel(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "devcode",required =false) String devcode) {
+ return alarmService.excuteAlramBatchCancel(deviceType,devcode);
+ }
+
+ @RequestMapping("/config/add")
+ public Object addAlarmConfig(@RequestBody AlarmConfigParam alarmConfigParam) {
+ return alarmService.addAlarmConfig(alarmConfigParam);
+ }
+}
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..50f4a19
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,161 @@
+
+
+ 4.0.0
+
+ com.casic
+ smartwell-demos
+ 1.0-SNAPSHOT
+
+
+
+
+ jdk-1.8
+
+ true
+ 1.8
+
+
+ 1.8
+ 1.8
+ 1.8
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ 2.4.5
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-jdbc
+ 2.4.5
+
+
+
+ mysql
+ mysql-connector-java
+ 8.0.16
+ compile
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.4.3
+
+
+
+ org.projectlombok
+ lombok
+ 1.18.20
+
+
+
+
+ com.alibaba
+ druid
+ 1.2.6
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.73
+
+
+
+ commons-codec
+ commons-codec
+ 1.14
+
+
+
+ redis.clients
+ jedis
+ 3.1.0
+ jar
+
+
+
+ org.springframework.data
+ spring-data-redis
+ 2.4.8
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 2.1.3.RELEASE
+
+ true
+
+ com.casic.CasicApplication
+ exec
+
+
+
+
+ repackage
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+
+
+ false
+
+
+
+
+
+
+
+ src/main/resources
+
+
+ /config/*/*
+ /config/*-*.yml
+
+ true
+
+
+ src/main/resources
+
+ **/*.xml
+
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/casic/CasicApplication.java b/src/main/java/com/casic/CasicApplication.java
new file mode 100644
index 0000000..9afd0b9
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,28 @@
+package com.casic;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+
+/**
+ * SpringBoot方式启动类
+ *
+ * @author cz
+ * @Date 2022/09/08 14:28
+ */
+
+@Slf4j
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication
+public class CasicApplication {
+ public static void main(String[] args) {
+ log.info("CasicApplication is success!");
+ SpringApplication.run(CasicApplication.class, args);
+ }
+}
diff --git a/src/main/java/com/casic/config/CorsConfig.java b/src/main/java/com/casic/config/CorsConfig.java
new file mode 100644
index 0000000..7d19680
--- /dev/null
+++ b/src/main/java/com/casic/config/CorsConfig.java
@@ -0,0 +1,31 @@
+package com.casic.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+/**
+ * 基础框架 - 跨域请求配置
+ */
+@Configuration
+public class CorsConfig {
+ @Bean
+ public CorsFilter corsFilter() {
+ UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+ source.registerCorsConfiguration("/**", buildConfig());
+ return new CorsFilter(source);
+ }
+
+ private CorsConfiguration buildConfig() {
+ CorsConfiguration corsConfiguration = new CorsConfiguration();
+ // 1允许任何域名使用
+ corsConfiguration.addAllowedOrigin("*");
+ // 2允许任何头
+ corsConfiguration.addAllowedHeader("*");
+ // 3允许任何方法(post、get等)
+ corsConfiguration.addAllowedMethod("*");
+ return corsConfiguration;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/controller/AlarmController.java b/src/main/java/com/casic/controller/AlarmController.java
new file mode 100644
index 0000000..957fc36
--- /dev/null
+++ b/src/main/java/com/casic/controller/AlarmController.java
@@ -0,0 +1,38 @@
+package com.casic.controller;
+
+import com.casic.model.AlarmConfigParam;
+import com.casic.service.AlarmService;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/alarm")
+public class AlarmController {
+
+ private final AlarmService alarmService;
+
+ public AlarmController(AlarmService alarmService) {
+ this.alarmService = alarmService;
+ }
+
+ @RequestMapping("/records")
+ public Object getAlarmRecord(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "currentIndex", required = true) Integer currentIndex,
+ @RequestParam(value = "devcode",required =false) String devcode,
+ @RequestParam(value = "pageSize", required = true) Integer pageSize) {
+ return alarmService.getAlarmRecord(deviceType,currentIndex,pageSize,devcode);
+ }
+
+ @RequestMapping("/batch/cancel")
+ public Object excuteAlramBatchCancel(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "devcode",required =false) String devcode) {
+ return alarmService.excuteAlramBatchCancel(deviceType,devcode);
+ }
+
+ @RequestMapping("/config/add")
+ public Object addAlarmConfig(@RequestBody AlarmConfigParam alarmConfigParam) {
+ return alarmService.addAlarmConfig(alarmConfigParam);
+ }
+}
diff --git a/src/main/java/com/casic/controller/DeviceDataController.java b/src/main/java/com/casic/controller/DeviceDataController.java
new file mode 100644
index 0000000..3498b04
--- /dev/null
+++ b/src/main/java/com/casic/controller/DeviceDataController.java
@@ -0,0 +1,38 @@
+package com.casic.controller;
+
+import com.casic.service.DeviceDataService;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/device")
+public class DeviceDataController {
+ private final DeviceDataService deviceDataService;
+
+ public DeviceDataController(DeviceDataService deviceDataService) {
+ this.deviceDataService = deviceDataService;
+ }
+
+ @RequestMapping("/recent-data")
+ public Object getDeviceRecentData(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "recentNum", required = true) String recentNum,
+ @RequestParam(value = "devcode", required = false) String devcode) {
+ return deviceDataService.getDeviceRecentData(deviceType, recentNum, devcode);
+ }
+
+ @RequestMapping("/data/list-page")
+ public Object getDeviceListPage(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "currentIndex", required = true) Integer currentIndex,
+ @RequestParam(value = "pageSize", required = true) Integer pageSize,
+ @RequestParam(value = "devcode", required = false) String devcode) {
+ return deviceDataService.getDeviceListPage(deviceType, currentIndex, pageSize, devcode);
+ }
+
+ @RequestMapping("/level/{deviceType}")
+ public Object getLevelList(@PathVariable("deviceType")String deviceType) {
+ return deviceDataService.getLevel(deviceType);
+ }
+
+}
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..50f4a19
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,161 @@
+
+
+ 4.0.0
+
+ com.casic
+ smartwell-demos
+ 1.0-SNAPSHOT
+
+
+
+
+ jdk-1.8
+
+ true
+ 1.8
+
+
+ 1.8
+ 1.8
+ 1.8
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ 2.4.5
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-jdbc
+ 2.4.5
+
+
+
+ mysql
+ mysql-connector-java
+ 8.0.16
+ compile
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.4.3
+
+
+
+ org.projectlombok
+ lombok
+ 1.18.20
+
+
+
+
+ com.alibaba
+ druid
+ 1.2.6
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.73
+
+
+
+ commons-codec
+ commons-codec
+ 1.14
+
+
+
+ redis.clients
+ jedis
+ 3.1.0
+ jar
+
+
+
+ org.springframework.data
+ spring-data-redis
+ 2.4.8
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 2.1.3.RELEASE
+
+ true
+
+ com.casic.CasicApplication
+ exec
+
+
+
+
+ repackage
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+
+
+ false
+
+
+
+
+
+
+
+ src/main/resources
+
+
+ /config/*/*
+ /config/*-*.yml
+
+ true
+
+
+ src/main/resources
+
+ **/*.xml
+
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/casic/CasicApplication.java b/src/main/java/com/casic/CasicApplication.java
new file mode 100644
index 0000000..9afd0b9
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,28 @@
+package com.casic;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+
+/**
+ * SpringBoot方式启动类
+ *
+ * @author cz
+ * @Date 2022/09/08 14:28
+ */
+
+@Slf4j
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication
+public class CasicApplication {
+ public static void main(String[] args) {
+ log.info("CasicApplication is success!");
+ SpringApplication.run(CasicApplication.class, args);
+ }
+}
diff --git a/src/main/java/com/casic/config/CorsConfig.java b/src/main/java/com/casic/config/CorsConfig.java
new file mode 100644
index 0000000..7d19680
--- /dev/null
+++ b/src/main/java/com/casic/config/CorsConfig.java
@@ -0,0 +1,31 @@
+package com.casic.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+/**
+ * 基础框架 - 跨域请求配置
+ */
+@Configuration
+public class CorsConfig {
+ @Bean
+ public CorsFilter corsFilter() {
+ UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+ source.registerCorsConfiguration("/**", buildConfig());
+ return new CorsFilter(source);
+ }
+
+ private CorsConfiguration buildConfig() {
+ CorsConfiguration corsConfiguration = new CorsConfiguration();
+ // 1允许任何域名使用
+ corsConfiguration.addAllowedOrigin("*");
+ // 2允许任何头
+ corsConfiguration.addAllowedHeader("*");
+ // 3允许任何方法(post、get等)
+ corsConfiguration.addAllowedMethod("*");
+ return corsConfiguration;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/controller/AlarmController.java b/src/main/java/com/casic/controller/AlarmController.java
new file mode 100644
index 0000000..957fc36
--- /dev/null
+++ b/src/main/java/com/casic/controller/AlarmController.java
@@ -0,0 +1,38 @@
+package com.casic.controller;
+
+import com.casic.model.AlarmConfigParam;
+import com.casic.service.AlarmService;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/alarm")
+public class AlarmController {
+
+ private final AlarmService alarmService;
+
+ public AlarmController(AlarmService alarmService) {
+ this.alarmService = alarmService;
+ }
+
+ @RequestMapping("/records")
+ public Object getAlarmRecord(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "currentIndex", required = true) Integer currentIndex,
+ @RequestParam(value = "devcode",required =false) String devcode,
+ @RequestParam(value = "pageSize", required = true) Integer pageSize) {
+ return alarmService.getAlarmRecord(deviceType,currentIndex,pageSize,devcode);
+ }
+
+ @RequestMapping("/batch/cancel")
+ public Object excuteAlramBatchCancel(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "devcode",required =false) String devcode) {
+ return alarmService.excuteAlramBatchCancel(deviceType,devcode);
+ }
+
+ @RequestMapping("/config/add")
+ public Object addAlarmConfig(@RequestBody AlarmConfigParam alarmConfigParam) {
+ return alarmService.addAlarmConfig(alarmConfigParam);
+ }
+}
diff --git a/src/main/java/com/casic/controller/DeviceDataController.java b/src/main/java/com/casic/controller/DeviceDataController.java
new file mode 100644
index 0000000..3498b04
--- /dev/null
+++ b/src/main/java/com/casic/controller/DeviceDataController.java
@@ -0,0 +1,38 @@
+package com.casic.controller;
+
+import com.casic.service.DeviceDataService;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/device")
+public class DeviceDataController {
+ private final DeviceDataService deviceDataService;
+
+ public DeviceDataController(DeviceDataService deviceDataService) {
+ this.deviceDataService = deviceDataService;
+ }
+
+ @RequestMapping("/recent-data")
+ public Object getDeviceRecentData(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "recentNum", required = true) String recentNum,
+ @RequestParam(value = "devcode", required = false) String devcode) {
+ return deviceDataService.getDeviceRecentData(deviceType, recentNum, devcode);
+ }
+
+ @RequestMapping("/data/list-page")
+ public Object getDeviceListPage(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "currentIndex", required = true) Integer currentIndex,
+ @RequestParam(value = "pageSize", required = true) Integer pageSize,
+ @RequestParam(value = "devcode", required = false) String devcode) {
+ return deviceDataService.getDeviceListPage(deviceType, currentIndex, pageSize, devcode);
+ }
+
+ @RequestMapping("/level/{deviceType}")
+ public Object getLevelList(@PathVariable("deviceType")String deviceType) {
+ return deviceDataService.getLevel(deviceType);
+ }
+
+}
diff --git a/src/main/java/com/casic/controller/ThirdDataController.java b/src/main/java/com/casic/controller/ThirdDataController.java
new file mode 100644
index 0000000..b9b2b42
--- /dev/null
+++ b/src/main/java/com/casic/controller/ThirdDataController.java
@@ -0,0 +1,28 @@
+package com.casic.controller;
+
+import com.casic.model.PressureDataParam;
+import com.casic.service.ThirdDataService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+@RestController
+@RequestMapping("/push")
+@Slf4j
+public class ThirdDataController {
+
+ private final ThirdDataService thirdDataService;
+
+ public ThirdDataController(ThirdDataService thirdDataService) {
+ this.thirdDataService = thirdDataService;
+ }
+
+ @RequestMapping("/pressure/data")
+ public Object getDeviceRecentData(@RequestBody PressureDataParam pressureData) {
+ return thirdDataService.getDeviceRecentData(pressureData);
+ }
+
+}
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..50f4a19
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,161 @@
+
+
+ 4.0.0
+
+ com.casic
+ smartwell-demos
+ 1.0-SNAPSHOT
+
+
+
+
+ jdk-1.8
+
+ true
+ 1.8
+
+
+ 1.8
+ 1.8
+ 1.8
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+ 2.4.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ 2.4.5
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-jdbc
+ 2.4.5
+
+
+
+ mysql
+ mysql-connector-java
+ 8.0.16
+ compile
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.4.3
+
+
+
+ org.projectlombok
+ lombok
+ 1.18.20
+
+
+
+
+ com.alibaba
+ druid
+ 1.2.6
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.73
+
+
+
+ commons-codec
+ commons-codec
+ 1.14
+
+
+
+ redis.clients
+ jedis
+ 3.1.0
+ jar
+
+
+
+ org.springframework.data
+ spring-data-redis
+ 2.4.8
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 2.1.3.RELEASE
+
+ true
+
+ com.casic.CasicApplication
+ exec
+
+
+
+
+ repackage
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+
+
+ false
+
+
+
+
+
+
+
+ src/main/resources
+
+
+ /config/*/*
+ /config/*-*.yml
+
+ true
+
+
+ src/main/resources
+
+ **/*.xml
+
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/casic/CasicApplication.java b/src/main/java/com/casic/CasicApplication.java
new file mode 100644
index 0000000..9afd0b9
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,28 @@
+package com.casic;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+
+/**
+ * SpringBoot方式启动类
+ *
+ * @author cz
+ * @Date 2022/09/08 14:28
+ */
+
+@Slf4j
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication
+public class CasicApplication {
+ public static void main(String[] args) {
+ log.info("CasicApplication is success!");
+ SpringApplication.run(CasicApplication.class, args);
+ }
+}
diff --git a/src/main/java/com/casic/config/CorsConfig.java b/src/main/java/com/casic/config/CorsConfig.java
new file mode 100644
index 0000000..7d19680
--- /dev/null
+++ b/src/main/java/com/casic/config/CorsConfig.java
@@ -0,0 +1,31 @@
+package com.casic.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+/**
+ * 基础框架 - 跨域请求配置
+ */
+@Configuration
+public class CorsConfig {
+ @Bean
+ public CorsFilter corsFilter() {
+ UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+ source.registerCorsConfiguration("/**", buildConfig());
+ return new CorsFilter(source);
+ }
+
+ private CorsConfiguration buildConfig() {
+ CorsConfiguration corsConfiguration = new CorsConfiguration();
+ // 1允许任何域名使用
+ corsConfiguration.addAllowedOrigin("*");
+ // 2允许任何头
+ corsConfiguration.addAllowedHeader("*");
+ // 3允许任何方法(post、get等)
+ corsConfiguration.addAllowedMethod("*");
+ return corsConfiguration;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/casic/controller/AlarmController.java b/src/main/java/com/casic/controller/AlarmController.java
new file mode 100644
index 0000000..957fc36
--- /dev/null
+++ b/src/main/java/com/casic/controller/AlarmController.java
@@ -0,0 +1,38 @@
+package com.casic.controller;
+
+import com.casic.model.AlarmConfigParam;
+import com.casic.service.AlarmService;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/alarm")
+public class AlarmController {
+
+ private final AlarmService alarmService;
+
+ public AlarmController(AlarmService alarmService) {
+ this.alarmService = alarmService;
+ }
+
+ @RequestMapping("/records")
+ public Object getAlarmRecord(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "currentIndex", required = true) Integer currentIndex,
+ @RequestParam(value = "devcode",required =false) String devcode,
+ @RequestParam(value = "pageSize", required = true) Integer pageSize) {
+ return alarmService.getAlarmRecord(deviceType,currentIndex,pageSize,devcode);
+ }
+
+ @RequestMapping("/batch/cancel")
+ public Object excuteAlramBatchCancel(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "devcode",required =false) String devcode) {
+ return alarmService.excuteAlramBatchCancel(deviceType,devcode);
+ }
+
+ @RequestMapping("/config/add")
+ public Object addAlarmConfig(@RequestBody AlarmConfigParam alarmConfigParam) {
+ return alarmService.addAlarmConfig(alarmConfigParam);
+ }
+}
diff --git a/src/main/java/com/casic/controller/DeviceDataController.java b/src/main/java/com/casic/controller/DeviceDataController.java
new file mode 100644
index 0000000..3498b04
--- /dev/null
+++ b/src/main/java/com/casic/controller/DeviceDataController.java
@@ -0,0 +1,38 @@
+package com.casic.controller;
+
+import com.casic.service.DeviceDataService;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/device")
+public class DeviceDataController {
+ private final DeviceDataService deviceDataService;
+
+ public DeviceDataController(DeviceDataService deviceDataService) {
+ this.deviceDataService = deviceDataService;
+ }
+
+ @RequestMapping("/recent-data")
+ public Object getDeviceRecentData(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "recentNum", required = true) String recentNum,
+ @RequestParam(value = "devcode", required = false) String devcode) {
+ return deviceDataService.getDeviceRecentData(deviceType, recentNum, devcode);
+ }
+
+ @RequestMapping("/data/list-page")
+ public Object getDeviceListPage(@RequestParam(value = "deviceType", required = true) String deviceType,
+ @RequestParam(value = "currentIndex", required = true) Integer currentIndex,
+ @RequestParam(value = "pageSize", required = true) Integer pageSize,
+ @RequestParam(value = "devcode", required = false) String devcode) {
+ return deviceDataService.getDeviceListPage(deviceType, currentIndex, pageSize, devcode);
+ }
+
+ @RequestMapping("/level/{deviceType}")
+ public Object getLevelList(@PathVariable("deviceType")String deviceType) {
+ return deviceDataService.getLevel(deviceType);
+ }
+
+}
diff --git a/src/main/java/com/casic/controller/ThirdDataController.java b/src/main/java/com/casic/controller/ThirdDataController.java
new file mode 100644
index 0000000..b9b2b42
--- /dev/null
+++ b/src/main/java/com/casic/controller/ThirdDataController.java
@@ -0,0 +1,28 @@
+package com.casic.controller;
+
+import com.casic.model.PressureDataParam;
+import com.casic.service.ThirdDataService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+@RestController
+@RequestMapping("/push")
+@Slf4j
+public class ThirdDataController {
+
+ private final ThirdDataService thirdDataService;
+
+ public ThirdDataController(ThirdDataService thirdDataService) {
+ this.thirdDataService = thirdDataService;
+ }
+
+ @RequestMapping("/pressure/data")
+ public Object getDeviceRecentData(@RequestBody PressureDataParam pressureData) {
+ return thirdDataService.getDeviceRecentData(pressureData);
+ }
+
+}
diff --git a/src/main/java/com/casic/dao/AlarmMapper.java b/src/main/java/com/casic/dao/AlarmMapper.java
new file mode 100644
index 0000000..a442e3a
--- /dev/null
+++ b/src/main/java/com/casic/dao/AlarmMapper.java
@@ -0,0 +1,28 @@
+package com.casic.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.casic.model.AlarmLevel;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface AlarmMapper extends BaseMapper {
+
+ List