上传绿通传输程序
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CamelCaseConfig">
|
||||
<option name="cb1State" value="false" />
|
||||
<option name="cb2State" value="false" />
|
||||
<option name="cb5State" value="false" />
|
||||
<option name="cb6State" value="false" />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="true" />
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="GreenTraffic" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||
<module name="GreenTraffic" options="-parameters" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://maven.aliyun.com/repository/public" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="OracleMavenRepository" />
|
||||
<option name="name" value="OracleMavenRepository" />
|
||||
<option name="url" value="https://maven.oracle.com" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
||||
</project>
|
||||
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,238 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.11</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>GreenTrafficPass</groupId>
|
||||
<artifactId>GreenTrafficPass</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<name>GreenTrafficPass</name>
|
||||
<description>GreenTrafficPass</description>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>OracleMavenRepository</id>
|
||||
<url>https://maven.oracle.com</url>
|
||||
<layout>default</layout>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- lombok -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- 外置依赖-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>4.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.5.3.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
<groupId>com.baomidou</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!--验证码 -->
|
||||
<dependency>
|
||||
<groupId>com.github.penggle</groupId>
|
||||
<artifactId>kaptcha</artifactId>
|
||||
<version>2.3.2</version>
|
||||
</dependency>
|
||||
<!-- 数据库链接包-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
<version>3.5.3.1</version>
|
||||
</dependency>
|
||||
<!-- 复合主键-->
|
||||
<dependency>
|
||||
<groupId>com.github.jeffreyning</groupId>
|
||||
<artifactId>mybatisplus-plus</artifactId>
|
||||
<version>1.7.3-RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microsoft</groupId>
|
||||
<artifactId>sqljdbc4</artifactId>
|
||||
<version>3.0</version>
|
||||
</dependency>
|
||||
<!--JWT鉴权-->
|
||||
<dependency>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>4.3.0</version>
|
||||
</dependency>
|
||||
<!-- 密码加密-->
|
||||
<dependency>
|
||||
<groupId>com.enc</groupId>
|
||||
<artifactId>EndPassJava</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<!-- DateUtil-->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<!--spring-session-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session-jdbc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>2.0.25</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dm</groupId>
|
||||
<artifactId>DmJdbcDriver18</artifactId>
|
||||
<version>1.8.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>3.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>3.8</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Oracle JDBC driver -->
|
||||
<dependency>
|
||||
<groupId>com.oracle.database.jdbc</groupId>
|
||||
<artifactId>ojdbc8</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.23</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.oracle.ojdbc</groupId>
|
||||
<artifactId>orai18n</artifactId>
|
||||
<version>19.3.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- JAX-WS dependency -->
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxws</artifactId>
|
||||
<version>3.2.5</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http</artifactId>
|
||||
<version>3.2.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.goldendb</groupId>
|
||||
<artifactId>goldendb</artifactId>
|
||||
<version>5.1.46.67</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>GreenTrafficPass</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<testFailureIgnore>true</testFailureIgnore>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
<!--打包时去除配置文件-->
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>*.properties</exclude>
|
||||
</excludes>
|
||||
<includes>
|
||||
<include>logback-spring.xml</include>
|
||||
<include>static/**</include>
|
||||
<include>excel/**</include>
|
||||
<include>META-INF/spring.factories</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,44 @@
|
||||
package com.nmgs;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.data.redis.LettuceClientConfigurationBuilderCustomizer;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.scheduling.TaskScheduler;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
|
||||
|
||||
@EnableAsync
|
||||
@SpringBootApplication
|
||||
@MapperScan(basePackages = {"com.nmgs.mapper.green"}, sqlSessionFactoryRef = "sqlSessionFactoryGreen")
|
||||
@MapperScan(basePackages = {"com.nmgs.mapper.check"}, sqlSessionFactoryRef = "sqlSessionFactoryCheck")
|
||||
@EnableScheduling //开启任务调度
|
||||
public class GreenTrafficApplication extends SpringBootServletInitializer {
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||
return builder.sources(GreenTrafficApplication.class);
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(GreenTrafficApplication.class, args);
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public TaskScheduler taskScheduler() {
|
||||
//注入定时器线程池,一次定时器,处理三次数据
|
||||
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
|
||||
taskScheduler.setPoolSize(10);
|
||||
return taskScheduler;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
package com.nmgs;
|
||||
|
||||
import com.nmgs.util.PathUtil;
|
||||
import com.trkf.PasswordEncryption.PassWordUtils;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.env.EnvironmentPostProcessor;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.core.env.PropertiesPropertySource;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
@Configuration
|
||||
public class MyEnvironmentPostProcessor implements EnvironmentPostProcessor {
|
||||
|
||||
@Override
|
||||
public void postProcessEnvironment(ConfigurableEnvironment configurableEnvironment, SpringApplication application) {
|
||||
System.out.println("GreenTraffic读取公用配置文件");
|
||||
//公用配置文件路径
|
||||
String path = PathUtil.applicationPath;
|
||||
//本项目配置文件路径
|
||||
String NewPath = PathUtil.projectApplicationPath;
|
||||
System.out.println("Loading local settings from : " + path);
|
||||
System.out.println("Loading local settings from : " + NewPath);
|
||||
Properties properties = new Properties();
|
||||
Properties Newproperties = new Properties();
|
||||
try {
|
||||
File fileproperties = new File(path);
|
||||
File fileNewproperties = new File(NewPath);
|
||||
// 判断文件夹是否存在
|
||||
if (!fileproperties.exists()) {
|
||||
fileproperties.createNewFile();
|
||||
}
|
||||
if (!fileNewproperties.exists()) {
|
||||
fileNewproperties.createNewFile();
|
||||
}
|
||||
properties.load(new FileInputStream(path));
|
||||
String DBType = properties.getProperty("DBType") == null ? "1" : properties.getProperty("DBType");
|
||||
Newproperties.load(new FileInputStream(NewPath));
|
||||
properties.setProperty("spring.logback.logPath",PathUtil.TomcatPath+"/logs");
|
||||
|
||||
|
||||
// properties.setProperty("spring.datasource.url",properties.getProperty("DBUrl"));
|
||||
// properties.setProperty("spring.datasource.username",properties.getProperty("DBUserName"));
|
||||
// properties.setProperty("spring.datasource.password",PassWordUtils.decrypt(properties.getProperty("DBPassWord")));
|
||||
//
|
||||
|
||||
|
||||
// properties.setProperty("spring.datasource.db-green.jdbc-url",properties.getProperty("DBUrl"));
|
||||
// properties.setProperty("spring.datasource.db-green.username",properties.getProperty("DBUserName"));
|
||||
// properties.setProperty("spring.datasource.db-green.password",PassWordUtils.decrypt(properties.getProperty("DBPassWord")));
|
||||
|
||||
properties.setProperty("spring.datasource.db-green.jdbc-url",properties.getProperty("GreenDBUrl"));
|
||||
properties.setProperty("spring.datasource.db-green.username",properties.getProperty("GreenDBUserName"));
|
||||
properties.setProperty("spring.datasource.db-green.password",PassWordUtils.decrypt(properties.getProperty("GreenDBPassWord")));
|
||||
|
||||
|
||||
properties.setProperty("spring.datasource.db-check.jdbc-url",properties.getProperty("CheckDBUrl"));
|
||||
properties.setProperty("spring.datasource.db-check.username",properties.getProperty("CheckDBUserName"));
|
||||
properties.setProperty("spring.datasource.db-check.password",PassWordUtils.decrypt(properties.getProperty("CheckDBPassWord")));
|
||||
|
||||
if(properties.getProperty("IsGolDen").equals("1")){
|
||||
properties.setProperty("spring.datasource.db-green.driver-class-name",Newproperties.getProperty("GoldenClassName"));
|
||||
properties.setProperty("spring.datasource.db-check.driver-class-name",Newproperties.getProperty("OracleClassName"));
|
||||
properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("MySQLvalidationQuery"));
|
||||
properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("MySQLvalidationQuery"));
|
||||
}else{
|
||||
if(DBType.equals("1")){
|
||||
properties.setProperty("spring.datasource.db-green.driver-class-name",Newproperties.getProperty("sqlClassName"));
|
||||
properties.setProperty("spring.datasource.driver-class-name",Newproperties.getProperty("sqlClassName"));
|
||||
properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("sqlvalidationQuery"));
|
||||
properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("sqlvalidationQuery"));
|
||||
}else if(DBType.equals("2")){
|
||||
properties.setProperty("spring.datasource.db-green.driver-class-name",Newproperties.getProperty("OracleClassName"));
|
||||
properties.setProperty("spring.datasource.db-check.driver-class-name",Newproperties.getProperty("OracleClassName"));
|
||||
properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("OraclevalidationQuery"));
|
||||
properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("OraclevalidationQuery"));
|
||||
}else if(DBType.equals("3")){
|
||||
properties.setProperty("spring.datasource.db-green.driver-class-name",Newproperties.getProperty("DMClassName"));
|
||||
properties.setProperty("spring.datasource.db-check.driver-class-name",Newproperties.getProperty("DMClassName"));
|
||||
properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("DMvalidationQuery"));
|
||||
properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("DMvalidationQuery"));
|
||||
}else if(DBType.equals("4")){
|
||||
properties.setProperty("spring.datasource.db-green.driver-class-name",Newproperties.getProperty("MySQLClassName"));
|
||||
properties.setProperty("spring.datasource.db-check.driver-class-name",Newproperties.getProperty("MySQLClassName"));
|
||||
properties.setProperty("spring.datasource.validationQuery",Newproperties.getProperty("MySQLvalidationQuery"));
|
||||
properties.setProperty("spring.datasource.hikari.connection-test-query",Newproperties.getProperty("MySQLvalidationQuery"));
|
||||
}
|
||||
}
|
||||
System.out.println("---------------------------GreenTraffic本次载入数据库----------------------");
|
||||
System.out.println("server.port: " + properties.getProperty("server.port"));
|
||||
System.out.println(" url : " + properties.getProperty("spring.datasource.url"));
|
||||
System.out.println(" username : " + properties.getProperty("spring.datasource.username"));
|
||||
//环境名称随意取,但尽量不能和其他环境名称相同,避免不生效
|
||||
PropertiesPropertySource propertySource = new PropertiesPropertySource("environmentPostProcessor", properties);
|
||||
PropertiesPropertySource newPropertySource = new PropertiesPropertySource("newEnvironmentPostProcessor", Newproperties);
|
||||
//外部的文件是最先导入的
|
||||
configurableEnvironment.getPropertySources().addFirst(propertySource);
|
||||
//如果公用配置文件没有配置的则使用本项目的配置文件
|
||||
configurableEnvironment.getPropertySources().addLast(newPropertySource);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
/**
|
||||
* 启用跨域配置
|
||||
* 编写SpringMVCConfig类使用FilterConfig中的配置
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
|
||||
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;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Configuration
|
||||
public class CorsConfig implements WebMvcConfigurer {
|
||||
|
||||
@Resource
|
||||
private FilterConfig filterconfig;
|
||||
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
// 设置拦截类
|
||||
registry.addInterceptor(filterconfig)
|
||||
.addPathPatterns("/**")
|
||||
// 是否允许证书
|
||||
.excludePathPatterns(
|
||||
"/MenuIndex/**",
|
||||
"/ETCLanePay/**",
|
||||
"/Manager/**",
|
||||
"/queryPage/**",
|
||||
"/staSubcomCollection/**",
|
||||
"/staDetilCollection/**",
|
||||
"/freightCollection/**",
|
||||
"/index/**",
|
||||
"/carTrack/**",
|
||||
"/printView/**",
|
||||
"/trackMap/**",
|
||||
"/logManager/**",
|
||||
"/wxCarUserInfo/**",
|
||||
"/showStanEcharts/**",
|
||||
"/404/**",
|
||||
"/MenuIndex/**",
|
||||
"/index.html",
|
||||
"/assets/**",
|
||||
"/img/**",
|
||||
"/static/**",
|
||||
"/error/**"
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 跨越配置
|
||||
*/
|
||||
@Bean
|
||||
public CorsFilter corsFilter() {
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
// 设置容许跨域请求的域名
|
||||
config.addAllowedOriginPattern("*");
|
||||
// config.addAllowedOrigin("*");
|
||||
// 设置容许的方法
|
||||
config.addAllowedMethod("*");
|
||||
// 容许任何头
|
||||
config.addAllowedHeader("*");
|
||||
config.addExposedHeader("token");
|
||||
//是否支持cookie跨域
|
||||
config.setAllowCredentials(true);
|
||||
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
|
||||
configSource.registerCorsConfiguration("/**", config);
|
||||
return new CorsFilter(configSource);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.MybatisConfiguration;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
@Configuration
|
||||
@MapperScan(basePackages = {"com.nmgs.mapper.check"}, sqlSessionFactoryRef = "sqlSessionFactoryCheck")
|
||||
public class DBSrcCheck {
|
||||
|
||||
@Autowired
|
||||
MybatisPlusInterceptor mybatisPlusInterceptor;
|
||||
@Bean
|
||||
public SqlSessionFactory sqlSessionFactoryCheck(@Qualifier("db_check") DataSource dataSource) throws Exception {
|
||||
MybatisSqlSessionFactoryBean sqlSessionFactory = new MybatisSqlSessionFactoryBean();
|
||||
sqlSessionFactory.setDataSource(dataSource);
|
||||
MybatisConfiguration configuration = new MybatisConfiguration();
|
||||
configuration.addInterceptor(mybatisPlusInterceptor);
|
||||
sqlSessionFactory.setConfiguration(configuration);
|
||||
// sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
|
||||
// .getResources("classpath:mapper/check/**/*.xml"));
|
||||
return sqlSessionFactory.getObject();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SqlSessionTemplate sqlSessionTemplateCheck(@Qualifier("sqlSessionFactoryCheck") SqlSessionFactory sqlSessionFactory) throws Exception {
|
||||
return new SqlSessionTemplate(sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.MybatisConfiguration;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
|
||||
@Configuration
|
||||
@MapperScan(basePackages = {"com.nmgs.mapper.green"}, sqlSessionFactoryRef = "sqlSessionFactoryGreen")
|
||||
public class DBSrcGreen {
|
||||
|
||||
@Autowired
|
||||
MybatisPlusInterceptor mybatisPlusInterceptor;
|
||||
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public SqlSessionFactory sqlSessionFactoryGreen(@Qualifier("db_green") DataSource dataSource) throws Exception {
|
||||
MybatisSqlSessionFactoryBean sqlSessionFactory = new MybatisSqlSessionFactoryBean();
|
||||
sqlSessionFactory.setDataSource(dataSource);
|
||||
// 添加分页插件
|
||||
MybatisConfiguration configuration = new MybatisConfiguration();
|
||||
configuration.addInterceptor(mybatisPlusInterceptor);
|
||||
sqlSessionFactory.setConfiguration(configuration);
|
||||
// sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
|
||||
// .getResources("classpath:mapper/green/**/*.xml"));
|
||||
return sqlSessionFactory.getObject();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public SqlSessionTemplate sqlSessionTemplateGreen(@Qualifier("sqlSessionFactoryGreen") SqlSessionFactory sqlSessionFactory) throws Exception {
|
||||
return new SqlSessionTemplate(sqlSessionFactory);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
|
||||
@Configuration
|
||||
public class DataSourceConfig {
|
||||
@Bean
|
||||
@ConfigurationProperties(prefix = "spring.datasource.hikari")
|
||||
public HikariConfig hikariConfig(){
|
||||
return new HikariConfig();
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean(name = "db_green")
|
||||
@ConfigurationProperties(prefix = "spring.datasource.db-green")
|
||||
public DataSource dBSrcGreen() {
|
||||
|
||||
HikariDataSource hikariDataSource = new HikariDataSource();
|
||||
hikariDataSource.setMaximumPoolSize(hikariConfig().getMaximumPoolSize());
|
||||
hikariDataSource.setAutoCommit(hikariConfig().isAutoCommit());
|
||||
hikariDataSource.setIdleTimeout(hikariConfig().getIdleTimeout());
|
||||
hikariDataSource.setPoolName(hikariConfig().getPoolName());
|
||||
hikariDataSource.setMaxLifetime(hikariConfig().getMaxLifetime());
|
||||
hikariDataSource.setConnectionTimeout(hikariConfig().getConnectionTimeout());
|
||||
hikariDataSource.setMinimumIdle(hikariConfig().getMinimumIdle());
|
||||
hikariDataSource.setAllowPoolSuspension(hikariConfig().isAllowPoolSuspension());
|
||||
hikariDataSource.setRegisterMbeans(hikariConfig().isRegisterMbeans());
|
||||
hikariDataSource.setLeakDetectionThreshold(hikariConfig().getLeakDetectionThreshold());
|
||||
|
||||
return hikariDataSource;
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean(name = "db_check")
|
||||
@ConfigurationProperties(prefix = "spring.datasource.db-check")
|
||||
public DataSource dBSrcCheck() {
|
||||
|
||||
HikariDataSource hikariDataSource = new HikariDataSource();
|
||||
hikariDataSource.setMaximumPoolSize(hikariConfig().getMaximumPoolSize());
|
||||
hikariDataSource.setAutoCommit(hikariConfig().isAutoCommit());
|
||||
hikariDataSource.setIdleTimeout(hikariConfig().getIdleTimeout());
|
||||
hikariDataSource.setPoolName(hikariConfig().getPoolName());
|
||||
hikariDataSource.setMaxLifetime(hikariConfig().getMaxLifetime());
|
||||
hikariDataSource.setConnectionTimeout(hikariConfig().getConnectionTimeout());
|
||||
hikariDataSource.setMinimumIdle(hikariConfig().getMinimumIdle());
|
||||
hikariDataSource.setAllowPoolSuspension(hikariConfig().isAllowPoolSuspension());
|
||||
hikariDataSource.setRegisterMbeans(hikariConfig().isRegisterMbeans());
|
||||
hikariDataSource.setLeakDetectionThreshold(hikariConfig().getLeakDetectionThreshold());
|
||||
|
||||
return hikariDataSource;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
import org.springframework.boot.web.server.ErrorPage;
|
||||
import org.springframework.boot.web.server.ErrorPageRegistrar;
|
||||
import org.springframework.boot.web.server.ErrorPageRegistry;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ErrorConfig implements ErrorPageRegistrar {
|
||||
|
||||
@Override
|
||||
public void registerErrorPages(ErrorPageRegistry registry) {
|
||||
ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/index.html");
|
||||
registry.addErrorPages(error404Page);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
/**
|
||||
* 允许跨域请求
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
|
||||
import com.nmgs.util.TokenUtil;
|
||||
import dm.jdbc.filter.stat.json.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class FilterConfig implements HandlerInterceptor {
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
if(request.getHeader("Origin")==null){
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");//支持跨域请求
|
||||
}else{
|
||||
System.out.println("request.getHeader(\"Origin\")=======>" + request.getHeader("Origin"));
|
||||
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));//支持跨域请求
|
||||
}
|
||||
response.setHeader("Access-Control-Allow-Credentials", "true");//是否支持cookie跨域
|
||||
response.setHeader("Access-Control-Allow-Methods", "*");//X-forwared-port,X-forwarded-host,
|
||||
response.setHeader("Access-Control-Allow-Headers", "Authorization,Origin, X-Requested-With, Content-Type, Accept,Access-Token");//Origin, X-Requested-With, Content-Type, Accept,Access-Token
|
||||
response.setHeader("Set-Cookie", "SameSite=None");
|
||||
String token = request.getHeader("token");
|
||||
// if(token == null){
|
||||
// return true;
|
||||
// }
|
||||
// if (token.equals("test")) {
|
||||
// return true;
|
||||
// }
|
||||
if (token != null) {
|
||||
boolean result = TokenUtil.verify(token,request);
|
||||
//判断绑定
|
||||
if (result) {
|
||||
log.info("通过拦截器");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setContentType("application/json; charset=utf-8");
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", "-1");
|
||||
res.put("msg", "鉴权失败");
|
||||
PrintWriter out = null;
|
||||
out = response.getWriter();
|
||||
out.write(res.toString());
|
||||
out.flush();
|
||||
out.close();
|
||||
return false;
|
||||
// return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.nmgs.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@Configuration
|
||||
@EnableAsync
|
||||
public class ThreadPoolConfig {
|
||||
|
||||
@Bean("greenTrafficThreadPool") //线程池实例名,多个线程池配置需要声明,一个线程池可有可无
|
||||
public Executor executorNormal() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(4);
|
||||
executor.setMaxPoolSize(120);
|
||||
executor.setQueueCapacity(30000);
|
||||
executor.setKeepAliveSeconds(60);
|
||||
executor.setThreadNamePrefix("NORMAL--");
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
@Bean
|
||||
public ThreadPoolTaskScheduler threadPoolTaskScheduler() {
|
||||
ThreadPoolTaskScheduler ThreadPoolTaskScheduler = new ThreadPoolTaskScheduler();
|
||||
// ThreadPoolTaskScheduler.initialize();
|
||||
return ThreadPoolTaskScheduler;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,292 @@
|
||||
package com.nmgs.controller;
|
||||
import com.nmgs.entity.GreenTrafficCheckResult;
|
||||
import com.nmgs.mapper.green.GreenTrafficCheckResultMapper;
|
||||
import com.nmgs.mapper.green.GreenTrafficMapper;
|
||||
import com.nmgs.service.IGreenTrafficService;
|
||||
import com.nmgs.util.PropertiesUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/GreenTraffic")
|
||||
@CrossOrigin(origins = "*")
|
||||
public class GreenTrafficController {
|
||||
|
||||
public static Logger logger = LoggerFactory.getLogger(GreenTrafficController.class);
|
||||
|
||||
@Autowired
|
||||
private IGreenTrafficService greenTrafficService;
|
||||
|
||||
@Autowired
|
||||
private GreenTrafficMapper greenTrafficMapper;
|
||||
|
||||
@Autowired
|
||||
private GreenTrafficCheckResultMapper greenTrafficCheckResultMapper;
|
||||
|
||||
|
||||
|
||||
@PostMapping("/getGreenTrafficPage")
|
||||
@ResponseBody
|
||||
public Object getGreenTrafficPage(@RequestBody Map<String, Object> params){
|
||||
|
||||
return greenTrafficService.getGreenTrafficList(params);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getGreenTrafficSearchData")
|
||||
@ResponseBody
|
||||
public Object GreenTrafficSearchData(@RequestBody Map<String, Object> params) {
|
||||
System.out.println(params);
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
if("N".equals(params.get("isChange"))){
|
||||
resultMap.put("carNoColorList", greenTrafficMapper.selectCarNoColorList());
|
||||
resultMap.put("roadList", greenTrafficMapper.selectRoadList());
|
||||
resultMap.put("staList", greenTrafficMapper.selectStaList(params));
|
||||
}else{
|
||||
resultMap.put("staList", greenTrafficMapper.selectStaList(params));
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@PostMapping("/getFreightTypes")
|
||||
@ResponseBody
|
||||
public Object getFreightTypes(@RequestBody Map<String, Object> params) {
|
||||
System.out.println(params);
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("freightTypeList", greenTrafficMapper.selectFreightTypeList(params));
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/getGreenTrafficCheckFromData")
|
||||
@ResponseBody
|
||||
public Object getGreenTrafficCheckFromData(@RequestBody Map<String, Object> params, HttpServletRequest request){
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
||||
|
||||
logger.info("params============"+params);
|
||||
String token = request.getHeader("token");
|
||||
logger.info("获取token============"+token);
|
||||
try {
|
||||
resultMap = greenTrafficService.getGreenTrafficCheckFromData(params,token);
|
||||
} catch (Exception e) {
|
||||
logger.error("com.nmgs.controller.GreenTrafficController.getGreenTrafficCheckFromData: 获取查验数据失败"+e);
|
||||
//e.printStackTrace();
|
||||
resultMap.put("checkFromData","{}");
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/getGreenTrafficCheckFromPicData")
|
||||
@ResponseBody
|
||||
public Object getGreenTrafficCheckFromPicData(@RequestBody Map<String, Object> params, HttpServletRequest request){
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
logger.info("params============"+params);
|
||||
String token = request.getHeader("token");
|
||||
logger.info("获取token============"+token);
|
||||
try {
|
||||
resultMap = greenTrafficService.getGreenTrafficCheckFromPicData(params,token);
|
||||
} catch (Exception e) {
|
||||
logger.error("com.nmgs.controller.GreenTrafficController.getGreenTrafficCheckFromPicData: 获取查验图片数据失败"+e);
|
||||
//e.printStackTrace();
|
||||
resultMap.put("checkPic","{}");
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/saveOrUpdateCheckResult")
|
||||
@ResponseBody
|
||||
public Object saveOrUpdateCheckResult(@RequestBody GreenTrafficCheckResult greenTrafficCheckResult) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
logger.info("greenTrafficCheckResult============"+greenTrafficCheckResult.toString());
|
||||
try{
|
||||
int res = greenTrafficService.saveOrUpdateCheckResult(greenTrafficCheckResult);
|
||||
if(res >= 0){
|
||||
resultMap.put("msg","更新稽核结论成功");
|
||||
resultMap.put("result",1);
|
||||
resultMap.put("data","[]");
|
||||
}else{
|
||||
resultMap.put("msg","更新稽核结论失败");
|
||||
resultMap.put("result",-1);
|
||||
resultMap.put("data","[]");
|
||||
}
|
||||
return resultMap;
|
||||
}catch (Exception e){
|
||||
logger.error("com.nmgs.controller.GreenTrafficController.saveOrUpdateCheckResult: 更新稽核结论数据失败"+e);
|
||||
resultMap.put("msg","更新稽核结论失败");
|
||||
resultMap.put("result",-1);
|
||||
resultMap.put("data","[]");
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getGreenTrafficCheckResultData")
|
||||
@ResponseBody
|
||||
public Object saveOrUpdateCheckResult(@RequestBody Map<String, Object> params) {
|
||||
|
||||
return greenTrafficCheckResultMapper.getCheckResultListByListNo(String.valueOf(params.get("listNo")));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/exportGreenTrafficExcle")
|
||||
@ResponseBody
|
||||
public void exportGreenTrafficExcle(String searchForm, HttpServletResponse response){
|
||||
logger.info("searchForm============"+searchForm.toString());
|
||||
try {
|
||||
greenTrafficService.exportGreenTrafficExcle(searchForm,response);
|
||||
} catch (Exception e) {
|
||||
logger.error("com.nmgs.controller.GreenTrafficController.exportGreenTrafficExcle: 导出失败"+e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/greenTotalCountByProvince")
|
||||
@ResponseBody
|
||||
public Object greenTotalCountByProvince(@RequestBody Map<String, Object> params){
|
||||
return greenTrafficService.greenTotalCountByProvince(params);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getStaSubComCollectionData")
|
||||
@ResponseBody
|
||||
public Object getStaSubComCollectionData(@RequestBody Map<String, Object> params) {
|
||||
// return greenTrafficService.getStaSubComCollectionData(params);
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
//从配置文件中读取数据库连接类型
|
||||
params.put("DBTYPE", PropertiesUtil.getValue("DBType"));
|
||||
resultMap.put("unionList", greenTrafficMapper.getGreenTrafficListGroupByUnionName(params));
|
||||
resultMap.put("subComList", greenTrafficMapper.getGreenTrafficListGroupBySubCom(params));
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@PostMapping("/getStaSubComCollectionSearchData")
|
||||
@ResponseBody
|
||||
public Object getStaSubComCollectionSearchData(@RequestBody Map<String, Object> params) {
|
||||
System.out.println(params);
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
if("N".equals(params.get("isChange"))){
|
||||
resultMap.put("unionList", greenTrafficMapper.selectUnionList());
|
||||
resultMap.put("staList", greenTrafficMapper.selectStaList(params));
|
||||
}else{
|
||||
resultMap.put("staList", greenTrafficMapper.selectStaList(params));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getStaDetilCollection")
|
||||
@ResponseBody
|
||||
public Object getStaDetilCollection(@RequestBody Map<String, Object> params) {
|
||||
return greenTrafficService.getStaDetilCollection(params);
|
||||
}
|
||||
|
||||
@PostMapping("/getStaDetilSearchData")
|
||||
@ResponseBody
|
||||
public Object getStaDetilSearchData(@RequestBody Map<String, Object> params) {
|
||||
System.out.println(params);
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
if("N".equals(params.get("isChange"))){
|
||||
resultMap.put("subComList", greenTrafficMapper.selectSubComList());
|
||||
resultMap.put("staList", greenTrafficMapper.selectStaList(params));
|
||||
resultMap.put("roadList", greenTrafficMapper.selectRoadList());
|
||||
}else{
|
||||
resultMap.put("staList", greenTrafficMapper.selectStaList(params));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getFigthTypeCollection")
|
||||
@ResponseBody
|
||||
public Object getStaFigthTypeCollectionByfreightType(@RequestBody Map<String, Object> params){
|
||||
return greenTrafficService.getStaFigthTypeCollection(params);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getFigthTypeCollectionSearchData")
|
||||
@ResponseBody
|
||||
public Object getStaFigthTypeCollectionSearchData(@RequestBody Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("unionList", greenTrafficMapper.selectUnionList());
|
||||
resultMap.put("freightTypeList", greenTrafficMapper.selectFreightTypeList(params));
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getGreenTotalCollection")
|
||||
@ResponseBody
|
||||
public Object getGreenTotalCollection(@RequestBody Map<String, Object> params){
|
||||
return greenTrafficService.getGreenTotalCollection(params);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getGreenFeeTotalCollection")
|
||||
@ResponseBody
|
||||
public Object getGreenFeeTotalCollection(@RequestBody Map<String, Object> params){
|
||||
return greenTrafficService.getGreenFeeTotalCollection(params);
|
||||
}
|
||||
|
||||
@PostMapping("/getFreightTotalCollection")
|
||||
@ResponseBody
|
||||
public Object getFreightTotalCollection(@RequestBody Map<String, Object> params){
|
||||
return greenTrafficService.getFreightTotalCollection(params);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getUnionFreightCollection")
|
||||
@ResponseBody
|
||||
public Object getUnionFreightCollection(@RequestBody Map<String, Object> params){
|
||||
return greenTrafficService.getUnionFreightCollection(params);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getSingleCarTrack")
|
||||
@ResponseBody
|
||||
public Object getSingleCarTrack(@RequestBody Map<String, Object> params){
|
||||
|
||||
//先判断车牌号码是否正确
|
||||
List<Map<String, Object>> greenAcarNoByAcarNoStr = greenTrafficMapper.getGreenAcarNoByAcarNoStr(params);
|
||||
if(null == greenAcarNoByAcarNoStr || greenAcarNoByAcarNoStr.isEmpty()){
|
||||
return "输入的车牌号码再绿通流水中未找到";
|
||||
}
|
||||
return greenTrafficService.getSingleCarTrack(params);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getGreenAcarNoByAcarNoStr")
|
||||
@ResponseBody
|
||||
public Object getGreenAcarNoByAcarNoStr(@RequestBody Map<String, Object> params){
|
||||
return greenTrafficMapper.getGreenAcarNoByAcarNoStr(params);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/getMenuByUserIdAndMenId")
|
||||
@ResponseBody
|
||||
public Object getMenuByUserIdAndMenId(@RequestBody Map<String, Object> params){
|
||||
|
||||
return greenTrafficMapper.getMenuByUserIdAndMenId(params);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package com.nmgs.controller;
|
||||
import com.nmgs.mapper.green.GreenTrafficCheckResultMapper;
|
||||
import com.nmgs.mapper.green.GreenTrafficMapper;
|
||||
import com.nmgs.service.IGreenTrafficExportExcelService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/GreenTrafficExportExcel")
|
||||
@CrossOrigin(origins = "*")
|
||||
public class GreenTrafficExportExcelController {
|
||||
|
||||
public static Logger logger = LoggerFactory.getLogger(GreenTrafficExportExcelController.class);
|
||||
|
||||
@Autowired
|
||||
private IGreenTrafficExportExcelService greenTrafficExportExcelService;
|
||||
|
||||
@Autowired
|
||||
private GreenTrafficMapper greenTrafficMapper;
|
||||
|
||||
@Autowired
|
||||
private GreenTrafficCheckResultMapper greenTrafficCheckResultMapper;
|
||||
|
||||
@GetMapping("/exportStaUnionCollectionExcle")
|
||||
@ResponseBody
|
||||
public void exportstaUnionCollectionExcle(String searchForm, HttpServletResponse response){
|
||||
logger.info("searchForm============"+searchForm.toString());
|
||||
try {
|
||||
greenTrafficExportExcelService.exportstaUnionCollectionExcle(searchForm,response);
|
||||
} catch (Exception e) {
|
||||
logger.error("com.nmgs.controller.GreenTrafficExportExcelController.exportstaUnionCollectionExcle: 导出失败"+e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/exportStaCollectionExcle")
|
||||
@ResponseBody
|
||||
public void exportstaCollectionExcle(String searchForm, HttpServletResponse response){
|
||||
logger.info("searchForm============"+searchForm.toString());
|
||||
try {
|
||||
greenTrafficExportExcelService.exportstaCollectionExcle(searchForm,response);
|
||||
} catch (Exception e) {
|
||||
logger.error("com.nmgs.controller.GreenTrafficExportExcelController.exportstaCollectionExcle: 导出失败"+e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/exportUnionFreightCollectionExcle")
|
||||
@ResponseBody
|
||||
public void exportUnionFreightCollectionExcle(String searchForm, HttpServletResponse response){
|
||||
logger.info("searchForm============"+searchForm.toString());
|
||||
try {
|
||||
greenTrafficExportExcelService.exportUnionFreightCollectionExcle(searchForm,response);
|
||||
} catch (Exception e) {
|
||||
logger.error("com.nmgs.controller.GreenTrafficExportExcelController.exportUnionFreightCollectionExcle: 导出失败"+e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/exportSingleTrackExcle")
|
||||
@ResponseBody
|
||||
public void exportSingleTrackExcle(String searchForm, HttpServletResponse response){
|
||||
logger.info("searchForm============"+searchForm.toString());
|
||||
try {
|
||||
greenTrafficExportExcelService.exportSingleTrackExcle(searchForm,response);
|
||||
} catch (Exception e) {
|
||||
logger.error("com.nmgs.controller.GreenTrafficExportExcelController.exportSingleTrackExcle: 导出失败"+e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/exportUnionTotalExcle")
|
||||
@ResponseBody
|
||||
public void exportUnionTotalExcle(String searchForm, HttpServletResponse response){
|
||||
logger.info("searchForm============"+searchForm.toString());
|
||||
try {
|
||||
greenTrafficExportExcelService.exportUnionTotalExcle(searchForm,response);
|
||||
} catch (Exception e) {
|
||||
logger.error("com.nmgs.controller.GreenTrafficExportExcelController.exportSingleTrackExcle: 导出失败"+e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/exportSubComTotalExcle")
|
||||
@ResponseBody
|
||||
public void exportSubComTotalExcle(String searchForm, HttpServletResponse response){
|
||||
logger.info("searchForm============"+searchForm.toString());
|
||||
try {
|
||||
greenTrafficExportExcelService.exportSubComTotalExcle(searchForm,response);
|
||||
} catch (Exception e) {
|
||||
logger.error("com.nmgs.controller.GreenTrafficExportExcelController.exportSingleTrackExcle: 导出失败"+e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@TableName("CHECK_RESULT_GREEN_FREIGHTTYPES")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CheckResultGreenFreightTypes {
|
||||
|
||||
@TableId(value = "TRANSACTIONID")
|
||||
private String transActionId;
|
||||
|
||||
|
||||
@TableField("FREIGHTTYPES")
|
||||
private String freightTypes;
|
||||
|
||||
|
||||
@TableField("CHECKTIME")
|
||||
private Date checkTime;
|
||||
|
||||
@TableField("LISTNO")
|
||||
private String listNo;
|
||||
|
||||
@TableField("APPOINTMENTID")
|
||||
private String appointmentId;
|
||||
|
||||
@TableField("CHECKID")
|
||||
private String checkId;
|
||||
|
||||
@TableField("CHECKRESULT")
|
||||
private Integer checkResult;
|
||||
|
||||
@TableField("CRATETYPE")
|
||||
private Integer crateType;
|
||||
|
||||
@TableField("CRATETYPETEXT")
|
||||
private String crateTypeText;
|
||||
|
||||
@TableField("DRIVERTELEPHONE")
|
||||
private String driverTelephone;
|
||||
|
||||
@TableField("ENSTATIONID")
|
||||
private String enStationId;
|
||||
|
||||
@TableField("ENWEIGHT")
|
||||
private Integer enWeight;
|
||||
|
||||
@TableField("EXSTATIONID")
|
||||
private String exStationId;
|
||||
|
||||
@TableField("EXTIME")
|
||||
private Date exTime;
|
||||
|
||||
@TableField("EXWEIGHT")
|
||||
private Integer exWeight;
|
||||
|
||||
@TableField("INSPECTOR")
|
||||
private String inspector;
|
||||
|
||||
@TableField("MEMO")
|
||||
private String memo;
|
||||
|
||||
@TableField("PASSID")
|
||||
private String passId;
|
||||
|
||||
@TableField("PAYFEE")
|
||||
private Integer payFee;
|
||||
|
||||
@TableField("REASON")
|
||||
private String reason;
|
||||
|
||||
@TableField("REVIEWER")
|
||||
private String reviewer;
|
||||
|
||||
@TableField("VEHICLEID")
|
||||
private String vehicleId;
|
||||
|
||||
@TableField("VEHICLETYPE")
|
||||
private Integer vehicleType;
|
||||
|
||||
|
||||
@TableField("RESULTTRANSACTIONID")
|
||||
private String resultTransActionId;
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@TableName("GREENTRAFFIC_TABLE")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GreenTraffic {;
|
||||
|
||||
@TableId(value = "LISTNO")
|
||||
private String listNo;
|
||||
|
||||
@TableField(value = "ROADNO")
|
||||
private Integer roadNo;
|
||||
|
||||
@TableField(value = "STANO")
|
||||
private Integer staNo;
|
||||
|
||||
@TableField(value = "CLASSDATE")
|
||||
private Date classDate;
|
||||
|
||||
@TableField("DT")
|
||||
private Date dt;
|
||||
|
||||
@TableField("MANNO")
|
||||
private long manNo;
|
||||
|
||||
@TableField("MAN")
|
||||
private String man;
|
||||
|
||||
@TableField("ACARNO")
|
||||
private String acarNo;
|
||||
|
||||
@TableField("ATYPE")
|
||||
@JsonProperty("aType")
|
||||
private Integer aType;
|
||||
|
||||
@TableField("KIND")
|
||||
private Integer kind;
|
||||
|
||||
@TableField("CASH")
|
||||
private BigDecimal cash;
|
||||
|
||||
@TableField("INCASH")
|
||||
private BigDecimal inCash;
|
||||
|
||||
@TableField("PAYCASH")
|
||||
private BigDecimal payCash;
|
||||
|
||||
@TableField("ID")
|
||||
private String id;
|
||||
|
||||
@TableField("ISASYNC")
|
||||
private String isAsync;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@JsonProperty("aTypeValue")
|
||||
private String aTypeValue; //车辆颜色
|
||||
@TableField(exist = false)
|
||||
private String kindValue; //车辆类型
|
||||
|
||||
@TableField(exist = false)
|
||||
private String staName;//收费站名称
|
||||
|
||||
@TableField(exist = false)
|
||||
private String inStaNo;//入口收费站NO
|
||||
|
||||
@TableField(exist = false)
|
||||
private String inStaName;//入口收费站名称
|
||||
|
||||
@TableField(exist = false)
|
||||
private String roadName;//道路名称
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private String freightTypes;//运输货物类型
|
||||
|
||||
@TableField(exist = false)
|
||||
private String freightTypeName;//运输货物名称
|
||||
|
||||
@TableField(exist = false)
|
||||
private String passId;//交易id
|
||||
|
||||
@TableField(exist = false)
|
||||
private String inInWeight;//入口称重
|
||||
|
||||
@TableField(exist = false)
|
||||
private String inAxisCnt;//入口车轴
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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 lombok.ToString;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@TableName("GREENTRAFFICCHECK_TABLE")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
public class GreenTrafficCheck {;
|
||||
|
||||
@TableId(value = "LISTNO")
|
||||
private String listNo;
|
||||
|
||||
@TableField(value = "CHECKTIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date checkTime;
|
||||
|
||||
|
||||
@TableField(value = "VEHICLEID")
|
||||
private String vehicleId;
|
||||
|
||||
@TableField(value = "VEHICLETYPE")
|
||||
private String vehicleType;
|
||||
|
||||
@TableField(value = "TRANSACTIONTYPE")
|
||||
private String transactionType;
|
||||
|
||||
@TableField(value = "CHECKID")
|
||||
private String checkId;
|
||||
|
||||
@TableField(value = "CHECKRESULT")
|
||||
private String checkResult;
|
||||
|
||||
@TableField(value = "FREIGHTTYPE")
|
||||
private String freightType;
|
||||
|
||||
@TableField(value = "FREIGHTTYPEDESC")
|
||||
private String freightTypeDesc;
|
||||
|
||||
@TableField(value = "ENWEIGHT")
|
||||
private String enWeight;
|
||||
|
||||
@TableField(value = "EXWEIGHT")
|
||||
private String exWeight;
|
||||
|
||||
@TableField(value = "FEE")
|
||||
private String fee;
|
||||
|
||||
@TableField(value = "ENTRYTOLLGATE")
|
||||
private String entryTollgate;
|
||||
|
||||
@TableField(value = "ENTRYTOLLGATEDESC")
|
||||
private String entryTollgateDesc;
|
||||
|
||||
@TableField(value = "EXITTOLLGATE")
|
||||
private String exitTollgate;
|
||||
|
||||
@TableField(value = "EXITTOLLGATEDESC")
|
||||
private String exitTollgateDesc;
|
||||
|
||||
@TableField(value = "INSPECTORID")
|
||||
private String inspectorId;
|
||||
|
||||
@TableField(value = "INSPECTORNAME")
|
||||
private String inspectorName;
|
||||
|
||||
@TableField(value = "REVIEWERUSER")
|
||||
private String reviewerUser;
|
||||
|
||||
@TableField(value = "CHECKDATAJSON")
|
||||
private String checkDataJson;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@TableName("GREENTRAFFICCHECKPIC_TABLE")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GreenTrafficCheckPic {
|
||||
|
||||
@TableField(value = "LISTNO")
|
||||
@MppMultiId
|
||||
private String listNo;
|
||||
|
||||
@TableField(value = "PICTYPE")
|
||||
@MppMultiId
|
||||
private String picType;
|
||||
|
||||
@TableField("PICDATA")
|
||||
private String picData;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private String typeName;//类型名称
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.nmgs.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@TableName("GREENTRAFFICCHECKRESULT_TABLE")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
public class GreenTrafficCheckResult {;
|
||||
|
||||
@TableId(value = "LISTNO")
|
||||
private String listNo;
|
||||
|
||||
@TableField(value = "CHECKRESULT")
|
||||
private String checkResult;
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.nmgs.mapper.check;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface CheckResultMapper{
|
||||
|
||||
/**
|
||||
* 根据货物类型和时间获取数据
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getCheckResultListByFreightTypeAndDate(@Param("params") Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 根据查验时间获取数据
|
||||
* @param page
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Page<Map<String, Object>> getCheckResultListByCheckTime(Page<Map<String, Object>> page, HashMap<String, Object> params);
|
||||
|
||||
@Select(" SELECT MAX(FREIGHTTYPES) as FreightType FROM CHECKRESULT_INFO_TABLE WHERE TRANSACTIONID = #{transactionid} and VEHICLEID like #{aCarNo}")
|
||||
String getMaxFreightByTransActionId(@Param("transactionid")String transactionid, @Param("aCarNo")String aCarNo);
|
||||
|
||||
@Select(" SELECT MAX(FREIGHTTYPES) as FreightType FROM CHECKRESULT_INFO_TABLE WHERE PASSID = #{passId} and VEHICLEID like #{aCarNo}")
|
||||
String getMaxFreightByPassId(@Param("passId")String passId, @Param("aCarNo")String aCarNo);
|
||||
|
||||
|
||||
List<Map<String, Object>> getResultListByTransActionId(@Param("transactionid")String transactionid, @Param("aCarNo")String aCarNo);
|
||||
|
||||
List<Map<String, Object>> getResultListByPassId(@Param("passId")String passId, @Param("aCarNo")String aCarNo);
|
||||
}
|
||||
@ -0,0 +1,152 @@
|
||||
<?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="com.nmgs.mapper.check.CheckResultMapper">
|
||||
|
||||
|
||||
<select id="getCheckResultListByfreightTypeAndDate" parameterType="java.util.HashMap" resultType="java.util.HashMap">
|
||||
select checks.TRANSACTIONID from CHECKRESULT_INFO_TABLE checks
|
||||
<where>
|
||||
and checks.TRANSACTIONID is not null
|
||||
<!-- 车牌号查询条件 -->
|
||||
<if test="params.freightType != null and params.freightType != ''">
|
||||
<bind name="freightType" value="'%'+params.freightType+'%'"/>
|
||||
AND checks.FREIGHTTYPES like #{freightType}
|
||||
</if>
|
||||
|
||||
|
||||
<!-- 开始时间查询条件 -->
|
||||
<if test="params.startTime != null and params.startTime != ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND checks.CHECKTIME >= dateadd(day,0,#{params.startTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND checks.CHECKTIME >= TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND checks.CHECKTIME >= TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND checks.CHECKTIME >= STR_TO_DATE(#{params.startTime}, '%Y-%m-%d %H:%i:%s')
|
||||
</if>
|
||||
</if>
|
||||
|
||||
<!-- 结束时间查询条件 -->
|
||||
<if test="params.endTime != null and params.endTime != ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND checks.CHECKTIME <= dateadd(day,0,#{params.endTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND checks.CHECKTIME <= TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND checks.CHECKTIME <= TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND checks.CHECKTIME <= STR_TO_DATE(#{params.endTime}, '%Y-%m-%d %H:%i:%s')
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="getCheckResultListByCheckTime" parameterType="java.util.HashMap" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
checks.TRANSACTIONID,
|
||||
checks.FREIGHTTYPES,
|
||||
checks.PASSID,
|
||||
checks.CHECKTIME
|
||||
FROM
|
||||
CHECKRESULT_INFO_TABLE checks
|
||||
<where>
|
||||
AND checks.TRANSACTIONID IS NOT NULL
|
||||
<!-- 开始时间查询条件 -->
|
||||
<if test="params.maxCheckTime != null and params.maxCheckTime != ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND checks.CHECKTIME >= dateadd(day,0,#{params.maxCheckTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND checks.CHECKTIME >= TO_DATE(#{params.maxCheckTime}, 'SYYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND checks.CHECKTIME >= TO_DATE(#{params.maxCheckTime}, 'SYYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND checks.CHECKTIME >= STR_TO_DATE(#{params.maxCheckTime}, '%Y-%m-%d %H:%i:%s')
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
checks.PASSID,
|
||||
checks.TRANSACTIONID,
|
||||
checks.FREIGHTTYPES,
|
||||
checks.CHECKTIME
|
||||
ORDER BY
|
||||
checks.CHECKTIME
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getResultListByTransActionId" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
result.TRANSACTIONID,
|
||||
result.FREIGHTTYPES ,
|
||||
result.CHECKTIME ,
|
||||
result.APPOINTMENTID,
|
||||
result.CHECKID ,
|
||||
result.CHECKRESULT ,
|
||||
result.CRATETYPE ,
|
||||
crate.text as CRATETYPETEXT ,
|
||||
result.DRIVERTELEPHONE ,
|
||||
result.ENSTATIONID ,
|
||||
result.ENWEIGHT ,
|
||||
result.EXTIME ,
|
||||
result.EXWEIGHT ,
|
||||
result.INSPECTOR ,
|
||||
result.MEMO ,
|
||||
result.PASSID ,
|
||||
result.PAYFEE ,
|
||||
result.REASON ,
|
||||
result.REVIEWER ,
|
||||
result.VEHICLEID ,
|
||||
result.VEHICLETYPE ,
|
||||
result.EXSTATIONID
|
||||
FROM
|
||||
CHECKRESULT_INFO_TABLE result
|
||||
left join CRATETYPE_TEXT crate on crate.value = result.CRATETYPE
|
||||
WHERE TRANSACTIONID = #{transactionid} and VEHICLEID like #{aCarNo}
|
||||
</select>
|
||||
|
||||
<select id="getResultListByPassId" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
result.TRANSACTIONID,
|
||||
result.FREIGHTTYPES ,
|
||||
result.CHECKTIME ,
|
||||
result.APPOINTMENTID,
|
||||
result.CHECKID ,
|
||||
result.CHECKRESULT ,
|
||||
result.CRATETYPE ,
|
||||
crate.text as CRATETYPETEXT ,
|
||||
result.DRIVERTELEPHONE ,
|
||||
result.ENSTATIONID ,
|
||||
result.ENWEIGHT ,
|
||||
result.EXTIME ,
|
||||
result.EXWEIGHT ,
|
||||
result.INSPECTOR ,
|
||||
result.MEMO ,
|
||||
result.PASSID ,
|
||||
result.PAYFEE ,
|
||||
result.REASON ,
|
||||
result.REVIEWER ,
|
||||
result.VEHICLEID ,
|
||||
result.VEHICLETYPE ,
|
||||
result.EXSTATIONID
|
||||
FROM
|
||||
CHECKRESULT_INFO_TABLE result
|
||||
left join CRATETYPE_TEXT crate on crate.value = result.CRATETYPE
|
||||
WHERE PASSID = #{passId} and VEHICLEID like #{aCarNo}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,28 @@
|
||||
package com.nmgs.mapper.green;
|
||||
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.nmgs.entity.CheckResultGreenFreightTypes;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface CheckResultGreenFreightTypesMapper extends MppBaseMapper<CheckResultGreenFreightTypes> {
|
||||
|
||||
|
||||
@Select("select TRANSACTIONID,CHECKTIME from CHECK_RESULT_GREEN_FREIGHTTYPES where CHECKTIME = (select MAX(CHECKTIME) from CHECK_RESULT_GREEN_FREIGHTTYPES)")
|
||||
List<Map<String,Object>> getMaxCheckTime();
|
||||
|
||||
|
||||
int insertAll(@Param("params")HashMap<String, Object> params, @Param("freightTypes") List<CheckResultGreenFreightTypes> checkResultGreenFreightTypes);
|
||||
|
||||
@Update("update CHECK_RESULT_GREEN_FREIGHTTYPES set FREIGHTTYPES=#{freightType} where TRANSACTIONID=#{transActionId} ")
|
||||
int updateFreightTypesByTransActionId(@Param("transActionId")String transActionId, @Param("freightType")String freightType);
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
<?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="com.nmgs.mapper.green.CheckResultGreenFreightTypesMapper">
|
||||
|
||||
<insert id="insertAll">
|
||||
|
||||
<if test="params.DBTYPE == 1">
|
||||
INSERT INTO CHECK_RESULT_GREEN_FREIGHTTYPES (TRANSACTIONID, FREIGHTTYPES, CHECKTIME) VALUES
|
||||
<foreach collection="freightTypes" item="freightType" separator=",">
|
||||
(#{freightType.transActionId}, #{freightType.freightTypes}, #{freightType.checkTime})
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
|
||||
<if test="params.DBTYPE == 2">
|
||||
INSERT ALL
|
||||
<foreach collection="freightTypes" item="freightType" separator="">
|
||||
INTO CHECK_RESULT_GREEN_FREIGHTTYPES (TRANSACTIONID, FREIGHTTYPES, CHECKTIME) VALUES (#{freightType.transActionId}, #{freightType.freightTypes}, #{freightType.checkTime})
|
||||
</foreach>
|
||||
SELECT * FROM dual
|
||||
</if>
|
||||
|
||||
<if test="params.DBTYPE == 3">
|
||||
INSERT INTO CHECK_RESULT_GREEN_FREIGHTTYPES (TRANSACTIONID, FREIGHTTYPES, CHECKTIME) VALUES
|
||||
<foreach collection="freightTypes" item="freightType" separator=",">
|
||||
(#{freightType.transActionId}, #{freightType.freightTypes}, #{freightType.checkTime})
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
|
||||
<if test="params.DBTYPE == 4">
|
||||
INSERT INTO CHECK_RESULT_GREEN_FREIGHTTYPES (TRANSACTIONID, FREIGHTTYPES, CHECKTIME) VALUES
|
||||
<foreach collection="freightTypes" item="freightType" separator=",">
|
||||
(#{freightType.transActionId}, #{freightType.freightTypes}, #{freightType.checkTime})
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,23 @@
|
||||
package com.nmgs.mapper.green;
|
||||
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.nmgs.entity.GreenTrafficCheck;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface GreenTrafficCheckMapper extends MppBaseMapper<GreenTrafficCheck> {
|
||||
|
||||
/**
|
||||
* 根据绿通流水获取数据
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<GreenTrafficCheck> getCheckListByListNo(@Param("params")Map<String, Object> params);
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
<?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="com.nmgs.mapper.green.GreenTrafficCheckMapper">
|
||||
|
||||
|
||||
<select id="getCheckListByListNo" parameterType="java.util.HashMap" resultType="com.nmgs.entity.GreenTrafficCheck">
|
||||
select
|
||||
checks.LISTNO,
|
||||
checks.CHECKTIME ,
|
||||
checks.VEHICLEID ,
|
||||
checks.VEHICLETYPE,
|
||||
checks.TRANSACTIONTYPE,
|
||||
checks.CHECKID,
|
||||
checks.CHECKRESULT,
|
||||
checks.FREIGHTTYPE,
|
||||
checks.FREIGHTTYPEDESC,
|
||||
checks.ENWEIGHT,
|
||||
checks.EXWEIGHT,
|
||||
checks.FEE,
|
||||
checks.ENTRYTOLLGATE,
|
||||
checks.ENTRYTOLLGATEDESC,
|
||||
checks.EXITTOLLGATE,
|
||||
checks.EXITTOLLGATEDESC,
|
||||
checks.INSPECTORID,
|
||||
checks.INSPECTORNAME,
|
||||
checks.REVIEWERUSER,
|
||||
checks.CHECKDATAJSON
|
||||
from
|
||||
GREENTRAFFICCHECK_TABLE checks , GREENTRAFFIC_TABLE green
|
||||
<where>
|
||||
<!-- 绿通流水号查询条件 -->
|
||||
<if test="params.listNo != null and params.listNo != '' ">
|
||||
AND checks.LISTNO = #{params.listNo}
|
||||
</if>
|
||||
|
||||
<!-- 开始时间查询条件 -->
|
||||
<if test="params.startTime != null and params.startTime != ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND checks.CHECKTIME >= dateadd(day,0,#{params.startTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND checks.CHECKTIME >= TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND checks.CHECKTIME >= TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND checks.CHECKTIME >= STR_TO_DATE(#{params.startTime}, '%Y-%m-%d %H:%i:%s')
|
||||
</if>
|
||||
</if>
|
||||
|
||||
<!-- 结束时间查询条件 -->
|
||||
<if test="params.endTime != null and params.endTime != ''">
|
||||
<if test="params.DBTYPE == 1">
|
||||
AND checks.CHECKTIME <= dateadd(day,0,#{params.endTime})
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
AND checks.CHECKTIME <= TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
AND checks.CHECKTIME <= TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
AND checks.CHECKTIME <= STR_TO_DATE(#{params.endTime}, '%Y-%m-%d %H:%i:%s')
|
||||
</if>
|
||||
</if>
|
||||
and checks.LISTNO = green.LISTNO
|
||||
</where>
|
||||
ORDER BY checks.LISTNO ,checks.CHECKTIME DESC
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,36 @@
|
||||
package com.nmgs.mapper.green;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.nmgs.entity.GreenTrafficCheckPic;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface GreenTrafficCheckPicMapper extends MppBaseMapper<GreenTrafficCheckPic> {
|
||||
|
||||
|
||||
/**
|
||||
* 根据绿通流水获取数据
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<GreenTrafficCheckPic> getCheckPicListBylistNo(@Param("params") Map<String, Object> params);
|
||||
|
||||
|
||||
/**
|
||||
* 批量保存数据
|
||||
* @param params
|
||||
* @param pics
|
||||
* @return
|
||||
*/
|
||||
int saveAll(@Param("params") Map<String, Object> params,@Param("pics")List<GreenTrafficCheckPic> pics);
|
||||
|
||||
|
||||
/**
|
||||
* 根据类型名称获取照片类型
|
||||
*/
|
||||
Map<String,Object> getPicType(@Param("typeName")String typeName);
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
<?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="com.nmgs.mapper.green.GreenTrafficCheckPicMapper">
|
||||
|
||||
|
||||
<select id="getCheckPicListBylistNo" parameterType="java.util.HashMap" resultType="com.nmgs.entity.GreenTrafficCheckPic">
|
||||
SELECT
|
||||
pic.LISTNO,
|
||||
pic.PICTYPE,
|
||||
pic.PICDATA,
|
||||
text.TEXT as typeName
|
||||
FROM
|
||||
GREENTRAFFICCHECKPIC_TABLE pic
|
||||
LEFT JOIN GREENTRAFFICCHECKPIC_TEXT text
|
||||
<if test="params.DBTYPE == 1">
|
||||
on SUBSTR(pic.PICTYPE, 1, (case when POSITION('_' IN pic.PICTYPE) != 0 then (POSITION('_' IN pic.PICTYPE)-1) else 2 end)) = text.VALUE
|
||||
</if>
|
||||
<if test="params.DBTYPE == 2">
|
||||
on SUBSTR(pic.PICTYPE, 1, (case when INSTR(pic.PICTYPE, '_') != 0 then (INSTR(pic.PICTYPE, '_')-1) else 2 end)) = text.VALUE
|
||||
</if>
|
||||
<if test="params.DBTYPE == 3">
|
||||
on SUBSTR(pic.PICTYPE, 1, (case when INSTR(pic.PICTYPE, '_') != 0 then (INSTR(pic.PICTYPE, '_')-1) else 2 end)) = text.VALUE
|
||||
</if>
|
||||
<if test="params.DBTYPE == 4">
|
||||
on SUBSTR(pic.PICTYPE, 1, (case when LOCATE('_', pic.PICTYPE) != 0 then (INSTR(pic.PICTYPE, '_')-1) else 2 end)) = text.VALUE
|
||||
</if>
|
||||
|
||||
|
||||
<where>
|
||||
<!-- 绿通流水号查询条件 -->
|
||||
<if test="params.listNo != null and params.listNo != '' ">
|
||||
AND pic.LISTNO = #{params.listNo}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY pic.PICTYPE
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getPicType" parameterType="java.lang.String" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
pic.TEXT,
|
||||
pic.VALUE
|
||||
FROM
|
||||
GREENTRAFFICCHECKPIC_TEXT pic
|
||||
<where>
|
||||
<!-- 类型名称查询条件 -->
|
||||
<if test="typeName != null and typeName != '' ">
|
||||
AND pic.TEXT = #{typeName}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY pic.VALUE
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<insert id="saveAll">
|
||||
|
||||
<if test="params.DBTYPE == 1">
|
||||
INSERT INTO GREENTRAFFICCHECKPIC_TABLE (LISTNO, PICTYPE, PICDATA) VALUES
|
||||
<foreach collection="pics" item="pic" separator=",">
|
||||
(#{pic.listNo}, #{pic.picType}, #{pic.picData})
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
|
||||
<if test="params.DBTYPE == 2">
|
||||
INSERT ALL
|
||||
<foreach collection="pics" item="pic" separator="">
|
||||
INTO GREENTRAFFICCHECKPIC_TABLE (LISTNO, PICTYPE, PICDATA) VALUES (#{pic.listNo}, #{pic.picType}, #{pic.picData})
|
||||
</foreach>
|
||||
SELECT * FROM dual
|
||||
</if>
|
||||
|
||||
<if test="params.DBTYPE == 3">
|
||||
INSERT INTO GREENTRAFFICCHECKPIC_TABLE (LISTNO, PICTYPE, PICDATA) VALUES
|
||||
<foreach collection="pics" item="pic" separator=",">
|
||||
(#{pic.listNo}, #{pic.picType}, #{pic.picData})
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
|
||||
<if test="params.DBTYPE == 4">
|
||||
INSERT INTO GREENTRAFFICCHECKPIC_TABLE (LISTNO, PICTYPE, PICDATA) VALUES
|
||||
<foreach collection="pics" item="pic" separator=",">
|
||||
(#{pic.listNo}, #{pic.picType}, #{pic.picData})
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,16 @@
|
||||
package com.nmgs.mapper.green;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.nmgs.entity.GreenTrafficCheckResult;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface GreenTrafficCheckResultMapper extends MppBaseMapper<GreenTrafficCheckResult> {
|
||||
|
||||
/**
|
||||
* 根据绿通流水获取数据
|
||||
* @param listNo
|
||||
* @return
|
||||
*/
|
||||
GreenTrafficCheckResult getCheckResultListByListNo(String listNo);
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
<?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="com.nmgs.mapper.green.GreenTrafficCheckResultMapper">
|
||||
|
||||
|
||||
<select id="getCheckResultListByListNo" parameterType="java.lang.String" resultType="com.nmgs.entity.GreenTrafficCheckResult">
|
||||
SELECT
|
||||
result.LISTNO,
|
||||
result.CHECKRESULT
|
||||
FROM
|
||||
GREENTRAFFICCHECKRESULT_TABLE result,
|
||||
GREENTRAFFIC_TABLE green
|
||||
<where>
|
||||
<!-- 绿通流水号查询条件 -->
|
||||
<if test="listNo != null and listNo != '' ">
|
||||
AND result.LISTNO = #{listNo}
|
||||
</if>
|
||||
and result.LISTNO = green.LISTNO
|
||||
</where>
|
||||
ORDER BY result.LISTNO
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,52 @@
|
||||
package com.nmgs.service;
|
||||
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public interface IGreenTrafficExportExcelService {
|
||||
|
||||
/**
|
||||
* 盟市、收费站统计绿通数据导出Excel
|
||||
* @param searchForm
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
void exportstaUnionCollectionExcle(String searchForm, HttpServletResponse response) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 收费站跨省本省绿通数据导出Excel
|
||||
* @param searchForm
|
||||
* @param response
|
||||
*/
|
||||
void exportstaCollectionExcle(String searchForm, HttpServletResponse response)throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 盟市货物统计Excel导出
|
||||
* @param searchForm
|
||||
* @param response
|
||||
*/
|
||||
void exportUnionFreightCollectionExcle(String searchForm, HttpServletResponse response)throws Exception;
|
||||
|
||||
/**
|
||||
* 单车轨迹导出
|
||||
* @param searchForm
|
||||
* @param response
|
||||
*/
|
||||
void exportSingleTrackExcle(String searchForm, HttpServletResponse response) throws Exception ;
|
||||
|
||||
/**
|
||||
* 盟市绿通数据导出
|
||||
* @param searchForm
|
||||
* @param response
|
||||
*/
|
||||
void exportUnionTotalExcle(String searchForm, HttpServletResponse response) throws Exception ;
|
||||
|
||||
/**
|
||||
* 分公司绿通数据导出
|
||||
* @param searchForm
|
||||
* @param response
|
||||
*/
|
||||
void exportSubComTotalExcle(String searchForm, HttpServletResponse response) throws Exception ;
|
||||
}
|
||||
@ -0,0 +1,252 @@
|
||||
package com.nmgs.util;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 时间切片工具
|
||||
* @Auther: xuxiaojun
|
||||
* @Date: 2020-03-19
|
||||
*/
|
||||
public class DateSplitUtils {
|
||||
|
||||
public enum IntervalType {
|
||||
DAY,
|
||||
HOUR,
|
||||
MINUTE,
|
||||
SECOND,
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间切割
|
||||
* @param startTime 被切割的开始时间
|
||||
* @param endTime 被切割的结束时间
|
||||
* @param intervalType
|
||||
* @param interval >0
|
||||
* @return
|
||||
*/
|
||||
public static List<DateSplit> splitDate(Date startTime, Date endTime, IntervalType intervalType, int interval) {
|
||||
if (interval < 0) {
|
||||
return null;
|
||||
}
|
||||
if (endTime.getTime() <= startTime.getTime()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (intervalType == IntervalType.DAY) {
|
||||
return splitByDay(startTime, endTime, interval);
|
||||
}
|
||||
if (intervalType == IntervalType.HOUR) {
|
||||
return splitByHour(startTime, endTime, interval);
|
||||
}
|
||||
if (intervalType == IntervalType.MINUTE) {
|
||||
return splitByMinute(startTime, endTime, interval);
|
||||
}
|
||||
if (intervalType == IntervalType.SECOND) {
|
||||
return splitBySecond(startTime, endTime, interval);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按照小时切割时间区间
|
||||
*/
|
||||
public static List<DateSplit> splitByHour(Date startTime, Date endTime, int intervalHours) {
|
||||
if (endTime.getTime() <= startTime.getTime()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<DateSplit> dateSplits = new ArrayList<>(256);
|
||||
|
||||
DateSplit param = new DateSplit();
|
||||
param.setStartDateTime(startTime);
|
||||
param.setEndDateTime(endTime);
|
||||
param.setEndDateTime(addHours(startTime, intervalHours));
|
||||
while (true) {
|
||||
param.setStartDateTime(startTime);
|
||||
Date tempEndTime = addHours(startTime, intervalHours);
|
||||
if (tempEndTime.getTime() >= endTime.getTime()) {
|
||||
tempEndTime = endTime;
|
||||
}
|
||||
param.setEndDateTime(tempEndTime);
|
||||
|
||||
dateSplits.add(new DateSplit(param.getStartDateTime(), param.getEndDateTime()));
|
||||
|
||||
startTime = addHours(startTime, intervalHours);
|
||||
if (startTime.getTime() >= endTime.getTime()) {
|
||||
break;
|
||||
}
|
||||
if (param.getEndDateTime().getTime() >= endTime.getTime()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return dateSplits;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按照秒切割时间区间
|
||||
*/
|
||||
public static List<DateSplit> splitBySecond(Date startTime, Date endTime, int intervalSeconds) {
|
||||
if (endTime.getTime() <= startTime.getTime()) {
|
||||
return null;
|
||||
}
|
||||
List<DateSplit> dateSplits = new ArrayList<>(256);
|
||||
|
||||
DateSplit param = new DateSplit();
|
||||
param.setStartDateTime(startTime);
|
||||
param.setEndDateTime(endTime);
|
||||
param.setEndDateTime(addSeconds(startTime, intervalSeconds));
|
||||
while (true) {
|
||||
param.setStartDateTime(startTime);
|
||||
Date tempEndTime = addSeconds(startTime, intervalSeconds);
|
||||
if (tempEndTime.getTime() >= endTime.getTime()) {
|
||||
tempEndTime = endTime;
|
||||
}
|
||||
param.setEndDateTime(tempEndTime);
|
||||
|
||||
dateSplits.add(new DateSplit(param.getStartDateTime(), param.getEndDateTime()));
|
||||
|
||||
startTime = addSeconds(startTime, intervalSeconds);
|
||||
if (startTime.getTime() >= endTime.getTime()) {
|
||||
break;
|
||||
}
|
||||
if (param.getEndDateTime().getTime() >= endTime.getTime()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return dateSplits;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按照天切割时间区间
|
||||
*/
|
||||
public static List<DateSplit> splitByDay(Date startTime, Date endTime, int intervalDays) {
|
||||
if (endTime.getTime() <= startTime.getTime()) {
|
||||
return null;
|
||||
}
|
||||
List<DateSplit> dateSplits = new ArrayList<>(256);
|
||||
|
||||
DateSplit param = new DateSplit();
|
||||
param.setStartDateTime(startTime);
|
||||
param.setEndDateTime(endTime);
|
||||
param.setEndDateTime(addDays(startTime, intervalDays));
|
||||
while (true) {
|
||||
param.setStartDateTime(startTime);
|
||||
Date tempEndTime = addDays(startTime, intervalDays);
|
||||
if (tempEndTime.getTime() >= endTime.getTime()) {
|
||||
tempEndTime = endTime;
|
||||
}
|
||||
param.setEndDateTime(tempEndTime);
|
||||
|
||||
dateSplits.add(new DateSplit(param.getStartDateTime(), param.getEndDateTime()));
|
||||
|
||||
startTime = addDays(startTime, intervalDays);
|
||||
if (startTime.getTime() >= endTime.getTime()) {
|
||||
break;
|
||||
}
|
||||
if (param.getEndDateTime().getTime() >= endTime.getTime()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return dateSplits;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按照分钟切割时间区间
|
||||
*
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @param intervalMinutes
|
||||
* @return
|
||||
*/
|
||||
public static List<DateSplit> splitByMinute(Date startTime, Date endTime, int intervalMinutes) {
|
||||
if (endTime.getTime() <= startTime.getTime()) {
|
||||
return null;
|
||||
}
|
||||
List<DateSplit> dateSplits = new ArrayList<>(256);
|
||||
|
||||
DateSplit param = new DateSplit();
|
||||
param.setStartDateTime(startTime);
|
||||
param.setEndDateTime(endTime);
|
||||
param.setEndDateTime(addMinute(startTime, intervalMinutes));
|
||||
while (true) {
|
||||
param.setStartDateTime(startTime);
|
||||
Date tempEndTime = addMinute(startTime, intervalMinutes);
|
||||
if (tempEndTime.getTime() >= endTime.getTime()) {
|
||||
tempEndTime = endTime;
|
||||
}
|
||||
param.setEndDateTime(tempEndTime);
|
||||
|
||||
dateSplits.add(new DateSplit(param.getStartDateTime(), param.getEndDateTime()));
|
||||
|
||||
startTime = addMinute(startTime, intervalMinutes);
|
||||
if (startTime.getTime() >= endTime.getTime()) {
|
||||
break;
|
||||
}
|
||||
if (param.getEndDateTime().getTime() >= endTime.getTime()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return dateSplits;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static Date addDays(Date date, int days) {
|
||||
return add(date, Calendar.DAY_OF_MONTH, days);
|
||||
}
|
||||
|
||||
private static Date addHours(Date date, int hours) {
|
||||
return add(date, Calendar.HOUR_OF_DAY, hours);
|
||||
}
|
||||
|
||||
private static Date addMinute(Date date, int minute) {
|
||||
return add(date, Calendar.MINUTE, minute);
|
||||
}
|
||||
private static Date addSeconds(Date date, int second) {
|
||||
return add(date, Calendar.SECOND, second);
|
||||
}
|
||||
|
||||
private static Date add(final Date date, final int calendarField, final int amount) {
|
||||
final Calendar c = Calendar.getInstance();
|
||||
c.setTime(date);
|
||||
c.add(calendarField, amount);
|
||||
return c.getTime();
|
||||
}
|
||||
|
||||
private static String formatDateTime(Date date) {
|
||||
if (date == null) {
|
||||
return "";
|
||||
}
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
return simpleDateFormat.format(date);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class DateSplit {
|
||||
private Date startDateTime;
|
||||
private Date endDateTime;
|
||||
|
||||
public String getStartDateTimeStr() {
|
||||
return formatDateTime(startDateTime);
|
||||
}
|
||||
|
||||
public String getEndDateTimeStr() {
|
||||
return formatDateTime(endDateTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.nmgs.util;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
|
||||
public class DateTimeSplitUtil {
|
||||
private static SimpleDateFormat sfMin00=new SimpleDateFormat("yyyy-MM-dd HH:00:00");
|
||||
private static SimpleDateFormat sfMin59=new SimpleDateFormat("yyyy-MM-dd HH:59:59");
|
||||
private static SimpleDateFormat sf00=new SimpleDateFormat("yyyy-MM-dd 00:00:00");
|
||||
private static SimpleDateFormat sf23=new SimpleDateFormat("yyyy-MM-dd 23:59:59");
|
||||
|
||||
private static SimpleDateFormat format =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
public static void main(String[] args) throws ParseException, CloneNotSupportedException, InterruptedException {
|
||||
String startTime="2023-05-01 00:00:00";
|
||||
String endTime="2023-05-16 10:53:22";
|
||||
System.out.println(splitDateByDay(startTime,endTime));
|
||||
// System.out.println(splitDateByDay(startTime,endTime));;
|
||||
}
|
||||
public static List<Map<String,String>> splitDateByHour(String startTime, String endTime) throws ParseException{
|
||||
Date currentDate = null;
|
||||
Date endDate= null;
|
||||
try {
|
||||
currentDate= format.parse(startTime);;//DateUtility.parse(startTime)
|
||||
|
||||
}catch (Exception e){
|
||||
LocalDate today = LocalDate.now(); // 获取当前日期
|
||||
LocalDate firstDayOfMonth = today.withDayOfMonth(1); // 设置当前日期为本月第一天
|
||||
currentDate = Date.from(firstDayOfMonth.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||
}
|
||||
|
||||
try {
|
||||
endDate= format.parse(endTime); //endTime.parse(endTime)
|
||||
}catch (Exception e){
|
||||
endDate = format.parse(format.format(new Date()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<Map<String,String>> dataList=new ArrayList<>();
|
||||
boolean first=true;
|
||||
while(currentDate.compareTo(endDate)<=0){
|
||||
Map<String,String> dataMap=new HashMap<>();
|
||||
dataMap.put("startTime",first?format.format(currentDate):sfMin00.format(currentDate));
|
||||
first=false;
|
||||
dataMap.put("endTime", DateUtils.addHours(currentDate,1).compareTo(endDate)>0?format.format(endDate):sfMin59.format(currentDate));
|
||||
dataList.add(dataMap);
|
||||
currentDate=DateUtils.addHours(currentDate,1);
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
public static List<Map<String,String>> splitDateByDay(String startTime,String endTime)throws ParseException{
|
||||
Date currentDate = null;
|
||||
Date endDate= null;
|
||||
try {
|
||||
currentDate= format.parse(startTime);;//DateUtility.parse(startTime)
|
||||
}catch (Exception e){
|
||||
// 获取当前日期
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 获取当前日期的00:00:00时间
|
||||
LocalTime midnight = LocalTime.MIDNIGHT;
|
||||
|
||||
LocalDateTime localDateTime = midnight.atDate(LocalDate.now());
|
||||
|
||||
// 转换为java.util.Date
|
||||
ZoneId zoneId = ZoneId.systemDefault(); // 使用系统默认时区
|
||||
currentDate = Date.from(localDateTime.atZone(zoneId).toInstant());
|
||||
}
|
||||
|
||||
try {
|
||||
endDate= format.parse(endTime); //endTime.parse(endTime)
|
||||
}catch (Exception e){
|
||||
endDate = format.parse(format.format(new Date()));
|
||||
}
|
||||
|
||||
|
||||
List<Map<String,String>> dataList=new ArrayList<>();
|
||||
boolean first=true;
|
||||
while(currentDate.compareTo(endDate)<=0){
|
||||
Map<String,String> dataMap=new HashMap<>();
|
||||
dataMap.put("startTime",first?format.format(currentDate):sf00.format(currentDate));
|
||||
first=false;
|
||||
dataMap.put("endTime", DateUtils.addDays(currentDate,1).compareTo(endDate)>0?format.format(endDate):sf23.format(currentDate));
|
||||
dataList.add(dataMap);
|
||||
currentDate=DateUtils.addDays(currentDate,1);
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,175 @@
|
||||
package com.nmgs.util;
|
||||
|
||||
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 时间工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
{
|
||||
public static String YYYY = "yyyy";
|
||||
|
||||
public static String YYYY_MM = "yyyy-MM";
|
||||
|
||||
public static String YYYY_MM_DD = "yyyy-MM-dd";
|
||||
|
||||
public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
|
||||
|
||||
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
private static String[] parsePatterns = {
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
||||
|
||||
/**
|
||||
* 获取当前Date型日期
|
||||
*
|
||||
* @return Date() 当前日期
|
||||
*/
|
||||
public static Date getNowDate()
|
||||
{
|
||||
return new Date();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期, 默认格式为yyyy-MM-dd
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String getDate()
|
||||
{
|
||||
return dateTimeNow(YYYY_MM_DD);
|
||||
}
|
||||
|
||||
public static final String getTime()
|
||||
{
|
||||
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
|
||||
}
|
||||
|
||||
public static final String dateTimeNow()
|
||||
{
|
||||
return dateTimeNow(YYYYMMDDHHMMSS);
|
||||
}
|
||||
|
||||
public static final String dateTimeNow(final String format)
|
||||
{
|
||||
return parseDateToStr(format, new Date());
|
||||
}
|
||||
|
||||
public static final String dateTime(final Date date)
|
||||
{
|
||||
return parseDateToStr(YYYY_MM_DD, date);
|
||||
}
|
||||
|
||||
public static final String parseDateToStr(final String format, final Date date)
|
||||
{
|
||||
return new SimpleDateFormat(format).format(date);
|
||||
}
|
||||
|
||||
public static final Date dateTime(final String format, final String ts)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new SimpleDateFormat(format).parse(ts);
|
||||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期路径 即年/月/日 如2018/08/08
|
||||
*/
|
||||
public static final String datePath()
|
||||
{
|
||||
Date now = new Date();
|
||||
return DateFormatUtils.format(now, "yyyy-MM-dd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期路径 即年/月/日 如20180808
|
||||
*/
|
||||
public static final String dateTime()
|
||||
{
|
||||
Date now = new Date();
|
||||
return DateFormatUtils.format(now, "yyyyMMdd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期型字符串转化为日期 格式
|
||||
*/
|
||||
public static Date parseDate(Object str)
|
||||
{
|
||||
if (str == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
return parseDate(str.toString(), parsePatterns);
|
||||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务器启动时间
|
||||
*/
|
||||
public static Date getServerStartDate()
|
||||
{
|
||||
long time = ManagementFactory.getRuntimeMXBean().getStartTime();
|
||||
return new Date(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两个时间差
|
||||
*/
|
||||
public static String getDatePoor(Date endDate, Date nowDate) {
|
||||
long nd = 1000 * 24 * 60 * 60;
|
||||
long nh = 1000 * 60 * 60;
|
||||
long nm = 1000 * 60;
|
||||
long ns = 1000;
|
||||
// 获得两个时间的毫秒时间差异
|
||||
long diff = endDate.getTime() - nowDate.getTime();
|
||||
// 计算差多少天
|
||||
long day = diff / nd;
|
||||
// 计算差多少小时
|
||||
long hour = diff % nd / nh;
|
||||
// 计算差多少分钟
|
||||
long min = diff % nd % nh / nm;
|
||||
// 计算差多少秒//输出结果
|
||||
long sec = diff % nd % nh % nm / ns;
|
||||
return day + "天" + hour + "小时" + min + "分钟" + sec + "秒";
|
||||
}
|
||||
public static String getDatePoorForMinSec(Date endDate, Date nowDate) {
|
||||
long nm = 1000 * 60;
|
||||
long ns = 1000;
|
||||
// 获得两个时间的毫秒时间差异
|
||||
long diff = endDate.getTime() - nowDate.getTime();
|
||||
// 计算差多少分钟
|
||||
long min = diff / nm;
|
||||
// 计算差多少秒//输出结果
|
||||
long sec = diff % nm / ns;
|
||||
return min + "分钟" + sec + "秒";
|
||||
}
|
||||
public static long getDatePoorForSec(Date endDate, Date nowDate) {
|
||||
long ns = 1000;
|
||||
// 获得两个时间的毫秒时间差异
|
||||
long diff = endDate.getTime() - nowDate.getTime();
|
||||
// 计算差多少秒//输出结果
|
||||
long sec = diff / ns;
|
||||
return sec;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.nmgs.util;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
public class ExceptionUtil {
|
||||
public static String getExceptionStr(Exception e){
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
PrintWriter writer = new PrintWriter(stringWriter);
|
||||
e.printStackTrace(writer);
|
||||
StringBuffer buffer = stringWriter.getBuffer();
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.nmgs.util;
|
||||
|
||||
public class PlateRegexutil {
|
||||
public static boolean isregex (String plateid) {
|
||||
String start = "(" +
|
||||
"京|津|冀|晋|蒙|辽|吉|黑|沪|苏|浙|皖|闽|赣|鲁|" +
|
||||
"豫|鄂|湘|粤|桂|琼|渝|川|贵|云|藏|陕|甘|青|宁|" +
|
||||
"新|港|澳|" +
|
||||
"军|空|海|北|沈|兰|济|南|广|成|临" +
|
||||
")";
|
||||
|
||||
String regex[] = {
|
||||
start + "[a-zA-Z]{1}[a-zA-Z0-9]{6}", //新能源车牌
|
||||
start + "[a-zA-Z]{1}[a-zA-Z0-9]{5}", //常规车牌
|
||||
start + "[a-zA-Z]{1}[a-zA-Z0-9]{4}(警|使|学|挂|领|港|澳|超|临)", //常规特种车牌
|
||||
"(WJ)[0-9]{2}[a-zA-Z0-9]{5}", //武警普通
|
||||
"(WJ)[0-9]{2}(消|边|通|森|金|警|电)[a-zA-Z0-9]{4}", //武警特种
|
||||
"(WJ)[a-zA-Z0-9]{1}[a-zA-Z0-9]{5}",
|
||||
"(WJ)[0-9]{2}(消|边|通|森|金|警|电|[a-zA-Z0-9])[a-zA-Z0-9]{4}", //武警(综合)
|
||||
"(WJ)(消|边|通|森|金|警|电|[a-zA-Z0-9])[a-zA-Z0-9]{5}",
|
||||
start + "[a-zA-Z]{1}[a-zA-Z0-9]{4}(警|使|学|挂|领|港|澳|超|临|[a-zA-Z0-9])"//常规(综合)
|
||||
};
|
||||
//总综合
|
||||
// regex = new String[]{"(" + start + "[a-zA-Z]{1}[a-zA-Z0-9]{4}(警|使|学|挂|领|港|澳|超|临|[a-zA-Z0-9]))|((WJ)[0-9]{2}(消|边|通|森|金|警|电|[a-zA-Z0-9])[a-zA-Z0-9]{4})"};
|
||||
|
||||
boolean relseltflag=false;
|
||||
for (int j = 0; j < regex.length; j++) {
|
||||
if (plateid.matches(regex[j])) {
|
||||
relseltflag= true;
|
||||
}
|
||||
}
|
||||
return relseltflag;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
org.springframework.boot.env.EnvironmentPostProcessor=\
|
||||
com.nmgs.MyEnvironmentPostProcessor
|
||||
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
|
||||
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
||||
version="3.1" metadata-complete="true">
|
||||
<display-name>Router for Tomcat</display-name>
|
||||
<error-page>
|
||||
<error-code>404</error-code>
|
||||
<location>/index.html</location>
|
||||
</error-page>
|
||||
</web-app>
|
||||
@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<link rel="icon" href="/favicon.ico"/>
|
||||
|
||||
<title></title>
|
||||
<script type="module" crossorigin src="./assets/index.2dc408bf.js"></script>
|
||||
<link rel="stylesheet" href="./assets/index.06f27ee2.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="loading">
|
||||
<div class="loading-wrap">
|
||||
<div class="loading-dots">
|
||||
<span class="dot dot-spin">
|
||||
<i></i>
|
||||
<i></i>
|
||||
<i></i>
|
||||
<i></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="loading-title">
|
||||
正在缓冲...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="./static/map_load.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,335 @@
|
||||
var BMap = window.BMap
|
||||
var BMapLib = (window.BMapLib = BMapLib || {})
|
||||
;(function () {
|
||||
var b = function (m, l, j) {
|
||||
l = d(l)
|
||||
var n = m.pointToPixel(l.getNorthEast())
|
||||
var i = m.pointToPixel(l.getSouthWest())
|
||||
n.x += j
|
||||
n.y -= j
|
||||
i.x -= j
|
||||
i.y += j
|
||||
var h = m.pixelToPoint(n)
|
||||
var k = m.pixelToPoint(i)
|
||||
return new BMap.Bounds(k, h)
|
||||
}
|
||||
var d = function (i) {
|
||||
var k = f(i.getNorthEast().lng, -180, 180)
|
||||
var h = f(i.getSouthWest().lng, -180, 180)
|
||||
var j = f(i.getNorthEast().lat, -74, 74)
|
||||
var l = f(i.getSouthWest().lat, -74, 74)
|
||||
return new BMap.Bounds(new BMap.Point(h, l), new BMap.Point(k, j))
|
||||
}
|
||||
var f = function (j, k, h) {
|
||||
k && (j = Math.max(j, k))
|
||||
h && (j = Math.min(j, h))
|
||||
return j
|
||||
}
|
||||
var a = function (h) {
|
||||
return '[object Array]' === Object.prototype.toString.call(h)
|
||||
}
|
||||
var c = function (l, n) {
|
||||
var j = -1
|
||||
if (a(n)) {
|
||||
if (n.indexOf) {
|
||||
j = n.indexOf(l)
|
||||
} else {
|
||||
for (var k = 0, h; (h = n[k]); k++) {
|
||||
if (h === l) {
|
||||
j = k
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return j
|
||||
}
|
||||
var e = (BMapLib.MarkerClusterer = function (l, h) {
|
||||
if (!l) {
|
||||
return
|
||||
}
|
||||
this._map = l
|
||||
this._markers = []
|
||||
this._clusters = []
|
||||
var k = h || {}
|
||||
this._gridSize = k.gridSize || 60
|
||||
this._maxZoom = k.maxZoom || 18
|
||||
this._minClusterSize = k.minClusterSize || 2
|
||||
this._isAverageCenter = false
|
||||
if (k.isAverageCenter != undefined) {
|
||||
this._isAverageCenter = k.isAverageCenter
|
||||
}
|
||||
this._styles = k.styles || []
|
||||
var j = this
|
||||
this._map.addEventListener('zoomend', function () {
|
||||
j._redraw()
|
||||
})
|
||||
this._map.addEventListener('moveend', function () {
|
||||
j._redraw()
|
||||
})
|
||||
var i = k.markers
|
||||
a(i) && this.addMarkers(i)
|
||||
})
|
||||
e.prototype.addMarkers = function (k) {
|
||||
for (var j = 0, h = k.length; j < h; j++) {
|
||||
this._pushMarkerTo(k[j])
|
||||
}
|
||||
this._createClusters()
|
||||
}
|
||||
e.prototype._pushMarkerTo = function (h) {
|
||||
var i = c(h, this._markers)
|
||||
if (i === -1) {
|
||||
h.isInCluster = false
|
||||
this._markers.push(h)
|
||||
}
|
||||
}
|
||||
e.prototype.addMarker = function (h) {
|
||||
this._pushMarkerTo(h)
|
||||
this._createClusters()
|
||||
}
|
||||
e.prototype._createClusters = function () {
|
||||
var j = this._map.getBounds()
|
||||
var l = b(this._map, j, this._gridSize)
|
||||
for (var k = 0, h; (h = this._markers[k]); k++) {
|
||||
if (!h.isInCluster && l.containsPoint(h.getPosition())) {
|
||||
this._addToClosestCluster(h)
|
||||
}
|
||||
}
|
||||
}
|
||||
e.prototype._addToClosestCluster = function (l) {
|
||||
var p = 4000000
|
||||
var n = null
|
||||
// var k = l.getPosition()
|
||||
for (var m = 0, j; (j = this._clusters[m]); m++) {
|
||||
var h = j.getCenter()
|
||||
if (h) {
|
||||
var o = this._map.getDistance(h, l.getPosition())
|
||||
if (o < p) {
|
||||
p = o
|
||||
n = j
|
||||
}
|
||||
}
|
||||
}
|
||||
if (n && n.isMarkerInClusterBounds(l)) {
|
||||
n.addMarker(l)
|
||||
} else {
|
||||
// eslint-disable-next-line
|
||||
var j = new g(this)
|
||||
j.addMarker(l)
|
||||
this._clusters.push(j)
|
||||
}
|
||||
}
|
||||
e.prototype._clearLastClusters = function () {
|
||||
for (var j = 0, h; (h = this._clusters[j]); j++) {
|
||||
h.remove()
|
||||
}
|
||||
this._clusters = []
|
||||
this._removeMarkersFromCluster()
|
||||
}
|
||||
e.prototype._removeMarkersFromCluster = function () {
|
||||
for (var j = 0, h; (h = this._markers[j]); j++) {
|
||||
h.isInCluster = false
|
||||
}
|
||||
}
|
||||
e.prototype._removeMarkersFromMap = function () {
|
||||
for (var j = 0, h; (h = this._markers[j]); j++) {
|
||||
h.isInCluster = false
|
||||
this._map.removeOverlay(h)
|
||||
}
|
||||
}
|
||||
e.prototype._removeMarker = function (h) {
|
||||
var i = c(h, this._markers)
|
||||
if (i === -1) {
|
||||
return false
|
||||
}
|
||||
this._map.removeOverlay(h)
|
||||
this._markers.splice(i, 1)
|
||||
return true
|
||||
}
|
||||
e.prototype.removeMarker = function (h) {
|
||||
var i = this._removeMarker(h)
|
||||
if (i) {
|
||||
this._clearLastClusters()
|
||||
this._createClusters()
|
||||
}
|
||||
return i
|
||||
}
|
||||
e.prototype.removeMarkers = function (l) {
|
||||
var k = false
|
||||
for (var h = 0; h < l.length; h++) {
|
||||
var j = this._removeMarker(l[h])
|
||||
k = k || j
|
||||
}
|
||||
if (k) {
|
||||
this._clearLastClusters()
|
||||
this._createClusters()
|
||||
}
|
||||
return k
|
||||
}
|
||||
e.prototype.clearMarkers = function () {
|
||||
this._clearLastClusters()
|
||||
this._removeMarkersFromMap()
|
||||
this._markers = []
|
||||
}
|
||||
e.prototype._redraw = function () {
|
||||
this._clearLastClusters()
|
||||
this._createClusters()
|
||||
}
|
||||
e.prototype.getGridSize = function () {
|
||||
return this._gridSize
|
||||
}
|
||||
e.prototype.setGridSize = function (h) {
|
||||
this._gridSize = h
|
||||
this._redraw()
|
||||
}
|
||||
e.prototype.getMaxZoom = function () {
|
||||
return this._maxZoom
|
||||
}
|
||||
e.prototype.setMaxZoom = function (h) {
|
||||
this._maxZoom = h
|
||||
this._redraw()
|
||||
}
|
||||
e.prototype.getStyles = function () {
|
||||
return this._styles
|
||||
}
|
||||
e.prototype.setStyles = function (h) {
|
||||
this._styles = h
|
||||
this._redraw()
|
||||
}
|
||||
e.prototype.getMinClusterSize = function () {
|
||||
return this._minClusterSize
|
||||
}
|
||||
e.prototype.setMinClusterSize = function (h) {
|
||||
this._minClusterSize = h
|
||||
this._redraw()
|
||||
}
|
||||
e.prototype.isAverageCenter = function () {
|
||||
return this._isAverageCenter
|
||||
}
|
||||
e.prototype.getMap = function () {
|
||||
return this._map
|
||||
}
|
||||
e.prototype.getMarkers = function () {
|
||||
return this._markers
|
||||
}
|
||||
e.prototype.getClustersCount = function () {
|
||||
var k = 0
|
||||
for (var j = 0, h; (h = this._clusters[j]); j++) {
|
||||
h.isReal() && k++
|
||||
}
|
||||
return k
|
||||
}
|
||||
|
||||
function g(h) {
|
||||
this._markerClusterer = h
|
||||
this._map = h.getMap()
|
||||
this._minClusterSize = h.getMinClusterSize()
|
||||
this._isAverageCenter = h.isAverageCenter()
|
||||
this._center = null
|
||||
this._markers = []
|
||||
this._gridBounds = null
|
||||
this._isReal = false
|
||||
this._clusterMarker = new BMapLib.TextIconOverlay(
|
||||
this._center,
|
||||
this._markers.length,
|
||||
{
|
||||
styles: this._markerClusterer.getStyles(),
|
||||
}
|
||||
)
|
||||
}
|
||||
g.prototype.addMarker = function (k) {
|
||||
if (this.isMarkerInCluster(k)) {
|
||||
return false
|
||||
}
|
||||
if (!this._center) {
|
||||
this._center = k.getPosition()
|
||||
this.updateGridBounds()
|
||||
} else {
|
||||
if (this._isAverageCenter) {
|
||||
var j = this._markers.length + 1
|
||||
var o = (this._center.lat * (j - 1) + k.getPosition().lat) / j
|
||||
var m = (this._center.lng * (j - 1) + k.getPosition().lng) / j
|
||||
this._center = new BMap.Point(m, o)
|
||||
this.updateGridBounds()
|
||||
}
|
||||
}
|
||||
k.isInCluster = true
|
||||
this._markers.push(k)
|
||||
var h = this._markers.length
|
||||
if (h < this._minClusterSize) {
|
||||
this._map.addOverlay(k)
|
||||
return true
|
||||
} else {
|
||||
if (h === this._minClusterSize) {
|
||||
for (var n = 0; n < h; n++) {
|
||||
this._markers[n].getMap() && this._map.removeOverlay(this._markers[n])
|
||||
}
|
||||
}
|
||||
}
|
||||
this._map.addOverlay(this._clusterMarker)
|
||||
this._isReal = true
|
||||
this.updateClusterMarker()
|
||||
return true
|
||||
}
|
||||
g.prototype.isMarkerInCluster = function (j) {
|
||||
if (this._markers.indexOf) {
|
||||
return this._markers.indexOf(j) != -1
|
||||
} else {
|
||||
for (var k = 0, h; (h = this._markers[k]); k++) {
|
||||
if (h === j) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
g.prototype.isMarkerInClusterBounds = function (h) {
|
||||
return this._gridBounds.containsPoint(h.getPosition())
|
||||
}
|
||||
g.prototype.isReal = function () {
|
||||
return this._isReal
|
||||
}
|
||||
g.prototype.updateGridBounds = function () {
|
||||
var h = new BMap.Bounds(this._center, this._center)
|
||||
this._gridBounds = b(this._map, h, this._markerClusterer.getGridSize())
|
||||
}
|
||||
g.prototype.updateClusterMarker = function () {
|
||||
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
||||
this._clusterMarker && this._map.removeOverlay(this._clusterMarker)
|
||||
for (var l = 0, j; (j = this._markers[l]); l++) {
|
||||
this._map.addOverlay(j)
|
||||
}
|
||||
return
|
||||
}
|
||||
if (this._markers.length < this._minClusterSize) {
|
||||
this._clusterMarker.hide()
|
||||
return
|
||||
}
|
||||
this._clusterMarker.setPosition(this._center)
|
||||
this._clusterMarker.setText(this._markers.length)
|
||||
var k = this._map
|
||||
var h = this.getBounds()
|
||||
this._clusterMarker.addEventListener('click', function () {
|
||||
k.setViewport(h)
|
||||
})
|
||||
}
|
||||
g.prototype.remove = function () {
|
||||
// eslint-disable-next-line
|
||||
for (var j = 0, h; (h = this._markers[j]); j++) {
|
||||
this._markers[j].getMap() && this._map.removeOverlay(this._markers[j])
|
||||
}
|
||||
this._map.removeOverlay(this._clusterMarker)
|
||||
this._markers.length = 0
|
||||
delete this._markers
|
||||
}
|
||||
g.prototype.getBounds = function () {
|
||||
var k = new BMap.Bounds(this._center, this._center)
|
||||
for (var j = 0, h; (h = this._markers[j]); j++) {
|
||||
k.extend(h.getPosition())
|
||||
}
|
||||
return k
|
||||
}
|
||||
g.prototype.getCenter = function () {
|
||||
return this._center
|
||||
}
|
||||
})()
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 49 B |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 326 B |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 624 B |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 73 B |
|
After Width: | Height: | Size: 73 B |
|
After Width: | Height: | Size: 76 B |
|
After Width: | Height: | Size: 59 B |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 899 B |
|
After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 61 B |
|
After Width: | Height: | Size: 628 B |
|
After Width: | Height: | Size: 326 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 983 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.2 KiB |