整合monitor到renren框架
This commit is contained in:
parent
da1cc12fe9
commit
ebd57157c8
|
@ -1,333 +1,368 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>io.renren</groupId>
|
||||
<artifactId>security-enterprise</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>renren-admin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<description>renren-admin</description>
|
||||
|
||||
<properties>
|
||||
<quartz.version>2.3.0</quartz.version>
|
||||
<shiro.version>1.6.0</shiro.version>
|
||||
<captcha.version>1.6.2</captcha.version>
|
||||
<easyexcel.version>2.2.6</easyexcel.version>
|
||||
<qiniu.version>7.2.27</qiniu.version>
|
||||
<aliyun.oss.version>2.8.3</aliyun.oss.version>
|
||||
<aliyun.core.version>3.2.2</aliyun.core.version>
|
||||
<aliyun.dysmsapi.version>1.1.0</aliyun.dysmsapi.version>
|
||||
<qcloud.cos.version>5.4.4</qcloud.cos.version>
|
||||
<qcloud.qcloudsms.version>1.0.5</qcloud.qcloudsms.version>
|
||||
<fastdfs.version>1.26.2</fastdfs.version>
|
||||
<minio.version>6.0.13</minio.version>
|
||||
<mail.version>1.6.2</mail.version>
|
||||
<freemarker.version>2.3.28</freemarker.version>
|
||||
<activiti.version>5.22.0</activiti.version>
|
||||
<ureport2.version>2.2.9</ureport2.version>
|
||||
<IJPay.version>2.7.1</IJPay.version>
|
||||
<yawei-pso.version>2.0.2</yawei-pso.version>
|
||||
<renren.version>2.9.0</renren.version>
|
||||
<groovy-all.version>2.4.17</groovy-all.version>
|
||||
<pinyin4j.version>2.5.1</pinyin4j.version>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.renren</groupId>
|
||||
<artifactId>renren-common</artifactId>
|
||||
<version>${renren.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.renren</groupId>
|
||||
<artifactId>renren-dynamic-datasource</artifactId>
|
||||
<version>${renren.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<version>${quartz.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.mchange</groupId>
|
||||
<artifactId>c3p0</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP-java6</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-core</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-spring</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.whvcse</groupId>
|
||||
<artifactId>easy-captcha</artifactId>
|
||||
<version>${captcha.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>${easyexcel.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.qiniu</groupId>
|
||||
<artifactId>qiniu-java-sdk</artifactId>
|
||||
<version>${qiniu.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
<version>${aliyun.oss.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.qcloud</groupId>
|
||||
<artifactId>cos_api</artifactId>
|
||||
<version>${qcloud.cos.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||
<version>${aliyun.core.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
|
||||
<version>${aliyun.dysmsapi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.qcloudsms</groupId>
|
||||
<artifactId>qcloudsms</artifactId>
|
||||
<version>${qcloud.qcloudsms.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
<artifactId>javax.mail</artifactId>
|
||||
<version>${mail.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.freemarker</groupId>
|
||||
<artifactId>freemarker</artifactId>
|
||||
<version>${freemarker.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.tobato</groupId>
|
||||
<artifactId>fastdfs-client</artifactId>
|
||||
<version>${fastdfs.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>${minio.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-spring-boot-starter-basic</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-explorer</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>vaadin</artifactId>
|
||||
<groupId>com.vaadin</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>dcharts-widget</artifactId>
|
||||
<groupId>org.vaadin.addons</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>activiti-simple-workflow</artifactId>
|
||||
<groupId>org.activiti</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- 支持JDK11 -->
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
<version>${groovy-all.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-diagram-rest</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-modeler</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
</dependency>
|
||||
<!-- end activiti -->
|
||||
<dependency>
|
||||
<groupId>com.bstek.ureport</groupId>
|
||||
<artifactId>ureport2-console</artifactId>
|
||||
<version>${ureport2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.javen205</groupId>
|
||||
<artifactId>IJPay-AliPay</artifactId>
|
||||
<version>${IJPay.version}</version>
|
||||
</dependency>
|
||||
<!-- 亚微单点登录 -->
|
||||
<dependency>
|
||||
<groupId>com.yawei.oav2</groupId>
|
||||
<artifactId>yawei-pso</artifactId>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/yawei-pso-2.0.2.jar</systemPath>
|
||||
<version>${yawei-pso.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>${pinyin4j.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<!-- 排除生产环境配置 -->
|
||||
<exclude>application-prod.yml</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>application.properties</include>
|
||||
<include>application-${profile.env}.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<classesDirectory>target/classes/</classesDirectory>
|
||||
<archive>
|
||||
<!--生成的jar包不包含maven描述相关文件-->
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
<manifest>
|
||||
<!--项目启动类-->
|
||||
<mainClass>io.renren.AdminApplication</mainClass>
|
||||
<useUniqueVersions>false</useUniqueVersions>
|
||||
<!--第三方JAR加入类构建的路径maven-dependency-plugin-->
|
||||
<addClasspath>true</addClasspath>
|
||||
<!--外部依赖jar包的位置-->
|
||||
<classpathPrefix>lib/</classpathPrefix>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<Class-Path>. lib/yawei-pso-2.0.2.jar</Class-Path>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!--关键插件,maven提供的assembly插件,需要放在最后-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-tar.gz</id>
|
||||
<!--绑定的maven操作-->
|
||||
<phase>package</phase>
|
||||
<!--运行一次-->
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
|
||||
<!--如果不想在打包的后缀加上assembly.xml中设置的id,可以加上下面的配置-->
|
||||
<!--<appendAssemblyId>false</appendAssemblyId>-->
|
||||
|
||||
<!--指定assembly插件对应的assembly.xml配置文件-->
|
||||
<descriptors>
|
||||
<descriptor>src/main/resources/assembly/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>libs/</classpathPrefix>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <includeSystemScope>true</includeSystemScope>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
||||
<!-- <artifactId>maven-surefire-plugin</artifactId>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <skipTests>true</skipTests>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>com.spotify</groupId>-->
|
||||
<!-- <artifactId>docker-maven-plugin</artifactId>-->
|
||||
<!-- <version>${docker.plugin.version}</version>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <imageName>renren/${project.artifactId}</imageName>-->
|
||||
<!-- <dockerDirectory>${project.basedir}/</dockerDirectory>-->
|
||||
<!-- <resources>-->
|
||||
<!-- <resource>-->
|
||||
<!-- <targetPath>/</targetPath>-->
|
||||
<!-- <directory>${project.build.directory}</directory>-->
|
||||
<!-- <include>${project.build.finalName}.jar</include>-->
|
||||
<!-- </resource>-->
|
||||
<!-- </resources>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
</plugins>
|
||||
</build>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>io.renren</groupId>
|
||||
<artifactId>security-enterprise</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>renren-admin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<description>renren-admin</description>
|
||||
|
||||
<properties>
|
||||
<quartz.version>2.3.0</quartz.version>
|
||||
<shiro.version>1.6.0</shiro.version>
|
||||
<captcha.version>1.6.2</captcha.version>
|
||||
<easyexcel.version>2.2.6</easyexcel.version>
|
||||
<qiniu.version>7.2.27</qiniu.version>
|
||||
<aliyun.oss.version>2.8.3</aliyun.oss.version>
|
||||
<aliyun.core.version>3.2.2</aliyun.core.version>
|
||||
<aliyun.dysmsapi.version>1.1.0</aliyun.dysmsapi.version>
|
||||
<qcloud.cos.version>5.4.4</qcloud.cos.version>
|
||||
<qcloud.qcloudsms.version>1.0.5</qcloud.qcloudsms.version>
|
||||
<fastdfs.version>1.26.2</fastdfs.version>
|
||||
<minio.version>6.0.13</minio.version>
|
||||
<mail.version>1.6.2</mail.version>
|
||||
<freemarker.version>2.3.28</freemarker.version>
|
||||
<activiti.version>5.22.0</activiti.version>
|
||||
<ureport2.version>2.2.9</ureport2.version>
|
||||
<IJPay.version>2.7.1</IJPay.version>
|
||||
<yawei-pso.version>2.0.2</yawei-pso.version>
|
||||
<renren.version>2.9.0</renren.version>
|
||||
<groovy-all.version>2.4.17</groovy-all.version>
|
||||
<pinyin4j.version>2.5.1</pinyin4j.version>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.renren</groupId>
|
||||
<artifactId>renren-common</artifactId>
|
||||
<version>${renren.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.renren</groupId>
|
||||
<artifactId>renren-dynamic-datasource</artifactId>
|
||||
<version>${renren.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<version>${quartz.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.mchange</groupId>
|
||||
<artifactId>c3p0</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP-java6</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-core</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-spring</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.whvcse</groupId>
|
||||
<artifactId>easy-captcha</artifactId>
|
||||
<version>${captcha.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>${easyexcel.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.qiniu</groupId>
|
||||
<artifactId>qiniu-java-sdk</artifactId>
|
||||
<version>${qiniu.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
<version>${aliyun.oss.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.qcloud</groupId>
|
||||
<artifactId>cos_api</artifactId>
|
||||
<version>${qcloud.cos.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||
<version>${aliyun.core.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
|
||||
<version>${aliyun.dysmsapi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.qcloudsms</groupId>
|
||||
<artifactId>qcloudsms</artifactId>
|
||||
<version>${qcloud.qcloudsms.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
<artifactId>javax.mail</artifactId>
|
||||
<version>${mail.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.freemarker</groupId>
|
||||
<artifactId>freemarker</artifactId>
|
||||
<version>${freemarker.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.tobato</groupId>
|
||||
<artifactId>fastdfs-client</artifactId>
|
||||
<version>${fastdfs.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>${minio.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-spring-boot-starter-basic</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-explorer</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>vaadin</artifactId>
|
||||
<groupId>com.vaadin</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>dcharts-widget</artifactId>
|
||||
<groupId>org.vaadin.addons</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>activiti-simple-workflow</artifactId>
|
||||
<groupId>org.activiti</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- 支持JDK11 -->
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
<version>${groovy-all.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-diagram-rest</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.activiti</groupId>
|
||||
<artifactId>activiti-modeler</artifactId>
|
||||
<version>${activiti.version}</version>
|
||||
</dependency>
|
||||
<!-- end activiti -->
|
||||
<dependency>
|
||||
<groupId>com.bstek.ureport</groupId>
|
||||
<artifactId>ureport2-console</artifactId>
|
||||
<version>${ureport2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.javen205</groupId>
|
||||
<artifactId>IJPay-AliPay</artifactId>
|
||||
<version>${IJPay.version}</version>
|
||||
</dependency>
|
||||
<!-- 亚微单点登录 -->
|
||||
<dependency>
|
||||
<groupId>com.yawei.oav2</groupId>
|
||||
<artifactId>yawei-pso</artifactId>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/yawei-pso-2.0.2.jar</systemPath>
|
||||
<version>${yawei-pso.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>${pinyin4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.72</version>
|
||||
</dependency>
|
||||
<!--缓存-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-cache</artifactId>
|
||||
<version>2.4.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.sf.ehcache</groupId>
|
||||
<artifactId>ehcache</artifactId>
|
||||
<version>2.10.6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bytedeco</groupId>
|
||||
<artifactId>javacv-platform</artifactId>
|
||||
<version>1.5.7</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generate</artifactId>
|
||||
<version>2.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<!-- 排除生产环境配置 -->
|
||||
<exclude>application-prod.yml</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>application.properties</include>
|
||||
<!--suppress UnresolvedMavenProperty -->
|
||||
<include>application-${profile.env}.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<classesDirectory>target/classes/</classesDirectory>
|
||||
<archive>
|
||||
<!--生成的jar包不包含maven描述相关文件-->
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
<manifest>
|
||||
<!--项目启动类-->
|
||||
<mainClass>io.renren.AdminApplication</mainClass>
|
||||
<useUniqueVersions>false</useUniqueVersions>
|
||||
<!--第三方JAR加入类构建的路径maven-dependency-plugin-->
|
||||
<addClasspath>true</addClasspath>
|
||||
<!--外部依赖jar包的位置-->
|
||||
<classpathPrefix>lib/</classpathPrefix>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<Class-Path>. lib/yawei-pso-2.0.2.jar</Class-Path>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!--关键插件,maven提供的assembly插件,需要放在最后-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-tar.gz</id>
|
||||
<!--绑定的maven操作-->
|
||||
<phase>package</phase>
|
||||
<!--运行一次-->
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
|
||||
<!--如果不想在打包的后缀加上assembly.xml中设置的id,可以加上下面的配置-->
|
||||
<!--<appendAssemblyId>false</appendAssemblyId>-->
|
||||
|
||||
<!--指定assembly插件对应的assembly.xml配置文件-->
|
||||
<descriptors>
|
||||
<descriptor>src/main/resources/assembly/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>libs/</classpathPrefix>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <includeSystemScope>true</includeSystemScope>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
||||
<!-- <artifactId>maven-surefire-plugin</artifactId>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <skipTests>true</skipTests>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>com.spotify</groupId>-->
|
||||
<!-- <artifactId>docker-maven-plugin</artifactId>-->
|
||||
<!-- <version>${docker.plugin.version}</version>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <imageName>renren/${project.artifactId}</imageName>-->
|
||||
<!-- <dockerDirectory>${project.basedir}/</dockerDirectory>-->
|
||||
<!-- <resources>-->
|
||||
<!-- <resource>-->
|
||||
<!-- <targetPath>/</targetPath>-->
|
||||
<!-- <directory>${project.build.directory}</directory>-->
|
||||
<!-- <include>${project.build.finalName}.jar</include>-->
|
||||
<!-- </resource>-->
|
||||
<!-- </resources>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -1,27 +1,37 @@
|
|||
package io.renren;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
|
||||
/**
|
||||
* renren-admin
|
||||
*
|
||||
*/
|
||||
@SpringBootApplication(exclude = {
|
||||
org.activiti.spring.boot.SecurityAutoConfiguration.class,
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
})
|
||||
public class AdminApplication extends SpringBootServletInitializer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AdminApplication.class, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
return application.sources(AdminApplication.class);
|
||||
}
|
||||
package io.renren;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
|
||||
/**
|
||||
* renren-admin
|
||||
*
|
||||
*/
|
||||
@SpringBootApplication(exclude = {
|
||||
org.activiti.spring.boot.SecurityAutoConfiguration.class,
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
})
|
||||
@EnableSwagger2
|
||||
//@MapperScan("io.renren.modules.monitor.mapper")
|
||||
@EnableCaching
|
||||
@EnableScheduling
|
||||
public class AdminApplication extends SpringBootServletInitializer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AdminApplication.class, args);
|
||||
System.out.println("项目启动成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
return application.sources(AdminApplication.class);
|
||||
}
|
||||
}
|
|
@ -9,6 +9,9 @@ import org.springframework.http.converter.StringHttpMessageConverter;
|
|||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Proxy;
|
||||
import java.net.SocketAddress;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Collections;
|
||||
|
||||
|
@ -18,7 +21,7 @@ public class RestTemplateConfig {
|
|||
@Bean
|
||||
public RestTemplate restTemplate(ClientHttpRequestFactory factory) {
|
||||
RestTemplate restTemplate = new RestTemplate(factory);
|
||||
restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(Charset.forName("UTF-8")));
|
||||
// restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(Charset.forName("UTF-8")));
|
||||
return restTemplate;
|
||||
}
|
||||
|
||||
|
@ -27,6 +30,11 @@ public class RestTemplateConfig {
|
|||
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
|
||||
factory.setReadTimeout(30000);//单位为ms
|
||||
factory.setConnectTimeout(30000);//单位为ms
|
||||
factory.setOutputStreaming(false);
|
||||
|
||||
/*SocketAddress address = new InetSocketAddress("15.2.23.141", 8888);
|
||||
Proxy proxy = new Proxy(Proxy.Type.HTTP, address);
|
||||
factory.setProxy(proxy);*/
|
||||
return factory;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package io.renren.modules.monitor.config;
|
||||
|
||||
import net.sf.ehcache.CacheManager;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.cache.ehcache.EhCacheCacheManager;
|
||||
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName CachingConfig.java
|
||||
* @Description cache配置
|
||||
* @createTime 2022年05月12日 09:45:00
|
||||
*/
|
||||
@Configuration
|
||||
@EnableCaching
|
||||
public class CachingConfig {
|
||||
@Bean
|
||||
public EhCacheCacheManager cacheManager(CacheManager cm) {
|
||||
return new EhCacheCacheManager(cm);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public EhCacheManagerFactoryBean ehcache() {
|
||||
EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean();
|
||||
cacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache.xml"));
|
||||
return cacheManagerFactoryBean;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package io.renren.modules.monitor.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 GlobalCorsConfig {
|
||||
|
||||
@Bean
|
||||
public CorsFilter corsFilter() {
|
||||
//1. 添加 CORS配置信息
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
//放行哪些原始域
|
||||
config.addAllowedOrigin("*");
|
||||
//是否发送 Cookie
|
||||
config.setAllowCredentials(true);
|
||||
//放行哪些请求方式
|
||||
config.addAllowedMethod("*");
|
||||
//放行哪些原始请求头部信息
|
||||
config.addAllowedHeader("*");
|
||||
//暴露哪些头部信息
|
||||
config.addExposedHeader("*");
|
||||
//2. 添加映射路径
|
||||
UrlBasedCorsConfigurationSource corsConfigurationSource = new UrlBasedCorsConfigurationSource();
|
||||
corsConfigurationSource.registerCorsConfiguration("/**",config);
|
||||
//3. 返回新的CorsFilter
|
||||
return new CorsFilter(corsConfigurationSource);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package io.renren.modules.monitor.controller;
|
||||
|
||||
import io.renren.modules.monitor.entity.BuildingRecords;
|
||||
import io.renren.modules.monitor.entity.Result;
|
||||
import io.renren.modules.monitor.service.BuildingRecordsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName BuildingController.java
|
||||
* @Description 工地
|
||||
* @createTime 2022年05月17日 15:26:00
|
||||
*/
|
||||
@Api(tags = "工地")
|
||||
@RequestMapping("api/project/building")
|
||||
@RestController
|
||||
public class BuildingController {
|
||||
@Autowired
|
||||
private BuildingRecordsService buildingRecordsService;
|
||||
|
||||
@GetMapping("/getRecords")
|
||||
@ApiOperation("测试,获取工地实时数据--调用接口")
|
||||
public List<Map> getRecords(){
|
||||
return buildingRecordsService.getRecords();
|
||||
}
|
||||
|
||||
@GetMapping("/getAndSaveRecords")
|
||||
@ApiOperation("获取工地实时数据并保存到表中--调用接口获取")
|
||||
public Result getAndSaveRecords(){
|
||||
boolean result = buildingRecordsService.getAndSaveRecords();
|
||||
if(result){
|
||||
return Result.success();
|
||||
}else{
|
||||
return Result.error(String.valueOf(result));
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/listRecords")
|
||||
@ApiOperation("获取工地实时数据列表-从t_building_records表中查询")
|
||||
@ApiImplicitParam(name="pushTime",value="上传时间",paramType = "query",required = true,dataType = "string",example = "2022-01-01")
|
||||
public List<BuildingRecords> listRecords(
|
||||
@RequestParam(value="pushTime") String pushTime
|
||||
){
|
||||
return buildingRecordsService.listRecords(pushTime);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,565 @@
|
|||
package io.renren.modules.monitor.controller;
|
||||
|
||||
import io.renren.modules.monitor.dto.*;
|
||||
import io.renren.modules.monitor.entity.*;
|
||||
import io.renren.modules.monitor.mapper.*;
|
||||
import io.renren.modules.monitor.service.*;
|
||||
import io.renren.modules.monitor.utils.LongLatUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/project")
|
||||
@Api(tags="通用")
|
||||
public class Controller {
|
||||
|
||||
@Autowired
|
||||
private ProjectMapper projectMapper;
|
||||
|
||||
@Autowired
|
||||
private CameraMapper cameraMapper;
|
||||
|
||||
@Autowired
|
||||
private ScenicMapper scenicMapper;
|
||||
|
||||
@Autowired
|
||||
private MonitorService monitorService;
|
||||
|
||||
@Autowired
|
||||
private SedimentTrailService sedimentTrailService;
|
||||
|
||||
@Autowired
|
||||
private CameraChannelMapper cameraChannelMapper;
|
||||
|
||||
@Autowired
|
||||
private CameraOrgenizationMapper cameraOrgenMapper;
|
||||
|
||||
@Autowired
|
||||
private PassengerFlowService passengerFlowService;
|
||||
|
||||
@Autowired
|
||||
private TrailSanitationService trailSanitationService;
|
||||
|
||||
@Autowired
|
||||
private RoadDataService roadDataService;
|
||||
|
||||
@Autowired
|
||||
private CameraChannelService cameraChannelService;
|
||||
|
||||
@Autowired
|
||||
private BuildingSiteService buildingSitrService;
|
||||
|
||||
@Autowired
|
||||
private BuildingSiteMapper buildingSiteMapper;
|
||||
|
||||
@Autowired
|
||||
private ChannelPictureMapper channelPictureMapper;
|
||||
|
||||
|
||||
@GetMapping("all")
|
||||
public Object all(){
|
||||
List<Project> projects = projectMapper.selectList(null);
|
||||
projects.forEach(project -> {
|
||||
List<Picture> pics = cameraMapper.selectPicByProjectId(project.getId());
|
||||
project.setPics(pics);
|
||||
});
|
||||
|
||||
return projects;
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送给城管接口用的
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("cameras")
|
||||
public Result cameras(){
|
||||
List<ChannelPictureDto> channelPictureDtos = channelPictureMapper.selectByProject();
|
||||
Result success = Result.success(channelPictureDtos);
|
||||
success.setCount(channelPictureDtos.size());
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 景区人流识别
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("scenicCamera")
|
||||
public Result scenicCamera(){
|
||||
List<ScenicCameraDto> scenicCameraDtos = scenicMapper.selectScenicCameras();
|
||||
Result success = Result.success(scenicCameraDtos);
|
||||
success.setCount(scenicCameraDtos.size());
|
||||
return success;
|
||||
}
|
||||
|
||||
@GetMapping("capture")
|
||||
public Object capture(){
|
||||
monitorService.start();
|
||||
|
||||
return "finish capture";
|
||||
}
|
||||
|
||||
@GetMapping("startScenic")
|
||||
public Object startScenic(){
|
||||
monitorService.startScenic();
|
||||
|
||||
return "startScenic finish";
|
||||
}
|
||||
|
||||
@GetMapping("capture1")
|
||||
public Object capture1(){
|
||||
monitorService.listChannelPlayStates();
|
||||
|
||||
return "finish capture";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有摄像头
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectAll")
|
||||
@ApiOperation("查询所有摄像头")
|
||||
public String selectAll(){
|
||||
return cameraChannelService.selectAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据channelCode查询摄像头详细信息
|
||||
* @param channelCode
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByChannelCode")
|
||||
@ApiOperation("根据摄像头编号查询摄像头详细信息")
|
||||
@ApiImplicitParam(name = "channelCode",value = "摄像头标识",required = true,dataType = "String")
|
||||
public Result selectByChannelCode(String channelCode){
|
||||
|
||||
List<CameraChannelDto1> list = cameraChannelMapper.selectByChannelCode(channelCode);
|
||||
|
||||
Result success = Result.success(list);
|
||||
|
||||
return success;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据摄像头名字模糊查询摄像头
|
||||
* @param channelName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByChannelName")
|
||||
@ApiOperation("根据摄像头名字模糊查询摄像头")
|
||||
@ApiImplicitParam(name = "channelName",value = "摄像头名称",required = true,dataType = "String")
|
||||
public Result selectByChannelName(String channelName){
|
||||
|
||||
List<CameraChannel> labels = cameraChannelMapper.selectByChannelName(channelName);
|
||||
|
||||
Result success = Result.success(labels);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据parentId和checkStatus查询摄像头
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByParentId")
|
||||
@ApiOperation("根据摄像头的组织Id和异常状态查询摄像头")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "parentId",value = "摄像头的组织Id",required = true,dataType = "String"),
|
||||
@ApiImplicitParam(name = "checkStatus",value = "异常状态 1正常,0异常",required = true,dataType = "String")
|
||||
})
|
||||
public Result selectByParentId(String parentId,String checkStatus){
|
||||
|
||||
List<CameraChannel> list = cameraChannelMapper.selectByParentId(parentId,checkStatus);
|
||||
|
||||
Result success = Result.success(list);
|
||||
|
||||
return success;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据标签查询对应摄像头
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectLabel")
|
||||
@ApiOperation("根据标签查询对应摄像头")
|
||||
@ApiImplicitParam(name = "labelCode",value = "标签号",required = true,dataType = "String")
|
||||
public Result selectLabel(String labelCode){
|
||||
|
||||
List<ChannelLabelDto> channelLabelDtos = cameraChannelMapper.selectLabel(labelCode);
|
||||
|
||||
for (ChannelLabelDto channelLabelDto :channelLabelDtos) {
|
||||
String nodeName = channelLabelDto.getNodeName();
|
||||
String[] splits = nodeName.split("->");
|
||||
String split = splits[1];
|
||||
channelLabelDto.setNodeName(split);
|
||||
|
||||
}
|
||||
|
||||
return Result.success(channelLabelDtos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据经纬度查询半径内所有的摄像头
|
||||
* @param gpsX
|
||||
* @param gpsY
|
||||
* @param radius
|
||||
* @return
|
||||
*/
|
||||
@GetMapping ("selectAllByGps")
|
||||
@ApiOperation("根据经纬度查询半径内所有的摄像头")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gpsX", value = "经度",required = true,dataType ="Double"),
|
||||
@ApiImplicitParam(name = "gpsY", value = "纬度",required = true,dataType ="Double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米",required = true,dataType ="Integer"),}
|
||||
)
|
||||
public Result selectAllByGps(Double gpsX,Double gpsY,Integer radius){
|
||||
double[] around = LongLatUtil.getAround(gpsX, gpsY, radius);
|
||||
List<CameraChannel> c = cameraChannelMapper.selectAllByGps(around[0], around[2], around[1], around[3]);
|
||||
Result success = Result.success(c);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有标签
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectAllLabel")
|
||||
@ApiOperation("查询所有标签")
|
||||
public Result selectAllLabel(){
|
||||
|
||||
List<Label> labels = cameraChannelMapper.selectAllLabel();
|
||||
|
||||
Result success = Result.success(labels);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询city为1的标签
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByLabelCity")
|
||||
@ApiOperation("查询city为1的标签")
|
||||
public Result selectByLabelCity(){
|
||||
|
||||
List<Label> labels = cameraChannelMapper.selectByLabelCity();
|
||||
|
||||
Result success = Result.success(labels);
|
||||
|
||||
return success;
|
||||
}
|
||||
/**
|
||||
* 根据标签名字模糊查询标签
|
||||
* @param labelName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByLabelName")
|
||||
@ApiOperation("根据标签名字模糊查询标签")
|
||||
@ApiImplicitParam(name = "labelName",value = "标签名称",required = true,dataType = "String")
|
||||
public Result selectByLabelName(String labelName){
|
||||
|
||||
List<Label> labels = cameraChannelMapper.selectByLabelName(labelName);
|
||||
|
||||
Result success = Result.success(labels);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据parentId查询组织
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectSubOrgan")
|
||||
@ApiOperation("根据上级组织id查询组织")
|
||||
@ApiImplicitParam(name = "parentId",value = "上级组织id",required = true,dataType = "String")
|
||||
public Result selectSubOrganization(String parentId){
|
||||
if (parentId == null){
|
||||
parentId = "";
|
||||
}
|
||||
|
||||
List<CameraOrganization> organs = cameraOrgenMapper.selectSubOrganization(parentId);
|
||||
|
||||
Result success = Result.success(organs);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供给其他项目分页查询摄像头接口
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectCamera")
|
||||
@ApiOperation("提供给其他项目分页查询摄像头接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page",value = "页码",required = true,dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize",value = "页码大小",required = true,dataType = "Integer")
|
||||
})
|
||||
public Result selectNLAll(Integer page,Integer pageSize,String labelCode){
|
||||
List<CameraChannelNLDto> selectNLAll = cameraChannelMapper.selectNLAll(page,pageSize);
|
||||
if (labelCode != null && labelCode != ""){
|
||||
List<CameraChannelNLDto> dtos = cameraChannelMapper.selectByLabel(page, pageSize);
|
||||
Result success = Result.success(dtos);
|
||||
return success;
|
||||
}
|
||||
Result success = Result.success(selectNLAll);
|
||||
return success;
|
||||
}
|
||||
|
||||
//查询视频点播巡检结果,只取异常的
|
||||
// @RequestMapping("listChannelPlayStates")
|
||||
// public Result listChannelPlayStates(
|
||||
// @RequestParam(value="page",required = false,defaultValue = "1") Integer page,
|
||||
// @RequestParam(value="pageSize",required = false,defaultValue = "20") Integer pageSize
|
||||
// ){
|
||||
// return monitorService.listChannelPlayStates();
|
||||
// }
|
||||
|
||||
//道路统计数据与排名
|
||||
@GetMapping("roadData")
|
||||
@ApiOperation("道路统计数据与排名,根据后台dt调用接口")
|
||||
public List<Map> roadData(){
|
||||
return monitorService.roadData();
|
||||
}
|
||||
|
||||
//启迪中台
|
||||
//登录
|
||||
@GetMapping("qidiToken")
|
||||
@ApiOperation("启迪数据中台登录获取token")
|
||||
public String qidiToken(){
|
||||
return monitorService.qidiToken();
|
||||
}
|
||||
|
||||
//渣土车轨迹数据
|
||||
@GetMapping("resCatalogApplyZTYS")
|
||||
@ApiOperation("获取渣土车轨迹数据,根据后台UPLOADTIME调用接口")
|
||||
public List<Map> resCatalogApply(){
|
||||
return monitorService.resCatalogApplyZTYS();
|
||||
}
|
||||
|
||||
//环卫车轨迹数据
|
||||
@GetMapping("resCatalogApplyHJWS")
|
||||
@ApiOperation("环卫车轨迹数据,根据后台updatetime调用接口")
|
||||
public List<Map> resCatalogApplyHJWS(){
|
||||
return monitorService.resCatalogApplyHJWS();
|
||||
}
|
||||
|
||||
//工地信息
|
||||
@GetMapping("resCatalogApplyGDYS")
|
||||
@ApiOperation("获取工地信息-表中获取")
|
||||
public List<Map> resCatalogApplyGDYS(){
|
||||
return monitorService.resCatalogApplyGDYS();
|
||||
}
|
||||
|
||||
//环卫车辆数据1,基础
|
||||
@GetMapping("resCatalogApplyHJWSBase")
|
||||
@ApiOperation("环卫车辆数据1,基础--根据后台updatetime调用接口")
|
||||
public List<Map> resCatalogApplyHJWSBase(){
|
||||
return monitorService.resCatalogApplyHJWSBase();
|
||||
}
|
||||
//环卫车辆数据1,作业
|
||||
@GetMapping("resCatalogApplyHJWSZY")
|
||||
@ApiOperation("环卫车辆数据1,作业--根据后台ZYRQ调用接口")
|
||||
public List<Map> resCatalogApplyHJWSZY(){
|
||||
return monitorService.resCatalogApplyHJWSZY();
|
||||
}
|
||||
|
||||
//环卫道路明细数据
|
||||
@GetMapping("resCatalogApplyHJWSRoad")
|
||||
@ApiOperation("环卫道路明细数据,根据后台updatetime调用接口")
|
||||
public List<Map> resCatalogApplyHJWSRoad(){
|
||||
return monitorService.resCatalogApplyHJWSRoad();
|
||||
}
|
||||
|
||||
//获取渣土车轨迹并保存到t_trail_sediment
|
||||
@GetMapping(value = "saveResCatalogApplyZTYS")
|
||||
@ApiOperation("取渣土车轨迹并保存到t_trail_sediment,根据后台UPLOADTIME调用接口")
|
||||
public Result resCatalogApplyZTYS(){
|
||||
|
||||
boolean result = sedimentTrailService.batchSaveSedimentTrail();
|
||||
if(result){
|
||||
return Result.success();
|
||||
}else{
|
||||
return Result.error(String.valueOf(result));
|
||||
}
|
||||
}
|
||||
|
||||
//根据输入的经纬度和查询的半径(米)时间查询范围内的渣土车轨迹信息
|
||||
@GetMapping(value = "listSedimentTrailByPoints")
|
||||
@ApiOperation("渣土车轨迹信息,根据经纬度和半径从表中查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query",required = true,dataType ="double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query",required = true,dataType ="double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", paramType = "query",required = true,dataType ="Integer"),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间,2021-08-03 10:17:23", paramType = "query",required = true,dataType ="string"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间,2021-08-03 12:17:23", paramType = "query",required = true,dataType ="string")
|
||||
})
|
||||
public Result listSedimentTrailByPoints(
|
||||
@RequestParam(value="longitude") double longitude,
|
||||
@RequestParam(value="latitude") double latitude,
|
||||
@RequestParam(value="radius") Integer radius,
|
||||
@RequestParam(value="start") String start,
|
||||
@RequestParam(value = "end") String end
|
||||
){
|
||||
Map<String,List<SedimentTrail>> map = sedimentTrailService.listSedimentTrailByPoints(longitude,latitude,radius,start,end);
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
//测试获取最新的客流列表,从接口获取
|
||||
@GetMapping("passengerFlow")
|
||||
@ApiOperation("获取最新的客流列表,测试接口,调用接口获取")
|
||||
public List<Map> passengerFlow(){
|
||||
List<Map> list = passengerFlowService.passengerFlow();
|
||||
return list;
|
||||
}
|
||||
|
||||
//获取最新的实时客流列表,从表获取
|
||||
@GetMapping("listPassengerFlow")
|
||||
@ApiOperation("获取最新的实时客流列表,从表获取,热力图")
|
||||
@ApiImplicitParam(name="timeId",value = "时间点",required = false,paramType = "query",dataType = "string")
|
||||
public List<PassengerFlow> listPassengerFlow(@RequestParam(value="timeId",required = false,defaultValue = "1970000000") String timeId){
|
||||
List<PassengerFlow> list = passengerFlowService.listPassengerFlow(timeId);
|
||||
return list;
|
||||
}
|
||||
//从表中获取最新的客流列表,并筛选出all_nums >=5000的
|
||||
@GetMapping("listPassengerFlowByAllNums")
|
||||
@ApiOperation("从表中获取最新的客流列表,并筛选出all_nums >=5000的")
|
||||
public List<PassengerFlow> listPassengerFlowByAllNums(){
|
||||
List<PassengerFlow> list = passengerFlowService.listPassengerFlowByAllNums();
|
||||
return list;
|
||||
}
|
||||
|
||||
//获取实时客流并保存到表t_passenger_flow
|
||||
@GetMapping("savePassengerFlow")
|
||||
@ApiOperation("获取实时客流并保存到表t_passenger_flow,调用接口")
|
||||
public Result savePassengerFlow(){
|
||||
List<Map> list = passengerFlowService.passengerFlow();
|
||||
boolean result = passengerFlowService.savePassengerFlow(list);
|
||||
if(result){
|
||||
return Result.success();
|
||||
}else{
|
||||
return Result.error(String.valueOf(result));
|
||||
}
|
||||
}
|
||||
|
||||
//根据输入的经纬度和查询的半径(米)和timeId查询游客总数
|
||||
@GetMapping("getPassengerNum")
|
||||
@ApiOperation("查询游客总数,根据经纬度和半径米、timeId从表中查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query",required = false,dataType ="double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query",required = false,dataType ="double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", paramType = "query",required = false,dataType ="Integer"),
|
||||
@ApiImplicitParam(name = "timeId", value = "时间点,202205101600", paramType = "query",required = true,dataType ="string"),
|
||||
})
|
||||
public Result getPassengerNum(
|
||||
@RequestParam(value="longitude",required = false,defaultValue = "0.00") double longitude,
|
||||
@RequestParam(value="latitude",required = false,defaultValue = "0.00") double latitude,
|
||||
@RequestParam(value="radius",required = false,defaultValue = "0") Integer radius,
|
||||
@RequestParam(value="timeId",required = true) String timeId
|
||||
){
|
||||
return Result.success(passengerFlowService.passengerNums(longitude,latitude,radius,timeId));
|
||||
}
|
||||
|
||||
//查询并保存环卫车轨迹到表t_trail_sanitation
|
||||
@GetMapping("saveTrailSanitation")
|
||||
@ApiOperation("保存环卫车轨迹到表t_trail_sanitation,根据后台updatetime调用接口")
|
||||
public Result saveTrailSanitation(){
|
||||
boolean result = trailSanitationService.saveTrailSanitation();
|
||||
if(result){
|
||||
return Result.success();
|
||||
}else{
|
||||
return Result.error(String.valueOf(result));
|
||||
}
|
||||
}
|
||||
|
||||
//根据输入的经纬度和查询的半径(米)时间查询范围内的环卫车轨迹信息
|
||||
@GetMapping(value = "listTrailSanitationByPoints")
|
||||
@ApiOperation("查询范围内环卫车轨迹信息,根据经纬度、半径米,时间从表中查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "longitude", value = "经度", paramType = "query",required = true,dataType ="double"),
|
||||
@ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query",required = true,dataType ="double"),
|
||||
@ApiImplicitParam(name = "radius", value = "半径,米", paramType = "query",required = true,dataType ="Integer"),
|
||||
@ApiImplicitParam(name = "start", value = "开始时间,2021-03-17 00:00:00", paramType = "query",required = true,dataType ="string"),
|
||||
@ApiImplicitParam(name = "end", value = "结束时间,2021-03-22 00:00:00", paramType = "query",required = true,dataType ="string"),
|
||||
})
|
||||
public Result listTrailSanitationByPoints(
|
||||
@RequestParam(value="longitude") double longitude,
|
||||
@RequestParam(value="latitude") double latitude,
|
||||
@RequestParam(value="radius") Integer radius,
|
||||
@RequestParam(value="start") String start,
|
||||
@RequestParam(value = "end") String end
|
||||
){
|
||||
List<TrailSanitation> list = trailSanitationService.listSedimentTrailByPoints(longitude,latitude,radius,start,end);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
//查询道路污染数据
|
||||
//输入参考:2022-05-10 00:00:00,只能查询当前日期前一天及以前的
|
||||
@GetMapping(value="listRoadData")
|
||||
@ApiOperation("查询道路污染数据,根据dt从表中查询,参考输入-2022-05-10 00:00:00,只能查询当前日期前一天及以前的")
|
||||
@ApiImplicitParam(name="dt",value = "时间",paramType = "query",required = true,dataType = "string")
|
||||
public Result listRoadData(@RequestParam(value="dt") String dt){
|
||||
List<RoadData> list = roadDataService.listRoadData(dt);
|
||||
return Result.success(list);
|
||||
}
|
||||
//根据输入的日期间隔查询道路污染数据(例如:2022-05-10 00:00:00至2022-05-11 00:00:00)
|
||||
@GetMapping(value="listRoadDataByTimeRegion")
|
||||
@ApiOperation("根据输入的日期间隔查询道路污染数据(例如:2022-05-10 00:00:00至2022-05-11 00:00:00)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "start", value = "开始日期", paramType = "query", dataType = "string", required = true),
|
||||
@ApiImplicitParam(name = "end", value = "结束日期", paramType = "query", dataType = "string", required = true)
|
||||
})
|
||||
public Result listRoadDataByTimeRegion(
|
||||
@RequestParam(value="start") String start,
|
||||
@RequestParam(value="end") String end
|
||||
){
|
||||
List<RoadData> list = roadDataService.listRoadDataByTimeRegion(start,end);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
//查询工地信息,根据经纬度和半径查询
|
||||
@GetMapping(value = "listBuildingSiteByPoints")
|
||||
@ApiOperation("查询工地信息,根据经纬度和半径从表中查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name="longitude",value = "经度",paramType = "query",required = true,dataType = "double"),
|
||||
@ApiImplicitParam(name="longitude",value = "经度",paramType = "query",required = true,dataType = "double")
|
||||
})
|
||||
public Result listBuildingSiteByPoints(double longitude,double latitude,Integer radius){
|
||||
List<BuildingSite> list = new ArrayList<>();
|
||||
list = buildingSitrService.listBuildingSiteByPoints(longitude,latitude,radius);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部工地信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectBuildSite")
|
||||
@ApiOperation("查询全部工地信息")
|
||||
public Result selectBuildSite(){
|
||||
List<BuildingSite> buildingSites = buildingSiteMapper.selectBuildSite();
|
||||
Result success = Result.success(buildingSites);
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,183 @@
|
|||
package io.renren.modules.monitor.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.renren.modules.monitor.entity.Event;
|
||||
import io.renren.modules.monitor.entity.Result;
|
||||
import io.renren.modules.monitor.mapper.EventMapper;
|
||||
import io.renren.modules.monitor.service.EventService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("STapi/project")
|
||||
@Api(tags = "事件")
|
||||
@Log4j2
|
||||
public class EventController {
|
||||
|
||||
@Autowired
|
||||
private EventService eventService;
|
||||
|
||||
@Autowired
|
||||
private EventMapper eventMapper;
|
||||
|
||||
/**
|
||||
* 订阅任务下发接口
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("subscribe")
|
||||
public JSONObject subscribe(){
|
||||
return eventService.subscribe();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 订阅任务下发接口
|
||||
* @param request
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
@PostMapping("receive")
|
||||
@ApiOperation("订阅任务下发接口")
|
||||
public Result receive(HttpServletRequest request) throws IOException {
|
||||
ServletInputStream ris = request.getInputStream();
|
||||
StringBuilder content = new StringBuilder();
|
||||
byte[] b = new byte[1024];
|
||||
int lens = -1;
|
||||
while ((lens = ris.read(b)) > 0) {
|
||||
content.append(new String(b, 0, lens));
|
||||
}
|
||||
String strcont = content.toString();// 内容
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(strcont);
|
||||
Event event = new Event();
|
||||
event.setEventCnName(jsonObject.getString("eventAlias"));
|
||||
event.setEventSerial(jsonObject.getString("eventSerial"));
|
||||
JSONObject attributes = jsonObject.getJSONObject("attributes");
|
||||
if (attributes==null){
|
||||
}else {
|
||||
JSONObject text = attributes.getJSONObject("text");
|
||||
if (text == null){
|
||||
}else {
|
||||
event.setVehicle(text.getString("valueDescription"));
|
||||
}
|
||||
JSONObject color = attributes.getJSONObject("color");
|
||||
if (color == null) {
|
||||
} else {
|
||||
event.setColor(color.getString("valueDescription"));
|
||||
}
|
||||
JSONObject largeVehicle = attributes.getJSONObject("large_vehicle");
|
||||
if (largeVehicle == null) {
|
||||
} else {
|
||||
event.setVehicle(largeVehicle.getString("valueDescription"));
|
||||
}
|
||||
JSONObject trainingVehicle = attributes.getJSONObject("training_vehicle");
|
||||
if (trainingVehicle == null) {
|
||||
} else {
|
||||
event.setVehicle(trainingVehicle.getString("valueDescription"));
|
||||
}
|
||||
JSONObject smallVehicle = attributes.getJSONObject("small_vehicle");
|
||||
if (smallVehicle == null) {
|
||||
} else {
|
||||
event.setVehicle(smallVehicle.getString("valueDescription"));
|
||||
}
|
||||
JSONObject aClass = attributes.getJSONObject("class");
|
||||
if (aClass == null) {
|
||||
} else {
|
||||
event.setClasses(aClass.getString("valueDescription"));
|
||||
}
|
||||
}
|
||||
JSONObject camera = jsonObject.getJSONObject("camera");
|
||||
event.setCameraName(camera.getString("cameraName"));
|
||||
event.setDistrict(camera.getString("district"));
|
||||
event.setLatitude(camera.getBigDecimal("latitude"));
|
||||
event.setLongitude(camera.getBigDecimal("longitude"));
|
||||
JSONObject image = jsonObject.getJSONObject("image");
|
||||
event.setImageUrl(image.getString("imageUrl"));
|
||||
event.setTaskId(jsonObject.getString("taskId"));
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//要转换的时间格式
|
||||
Date date;
|
||||
try {
|
||||
date = sdf.parse(sdf.format(jsonObject.get("captureTime")));
|
||||
event.setCaptureTime(sdf.format(date));
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
event.setTrackEvent(jsonObject.getString("trackEvent"));
|
||||
eventMapper.insert(event);
|
||||
log.info(event);
|
||||
return Result.success(strcont);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 事件模板分页查询接口
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("tamplate")
|
||||
@ApiOperation("事件模板分页查询接口")
|
||||
public JSONObject tamplate(){
|
||||
return eventService.template();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有事件
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectEvent")
|
||||
@ApiOperation("查询所有事件")
|
||||
public Result selectEvent(){
|
||||
|
||||
List<Event> events = eventMapper.selectEvent();
|
||||
|
||||
Result success = Result.success(events);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当天事件
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByTime")
|
||||
@ApiOperation("查询当天事件")
|
||||
public Result selectByTime(){
|
||||
List<Event> byTime = eventMapper.selectByTime();
|
||||
|
||||
Result success = Result.success(byTime);
|
||||
|
||||
return success;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据事件名称查询事件
|
||||
* @param eventCnName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectByName")
|
||||
@ApiOperation("根据事件名称查询事件")
|
||||
@ApiImplicitParam(name = "eventCnName",value = "事件名称",required = true,dataType = "String")
|
||||
public Result selectByName(String eventCnName){
|
||||
List<Event> byName = eventMapper.selectByName(eventCnName);
|
||||
|
||||
Result success = Result.success(byName);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package io.renren.modules.monitor.controller;
|
||||
|
||||
import io.renren.modules.monitor.entity.Result;
|
||||
import io.renren.modules.monitor.service.MonitorService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/project")
|
||||
@Api(tags="视频流")
|
||||
public class FileController {
|
||||
|
||||
@Autowired
|
||||
private MonitorService monitorService;
|
||||
|
||||
/**
|
||||
* 根据摄像头标识获取视频流
|
||||
* @param channelCode
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
@GetMapping("file")
|
||||
@ApiOperation("根据摄像头标识获取视频流")
|
||||
public Result File(String channelCode)throws IOException {
|
||||
String s = monitorService.fileCode(channelCode);
|
||||
Result success = Result.success(s);
|
||||
return success;
|
||||
}
|
||||
|
||||
@GetMapping("token")
|
||||
public Result token( ) {
|
||||
String s = monitorService.init();
|
||||
Result success = Result.success(s);
|
||||
return success;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package io.renren.modules.monitor.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
|
||||
@Controller
|
||||
@Api(tags = "转发")
|
||||
public class FordController {
|
||||
|
||||
@GetMapping("components/**")
|
||||
@ApiOperation("前端访问图片请求转发")
|
||||
public void ford(HttpServletRequest request, HttpServletResponse response){
|
||||
|
||||
String imageDomain = "http://10.132.191.48:30080";
|
||||
|
||||
String uri = request.getRequestURI();
|
||||
String fordUrl = imageDomain + uri;
|
||||
|
||||
URLConnection con = null;
|
||||
|
||||
try {
|
||||
URL url = new URL(fordUrl);
|
||||
con = url.openConnection();
|
||||
|
||||
//允许写出
|
||||
con.setDoOutput(true);
|
||||
//允许读入
|
||||
con.setDoInput(true);
|
||||
//不使用缓存
|
||||
con.setUseCaches(false);
|
||||
//得到响应流
|
||||
InputStream inputStream = con.getInputStream();
|
||||
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
byte[] buffer = new byte[1024];
|
||||
int len = inputStream.read(buffer);
|
||||
while (len != -1) {
|
||||
outputStream.write(buffer, 0, len);
|
||||
len = inputStream.read(buffer);
|
||||
}
|
||||
inputStream.close();
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package io.renren.modules.monitor.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.renren.modules.monitor.entity.CaseCityLaw;
|
||||
import io.renren.modules.monitor.entity.Result;
|
||||
import io.renren.modules.monitor.service.SJZTService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "数交中台-城市执法案件")
|
||||
@RestController
|
||||
@RequestMapping("api/project")
|
||||
public class SJZTController {
|
||||
@Autowired
|
||||
private SJZTService sjztService;
|
||||
|
||||
//从接口获取案件数据
|
||||
@GetMapping("listSJZTDatas")
|
||||
@ApiOperation("获取案件数据,根据后台条件调用接口获取")
|
||||
public List<Map> listSJZTDatas(){
|
||||
return sjztService.listSJZTDatas();
|
||||
}
|
||||
|
||||
//测试保存
|
||||
@GetMapping("batchSaveSJZT")
|
||||
@ApiOperation("测试保存,根据后台条件调用接口获取并保存到表,这个后台条件需要改动,也可能是做成自动任务调度")
|
||||
public void batchSaveSJZT(){
|
||||
sjztService.batchSave();
|
||||
}
|
||||
|
||||
//从表中查询案件数据,需要根据要求增加条件
|
||||
@GetMapping("listSJZTByDt")
|
||||
@ApiOperation("获取案件数据,根据ajjlsj从表中获取")
|
||||
@ApiImplicitParam(name="ajjlsj",value="案件建立时间,2021-01-01",paramType = "query",required = true,dataType = "string")
|
||||
public List<CaseCityLaw> listSJZTByDt(
|
||||
@RequestParam(value="ajjlsj") String ajjlsj
|
||||
){
|
||||
return sjztService.listSJZTByDt(ajjlsj);
|
||||
}
|
||||
|
||||
@PostMapping("upStream")
|
||||
@ApiOperation("案件上报,调用接口上报,暂时未测试")
|
||||
public Result upStream(@ApiParam(value="data,直接以json字符串的形式传递",required = true) @RequestBody String data){
|
||||
System.out.println("案件上报,调用接口上报");
|
||||
return sjztService.upStream(JSONObject.parseObject(data));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package io.renren.modules.monitor.controller;
|
||||
|
||||
import io.renren.modules.monitor.entity.Result;
|
||||
import io.renren.modules.monitor.service.SanitationService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName SanitationController.java
|
||||
* @Description 环卫
|
||||
* @createTime 2022年05月19日 11:22:00
|
||||
*/
|
||||
@Api(tags = "环卫")
|
||||
@RequestMapping("api/project/santation")
|
||||
@RestController
|
||||
public class SanitationController {
|
||||
@Autowired
|
||||
private SanitationService sanitationService;
|
||||
|
||||
@GetMapping("/saveSantation")
|
||||
@ApiOperation("测试获取环卫车辆基础数据并保存到表中")
|
||||
public Result saveSantation(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/saveSanitationRoad")
|
||||
@ApiOperation("测试获取环卫道路数据并保存到表中")
|
||||
public Result saveSanitationRoad(){
|
||||
return sanitationService.saveSanitationRoad();
|
||||
}
|
||||
|
||||
@GetMapping("saveSanitationTask")
|
||||
@ApiOperation("测试获取环卫车作业数据并保存到表中")
|
||||
public Result saveSanitationTask(){
|
||||
return sanitationService.saveSanitationTask();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package io.renren.modules.monitor.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.renren.modules.monitor.entity.Camera;
|
||||
import io.renren.modules.monitor.entity.Result;
|
||||
import io.renren.modules.monitor.mapper.CameraMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/static")
|
||||
public class StaticController {
|
||||
|
||||
@Autowired
|
||||
private CameraMapper cameraMapper;
|
||||
|
||||
@RequestMapping("all")
|
||||
public Object all(){
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
//
|
||||
Integer cameraCount = cameraMapper.selectCount(null);
|
||||
map.put("cameraCount", cameraCount);
|
||||
LambdaQueryWrapper<Camera> queryWrapper = new QueryWrapper<Camera>().lambda()
|
||||
.gt(Camera::getCaptureTime, DateUtil.beginOfDay(new Date()));
|
||||
Integer todayCount = cameraMapper.selectCount(queryWrapper);
|
||||
map.put("todayCount", todayCount);
|
||||
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package io.renren.modules.monitor.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CameraChannelDto {
|
||||
|
||||
private String channelCode;
|
||||
|
||||
private String gpsX;
|
||||
|
||||
private String gpsY;
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package io.renren.modules.monitor.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CameraChannelDto1 {
|
||||
private Long idtCameraChannel;
|
||||
|
||||
private String channelCode;
|
||||
|
||||
private String channelId;
|
||||
|
||||
private String channelName;
|
||||
|
||||
private String gpsX;
|
||||
|
||||
private String gpsY;
|
||||
|
||||
private Integer status;//1在线;0离线
|
||||
|
||||
private String nodeName;
|
||||
|
||||
private Integer checkStatus;//1正常;0异常
|
||||
|
||||
private String parentId;
|
||||
|
||||
private String picUrl;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package io.renren.modules.monitor.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CameraChannelNLDto {
|
||||
|
||||
private String labelCode;
|
||||
|
||||
private String labelName;
|
||||
|
||||
private String channelCode;
|
||||
|
||||
private String channelId;
|
||||
|
||||
private String channelName;
|
||||
|
||||
private String gpsX;
|
||||
|
||||
private String gpsY;
|
||||
|
||||
private Integer status;//1在线;0离线
|
||||
|
||||
private String nodeName;
|
||||
|
||||
private Integer checkStatus;//1正常;0异常
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package io.renren.modules.monitor.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ChannelLabelDto {
|
||||
|
||||
private String channelCode;
|
||||
|
||||
private String channelName;
|
||||
|
||||
private String gpsX;
|
||||
|
||||
private String gpsY;
|
||||
|
||||
private String checkStatus;
|
||||
|
||||
private String nodeName;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package io.renren.modules.monitor.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class ChannelPictureDto {
|
||||
|
||||
private String ssqh;
|
||||
private String xmmc;
|
||||
private String xmdz;
|
||||
private String channelCode;
|
||||
|
||||
private String PicUrl;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date insertTime;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package io.renren.modules.monitor.dto;
|
||||
|
||||
|
||||
import io.renren.modules.monitor.entity.Camera;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ChengguanDto extends Camera {
|
||||
|
||||
|
||||
private String id;
|
||||
private String xmdz;
|
||||
private String xmmc;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package io.renren.modules.monitor.dto;
|
||||
|
||||
|
||||
import io.renren.modules.monitor.entity.Camera;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ScenicCameraDto extends Camera {
|
||||
|
||||
|
||||
/**
|
||||
* 景区编码
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 摄像头名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 景区名
|
||||
*/
|
||||
private String jqmc;
|
||||
/**
|
||||
* 管理单位
|
||||
*/
|
||||
private String gldw;
|
||||
|
||||
/**
|
||||
* 识别出来的人数
|
||||
*/
|
||||
private Integer personNum;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("t_booth")
|
||||
public class Booth {
|
||||
private String serial;
|
||||
private String area;
|
||||
private String boothName;
|
||||
private String location;
|
||||
private String manageTime;
|
||||
private String captureTime;
|
||||
private String channelCode;
|
||||
private String gpsX;
|
||||
private String gpsY;
|
||||
private String channelName;
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName BuildingRecords.java
|
||||
* @Description 工地实时信息类
|
||||
* @createTime 2022年05月17日 15:28:00
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("t_building_records")
|
||||
@ApiModel("工地实时数据")
|
||||
public class BuildingRecords {
|
||||
@TableId
|
||||
@ApiModelProperty("id")
|
||||
private Integer id;
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
@ApiModelProperty("项目建筑批准编号")
|
||||
private String buildLicense;
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@ApiModelProperty("数据上传时间")
|
||||
private LocalDateTime pushTime;
|
||||
@ApiModelProperty("appid")
|
||||
private String appid;
|
||||
@ApiModelProperty("pm10值")
|
||||
private double pm10;
|
||||
@ApiModelProperty("噪音值")
|
||||
private double noice;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName BuildingSite.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月12日 14:00:00
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("t_building_site")
|
||||
public class BuildingSite {
|
||||
@TableId
|
||||
private Integer id;
|
||||
private String gdmc;
|
||||
private String sgwz;
|
||||
private double jd;
|
||||
private double wd;
|
||||
private String ssdq;
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("t_camera")
|
||||
public class Camera {
|
||||
|
||||
@TableId
|
||||
private String code;
|
||||
private String name;
|
||||
private String description;
|
||||
|
||||
private String longitude;
|
||||
private String latitude;
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date captureTime;
|
||||
private String pic;
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("t_camera_channel")
|
||||
public class CameraChannel {
|
||||
|
||||
@TableId
|
||||
private Long idtCameraChannel;
|
||||
|
||||
private String channelCode;
|
||||
|
||||
private String channelId;
|
||||
|
||||
private String channelName;
|
||||
|
||||
private String gpsX;
|
||||
|
||||
private String gpsY;
|
||||
|
||||
private Integer status;//1在线;0离线
|
||||
|
||||
private String nodeName;
|
||||
|
||||
private Integer checkStatus;//1正常;0异常
|
||||
|
||||
private String parentId;
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName CameraCheck.java
|
||||
* @Description 摄像头巡检类
|
||||
* @createTime 2022年05月13日 20:57:00
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class CameraCheck {
|
||||
private String cameraType;
|
||||
private String channelCode;
|
||||
// private String channelName;
|
||||
// private String channelSn;
|
||||
// private String channelType;
|
||||
// private String deviceCode;
|
||||
// private String deviceIp;
|
||||
// private String deviceName;
|
||||
// @JsonFormat(pattern="yyyyMMdd'T'HHmmss'Z'")
|
||||
// private ZonedDateTime checkTime;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("t_camera_organization")
|
||||
public class CameraOrganization {
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String parentId;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
private Integer subCount;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("t_camera_scenic")
|
||||
public class CameraScenic {
|
||||
|
||||
@TableId
|
||||
private String cameraId;
|
||||
private Integer personNum;
|
||||
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName CaseCityLaw.java
|
||||
* @Description 城市执法案件类
|
||||
* @createTime 2022年05月13日 15:32:00
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("t_case_cityLaw")
|
||||
public class CaseCityLaw {
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime ajjlsj;
|
||||
private String dzms;
|
||||
private String wtms;
|
||||
private String wtlybs;
|
||||
private String wtlymc;
|
||||
private String ajlxbs;
|
||||
private String ajlxmc;
|
||||
private String dlbs;
|
||||
private String dlmc;
|
||||
private String xlbs;
|
||||
private String xlmc;
|
||||
private String qbs;
|
||||
private String qmc;
|
||||
private String jdbs;
|
||||
private String jdmc;
|
||||
private String sqbs;
|
||||
private String sqmc;
|
||||
private String xzb;
|
||||
private String yzb;
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime pqsj;
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime ajjssj;
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime ajzfsj;
|
||||
private String czsxcqjaaqjacqwjayqja;
|
||||
private String sbtpsl;
|
||||
private String cztpsl;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("t_channel_picture")
|
||||
public class ChannelPicture {
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
private String channelCode;
|
||||
|
||||
private String PicUrl;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date insertTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@TableName("t_event")
|
||||
public class Event {
|
||||
@TableId
|
||||
private String id;
|
||||
private String eventCnName;
|
||||
private String eventSerial;
|
||||
private String color;
|
||||
private String vehicle;
|
||||
private String classes;
|
||||
private String cameraName;
|
||||
private String district;
|
||||
private BigDecimal latitude;
|
||||
private BigDecimal longitude;
|
||||
private String imageUrl;
|
||||
private String taskId;
|
||||
private String captureTime;
|
||||
private String trackEvent;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("t_label")
|
||||
public class Label {
|
||||
@TableId
|
||||
private Long id;
|
||||
private String labelCode;
|
||||
private String labelName;
|
||||
private String capturePatternn;
|
||||
private String city;
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName PassengerFlow.java
|
||||
* @Description 实时客流
|
||||
* @createTime 2022年05月10日 14:25:00
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("t_passenger_flow")
|
||||
public class PassengerFlow {
|
||||
@TableId
|
||||
private Integer id;
|
||||
private String hourId;
|
||||
private String timeId;
|
||||
private double longitude;
|
||||
private double latitude;
|
||||
private Integer allNums;
|
||||
private Integer localNums;
|
||||
private Integer nonlocalNums;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Picture {
|
||||
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
private Date captureTime;
|
||||
private String pic;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@TableName("t_project")
|
||||
public class Project {
|
||||
|
||||
@TableId
|
||||
private String id;
|
||||
private String ssqh;
|
||||
private String xmmc;
|
||||
private String xmdz;
|
||||
private String ghxkzbh;
|
||||
private String fzsj;
|
||||
private String xkmj;
|
||||
private String lzs;
|
||||
private String xmxz;
|
||||
private String jsdw;
|
||||
private String dwdz;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<Picture> pics;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class Result<T> {
|
||||
|
||||
private int code;
|
||||
private String message;
|
||||
private T data;
|
||||
private int count;
|
||||
|
||||
static public Result success(){
|
||||
return Result.builder()
|
||||
.code(1)
|
||||
.message("success")
|
||||
.build();
|
||||
}
|
||||
static public Result success(Object obj){
|
||||
return Result.builder()
|
||||
.code(1)
|
||||
.message("success")
|
||||
.data(obj)
|
||||
.build();
|
||||
}
|
||||
static public Result error(String errMsg){
|
||||
return Result.builder()
|
||||
.code(0)
|
||||
.message(errMsg)
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName RoadData.java
|
||||
* @Description 道路统计数据
|
||||
* @createTime 2022年05月11日 11:10:00
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("t_road_data")
|
||||
public class RoadData {
|
||||
@TableId
|
||||
private Integer id;
|
||||
private String regionName;
|
||||
private String streetName;
|
||||
private String roadName;
|
||||
private String start;
|
||||
private String end;
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double pm10;
|
||||
private double pm25;
|
||||
private Integer descPm10Rank;
|
||||
private Integer ascPm10Rank;
|
||||
private Integer descPm25Rank;
|
||||
private Integer ascPm25Rank;
|
||||
private String points;
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
private LocalDateTime dt;
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName Sanitation.java
|
||||
* @Description 环卫车基础信息类
|
||||
* @createTime 2022年05月19日 11:24:00
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("t_sanitation_info")
|
||||
@ApiModel("环卫车辆基础数据")
|
||||
public class Sanitation {
|
||||
@TableId
|
||||
@ApiModelProperty("id")
|
||||
private Integer id;
|
||||
@ApiModelProperty("车牌号")
|
||||
private String cph;
|
||||
@ApiModelProperty("驾驶员")
|
||||
private String jsy;
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
@ApiModelProperty("购买日期")
|
||||
private LocalDateTime gmri;
|
||||
@ApiModelProperty("车辆类型")
|
||||
private String cllx;
|
||||
@ApiModelProperty("所属区域编号")
|
||||
private String ssqybh;
|
||||
@ApiModelProperty("所属环卫公司编号")
|
||||
private String sshwgsbh;
|
||||
@ApiModelProperty("备注")
|
||||
private String bz;
|
||||
@ApiModelProperty("是否考核")
|
||||
private Integer sfkh;
|
||||
@ApiModelProperty("车辆编号")
|
||||
private String clbh;
|
||||
@ApiModelProperty("吨数")
|
||||
private String ds;
|
||||
@ApiModelProperty("是否加装GPS并连入市监管平台")
|
||||
private String sfjzgpsblrsjgpt;
|
||||
@ApiModelProperty("简介")
|
||||
private String jj;
|
||||
@ApiModelProperty("车辆型号")
|
||||
private String clxh;
|
||||
@ApiModelProperty("车辆大类")
|
||||
private String cldl;
|
||||
@ApiModelProperty("是否机扫")
|
||||
private Integer sfjs;
|
||||
@ApiModelProperty("是否洒水")
|
||||
private Integer sfss;
|
||||
@ApiModelProperty("是否冲洗")
|
||||
private Integer sfcx;
|
||||
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName SanitationRoad.java
|
||||
* @Description 环卫道路
|
||||
* @createTime 2022年05月20日 09:57:00
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("t_sanitation_road")
|
||||
@ApiModel("环卫道路数据")
|
||||
public class SanitationRoad {
|
||||
@TableField
|
||||
private Integer id;
|
||||
private String bh;
|
||||
private String dlmc;
|
||||
private String qdlkdlmc;
|
||||
private String zdlkdlmc;
|
||||
private String zcgdlxzc;
|
||||
private String bjdj;
|
||||
private double dlzd;
|
||||
private double dlkd;
|
||||
private double dlzmj;
|
||||
private double cxdmj;
|
||||
private double rxdmj;
|
||||
private double jsmj;
|
||||
private double ssmj;
|
||||
private double gycxmj;
|
||||
private Integer bjysl;
|
||||
private Integer gpxsl;
|
||||
private String ssqybh;
|
||||
private String ssjdbsc;
|
||||
private String sshwgsbh;
|
||||
private String zbjh;
|
||||
private String sfqy;
|
||||
private String bz;
|
||||
private String bh1;
|
||||
private Integer dtdlhzkd;
|
||||
private String zcgd;
|
||||
private String jsqz;
|
||||
private String cxqz;
|
||||
private String jj;
|
||||
private String tplj;
|
||||
private String zbdfxbz0zx1fx;
|
||||
private String fxzbxxid;
|
||||
private String ys;
|
||||
private double btmx;
|
||||
private Integer jsts;
|
||||
private String jspc;
|
||||
private Integer sfjs0bjs1js;
|
||||
private Integer sfss0bss1ss;
|
||||
private Integer sfcx0bcx1cx;
|
||||
private String sspc;
|
||||
private String cxpc;
|
||||
private Integer ssts;
|
||||
private Integer cxts;
|
||||
private String sfkh;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName SanitationTask.java
|
||||
* @Description 环卫车作业数据
|
||||
* @createTime 2022年05月20日 13:33:00
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("t_sanitation_task")
|
||||
@ApiModel("环卫车辆作业数据")
|
||||
public class SanitationTask {
|
||||
@TableId
|
||||
@ApiModelProperty("id")
|
||||
private Integer id;
|
||||
@ApiModelProperty("道路名称")
|
||||
private String dlmc;
|
||||
@ApiModelProperty("开始道路")
|
||||
private String ksdl;
|
||||
@ApiModelProperty("终止道路")
|
||||
private String zzdl;
|
||||
@ApiModelProperty("所属区市")
|
||||
private String ssqs;
|
||||
@ApiModelProperty("车牌号")
|
||||
private String cph;
|
||||
@ApiModelProperty("作业完成率")
|
||||
private double zywcl;
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
@ApiModelProperty("作业日期")
|
||||
private LocalDateTime zyrq;
|
||||
@ApiModelProperty("作业类型")
|
||||
private String zylx;
|
||||
@ApiModelProperty("作业时间")
|
||||
private String zysj;
|
||||
@ApiModelProperty("作业趟数")
|
||||
private double zyts;
|
||||
@ApiModelProperty("作业频次")
|
||||
private double zypc;
|
||||
@ApiModelProperty("作业长度")
|
||||
private double zyzd;
|
||||
@ApiModelProperty("作业宽度")
|
||||
private double zykd;
|
||||
@ApiModelProperty("作业面积")
|
||||
private double zymj;
|
||||
@ApiModelProperty("未作业点数")
|
||||
private double wzyds;
|
||||
@ApiModelProperty("作业超速点数")
|
||||
private double zycsds;
|
||||
@ApiModelProperty("作业GPS点数")
|
||||
private double zygpsds;
|
||||
@JsonFormat(pattern="yyyy-MM-dd mm:HH:ss",timezone = "GMT+8")
|
||||
@ApiModelProperty("上传时间")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author huangweixiong
|
||||
* @Date 2022-04-19
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("t_scenic" )
|
||||
public class Scenic implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4864551986417177990L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 景区名
|
||||
*/
|
||||
private String jqmc;
|
||||
|
||||
/**
|
||||
* 管理单位
|
||||
*/
|
||||
private String gldw;
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName SedimentTrail.java
|
||||
* @Description 渣土车轨迹
|
||||
* @createTime 2022年05月09日 13:47:00
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("t_trail_sediment")
|
||||
public class SedimentTrail{
|
||||
@TableId
|
||||
private Integer id;
|
||||
private double speed;
|
||||
private String simCardNum;
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime uploadtime;
|
||||
private double coordinateX;
|
||||
private double coordinateY;
|
||||
private double longitude;
|
||||
private double latitude;
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime recordTime;
|
||||
private double angle;
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime updateTime;
|
||||
private String status;
|
||||
private double fuel;
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package io.renren.modules.monitor.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName TrailSanitation.java
|
||||
* @Description 环卫车轨迹类
|
||||
* @createTime 2022年05月10日 16:29:00
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("t_trail_sanitation")
|
||||
public class TrailSanitation {
|
||||
@TableId
|
||||
private Integer id;
|
||||
private String simkh;
|
||||
private String cph;
|
||||
private String wz;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime fssj;
|
||||
private double jd;
|
||||
private double wd;
|
||||
private double sd;
|
||||
private Integer fx;
|
||||
private String zt;
|
||||
private double yl;
|
||||
private double lc;
|
||||
private double yl2;
|
||||
private Integer sfzx;
|
||||
private Integer xh;
|
||||
private String bjzt;
|
||||
private double gd;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime updatetime;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.Booth;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface BoothMapper extends BaseDao<Booth> {
|
||||
|
||||
@Select("select * from t_booth where capture_time = #{captureTime}")
|
||||
List<Booth> selectBooth(String captureTime);
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.BuildingRecords;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName BuildingRecordsMapper.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月17日 15:32:00
|
||||
*/
|
||||
@Mapper
|
||||
public interface BuildingRecordsMapper extends BaseDao<BuildingRecords> {
|
||||
public void batchSave(@Param("list") List<Map> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.BuildingSite;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName BuildingSiteMapper.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月12日 13:59:00
|
||||
*/
|
||||
@Mapper
|
||||
public interface BuildingSiteMapper extends BaseDao<BuildingSite> {
|
||||
|
||||
@Select("select * from t_building_site")
|
||||
List<BuildingSite> selectBuildSite();
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.dto.CameraChannelDto;
|
||||
import io.renren.modules.monitor.dto.CameraChannelDto1;
|
||||
import io.renren.modules.monitor.dto.CameraChannelNLDto;
|
||||
import io.renren.modules.monitor.dto.ChannelLabelDto;
|
||||
import io.renren.modules.monitor.entity.CameraChannel;
|
||||
import io.renren.modules.monitor.entity.Label;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface CameraChannelMapper extends BaseDao<CameraChannel> {
|
||||
|
||||
void updateCameraStatus(List<String> list);
|
||||
|
||||
List<CameraChannelDto> selectAll();
|
||||
|
||||
@Select("select cc.*,cp.pic_url from t_camera_channel cc LEFT JOIN t_channel_picture cp ON cc.channel_code=cp.channel_code where cc.channel_code = #{channelCode}")
|
||||
List<CameraChannelDto1> selectByChannelCode(@Param("channelCode") String channelCode);
|
||||
|
||||
@Select("select * from t_camera_channel where parent_id = #{parentId} and check_status in (${checkStatus}) ")
|
||||
List<CameraChannel> selectByParentId(@Param("parentId") String parentId,
|
||||
@Param("checkStatus") String checkStatus);
|
||||
|
||||
@Select("select c.* from t_camera_channel c where channel_code in " +
|
||||
"(select b.channel_code from t_channel_mtm_label b where b.label_code = #{labelCode}) ")
|
||||
List<ChannelLabelDto> selectLabel(@Param("labelCode") String labelCode);
|
||||
//@Update("update t_camera_channel set state = list")
|
||||
void updateState(@Param("list") List list);
|
||||
|
||||
@Select("select * from t_label")
|
||||
List<Label> selectAllLabel();
|
||||
|
||||
@Select("select * from t_label where city = 1 ")
|
||||
List<Label> selectByLabelCity();
|
||||
|
||||
@Select("select * from t_label where label_name like concat('%',#{labelName},'%')")
|
||||
List<Label> selectByLabelName(String labelName);
|
||||
|
||||
@Select("select * from t_camera_channel where channel_name like concat('%',#{channelName},'%')")
|
||||
List<CameraChannel> selectByChannelName(String channelName);
|
||||
|
||||
@Select("select * from (select a.label_code,a.label_name,c.channel_code,c.channel_name from t_channel_mtm_label b JOIN t_label a JOIN t_camera_channel c " +
|
||||
"ON a.label_code = b.label_code AND b.channel_code = c.channel_code where c.`status`!= 0) m where m.label_code in (${labelCode}) ")
|
||||
List<ChannelLabelDto> selectLabelAndChannel(@Param("labelCode") String labelCode);
|
||||
|
||||
@Select("select cc.* from t_camera_channel cc " +
|
||||
"where (gps_x between #{gpsX} and #{gpsX1}) and (gps_y between #{gpsY} and #{gpsY1} )")
|
||||
List<CameraChannel> selectAllByGps(@Param("gpsX") Double gpsX,
|
||||
@Param("gpsX1") Double gpsX1,
|
||||
@Param("gpsY") Double gpsY,
|
||||
@Param("gpsY1") Double gpsY1);
|
||||
|
||||
|
||||
List<CameraChannelNLDto> selectNLAll(@Param("page") Integer page, @Param("pageSize") Integer pageSize);
|
||||
|
||||
List<CameraChannelNLDto> selectByLabel(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.dto.ChengguanDto;
|
||||
import io.renren.modules.monitor.entity.Camera;
|
||||
import io.renren.modules.monitor.entity.Picture;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface CameraMapper extends BaseDao<Camera> {
|
||||
|
||||
@Select("SELECT tc.pic,tc.capture_time AS captureTime FROM t_project_mtm_camera pmc JOIN t_camera tc ON pmc.project_id = #{id} AND pmc.camera_id = tc.`code` AND tc.pic IS NOT NULL")
|
||||
List<Picture> selectPicByProjectId(String id);
|
||||
|
||||
@Select("SELECT tp.*,tc.* FROM t_project_mtm_camera pmc JOIN t_camera tc JOIN t_project tp ON pmc.camera_id = tc.`code` AND pmc.project_id = tp.id")
|
||||
List<ChengguanDto> selectCamera();
|
||||
|
||||
@Select("SELECT code FROM t_camera")
|
||||
List<String> selectCameraCodes();
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.CameraOrganization;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface CameraOrgenizationMapper extends BaseDao<CameraOrganization> {
|
||||
|
||||
@Select("select * from t_camera_organization where parent_id = #{parentId}")
|
||||
List<CameraOrganization> selectSubOrganization(@Param("parentId") String parentId);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.CameraScenic;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface CameraScenicMapper extends BaseDao<CameraScenic> {
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.CaseCityLaw;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName CaseCityLawMapper.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月13日 16:22:00
|
||||
*/
|
||||
@Mapper
|
||||
public interface CaseCityLawMapper extends BaseDao<CaseCityLaw> {
|
||||
//public void batchSave(List<Map> list);
|
||||
public void batchSave(List<Map> list);
|
||||
public void singleSave(Map map);
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.dto.ChannelPictureDto;
|
||||
import io.renren.modules.monitor.entity.ChannelPicture;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ChannelPictureMapper extends BaseDao<ChannelPicture> {
|
||||
|
||||
@Select("select * from t_project p JOIN t_channel_picture cp JOIN t_project_mtm_camera pmc on p.id = pmc.project_id AND cp.channel_code = pmc.channel_code")
|
||||
List<ChannelPictureDto> selectByProject();
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.Event;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface EventMapper extends BaseDao<Event> {
|
||||
@Select("SELECT * FROM t_event where track_event = 'START'")
|
||||
List<Event> selectEvent();
|
||||
|
||||
@Select("SELECT * FROM t_event where TO_DAYS(capture_time) = TO_DAYS(NOW()) AND track_event = 'START'")
|
||||
List<Event> selectByTime();
|
||||
|
||||
@Select("select * from t_event where event_cn_name = #{eventCnName} and track_event = 'START'")
|
||||
List<Event> selectByName(@Param("eventCnName") String eventCnName);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.PassengerFlow;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface PassengerFlowlMapper extends BaseDao<PassengerFlow> {
|
||||
void batchSave(List<Map> list);
|
||||
PassengerFlow getByMaxId();
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.Project;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ProjectMapper extends BaseDao<Project> {
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.RoadData;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName RoadDataMapper.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月11日 11:10:00
|
||||
*/
|
||||
@Mapper
|
||||
public interface RoadDataMapper extends BaseDao<RoadData> {
|
||||
public void batchSave(List<Map> list);
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.Sanitation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName SanitationMapper.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月19日 11:24:00
|
||||
*/
|
||||
@Mapper
|
||||
public interface SanitationMapper extends BaseDao<Sanitation> {
|
||||
void batchSave(@Param("list") List<Map> list);
|
||||
void batchSaveSanitationRoad(@Param("list") List<Map> list);
|
||||
void batchSaveSanitationTask(@Param("list") List<Map> list);
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.SanitationTask;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName sanitationTaskMapper.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月20日 17:54:00
|
||||
*/
|
||||
@Mapper
|
||||
public interface SanitationTaskMapper extends BaseDao<SanitationTask> {
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.dto.ScenicCameraDto;
|
||||
import io.renren.modules.monitor.entity.Camera;
|
||||
import io.renren.modules.monitor.entity.Scenic;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ScenicMapper extends BaseDao<Scenic> {
|
||||
|
||||
//带去重
|
||||
@Select("select cam.* from t_camera cam, (SELECT DISTINCT camera_id FROM t_scenic_mtm_camera) sc WHERE cam.`code` = sc.camera_id")
|
||||
List<Camera> selectCamerasInScenic();
|
||||
|
||||
//不去重,按景区纬度提取摄像头
|
||||
@Select("select ts.*,cam.*,cs.person_num from t_scenic_mtm_camera sc JOIN t_camera cam ON cam.`code` = sc.camera_id JOIN t_scenic ts ON ts.id = sc.scenic_id LEFT JOIN t_camera_scenic cs ON cam.`code` = cs.camera_id")
|
||||
List<ScenicCameraDto> selectScenicCameras();
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.SedimentTrail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName sedimentTrailMapper.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月09日 13:59:00
|
||||
*/
|
||||
@Mapper
|
||||
public interface SedimentTrailMapper extends BaseDao<SedimentTrail> {
|
||||
public void batchaSave(List<Map> list);
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package io.renren.modules.monitor.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.monitor.entity.TrailSanitation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface TrailSanitationMapper extends BaseDao<TrailSanitation> {
|
||||
public void batchaSave(List<Map> list);
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
package io.renren.modules.monitor.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.renren.modules.monitor.entity.BuildingRecords;
|
||||
import io.renren.modules.monitor.mapper.BuildingRecordsMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName BuildingRecordsService.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月17日 15:33:00
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BuildingRecordsService {
|
||||
@Autowired
|
||||
private BuildingRecordsMapper buildingRecordsMapper;
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
private String url = "http://scxjsw.qingdao.gov.cn/monitorData/real-time";
|
||||
|
||||
public List<Map> getRecords(){
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("appid","");
|
||||
map.put("timestamp","");
|
||||
map.put("sign","");
|
||||
map.put("data","");
|
||||
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
List<Map> maps = new ArrayList<>();
|
||||
try{
|
||||
responseEntity = restTemplate.postForEntity(url,map,JSONObject.class);
|
||||
if (responseEntity.getStatusCodeValue() == 200) {
|
||||
JSONObject result = responseEntity.getBody();
|
||||
if(result.getIntValue("code") == 0){
|
||||
JSONArray jsonArray = result.getJSONArray("data");
|
||||
if(jsonArray != null){
|
||||
maps = JSONObject.parseArray(JSONArray.toJSONString(jsonArray),Map.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error("[BuildingRecordsService-getRecords] Exception:"+e.getMessage());
|
||||
}
|
||||
|
||||
return maps;
|
||||
}
|
||||
|
||||
public boolean getAndSaveRecords(){
|
||||
List<Map> maps = this.getRecords();
|
||||
boolean result = false;
|
||||
|
||||
if(maps.size() > 0){
|
||||
List<List<Map>> lists = Lists.partition(maps,200);
|
||||
try{
|
||||
lists.forEach(l->buildingRecordsMapper.batchSave(l));
|
||||
result = true;
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error("[BuildingRecordsService-getAndSaveRecords] Exception:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<BuildingRecords> listRecords(String pushTime){
|
||||
QueryWrapper<BuildingRecords> wrapper = new QueryWrapper<>();
|
||||
wrapper.like("push_time",pushTime);
|
||||
List<BuildingRecords> list = new ArrayList<>();
|
||||
list = buildingRecordsMapper.selectList(wrapper);
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package io.renren.modules.monitor.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.renren.modules.monitor.entity.BuildingSite;
|
||||
import io.renren.modules.monitor.mapper.BuildingSiteMapper;
|
||||
import io.renren.modules.monitor.utils.LongLatUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName BuildingSitrService.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月12日 13:58:00
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BuildingSiteService {
|
||||
@Autowired
|
||||
private BuildingSiteMapper buildingSiteMapper;
|
||||
|
||||
public List<BuildingSite> listBuildingSiteByPoints(double longitude, double latitude, Integer radius){
|
||||
List<BuildingSite> list = new ArrayList<>();
|
||||
try{
|
||||
double[] points = LongLatUtil.getAround(longitude,latitude,radius);
|
||||
QueryWrapper<BuildingSite> wrapper = new QueryWrapper();
|
||||
wrapper.between("jd",points[0],points[2]).between("wd",points[1],points[3]);
|
||||
list = buildingSiteMapper.selectList(wrapper);
|
||||
}catch (Exception e){
|
||||
log.error("[listBuildingSiteByPoints] Exception:"+e.getMessage());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package io.renren.modules.monitor.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.renren.modules.monitor.dto.CameraChannelDto;
|
||||
import io.renren.modules.monitor.mapper.CameraChannelMapper;
|
||||
import io.renren.modules.monitor.utils.EhcacheUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.ehcache.EhCacheCacheManager;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName CameraChannelService.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月12日 09:19:00
|
||||
*/
|
||||
@Service
|
||||
public class CameraChannelService {
|
||||
@Autowired
|
||||
private CameraChannelMapper cameraChannelMapper;
|
||||
|
||||
@Autowired
|
||||
private EhCacheCacheManager ehCacheCacheManager;
|
||||
|
||||
//查询所有摄像头
|
||||
//@Cacheable(value = "fillIn")
|
||||
public String selectAll(){
|
||||
String list = (String) EhcacheUtil.getInstance().get("fillIn", "allCameraList");
|
||||
if(StringUtils.isEmpty(list)){
|
||||
List<CameraChannelDto> cameraChannelDtos = cameraChannelMapper.selectAll();
|
||||
list = JSONObject.toJSONString(cameraChannelDtos);
|
||||
EhcacheUtil.getInstance().put("fillIn", "allCameraList",list);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
package io.renren.modules.monitor.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Log4j2
|
||||
public class EventService {
|
||||
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
//1.登录
|
||||
//2.获取token
|
||||
public String shangtangToken () {
|
||||
String url = "http://10.132.191.54:10270/whale-open-api/tenant/token";
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("accessKey","a1ddCV7z7Jhv0SBGx5O3hblO");
|
||||
map.put("secretKey","glIixzORLgoFJz0VdF1aXICR");
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try {
|
||||
responseEntity = restTemplate.postForEntity(url,map,JSONObject.class);
|
||||
JSONObject body = responseEntity.getBody();
|
||||
JSONObject data = body.getJSONObject("data");
|
||||
String token = data.getString("token");
|
||||
log.info("get token:{}", body.toJSONString());
|
||||
return token;
|
||||
} catch (Exception e) {
|
||||
log.info("[shangtangToken] exception:{}", e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//订阅任务下发接口
|
||||
public JSONObject subscribe(){
|
||||
String token = this.shangtangToken();
|
||||
String url = "http://10.132.191.54:10270/whale-open-api/subscribe";
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
|
||||
headers.add("token", token);
|
||||
headers.add("tid","default");
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("callBackUrl","http://15.2.23.205:7009/STapi/project/receive");
|
||||
// map.put("certPubKey","");
|
||||
map.put("subscribeType",3);
|
||||
// map.put("taskId","serial");
|
||||
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(map), headers);
|
||||
try {
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.POST,entity,JSONObject.class);
|
||||
JSONObject body = responseEntity.getBody();
|
||||
return body;
|
||||
}catch (Exception e){
|
||||
log.info( "[subscribe] exception:{}",e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//事件模板分页查询接口
|
||||
public JSONObject template(){
|
||||
String token = this.shangtangToken();
|
||||
String url = "http://10.132.191.54:10270/whale-open-api/scenario/event/template?pageNum=1&pageSize=1000";
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("token",token);
|
||||
headers.add("tid","default");
|
||||
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try {
|
||||
responseEntity = restTemplate.exchange(url,HttpMethod.GET,new HttpEntity<>(headers),JSONObject.class);
|
||||
JSONObject jsonObject = responseEntity.getBody();
|
||||
return jsonObject;
|
||||
} catch (Exception e) {
|
||||
log.info("[template] exception:{}", e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,283 @@
|
|||
package io.renren.modules.monitor.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.renren.modules.monitor.entity.PassengerFlow;
|
||||
import io.renren.modules.monitor.mapper.PassengerFlowlMapper;
|
||||
import io.renren.modules.monitor.utils.LongLatUtil;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.DigestUtils;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName PassengerFlowService.java
|
||||
* @Description 实时客流service
|
||||
* @createTime 2022年05月10日 14:45:00
|
||||
*/
|
||||
@Service
|
||||
@Log4j2
|
||||
public class PassengerFlowService {
|
||||
@Autowired
|
||||
private PassengerFlowlMapper passengerFlowMapper;
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
//实时客流相关参数
|
||||
@Value("202204141052331249fcc8-046")
|
||||
private String APIKEY;
|
||||
@Value("apitest")
|
||||
private String appId;
|
||||
@Value("7eb78b134e0310904d46039ccea20c32")
|
||||
private String appSecret;
|
||||
|
||||
|
||||
/**
|
||||
* 最新的实时客流
|
||||
* @param
|
||||
* @return List
|
||||
*/
|
||||
//{"APIKEY":"202204141052331249fcc8-046","ParamJson":{"data":"{\"appId\":\"apitest\",\"mac\":\"f51093001255129b88deba6c5045ee26\",\"timeStamp\":\"20220510152759\",\"hourId\":\"2022051013\",\"timeId\":\"202205101300\"}"}}
|
||||
public List<Map> passengerFlow(){
|
||||
//JSONObject map = new JSONObject();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
//MultiValueMap<String,Object> map = new LinkedMultiValueMap<>();
|
||||
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||
|
||||
LocalDateTime dateNow = LocalDateTime.now();
|
||||
String timeStamp = dateNow.format(dateTimeFormatter1);//yyyyMMddHHmmss
|
||||
String[] tt = this.newMinusMinutesStr(dateNow);
|
||||
|
||||
String url = "http://15.72.158.72:8081/getway/api/Proxy/HandleByKey/1249fcc8-0466-4897-87b4-d2111a9baf4f";
|
||||
map.put("APIKEY",APIKEY);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("appId",appId);
|
||||
//安全认证 MD5(appId+”-”+timeStamp+”-”+ appSecret)
|
||||
String code = appId+"-"+timeStamp+"-"+ appSecret;
|
||||
String md5Str = DigestUtils.md5DigestAsHex(code.getBytes(StandardCharsets.UTF_8));
|
||||
jsonObject.put("mac",md5Str);
|
||||
jsonObject.put("timeStamp",timeStamp);
|
||||
jsonObject.put("hourId",tt[1]);
|
||||
jsonObject.put("timeId",tt[0]);
|
||||
//jsonObject.put("apiType","***");
|
||||
JSONObject para = new JSONObject();
|
||||
para.put("data",JSONObject.toJSONString(jsonObject));
|
||||
map.put("ParamJson",para);
|
||||
|
||||
System.out.println("multimap->"+map.toString());
|
||||
log.info("[passengerFlow] ->",map.toString());
|
||||
ResponseEntity<String> responseEntity;
|
||||
List<Map> list = new ArrayList<>();
|
||||
try{
|
||||
responseEntity = restTemplate.postForEntity(url,map,String.class);
|
||||
//System.out.println(responseEntity.getStatusCodeValue());
|
||||
if(responseEntity.getStatusCodeValue() == 200){
|
||||
String result = responseEntity.getBody();
|
||||
//System.out.println("passengerFlow ->"+result);
|
||||
JSONObject jsonResult = JSONObject.parseObject(result);
|
||||
System.out.println(jsonResult.keySet().toString());
|
||||
if(jsonResult.getIntValue("code") == 0){
|
||||
JSONArray jsonArray = jsonResult.getJSONArray("result");
|
||||
list = JSONObject.parseArray(JSONObject.toJSONString(jsonArray),Map.class);
|
||||
}
|
||||
}
|
||||
} catch (Exception e){
|
||||
log.error("[passengerFlow] Exception:"+e.getMessage());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
//从表中获取最新的实时客流
|
||||
public List<PassengerFlow> listPassengerFlow(String timeId){
|
||||
List<PassengerFlow> lists = new ArrayList<>();
|
||||
long longTimeId = Long.valueOf(timeId);
|
||||
if(longTimeId == 1970000000){
|
||||
PassengerFlow passengerFlow = passengerFlowMapper.getByMaxId();
|
||||
timeId = passengerFlow.getTimeId();
|
||||
}
|
||||
QueryWrapper<PassengerFlow> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("time_id",timeId);
|
||||
lists = passengerFlowMapper.selectList(wrapper);
|
||||
|
||||
return lists;
|
||||
}
|
||||
//从表中获取获取最新的实时客流,并筛选出all_nums>=5000,并desc排序
|
||||
public List<PassengerFlow> listPassengerFlowByAllNums(){
|
||||
List<PassengerFlow> lists = new ArrayList<>();
|
||||
String timeId = passengerFlowMapper.getByMaxId().getTimeId();
|
||||
QueryWrapper<PassengerFlow> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("time_id",timeId).ge("all_nums",5000).orderByDesc("all_nums");
|
||||
lists = passengerFlowMapper.selectList(wrapper);
|
||||
return lists;
|
||||
|
||||
}
|
||||
@Scheduled(cron = "0 31 10-22/1 * * ? ")
|
||||
//提供的接口能查到当前时间2个小时之前的数据,每隔15分钟一次,我们只取整点从早8点到晚8点的整点数据
|
||||
//10:31 到晚上10:31,每小时的31分执行一次
|
||||
public void passengerFlowSchedule(){
|
||||
//JSONObject map = new JSONObject();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
//MultiValueMap<String,Object> map = new LinkedMultiValueMap<>();
|
||||
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||
|
||||
LocalDateTime dateNow = LocalDateTime.now();
|
||||
String timeStamp = dateNow.format(dateTimeFormatter1);//yyyyMMddHHmmss
|
||||
String[] tt = this.minusMinutesStr(dateNow,120);
|
||||
|
||||
String url = "http://15.72.158.72:8081/getway/api/Proxy/HandleByKey/1249fcc8-0466-4897-87b4-d2111a9baf4f";
|
||||
map.put("APIKEY",APIKEY);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("appId",appId);
|
||||
//安全认证 MD5(appId+”-”+timeStamp+”-”+ appSecret)
|
||||
String code = appId+"-"+timeStamp+"-"+ appSecret;
|
||||
String md5Str = DigestUtils.md5DigestAsHex(code.getBytes(StandardCharsets.UTF_8));
|
||||
jsonObject.put("mac",md5Str);
|
||||
jsonObject.put("timeStamp",timeStamp);
|
||||
jsonObject.put("hourId",tt[1]);
|
||||
jsonObject.put("timeId",tt[0]);
|
||||
//jsonObject.put("apiType","***");
|
||||
JSONObject para = new JSONObject();
|
||||
para.put("data",JSONObject.toJSONString(jsonObject));
|
||||
map.put("ParamJson",para);
|
||||
|
||||
System.out.println("multimap->"+map.toString());
|
||||
ResponseEntity<String> responseEntity;
|
||||
List<Map> list = new ArrayList<>();
|
||||
try{
|
||||
responseEntity = restTemplate.postForEntity(url,map,String.class);
|
||||
//System.out.println(responseEntity.getStatusCodeValue());
|
||||
if(responseEntity.getStatusCodeValue() == 200){
|
||||
String result = responseEntity.getBody();
|
||||
//System.out.println("passengerFlow ->"+result);
|
||||
JSONObject jsonResult = JSONObject.parseObject(result);
|
||||
System.out.println(jsonResult.keySet().toString());
|
||||
if(jsonResult.getIntValue("code") == 0){
|
||||
JSONArray jsonArray = jsonResult.getJSONArray("result");
|
||||
list = JSONObject.parseArray(JSONObject.toJSONString(jsonArray),Map.class);
|
||||
List<List<Map>> lists = Lists.partition(list,200);
|
||||
lists.forEach(ll ->passengerFlowMapper.batchSave(ll));
|
||||
}
|
||||
}
|
||||
} catch (Exception e){
|
||||
log.error("[passengerFlowSchedule] Exception:"+e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
//保存实时客流
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean savePassengerFlow(List<Map> maps){
|
||||
List<List<Map>> lists = Lists.partition(maps,200);
|
||||
try{
|
||||
lists.forEach(list ->passengerFlowMapper.batchSave(list));
|
||||
return true;
|
||||
}catch (Exception e){
|
||||
log.error("[savePassengerFlow] Exception:"+e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//根据半径,一个经纬度和timeId查询游客总数
|
||||
public JSONObject passengerNums(double longitude, double latitude, Integer radius,String timeId){
|
||||
QueryWrapper<PassengerFlow> wrapper = new QueryWrapper<>();
|
||||
if(Double.doubleToLongBits(longitude) == Double.doubleToLongBits(0.00) || Double.doubleToLongBits(latitude) == Double.doubleToLongBits(0.00)){
|
||||
wrapper.eq("time_id",timeId);
|
||||
}else{
|
||||
double[] points = LongLatUtil.getAround(longitude,latitude,radius);
|
||||
wrapper.eq("time_id",timeId).between("longitude",points[0],points[2]).between("latitude",points[1],points[3]);
|
||||
}
|
||||
|
||||
int allCount = 0;
|
||||
int localCount = 0;
|
||||
int nonLocalCount = 0;
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
try{
|
||||
List<PassengerFlow> list = passengerFlowMapper.selectList(wrapper);
|
||||
for(PassengerFlow p:list){
|
||||
allCount+=p.getAllNums();
|
||||
localCount+=p.getLocalNums();
|
||||
nonLocalCount+=p.getNonlocalNums();
|
||||
}
|
||||
result.put("local_nums",localCount);
|
||||
result.put("nonlocal_nums",nonLocalCount);
|
||||
result.put("all_nums",allCount);
|
||||
}catch (Exception e){
|
||||
log.error("[passengerNums] Exception:"+e.getMessage());
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//当前时间减去固定的分钟数,然后分钟取30
|
||||
private String[] minusMinutesStr(LocalDateTime datetime,long minutes){
|
||||
String t1,t2;//t1 yyyyMMddHHmm t2 yyyyMMddHH
|
||||
LocalDateTime minus = datetime.minus(minutes, ChronoUnit.MINUTES);
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm");
|
||||
DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyyMMddHH");
|
||||
String time1 = minus.format(dateTimeFormatter);
|
||||
System.out.println(time1);
|
||||
String mm = time1.substring(time1.length() -2,time1.length());
|
||||
System.out.println(mm);
|
||||
if(0 < Integer.parseInt(mm) &&Integer.parseInt(mm)>=30){
|
||||
t1 = time1.substring(0,time1.length() -2)+"00";
|
||||
}else if(Integer.parseInt(mm)<30){
|
||||
LocalDateTime lastHour = LocalDateTime.parse(time1,dateTimeFormatter).plus(1,ChronoUnit.HOURS);
|
||||
t1 = lastHour.format(dateTimeFormatter2)+"00";
|
||||
}else{
|
||||
t1 = time1;
|
||||
}
|
||||
|
||||
t2 = t1.substring(0,t1.length()-2);
|
||||
System.out.println("t1->"+t1+"...t2->"+t2);
|
||||
return new String[]{t1,t2};
|
||||
}
|
||||
|
||||
//查询出最新有游客数据的时间点
|
||||
private String[] newMinusMinutesStr(LocalDateTime datetime){
|
||||
String t1,t2;//t1 yyyyMMddHHmm t2 yyyyMMddHH
|
||||
LocalDateTime minus = datetime.minus(125, ChronoUnit.MINUTES);
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm");
|
||||
DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyyMMddHH");
|
||||
String time1 = minus.format(dateTimeFormatter);
|
||||
System.out.println(time1);
|
||||
String mm = time1.substring(time1.length() -2,time1.length());
|
||||
System.out.println(mm);
|
||||
|
||||
Integer i = Integer.parseInt(mm)/15;
|
||||
if(i == 0){
|
||||
t1 = time1.substring(0,time1.length() -2)+"00";
|
||||
}else{
|
||||
t1 = time1.substring(0,time1.length() -2)+String.valueOf(15*i);
|
||||
}
|
||||
// if(0 < Integer.parseInt(mm) &&Integer.parseInt(mm)<=30){
|
||||
// t1 = time1.substring(0,time1.length() -2)+"00";
|
||||
// }else if(Integer.parseInt(mm) > 30){
|
||||
// LocalDateTime lastHour = LocalDateTime.parse(time1,dateTimeFormatter).plus(1,ChronoUnit.HOURS);
|
||||
// t1 = lastHour.format(dateTimeFormatter2)+"30";
|
||||
// }else{
|
||||
// t1 = time1;
|
||||
// }
|
||||
|
||||
t2 = t1.substring(0,t1.length()-2);
|
||||
System.out.println("t1->"+t1+"...t2->"+t2);
|
||||
return new String[]{t1,t2};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
package io.renren.modules.monitor.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.renren.modules.monitor.entity.RoadData;
|
||||
import io.renren.modules.monitor.mapper.RoadDataMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName RoadDataService.java
|
||||
* @Description 道路统计数据service,道路污染
|
||||
* @createTime 2022年05月11日 11:09:00
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class RoadDataService {
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
@Autowired
|
||||
private RoadDataMapper roadDataMapper;
|
||||
|
||||
//道路统计数据与排名(道路污染),调用公开接口并保存到表t_road_data
|
||||
@Scheduled(cron="0 0 8 * * ?")
|
||||
public void saveRoadData(){
|
||||
String url = "http://outerdata.novaecs.com/api/qingdaoData/roadData?groupId={groupId}&timeType={timeType}&dt={dt}";
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
|
||||
map.put("dt",this.dateTimeStr());
|
||||
map.put("groupId",1);
|
||||
map.put("timeType","日");
|
||||
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
List<Map> list = new ArrayList<>();
|
||||
try {
|
||||
responseEntity = restTemplate.getForEntity(url, JSONObject.class, map);
|
||||
HttpStatus statusCode = responseEntity.getStatusCode();
|
||||
if (statusCode.is2xxSuccessful()) {
|
||||
JSONObject re = responseEntity.getBody();
|
||||
if (re.getIntValue("status") == 0) {
|
||||
JSONArray jsonArray = re.getJSONArray("data");
|
||||
list = JSONArray.parseArray(JSONObject.toJSONString(jsonArray), Map.class);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("[roadData] exception:{}", e.getMessage());
|
||||
}
|
||||
if(list.size() > 0){
|
||||
List<Map> maps = list.stream().map(l->{
|
||||
l.put("points",JSONObject.toJSONString(l.get("points")));
|
||||
l.put("dt",this.dateTimeStr());
|
||||
return l;
|
||||
}).collect(Collectors.toList());
|
||||
List<List<Map>> lists = Lists.partition(maps,200);
|
||||
lists.forEach(ll->roadDataMapper.batchSave(ll));
|
||||
}
|
||||
}
|
||||
|
||||
//根据日期查询道路污染数据
|
||||
public List<RoadData> listRoadData(String dt){
|
||||
QueryWrapper<RoadData> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("dt",dt);
|
||||
List<RoadData> list = roadDataMapper.selectList(wrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<RoadData> listRoadDataByTimeRegion(String start,String end){
|
||||
QueryWrapper<RoadData> wrapper = new QueryWrapper<>();
|
||||
wrapper.between("dt",start,end);
|
||||
List<RoadData> list = roadDataMapper.selectList(wrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
//获取当前日期的时间串,2022-05-08 00:00:00
|
||||
private String dateTimeStr(){
|
||||
LocalDate localDate = LocalDate.now();
|
||||
LocalDate yestDay = localDate.minusDays(1);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime dateTime = LocalDateTime.of(yestDay.getYear(),yestDay.getMonth(),yestDay.getDayOfMonth(),0,0,0);
|
||||
return dateTime.format(formatter);
|
||||
}
|
||||
|
||||
//获取当前日期的时间串,2022-05-08
|
||||
private String dateStr(){
|
||||
LocalDate localDate = LocalDate.now();
|
||||
LocalDate yestDay = localDate.minusDays(1);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
|
||||
return yestDay.format(formatter);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,221 @@
|
|||
package io.renren.modules.monitor.service;
|
||||
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.renren.modules.monitor.entity.CaseCityLaw;
|
||||
import io.renren.modules.monitor.entity.Result;
|
||||
import io.renren.modules.monitor.mapper.CaseCityLawMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName SJZTService.java
|
||||
* @Description 数交中台service,城市执法
|
||||
* @createTime 2022年05月12日 18:00:00
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SJZTService {
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
@Autowired
|
||||
private CaseCityLawMapper caseCityLawMapper;
|
||||
|
||||
//数交中台
|
||||
//1.登录
|
||||
public String sjztToken () {
|
||||
String url = "http://120.221.95.13:9090/apin/authorization/oauth/token";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Basic dGVzdF9jbGllbnQ6ZTk4OWQ0NmZkYmMxYzM3NmMxOWE0M2FhZjg1MjI3YTQ=");
|
||||
headers.add("Content-Type", "application/x-www-form-urlencoded");
|
||||
|
||||
MultiValueMap map = new LinkedMultiValueMap();
|
||||
map.add("username", "qdsyn");
|
||||
String sigin = SecureUtil.md5("Qdsyn123!");
|
||||
map.add("password", sigin);//Qdsyn123!,需要MD5加密
|
||||
map.add("scope", "read");
|
||||
map.add("grant_type", "password");
|
||||
map.add("vc", "NO");
|
||||
|
||||
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(map, headers);
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try {
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.POST, request, JSONObject.class);
|
||||
JSONObject jsonObject = responseEntity.getBody();
|
||||
if (jsonObject.getBooleanValue("success") == true) {
|
||||
JSONObject resultJson = jsonObject.getJSONObject("result");
|
||||
return resultJson.getString("accessToken");
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("[qidiToken] exception:{}", e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//从接口获取案件数据
|
||||
public List<Map> listSJZTDatas() {
|
||||
String token = this.sjztToken();
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Bearer " + token);
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
JSONObject search = new JSONObject();
|
||||
search.put("opt","LIKE");
|
||||
search.put("key","WTLYMC");
|
||||
// search.put("val",this.dateStr());
|
||||
search.put("val","微信举报");
|
||||
|
||||
map.put("json",search);
|
||||
int i = 1;
|
||||
int roundCount = 0;
|
||||
int count = 0;
|
||||
List<Map> maps = new ArrayList<>();
|
||||
do{
|
||||
String url = "http://120.221.95.13:9090/catalog/resCatalogApply/getData/UC_QUERY_QDZWT_307013311122000064_1?pageSize=10000&pageNo={1}&search=[{2}]";
|
||||
//String url = "http://120.221.95.13:9090/catalog/resCatalogApply/getData/UC_QUERY_QDZWT_307013311122000064_1?pageSize=1&pageNo=1&search={json}";
|
||||
HttpEntity<Map> httpEntity = new HttpEntity<>(null, headers);
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try {
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, JSONObject.class,i,search);
|
||||
|
||||
JSONObject jsonObject = responseEntity.getBody();
|
||||
count = jsonObject.getIntValue("count");
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("list");
|
||||
maps.addAll(JSONObject.parseArray(JSONObject.toJSONString(jsonArray), Map.class));
|
||||
i++;
|
||||
roundCount = i*10000;
|
||||
} catch (Exception e) {
|
||||
log.info("[listSJZTDatas] exception:{}", e.getMessage());
|
||||
return null;
|
||||
}
|
||||
} while(roundCount <=count);
|
||||
|
||||
log.info("[listSJZTDatas] 返回数据的数量:{}",maps.size());
|
||||
return maps;
|
||||
}
|
||||
|
||||
//从接口获取案件数据并保存
|
||||
public void batchSave(){
|
||||
String token = this.sjztToken();
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Authorization", "Bearer " + token);
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
JSONObject search = new JSONObject();
|
||||
search.put("opt","LIKE");
|
||||
search.put("key","AJJLSJ");
|
||||
// search.put("val",this.dateStr());
|
||||
search.put("val","2017");
|
||||
|
||||
map.put("json",search);
|
||||
int i = 1;
|
||||
int roundCount = 0;
|
||||
int count = 0;
|
||||
List<Map> mapList = new ArrayList<>();
|
||||
do{
|
||||
String url = "http://120.221.95.13:9090/catalog/resCatalogApply/getData/UC_QUERY_QDZWT_307013311122000064_1?pageSize=10000&pageNo={1}&search=[{2}]";
|
||||
//String url = "http://120.221.95.13:9090/catalog/resCatalogApply/getData/UC_QUERY_QDZWT_307013311122000064_1?pageSize=1&pageNo=1&search={json}";
|
||||
HttpEntity<Map> httpEntity = new HttpEntity<>(null, headers);
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try {
|
||||
responseEntity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, JSONObject.class,i,search);
|
||||
|
||||
JSONObject jsonObject = responseEntity.getBody();
|
||||
count = jsonObject.getIntValue("count");
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("list");
|
||||
mapList.addAll(JSONObject.parseArray(JSONObject.toJSONString(jsonArray), Map.class));
|
||||
i++;
|
||||
roundCount = i*10000;
|
||||
} catch (Exception e) {
|
||||
log.info("[SJZTService-batchSave] exception:{}", e.getMessage());
|
||||
}
|
||||
} while(roundCount <=count);
|
||||
System.out.println(mapList.size());
|
||||
|
||||
IdentifierGenerator identifierGenerator=new DefaultIdentifierGenerator();
|
||||
mapList.forEach(m-> m.put("id",identifierGenerator.nextId(new Object())));//给id赋值
|
||||
|
||||
List<List<Map>> lists = Lists.partition(mapList,50);
|
||||
try{
|
||||
lists.forEach(l->caseCityLawMapper.batchSave(l));
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error("[SJZTService batchsave Exception]:",e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<CaseCityLaw> listSJZTByDt(String ajjlsj){
|
||||
QueryWrapper<CaseCityLaw> wrapper = new QueryWrapper<>();
|
||||
wrapper.like("ajjlsj",ajjlsj);
|
||||
return caseCityLawMapper.selectList(wrapper);
|
||||
}
|
||||
|
||||
public Result upStream(JSONObject data){
|
||||
String url = "?actionType={1}&senderCode={2}&data={3}";
|
||||
String senderCode = "";//发送方标识
|
||||
String actionType = "UP_REC_REPORT";//调用方法,固定值
|
||||
boolean result = false;
|
||||
|
||||
ResponseEntity<JSONObject> responseEntity;
|
||||
try{
|
||||
responseEntity = restTemplate.postForEntity(url, null, JSONObject.class,senderCode,actionType,data);
|
||||
JSONObject responseJSON = responseEntity.getBody();
|
||||
if(responseEntity.getStatusCodeValue() == 200){
|
||||
if(responseJSON.getBooleanValue("success") && responseJSON.getIntValue("code") == 0){
|
||||
return Result.success(responseJSON.get("data"));
|
||||
}else{
|
||||
return Result.error(responseJSON.getString("data"));
|
||||
}
|
||||
}else{
|
||||
return Result.error(String.valueOf(responseEntity.getStatusCodeValue()));
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error("[SJZTService upStream] Exception:"+e.getMessage());
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//获取当前日期的时间串,2022-05-08 00:00:00
|
||||
private String dateTimeStr(){
|
||||
LocalDate localDate = LocalDate.now();
|
||||
LocalDate yestDay = localDate.minusDays(1);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime dateTime = LocalDateTime.of(yestDay.getYear(),yestDay.getMonth(),yestDay.getDayOfMonth(),0,0,0);
|
||||
return dateTime.format(formatter);
|
||||
}
|
||||
//获取当前日期的时间串,2022-05-08
|
||||
private String dateStr(){
|
||||
LocalDate localDate = LocalDate.now();
|
||||
LocalDate yestDay = localDate.minusDays(1);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
|
||||
return yestDay.format(formatter);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package io.renren.modules.monitor.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.renren.modules.monitor.entity.Result;
|
||||
import io.renren.modules.monitor.entity.SanitationTask;
|
||||
import io.renren.modules.monitor.mapper.SanitationMapper;
|
||||
import io.renren.modules.monitor.mapper.SanitationTaskMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName SanitationService.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月19日 11:23:00
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SanitationService {
|
||||
@Autowired
|
||||
private SanitationMapper sanitationMapper;
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
@Autowired
|
||||
private MonitorService monitorService;
|
||||
@Autowired
|
||||
private SanitationTaskMapper sanitationTaskMapper;
|
||||
|
||||
|
||||
public Result saveSantation(){
|
||||
List<Map> list = monitorService.resCatalogApplyHJWSBase();
|
||||
if(list.size() > 0){
|
||||
List<List<Map>> maps = Lists.partition(list,100);
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Result saveSanitationRoad(){
|
||||
List<Map> list = monitorService.resCatalogApplyHJWSRoad();
|
||||
try{
|
||||
if(list.size() > 0){
|
||||
List<List<Map>> maps = Lists.partition(list,100);
|
||||
maps.forEach(m->sanitationMapper.batchSaveSanitationRoad(m));
|
||||
}
|
||||
return Result.success();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error("[SanitationService saveSanitationRoad] Exception:"+e.getMessage());
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public Result saveSanitationTask(){
|
||||
List<Map> list = monitorService.resCatalogApplyHJWSZY();
|
||||
try{
|
||||
if(list.size() > 0){
|
||||
List<List<Map>> maps = Lists.partition(list,100);
|
||||
maps.forEach(m->sanitationMapper.batchSaveSanitationTask(m));
|
||||
}
|
||||
return Result.success();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error("[SanitationService saveSanitationTask] Exception:"+e.getMessage());
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//批量查询环卫车作业数据并保存,可以根据实际需求更改
|
||||
@Scheduled(cron = "0 0 8 * * ?")
|
||||
public void saveSanitationTaskScheduled(){
|
||||
QueryWrapper<SanitationTask> wrapper = new QueryWrapper<>();
|
||||
wrapper.orderByDesc("updatetime");
|
||||
SanitationTask sanitationTask = sanitationTaskMapper.selectOne(wrapper);
|
||||
List<Map> maps = new ArrayList<>();
|
||||
|
||||
try{
|
||||
if(sanitationTask != null){
|
||||
maps = monitorService.resCatalogApplyHJWSZY(String.valueOf(sanitationTask.getUpdatetime()));
|
||||
|
||||
}else{
|
||||
maps = monitorService.resCatalogApplyHJWSZY();
|
||||
}
|
||||
|
||||
if(maps.size() > 0){
|
||||
List<List<Map>> lists = Lists.partition(maps,100);
|
||||
lists.forEach(list->sanitationMapper.batchSaveSanitationTask(list));
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error("[SanitationService saveSanitationTaskScheduled] Exception:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package io.renren.modules.monitor.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.renren.modules.monitor.entity.SedimentTrail;
|
||||
import io.renren.modules.monitor.mapper.SedimentTrailMapper;
|
||||
import io.renren.modules.monitor.utils.LongLatUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName SedimentTrailService.java
|
||||
* @Description 渣土车service
|
||||
* @createTime 2022年05月09日 14:01:00
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SedimentTrailService {
|
||||
@Autowired
|
||||
private SedimentTrailMapper sedimentTrailMapper;
|
||||
|
||||
@Autowired
|
||||
private MonitorService monitorService;
|
||||
|
||||
//获取渣土车轨迹并保存到表t_trail_sediment
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean batchSaveSedimentTrail(){
|
||||
try{
|
||||
List<Map> maps = monitorService.resCatalogApplyZTYS();
|
||||
Lists.partition(maps,200).forEach(
|
||||
item-> sedimentTrailMapper.batchaSave(item)
|
||||
);
|
||||
return true;
|
||||
}catch (Exception e){
|
||||
log.error("[batchSaveSedimentTrail] exception:{}",e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据输入的经纬度和查询的半径(米)查询范围内的渣土车轨迹信息
|
||||
* @param longitude(经度) latitude(纬度) radius(米) start(时间) end(时间)
|
||||
*
|
||||
*/
|
||||
public Map<String,List<SedimentTrail>> listSedimentTrailByPoints(double longitude, double latitude, Integer radius, String start, String end){
|
||||
double[] points = LongLatUtil.getAround(longitude,latitude,radius);
|
||||
QueryWrapper<SedimentTrail> wrapper = new QueryWrapper<>();
|
||||
wrapper.between("update_time",start,end).between("longitude",points[0],points[2]).between("latitude",points[1],points[3])
|
||||
.orderByAsc("sim_card_num","record_time");
|
||||
List<Map> maps = new ArrayList<>();
|
||||
Map<String, List<SedimentTrail>> map = new HashMap<>();
|
||||
try{
|
||||
List<SedimentTrail> list = sedimentTrailMapper.selectList(wrapper);
|
||||
map = list.stream().collect(Collectors.groupingBy(SedimentTrail::getSimCardNum));
|
||||
|
||||
}catch (Exception e){
|
||||
log.error("[listSedimentTrailByPoints] Exception:",e.getMessage());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package io.renren.modules.monitor.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.renren.modules.monitor.entity.TrailSanitation;
|
||||
import io.renren.modules.monitor.mapper.TrailSanitationMapper;
|
||||
import io.renren.modules.monitor.utils.LongLatUtil;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Log4j2
|
||||
public class TrailSanitationService {
|
||||
@Autowired
|
||||
private TrailSanitationMapper trailSanitationMapper;
|
||||
@Autowired
|
||||
private MonitorService monitorService;
|
||||
|
||||
public boolean saveTrailSanitation(){
|
||||
boolean result = false;
|
||||
try{
|
||||
List<Map> list = monitorService.resCatalogApplyHJWS();
|
||||
List<List<Map>> lists = Lists.partition(list,200);
|
||||
lists.forEach(l->trailSanitationMapper.batchaSave(l));
|
||||
result = true;
|
||||
}catch (Exception e){
|
||||
log.error("[saveTrailSanitation] Exception:",e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据输入的经纬度和查询的半径(米)查询范围内的环卫车轨迹信息
|
||||
* @param longitude(经度) latitude(纬度) raidus(米) start(时间) end(时间)
|
||||
*
|
||||
*/
|
||||
public List<TrailSanitation> listSedimentTrailByPoints(double longitude, double latitude, Integer radius, String start, String end){
|
||||
double[] points = LongLatUtil.getAround(longitude,latitude,radius);
|
||||
QueryWrapper<TrailSanitation> wrapper = new QueryWrapper<>();
|
||||
wrapper.between("fssj",start,end).between("jd",points[0],points[2]).between("wd",points[1],points[3]);
|
||||
return trailSanitationMapper.selectList(wrapper);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package io.renren.modules.monitor.utils;
|
||||
|
||||
import net.sf.ehcache.Cache;
|
||||
import net.sf.ehcache.CacheManager;
|
||||
import net.sf.ehcache.Element;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName EhcacheUtil.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月12日 10:20:00
|
||||
*/
|
||||
public class EhcacheUtil {
|
||||
private static final String path = "/ehcache.xml";
|
||||
private URL url;
|
||||
private CacheManager manager;
|
||||
private static EhcacheUtil ehCache;
|
||||
private EhcacheUtil(String path) {
|
||||
url = getClass().getResource(path);
|
||||
manager = CacheManager.create(url);
|
||||
}
|
||||
|
||||
public static EhcacheUtil getInstance() {
|
||||
if (ehCache== null) {
|
||||
ehCache= new EhcacheUtil(path);
|
||||
}
|
||||
return ehCache;
|
||||
}
|
||||
|
||||
public void put(String cacheName, String key, Object value) {
|
||||
Cache cache = manager.getCache(cacheName);
|
||||
Element element = new Element(key, value);
|
||||
cache.put(element);
|
||||
}
|
||||
|
||||
public Object get(String cacheName, String key) {
|
||||
Cache cache = manager.getCache(cacheName);
|
||||
Element element = cache.get(key);
|
||||
return element == null ? null : element.getObjectValue();
|
||||
}
|
||||
|
||||
public Cache get(String cacheName) {
|
||||
return manager.getCache(cacheName);
|
||||
}
|
||||
|
||||
public void remove(String cacheName, String key) {
|
||||
Cache cache = manager.getCache(cacheName);
|
||||
cache.remove(key);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package io.renren.modules.monitor.utils;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @version 1.0.0
|
||||
* @ClassName LongLatUtil.java
|
||||
* @Description TODO
|
||||
* @createTime 2022年05月09日 09:54:00
|
||||
*/
|
||||
public class LongLatUtil {
|
||||
private static final double PI = 3.1415926;
|
||||
/**
|
||||
* 计算地球上任意两点(经纬度)距离
|
||||
*
|
||||
* @param long1 第一点经度
|
||||
* @param lat1 第一点纬度
|
||||
* @param long2 第二点经度
|
||||
* @param lat2 第二点纬度
|
||||
* @return 返回距离 单位:米
|
||||
*/
|
||||
public static double distanceByLongNLat(double long1, double lat1, double long2, double lat2) {
|
||||
double a, b, R;
|
||||
R = 6378137;//地球半径
|
||||
lat1 = lat1 * Math.PI / 180.0;
|
||||
lat2 = lat2 * Math.PI / 180.0;
|
||||
a = lat1 - lat2;
|
||||
b = (long1 - long2) * Math.PI / 180.0;
|
||||
double d;
|
||||
double sa2, sb2;
|
||||
sa2 = Math.sin(a / 2.0);
|
||||
sb2 = Math.sin(b / 2.0);
|
||||
d = 2 * R * Math.asin(Math.sqrt(sa2 * sa2 + Math.cos(lat1) * Math.cos(lat2) * sb2 * sb2));
|
||||
return d;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据经纬度和半径计算经纬度范围
|
||||
*
|
||||
* @param raidus 单位米
|
||||
* @return minLat, minLng, maxLat, maxLng
|
||||
*/
|
||||
public static double[] getAround(double lon,double lat, int raidus) {
|
||||
|
||||
Double latitude = lat;
|
||||
Double longitude = lon;
|
||||
|
||||
Double degree = (24901 * 1609) / 360.0;
|
||||
double raidusMile = raidus;
|
||||
|
||||
Double dpmLat = 1 / degree;
|
||||
Double radiusLat = dpmLat * raidusMile;
|
||||
Double minLat = latitude - radiusLat;
|
||||
Double maxLat = latitude + radiusLat;
|
||||
|
||||
Double mpdLng = degree * Math.cos(latitude * (PI / 180));
|
||||
Double dpmLng = 1 / mpdLng;
|
||||
Double radiusLng = dpmLng * raidusMile;
|
||||
Double minLng = longitude - radiusLng;
|
||||
Double maxLng = longitude + radiusLng;
|
||||
return new double[]{minLng,minLat, maxLng, maxLat};
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ehcache updateCheck="false" name="defaultCache">
|
||||
<!-- 磁盘缓存位置 -->
|
||||
<diskStore path="java.io.tmpdir/ehcache"/>
|
||||
<!--
|
||||
maxEntriesLocalHeap:堆内存中最大缓存对象数
|
||||
eternal:对象是否永久有效,一但设置了,timeout将不起作用
|
||||
overflowToDisk:当缓存达到maxElementsInMemory值是,是否允许溢出到磁盘
|
||||
timeToIdleSeconds:当缓存闲置n秒后销毁
|
||||
timeToLiveSeconds:当缓存存活n秒后销毁
|
||||
maxEntriesLocalDisk:硬盘最大缓存个数
|
||||
diskPersistent:磁盘缓存在JVM重新启动时是否保持
|
||||
-->
|
||||
<!-- 默认缓存 -->
|
||||
<defaultCache
|
||||
maxEntriesLocalHeap="10000"
|
||||
eternal="false"
|
||||
timeToIdleSeconds="600"
|
||||
timeToLiveSeconds="600"
|
||||
maxEntriesLocalDisk="10000000"
|
||||
diskExpiryThreadIntervalSeconds="120"
|
||||
memoryStoreEvictionPolicy="LRU"/>
|
||||
|
||||
<!-- fill-in缓存 -->
|
||||
<cache name="fillIn"
|
||||
maxElementsInMemory="10000"
|
||||
eternal="false"
|
||||
timeToIdleSeconds="600"
|
||||
timeToLiveSeconds="600"
|
||||
overflowToDisk="false"
|
||||
memoryStoreEvictionPolicy="LRU"/>
|
||||
|
||||
</ehcache>
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.renren.modules.monitor.mapper.BuildingRecordsMapper">
|
||||
|
||||
<insert id="batchSave" parameterType="java.util.List">
|
||||
insert into t_building_records
|
||||
(
|
||||
project_name,build_license,push_time,appid,pm10,noice
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(
|
||||
#{item.projectName},#{item.buildLicense},#{item.pushTime},#{item.appid},
|
||||
#{item.pm10},#{item.noice}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.renren.modules.monitor.mapper.CameraChannelMapper">
|
||||
<!-- <update id="updateState" parameterType="java.util.List">-->
|
||||
<!-- <foreach collection="list" item="item" index="index" open="begin" close=";end;" separator=";">-->
|
||||
<!-- update CameraChannel set state =#{item.estAmount,jdbcType=NUMERIC}-->
|
||||
<!-- where t.licai_id = #{item.licaiId,jdbcType=NUMERIC}-->
|
||||
<!-- </foreach>-->
|
||||
|
||||
<!-- </update>-->
|
||||
|
||||
<select id="selectAll" resultType="io.renren.modules.monitor.dto.CameraChannelDto">
|
||||
select c.* from t_camera_channel c
|
||||
where (c.gps_x NOT IN('0.0','0','','-1000.0') OR c.gps_y NOT IN('0.0','0','','-1000.0'))
|
||||
AND c.status != 0 AND c.check_status != 0
|
||||
<!-- <bind name="page" value="(page-1)*pageSize"/>-->
|
||||
<!-- limit #{page},#{pageSize}-->
|
||||
</select>
|
||||
|
||||
<update id="updateCameraStatus" parameterType="java.util.List">
|
||||
<foreach collection="list" item="item" index="index" separator=";">
|
||||
update t_camera_channel set check_status = 0
|
||||
where channel_code = #{item,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectNLAll" resultType="io.renren.modules.monitor.dto.CameraChannelNLDto">
|
||||
SELECT a.label_name,d.* from t_label a RIGHT JOIN (select b.label_code,c.* from t_camera_channel c
|
||||
LEFT JOIN t_channel_mtm_label b on c.channel_code = b.channel_code) d
|
||||
on d.label_code = a.label_code
|
||||
<bind name="page" value="(page-1)*pageSize"/>
|
||||
limit #{page},#{pageSize}
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.renren.modules.monitor.mapper.CameraOrgenizationMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.renren.modules.monitor.mapper.CameraScenicMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.renren.modules.monitor.mapper.CaseCityLawMapper">
|
||||
|
||||
<insert id="batchSave" parameterType="java.util.List">
|
||||
INSERT INTO t_case_citylaw
|
||||
(id,ajjlsj,dzms,wtms,wtlybs,wtlymc,ajlxbs,ajlxmc,dlbs,dlmc,xlbs,xlmc,qbs,qmc,jdbs,
|
||||
jdmc,sqbs,sqmc,xzb,yzb,pqsj,ajjssj,ajzfsj,czsxcqjaaqjacqwjayqja,sbtpsl,cztpsl
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator="," >
|
||||
(
|
||||
#{item.id},#{item.AJJLSJ},#{item.DZMS},#{item.WTMS},#{item.WTLYBS},#{item.WTLYMC},
|
||||
#{item.AJLXBS},#{item.AJLXMC},#{item.DLBS},#{item.DLMC},#{item.XLBS},
|
||||
#{item.XLMC},#{item.QBS},#{item.QMC},#{item.JDBS},#{item.JDMC},#{item.SQBS},
|
||||
#{item.SQMC},#{item.XZB},#{item.YZB},#{item.PQSJ},#{item.AJJSSJ},#{item.AJZFSJ},
|
||||
#{item.CZSXCQJAAQJACQWJAYQJA},#{item.SBTPSL},#{item.CZTPSL}
|
||||
)
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
|
||||
<insert id="singleSave" parameterType="java.util.Map">
|
||||
INSERT INTO t_case_citylaw
|
||||
(id,ajjlsj,dzms,wtms,wtlybs,wtlymc,ajlxbs,ajlxmc,dlbs,dlmc,xlbs,xlmc,qbs,qmc,jdbs,
|
||||
jdmc,sqbs,sqmc,xzb,yzb,pqsj,ajjssj,ajzfsj,czsxcqjaaqjacqwjayqja,sbtpsl,cztpsl
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{id},#{AJJLSJ},#{DZMS},#{WTMS},#{WTLYBS},#{WTLYMC},
|
||||
#{AJLXBS},#{AJLXMC},#{DLBS},#{DLMC},#{XLBS},
|
||||
#{XLMC},#{QBS},#{QMC},#{JDBS},#{JDMC},#{SQBS},
|
||||
#{SQMC},#{XZB},#{YZB},#{PQSJ},#{AJJSSJ},#{AJZFSJ},
|
||||
#{itCZSXCQJAAQJACQWJAYQJA},#{SBTPSL},#{CZTPSL}
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.renren.modules.monitor.mapper.ChannelPictureMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.renren.modules.monitor.mapper.EventMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.renren.modules.monitor.mapper.PassengerFlowlMapper">
|
||||
|
||||
<insert id="batchSave" parameterType="java.util.List">
|
||||
INSERT INTO t_passenger_flow
|
||||
(hour_id,time_id,longitude,latitude,all_nums,local_nums,nonlocal_nums)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator="," >
|
||||
(
|
||||
#{item.hour_id},#{item.time_id},#{item.longitude},#{item.latitude},#{item.all_nums},
|
||||
#{item.local_nums},#{item.nonlocal_nums}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getByMaxId" resultType="io.renren.modules.monitor.entity.PassengerFlow">
|
||||
select * from t_passenger_flow ORDer by id desc limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.renren.modules.monitor.mapper.RoadDataMapper">
|
||||
|
||||
<insert id="batchSave" parameterType="java.util.List">
|
||||
INSERT INTO t_road_data
|
||||
(region_name,street_name,road_name,start,end,lng,lat,pm10,pm25,desc_pm10_rank,asc_pm10_rank,
|
||||
desc_pm25_rank,asc_pm25_rank,points)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator="," >
|
||||
(
|
||||
#{item.regionName},#{item.streetName},#{item.roadName},#{item.start},#{item.end},
|
||||
#{item.lng},#{item.lat},#{item.pm10},#{item.pm25},#{item.desc_pm10_rank},
|
||||
#{item.asc_pm10_rank},#{item.desc_pm25_rank},#{item.asc_pm25_rank},#{item.points}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.renren.modules.monitor.mapper.SanitationMapper">
|
||||
<insert id="batchSave" parameterType="java.util.List">
|
||||
insert into t_sanitation_info
|
||||
(cph,jsy,gmri,cllx,ssqybh,sshwgsbh,bz,sfkh,clbh,ds,sfjzgpsblrsjgpt,jj,
|
||||
clxh,cldl,sfjs,sfss,sfcx
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.cph},#{item.cph},#{item.cph},#{item.cph},#{item.cph},#{item.cph},
|
||||
#{item.cph},#{item.cph},#{item.cph},#{item.cph},#{item.cph},#{item.cph}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="batchSaveSanitationRoad" parameterType="java.util.List">
|
||||
insert into t_sanitation_road
|
||||
(bh,dlmc,qdlkdlmc,zdlkdlmc,zcgdlxzc,bjdj,dlzd,dlkd,dlzmj,cxdmj,rxdmj,jsmj,ssmj,
|
||||
gycxmj,bjysl,gpxsl,ssqybh,ssjdbsc,sshwgsbh,zbjh,sfqy,bh1,dtdlhzkd,
|
||||
zcgd,jsqz,cxqz,jj,tplj,zbdfxbz0zx1fx,fxzbxxid,ys,btmx,jsts,jspc,
|
||||
sfjs0bjs1js,sfss0bss1ss,sfcx0bcx1cx,sspc,cxpc,ssts,cxts,sfkh
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.BH},#{item.DLMC},#{item.QDLKDLMC},#{item.ZDLKDLMC},#{item.ZCGDLXZC},#{item.BJDJ},#{item.DLZD},
|
||||
#{item.DLKD},#{item.DLZMJ},#{item.CXDMJ},#{item.RXDMJ},#{item.JSMJ},#{item.SSMJ},
|
||||
#{item.GYCXMJ},#{item.BJYSL},#{item.GPXSL},#{item.SSQYBH},#{item.SSJDBSC},#{item.SSHWGSBH},
|
||||
#{item.ZBJH},#{item.SFQY},#{item.BH1},#{item.DTDLHZKD},#{item.ZCGD},#{item.JSQZ},
|
||||
#{item.CXQZ},#{item.JJ},#{item.TPLJ},#{item.ZBDFXBZ0ZX1FX},#{item.FXZBXXID},#{item.YS},
|
||||
#{item.BTMX},#{item.JSTS},#{item.JSPC},#{item.SFJS0BJS1JS},#{item.SFSS0BSS1SS},#{item.SFCX0BCX1CX},
|
||||
#{item.SSPC},#{item.CXPC},#{item.SSTS},#{item.CXTS},#{item.SFKH}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="batchSaveSanitationTask" parameterType="java.util.List">
|
||||
insert into t_sanitation_task
|
||||
(dlmc,ksdl,zzdl,ssqs,cph,zywcl,zyrq,zylx,zysj,zyts,zypc,zyzd,
|
||||
zykd,zymj,wzyds,zycsds,zygpsds,updatetime
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.DLMC},#{item.KSDL},#{item.ZZDL},#{item.SSQS},#{item.CPH},#{item.ZYWCL},
|
||||
#{item.ZYRQ},#{item.ZYLX},#{item.ZYSJ},#{item.ZYTS},#{item.ZYPC},#{item.ZYZD},
|
||||
#{item.ZYKD},#{item.ZYMJ},#{item.WZYDS},#{item.ZYCSDS},#{item.ZYGPSDS},#{item.updatetime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.renren.modules.monitor.mapper.SedimentTrailMapper">
|
||||
|
||||
<insert id="batchaSave" parameterType="java.util.List">
|
||||
<foreach collection="list" item="item" separator=";" >
|
||||
INSERT INTO t_trail_sediment
|
||||
(speed,sim_card_num,uploadtime,coordinate_x,coordinate_y,
|
||||
longitude,latitude,record_time,angle,update_time,status,fuel)
|
||||
VALUES
|
||||
(
|
||||
#{item.SPEED},#{item.SIMCARDNUM},#{item.UPLOADTIME},#{item.COORDINATEX},#{item.COORDINATEY},
|
||||
#{item.LONGITUDE},#{item.LATITUDE},#{item.RECORDTIME},#{item.ANGEL},#{item.updatetime},
|
||||
#{item.STATUS},#{item.FUEL}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="io.renren.modules.monitor.mapper.TrailSanitationMapper">
|
||||
|
||||
<insert id="batchaSave" parameterType="java.util.List">
|
||||
INSERT INTO t_trail_sanitation
|
||||
(simkh,cph,fssj,jd,wd,sd,fx,zt,yl,lc,sfzx,bjzt,gd,updatetime)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator="," >
|
||||
(
|
||||
#{item.SIMKH},#{item.CPH},#{item.FSSJ},#{item.JD},#{item.WD},
|
||||
#{item.SD},#{item.FX},#{item.ZT},#{item.YL},#{item.LC},
|
||||
#{item.SFZX},#{item.BJZT},#{item.GD},#{item.updatetime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue