diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..9661ac7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..9661ac7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ 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..98d3a9c
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,31 @@
+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/06/20 14:28
+ */
+
+@Slf4j
+@EnableTransactionManagement(proxyTargetClass = true)
+@EnableAsync
+@EnableScheduling
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
+public class CasicApplication {
+ public static void main(String[] args) {
+ log.info("CasicApplication is success!");
+ SpringApplication.run(CasicApplication.class, args);
+ }
+}
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..9661ac7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ 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..98d3a9c
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,31 @@
+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/06/20 14:28
+ */
+
+@Slf4j
+@EnableTransactionManagement(proxyTargetClass = true)
+@EnableAsync
+@EnableScheduling
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
+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/CmsDataSourceConfig.java b/src/main/java/com/casic/config/CmsDataSourceConfig.java
new file mode 100644
index 0000000..59253c1
--- /dev/null
+++ b/src/main/java/com/casic/config/CmsDataSourceConfig.java
@@ -0,0 +1,62 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置1
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.cms", sqlSessionFactoryRef = "cmsSqlSessionFactory")
+public class CmsDataSourceConfig {
+ @Value("${spring.datasource.cms.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.cms.url}")
+ String url;
+ @Value("${spring.datasource.cms.username}")
+ String userName;
+ @Value("${spring.datasource.cms.password}")
+ String passWord;
+
+ @Primary
+ @Bean(name = "cmsDataSource")
+ @ConfigurationProperties("spring.datasource.cms")
+ public DataSource masterDataSource() {
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "cmsSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("cmsDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/cms/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "cmsSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("cmsSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..9661ac7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ 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..98d3a9c
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,31 @@
+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/06/20 14:28
+ */
+
+@Slf4j
+@EnableTransactionManagement(proxyTargetClass = true)
+@EnableAsync
+@EnableScheduling
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
+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/CmsDataSourceConfig.java b/src/main/java/com/casic/config/CmsDataSourceConfig.java
new file mode 100644
index 0000000..59253c1
--- /dev/null
+++ b/src/main/java/com/casic/config/CmsDataSourceConfig.java
@@ -0,0 +1,62 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置1
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.cms", sqlSessionFactoryRef = "cmsSqlSessionFactory")
+public class CmsDataSourceConfig {
+ @Value("${spring.datasource.cms.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.cms.url}")
+ String url;
+ @Value("${spring.datasource.cms.username}")
+ String userName;
+ @Value("${spring.datasource.cms.password}")
+ String passWord;
+
+ @Primary
+ @Bean(name = "cmsDataSource")
+ @ConfigurationProperties("spring.datasource.cms")
+ public DataSource masterDataSource() {
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "cmsSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("cmsDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/cms/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "cmsSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("cmsSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
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/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..9661ac7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ 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..98d3a9c
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,31 @@
+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/06/20 14:28
+ */
+
+@Slf4j
+@EnableTransactionManagement(proxyTargetClass = true)
+@EnableAsync
+@EnableScheduling
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
+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/CmsDataSourceConfig.java b/src/main/java/com/casic/config/CmsDataSourceConfig.java
new file mode 100644
index 0000000..59253c1
--- /dev/null
+++ b/src/main/java/com/casic/config/CmsDataSourceConfig.java
@@ -0,0 +1,62 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置1
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.cms", sqlSessionFactoryRef = "cmsSqlSessionFactory")
+public class CmsDataSourceConfig {
+ @Value("${spring.datasource.cms.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.cms.url}")
+ String url;
+ @Value("${spring.datasource.cms.username}")
+ String userName;
+ @Value("${spring.datasource.cms.password}")
+ String passWord;
+
+ @Primary
+ @Bean(name = "cmsDataSource")
+ @ConfigurationProperties("spring.datasource.cms")
+ public DataSource masterDataSource() {
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "cmsSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("cmsDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/cms/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "cmsSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("cmsSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
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/config/DeviceTypesConfig.java b/src/main/java/com/casic/config/DeviceTypesConfig.java
new file mode 100644
index 0000000..9b727c0
--- /dev/null
+++ b/src/main/java/com/casic/config/DeviceTypesConfig.java
@@ -0,0 +1,14 @@
+package com.casic.config;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Data
+@Configuration("DeviceTypesConfig")
+public class DeviceTypesConfig {
+
+ @Value("${casic.device-types}")
+ private String deviceTypes;
+
+}
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..9661ac7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ 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..98d3a9c
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,31 @@
+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/06/20 14:28
+ */
+
+@Slf4j
+@EnableTransactionManagement(proxyTargetClass = true)
+@EnableAsync
+@EnableScheduling
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
+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/CmsDataSourceConfig.java b/src/main/java/com/casic/config/CmsDataSourceConfig.java
new file mode 100644
index 0000000..59253c1
--- /dev/null
+++ b/src/main/java/com/casic/config/CmsDataSourceConfig.java
@@ -0,0 +1,62 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置1
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.cms", sqlSessionFactoryRef = "cmsSqlSessionFactory")
+public class CmsDataSourceConfig {
+ @Value("${spring.datasource.cms.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.cms.url}")
+ String url;
+ @Value("${spring.datasource.cms.username}")
+ String userName;
+ @Value("${spring.datasource.cms.password}")
+ String passWord;
+
+ @Primary
+ @Bean(name = "cmsDataSource")
+ @ConfigurationProperties("spring.datasource.cms")
+ public DataSource masterDataSource() {
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "cmsSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("cmsDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/cms/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "cmsSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("cmsSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
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/config/DeviceTypesConfig.java b/src/main/java/com/casic/config/DeviceTypesConfig.java
new file mode 100644
index 0000000..9b727c0
--- /dev/null
+++ b/src/main/java/com/casic/config/DeviceTypesConfig.java
@@ -0,0 +1,14 @@
+package com.casic.config;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Data
+@Configuration("DeviceTypesConfig")
+public class DeviceTypesConfig {
+
+ @Value("${casic.device-types}")
+ private String deviceTypes;
+
+}
diff --git a/src/main/java/com/casic/config/SmartWellDataSourceConfig.java b/src/main/java/com/casic/config/SmartWellDataSourceConfig.java
new file mode 100644
index 0000000..4c75368
--- /dev/null
+++ b/src/main/java/com/casic/config/SmartWellDataSourceConfig.java
@@ -0,0 +1,61 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置2
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.smartwell",sqlSessionFactoryRef = "smartwellSqlSessionFactory")
+public class SmartWellDataSourceConfig {
+
+ @Value("${spring.datasource.smartwell.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.smartwell.url}")
+ String url;
+ @Value("${spring.datasource.smartwell.username}")
+ String userName;
+ @Value("${spring.datasource.smartwell.password}")
+ String passWord;
+
+ @Bean(name = "smartwellDataSource")
+ @ConfigurationProperties("spring.datasource.smartwell")
+ public DataSource masterDataSource(){
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "smartwellSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("smartwellDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/smartwell/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "smartwelSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("smartwellSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..9661ac7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ 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..98d3a9c
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,31 @@
+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/06/20 14:28
+ */
+
+@Slf4j
+@EnableTransactionManagement(proxyTargetClass = true)
+@EnableAsync
+@EnableScheduling
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
+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/CmsDataSourceConfig.java b/src/main/java/com/casic/config/CmsDataSourceConfig.java
new file mode 100644
index 0000000..59253c1
--- /dev/null
+++ b/src/main/java/com/casic/config/CmsDataSourceConfig.java
@@ -0,0 +1,62 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置1
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.cms", sqlSessionFactoryRef = "cmsSqlSessionFactory")
+public class CmsDataSourceConfig {
+ @Value("${spring.datasource.cms.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.cms.url}")
+ String url;
+ @Value("${spring.datasource.cms.username}")
+ String userName;
+ @Value("${spring.datasource.cms.password}")
+ String passWord;
+
+ @Primary
+ @Bean(name = "cmsDataSource")
+ @ConfigurationProperties("spring.datasource.cms")
+ public DataSource masterDataSource() {
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "cmsSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("cmsDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/cms/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "cmsSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("cmsSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
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/config/DeviceTypesConfig.java b/src/main/java/com/casic/config/DeviceTypesConfig.java
new file mode 100644
index 0000000..9b727c0
--- /dev/null
+++ b/src/main/java/com/casic/config/DeviceTypesConfig.java
@@ -0,0 +1,14 @@
+package com.casic.config;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Data
+@Configuration("DeviceTypesConfig")
+public class DeviceTypesConfig {
+
+ @Value("${casic.device-types}")
+ private String deviceTypes;
+
+}
diff --git a/src/main/java/com/casic/config/SmartWellDataSourceConfig.java b/src/main/java/com/casic/config/SmartWellDataSourceConfig.java
new file mode 100644
index 0000000..4c75368
--- /dev/null
+++ b/src/main/java/com/casic/config/SmartWellDataSourceConfig.java
@@ -0,0 +1,61 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置2
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.smartwell",sqlSessionFactoryRef = "smartwellSqlSessionFactory")
+public class SmartWellDataSourceConfig {
+
+ @Value("${spring.datasource.smartwell.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.smartwell.url}")
+ String url;
+ @Value("${spring.datasource.smartwell.username}")
+ String userName;
+ @Value("${spring.datasource.smartwell.password}")
+ String passWord;
+
+ @Bean(name = "smartwellDataSource")
+ @ConfigurationProperties("spring.datasource.smartwell")
+ public DataSource masterDataSource(){
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "smartwellSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("smartwellDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/smartwell/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "smartwelSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("smartwellSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
diff --git a/src/main/java/com/casic/config/TiltDataSourceConfig.java b/src/main/java/com/casic/config/TiltDataSourceConfig.java
new file mode 100644
index 0000000..3a1e23c
--- /dev/null
+++ b/src/main/java/com/casic/config/TiltDataSourceConfig.java
@@ -0,0 +1,61 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+
+/**
+ * @program:
+ * @description: 数据库配置3
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.spantilt",sqlSessionFactoryRef = "tiltSqlSessionFactory")
+public class TiltDataSourceConfig {
+
+ @Value("${spring.datasource.spantilt.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.spantilt.url}")
+ String url;
+ @Value("${spring.datasource.spantilt.username}")
+ String userName;
+ @Value("${spring.datasource.spantilt.password}")
+ String passWord;
+
+ @Bean(name = "tiltDataSource")
+ @ConfigurationProperties("spring.datasource.spantilt")
+ public DataSource masterDataSource(){
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "tiltSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("tiltDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/tilt/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "tiltSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("tiltSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..9661ac7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ 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..98d3a9c
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,31 @@
+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/06/20 14:28
+ */
+
+@Slf4j
+@EnableTransactionManagement(proxyTargetClass = true)
+@EnableAsync
+@EnableScheduling
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
+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/CmsDataSourceConfig.java b/src/main/java/com/casic/config/CmsDataSourceConfig.java
new file mode 100644
index 0000000..59253c1
--- /dev/null
+++ b/src/main/java/com/casic/config/CmsDataSourceConfig.java
@@ -0,0 +1,62 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置1
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.cms", sqlSessionFactoryRef = "cmsSqlSessionFactory")
+public class CmsDataSourceConfig {
+ @Value("${spring.datasource.cms.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.cms.url}")
+ String url;
+ @Value("${spring.datasource.cms.username}")
+ String userName;
+ @Value("${spring.datasource.cms.password}")
+ String passWord;
+
+ @Primary
+ @Bean(name = "cmsDataSource")
+ @ConfigurationProperties("spring.datasource.cms")
+ public DataSource masterDataSource() {
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "cmsSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("cmsDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/cms/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "cmsSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("cmsSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
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/config/DeviceTypesConfig.java b/src/main/java/com/casic/config/DeviceTypesConfig.java
new file mode 100644
index 0000000..9b727c0
--- /dev/null
+++ b/src/main/java/com/casic/config/DeviceTypesConfig.java
@@ -0,0 +1,14 @@
+package com.casic.config;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Data
+@Configuration("DeviceTypesConfig")
+public class DeviceTypesConfig {
+
+ @Value("${casic.device-types}")
+ private String deviceTypes;
+
+}
diff --git a/src/main/java/com/casic/config/SmartWellDataSourceConfig.java b/src/main/java/com/casic/config/SmartWellDataSourceConfig.java
new file mode 100644
index 0000000..4c75368
--- /dev/null
+++ b/src/main/java/com/casic/config/SmartWellDataSourceConfig.java
@@ -0,0 +1,61 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置2
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.smartwell",sqlSessionFactoryRef = "smartwellSqlSessionFactory")
+public class SmartWellDataSourceConfig {
+
+ @Value("${spring.datasource.smartwell.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.smartwell.url}")
+ String url;
+ @Value("${spring.datasource.smartwell.username}")
+ String userName;
+ @Value("${spring.datasource.smartwell.password}")
+ String passWord;
+
+ @Bean(name = "smartwellDataSource")
+ @ConfigurationProperties("spring.datasource.smartwell")
+ public DataSource masterDataSource(){
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "smartwellSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("smartwellDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/smartwell/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "smartwelSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("smartwellSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
diff --git a/src/main/java/com/casic/config/TiltDataSourceConfig.java b/src/main/java/com/casic/config/TiltDataSourceConfig.java
new file mode 100644
index 0000000..3a1e23c
--- /dev/null
+++ b/src/main/java/com/casic/config/TiltDataSourceConfig.java
@@ -0,0 +1,61 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+
+/**
+ * @program:
+ * @description: 数据库配置3
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.spantilt",sqlSessionFactoryRef = "tiltSqlSessionFactory")
+public class TiltDataSourceConfig {
+
+ @Value("${spring.datasource.spantilt.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.spantilt.url}")
+ String url;
+ @Value("${spring.datasource.spantilt.username}")
+ String userName;
+ @Value("${spring.datasource.spantilt.password}")
+ String passWord;
+
+ @Bean(name = "tiltDataSource")
+ @ConfigurationProperties("spring.datasource.spantilt")
+ public DataSource masterDataSource(){
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "tiltSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("tiltDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/tilt/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "tiltSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("tiltSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
diff --git a/src/main/java/com/casic/controller/MapDataController.java b/src/main/java/com/casic/controller/MapDataController.java
new file mode 100644
index 0000000..b897b95
--- /dev/null
+++ b/src/main/java/com/casic/controller/MapDataController.java
@@ -0,0 +1,47 @@
+package com.casic.controller;
+
+import com.casic.service.MapDataService;
+import org.springframework.beans.factory.annotation.Required;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/overview")
+public class MapDataController {
+
+ private final MapDataService mapDataService;
+
+ public MapDataController(MapDataService mapDataService) {
+ this.mapDataService = mapDataService;
+ }
+
+ /**
+ * 获取列表
+ */
+ @RequestMapping(value = "/wellList")
+ public Object getWellList(@RequestParam(required = false) String keywords,
+ @RequestParam(required = false) String wellType,
+ @RequestParam(required = false) String deptid,
+ @RequestParam(required = false) String isAlarm) {
+
+ return mapDataService.getWellList(keywords,wellType,deptid,isAlarm);
+ }
+
+ /**
+ * 获取当前全部告警列表
+ */
+ @RequestMapping(value = "/alarmNow")
+ public Object alarmNow() {
+ return mapDataService.getNowAlarmRecords();
+ }
+
+ /**
+ * 获取当前全部告警列表
+ */
+ @RequestMapping(value = "/wellInfo")
+ public Object getWellInfo(@RequestParam(value = "devcode", required = true) String devcode,
+ @RequestParam(value = "deviceType", required = true) String deviceType) {
+ return mapDataService.getWellInfo(devcode,deviceType);
+ }
+}
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..9661ac7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ 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..98d3a9c
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,31 @@
+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/06/20 14:28
+ */
+
+@Slf4j
+@EnableTransactionManagement(proxyTargetClass = true)
+@EnableAsync
+@EnableScheduling
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
+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/CmsDataSourceConfig.java b/src/main/java/com/casic/config/CmsDataSourceConfig.java
new file mode 100644
index 0000000..59253c1
--- /dev/null
+++ b/src/main/java/com/casic/config/CmsDataSourceConfig.java
@@ -0,0 +1,62 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置1
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.cms", sqlSessionFactoryRef = "cmsSqlSessionFactory")
+public class CmsDataSourceConfig {
+ @Value("${spring.datasource.cms.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.cms.url}")
+ String url;
+ @Value("${spring.datasource.cms.username}")
+ String userName;
+ @Value("${spring.datasource.cms.password}")
+ String passWord;
+
+ @Primary
+ @Bean(name = "cmsDataSource")
+ @ConfigurationProperties("spring.datasource.cms")
+ public DataSource masterDataSource() {
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "cmsSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("cmsDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/cms/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "cmsSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("cmsSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
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/config/DeviceTypesConfig.java b/src/main/java/com/casic/config/DeviceTypesConfig.java
new file mode 100644
index 0000000..9b727c0
--- /dev/null
+++ b/src/main/java/com/casic/config/DeviceTypesConfig.java
@@ -0,0 +1,14 @@
+package com.casic.config;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Data
+@Configuration("DeviceTypesConfig")
+public class DeviceTypesConfig {
+
+ @Value("${casic.device-types}")
+ private String deviceTypes;
+
+}
diff --git a/src/main/java/com/casic/config/SmartWellDataSourceConfig.java b/src/main/java/com/casic/config/SmartWellDataSourceConfig.java
new file mode 100644
index 0000000..4c75368
--- /dev/null
+++ b/src/main/java/com/casic/config/SmartWellDataSourceConfig.java
@@ -0,0 +1,61 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置2
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.smartwell",sqlSessionFactoryRef = "smartwellSqlSessionFactory")
+public class SmartWellDataSourceConfig {
+
+ @Value("${spring.datasource.smartwell.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.smartwell.url}")
+ String url;
+ @Value("${spring.datasource.smartwell.username}")
+ String userName;
+ @Value("${spring.datasource.smartwell.password}")
+ String passWord;
+
+ @Bean(name = "smartwellDataSource")
+ @ConfigurationProperties("spring.datasource.smartwell")
+ public DataSource masterDataSource(){
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "smartwellSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("smartwellDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/smartwell/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "smartwelSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("smartwellSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
diff --git a/src/main/java/com/casic/config/TiltDataSourceConfig.java b/src/main/java/com/casic/config/TiltDataSourceConfig.java
new file mode 100644
index 0000000..3a1e23c
--- /dev/null
+++ b/src/main/java/com/casic/config/TiltDataSourceConfig.java
@@ -0,0 +1,61 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+
+/**
+ * @program:
+ * @description: 数据库配置3
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.spantilt",sqlSessionFactoryRef = "tiltSqlSessionFactory")
+public class TiltDataSourceConfig {
+
+ @Value("${spring.datasource.spantilt.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.spantilt.url}")
+ String url;
+ @Value("${spring.datasource.spantilt.username}")
+ String userName;
+ @Value("${spring.datasource.spantilt.password}")
+ String passWord;
+
+ @Bean(name = "tiltDataSource")
+ @ConfigurationProperties("spring.datasource.spantilt")
+ public DataSource masterDataSource(){
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "tiltSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("tiltDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/tilt/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "tiltSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("tiltSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
diff --git a/src/main/java/com/casic/controller/MapDataController.java b/src/main/java/com/casic/controller/MapDataController.java
new file mode 100644
index 0000000..b897b95
--- /dev/null
+++ b/src/main/java/com/casic/controller/MapDataController.java
@@ -0,0 +1,47 @@
+package com.casic.controller;
+
+import com.casic.service.MapDataService;
+import org.springframework.beans.factory.annotation.Required;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/overview")
+public class MapDataController {
+
+ private final MapDataService mapDataService;
+
+ public MapDataController(MapDataService mapDataService) {
+ this.mapDataService = mapDataService;
+ }
+
+ /**
+ * 获取列表
+ */
+ @RequestMapping(value = "/wellList")
+ public Object getWellList(@RequestParam(required = false) String keywords,
+ @RequestParam(required = false) String wellType,
+ @RequestParam(required = false) String deptid,
+ @RequestParam(required = false) String isAlarm) {
+
+ return mapDataService.getWellList(keywords,wellType,deptid,isAlarm);
+ }
+
+ /**
+ * 获取当前全部告警列表
+ */
+ @RequestMapping(value = "/alarmNow")
+ public Object alarmNow() {
+ return mapDataService.getNowAlarmRecords();
+ }
+
+ /**
+ * 获取当前全部告警列表
+ */
+ @RequestMapping(value = "/wellInfo")
+ public Object getWellInfo(@RequestParam(value = "devcode", required = true) String devcode,
+ @RequestParam(value = "deviceType", required = true) String deviceType) {
+ return mapDataService.getWellInfo(devcode,deviceType);
+ }
+}
diff --git a/src/main/java/com/casic/controller/ScreenDataController.java b/src/main/java/com/casic/controller/ScreenDataController.java
new file mode 100644
index 0000000..04f8d97
--- /dev/null
+++ b/src/main/java/com/casic/controller/ScreenDataController.java
@@ -0,0 +1,210 @@
+package com.casic.controller;
+
+import com.casic.service.ScreenDataService;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/whale/eye")
+public class ScreenDataController {
+ private final ScreenDataService screenDataService;
+
+ public ScreenDataController(ScreenDataService screenDataService) {
+ this.screenDataService = screenDataService;
+ }
+
+ /**
+ * 动态显示已安装设备的类型和个数
+ */
+ @RequestMapping("/installed-device")
+ public Object getInstalledDevice(String beginTime, String endTime) {
+ return screenDataService.getInstalledDevice(beginTime, endTime);
+ }
+
+ /**
+ * 统计汇总各管线权属单位下的燃气管线总长度
+ */
+ @RequestMapping("/line-length")
+ public Object getLineLength(String beginTime, String endTime) {
+// return screenDataService.getLineLength(beginTime, endTime);
+ return "[\n" +
+ " {\n" +
+ " \"deptName\":\"圣井燃气\",\n" +
+ " \"totalLength\":440\n" +
+ " },\n" +
+ " {\n" +
+ " \"deptName\":\"华气燃气\",\n" +
+ " \"totalLength\":810\n" +
+ " },\n" +
+ " {\n" +
+ " \"typeName\":\"中燃燃气\",\n" +
+ " \"totalLength\":500\n" +
+ " },\n" +
+ " {\n" +
+ " \"typeName\":\"正和燃气\",\n" +
+ " \"totalLength\":520\n" +
+ " },\n" +
+ " {\n" +
+ " \"typeName\":\"华罚燃气\",\n" +
+ " \"totalLength\":630\n" +
+ " }\n" +
+ " ]";
+ }
+
+ /**
+ * 统计汇总各管线权属单位下的燃气管线总长度
+ */
+ @RequestMapping("/alarm-rate")
+ public Object getKindsAlarmRate(String beginTime, String endTime) {
+ return screenDataService.getKindsAlarmRate(beginTime, endTime);
+ }
+
+ /**
+ * 分类汇总燃气管线监管人员的类型和数量
+ */
+ @RequestMapping("/staff")
+ public Object getObvserStaff(String beginTime, String endTime) {
+// return screenDataService.getObvserStaff(beginTime, endTime);
+ return "{\n" +
+ " \t\"总人数\":2022,\n" +
+ "\t\"staffDataList\":[\n" +
+ " {\n" +
+ "\t\t\"岗位名称\":\"管理人员\",\n" +
+ "\t\t\"总计\":72\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"岗位名称\":\"运维人员\",\n" +
+ "\t\t\"总计\":874\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"岗位名称\":\"施工人员\",\n" +
+ "\t\t\"总计\":456\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"岗位名称\":\"统计人员\",\n" +
+ "\t\t\"总计\":745\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"岗位名称\":\"技术人员\",\n" +
+ "\t\t\"总计\":455\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"岗位名称\":\"监管人员\",\n" +
+ "\t\t\"总计\":644\n" +
+ " }]\n" +
+ " }";
+ }
+
+ /**
+ * 以道路的维度来统计汇总燃气管线的长度和权属单位
+ */
+ @RequestMapping("/road-line-length")
+ public Object getRoadLineLength(String beginTime, String endTime) {
+// return screenDataService.getRoadLineLength(beginTime, endTime);
+ return "[\n" +
+ " {\n" +
+ "\t\t\"所属道路\":\"双山西街\",\n" +
+ "\t\t\"管线长度/km\":41,\n" +
+ "\t\t\"权属单位\":\"圣井燃气\"\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"所属道路\":\"世纪大道\",\n" +
+ "\t\t\"管线长度/km\":54,\n" +
+ "\t\t\"权属单位\":\"正和燃气\"\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"所属道路\":\"桃水大街\",\n" +
+ "\t\t\"管线长度/km\":32,\n" +
+ "\t\t\"权属单位\":\"中燃燃气\"\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"所属道路\":\"鲁态大街\",\n" +
+ "\t\t\"管线长度/km\":41,\n" +
+ "\t\t\"权属单位\":\"正和燃气\"\n" +
+ " }\n" +
+ "]";
+ }
+
+ /**
+ * 以道路的维度来统计燃气管线监控中的报警情况
+ */
+ @RequestMapping("/road-alarm")
+ public Object getAlarmRecordsByRoad(String beginTime, String endTime) {
+ return screenDataService.getAlarmRecordsByRoad(beginTime, endTime);
+ }
+
+// /**
+// * 燃气设备列表,包括设备基本信息、燃气数据值、告警情况
+// */
+// @RequestMapping("/well/list")
+// public Object getDeviceList(String beginTime, String endTime) {
+// return screenDataService.getDeviceList(beginTime,endTime);
+// }
+//
+// /**
+// * 包括设备基本信息、燃气数据值、告警情况
+// */
+// @RequestMapping("/well/Info")
+// public Object getDeviceInfo(String wellCode,String deviceType) {
+// return screenDataService.getDeviceInfo(wellCode,deviceType);
+// }
+
+ /**
+ * 管网健康指数
+ * 场站健康指数
+ */
+ @RequestMapping("/health-indicator")
+ public Object getDeviceIndicator(String beginTime, String endTime) {
+ return screenDataService.getHealthIndicator(beginTime, endTime);
+ }
+
+ @RequestMapping("/dept-indicator")
+ public Object getDeptIndicator(String beginTime, String endTime) {
+ return screenDataService.getDeptIndicator(beginTime, endTime);
+ }
+
+ /**
+ * 显示云台的报警信息
+ */
+ @RequestMapping("/station-alarm")
+ public Object getAlarmRecordsByStation(String beginTime, String endTime) {
+ return screenDataService.getAlarmRecordsByStation(beginTime, endTime);
+ }
+
+ /**
+ * 道路管网健康指标:从道路的维度来判断,每条道路燃气管线的健康指数,(按照设备的总数和设备的报警数来计算)
+ */
+ @RequestMapping("/road-indicator")
+ public Object getRoadIndicator(String isSort,String limitNum,String beginTime, String endTime) {
+ return screenDataService.getHealthIndicatorByRoad( isSort, limitNum,beginTime, endTime);
+ }
+
+ @RequestMapping("/time-span")
+ public Object getDeptTimeSpan(String beginTime, String endTime) {
+ return screenDataService.getDeptTimeSpan(beginTime, endTime);
+ }
+
+ /**
+ * 道路巡检运维情况
+ *
+ * @param beginTime
+ * @param endTime
+ * @return
+ */
+ @RequestMapping("/inspect-road")
+ public Object getInspectRoad(String beginTime, String endTime) {
+ return screenDataService.getInspectRoad(beginTime, endTime);
+ }
+
+ /**
+ * 运维完成情况
+ *
+ * @param beginTime
+ * @param endTime
+ * @return
+ */
+ @RequestMapping("/operational-status")
+ public Object getOperationalStatus(String beginTime, String endTime) {
+ return screenDataService.getOperationalStatus(beginTime, endTime);
+ }
+}
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..9661ac7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ 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..98d3a9c
--- /dev/null
+++ b/src/main/java/com/casic/CasicApplication.java
@@ -0,0 +1,31 @@
+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/06/20 14:28
+ */
+
+@Slf4j
+@EnableTransactionManagement(proxyTargetClass = true)
+@EnableAsync
+@EnableScheduling
+@ComponentScan(basePackages= "com.casic.**")
+@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
+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/CmsDataSourceConfig.java b/src/main/java/com/casic/config/CmsDataSourceConfig.java
new file mode 100644
index 0000000..59253c1
--- /dev/null
+++ b/src/main/java/com/casic/config/CmsDataSourceConfig.java
@@ -0,0 +1,62 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置1
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.cms", sqlSessionFactoryRef = "cmsSqlSessionFactory")
+public class CmsDataSourceConfig {
+ @Value("${spring.datasource.cms.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.cms.url}")
+ String url;
+ @Value("${spring.datasource.cms.username}")
+ String userName;
+ @Value("${spring.datasource.cms.password}")
+ String passWord;
+
+ @Primary
+ @Bean(name = "cmsDataSource")
+ @ConfigurationProperties("spring.datasource.cms")
+ public DataSource masterDataSource() {
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "cmsSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("cmsDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/cms/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "cmsSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("cmsSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
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/config/DeviceTypesConfig.java b/src/main/java/com/casic/config/DeviceTypesConfig.java
new file mode 100644
index 0000000..9b727c0
--- /dev/null
+++ b/src/main/java/com/casic/config/DeviceTypesConfig.java
@@ -0,0 +1,14 @@
+package com.casic.config;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Data
+@Configuration("DeviceTypesConfig")
+public class DeviceTypesConfig {
+
+ @Value("${casic.device-types}")
+ private String deviceTypes;
+
+}
diff --git a/src/main/java/com/casic/config/SmartWellDataSourceConfig.java b/src/main/java/com/casic/config/SmartWellDataSourceConfig.java
new file mode 100644
index 0000000..4c75368
--- /dev/null
+++ b/src/main/java/com/casic/config/SmartWellDataSourceConfig.java
@@ -0,0 +1,61 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+/**
+ * @program:
+ * @description: 数据库配置2
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.smartwell",sqlSessionFactoryRef = "smartwellSqlSessionFactory")
+public class SmartWellDataSourceConfig {
+
+ @Value("${spring.datasource.smartwell.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.smartwell.url}")
+ String url;
+ @Value("${spring.datasource.smartwell.username}")
+ String userName;
+ @Value("${spring.datasource.smartwell.password}")
+ String passWord;
+
+ @Bean(name = "smartwellDataSource")
+ @ConfigurationProperties("spring.datasource.smartwell")
+ public DataSource masterDataSource(){
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "smartwellSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("smartwellDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/smartwell/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "smartwelSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("smartwellSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
+
diff --git a/src/main/java/com/casic/config/TiltDataSourceConfig.java b/src/main/java/com/casic/config/TiltDataSourceConfig.java
new file mode 100644
index 0000000..3a1e23c
--- /dev/null
+++ b/src/main/java/com/casic/config/TiltDataSourceConfig.java
@@ -0,0 +1,61 @@
+package com.casic.config;
+
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+
+/**
+ * @program:
+ * @description: 数据库配置3
+ * @author: cz
+ * @create: 2022-08-17 09:03
+ **/
+@Configuration
+@MapperScan(basePackages = "com.casic.dao.spantilt",sqlSessionFactoryRef = "tiltSqlSessionFactory")
+public class TiltDataSourceConfig {
+
+ @Value("${spring.datasource.spantilt.driver-class-name}")
+ String driverClass;
+ @Value("${spring.datasource.spantilt.url}")
+ String url;
+ @Value("${spring.datasource.spantilt.username}")
+ String userName;
+ @Value("${spring.datasource.spantilt.password}")
+ String passWord;
+
+ @Bean(name = "tiltDataSource")
+ @ConfigurationProperties("spring.datasource.spantilt")
+ public DataSource masterDataSource(){
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(driverClass);
+ dataSource.setUrl(url);
+ dataSource.setUsername(userName);
+ dataSource.setPassword(passWord);
+ return dataSource;
+ }
+
+ @Bean(name = "tiltSqlSessionFactory")
+ public SqlSessionFactory sqlSessionFactory(@Qualifier("tiltDataSource") DataSource dataSource) throws Exception {
+ SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+ sessionFactoryBean.setDataSource(dataSource);
+ sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
+ .getResources("classpath:mapper/tilt/*.xml"));
+ return sessionFactoryBean.getObject();
+ }
+
+ @Bean(name = "tiltSqlSessionTemplate")
+ public SqlSessionTemplate sqlSessionFactoryTemplate(@Qualifier("tiltSqlSessionFactory") SqlSessionFactory sqlSessionFactory ) throws Exception {
+ return new SqlSessionTemplate(sqlSessionFactory);
+ }
+}
diff --git a/src/main/java/com/casic/controller/MapDataController.java b/src/main/java/com/casic/controller/MapDataController.java
new file mode 100644
index 0000000..b897b95
--- /dev/null
+++ b/src/main/java/com/casic/controller/MapDataController.java
@@ -0,0 +1,47 @@
+package com.casic.controller;
+
+import com.casic.service.MapDataService;
+import org.springframework.beans.factory.annotation.Required;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/overview")
+public class MapDataController {
+
+ private final MapDataService mapDataService;
+
+ public MapDataController(MapDataService mapDataService) {
+ this.mapDataService = mapDataService;
+ }
+
+ /**
+ * 获取列表
+ */
+ @RequestMapping(value = "/wellList")
+ public Object getWellList(@RequestParam(required = false) String keywords,
+ @RequestParam(required = false) String wellType,
+ @RequestParam(required = false) String deptid,
+ @RequestParam(required = false) String isAlarm) {
+
+ return mapDataService.getWellList(keywords,wellType,deptid,isAlarm);
+ }
+
+ /**
+ * 获取当前全部告警列表
+ */
+ @RequestMapping(value = "/alarmNow")
+ public Object alarmNow() {
+ return mapDataService.getNowAlarmRecords();
+ }
+
+ /**
+ * 获取当前全部告警列表
+ */
+ @RequestMapping(value = "/wellInfo")
+ public Object getWellInfo(@RequestParam(value = "devcode", required = true) String devcode,
+ @RequestParam(value = "deviceType", required = true) String deviceType) {
+ return mapDataService.getWellInfo(devcode,deviceType);
+ }
+}
diff --git a/src/main/java/com/casic/controller/ScreenDataController.java b/src/main/java/com/casic/controller/ScreenDataController.java
new file mode 100644
index 0000000..04f8d97
--- /dev/null
+++ b/src/main/java/com/casic/controller/ScreenDataController.java
@@ -0,0 +1,210 @@
+package com.casic.controller;
+
+import com.casic.service.ScreenDataService;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/whale/eye")
+public class ScreenDataController {
+ private final ScreenDataService screenDataService;
+
+ public ScreenDataController(ScreenDataService screenDataService) {
+ this.screenDataService = screenDataService;
+ }
+
+ /**
+ * 动态显示已安装设备的类型和个数
+ */
+ @RequestMapping("/installed-device")
+ public Object getInstalledDevice(String beginTime, String endTime) {
+ return screenDataService.getInstalledDevice(beginTime, endTime);
+ }
+
+ /**
+ * 统计汇总各管线权属单位下的燃气管线总长度
+ */
+ @RequestMapping("/line-length")
+ public Object getLineLength(String beginTime, String endTime) {
+// return screenDataService.getLineLength(beginTime, endTime);
+ return "[\n" +
+ " {\n" +
+ " \"deptName\":\"圣井燃气\",\n" +
+ " \"totalLength\":440\n" +
+ " },\n" +
+ " {\n" +
+ " \"deptName\":\"华气燃气\",\n" +
+ " \"totalLength\":810\n" +
+ " },\n" +
+ " {\n" +
+ " \"typeName\":\"中燃燃气\",\n" +
+ " \"totalLength\":500\n" +
+ " },\n" +
+ " {\n" +
+ " \"typeName\":\"正和燃气\",\n" +
+ " \"totalLength\":520\n" +
+ " },\n" +
+ " {\n" +
+ " \"typeName\":\"华罚燃气\",\n" +
+ " \"totalLength\":630\n" +
+ " }\n" +
+ " ]";
+ }
+
+ /**
+ * 统计汇总各管线权属单位下的燃气管线总长度
+ */
+ @RequestMapping("/alarm-rate")
+ public Object getKindsAlarmRate(String beginTime, String endTime) {
+ return screenDataService.getKindsAlarmRate(beginTime, endTime);
+ }
+
+ /**
+ * 分类汇总燃气管线监管人员的类型和数量
+ */
+ @RequestMapping("/staff")
+ public Object getObvserStaff(String beginTime, String endTime) {
+// return screenDataService.getObvserStaff(beginTime, endTime);
+ return "{\n" +
+ " \t\"总人数\":2022,\n" +
+ "\t\"staffDataList\":[\n" +
+ " {\n" +
+ "\t\t\"岗位名称\":\"管理人员\",\n" +
+ "\t\t\"总计\":72\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"岗位名称\":\"运维人员\",\n" +
+ "\t\t\"总计\":874\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"岗位名称\":\"施工人员\",\n" +
+ "\t\t\"总计\":456\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"岗位名称\":\"统计人员\",\n" +
+ "\t\t\"总计\":745\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"岗位名称\":\"技术人员\",\n" +
+ "\t\t\"总计\":455\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"岗位名称\":\"监管人员\",\n" +
+ "\t\t\"总计\":644\n" +
+ " }]\n" +
+ " }";
+ }
+
+ /**
+ * 以道路的维度来统计汇总燃气管线的长度和权属单位
+ */
+ @RequestMapping("/road-line-length")
+ public Object getRoadLineLength(String beginTime, String endTime) {
+// return screenDataService.getRoadLineLength(beginTime, endTime);
+ return "[\n" +
+ " {\n" +
+ "\t\t\"所属道路\":\"双山西街\",\n" +
+ "\t\t\"管线长度/km\":41,\n" +
+ "\t\t\"权属单位\":\"圣井燃气\"\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"所属道路\":\"世纪大道\",\n" +
+ "\t\t\"管线长度/km\":54,\n" +
+ "\t\t\"权属单位\":\"正和燃气\"\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"所属道路\":\"桃水大街\",\n" +
+ "\t\t\"管线长度/km\":32,\n" +
+ "\t\t\"权属单位\":\"中燃燃气\"\n" +
+ " },\n" +
+ " {\n" +
+ "\t\t\"所属道路\":\"鲁态大街\",\n" +
+ "\t\t\"管线长度/km\":41,\n" +
+ "\t\t\"权属单位\":\"正和燃气\"\n" +
+ " }\n" +
+ "]";
+ }
+
+ /**
+ * 以道路的维度来统计燃气管线监控中的报警情况
+ */
+ @RequestMapping("/road-alarm")
+ public Object getAlarmRecordsByRoad(String beginTime, String endTime) {
+ return screenDataService.getAlarmRecordsByRoad(beginTime, endTime);
+ }
+
+// /**
+// * 燃气设备列表,包括设备基本信息、燃气数据值、告警情况
+// */
+// @RequestMapping("/well/list")
+// public Object getDeviceList(String beginTime, String endTime) {
+// return screenDataService.getDeviceList(beginTime,endTime);
+// }
+//
+// /**
+// * 包括设备基本信息、燃气数据值、告警情况
+// */
+// @RequestMapping("/well/Info")
+// public Object getDeviceInfo(String wellCode,String deviceType) {
+// return screenDataService.getDeviceInfo(wellCode,deviceType);
+// }
+
+ /**
+ * 管网健康指数
+ * 场站健康指数
+ */
+ @RequestMapping("/health-indicator")
+ public Object getDeviceIndicator(String beginTime, String endTime) {
+ return screenDataService.getHealthIndicator(beginTime, endTime);
+ }
+
+ @RequestMapping("/dept-indicator")
+ public Object getDeptIndicator(String beginTime, String endTime) {
+ return screenDataService.getDeptIndicator(beginTime, endTime);
+ }
+
+ /**
+ * 显示云台的报警信息
+ */
+ @RequestMapping("/station-alarm")
+ public Object getAlarmRecordsByStation(String beginTime, String endTime) {
+ return screenDataService.getAlarmRecordsByStation(beginTime, endTime);
+ }
+
+ /**
+ * 道路管网健康指标:从道路的维度来判断,每条道路燃气管线的健康指数,(按照设备的总数和设备的报警数来计算)
+ */
+ @RequestMapping("/road-indicator")
+ public Object getRoadIndicator(String isSort,String limitNum,String beginTime, String endTime) {
+ return screenDataService.getHealthIndicatorByRoad( isSort, limitNum,beginTime, endTime);
+ }
+
+ @RequestMapping("/time-span")
+ public Object getDeptTimeSpan(String beginTime, String endTime) {
+ return screenDataService.getDeptTimeSpan(beginTime, endTime);
+ }
+
+ /**
+ * 道路巡检运维情况
+ *
+ * @param beginTime
+ * @param endTime
+ * @return
+ */
+ @RequestMapping("/inspect-road")
+ public Object getInspectRoad(String beginTime, String endTime) {
+ return screenDataService.getInspectRoad(beginTime, endTime);
+ }
+
+ /**
+ * 运维完成情况
+ *
+ * @param beginTime
+ * @param endTime
+ * @return
+ */
+ @RequestMapping("/operational-status")
+ public Object getOperationalStatus(String beginTime, String endTime) {
+ return screenDataService.getOperationalStatus(beginTime, endTime);
+ }
+}
diff --git a/src/main/java/com/casic/dao/cms/CmsDataMapper.java b/src/main/java/com/casic/dao/cms/CmsDataMapper.java
new file mode 100644
index 0000000..e57975e
--- /dev/null
+++ b/src/main/java/com/casic/dao/cms/CmsDataMapper.java
@@ -0,0 +1,23 @@
+package com.casic.dao.cms;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface CmsDataMapper {
+
+ Integer countElectronicDevice();
+
+ List