Skip to content

Instantly share code, notes, and snippets.

@lichunjiang1989
Created October 28, 2019 03:42
Show Gist options
  • Save lichunjiang1989/d70b6d713a1c3e31ccf6afbab68851aa to your computer and use it in GitHub Desktop.
Save lichunjiang1989/d70b6d713a1c3e31ccf6afbab68851aa to your computer and use it in GitHub Desktop.
This gist exceeds the recommended number of files (~10). To access all files, please clone this gist.
HELP.md
/target/
/linghang/
!.mvn/wrapper/maven-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
/build/
### VS Code ###
.vscode/
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<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="linghang" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="linghang" options="-parameters" />
</option>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
</component>
</project>
<?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" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="3fd579e2-0523-460b-82d5-6abf7c2bf0db" name="Default Changelist" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="localRepository" value="E:\.m2\repository" />
<option name="mavenHome" value="D:/apache-maven-3.6.1" />
<option name="userSettingsFile" value="D:\apache-maven-3.6.1\conf\settings.xml" />
</MavenGeneralSettings>
</option>
</component>
<component name="ProjectId" id="1Sd2zByyE9CgmS0Qr9bg4q068tz" />
<component name="PropertiesComponent">
<property name="RequestMappingsPanelOrder0" value="0" />
<property name="RequestMappingsPanelOrder1" value="1" />
<property name="RequestMappingsPanelWidth0" value="75" />
<property name="RequestMappingsPanelWidth1" value="75" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/main/docker" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="preferences.sourceCode" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="E:\workSpacetime\linghang\src\main\docker" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager" selected="Docker.docker/Dockerfile">
<configuration name="LinghangApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="linghang" />
<option name="SPRING_BOOT_MAIN_CLASS" value="cn.com.sailfish.linghang.LinghangApplication" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="docker/Dockerfile" type="docker-deploy" factoryName="dockerfile" temporary="true" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="buildCliOptions" value="" />
<option name="command" value="" />
<option name="containerName" value="" />
<option name="entrypoint" value="" />
<option name="imageTag" value="" />
<option name="commandLineOptions" value="" />
<option name="sourceFilePath" value="src/main/docker/Dockerfile" />
</settings>
</deployment>
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Docker.docker/Dockerfile" />
</list>
</recent_temporary>
</component>
<component name="ServiceViewManager">
<option name="allServicesViewState">
<serviceView>
<treeState>
<expand />
<select />
</treeState>
</serviceView>
</option>
<option name="selectedView" value="0" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="3fd579e2-0523-460b-82d5-6abf7c2bf0db" name="Default Changelist" comment="" />
<created>1571879412789</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1571879412789</updated>
<workItem from="1571879418648" duration="1226000" />
<workItem from="1571881352020" duration="24521000" />
<workItem from="1571995188919" duration="4159000" />
<workItem from="1572222682587" duration="9770000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
</project>
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.util.Properties;
public class MavenWrapperDownloader {
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: : " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
2019-10-24 09:52:51.525 INFO 3444 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 3444 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 09:52:51.534 INFO 3444 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 09:52:53.111 INFO 3444 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 09:52:53.153 INFO 3444 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 09:52:53.155 INFO 3444 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 09:52:53.155 INFO 3444 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 09:52:53.155 INFO 3444 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:52:53.155 INFO 3444 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:52:53.155 INFO 3444 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 09:52:53.155 INFO 3444 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:52:53.155 INFO 3444 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:52:53.155 INFO 3444 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:52:53.191 INFO 3444 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 09:52:53.339 INFO 3444 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 09:52:53.340 INFO 3444 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 09:52:59.388 ERROR 3444 --- [restartedMain] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:905)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:830)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:136)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:266)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:307)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at cn.com.sailfish.linghang.LinghangApplication.main(LinghangApplication.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2241)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2265)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1319)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:868)
... 35 common frames omitted
2019-10-24 09:52:59.389 WARN 3444 --- [restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [cn/com/sailfish/linghang/config/LiquibaseConfig.class]: Invocation of init method failed; nested exception is liquibase.exception.DatabaseException: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
2019-10-24 09:52:59.408 ERROR 3444 --- [restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [cn/com/sailfish/linghang/config/LiquibaseConfig.class]: Invocation of init method failed; nested exception is liquibase.exception.DatabaseException: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:307)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at cn.com.sailfish.linghang.LinghangApplication.main(LinghangApplication.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: liquibase.exception.DatabaseException: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:271)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774)
... 21 common frames omitted
Caused by: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:905)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:830)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:136)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:266)
... 23 common frames omitted
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2241)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2265)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1319)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:868)
... 35 common frames omitted
2019-10-24 09:55:24.149 INFO 1348 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 1348 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 09:55:24.151 INFO 1348 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 09:55:25.642 INFO 1348 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 09:55:25.727 INFO 1348 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 09:55:25.728 INFO 1348 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 09:55:25.728 INFO 1348 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 09:55:25.728 INFO 1348 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:55:25.728 INFO 1348 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:55:25.728 INFO 1348 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 09:55:25.728 INFO 1348 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:55:25.728 INFO 1348 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:55:25.729 INFO 1348 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:55:25.764 INFO 1348 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 09:55:25.856 INFO 1348 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 09:55:25.857 INFO 1348 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 09:55:31.861 ERROR 1348 --- [restartedMain] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:905)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:830)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:136)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:266)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:307)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at cn.com.sailfish.linghang.LinghangApplication.main(LinghangApplication.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2241)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2265)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1319)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:868)
... 35 common frames omitted
2019-10-24 09:55:31.862 WARN 1348 --- [restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [cn/com/sailfish/linghang/config/LiquibaseConfig.class]: Invocation of init method failed; nested exception is liquibase.exception.DatabaseException: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
2019-10-24 09:55:31.882 ERROR 1348 --- [restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [cn/com/sailfish/linghang/config/LiquibaseConfig.class]: Invocation of init method failed; nested exception is liquibase.exception.DatabaseException: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:307)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at cn.com.sailfish.linghang.LinghangApplication.main(LinghangApplication.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: liquibase.exception.DatabaseException: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:271)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774)
... 21 common frames omitted
Caused by: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:905)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:830)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:136)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:266)
... 23 common frames omitted
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2241)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2265)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1319)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:868)
... 35 common frames omitted
2019-10-24 09:56:58.099 INFO 4088 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 4088 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 09:56:58.100 INFO 4088 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 09:56:59.600 INFO 4088 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 09:56:59.691 INFO 4088 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 09:56:59.692 INFO 4088 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 09:56:59.692 INFO 4088 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 09:56:59.693 INFO 4088 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:56:59.693 INFO 4088 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:56:59.693 INFO 4088 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 09:56:59.693 INFO 4088 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:56:59.693 INFO 4088 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:56:59.693 INFO 4088 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:56:59.734 INFO 4088 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 09:56:59.835 INFO 4088 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 09:56:59.836 INFO 4088 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 09:57:02.001 ERROR 4088 --- [restartedMain] l.p.core.xml.XMLChangeLogSAXParser$1 : cvc-complex-type.2.3: 元素 'changeSet' 必须不含字符 [子级], 因为该类型的内容类型为“仅元素”。
2019-10-24 09:57:02.195 WARN 4088 --- [restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [cn/com/sailfish/linghang/config/LiquibaseConfig.class]: Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Error parsing line 187 column 17 of classpath:changelog/change/2.linghang_add_constraints.xml: cvc-complex-type.2.3: 元素 'changeSet' 必须不含字符 [子级], 因为该类型的内容类型为“仅元素”。
2019-10-24 09:57:02.221 ERROR 4088 --- [restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [cn/com/sailfish/linghang/config/LiquibaseConfig.class]: Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Error parsing line 187 column 17 of classpath:changelog/change/2.linghang_add_constraints.xml: cvc-complex-type.2.3: 元素 'changeSet' 必须不含字符 [子级], 因为该类型的内容类型为“仅元素”。
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:307)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at cn.com.sailfish.linghang.LinghangApplication.main(LinghangApplication.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Error parsing line 187 column 17 of classpath:changelog/change/2.linghang_add_constraints.xml: cvc-complex-type.2.3: 元素 'changeSet' 必须不含字符 [子级], 因为该类型的内容类型为“仅元素”。
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25)
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:217)
at liquibase.Liquibase.update(Liquibase.java:190)
at liquibase.Liquibase.update(Liquibase.java:179)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:317)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:269)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774)
... 21 common frames omitted
Caused by: liquibase.exception.SetupException: Error parsing line 187 column 17 of classpath:changelog/change/2.linghang_add_constraints.xml: cvc-complex-type.2.3: 元素 'changeSet' 必须不含字符 [子级], 因为该类型的内容类型为“仅元素”。
at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:336)
at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:293)
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:23)
... 28 common frames omitted
Caused by: liquibase.exception.ChangeLogParseException: Error parsing line 187 column 17 of classpath:changelog/change/2.linghang_add_constraints.xml: cvc-complex-type.2.3: 元素 'changeSet' 必须不含字符 [子级], 因为该类型的内容类型为“仅元素”。
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:120)
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:15)
at liquibase.changelog.DatabaseChangeLog.include(DatabaseChangeLog.java:525)
at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:334)
... 30 common frames omitted
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.3: 元素 'changeSet' 必须不含字符 [子级], 因为该类型的内容类型为“仅元素”。
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:453)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3231)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidComplexType(XMLSchemaValidator.java:3194)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(XMLSchemaValidator.java:3154)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(XMLSchemaValidator.java:3056)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2135)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:854)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:112)
... 33 common frames omitted
2019-10-24 09:58:55.972 INFO 9976 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 9976 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 09:58:55.973 INFO 9976 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 09:58:57.497 INFO 9976 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 09:58:57.584 INFO 9976 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 09:58:57.585 INFO 9976 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 09:58:57.585 INFO 9976 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 09:58:57.585 INFO 9976 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:58:57.585 INFO 9976 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:58:57.585 INFO 9976 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 09:58:57.585 INFO 9976 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:58:57.585 INFO 9976 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:58:57.585 INFO 9976 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 09:58:57.622 INFO 9976 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 09:58:57.719 INFO 9976 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 09:58:57.720 INFO 9976 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 10:00:30.075 ERROR 9976 --- [restartedMain] liquibase.changelog.ChangeSet : Change Set classpath:changelog/change/1.linghang_initialize_table.xml::initial-01::AutoCoder (maintained by newma) failed. Error: Table 'engine' already exists [Failed SQL: CREATE TABLE linghang.engine (id BIGINT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NULL COMMENT '发动机名字, 长度大于1小于50, 不为空且唯一 ', type INT NULL COMMENT '发动机和名字对应的值 0:非发动机检查项; 1:V2500; 2:CFM56; 3:PW1100 ', gmt_created timestamp DEFAULT NOW() NOT NULL COMMENT '创建时间(系统自动生成)', gmt_modified timestamp NULL COMMENT '最后修改时间(系统自动生成)', CONSTRAINT PK_ENGINE PRIMARY KEY (id), UNIQUE (name)) COMMENT='发动机信息表']
2019-10-24 10:00:30.193 WARN 9976 --- [restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [cn/com/sailfish/linghang/config/LiquibaseConfig.class]: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set classpath:changelog/change/1.linghang_initialize_table.xml::initial-01::AutoCoder (maintained by newma):
Reason: liquibase.exception.DatabaseException: Table 'engine' already exists [Failed SQL: CREATE TABLE linghang.engine (id BIGINT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NULL COMMENT '发动机名字, 长度大于1小于50, 不为空且唯一 ', type INT NULL COMMENT '发动机和名字对应的值 0:非发动机检查项; 1:V2500; 2:CFM56; 3:PW1100 ', gmt_created timestamp DEFAULT NOW() NOT NULL COMMENT '创建时间(系统自动生成)', gmt_modified timestamp NULL COMMENT '最后修改时间(系统自动生成)', CONSTRAINT PK_ENGINE PRIMARY KEY (id), UNIQUE (name)) COMMENT='发动机信息表']
2019-10-24 10:00:30.228 ERROR 9976 --- [restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [cn/com/sailfish/linghang/config/LiquibaseConfig.class]: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set classpath:changelog/change/1.linghang_initialize_table.xml::initial-01::AutoCoder (maintained by newma):
Reason: liquibase.exception.DatabaseException: Table 'engine' already exists [Failed SQL: CREATE TABLE linghang.engine (id BIGINT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NULL COMMENT '发动机名字, 长度大于1小于50, 不为空且唯一 ', type INT NULL COMMENT '发动机和名字对应的值 0:非发动机检查项; 1:V2500; 2:CFM56; 3:PW1100 ', gmt_created timestamp DEFAULT NOW() NOT NULL COMMENT '创建时间(系统自动生成)', gmt_modified timestamp NULL COMMENT '最后修改时间(系统自动生成)', CONSTRAINT PK_ENGINE PRIMARY KEY (id), UNIQUE (name)) COMMENT='发动机信息表']
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:307)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at cn.com.sailfish.linghang.LinghangApplication.main(LinghangApplication.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set classpath:changelog/change/1.linghang_initialize_table.xml::initial-01::AutoCoder (maintained by newma):
Reason: liquibase.exception.DatabaseException: Table 'engine' already exists [Failed SQL: CREATE TABLE linghang.engine (id BIGINT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NULL COMMENT '发动机名字, 长度大于1小于50, 不为空且唯一 ', type INT NULL COMMENT '发动机和名字对应的值 0:非发动机检查项; 1:V2500; 2:CFM56; 3:PW1100 ', gmt_created timestamp DEFAULT NOW() NOT NULL COMMENT '创建时间(系统自动生成)', gmt_modified timestamp NULL COMMENT '最后修改时间(系统自动生成)', CONSTRAINT PK_ENGINE PRIMARY KEY (id), UNIQUE (name)) COMMENT='发动机信息表']
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:637)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:78)
at liquibase.Liquibase.update(Liquibase.java:202)
at liquibase.Liquibase.update(Liquibase.java:179)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:317)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:269)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774)
... 21 common frames omitted
Caused by: liquibase.exception.DatabaseException: Table 'engine' already exists [Failed SQL: CREATE TABLE linghang.engine (id BIGINT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NULL COMMENT '发动机名字, 长度大于1小于50, 不为空且唯一 ', type INT NULL COMMENT '发动机和名字对应的值 0:非发动机检查项; 1:V2500; 2:CFM56; 3:PW1100 ', gmt_created timestamp DEFAULT NOW() NOT NULL COMMENT '创建时间(系统自动生成)', gmt_modified timestamp NULL COMMENT '最后修改时间(系统自动生成)', CONSTRAINT PK_ENGINE PRIMARY KEY (id), UNIQUE (name)) COMMENT='发动机信息表']
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:356)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:57)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:125)
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1229)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1211)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:600)
... 29 common frames omitted
Caused by: java.sql.SQLSyntaxErrorException: Table 'engine' already exists
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:782)
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:666)
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:352)
... 34 common frames omitted
2019-10-24 10:08:04.220 INFO 9448 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 9448 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 10:08:04.222 INFO 9448 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 10:08:05.731 INFO 9448 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 10:08:05.823 INFO 9448 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 10:08:05.824 INFO 9448 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:08:05.824 INFO 9448 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:08:05.825 INFO 9448 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:08:05.825 INFO 9448 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:08:05.825 INFO 9448 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:08:05.825 INFO 9448 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:08:05.825 INFO 9448 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:08:05.825 INFO 9448 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:08:05.860 INFO 9448 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 10:08:05.955 INFO 9448 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 10:08:05.956 INFO 9448 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 10:08:09.879 INFO 9448 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor
2019-10-24 10:08:09.883 INFO 9448 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWithMD5AndDES
2019-10-24 10:08:09.883 INFO 9448 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000
2019-10-24 10:08:09.883 INFO 9448 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.poolSize, using default value: 1
2019-10-24 10:08:09.884 INFO 9448 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerName, using default value: null
2019-10-24 10:08:09.884 INFO 9448 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerClassName, using default value: null
2019-10-24 10:08:09.884 INFO 9448 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator
2019-10-24 10:08:09.884 INFO 9448 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64
2019-10-24 10:08:09.899 INFO 9448 --- [restartedMain] c.c.s.linghang.service.RabbitmqService : localhost
2019-10-24 10:08:13.737 INFO 9448 --- [restartedMain] c.c.s.linghang.LinghangApplication : Started LinghangApplication in 10.03 seconds (JVM running for 10.699)
2019-10-24 10:08:13.749 INFO 9448 --- [restartedMain] c.c.s.linghang.LinghangApplication :
----------------------------------------------------------
Application 'linghang' is running! Access URLs:
Local: http://localhost:9191
External: http://10.0.75.1:9191
Profile(s): [dev, swagger]
----------------------------------------------------------
2019-10-24 10:08:13.749 INFO 9448 --- [restartedMain] c.c.s.linghang.LinghangApplication :
-------------------------- spring cloud --------------------------------
Config Server: Not found or not setup for this application
----------------------------------------------------------
2019-10-24 10:08:13.899 DEBUG 9448 --- [RMI TCP Connection(1)-10.0.75.1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:08:16.344 INFO 9448 --- [registrationTask1] d.c.b.a.c.r.ApplicationRegistrator : Application registered itself as 5bf1a11d836a
2019-10-24 10:08:16.378 DEBUG 9448 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:08:33.245 DEBUG 9448 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:08:53.257 DEBUG 9448 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:09:13.240 DEBUG 9448 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:09:23.289 DEBUG 9448 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:09:43.248 DEBUG 9448 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:10:03.240 DEBUG 9448 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:10:23.250 DEBUG 9448 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:10:43.240 DEBUG 9448 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:11:03.239 DEBUG 9448 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:11:23.240 DEBUG 9448 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:11:43.240 DEBUG 9448 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:12:03.239 DEBUG 9448 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:12:11.183 INFO 8184 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 8184 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 10:12:11.185 INFO 8184 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 10:12:12.661 INFO 8184 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 10:12:12.749 INFO 8184 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 10:12:12.750 INFO 8184 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:12:12.750 INFO 8184 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:12:12.751 INFO 8184 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:12:12.751 INFO 8184 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:12:12.751 INFO 8184 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:12:12.751 INFO 8184 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:12:12.751 INFO 8184 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:12:12.751 INFO 8184 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:12:12.789 INFO 8184 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 10:12:12.889 INFO 8184 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 10:12:12.890 INFO 8184 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 10:12:16.769 INFO 8184 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor
2019-10-24 10:12:16.773 INFO 8184 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWithMD5AndDES
2019-10-24 10:12:16.773 INFO 8184 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000
2019-10-24 10:12:16.773 INFO 8184 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.poolSize, using default value: 1
2019-10-24 10:12:16.773 INFO 8184 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerName, using default value: null
2019-10-24 10:12:16.773 INFO 8184 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerClassName, using default value: null
2019-10-24 10:12:16.773 INFO 8184 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator
2019-10-24 10:12:16.774 INFO 8184 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64
2019-10-24 10:12:16.787 INFO 8184 --- [restartedMain] c.c.s.linghang.service.RabbitmqService : localhost
2019-10-24 10:12:20.494 INFO 8184 --- [restartedMain] c.c.s.linghang.LinghangApplication : Started LinghangApplication in 9.767 seconds (JVM running for 10.391)
2019-10-24 10:12:20.505 INFO 8184 --- [restartedMain] c.c.s.linghang.LinghangApplication :
----------------------------------------------------------
Application 'linghang' is running! Access URLs:
Local: http://localhost:9191
External: http://10.0.75.1:9191
Profile(s): [dev, swagger]
----------------------------------------------------------
2019-10-24 10:12:20.505 INFO 8184 --- [restartedMain] c.c.s.linghang.LinghangApplication :
-------------------------- spring cloud --------------------------------
Config Server: Not found or not setup for this application
----------------------------------------------------------
2019-10-24 10:12:21.064 DEBUG 8184 --- [RMI TCP Connection(5)-10.0.75.1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:12:23.104 INFO 8184 --- [registrationTask1] d.c.b.a.c.r.ApplicationRegistrator : Application registered itself as 5bf1a11d836a
2019-10-24 10:12:23.136 DEBUG 8184 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:12:40.025 DEBUG 8184 --- [http-nio-9191-exec-6] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:12:56.098 INFO 3656 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 3656 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 10:12:56.100 INFO 3656 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 10:12:57.557 INFO 3656 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 10:12:57.643 INFO 3656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 10:12:57.644 INFO 3656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:12:57.644 INFO 3656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:12:57.644 INFO 3656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:12:57.644 INFO 3656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:12:57.644 INFO 3656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:12:57.644 INFO 3656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:12:57.645 INFO 3656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:12:57.645 INFO 3656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:12:57.679 INFO 3656 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 10:12:57.772 INFO 3656 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 10:12:57.773 INFO 3656 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 10:13:01.623 INFO 3656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor
2019-10-24 10:13:01.627 INFO 3656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWithMD5AndDES
2019-10-24 10:13:01.627 INFO 3656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000
2019-10-24 10:13:01.627 INFO 3656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.poolSize, using default value: 1
2019-10-24 10:13:01.627 INFO 3656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerName, using default value: null
2019-10-24 10:13:01.628 INFO 3656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerClassName, using default value: null
2019-10-24 10:13:01.628 INFO 3656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator
2019-10-24 10:13:01.628 INFO 3656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64
2019-10-24 10:13:01.644 INFO 3656 --- [restartedMain] c.c.s.linghang.service.RabbitmqService : localhost
2019-10-24 10:13:05.355 INFO 3656 --- [restartedMain] c.c.s.linghang.LinghangApplication : Started LinghangApplication in 9.736 seconds (JVM running for 10.372)
2019-10-24 10:13:05.366 INFO 3656 --- [restartedMain] c.c.s.linghang.LinghangApplication :
----------------------------------------------------------
Application 'linghang' is running! Access URLs:
Local: http://localhost:9191
External: http://10.0.75.1:9191
Profile(s): [dev, swagger]
----------------------------------------------------------
2019-10-24 10:13:05.366 INFO 3656 --- [restartedMain] c.c.s.linghang.LinghangApplication :
-------------------------- spring cloud --------------------------------
Config Server: Not found or not setup for this application
----------------------------------------------------------
2019-10-24 10:13:05.845 DEBUG 3656 --- [RMI TCP Connection(1)-10.0.75.1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:13:07.956 INFO 3656 --- [registrationTask1] d.c.b.a.c.r.ApplicationRegistrator : Application registered itself as 5bf1a11d836a
2019-10-24 10:13:07.989 DEBUG 3656 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:13:13.569 WARN 3656 --- [http-nio-9191-exec-9] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'GET' not supported]
2019-10-24 10:13:24.886 DEBUG 3656 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:13:44.883 DEBUG 3656 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:14:04.882 DEBUG 3656 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:14:24.882 DEBUG 3656 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:14:44.881 DEBUG 3656 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:15:04.881 DEBUG 3656 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:15:24.898 DEBUG 3656 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:15:39.406 INFO 11260 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 11260 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 10:15:39.408 INFO 11260 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 10:15:41.016 INFO 11260 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 10:15:41.102 INFO 11260 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 10:15:41.103 INFO 11260 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:15:41.103 INFO 11260 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:15:41.103 INFO 11260 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:15:41.104 INFO 11260 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:15:41.104 INFO 11260 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:15:41.104 INFO 11260 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:15:41.104 INFO 11260 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:15:41.104 INFO 11260 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:15:41.139 INFO 11260 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 10:15:41.233 INFO 11260 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 10:15:41.234 INFO 11260 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 10:15:45.219 INFO 11260 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor
2019-10-24 10:15:45.223 INFO 11260 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWithMD5AndDES
2019-10-24 10:15:45.224 INFO 11260 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000
2019-10-24 10:15:45.224 INFO 11260 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.poolSize, using default value: 1
2019-10-24 10:15:45.224 INFO 11260 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerName, using default value: null
2019-10-24 10:15:45.224 INFO 11260 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerClassName, using default value: null
2019-10-24 10:15:45.224 INFO 11260 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator
2019-10-24 10:15:45.224 INFO 11260 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64
2019-10-24 10:15:45.238 INFO 11260 --- [restartedMain] c.c.s.linghang.service.RabbitmqService : localhost
2019-10-24 10:15:48.952 INFO 11260 --- [restartedMain] c.c.s.linghang.LinghangApplication : Started LinghangApplication in 10.045 seconds (JVM running for 10.659)
2019-10-24 10:15:48.963 INFO 11260 --- [restartedMain] c.c.s.linghang.LinghangApplication :
----------------------------------------------------------
Application 'linghang' is running! Access URLs:
Local: http://localhost:9191
External: http://10.0.75.1:9191
Profile(s): [dev, swagger]
----------------------------------------------------------
2019-10-24 10:15:48.964 INFO 11260 --- [restartedMain] c.c.s.linghang.LinghangApplication :
-------------------------- spring cloud --------------------------------
Config Server: Not found or not setup for this application
----------------------------------------------------------
2019-10-24 10:15:49.063 DEBUG 11260 --- [RMI TCP Connection(1)-10.0.75.1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:15:51.550 INFO 11260 --- [registrationTask1] d.c.b.a.c.r.ApplicationRegistrator : Application registered itself as 5bf1a11d836a
2019-10-24 10:15:51.583 DEBUG 11260 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:16:01.410 WARN 11260 --- [http-nio-9191-exec-6] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'deptment' is not present]
2019-10-24 10:16:08.494 DEBUG 11260 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:16:16.885 WARN 11260 --- [http-nio-9191-exec-2] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'deptment' is not present]
2019-10-24 10:16:28.473 DEBUG 11260 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:16:48.474 DEBUG 11260 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:17:08.491 DEBUG 11260 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:17:28.474 DEBUG 11260 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:17:48.476 DEBUG 11260 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:18:08.473 DEBUG 11260 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:18:28.471 DEBUG 11260 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:18:48.474 DEBUG 11260 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:19:08.485 DEBUG 11260 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:19:28.473 DEBUG 11260 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:19:48.475 DEBUG 11260 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:20:08.472 DEBUG 11260 --- [http-nio-9191-exec-6] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:20:28.474 DEBUG 11260 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:20:48.476 DEBUG 11260 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:21:08.474 DEBUG 11260 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:21:28.473 DEBUG 11260 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:21:48.488 DEBUG 11260 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:22:08.488 DEBUG 11260 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:22:28.488 DEBUG 11260 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:22:48.475 DEBUG 11260 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:22:55.647 WARN 11260 --- [http-nio-9191-exec-8] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'deptment' is not present]
2019-10-24 10:23:08.478 DEBUG 11260 --- [http-nio-9191-exec-6] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:23:28.475 DEBUG 11260 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:23:48.475 DEBUG 11260 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:24:08.487 DEBUG 11260 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:24:28.474 DEBUG 11260 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:24:48.474 DEBUG 11260 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:25:33.696 INFO 12012 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 12012 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 10:25:33.698 INFO 12012 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 10:25:35.589 INFO 12012 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 10:25:35.638 INFO 12012 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 10:25:35.639 INFO 12012 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:25:35.639 INFO 12012 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:25:35.639 INFO 12012 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:25:35.640 INFO 12012 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:25:35.640 INFO 12012 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:25:35.640 INFO 12012 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:25:35.640 INFO 12012 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:25:35.640 INFO 12012 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:25:35.685 INFO 12012 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 10:25:35.800 INFO 12012 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 10:25:35.802 INFO 12012 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 10:25:40.355 INFO 12012 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor
2019-10-24 10:25:40.361 INFO 12012 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWithMD5AndDES
2019-10-24 10:25:40.361 INFO 12012 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000
2019-10-24 10:25:40.361 INFO 12012 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.poolSize, using default value: 1
2019-10-24 10:25:40.361 INFO 12012 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerName, using default value: null
2019-10-24 10:25:40.361 INFO 12012 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerClassName, using default value: null
2019-10-24 10:25:40.361 INFO 12012 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator
2019-10-24 10:25:40.362 INFO 12012 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64
2019-10-24 10:25:40.379 INFO 12012 --- [restartedMain] c.c.s.linghang.service.RabbitmqService : localhost
2019-10-24 10:25:46.289 INFO 12012 --- [restartedMain] c.c.s.linghang.LinghangApplication : Started LinghangApplication in 13.124 seconds (JVM running for 14.87)
2019-10-24 10:25:46.303 INFO 12012 --- [restartedMain] c.c.s.linghang.LinghangApplication :
----------------------------------------------------------
Application 'linghang' is running! Access URLs:
Local: http://localhost:9191
External: http://10.0.75.1:9191
Profile(s): [dev, swagger]
----------------------------------------------------------
2019-10-24 10:25:46.304 INFO 12012 --- [restartedMain] c.c.s.linghang.LinghangApplication :
-------------------------- spring cloud --------------------------------
Config Server: Not found or not setup for this application
----------------------------------------------------------
2019-10-24 10:25:46.525 DEBUG 12012 --- [RMI TCP Connection(6)-10.0.75.1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:25:48.945 INFO 12012 --- [registrationTask1] d.c.b.a.c.r.ApplicationRegistrator : Application registered itself as 5bf1a11d836a
2019-10-24 10:25:48.982 DEBUG 12012 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:26:05.708 DEBUG 12012 --- [http-nio-9191-exec-6] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:26:25.704 DEBUG 12012 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:26:47.022 INFO 11748 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 11748 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 10:26:47.024 INFO 11748 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 10:26:49.059 INFO 11748 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 10:26:49.108 INFO 11748 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 10:26:49.109 INFO 11748 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:26:49.109 INFO 11748 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:26:49.109 INFO 11748 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:26:49.109 INFO 11748 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:26:49.110 INFO 11748 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:26:49.110 INFO 11748 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:26:49.110 INFO 11748 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:26:49.110 INFO 11748 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:26:49.154 INFO 11748 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 10:26:49.265 INFO 11748 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 10:26:49.267 INFO 11748 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 10:26:53.796 INFO 11748 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor
2019-10-24 10:26:53.802 INFO 11748 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWithMD5AndDES
2019-10-24 10:26:53.802 INFO 11748 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000
2019-10-24 10:26:53.802 INFO 11748 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.poolSize, using default value: 1
2019-10-24 10:26:53.802 INFO 11748 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerName, using default value: null
2019-10-24 10:26:53.802 INFO 11748 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerClassName, using default value: null
2019-10-24 10:26:53.802 INFO 11748 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator
2019-10-24 10:26:53.803 INFO 11748 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64
2019-10-24 10:26:53.820 INFO 11748 --- [restartedMain] c.c.s.linghang.service.RabbitmqService : localhost
2019-10-24 10:26:57.838 INFO 11748 --- [restartedMain] c.c.s.linghang.LinghangApplication : Started LinghangApplication in 11.434 seconds (JVM running for 12.218)
2019-10-24 10:26:57.853 INFO 11748 --- [restartedMain] c.c.s.linghang.LinghangApplication :
----------------------------------------------------------
Application 'linghang' is running! Access URLs:
Local: http://localhost:9191
External: http://10.0.75.1:9191
Profile(s): [dev, swagger]
----------------------------------------------------------
2019-10-24 10:26:57.853 INFO 11748 --- [restartedMain] c.c.s.linghang.LinghangApplication :
-------------------------- spring cloud --------------------------------
Config Server: Not found or not setup for this application
----------------------------------------------------------
2019-10-24 10:26:58.250 DEBUG 11748 --- [RMI TCP Connection(4)-10.0.75.1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:27:00.497 INFO 11748 --- [registrationTask1] d.c.b.a.c.r.ApplicationRegistrator : Application registered itself as 5bf1a11d836a
2019-10-24 10:27:00.537 DEBUG 11748 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:27:17.273 DEBUG 11748 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:27:22.527 WARN 11748 --- [http-nio-9191-exec-8] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'deptment' is not present]
2019-10-24 10:27:37.274 DEBUG 11748 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:27:57.273 DEBUG 11748 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:28:17.292 DEBUG 11748 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:28:37.274 DEBUG 11748 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:28:57.284 DEBUG 11748 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:29:17.273 DEBUG 11748 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:29:37.275 DEBUG 11748 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:29:57.273 DEBUG 11748 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:29:58.333 WARN 11748 --- [http-nio-9191-exec-6] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'course' is not present]
2019-10-24 10:30:11.782 WARN 11748 --- [http-nio-9191-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'type' is not present]
2019-10-24 10:30:17.274 DEBUG 11748 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:30:20.209 WARN 11748 --- [http-nio-9191-exec-9] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'startTime' is not present]
2019-10-24 10:30:29.940 WARN 11748 --- [http-nio-9191-exec-3] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'endTime' is not present]
2019-10-24 10:30:45.432 DEBUG 11748 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:30:46.574 INFO 11748 --- [http-nio-9191-exec-1] c.c.s.l.resource.UserInfoResource : list.size() is 0
2019-10-24 10:30:57.669 DEBUG 11748 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:30:57.677 DEBUG 11748 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:31:19.677 DEBUG 11748 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:31:19.678 DEBUG 11748 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:31:29.865 INFO 9656 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 9656 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 10:31:29.867 INFO 9656 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 10:31:31.608 INFO 9656 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 10:31:31.692 INFO 9656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 10:31:31.693 INFO 9656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:31:31.693 INFO 9656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:31:31.694 INFO 9656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:31:31.694 INFO 9656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:31:31.694 INFO 9656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:31:31.694 INFO 9656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:31:31.694 INFO 9656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:31:31.694 INFO 9656 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:31:31.729 INFO 9656 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 10:31:31.821 INFO 9656 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 10:31:31.822 INFO 9656 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 10:31:35.613 INFO 9656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor
2019-10-24 10:31:35.617 INFO 9656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWithMD5AndDES
2019-10-24 10:31:35.617 INFO 9656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000
2019-10-24 10:31:35.617 INFO 9656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.poolSize, using default value: 1
2019-10-24 10:31:35.617 INFO 9656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerName, using default value: null
2019-10-24 10:31:35.617 INFO 9656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerClassName, using default value: null
2019-10-24 10:31:35.617 INFO 9656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator
2019-10-24 10:31:35.618 INFO 9656 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64
2019-10-24 10:31:35.632 INFO 9656 --- [restartedMain] c.c.s.linghang.service.RabbitmqService : localhost
2019-10-24 10:31:39.379 INFO 9656 --- [restartedMain] c.c.s.linghang.LinghangApplication : Started LinghangApplication in 10.046 seconds (JVM running for 10.742)
2019-10-24 10:31:39.391 INFO 9656 --- [restartedMain] c.c.s.linghang.LinghangApplication :
----------------------------------------------------------
Application 'linghang' is running! Access URLs:
Local: http://localhost:9191
External: http://10.0.75.1:9191
Profile(s): [dev, swagger]
----------------------------------------------------------
2019-10-24 10:31:39.392 INFO 9656 --- [restartedMain] c.c.s.linghang.LinghangApplication :
-------------------------- spring cloud --------------------------------
Config Server: Not found or not setup for this application
----------------------------------------------------------
2019-10-24 10:31:39.600 DEBUG 9656 --- [RMI TCP Connection(3)-10.0.75.1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:31:41.978 INFO 9656 --- [registrationTask1] d.c.b.a.c.r.ApplicationRegistrator : Application registered itself as 5bf1a11d836a
2019-10-24 10:31:42.012 DEBUG 9656 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:31:45.916 INFO 9656 --- [http-nio-9191-exec-6] c.c.s.l.resource.UserInfoResource : list.size() is 0
2019-10-24 10:31:58.891 DEBUG 9656 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:31:58.897 DEBUG 9656 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:32:18.890 DEBUG 9656 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:32:18.891 DEBUG 9656 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:32:38.889 DEBUG 9656 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:32:38.890 DEBUG 9656 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:32:58.907 DEBUG 9656 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:32:58.911 DEBUG 9656 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:33:18.934 DEBUG 9656 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:33:18.938 DEBUG 9656 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:33:38.892 DEBUG 9656 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:33:38.893 DEBUG 9656 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:34:00.364 INFO 2400 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 2400 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 10:34:00.365 INFO 2400 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 10:34:01.839 INFO 2400 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 10:34:01.926 INFO 2400 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 10:34:01.927 INFO 2400 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:34:01.927 INFO 2400 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:34:01.928 INFO 2400 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:34:01.928 INFO 2400 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:34:01.928 INFO 2400 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:34:01.928 INFO 2400 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:34:01.928 INFO 2400 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:34:01.928 INFO 2400 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:34:01.964 INFO 2400 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 10:34:02.059 INFO 2400 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 10:34:02.060 INFO 2400 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 10:34:05.885 INFO 2400 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor
2019-10-24 10:34:05.890 INFO 2400 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWithMD5AndDES
2019-10-24 10:34:05.890 INFO 2400 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000
2019-10-24 10:34:05.890 INFO 2400 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.poolSize, using default value: 1
2019-10-24 10:34:05.890 INFO 2400 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerName, using default value: null
2019-10-24 10:34:05.890 INFO 2400 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerClassName, using default value: null
2019-10-24 10:34:05.890 INFO 2400 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator
2019-10-24 10:34:05.891 INFO 2400 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64
2019-10-24 10:34:05.906 INFO 2400 --- [restartedMain] c.c.s.linghang.service.RabbitmqService : localhost
2019-10-24 10:34:09.652 INFO 2400 --- [restartedMain] c.c.s.linghang.LinghangApplication : Started LinghangApplication in 9.768 seconds (JVM running for 10.43)
2019-10-24 10:34:09.663 INFO 2400 --- [restartedMain] c.c.s.linghang.LinghangApplication :
----------------------------------------------------------
Application 'linghang' is running! Access URLs:
Local: http://localhost:9191
External: http://10.0.75.1:9191
Profile(s): [dev, swagger]
----------------------------------------------------------
2019-10-24 10:34:09.663 INFO 2400 --- [restartedMain] c.c.s.linghang.LinghangApplication :
-------------------------- spring cloud --------------------------------
Config Server: Not found or not setup for this application
----------------------------------------------------------
2019-10-24 10:34:10.288 DEBUG 2400 --- [RMI TCP Connection(3)-10.0.75.1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:34:12.259 INFO 2400 --- [registrationTask1] d.c.b.a.c.r.ApplicationRegistrator : Application registered itself as 5bf1a11d836a
2019-10-24 10:34:12.293 DEBUG 2400 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:34:15.930 INFO 2400 --- [http-nio-9191-exec-6] c.c.s.l.resource.UserInfoResource : list.size() is 0
2019-10-24 10:34:29.168 DEBUG 2400 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:34:29.174 DEBUG 2400 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:34:49.166 DEBUG 2400 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:34:49.167 DEBUG 2400 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:35:05.335 INFO 2824 --- [restartedMain] c.c.s.linghang.LinghangApplication : Starting LinghangApplication on M78VK017XEFZ48Q with PID 2824 (E:\workSpacetime\linghang\target\classes started by Administrator in E:\workSpacetime\linghang)
2019-10-24 10:35:05.337 INFO 2824 --- [restartedMain] c.c.s.linghang.LinghangApplication : The following profiles are active: dev,swagger
2019-10-24 10:35:06.899 INFO 2824 --- [restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2019-10-24 10:35:06.991 INFO 2824 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2019-10-24 10:35:06.993 INFO 2824 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:35:06.993 INFO 2824 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:35:06.993 INFO 2824 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:35:06.993 INFO 2824 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:35:06.993 INFO 2824 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2019-10-24 10:35:06.993 INFO 2824 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:35:06.993 INFO 2824 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:35:06.994 INFO 2824 --- [restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
2019-10-24 10:35:07.030 INFO 2824 --- [restartedMain] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
2019-10-24 10:35:07.131 INFO 2824 --- [restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
2019-10-24 10:35:07.132 INFO 2824 --- [restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
2019-10-24 10:35:11.234 INFO 2824 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor
2019-10-24 10:35:11.238 INFO 2824 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWithMD5AndDES
2019-10-24 10:35:11.238 INFO 2824 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000
2019-10-24 10:35:11.239 INFO 2824 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.poolSize, using default value: 1
2019-10-24 10:35:11.239 INFO 2824 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerName, using default value: null
2019-10-24 10:35:11.239 INFO 2824 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerClassName, using default value: null
2019-10-24 10:35:11.239 INFO 2824 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator
2019-10-24 10:35:11.239 INFO 2824 --- [restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64
2019-10-24 10:35:11.254 INFO 2824 --- [restartedMain] c.c.s.linghang.service.RabbitmqService : localhost
2019-10-24 10:35:14.994 INFO 2824 --- [restartedMain] c.c.s.linghang.LinghangApplication : Started LinghangApplication in 10.193 seconds (JVM running for 10.844)
2019-10-24 10:35:15.006 INFO 2824 --- [restartedMain] c.c.s.linghang.LinghangApplication :
----------------------------------------------------------
Application 'linghang' is running! Access URLs:
Local: http://localhost:9191
External: http://10.0.75.1:9191
Profile(s): [dev, swagger]
----------------------------------------------------------
2019-10-24 10:35:15.006 INFO 2824 --- [restartedMain] c.c.s.linghang.LinghangApplication :
-------------------------- spring cloud --------------------------------
Config Server: Not found or not setup for this application
----------------------------------------------------------
2019-10-24 10:35:15.237 DEBUG 2824 --- [RMI TCP Connection(5)-10.0.75.1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:35:17.607 INFO 2824 --- [registrationTask1] d.c.b.a.c.r.ApplicationRegistrator : Application registered itself as 5bf1a11d836a
2019-10-24 10:35:17.642 DEBUG 2824 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:35:22.372 INFO 2824 --- [http-nio-9191-exec-5] c.c.s.l.resource.UserInfoResource : list.size() is 0
2019-10-24 10:35:34.509 DEBUG 2824 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:35:34.515 DEBUG 2824 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:35:54.507 DEBUG 2824 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:35:54.508 DEBUG 2824 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:36:14.508 DEBUG 2824 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:36:14.509 DEBUG 2824 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:36:34.511 DEBUG 2824 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:36:34.512 DEBUG 2824 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:36:54.526 DEBUG 2824 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:36:54.529 DEBUG 2824 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:37:14.508 DEBUG 2824 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:37:14.509 DEBUG 2824 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:37:34.507 DEBUG 2824 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:37:34.508 DEBUG 2824 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:37:54.511 DEBUG 2824 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:37:54.512 DEBUG 2824 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:38:14.518 DEBUG 2824 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:38:14.519 DEBUG 2824 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:38:34.523 DEBUG 2824 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:38:34.526 DEBUG 2824 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:38:54.507 DEBUG 2824 --- [http-nio-9191-exec-6] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:38:54.508 DEBUG 2824 --- [http-nio-9191-exec-6] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:39:14.511 DEBUG 2824 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:39:14.513 DEBUG 2824 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:39:34.518 DEBUG 2824 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:39:34.521 DEBUG 2824 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:39:54.524 DEBUG 2824 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:39:54.529 DEBUG 2824 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:40:14.507 DEBUG 2824 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:40:14.508 DEBUG 2824 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:40:34.525 DEBUG 2824 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:40:34.529 DEBUG 2824 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:40:54.511 DEBUG 2824 --- [http-nio-9191-exec-6] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:40:54.512 DEBUG 2824 --- [http-nio-9191-exec-6] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:41:14.508 DEBUG 2824 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:41:14.509 DEBUG 2824 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:41:34.507 DEBUG 2824 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:41:34.508 DEBUG 2824 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:41:54.514 DEBUG 2824 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:41:54.515 DEBUG 2824 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:42:14.523 DEBUG 2824 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:42:14.527 DEBUG 2824 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:42:34.508 DEBUG 2824 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:42:34.509 DEBUG 2824 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:42:54.524 DEBUG 2824 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:42:54.527 DEBUG 2824 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:43:14.521 DEBUG 2824 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:43:14.524 DEBUG 2824 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:43:34.521 DEBUG 2824 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:43:34.524 DEBUG 2824 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:43:54.509 DEBUG 2824 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:43:54.510 DEBUG 2824 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:44:14.510 DEBUG 2824 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:44:14.510 DEBUG 2824 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:44:34.509 DEBUG 2824 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:44:34.510 DEBUG 2824 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:44:54.509 DEBUG 2824 --- [http-nio-9191-exec-6] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:44:54.510 DEBUG 2824 --- [http-nio-9191-exec-6] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:45:14.508 DEBUG 2824 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:45:14.509 DEBUG 2824 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:45:34.506 DEBUG 2824 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:45:34.507 DEBUG 2824 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:45:54.523 DEBUG 2824 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:45:54.526 DEBUG 2824 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:46:14.507 DEBUG 2824 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:46:14.508 DEBUG 2824 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:46:34.506 DEBUG 2824 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:46:34.507 DEBUG 2824 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:46:54.520 DEBUG 2824 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:46:54.524 DEBUG 2824 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:47:14.513 DEBUG 2824 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:47:14.514 DEBUG 2824 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:47:34.513 DEBUG 2824 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:47:34.515 DEBUG 2824 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:47:54.516 DEBUG 2824 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:47:54.517 DEBUG 2824 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:48:14.523 DEBUG 2824 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:48:14.526 DEBUG 2824 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:48:34.511 DEBUG 2824 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:48:34.514 DEBUG 2824 --- [http-nio-9191-exec-1] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:48:54.522 DEBUG 2824 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:48:54.526 DEBUG 2824 --- [http-nio-9191-exec-3] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:49:14.518 DEBUG 2824 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:49:14.519 DEBUG 2824 --- [http-nio-9191-exec-8] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:49:34.523 DEBUG 2824 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:49:34.527 DEBUG 2824 --- [http-nio-9191-exec-4] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:49:54.509 DEBUG 2824 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:49:54.509 DEBUG 2824 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:50:14.521 DEBUG 2824 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:50:14.525 DEBUG 2824 --- [http-nio-9191-exec-9] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:50:34.521 DEBUG 2824 --- [http-nio-9191-exec-6] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:50:34.524 DEBUG 2824 --- [http-nio-9191-exec-6] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:50:54.521 DEBUG 2824 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:50:54.525 DEBUG 2824 --- [http-nio-9191-exec-5] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:51:14.510 DEBUG 2824 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:51:14.510 DEBUG 2824 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:51:34.516 DEBUG 2824 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:51:34.517 DEBUG 2824 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:51:54.509 DEBUG 2824 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:51:54.510 DEBUG 2824 --- [http-nio-9191-exec-7] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:52:14.508 DEBUG 2824 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:52:14.509 DEBUG 2824 --- [http-nio-9191-exec-2] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
2019-10-24 10:52:34.513 DEBUG 2824 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : Executing SQL query [/* ping */ SELECT 1]
2019-10-24 10:52:34.514 DEBUG 2824 --- [http-nio-9191-exec-10] o.s.jdbc.core.JdbcTemplate : SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: '""']
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
basePath=$(cd `dirname $0`; pwd)
ROOT_DIR=${basePath}/..
PROJECT_DIR=${ROOT_DIR}/linghang
DOMAIN_DIR=${PROJECT_DIR}/src/main/java/cn/com/sailfish/linghang/domain
SCRIPT_DIR=${ROOT_DIR}/scripts/jdl_generator
JDL_DIR=${ROOT_DIR}/doc/2.design/b.dataModel
PACKAGE=cn.com.sailfish.linghang
if [ ! -d ${DOMAIN_DIR} ]; then
if [ ! -f ${SCRIPT_DIR}/main.py ]; then
echo "Error: not found main.py in directory ${SCRIPT_DIR}"
exit 1
else
echo "Auto generating jpa code and liquibase xml file ..."
python ${SCRIPT_DIR}/main.py ${JDL_DIR}/linghang.jdl -p ${PACKAGE} -w ${PROJECT_DIR} -t ${SCRIPT_DIR}/template -g ${SCRIPT_DIR}/grammar
fi
fi
if [ $? -ne 0 ]; then
exit $?
else
echo "Generate code done!"
fi
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
# TODO classpath?
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
wget "$jarUrl" -O "$wrapperJarPath"
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
curl -o "$wrapperJarPath" "$jarUrl"
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@set ROOT_DIR=%~dp0..
@set PROJECT_DIR=%ROOT_DIR%\linghang
@set DOMAIN_DIR=%PROJECT_DIR%\src\main\java\cn\com\sailfish\linghang\domain
@set SCRIPT_DIR=%ROOT_DIR%\scripts\jdl_generator
@set JDL_DIR=%ROOT_DIR%\doc\2.design\b.dataModel
@set PACKAGE=cn.com.sailfish.linghang
@if not exist "%DOMAIN_DIR%" (
if exist "%SCRIPT_DIR%\main.py" (
echo "Auto generate jdl code ..."
python "%SCRIPT_DIR%\main.py" "%JDL_DIR%\linghang.jdl" -p %PACKAGE% -w "%PROJECT_DIR%" -t "%SCRIPT_DIR%\template" -g "%SCRIPT_DIR%\grammar"
) else (
echo "Error: not found main.py in directory %SCRIPT_DIR%"
goto error
)
)
@REM set title of command window
title %0
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
echo Found %WRAPPER_JAR%
) else (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
echo Finished downloading %WRAPPER_JAR%
)
@REM End of extension
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
<?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 http://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.1.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>cn.com.sailfish</groupId>
<artifactId>linghang</artifactId>
<version>1.0.0</version>
<name>linghang</name>
<packaging>jar</packaging>
<description>Ling Hang project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<start-class>cn.com.sailfish.linghang.LinghangApplication</start-class>
<docker.image.prefix>springio</docker.image.prefix>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<liquibase.version>3.6.1</liquibase.version>
<springfox.version>2.9.2</springfox.version>
<SBA.version>2.1.1</SBA.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>${liquibase.version}</version>
</dependency>
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<!-- war need to disable embed tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>compile</scope>
</dependency>
<!-- swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.16</version>
</dependency>
<!-- H2 Database for test and dev -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<!-- 监控模块 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- 监控界面 -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${SBA.version}</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
<version>${SBA.version}</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
<version>${SBA.version}</version>
</dependency>
<!-- JSON -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.0</version>
</dependency>
<!-- poi excel文件信息的导入-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.18</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>com.github.axet</groupId>
<artifactId>kaptcha</artifactId>
<version>0.0.9</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/dom4j-2.1.1.jar</systemPath>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.9.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>28.0-jre</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.22</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
<version>9.0.22</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/tomcat-embed-websocket-9.0.22.jar</systemPath>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>spring-boot:run</defaultGoal>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<!-- 构建信息 -->
<execution>
<goals>
<goal>build-info</goal>
</goals>
<configuration>
<additionalProperties>
<encoding.source>UTF-8</encoding.source>
<encoding.reporting>UTF-8</encoding.reporting>
<java.source>${maven.compiler.source}</java.source>
<java.target>${maven.compiler.target}</java.target>
</additionalProperties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.1.1</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<!--指定docker镜像的版本号-->
<imageTags>
<!--使用maven项目的版本号-->
<imageTag>${project.version}</imageTag>
<imageTag>latest</imageTag>
</imageTags>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
<!-- git 的版本信息 -->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<configuration>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${liquibase.version}</version>
<configuration>
<propertyFile>src/main/resources/liquibase.properties</propertyFile>
</configuration>
</plugin>
<!-- 单元测试覆盖率 -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.0</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>jacoco-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>PACKAGE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.85</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
# https://docs.docker.com/engine/reference/builder/#dockerignore-file
classes/
generated-sources/
generated-test-sources/
h2db/
maven-archiver/
maven-status/
reports/
surefire-reports/
test-classes/
test-results/
www/
!*.jar
!*.war
version: '2'
services:
linghangapplication-app:
image: registry.cn-shenzhen.aliyuncs.com/sailfish/linghang-back-end-repo:latest_production_master
environment:
- TZ=Asia/Shanghai # 指定容器时区为东八区
- _JAVA_OPTIONS=-Xmx512m -Xms256m
- SPRING_PROFILES_ACTIVE=prod,swagger
- SAILFISH_SLEEP=3 # gives time for the database to boot before the application
#- SPRING_DATASOURCE_URL=jdbc:mysql://linghangapplication-mysql:3306/linghangapplication?useUnicode=true&characterEncoding=utf8&useSSL=false
#- SPRING_DATA_JEST_URI=http://linghangapplication-elasticsearch:9200
restart: always
# volumes:
# - ./logs:/home/haituke/logs
# - ./tmp:/tmp
ports:
- 9191:9191
networks:
- linghang-net
# linghang-mysql:
# extends:
# file: mysql.yml
# service: linghang-mysql
# linghang-elasticsearch:
# extends:
# file: elasticsearch.yml
# service: linghang-elasticsearch
networks:
linghang-net:
driver: bridge
version: '2'
services:
linghangapplication-app:
image: registry.cn-shenzhen.aliyuncs.com/sailfish/linghang-back-end-repo:latest_staging_master
environment:
- TZ=Asia/Shanghai # 指定容器时区为东八区
- _JAVA_OPTIONS=-Xmx512m -Xms256m
- SPRING_PROFILES_ACTIVE=preprod,swagger
- SAILFISH_SLEEP=3 # gives time for the database to boot before the application
#- SPRING_DATASOURCE_URL=jdbc:mysql://linghangapplication-mysql:3306/linghangapplication?useUnicode=true&characterEncoding=utf8&useSSL=false
#- SPRING_DATA_JEST_URI=http://linghangapplication-elasticsearch:9200
restart: always
# volumes:
# - ./logs:/home/haituke/logs
# - ./tmp:/tmp
ports:
- 9191:9191
networks:
- linghang-net
# linghang-mysql:
# extends:
# file: mysql.yml
# service: linghang-mysql
# linghang-elasticsearch:
# extends:
# file: elasticsearch.yml
# service: linghang-elasticsearch
networks:
linghang-net:
driver: bridge
version: '2'
services:
linghangapplication-app:
image: docker
environment:
- TZ=Asia/Shanghai # 指定容器时区为东八区
- _JAVA_OPTIONS=-Xmx512m -Xms256m
- SPRING_PROFILES_ACTIVE=dev,swagger
- SAILFISH_SLEEP=3 # gives time for the database to boot before the application
#- SPRING_DATASOURCE_URL=jdbc:mysql://linghangapplication-mysql:3306/linghangapplication?useUnicode=true&characterEncoding=utf8&useSSL=false
#- SPRING_DATA_JEST_URI=http://linghangapplication-elasticsearch:9200
restart: always
# volumes:
# - ./logs:/home/haituke/logs
# - ./tmp:/tmp
ports:
- 9191:9191
networks:
- linghang-net
# linghang-mysql:
# extends:
# file: mysql.yml
# service: linghang-mysql
# linghang-elasticsearch:
# extends:
# file: elasticsearch.yml
# service: linghang-elasticsearch
networks:
linghang-net:
driver: bridge
#!/bin/bash
#=======================
VERSION=0.1
DATE=2019年05月05日21:34:53
MAINTAINER="zengqiaowen<qwzeng@sailfish.com.cn>"
#======================
PROG_NAME=$0
ACTION=$1
ONLINE_OFFLINE_WAIT_TIME=1 # 实例上下线的等待时间
APP_START_TIMEOUT=60 # 等待应用启动的时间
APP_PORT=9191 # 应用端口
HEALTH_CHECK_URL=http://127.0.0.1:${APP_PORT}/actuator/info # 应用健康检查URL
HEALTH_CHECK_FILE_DIR=/home/sailfish/datadisk/linghang-project/docker/status # 脚本会在这个目录下生成nginx-status文件
RUN_HOME=/home/sailfish/datadisk/linghang-project/docker #应用运行位置
APP_HOME=/home/sailfish/datadisk/linghang-project/rdc-build-output # 从package.tgz中解压出来的jar包放到这个目录下
WAR_NAME=*.war
REGISTRY_URL=127.0.0.1:8761
APP_LOG=${RUN_HOME}/logs/app.log
APP_FLAG=registry.cn-shenzhen.aliyuncs.com/sailfish/linghang-back-end-repo
mkdir -p ${HEALTH_CHECK_FILE_DIR}
mkdir -p ${APP_HOME}
mkdir -p ${RUN_HOME}/logs
now=$(date +'%F %H:%M:%S')
echo "***自动部署脚本,该脚本由${MAINTAINER}维护,版本号为${VERSION},时间${DATE}***"
echo "执行脚本:$PROG_NAME $ACTION"
#usage() {
usage() {
echo "Usage: $PROG_NAME {start|stop|online|offline|restart}"
exit 2
}
online() {
touch -m $HEALTH_CHECK_FILE_DIR/nginx-status || exit 1
echo "wait app online in ${ONLINE_OFFLINE_WAIT_TIME} seconds..."
sleep ${ONLINE_OFFLINE_WAIT_TIME}
}
offline() {
rm -rf $HEALTH_CHECK_FILE_DIR/nginx-status || exit 1
echo "wait app offline in ${ONLINE_OFFLINE_WAIT_TIME} seconds..."
sleep ${ONLINE_OFFLINE_WAIT_TIME}
}
health_check() {
exptime=0
echo "checking ${HEALTH_CHECK_URL}"
while true
do
status_code=`/usr/bin/curl -L -o /dev/null --connect-timeout 5 -s -w %{http_code} ${HEALTH_CHECK_URL}`
if [ x$status_code != x200 ];then
sleep 1
((exptime++))
echo -n -e "\rWait app to pass health check: $exptime..."
else
break
fi
if [ $exptime -gt ${APP_START_TIMEOUT} ]; then
echo
echo "${now}[ERROR] `app start failed`"
echo "${now}[INFO] 查看最近1000行启动log"
tail -n 1000 ${APP_FLAG}logs/app.log
exit 2
fi
done
echo "${now}[INFO] check ${HEALTH_CHECK_URL} success"
}
start_application() {
#tar -zxvf package.gz
cd ${RUN_HOME}
echo '===================starting the application================================'
Cur_Dir=$(pwd)
echo "${now}[INFO] 当前路径 $Cur_Dir...[${now}]"
echo "待更新文件 md5:`md5sum $APP_HOME/docker_url` "
echo "待更新文件docker镜像内容:`more $APP_HOME/docker_url` "
echo "待更新文件构建时间:`ls -al $APP_HOME/docker_url` "
echo 'starting the docker container from images'
docker-compose -f app_production.yml up -d
}
stop_application() {
cd ${RUN_HOME}
echo '*******************stopping the application**********************************'
Cur_Dir=$(pwd)
echo " 当前路径 $Cur_Dir...[${now}]"
CONTAINER_ID=`docker ps | grep ${APP_FLAG} | grep -v grep | awk '{print $1}'`
echo "当前docker容器id:${CONTAINER_ID}"
if [ ! -z "$CONTAINER_ID" ]; then
echo 'stopping the docker container and remove old docker images'
docker-compose -f app_production.yml down
echo "rm docker images"
# 说明:docker images 查询出所有的image,然后通过grep 使用扩展的正则表达式匹配,找出含有aaa或者bbb的映像文件,
# 接着用awk打印出第三列也就是hash值的那一列,再通过uniq把重复的去掉(如果做了tag会有多个名字有相同的hash值),然后将结果作为参数传给删除命令.
# link https://blog.csdn.net/babys/article/details/71191027
docker images | grep -E "(registry.cn-shenzhen.aliyuncs.com/sailfish/linghang-back-end-repo)" | awk '{print $3}' | uniq | xargs -I {} docker rmi --force {}
exit 0
else
echo 'docker container is not running'
fi
}
start() {
# stop_application
start_application
health_check
online
}
stop() {
offline
stop_application
}
case "$ACTION" in
start)
start
;;
stop)
stop
;;
online)
online
;;
offline)
offline
;;
restart)
stop
start
;;
*)
usage
;;
esac
FROM openjdk:8-jre-alpine
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
HAITUKE_SLEEP=0 \
JAVA_OPTS=""
# Add a haituke user to run our application so that it doesn't need to run as root
RUN adduser -D -s /bin/sh haituke
RUN set -xe && apk --no-cache add ttf-dejavu fontconfig
WORKDIR /home/haituke
ADD entrypoint.sh entrypoint.sh
RUN chmod 755 entrypoint.sh && chown haituke:haituke entrypoint.sh
USER haituke
ENTRYPOINT ["./entrypoint.sh"]
EXPOSE 9090
ADD *.jar app.war
FROM openjdk:8-jre-alpine
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
HAITUKE_SLEEP=0 \
JAVA_OPTS=""
# Add a haituke user to run our application so that it doesn't need to run as root
RUN adduser -D -s /bin/sh haituke
RUN set -xe && apk --no-cache add ttf-dejavu fontconfig
WORKDIR /home/haituke
ADD entrypoint.sh entrypoint.sh
RUN chmod 755 entrypoint.sh && chown haituke:haituke entrypoint.sh
USER haituke
ENTRYPOINT ["./entrypoint.sh"]
EXPOSE 9090
ADD *.jar app.war
FROM openjdk:8-jre-alpine
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
HAITUKE_SLEEP=0 \
JAVA_OPTS=""
# Add a haituke user to run our application so that it doesn't need to run as root
RUN adduser -D -s /bin/sh haituke
RUN set -xe && apk --no-cache add ttf-dejavu fontconfig
WORKDIR /home/haituke
ADD entrypoint.sh entrypoint.sh
RUN chmod 755 entrypoint.sh && chown haituke:haituke entrypoint.sh
USER haituke
ENTRYPOINT ["./entrypoint.sh"]
EXPOSE 9090
ADD *.jar app.war
version: '2'
services:
shennong-elasticsearch:
image: elasticsearch:5.6.13
# volumes:
# - ~/volumes/shennong/shennong/elasticsearch/:/usr/share/elasticsearch/data/
ports:
- 9200:9200
- 9300:9300
command: -Enetwork.host=0.0.0.0 -Ediscovery.type=single-node
environment:
- "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
#!/bin/sh
echo "The application will start in ${SAILFISH_SLEEP}s..." && sleep ${SAILFISH_SLEEP}
exec java ${JAVA_OPTS} -D java.security.egd=file:/dev/./urandom -jar "${HOME}/app.war" "$@"
version: '2'
services:
linghang-mysql:
image: mysql:5.7.20
volumes:
- ./volumes/linghang/mysql/:/var/lib/mysql/
environment:
- MYSQL_ROOT_PASSWORD=Sailfish020
#- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_DATABASE=linghang_db
- MYSQL_USER=linghang-user
- MYSQL_PASSWORD=KcOWpZrsskAODic6
ports:
- 13306:3306
command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8mb4 --explicit_defaults_for_timestamp

构建和运行一个“神农”应用的 Docker image

  • With Maven, type: ./mvnw package -Pprod verify jib:dockerBuild

在项目根目录执行以下命令,将编排运行整个linghang项目

    docker-compose -f linghang/src/main/docker/app_testing.yml up

操作数据库

如果只想对数据库应用进行启动和关闭操作,只需要运行下面的命令

With MySQL: docker-compose -f linghang/src/main/docker/mysql.yml up

代码质量管理

除了阿里巴巴的java代码检测,这里我们还可以用sonar用于管理Java源代码的质量 首先启动sonar平台

docker-compose -f linghang/src/main/docker/sonar.yml up

然后采用对应的工具进行分析

With Maven: ./mvnw sonar:sonar

常用命令

显示所有docker 容器

You can use docker container ps -a to list all the containers

$ docker container ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
fc35e1090021        mysql               "/entrypoint.sh mysql"   4 seconds ago       Up 4 seconds        0.0.0.0:3306->3306/tcp   sampleApplication-mysql

停止容器服务

docker-compose -f src/main/docker/app.yml stop

You can also use directly Docker:

docker container stop <container_id>

When you stop a container, the data is not deleted, unless you delete the container.

version: '2'
services:
linghang-sonar:
image: sonarqube:7.1
ports:
- 9001:9000
- 9092:9092
version: '2'
services:
swagger-editor:
image: swaggerapi/swagger-editor:latest
ports:
- 7742:8080
package cn.com.sailfish.linghang.common.auditor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.time.Instant;
/**
* Author: newma<newma@live.cn>
* Create at: 2018-06-05 18:56:10
* Description:
* @author newma
*/
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class Auditable {
@CreatedDate
@Column(name = "gmt_created", nullable = false, updatable = false)
protected Instant gmtCreated;
@LastModifiedDate
@Column(name = "gmt_modified", nullable = true)
protected Instant gmtModified;
public void setGmtCreated(Instant gmtCreated){
this.gmtCreated = gmtCreated;
}
public void setGmtModified(Instant gmtModified) {
this.gmtModified = gmtModified;
}
public Instant getGmtCreated() {
return gmtCreated;
}
public Instant getGmtModified() {
return gmtModified;
}
}
package cn.com.sailfish.linghang.common.auditor;
import org.springframework.data.domain.AuditorAware;
import java.util.Optional;
/**
* Author: newma<newma@live.cn>
* Create at: 2018-06-05 19:02:48
* Description:
* @author newma
*/
public class AuditorAwareImpl implements AuditorAware<String> {
@Override
public Optional<String> getCurrentAuditor() {
return Optional.of("admin");
}
}
package cn.com.sailfish.linghang.common;
/**
* Author: wengxinyou
* Create at: 2018/12/27
* Description: 存储全局变量类
*/
public class Constants {
public final static String GMT_CREATED = "gmtCreated"; // 排序字段 创建时间
public final static String GMT_MODIFIED = "gmtModified"; // 排序字段 修改时间
}
package cn.com.sailfish.linghang.common;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:43:08
* Description:
*
* @author huangpeilin
*/
public class ErrorConstants {
//========================= 全局错误码 =============================
public static final int SUCCESS = 0x00000000;
public static final int ERR_BAD_PARAM = 0x00000001;
public static final int ERR_FORM_PARAMETER_ERROR = 0x00000002;
public static final int FILE_UPLOAD_FAILED = 0x00000003;
public static final int BIND_FAILED = 0x00000004;
/**
* 验证码到期失效
*/
public static final int CAPTCHA_CODE_EXPIRES = 0x00000005;
/**
* 验证码错误
*/
public static final int CAPTCHA_CODE_ERROR = 0x00000006;
/**
* 转化byte数据错误
*/
public static final int GET_BYTE_ERROR = 0x00000007;
/**
* 不是数字的字符串
*/
public static final int NUMBER_IS_ERROR = 0x00000008;
/**
* 验证码为空
*/
public static final int CAPTCHA_CODE_IS_NULL = 0x00000009;
/**
* referer错误
*/
public static final int REFERER_IS_ERROR = 0x0000000A;
public static final int ERR_INTERNAL_EXCEPTION = 0xfffffffE;
public static final int ERR_UNKNOWN = 0xffffffff;
//========================= 模块错误码 ===============================
// 模块定义从0x00010000开始
/**
* 用户模块
*/
private static final int USER_BASE_ERROR_SEGMENT = 0x00010000;
/**
* 文件模块
*/
private static final int FILE_BASE_ERROR_SEGMENT = 0x00020000;
/**
* 区域模块
*/
private static final int AREA_BASE_ERROR_SEGMENT = 0x00030000;
/**
* 机型模块
*/
private static final int MODEL_BASE_ERROR_SEGMENT = 0x00040000;
/**
* 发动机模块
*/
private static final int ENGINE_BASE_ERROR_SEGMENT = 0x00050000;
/**
* 课程模块
*/
private static final int COURSE_BASE_ERROR_SEGMENT = 0x00060000;
/**
* 试卷模块
*/
private static final int QUESTION_PAPER_BASE_ERROR_SEGMENT = 0x00070000;
/**
* 考试模块
*/
private static final int EXAM_BASE_ERROR_SEGMENT = 0x00080000;
/**
* 成绩单模块
*/
private static final int REPORT_CARD_BASE_ERROR_SEGMENT = 0x00090000;
/**
* 部门模块
*/
private static final int ORG_UNIT_BASE_ERROR_SEGMENT = 0x00001000;
//==========================用户模块==============================
/**
* 用户卡号为空
*/
public static final int USER_CARD_IS_NULL = USER_BASE_ERROR_SEGMENT | 1;
/**
* 用户类型为空
*/
public static final int USER_TYPE_IS_NULL = USER_BASE_ERROR_SEGMENT | 2;
/**
* 用户手机号码为空
*/
public static final int MOBILE_PHONE_IS_NULL = USER_BASE_ERROR_SEGMENT | 3;
/**
* 手机号码的格式错误
*/
public static final int MOBILE_PHONE_IS_ERROR_FORMAT = USER_BASE_ERROR_SEGMENT | 4;
/**
* 用户电子邮箱为空
*/
public static final int EMAIL_IS_NULL = USER_BASE_ERROR_SEGMENT | 5;
/**
* 电子邮箱的格式错误
*/
public static final int EMAIL_IS_ERROR_FORMAT = USER_BASE_ERROR_SEGMENT | 6;
/**
* 用户名为空
*/
public static final int USERNAME_IS_NULL = USER_BASE_ERROR_SEGMENT | 7;
/**
* 已经存在使用该手机号码的用户
*/
public static final int USER_MOBILE_PHONE_IS_ALREADY_EXISTS = USER_BASE_ERROR_SEGMENT | 8;
/**
* 已经存在使用该电子邮箱的用户
*/
public static final int USER_EMAIL_IS_ALREADY_EXISTS = USER_BASE_ERROR_SEGMENT | 9;
/**
* 用户类型出错
*/
public static final int USER_TYPE_IS_ERROR = USER_BASE_ERROR_SEGMENT | 10;
/**
* 用户登录账号为空
*/
public static final int USER_LOGIN_ACCOUNT_IS_NULL = USER_BASE_ERROR_SEGMENT | 11;
/**
* 用户密码为空
*/
public static final int USER_PASSWORD_IS_NULL = USER_BASE_ERROR_SEGMENT | 12;
/**
* 用户不存在
*/
public static final int USER_IS_NOT_EXISTS = USER_BASE_ERROR_SEGMENT | 13;
/**
* 用户账号没有被激活,在回收站中
*/
public static final int USER_IS_NOT_ACTIVATED = USER_BASE_ERROR_SEGMENT | 14;
/**
* 登录用户不是管理员或者教员
*/
public static final int CAN_NOT_OPERATE_WITHOUT_ADMIN_OR_TEACHER = USER_BASE_ERROR_SEGMENT | 15;
/**
* 密码错误authority is error.
*/
public static final int USER_PASSWORD_IS_ERROR = USER_BASE_ERROR_SEGMENT | 16;
/**
* 用户权限值出错
*/
public static final int USER_AUTHORITY_IS_ERROR = USER_BASE_ERROR_SEGMENT | 17;
/**
* 用户已经存在
*/
public static final int USER_IS_ALREADY_EXISTS = USER_BASE_ERROR_SEGMENT | 18;
/**
* 用户在考试队列中
*/
public static final int USER_IS_IN_TEST_QUEUE = USER_BASE_ERROR_SEGMENT | 19;
/**
* 用户权限不足
*/
public static final int INSUFFICIENT_USER_PERMISSION = USER_BASE_ERROR_SEGMENT | 20;
/**
* 用户跨区操作
*/
public static final int USER_OPERATE_ACROSS_REGION = USER_BASE_ERROR_SEGMENT | 21;
/**
* 用户ID为空
*/
public static final int USER_ID_IS_NULL = USER_BASE_ERROR_SEGMENT | 22;
/**
* 用户登录的队列名为空
*/
public static final int USER_QUEUE_NAME_IS_NULL = USER_BASE_ERROR_SEGMENT | 23;
/**
* 用户在异地登录
*/
public static final int USER_REMOTE_LOGIN = USER_BASE_ERROR_SEGMENT | 24;
/**
* 请求sso系统失败
*/
public static final int REQUEST_SSO_SERVER_FAILED = USER_BASE_ERROR_SEGMENT | 25;
/**
* 这个权限的用户只能存在一个
*/
public static final int THIS_USER_PRIVILEGE_ONLY_ONE_CAN_EXIST = USER_BASE_ERROR_SEGMENT | 26;
/**
* 用户权限不足
*/
public static final int USER_PERMISSION_DENIED = USER_BASE_ERROR_SEGMENT | 27;
/**
* sso系统不存在该数据失败
*/
public static final int SSO_SERVER_CAN_NOT_FIND_THIS_DATA = USER_BASE_ERROR_SEGMENT | 28;
/**
* 用户账号被锁定
*/
public static final int USER_ACCOUNT_IS_LOCK = USER_BASE_ERROR_SEGMENT | 29;
/**
* 用户名或密码错误,认证失败
*/
public static final int USER_ACCOUNT_IS_ERROR = USER_BASE_ERROR_SEGMENT | 30;
/**
* 触发双因子验证
*/
public static final int USER_ACCOUNT_IS_VERIFY = USER_BASE_ERROR_SEGMENT | 31;
/**
* IP列入黑名单
*/
public static final int USER_SEND_MESSAGE_IPERROR = USER_BASE_ERROR_SEGMENT | 32;
/**
* token信息不存在或者已过期不合法等
*/
public static final int USER_SEND_MESSAGE_TOKENERROR = USER_BASE_ERROR_SEGMENT | 33;
/**
* 双因子认证已关闭,请求失败
*/
public static final int USER_SEND_MESSAGE_DFACTORERROR = USER_BASE_ERROR_SEGMENT | 34;
/**
* 发送验证码失败
*/
public static final int USER_SEND_MESSAGE_FAILURE = USER_BASE_ERROR_SEGMENT | 35;
//==========================文件模块==============================
/**
* 导入的信息文件不是excel文件
*/
public static final int FILE_IS_NOT_THE_EXCEL = FILE_BASE_ERROR_SEGMENT | 1;
/**
* 导入文件信息失败
*/
public static final int IMPORT_INFO_IS_FAIL = FILE_BASE_ERROR_SEGMENT | 2;
/**
* 文件操作异常
*/
public static final int FILE_OPERATING_EXCEPTION = FILE_BASE_ERROR_SEGMENT | 3;
/**
* 文件不存在
*/
public static final int FILE_IS_NOT_EXISTS = USER_BASE_ERROR_SEGMENT | 4;
/**
* 文件不是图片
*/
public static final int FILE_IS_NOT_IMAGE = USER_BASE_ERROR_SEGMENT | 5;
/**
* 图片太大
*/
public static final int FILE_IS_TOO_BIG = USER_BASE_ERROR_SEGMENT | 6;
//==========================区域模块==============================
/**
* 区域名字为空
*/
public static final int AREA_NAME_IS_NULL = AREA_BASE_ERROR_SEGMENT | 1;
/**
* 区域已经存在
*/
public static final int AREA_IS_ALREADY_EXISTS = AREA_BASE_ERROR_SEGMENT | 2;
/**
* 区域不存在
*/
public static final int AREA_IS_NOT_EXISTS = AREA_BASE_ERROR_SEGMENT | 3;
/**
* 区域ID为空
*/
public static final int AREA_ID_IS_NULL = AREA_BASE_ERROR_SEGMENT | 4;
//==========================机型模块==============================
/**
* 机型名字为空
*/
public static final int MODEL_NAME_IS_NULL = MODEL_BASE_ERROR_SEGMENT | 1;
/**
* 机型已经存在
*/
public static final int MODEL_IS_ALREADY_EXISTS = MODEL_BASE_ERROR_SEGMENT | 2;
/**
* 机型不存在
*/
public static final int MODEL_IS_NOT_EXISTS = MODEL_BASE_ERROR_SEGMENT | 3;
/**
* 机型ID为空
*/
public static final int MODEL_ID_IS_NULL = MODEL_BASE_ERROR_SEGMENT | 4;
//==========================发动机模块==============================
/**
* 发动机名字为空
*/
public static final int ENGINE_NAME_IS_NULL = ENGINE_BASE_ERROR_SEGMENT | 1;
/**
* 发动机已经存在
*/
public static final int ENGINE_IS_ALREADY_EXISTS = ENGINE_BASE_ERROR_SEGMENT | 2;
/**
* 发动机不存在
*/
public static final int ENGINE_IS_NOT_EXISTS = ENGINE_BASE_ERROR_SEGMENT | 3;
/**
* 发动机ID为空
*/
public static final int ENGINE_ID_IS_NULL = ENGINE_BASE_ERROR_SEGMENT | 4;
//==========================课程模块==============================
/**
* 课程已经存在
*/
public static final int COURSE_IS_ALREADY_EXISTS = COURSE_BASE_ERROR_SEGMENT | 1;
/**
* 课程不存在
*/
public static final int COURSE_IS_NOT_EXISTS = COURSE_BASE_ERROR_SEGMENT | 2;
/**
* 课程ID为空
*/
public static final int COURSE_ID_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 3;
/**
* 检查项ID为空
*/
public static final int ITEM_ID_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 4;
/**
* 检查项名字为空
*/
public static final int ITEM_NAME_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 5;
/**
* 检查项中文名字为空
*/
public static final int ITEM_CHINESE_NAME_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 6;
/**
* 检查项区域名字为空
*/
public static final int ITEM_REGION_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 7;
/**
* 检查项机型为空
*/
public static final int ITEM_MODEL_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 8;
/**
* 检查项发动机为空
*/
public static final int ITEM_ENGINE_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 9;
/**
* 课程名字为空
*/
public static final int COURSE_NAME_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 10;
/**
* 课程中文名字为空
*/
public static final int COURSE_CHINESE_NAME_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 11;
/**
* 课程机型为空
*/
public static final int COURSE_MODEL_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 12;
/**
* 课程发动机为空
*/
public static final int COURSE_ENGINE_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 13;
/**
* 课程职位为空
*/
public static final int COURSE_DIVISION_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 14;
/**
* 导入表中飞机制造商项为空
*/
public static final int AIR_FRAMER_IS_NULL = COURSE_BASE_ERROR_SEGMENT | 15;
/**
* 导入表中职位数值错误
*/
public static final int DIVISION_IS_ERROR = COURSE_BASE_ERROR_SEGMENT | 16;
//==========================试卷模块==============================
/**
* 试卷已经存在
*/
public static final int QUESTION_PAPER_IS_ALREADY_EXISTS = QUESTION_PAPER_BASE_ERROR_SEGMENT | 1;
/**
* 试卷不存在
*/
public static final int QUESTION_PAPER_IS_NOT_EXISTS = QUESTION_PAPER_BASE_ERROR_SEGMENT | 2;
/**
* 试卷标题为空
*/
public static final int QUESTION_PAPER_TITLE_IS_NULL = QUESTION_PAPER_BASE_ERROR_SEGMENT | 3;
/**
* 试卷考试时长为空
*/
public static final int QUESTION_PAPER_TEST_LENGTH_IS_NULL = QUESTION_PAPER_BASE_ERROR_SEGMENT | 4;
/**
* 试卷人为设定异常数量为空
*/
public static final int QUESTION_PAPER_RANDOM_ABNORMAL_IS_NULL = QUESTION_PAPER_BASE_ERROR_SEGMENT | 5;
/**
* 试卷异常生成类型错误
*/
public static final int QUESTION_PAPER_EXCEPTION_GENERATE_TYPE_IS_ERROR = QUESTION_PAPER_BASE_ERROR_SEGMENT | 6;
/**
* 试卷删除失败
*/
public static final int QUESTION_PAPER_DELETE_FAILED = QUESTION_PAPER_BASE_ERROR_SEGMENT | 7;
/**
* 试卷ID为空
*/
public static final int QUESTION_PAPER_ID_IS_NULL = QUESTION_PAPER_BASE_ERROR_SEGMENT | 8;
/**
* 试卷名字为空
*/
public static final int QUESTION_PAPER_NAME_IS_NULL = QUESTION_PAPER_BASE_ERROR_SEGMENT | 9;
/**
* 试卷描述为空
*/
public static final int QUESTION_PAPER_DESC_IS_NULL = QUESTION_PAPER_BASE_ERROR_SEGMENT | 10;
/**
* 试卷类型为空
*/
public static final int QUESTION_PAPER_TYPE_IS_NULL = QUESTION_PAPER_BASE_ERROR_SEGMENT | 11;
/**
* 试卷类型错误
*/
public static final int QUESTION_PAPER_TYPE_IS_ERROR = QUESTION_PAPER_BASE_ERROR_SEGMENT | 12;
/**
* 试卷的课程ID为空
*/
public static final int QUESTION_PAPER_COURSE_ID_IS_NULL = QUESTION_PAPER_BASE_ERROR_SEGMENT | 13;
/**
* 试卷异常生成类型为空
*/
public static final int QUESTION_PAPER_ABNORMAL_GENERATE_TYPE_IS_NULL = QUESTION_PAPER_BASE_ERROR_SEGMENT | 14;
/**
* 试卷总分数为空
*/
public static final int QUESTION_PAPER_SCORE_IS_NULL = QUESTION_PAPER_BASE_ERROR_SEGMENT | 15;
/**
* 试卷通过分数为空
*/
public static final int QUESTION_PAPER_PASSING_SCORE_IS_NULL = QUESTION_PAPER_BASE_ERROR_SEGMENT | 15;
//==========================考试模块==============================
/**
* 考试监考老师的数量错误
*/
public static final int INVIGILATOR_NUMBER_IS_ERROR = EXAM_BASE_ERROR_SEGMENT | 1;
/**
* 用户正在考试,指定考试失败
*/
public static final int USER_SPECIFIED_TEST_FAILED = EXAM_BASE_ERROR_SEGMENT | 2;
/**
* 考试ID为空
*/
public static final int EXAM_ID_IS_NULL = EXAM_BASE_ERROR_SEGMENT | 3;
/**
* 考试不存在
*/
public static final int EXAM_IS_NOT_EXISTS = EXAM_BASE_ERROR_SEGMENT | 4;
//==========================成绩单模块==============================
/**
* 成绩单不存在
*/
public static final int REPORT_CARD_IS_NOT_EXISTS = REPORT_CARD_BASE_ERROR_SEGMENT | 1;
/**
* 成绩单ID为空
*/
public static final int REPORT_CARD_ID_IS_NULL = REPORT_CARD_BASE_ERROR_SEGMENT | 2;
/**
* 成绩单的评定为空
*/
public static final int REPORT_CARD_ASSESSMENT_IS_NULL = REPORT_CARD_BASE_ERROR_SEGMENT | 3;
/**
* 成绩单的分数为空
*/
public static final int REPORT_CARD_SCORE_IS_NULL = REPORT_CARD_BASE_ERROR_SEGMENT | 4;
/**
* 成绩单的评定错误
*/
public static final int REPORT_CARD_ASSESSMENT_IS_ERROR = REPORT_CARD_BASE_ERROR_SEGMENT | 5;
//==========================部门模块==============================
/**
* 部门编码为空
*/
public static final int ORG_UNIT_LEVEL_IS_NULL = ORG_UNIT_BASE_ERROR_SEGMENT | 1;
}
package cn.com.sailfish.linghang.common;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import static cn.com.sailfish.linghang.common.ErrorConstants.*;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:44:18
* Description:
*
* @author huangpeilin
*/
public class ErrorMessages {
// 默认错误描述
public static final String DEFAULT_ERROR_MESSAGE = "unknown error";
private static final Map<Integer, String> MESSAGES;
static {
Map<Integer, String> map = new HashMap<Integer, String>();
map.put(ERR_BAD_PARAM, "bad request param");
map.put(ERR_FORM_PARAMETER_ERROR, "form parameter error");
map.put(FILE_UPLOAD_FAILED, "file upload failed.");
map.put(BIND_FAILED, "bind failed.");
map.put(CAPTCHA_CODE_EXPIRES, "The Captcha verification code expires.");
map.put(CAPTCHA_CODE_ERROR, "The Captcha verification code error.");
map.put(GET_BYTE_ERROR, "Error converting byte data.");
map.put(NUMBER_IS_ERROR, "Strings that are not Numbers");
map.put(CAPTCHA_CODE_IS_NULL, "The Captcha verification code is null.");
map.put(REFERER_IS_ERROR, "referer is error!");
map.put(ERR_INTERNAL_EXCEPTION, "internal server exception");
// 添加更多的错误的描述
MESSAGES = Collections.unmodifiableMap(map);
// 用户模块
map.put(USER_CARD_IS_NULL, "user card is null.");
map.put(USER_TYPE_IS_NULL, "user type is null.");
map.put(MOBILE_PHONE_IS_NULL, "mobile phone is null.");
map.put(MOBILE_PHONE_IS_ERROR_FORMAT, "mobile phone is error format.");
map.put(EMAIL_IS_NULL, "email is null.");
map.put(EMAIL_IS_ERROR_FORMAT, "email is error format.");
map.put(USERNAME_IS_NULL, "username is null.");
map.put(USER_MOBILE_PHONE_IS_ALREADY_EXISTS, "mobile phone is already exists.");
map.put(USER_EMAIL_IS_ALREADY_EXISTS, "email is already exists.");
map.put(USER_TYPE_IS_ERROR, "user type is error");
map.put(USER_LOGIN_ACCOUNT_IS_NULL, "user login account is null.");
map.put(USER_PASSWORD_IS_NULL, "user password is null.");
map.put(USER_IS_NOT_EXISTS, "user is not exists.");
map.put(USER_IS_NOT_ACTIVATED, "user is not activated.");
map.put(CAN_NOT_OPERATE_WITHOUT_ADMIN_OR_TEACHER, "user is not a admin or teacher.");
map.put(USER_PASSWORD_IS_ERROR, "user password is error.");
map.put(USER_AUTHORITY_IS_ERROR, "authority is error.");
map.put(USER_IS_ALREADY_EXISTS, "user is already exists.");
map.put(USER_IS_IN_TEST_QUEUE, "user is in test queue.");
map.put(INSUFFICIENT_USER_PERMISSION, "insufficient user permissions.");
map.put(USER_OPERATE_ACROSS_REGION, "users operate across regions.");
map.put(USER_ID_IS_NULL, "user id is null.");
map.put(USER_QUEUE_NAME_IS_NULL, "user queue name is null.");
map.put(USER_REMOTE_LOGIN, "user remote login.");
map.put(REQUEST_SSO_SERVER_FAILED, "request sso server failed");
map.put(THIS_USER_PRIVILEGE_ONLY_ONE_CAN_EXIST, "Only one user with this privilege can exist.");
map.put(USER_PERMISSION_DENIED, "permission denied.");
map.put(SSO_SERVER_CAN_NOT_FIND_THIS_DATA, "can not find this data.");
map.put(USER_ACCOUNT_IS_LOCK, "user account is lock.");
map.put(USER_ACCOUNT_IS_ERROR, "user account is error.");
map.put(USER_ACCOUNT_IS_VERIFY, "user account is verify.");
map.put(USER_SEND_MESSAGE_IPERROR, "user send message iperror.");
map.put(USER_SEND_MESSAGE_TOKENERROR, "user send message tokenerror.");
map.put(USER_SEND_MESSAGE_DFACTORERROR, "user send message dfactorerror.");
map.put(USER_SEND_MESSAGE_FAILURE, "user send message failure.");
// 文件模块
map.put(FILE_IS_NOT_THE_EXCEL, "File is not the excel.");
map.put(IMPORT_INFO_IS_FAIL, "Import info is fail.");
map.put(FILE_OPERATING_EXCEPTION, "File operating exception.");
map.put(FILE_IS_NOT_EXISTS, "File is not exists.");
map.put(FILE_IS_NOT_IMAGE, "File is not image.");
map.put(FILE_IS_TOO_BIG, "file is too big.");
// 区域模块
map.put(AREA_NAME_IS_NULL, "area name is null.");
map.put(AREA_IS_ALREADY_EXISTS, "area is already exists.");
map.put(AREA_IS_NOT_EXISTS, "area is not exists.");
map.put(AREA_ID_IS_NULL, "area id is null.");
// 机型模块
map.put(MODEL_NAME_IS_NULL, "model name is null.");
map.put(MODEL_IS_ALREADY_EXISTS, "model is already exists.");
map.put(MODEL_IS_NOT_EXISTS, "model is not exists.");
map.put(MODEL_ID_IS_NULL, "model id is null.");
// 发动机模块
map.put(ENGINE_NAME_IS_NULL, "engine name is null.");
map.put(ENGINE_IS_ALREADY_EXISTS, "engine is already exists.");
map.put(ENGINE_IS_NOT_EXISTS, "engine is not exists.");
map.put(ENGINE_ID_IS_NULL, "engine id is null.");
// 课程模块
map.put(COURSE_IS_ALREADY_EXISTS, "course is already exists.");
map.put(COURSE_IS_NOT_EXISTS, "course is not exists.");
map.put(COURSE_ID_IS_NULL, "course id is null.");
map.put(ITEM_ID_IS_NULL, "item id is null.");
map.put(ITEM_NAME_IS_NULL, "item name is null.");
map.put(ITEM_CHINESE_NAME_IS_NULL, "item chinese name is null.");
map.put(ITEM_REGION_IS_NULL, "item region is null.");
map.put(ITEM_MODEL_IS_NULL, "item model is null.");
map.put(ITEM_ENGINE_IS_NULL, "item engine is null.");
map.put(COURSE_NAME_IS_NULL, "course name is null.");
map.put(COURSE_CHINESE_NAME_IS_NULL, "course chinese name is null.");
map.put(COURSE_MODEL_IS_NULL, "course model is null.");
map.put(COURSE_ENGINE_IS_NULL, "course engine is null.");
map.put(COURSE_DIVISION_IS_NULL, "course division is null.");
map.put(AIR_FRAMER_IS_NULL, "air framer is null.");
map.put(DIVISION_IS_ERROR, "division is error.");
// 试卷模块
map.put(QUESTION_PAPER_IS_ALREADY_EXISTS, "question paper is already exists.");
map.put(QUESTION_PAPER_IS_NOT_EXISTS, "question paper is not exists.");
map.put(QUESTION_PAPER_TITLE_IS_NULL, "question paper id is null.");
map.put(QUESTION_PAPER_TEST_LENGTH_IS_NULL, "question paper test length is null.");
map.put(QUESTION_PAPER_RANDOM_ABNORMAL_IS_NULL, "question paper random abnormal is null");
map.put(QUESTION_PAPER_EXCEPTION_GENERATE_TYPE_IS_ERROR, "question paper exception generate type is error.");
map.put(QUESTION_PAPER_DELETE_FAILED, "The paper is used and cannot be deleted.");
map.put(QUESTION_PAPER_ID_IS_NULL, "question paper id is null.");
map.put(QUESTION_PAPER_NAME_IS_NULL, "question paper name is null");
map.put(QUESTION_PAPER_DESC_IS_NULL, "question paper desc is null.");
map.put(QUESTION_PAPER_TYPE_IS_NULL, "question paper type is null.");
map.put(QUESTION_PAPER_TYPE_IS_ERROR, "question paper type is error.");
map.put(QUESTION_PAPER_COURSE_ID_IS_NULL, "question paper course id is null.");
map.put(QUESTION_PAPER_ABNORMAL_GENERATE_TYPE_IS_NULL, "question paper abnormal generate type is null.");
map.put(QUESTION_PAPER_SCORE_IS_NULL, "question paper score is null.");
map.put(QUESTION_PAPER_PASSING_SCORE_IS_NULL, "question paper passing score is null.");
// 考试模块
map.put(INVIGILATOR_NUMBER_IS_ERROR, "invigilator number is error.");
map.put(USER_SPECIFIED_TEST_FAILED, "The specified user failed the test");
map.put(EXAM_ID_IS_NULL, "exam id is null");
map.put(EXAM_IS_NOT_EXISTS, "exam is not exists.");
// 成绩单模块
map.put(REPORT_CARD_IS_NOT_EXISTS, "report card is not exists.");
map.put(REPORT_CARD_ID_IS_NULL, "report card id is null.");
map.put(REPORT_CARD_ASSESSMENT_IS_NULL, "report card assessment is null.");
map.put(REPORT_CARD_SCORE_IS_NULL, "report card score is null.");
map.put(REPORT_CARD_ASSESSMENT_IS_ERROR, "report card assessment is error.");
//部门模块
map.put(ORG_UNIT_LEVEL_IS_NULL, "orgUnitLevel is null.");
}
/**
* 通过error code取得错误描述
*
* @param errCode : int 类型的错误代码
* @return String : 返回错误描述
*/
public static String getErrorMessage(int errCode) {
return MESSAGES.get(errCode);
}
}
package cn.com.sailfish.linghang.common;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:47:13
* Description:
*
* @author huangpeilin
*/
public class Http401UnauthorizedEntryPoint implements AuthenticationEntryPoint {
private final Logger log = LoggerFactory.getLogger(Http401UnauthorizedEntryPoint.class);
/**
* Always returns a 401 error code to the client.
*/
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException arg2)
throws IOException,
ServletException {
log.debug("Pre-authenticated entry point called. Rejecting access");
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Access Denied");
}
}
package cn.com.sailfish.linghang.common;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:42:32
* Description:
*
* @author huangpeilin
*/
public class RestRespDTO {
private Integer errorCode = ErrorConstants.SUCCESS;
private String errorMessage;
private Object data;
public Integer getErrorCode() {
return errorCode;
}
public void setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
@Override
public String toString() {
return "{" +
"errorCode=" + errorCode +
", errorMessage='" + errorMessage + '\'' +
", data=" + data +
'}';
}
}
package cn.com.sailfish.linghang.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
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;
/**
* Author: huangpeilin
* Create at: 2019-04-22 11:03:35
* Description:
*
* @author huangpeilin
*/
@Configuration
public class CrossConfig {
@Value("${sailfish.cros}")
private String cros;
@Bean
public FilterRegistrationBean crossFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
// 设置你要允许的网站域名,如果全允许则设为 *
config.addAllowedOrigin(cros);
// 如果要限制 HEADER 或 METHOD 请自行更改
config.addAllowedHeader("*");
config.addAllowedMethod("*");
source.registerCorsConfiguration("/**", config);
FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
// 这个顺序很重要哦,为避免麻烦请设置在最前
bean.setOrder(0);
return bean;
}
}
package cn.com.sailfish.linghang.config;
import cn.com.sailfish.linghang.config.property.FileUploadProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.unit.DataSize;
import javax.servlet.MultipartConfigElement;
import java.io.File;
/**
* Author: huangpeilin
* Create at: 2019-04-22 11:03:35
* Description:
*
* @author huangpeilin
*/
@Configuration
public class FileUploadConfig {
@Autowired
private FileUploadProperty fileUploadProperty;
/**
* 文件上传配置
* @return
*/
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
// 单个文件最大
factory.setMaxFileSize(DataSize.parse(fileUploadProperty.getMaxFileSize()));
// 设置总上传数据总大小
factory.setMaxRequestSize(DataSize.parse(fileUploadProperty.getMaxRequestSize()));
// 文件上传的临时路径
String location = System.getProperty("user.dir") + "/tmp";
File tmpFile = new File(location);
if (!tmpFile.exists()) {
tmpFile.mkdirs();
}
factory.setLocation(location);
return factory.createMultipartConfig();
}
}
package cn.com.sailfish.linghang.config;
import liquibase.configuration.GlobalConfiguration;
import liquibase.configuration.LiquibaseConfiguration;
import liquibase.integration.spring.SpringLiquibase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.sql.DataSource;
/**
* Author: newma<newma@live.cn>
* Create at: 2018-07-04 12:25:14
* Description:
*/
@Configuration
@EnableJpaRepositories(basePackages = {"cn.com.sailfish.linghang.repository"})
@EnableTransactionManagement
public class LiquibaseConfig {
@Value("${sailfish.liquibase.change-log}")
private String changeLogPath;
@Value("${sailfish.liquibase.drop-first}")
private boolean dropFirst;
@Value("${sailfish.liquibase.enabled}")
private boolean enabled;
@Autowired
private DataSource dataSource;
@Bean
public SpringLiquibase liquibase() {
GlobalConfiguration configuration = LiquibaseConfiguration.getInstance().getConfiguration(GlobalConfiguration.class);
configuration.setDatabaseChangeLogTableName("LINGHANGLIQUIBASECHANGELOG");
configuration.setDatabaseChangeLogLockTableName("LINGHANGLIQUIBASECHANGELOGLOCK");
SpringLiquibase liquibase = new SpringLiquibase();
liquibase.setDataSource(dataSource);
liquibase.setShouldRun(enabled);
liquibase.setDropFirst(dropFirst);
liquibase.setChangeLog(changeLogPath);
return liquibase;
}
}
package cn.com.sailfish.linghang.config.property;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-05-28 18:35:33
* Description:
*/
@ConfigurationProperties(prefix = "sailfish.captcha")
public class CaptchaProperty {
private Integer validTime;
public Integer getValidTime() {
return validTime;
}
public void setValidTime(Integer validTime) {
this.validTime = validTime;
}
@Override
public String toString() {
return "CaptchaProperty{" +
"validTime=" + validTime +
'}';
}
}
package cn.com.sailfish.linghang.config.property;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Author: huangpeilin
* Create at: 2019-05-09 15:13:54
* Description:
*
* @author huangpeilin
*/
@ConfigurationProperties(prefix = "sailfish.export-template")
public class ExportTemplateProperty {
private String exportTemplateLocation;
private String exportFileName;
private String exportFilePath;
private String userExportTemplate;
private String personReportCardExportTemplate;
private String classReportCardExportTemplate;
private String examOperationRecordExportTemplate;
private String trainOperationRecordExportTemplate;
private String personalExamOperationRecordExportTemplate;
private String personalTrainingOperationRecordExportTemplate;
@Override
public String toString() {
return "ExportTemplateProperty{" +
"exportTemplateLocation='" + exportTemplateLocation + '\'' +
", exportFileName='" + exportFileName + '\'' +
'}';
}
public String getExportTemplateLocation() {
return exportTemplateLocation;
}
public void setExportTemplateLocation(String exportTemplateLocation) {
this.exportTemplateLocation = exportTemplateLocation;
}
public String getExportFileName() {
return exportFileName;
}
public void setExportFileName(String exportFileName) {
this.exportFileName = exportFileName;
}
public String getUserExportTemplate() {
return userExportTemplate;
}
public void setUserExportTemplate(String userExportTemplate) {
this.userExportTemplate = userExportTemplate;
}
public String getExportFilePath() {
return exportFilePath;
}
public void setExportFilePath(String exportFilePath) {
this.exportFilePath = exportFilePath;
}
public String getPersonReportCardExportTemplate() {
return personReportCardExportTemplate;
}
public void setPersonReportCardExportTemplate(String personReportCardExportTemplate) {
this.personReportCardExportTemplate = personReportCardExportTemplate;
}
public String getClassReportCardExportTemplate() {
return classReportCardExportTemplate;
}
public void setClassReportCardExportTemplate(String classReportCardExportTemplate) {
this.classReportCardExportTemplate = classReportCardExportTemplate;
}
public String getExamOperationRecordExportTemplate() {
return examOperationRecordExportTemplate;
}
public void setExamOperationRecordExportTemplate(String examOperationRecordExportTemplate) {
this.examOperationRecordExportTemplate = examOperationRecordExportTemplate;
}
public String getTrainOperationRecordExportTemplate() {
return trainOperationRecordExportTemplate;
}
public void setTrainOperationRecordExportTemplate(String trainOperationRecordExportTemplate) {
this.trainOperationRecordExportTemplate = trainOperationRecordExportTemplate;
}
public String getPersonalExamOperationRecordExportTemplate() {
return personalExamOperationRecordExportTemplate;
}
public void setPersonalExamOperationRecordExportTemplate(String personalExamOperationRecordExportTemplate) {
this.personalExamOperationRecordExportTemplate = personalExamOperationRecordExportTemplate;
}
public String getPersonalTrainingOperationRecordExportTemplate() {
return personalTrainingOperationRecordExportTemplate;
}
public void setPersonalTrainingOperationRecordExportTemplate(String personalTrainingOperationRecordExportTemplate) {
this.personalTrainingOperationRecordExportTemplate = personalTrainingOperationRecordExportTemplate;
}
}
package cn.com.sailfish.linghang.config.property;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:05:42
* Description:
*
* @author huangpeilin
*/
@ConfigurationProperties(prefix = "sailfish.file-upload")
public class FileUploadProperty {
private String maxFileSize;
private String maxRequestSize;
public String getMaxFileSize() {
return maxFileSize;
}
public void setMaxFileSize(String maxFileSize) {
this.maxFileSize = maxFileSize;
}
public String getMaxRequestSize() {
return maxRequestSize;
}
public void setMaxRequestSize(String maxRequestSize) {
this.maxRequestSize = maxRequestSize;
}
@Override
public String toString() {
return "FileUploadProperty{" +
"maxFileSize='" + maxFileSize + '\'' +
", maxRequestSize='" + maxRequestSize + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.config.property;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:10:10
* Description:
*
* @author huangpeilin
*/
@ConfigurationProperties(prefix = "sailfish.security")
public class SecurityProperty {
private JWT jwt;
public JWT getJwt() {
return jwt;
}
public void setJwt(JWT jwt) {
this.jwt = jwt;
}
@Override
public String toString() {
return "SecurityConfig{" +
"jwt=" + jwt +
'}';
}
public static class JWT {
private String secret;
private Long tokenValidateInSecond;
private Long tokenValidateInSecondForRememberMe;
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public Long getTokenValidateInSecond() {
return tokenValidateInSecond;
}
public void setTokenValidateInSecond(Long tokenValidateInSecond) {
this.tokenValidateInSecond = tokenValidateInSecond;
}
public Long getTokenValidateInSecondForRememberMe() {
return tokenValidateInSecondForRememberMe;
}
public void setTokenValidateInSecondForRememberMe(Long tokenValidateInSecondForRememberMe) {
this.tokenValidateInSecondForRememberMe = tokenValidateInSecondForRememberMe;
}
@Override
public String toString() {
return "JWT{" +
"secret='" + secret + '\'' +
", tokenValidateInSecond=" + tokenValidateInSecond +
", tokenValidateInSecondForWeek=" + tokenValidateInSecondForRememberMe +
'}';
}
}
}
package cn.com.sailfish.linghang.config.property;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-05-25 11:22:16
* Description:
*/
@ConfigurationProperties(prefix = "sailfish.sso")
public class SsoProperty {
private String ip;
private String keyDate;
private String appName;
private String userDataIp;
@Override
public String toString() {
return "SsoProperty{" +
"ip='" + ip + '\'' +
", keyDate='" + keyDate + '\'' +
", appName='" + appName + '\'' +
", userDataIp='" + userDataIp + '\'' +
'}';
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getKeyDate() {
return keyDate;
}
public void setKeyDate(String keyDate) {
this.keyDate = keyDate;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public String getUserDataIp() {
return userDataIp;
}
public void setUserDataIp(String userDataIp) {
this.userDataIp = userDataIp;
}
}
package cn.com.sailfish.linghang.config;
import cn.com.sailfish.linghang.filter.RequestLoggingFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.CommonsRequestLoggingFilter;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:24:44
* Description:
*
* @author huangpeilin
*/
@Configuration
public class RequestLoggingFilterConfig {
@Bean
public CommonsRequestLoggingFilter logFilter() {
CommonsRequestLoggingFilter filter = new RequestLoggingFilter();
((RequestLoggingFilter) filter)
.get()
// .exclude("要过滤的接口")
.exclude("/actuator/**")
.exclude("/monitor/**")
.exclude("/swagger-ui.html")
.exclude("/apiv1/web/exam/getUserInTheExamQueue")
.post()
.exclude("/actuator/**")
.exclude("/monitor/**")
.exclude("/apiv1/web/user/login")
.exclude("/apiv1/vr/user/login");
return filter;
}
}
package cn.com.sailfish.linghang.config;
import cn.com.sailfish.linghang.config.property.*;
import cn.com.sailfish.linghang.service.RabbitmqService;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.TimeoutException;
/**
* Author: huangpeilin
* Create at: 2019-04-22 11:03:35
* Description:
*
* @author huangpeilin
*/
@Configuration
@EnableConfigurationProperties({
FileUploadProperty.class,
SecurityProperty.class,
ExportTemplateProperty.class,
SsoProperty.class,
CaptchaProperty.class
})
public class SailfishPropertiesConfig {
// 设置RestTemplate的超时时间
@Bean
public RestTemplate restTemplate() {
RestTemplate restTemplate = new RestTemplate();
restTemplate.getMessageConverters()
.add(0, new StringHttpMessageConverter(StandardCharsets.UTF_8));
return restTemplate;
}
}
package cn.com.sailfish.linghang.config;
import cn.com.sailfish.linghang.security.jwt.TokenProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:29:33
* Description:
*
* @author huangpeilin
*/
@Configuration
@EnableSwagger2
@Profile("swagger")
public class SwaggerConfig {
@Autowired
private TokenProvider tokenProvider;
@Bean
public Docket createRestApi() {
ParameterBuilder tokenPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<Parameter>();
tokenPar.name("Authorization")
.description("令牌, Bearer 开头")
.modelRef(new ModelRef("string"))
.parameterType("header")
.defaultValue("Bearer ")
.required(false)
.build();
pars.add(tokenPar.build());
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("cn.com.sailfish.linghang.controllers"))
.paths(PathSelectors.any())
.build()
.globalOperationParameters(pars)
.apiInfo(apiInfo());
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Swagger REST API")
.description("领航系统后台接口")
.termsOfServiceUrl("")
.version("1.0")
.build();
}
}
package cn.com.sailfish.linghang.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:31:30
* Description:
*
* @author huangpeilin
*/
@Configuration
@Profile("swagger")
public class SwaggerWebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
// System.out.println("SwaggerWebMvcConfig addResourceHandlers" );
}
}
package cn.com.sailfish.linghang.config;
import cn.com.sailfish.linghang.common.Http401UnauthorizedEntryPoint;
import cn.com.sailfish.linghang.repository.UserRepository;
import cn.com.sailfish.linghang.security.jwt.JWTConfigurer;
import cn.com.sailfish.linghang.security.jwt.TokenProvider;
import org.springframework.beans.factory.BeanInitializationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import javax.annotation.PostConstruct;
import static cn.com.sailfish.linghang.security.SystemPrivilege.*;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:48:26
* Description:
*
* @author huangpeilin
*/
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
AuthenticationManagerBuilder authenticationManagerBuilder;
@Autowired
UserDetailsService userDetailsService;
@Autowired
TokenProvider tokenProvider;
@Autowired
UserRepository userRepository;
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf()
.disable()
.headers()
.frameOptions()
.disable()
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers("/vr_resource/**").permitAll()
.antMatchers("/apiv1/web/course/import").hasAnyAuthority(DEVELOPER)
.antMatchers("/apiv1/web/check_item/import").hasAnyAuthority(DEVELOPER)
.antMatchers("/apiv1/web/exception_item/import").hasAnyAuthority(DEVELOPER)
.antMatchers("/apiv1/web/question_paper/import").hasAnyAuthority(DEVELOPER)
.antMatchers("/apiv1/web/user/checkAddSuper").hasAnyAuthority(DEVELOPER, SUPER_ADMIN)
.antMatchers("/apiv1/web/user/export").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/user/findOne").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/user/findAllByArea").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/user/findAllByCondition").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/user/recycle").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/user/getRecycle").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/user/recycle/findAll").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/user/enableAuthority").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/user/restore").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/user/importByLocomotive").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/user/findAllByAreaId").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/question_paper/**").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/exam/**").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/course/**").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/model/**").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/engine/**").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/area/**").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/operation_record/**").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/report_card/**").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/sum/**").permitAll()
.antMatchers("/apiv1/univ/file/upload").hasAnyAuthority(DEVELOPER, SUPER_ADMIN, ADMIN, INSTRUCTOR)
.antMatchers("/apiv1/web/user/login").permitAll()
.antMatchers("/apiv1/vr/user/login").permitAll()
.antMatchers("/apiv1/vr/user/sendMobileCode").permitAll()
.antMatchers("/apiv1/web/user/sendMobileCode").permitAll()
.antMatchers("/apiv1/univ/account/**").permitAll()
.antMatchers("/apiv1/web/user/logout").permitAll()
.antMatchers("/apiv1/vr/user/logout").permitAll()
.antMatchers("/websocket").permitAll()
.anyRequest().authenticated()
.and()
.apply(securityConfigurerAdapter());
}
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring()
.antMatchers(HttpMethod.OPTIONS, "/**")
.antMatchers("/app/**/*.{js,html}")
.antMatchers("/i18n/**")
.antMatchers("/content/**")
.antMatchers("/swagger-ui.html")
.antMatchers("/webjars/**")
.antMatchers("/v2/**")
.antMatchers("/swagger-resources/**")
.antMatchers("/test/**")
.antMatchers("/resources/vr_resource/**")
.antMatchers("/actuator/**")
.antMatchers("/monitor/**")
.antMatchers("/h2/**");
}
@PostConstruct
public void init() {
try {
authenticationManagerBuilder
.userDetailsService(userDetailsService)
.passwordEncoder(passwordEncoder());
} catch (Exception e) {
throw new BeanInitializationException("Security configuration failed", e);
}
}
private JWTConfigurer securityConfigurerAdapter() {
return new JWTConfigurer(tokenProvider, userRepository);
}
@Bean
public Http401UnauthorizedEntryPoint http401UnauthorizedEntryPoint() {
return new Http401UnauthorizedEntryPoint();
}
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
}
package cn.com.sailfish.linghang.config;
import cn.com.sailfish.linghang.service.RabbitmqService;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-05-30 11:14:14
* Description:
*/
@Configuration
public class WebSocketConfig {
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
}
package cn.com.sailfish.linghang.controllers.vr;
import com.rabbitmq.client.Channel;
import java.time.Instant;
/**
* @author huangpeilin<plhuang@sailfish.com.cn>
* Create at: 2019-06-19 11:25:12
* Description: websocket中保存的关键信息
*/
public class AuthorSession {
private String card;
private Instant loginTime;
private Channel channel;
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public Instant getLoginTime() {
return loginTime;
}
public void setLoginTime(Instant loginTime) {
this.loginTime = loginTime;
}
public Channel getChannel() {
return channel;
}
public void setChannel(Channel channel) {
this.channel = channel;
}
}
package cn.com.sailfish.linghang.controllers.vr;
import java.util.HashMap;
import java.util.Map;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-06-19 11:27:50
* Description:
*/
public class AuthorSessionManager {
private static AuthorSessionManager s_instance;
public static AuthorSessionManager getInstance() {
if (s_instance == null) {
synchronized (AuthorSessionManager.class) {
if (s_instance == null) {
s_instance = new AuthorSessionManager();
}
}
}
return s_instance;
}
private static Map<String, AuthorSession> sessionMap = new HashMap<>();
public synchronized void addSession(String sessionId, AuthorSession authorSession){
sessionMap.put(sessionId, authorSession);
}
public synchronized void removeSession(String sessionId){
sessionMap.remove(sessionId);
}
public synchronized AuthorSession getSession(String sessionId){
return sessionMap.get(sessionId);
}
public boolean hasSession(String sessionId) {
return sessionMap.entrySet().contains(sessionId);
}
}
package cn.com.sailfish.linghang.controllers.vr;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.dao.vr.request.VrExamResultRequestDTO;
import cn.com.sailfish.linghang.dao.vr.request.VrOperationRecordRequestDTO;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.OperationRecordResource;
import cn.com.sailfish.linghang.resource.UserResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import static cn.com.sailfish.linghang.common.ErrorConstants.*;
import static cn.com.sailfish.linghang.enumeration.OperationRecordConstant.OPERATION_RECORD_TYPE_EXAM;
import static cn.com.sailfish.linghang.enumeration.OperationRecordConstant.OPERATION_RECORD_TYPE_EXERCISE;
/**
* Author: huangpeilin
* Create at: 2019-05-07 10:49:03
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "VR 操作管理API")
@RequestMapping("/apiv1/vr")
public class VrOperationRecordController {
public final Logger log = LoggerFactory.getLogger(VrOperationRecordController.class);
private OperationRecordResource operationRecordResource;
@Autowired
public VrOperationRecordController(OperationRecordResource operationRecordResource) {
this.operationRecordResource = operationRecordResource;
}
@ApiOperation("发送登录用户操作的信息")
@PostMapping("/operation_record/send")
public RestRespDTO sendOperationRecord(
@ApiParam("操作信息的数据模型")
@RequestBody VrOperationRecordRequestDTO requestDTO,
HttpServletRequest request) {
if (requestDTO.getbIsEnd() == null || "".equals(requestDTO.getbIsEnd())){
log.error("bIsEnd is null.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM, "bIsEnd is null.");
}
if (requestDTO.getLoginTime() == null || "".equals(requestDTO.getLoginTime())){
log.error("login time is null.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM, "login time is null.");
}
switch (requestDTO.getType()) {
case OPERATION_RECORD_TYPE_EXAM:
if (requestDTO.getId() == null || "".equals(requestDTO.getId())){
log.error("id is null.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM, "id is null.");
}
break;
case OPERATION_RECORD_TYPE_EXERCISE:
if (requestDTO.getCourseName() == null || "".equals(requestDTO.getCourseName())){
log.error("course name is null.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM, "course name is null.");
}
break;
default:
log.error("type is error.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM, "type is error.");
}
try {
operationRecordResource.saveOperationRecord(requestDTO, request);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
}
package cn.com.sailfish.linghang.controllers.vr;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.controllers.web.WebReportCardController;
import cn.com.sailfish.linghang.dao.vr.request.VrExamResultRequestDTO;
import cn.com.sailfish.linghang.dao.vr.response.VrQuestionPaperInfoResponseDTO;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.ReportCardResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import static cn.com.sailfish.linghang.common.ErrorConstants.*;
import static cn.com.sailfish.linghang.enumeration.ExamConstant.*;
/**
* Author: huangpeilin
* Create at: 2019-05-06 18:00:26
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "VR 成绩单管理API")
@RequestMapping("/apiv1/vr")
public class VrReportCardController {
public final Logger log = LoggerFactory.getLogger(VrReportCardController.class);
private ReportCardResource reportCardResource;
@Autowired
public VrReportCardController(ReportCardResource reportCardResource){
this.reportCardResource = reportCardResource;
}
@ApiOperation("获取登录用户将要考试的试卷信息")
@GetMapping("/exam/get")
public RestRespDTO getReportCardByCurrentUser() {
VrQuestionPaperInfoResponseDTO responseDTO = null;
try {
responseDTO = reportCardResource.getReportCardByCurrentUser();
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("服务端接收考试的信息(答案试卷的信息)")
@PostMapping("/exam/answer")
public RestRespDTO answerExamByCurrentUser(
@ApiParam("回答试卷的数据模型")
@RequestBody VrExamResultRequestDTO requestDTO) {
if (requestDTO.getReportCardId() == null || "".equals(requestDTO.getReportCardId())){
log.error("report card id is null.");
return RestRespUtil.getErrorRsp(REPORT_CARD_ID_IS_NULL);
}
if (requestDTO.getAssessment() == null || "".equals(requestDTO.getAssessment())){
log.error("user assessment is null.");
return RestRespUtil.getErrorRsp(REPORT_CARD_ASSESSMENT_IS_NULL);
}
switch (requestDTO.getAssessment()) {
case ASSESSMENT_TYPE_PASS + ASSESSMENT_TYPE_GO:
case ASSESSMENT_TYPE_NO_PASS + ASSESSMENT_TYPE_NOT_GO:
case ASSESSMENT_TYPE_GO + ASSESSMENT_TYPE_NO_PASS:
case ASSESSMENT_TYPE_NOT_GO + ASSESSMENT_TYPE_PASS:
break;
default:
log.error("user assessment is error.");
return RestRespUtil.getErrorRsp(REPORT_CARD_ASSESSMENT_IS_ERROR);
}
if (requestDTO.getScore() == null || "".equals(requestDTO.getScore())){
log.error("report card score is null.");
return RestRespUtil.getErrorRsp(REPORT_CARD_SCORE_IS_NULL);
}
try {
reportCardResource.answerExamByCurrentUser(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
}
package cn.com.sailfish.linghang.controllers.vr;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.dao.vr.request.VrSendMobileCodeRequestDTO;
import cn.com.sailfish.linghang.dao.vr.request.VrUserLoginRequestDTO;
import cn.com.sailfish.linghang.dao.vr.request.VrUserRegisterRequestDTO;
import cn.com.sailfish.linghang.dao.vr.response.VrUserLoginResponseDTO;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.UserResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import cn.com.sailfish.linghang.util.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import static cn.com.sailfish.linghang.common.ErrorConstants.USER_LOGIN_ACCOUNT_IS_NULL;
import static cn.com.sailfish.linghang.common.ErrorConstants.USER_PASSWORD_IS_NULL;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.FLIGHT_INT;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.LOCOMOTIVE_INT;
/**
* Author: huangpeilin
* Create at: 2019-05-06 16:50:35
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "VR 用户管理API")
@RequestMapping("/apiv1/vr")
public class VrUserController {
public final Logger log = LoggerFactory.getLogger(VrUserController.class);
private UserResource userResource;
@Autowired
public VrUserController(UserResource userResource) {
this.userResource = userResource;
}
@ApiOperation("用户登录")
@PostMapping("/user/login")
public RestRespDTO userLoginVr(
@ApiParam("用户登录的类")
@RequestBody VrUserLoginRequestDTO requestDTO,
HttpServletRequest request) {
if (requestDTO.getLoginName() == null || "".equals(requestDTO.getLoginName())) {
log.error("user login account is null.");
return RestRespUtil.getErrorRsp(USER_LOGIN_ACCOUNT_IS_NULL);
}
if (requestDTO.getQueueName() == null || "".equals(requestDTO.getQueueName())) {
log.error("user queue name is null.");
return RestRespUtil.getErrorRsp(USER_PASSWORD_IS_NULL);
}
if (requestDTO.getPassword() == null || "".equals(requestDTO.getPassword())) {
log.error("user password is null.");
return RestRespUtil.getErrorRsp(USER_PASSWORD_IS_NULL);
}
VrUserLoginResponseDTO responseDTO;
try {
responseDTO = userResource.userLoginInVr(requestDTO, request);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("退出登录")
@GetMapping("/user/logout")
public RestRespDTO logoutInVr(HttpServletRequest request) {
try {
userResource.logoutInVr(request);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("用户注册")
@PostMapping("/user/register")
public RestRespDTO registerInVr(
@ApiParam("用户注册的类")
@RequestBody VrUserRegisterRequestDTO requestDTO) {
if (requestDTO.getLoginName() == null || "".equals(requestDTO.getLoginName())) {
log.error("user login account is null.");
return RestRespUtil.getErrorRsp(USER_LOGIN_ACCOUNT_IS_NULL);
}
if (requestDTO.getPassword() == null || "".equals(requestDTO.getPassword())) {
log.error("user password is null.");
return RestRespUtil.getErrorRsp(USER_PASSWORD_IS_NULL);
}
if (!FLIGHT_INT.equals(requestDTO.getPosition()) && !LOCOMOTIVE_INT.equals(requestDTO.getPosition())) {
log.error("user password is null.");
return RestRespUtil.getErrorRsp(USER_PASSWORD_IS_NULL);
}
try{
userResource.registerInVr(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("发送验证码")
@PostMapping("/user/sendMobileCode")
public RestRespDTO mobileCodeInVr(
@ApiParam("获取验证码的类")
@RequestBody VrSendMobileCodeRequestDTO requestDTO,
HttpServletRequest request
) {
if (StringUtil.isEmpty(requestDTO.getLoginName())) {
log.error("user login account is null.");
return RestRespUtil.getErrorRsp(USER_LOGIN_ACCOUNT_IS_NULL);
}
if (StringUtil.isEmpty(requestDTO.getToken())){
log.error("user login account is null.");
return RestRespUtil.getErrorRsp(USER_LOGIN_ACCOUNT_IS_NULL);
}
userResource.requestMobileCode(requestDTO, request);
return RestRespUtil.getSuccessRsp();
}
}
package cn.com.sailfish.linghang.controllers.vr;
import cn.com.sailfish.linghang.domain.User;
import cn.com.sailfish.linghang.enumeration.WebSocketConstant;
import cn.com.sailfish.linghang.repository.UserRepository;
import cn.com.sailfish.linghang.service.OperationRecordService;
import cn.com.sailfish.linghang.service.RabbitmqService;
import cn.com.sailfish.linghang.util.AESUtil;
import com.alibaba.fastjson.JSONObject;
import com.rabbitmq.client.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.time.Instant;
import java.util.Base64;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.TimeoutException;
import static cn.com.sailfish.linghang.enumeration.WebSocketConstant.*;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-05-30 10:33:35
* Description:
*/
@RestController
@ServerEndpoint("/websocket")
public class WebSocketController {
private static final Logger log = LoggerFactory.getLogger(WebSocketController.class);
/**
* 用来记录当前连接数的变量
*/
private static volatile int onlineCount = 0;
/**
* concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象
*/
private static CopyOnWriteArraySet<WebSocketController> webSocketSet = new CopyOnWriteArraySet<WebSocketController>();
/**
* 与某个客户端的连接会话,需要通过它来与客户端进行数据收发
*/
private Session session;
/**
* 加密解密的密钥
*/
private static final String ENCRYPT_KEY = "SAILFISH";
private static RabbitmqService rabbitmqService;
private static OperationRecordService operationRecordService;
private static UserRepository userRepository;
@Autowired
public void setRabbitmqService(RabbitmqService rabbitmqService, OperationRecordService operationRecordService,
UserRepository userRepository){
WebSocketController.rabbitmqService = rabbitmqService;
WebSocketController.operationRecordService = operationRecordService;
WebSocketController.userRepository = userRepository;
}
@OnOpen
public void onOpen(Session session) {
this.session = session;
// 加入到set中
webSocketSet.add(this);
// 在线数加1
addOnlineCount();
log.info("New connection added!The current online population is {}", getOnlineCount());
}
@OnClose
public void onClose(Session session) throws IOException, TimeoutException {
String sessionId = session.getId();
//从set中删除
webSocketSet.remove(this);
AuthorSession authorSession = AuthorSessionManager.getInstance().getSession(sessionId);
if (authorSession != null){
Channel channel = authorSession.getChannel();
if (channel != null){
channel.close();
}
String card = authorSession.getCard();
if (card != null){
operationRecordService.closeOperationRecord(card);
}
}
AuthorSessionManager.getInstance().removeSession(sessionId);
// 在线数减1
subOnlineCount();
log.info("Close a websocket. A connection is closed!The current online population is {}", getOnlineCount());
}
@OnMessage
public void onMessage(String message, Session session) throws IOException, NoSuchAlgorithmException {
log.info("Receive a message from client: " + message);
JSONObject jsonObject = JSONObject.parseObject(message);
int command = jsonObject.getIntValue("command");
JSONObject resultMessage = new JSONObject();
do {
if (command != WebSocketConstant.INIT_COMMAND_C2S){
resultMessage.put("accepted", false);
resultMessage.put("message", "command is error.");
break;
}
String version = jsonObject.getString("version");
if (!SOCKET_VERSION.equals(version)){
resultMessage.put("accepted", false);
resultMessage.put("message", "version is error.");
break;
}
String uuid = jsonObject.getString("uuid");
String sign = jsonObject.getString("sign");
String card = jsonObject.getString("card");
User user = userRepository.findOneByCard(card).orElse(null);
if (user == null){
resultMessage.put("accepted", false);
resultMessage.put("message", "can not find user by this card " + card);
break;
}
String result = version + uuid;
MessageDigest sd = MessageDigest.getInstance("MD5");
sd.update(result.getBytes(StandardCharsets.UTF_8));
String digestOfResult = Base64.getEncoder().encodeToString(sd.digest());
if (!digestOfResult.equals(sign)){
resultMessage.put("accepted", false);
resultMessage.put("message", "sign is error.");
break;
}
if (uuid != null && !"".equals(uuid)){
Channel channel = rabbitmqService.createChannel();
listenerQueueMessage(channel, uuid, session);
AuthorSession authorSession = new AuthorSession();
authorSession.setCard(card);
authorSession.setChannel(channel);
authorSession.setLoginTime(Instant.now());
AuthorSessionManager.getInstance().addSession(session.getId(), authorSession);
}
String encrypt_key = new String(Base64.getEncoder().encode(ENCRYPT_KEY.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8);
resultMessage.put("accepted", true);
resultMessage.put("message", "success.");
resultMessage.put("encrypt_key", encrypt_key);
}while (false);
resultMessage.put("command", INIT_COMMAND_S2C);
synchronized (this.session){
this.session.getBasicRemote().sendText(resultMessage.toJSONString());
}
}
@OnError
public void onError(Session session, Throwable error) {
String sessionId = session.getId();
//从set中删除
webSocketSet.remove(this);
AuthorSession authorSession = AuthorSessionManager.getInstance().getSession(sessionId);
if (authorSession != null){
// 在线数减1
subOnlineCount();
Channel channel = authorSession.getChannel();
String card = authorSession.getCard();
if (card != null){
operationRecordService.closeOperationRecord(card);
}
if (channel != null){
try {
channel.close();
} catch (IOException e) {
e.printStackTrace();
} catch (TimeoutException e) {
e.printStackTrace();
}
}
}
AuthorSessionManager.getInstance().removeSession(sessionId);
log.error("Error while websocket. ", error);
}
/**
* 获取当前连接数
* @return
*/
public static synchronized int getOnlineCount() {
return onlineCount;
}
/**
* 当前连接数加一
* @return
*/
public static synchronized void addOnlineCount() {
WebSocketController.onlineCount++;
}
/**
* 当前连接数减一
*/
public static synchronized void subOnlineCount() {
if (WebSocketController.onlineCount > 0){
WebSocketController.onlineCount--;
}
}
private void listenerQueueMessage(Channel channel, String queue, Session session){
try {
channel.queueDeclare(queue, true, false, false, null);
//每次从队列获取的数量,保证一次只分发一个
channel.basicQos(1);
//监听队列
Consumer consumer = new DefaultConsumer(channel) {
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
//处理监听得到的消息
String message = null;
try {
message = new String(body, StandardCharsets.UTF_8);
//消息处理逻辑
String encryptMessage = AESUtil.doEncryptedAES(message, ENCRYPT_KEY);
JSONObject resultMessage = new JSONObject();
resultMessage.put("command", MESSAGE_COMMAND_S2C);
resultMessage.put("message", encryptMessage);
synchronized (session){
session.getBasicRemote().sendText(resultMessage.toJSONString());
channel.basicAck(envelope.getDeliveryTag(), false);
}
} catch (Exception e){
e.printStackTrace();
}
}
};
//autoAck是否自动回复,如果为true的话,每次生产者只要发送信息就会从内存中删除,那么如果消费者程序异常退出,
// 那么就无法获取数据,我们当然是不希望出现这样的情况,所以才去手动回复,每当消费者收到并处理信息然后在通知
// 生成者。最后从队列中删除这条信息。如果消费者异常退出,如果还有其他消费者,那么就会把队列中的消息发送给其
// 他消费者,如果没有,等消费者启动时候再次发送。
//消息消费完成确认
channel.basicConsume(queue, false, consumer);
} catch (IOException e) {
e.printStackTrace();
}
}
}
package cn.com.sailfish.linghang.controllers.web;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.config.property.CaptchaProperty;
import cn.com.sailfish.linghang.dao.CaptchaValidateDTO;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.CaptchaResource;
import cn.com.sailfish.linghang.resource.FileResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import com.alibaba.fastjson.JSONObject;
import io.micrometer.core.annotation.Timed;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.time.Instant;
import static cn.com.sailfish.linghang.common.ErrorConstants.CAPTCHA_CODE_EXPIRES;
/**
* Author: huangpeilin
* Create at: 2019-05-07 14:58:27
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "文件管理API")
@RequestMapping("/apiv1/univ")
public class FileController {
public final Logger log = LoggerFactory.getLogger(FileController.class);
private FileResource fileResource;
private CaptchaProperty captchaProperty;
private CaptchaResource captchaResource;
private static final String CAPTCHA_SESSION = "captchaValidate";
@Autowired
public FileController(FileResource fileResource, CaptchaProperty captchaProperty,
CaptchaResource captchaResource) {
this.fileResource = fileResource;
this.captchaProperty = captchaProperty;
this.captchaResource = captchaResource;
}
@ApiOperation("文件下载")
@GetMapping("/file/download")
public void downloadFile(
@ApiParam("文件地址")
@RequestParam String key,
HttpServletResponse response) throws IOException {
fileResource.downloadFile(key, response);
}
@ApiOperation("上传文件")
@PostMapping("/file/upload")
public RestRespDTO uploadFile(
@ApiParam("上传的文件")
@RequestParam MultipartFile file,
@ApiParam("文件的key")
@RequestParam(required = false) String key) {
JSONObject response;
try {
response = fileResource.uploadFile(file, key);
} catch (IOException e) {
return RestRespUtil.getErrorRsp(e);
}catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(response);
}
@ApiOperation("删除文件")
@GetMapping("/file/delete")
public RestRespDTO deleteFile(
@ApiParam("文件地址")
@RequestParam String key) {
try {
fileResource.deleteFile(key);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation(value = "发送动态验证码")
@GetMapping(value = "/account/reset/captcha.jpg")
@Timed
public void getCaptcha(HttpServletRequest req, HttpServletResponse resp) {
log.debug("REST request to get Captcha ");
try {
captchaResource.captcha(req, resp);
String captcha = captchaResource.getGeneratedKey(req).toLowerCase();
log.debug("Captcha is {}", captcha);
HttpSession session = req.getSession();
CaptchaValidateDTO captchaValidateDTO = new CaptchaValidateDTO();
captchaValidateDTO.setActiveTime(Instant.now());
captchaValidateDTO.setCaptcha(captcha);
session.setAttribute(CAPTCHA_SESSION, captchaValidateDTO);
session.setMaxInactiveInterval(captchaProperty.getValidTime());
} catch (Exception e) {
log.error(e.getMessage());
e.printStackTrace();
}
}
}
package cn.com.sailfish.linghang.controllers.web;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.dao.web.response.AreaResponseDTO;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.AreaResource;
import cn.com.sailfish.linghang.resource.UserResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-24 18:21:31
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "WEB 区域管理API")
@RequestMapping("/apiv1/web")
public class WebAreaController {
public final Logger log = LoggerFactory.getLogger(WebAreaController.class);
private AreaResource areaResource;
@Autowired
public WebAreaController(AreaResource areaResource) {
this.areaResource = areaResource;
}
@ApiOperation("获取所有的区域")
@GetMapping("/area/findAll")
public RestRespDTO findAllArea(){
List<AreaResponseDTO> responseDTOList = null;
try {
responseDTOList = areaResource.findAllArea();
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTOList);
}
@ApiOperation("获取某个职位的所有区域")
@GetMapping("/area/findAllByPosition")
public RestRespDTO findAllAreaByPosition(){
List<AreaResponseDTO> responseDTOList = null;
try {
responseDTOList = areaResource.findAllAreaByPosition();
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTOList);
}
}
package cn.com.sailfish.linghang.controllers.web;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.dao.web.response.CourseInfoResponseDTO;
import cn.com.sailfish.linghang.dao.web.response.QuestionPaperInfoResponseDTO;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.CourseResource;
import cn.com.sailfish.linghang.resource.EngineResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-30 14:59:53
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "WEB 课程管理API")
@RequestMapping("/apiv1/web")
public class WebCourseController {
public final Logger log = LoggerFactory.getLogger(WebCourseController.class);
private CourseResource courseResource;
@Autowired
public WebCourseController(CourseResource courseResource){
this.courseResource = courseResource;
}
@ApiOperation("根据课程ID获取课程信息 ")
@GetMapping("/course/findOne")
public RestRespDTO findOneCourseById(
@ApiParam("课程ID")
@RequestParam Long id){
CourseInfoResponseDTO responseDTO = null;
try {
responseDTO = courseResource.findOneCourseById(id);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("获取所有获取课程信息 ")
@GetMapping("/course/findAll")
public RestRespDTO findAllCourse(){
return RestRespUtil.getSuccessRsp(courseResource.findAllCourse());
}
@ApiOperation("导入课程数据")
@PostMapping("/course/import")
public RestRespDTO importCourse(
@ApiParam("导入课程数据")
@RequestParam MultipartFile file){
try {
courseResource.importCourse(file);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
}
package cn.com.sailfish.linghang.controllers.web;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.resource.EngineResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Author: huangpeilin
* Create at: 2019-04-25 14:07:13
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "WEB 发动机管理API")
@RequestMapping("/apiv1/web")
public class WebEngineController {
public final Logger log = LoggerFactory.getLogger(WebEngineController.class);
private EngineResource engineResource;
@Autowired
public WebEngineController(EngineResource engineResource){
this.engineResource = engineResource;
}
@ApiOperation("获取所有发动机")
@GetMapping("/engine/findAll")
public RestRespDTO findAllEngine(){
return RestRespUtil.getSuccessRsp(engineResource.findAllEngine());
}
}
package cn.com.sailfish.linghang.controllers.web;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.dao.web.request.*;
import cn.com.sailfish.linghang.dao.web.response.*;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.ExamResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import com.sun.org.apache.regexp.internal.RE;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static cn.com.sailfish.linghang.common.ErrorConstants.*;
import static cn.com.sailfish.linghang.enumeration.ExamConstant.*;
/**
* Author: huangpeilin
* Create at: 2019-04-26 15:35:28
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "WEB 考试管理API")
@RequestMapping("/apiv1/web")
public class WebExamController {
public final Logger log = LoggerFactory.getLogger(WebExamController.class);
private ExamResource examResource;
@Autowired
public WebExamController(ExamResource examResource){
this.examResource = examResource;
}
@ApiOperation("获取某个区域下所有在考试队列的人")
@GetMapping("/exam/getUserInTheExamQueue")
public RestRespDTO findAllUserInTheExamQueue(
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("工号")
@RequestParam(required = false) String card,
@ApiParam("姓名")
@RequestParam(required = false) String username,
@ApiParam("班别")
@RequestParam(required = false) String classType,
@ApiParam("负责人名字")
@RequestParam(required = false) String leader){
List<WebExamUserMessageResponseDTO> responseDTO = null;
try {
responseDTO = examResource.findAllUserInTheExamQueue(areaId, card, username, classType, leader);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("获取当前教员最近一次指定的监考人")
@GetMapping("/exam/getInvigilator")
public RestRespDTO getInvigilator(){
String responseDTO = null;
try {
responseDTO = examResource.getInvigilator();
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("指定用户考试")
@PostMapping("/exam/appointUserTest")
public RestRespDTO appointUserTest (
@ApiParam("指定用户考试的数据模型")
@RequestBody AppointUserTestRequestDTO requestDTO){
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
if (CollectionUtils.isEmpty(requestDTO.getExamUserIds()) || CollectionUtils.isEmpty(requestDTO.getInvigilatorIds())){
log.error("user id is null.");
return RestRespUtil.getErrorRsp(USER_ID_IS_NULL);
}
if (requestDTO.getInvigilatorIds().size() > MAX){
log.error("invigilator number is error.");
return RestRespUtil.getErrorRsp(INVIGILATOR_NUMBER_IS_ERROR);
}
if (requestDTO.getQuestionPaperId() == null || "".equals(requestDTO.getQuestionPaperId())){
log.error("question paper id is null.");
return RestRespUtil.getErrorRsp(QUESTION_PAPER_ID_IS_NULL);
}
if (requestDTO.getType() != TYPE_CREATE && requestDTO.getType() != TYPE_UPDATE){
log.error("type is error.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}
try {
examResource.appointUserTest(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("是否可以指定用户考试")
@PostMapping("/exam/checkAppointUserTest")
public RestRespDTO checkAppointUserTest (
@ApiParam("指定用户考试的数据模型")
@RequestBody AppointUserTestRequestDTO requestDTO){
if (CollectionUtils.isEmpty(requestDTO.getExamUserIds()) || CollectionUtils.isEmpty(requestDTO.getInvigilatorIds())){
log.error("user id is null.");
return RestRespUtil.getErrorRsp(USER_ID_IS_NULL);
}
if (requestDTO.getQuestionPaperId() == null || "".equals(requestDTO.getQuestionPaperId())){
log.error("question paper id is null.");
return RestRespUtil.getErrorRsp(QUESTION_PAPER_ID_IS_NULL);
}
CheckExamUserTestResponseDTO responseDTO = null;
try {
responseDTO = examResource.checkAppointUserTest(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("检测是否可以开启考试")
@PostMapping("/exam/checkTestStart")
public RestRespDTO checkTestStart (
@ApiParam("开始考试的数据模型")
@RequestBody OperationUserTestRequestDTO requestDTO){
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
if (CollectionUtils.isEmpty(requestDTO.getList())){
log.error("ExamRequestDTO is null");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}else{
for (ExamRequestDTO examRequestDTO : requestDTO.getList()){
if (examRequestDTO.getExamId() == null || "".equals(examRequestDTO.getExamId())){
log.error("exam id is null");
return RestRespUtil.getErrorRsp(EXAM_ID_IS_NULL);
}
if (examRequestDTO.getExamUserId() == null || "".equals(examRequestDTO.getExamUserId())){
log.error("user id is null");
return RestRespUtil.getErrorRsp(USER_ID_IS_NULL);
}
if (examRequestDTO.getQuestionPaperId() == null || "".equals(examRequestDTO.getQuestionPaperId())){
log.error("question paper is is null");
return RestRespUtil.getErrorRsp(QUESTION_PAPER_ID_IS_NULL);
}
}
}
CheckExamUserTestResponseDTO responseDTO = null;
try {
responseDTO = examResource.checkTestStart(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("开启考试")
@PostMapping("/exam/start")
public RestRespDTO testStart (
@ApiParam("开始考试的数据模型")
@RequestBody OperationUserTestRequestDTO requestDTO){
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
if (CollectionUtils.isEmpty(requestDTO.getList())){
log.error("ExamRequestDTO is null");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}else{
for (ExamRequestDTO examRequestDTO : requestDTO.getList()){
if (examRequestDTO.getExamId() == null || "".equals(examRequestDTO.getExamId())){
log.error("exam id is null");
return RestRespUtil.getErrorRsp(EXAM_ID_IS_NULL);
}
if (examRequestDTO.getQuestionPaperId() == null || "".equals(examRequestDTO.getQuestionPaperId())){
log.error("question paper is is null");
return RestRespUtil.getErrorRsp(QUESTION_PAPER_ID_IS_NULL);
}
if (examRequestDTO.getExamUserId() == null || "".equals(examRequestDTO.getExamUserId())){
log.error("user id is null");
return RestRespUtil.getErrorRsp(USER_ID_IS_NULL);
}
}
}
try {
examResource.testStart(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("关闭考试")
@PostMapping("/exam/close")
public RestRespDTO testClose (
@ApiParam("关闭考试的数据模型")
@RequestBody OperationUserTestRequestDTO requestDTO){
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
if (CollectionUtils.isEmpty(requestDTO.getList())){
log.error("ExamRequestDTO is null");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}else{
for (ExamRequestDTO examRequestDTO : requestDTO.getList()){
if (examRequestDTO.getQuestionPaperId() == null || "".equals(examRequestDTO.getQuestionPaperId())){
log.error("question paper is is null");
return RestRespUtil.getErrorRsp(QUESTION_PAPER_ID_IS_NULL);
}
if (examRequestDTO.getExamUserId() == null || "".equals(examRequestDTO.getExamUserId())){
log.error("user id is null");
return RestRespUtil.getErrorRsp(USER_ID_IS_NULL);
}
if (examRequestDTO.getExamId() == null || "".equals(examRequestDTO.getExamId())){
log.error("exam id is null");
return RestRespUtil.getErrorRsp(EXAM_ID_IS_NULL);
}
}
}
try {
examResource.testClose(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("新增考试队列的人")
@PostMapping("/exam/addUserInTheExamQueue")
public RestRespDTO addUserInTheExamQueue (
@ApiParam("新增考试队列的人的数据模型")
@RequestBody UserTestQueueRequestDTO requestDTO){
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
if (CollectionUtils.isEmpty(requestDTO.getExamUserIds())){
log.error("user id is null");
return RestRespUtil.getErrorRsp(USER_ID_IS_NULL);
}
try {
examResource.operationUserInTheExamQueue(requestDTO, true);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("删除考试队列的人")
@PostMapping("/exam/removeUserInTheExamQueue")
public RestRespDTO removeUserInTheExamQueue (
@ApiParam("删除考试队列的人的数据模型")
@RequestBody UserTestQueueRequestDTO requestDTO){
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
if (CollectionUtils.isEmpty(requestDTO.getExamUserIds())){
log.error("user id is null");
return RestRespUtil.getErrorRsp(USER_ID_IS_NULL);
}
try {
examResource.operationUserInTheExamQueue(requestDTO, false);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("检测是否可以删除考试队列的人")
@PostMapping("/exam/removeUserInTheExamQueue/check")
public RestRespDTO checkRemoveUserInTheExamQueue (
@ApiParam("检测是否可以删除考试队列的人的数据模型")
@RequestBody WebCheckUserTestQueueRequestDTO requestDTO){
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
WebCheckUserTestQueueResponseDTO responseDTO = null;
try {
responseDTO = examResource.checkRemoveUserInTheExamQueue(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("操作指定监考老师的信息")
@PostMapping("/exam/addInvigilator")
public RestRespDTO addInvigilator (
@ApiParam("要保存的监考老师的ID")
@RequestBody List<Long> ids){
try {
examResource.addInvigilator(ids);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("根据考试时间,试卷名字,考试时长查看某个班别的所有考试")
@GetMapping("/exam/findAllByCondition")
public RestRespDTO findAllExamByCondition (
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("是否在回收站 false 否 true 是")
@RequestParam Boolean isRecycle,
@ApiParam("监考人名字")
@RequestParam(required = false) String invigilator,
@ApiParam("班别 初训 复选")
@RequestParam(required = false) String classType,
@ApiParam("考试时长")
@RequestParam(required = false) Long examTime,
@ApiParam("试卷名字")
@RequestParam(required = false) String questionPaperName,
@ApiParam("页数 默认是1")
@RequestParam Integer page,
@ApiParam("每一页的条数 默认是20")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
PageResponse<ExamMessageResponseDTO> responseDTOList = null;
try {
responseDTOList = examResource.findAllExamByCondition(
areaId, isRecycle, invigilator, classType, examTime, questionPaperName, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTOList);
}
@ApiOperation("将班级成绩单放入回收站")
@PostMapping("/exam/recycle")
public RestRespDTO recycleExam(
@ApiParam("成绩单放入回收站的模型")
@RequestBody WebExamOperationRequestDTO requestDTO){
if (CollectionUtils.isEmpty(requestDTO.getIds())){
log.error("exam id is null.");
return RestRespUtil.getErrorRsp(EXAM_ID_IS_NULL);
}
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
try {
examResource.operationExamInRecycle(requestDTO, true);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("将班级成绩单从回收站中恢复")
@PostMapping("/exam/restore")
public RestRespDTO restoreExam(
@ApiParam("成绩单还原回收站的模型")
@RequestBody WebExamOperationRequestDTO requestDTO){
if (CollectionUtils.isEmpty(requestDTO.getIds())){
log.error("exam id is null.");
return RestRespUtil.getErrorRsp(EXAM_ID_IS_NULL);
}
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
try {
examResource.operationExamInRecycle(requestDTO, false);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("根据考试ID设置班级成绩单的备注")
@GetMapping("/exam/setRemark")
public RestRespDTO setRemarkByExamId(
@ApiParam("考试ID")
@RequestParam Long examId,
@ApiParam("成绩备注")
@RequestParam(required = false) String remarks){
try {
examResource.setRemarkByExamId(examId, remarks);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
}
package cn.com.sailfish.linghang.controllers.web;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.ItemResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-06-03 15:10:55
* Description:
*/
@RestController
@Api(description = "WEB 检查项和异常项管理API")
@RequestMapping("/apiv1/web")
public class WebItemController {
public final Logger log = LoggerFactory.getLogger(WebItemController.class);
private ItemResource itemResource;
@Autowired
public WebItemController(ItemResource itemResource){
this.itemResource = itemResource;
}
@ApiOperation("导入检查项数据")
@PostMapping("/check_item/import")
public RestRespDTO importCheckItem(
@ApiParam("导入检查项数据")
@RequestParam MultipartFile file){
try {
itemResource.importCheckItem(file);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("导入异常项数据")
@PostMapping("/exception_item/import")
public RestRespDTO importExceptionItem(
@ApiParam("导入异常项数据")
@RequestParam MultipartFile file){
try {
itemResource.importExceptionItem(file);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
}
package cn.com.sailfish.linghang.controllers.web;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.resource.ModelResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* Author: huangpeilin
* Create at: 2019-04-25 10:41:06
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "WEB 机型管理API")
@RequestMapping("/apiv1/web")
public class WebModelController {
public final Logger log = LoggerFactory.getLogger(WebModelController.class);
private ModelResource modelResource;
@Autowired
public WebModelController(ModelResource modelResource) {
this.modelResource = modelResource;
}
@ApiOperation("获取所有机型的品牌")
@GetMapping("/model/findAllBrand")
public RestRespDTO findAllBrand(){
return RestRespUtil.getSuccessRsp(modelResource.findAllBrand());
}
@ApiOperation("根据机型的品牌获取所有机型")
@GetMapping("/model/findAllByBrand")
public RestRespDTO findAllModelByBrand(
@ApiParam("飞机的品牌")
@RequestParam String brand){
return RestRespUtil.getSuccessRsp(modelResource.findAllModelByBrand(brand));
}
@ApiOperation("获取所有机型")
@GetMapping("/model/findAll")
public RestRespDTO findAllModel(){
return RestRespUtil.getSuccessRsp(modelResource.findAllModel());
}
}
package cn.com.sailfish.linghang.controllers.web;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.dao.web.response.*;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.OperationRecordResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import static cn.com.sailfish.linghang.common.ErrorConstants.ERR_BAD_PARAM;
import static cn.com.sailfish.linghang.enumeration.QuestionPaperConstant.QUESTION_PAPER_TYPE_EXAM;
import static cn.com.sailfish.linghang.enumeration.QuestionPaperConstant.QUESTION_PAPER_TYPE_EXERCISE;
/**
* Author: huangpeilin
* Create at: 2019-05-05 11:00:11
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "WEB 操作记录管理API")
@RequestMapping("/apiv1/web")
public class WebOperationRecordController {
public final Logger log = LoggerFactory.getLogger(WebOperationRecordController.class);
private OperationRecordResource operationRecordResource;
@Autowired
public WebOperationRecordController(OperationRecordResource operationRecordResource) {
this.operationRecordResource = operationRecordResource;
}
@ApiOperation("根据工号,姓名,日期,试卷或者课程名字搜索操作记录")
@GetMapping("/operation_record/findAllByType")
public RestRespDTO findAllOperationRecordByCondition (
@ApiParam("操作的类型 0 训练 1 考试 ")
@RequestParam Integer type,
@ApiParam("试卷名字或者课程名字 由操作类型决定 选填")
@RequestParam(required = false) String name,
@ApiParam("工号 选填")
@RequestParam(required = false) String card,
@ApiParam("时间日期 时间戳 选填")
@RequestParam(required = false) Long dateTime,
@ApiParam("用户名字 选填")
@RequestParam(required = false) String username,
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("页数 默认是1")
@RequestParam Integer page,
@ApiParam("每一页的条数 默认是20")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
if (type < QUESTION_PAPER_TYPE_EXAM && type > QUESTION_PAPER_TYPE_EXERCISE){
log.error("type is error.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}
PageResponse<OperationRecordResponseDTO> responseDTO = null;
try {
responseDTO = operationRecordResource.findAllOperationRecordByCondition(areaId, type, name, card, dateTime, username, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("根据用户工号搜索训练操作记录")
@GetMapping("/operation_record/findAllByUserAndPractice")
public RestRespDTO findAllOperationRecordByUserAndPractice (
@ApiParam("工号")
@RequestParam String card,
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("页数 默认是1")
@RequestParam Integer page,
@ApiParam("每一页的条数 默认是20")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
OperationRecordPracticeResponseDTO responseDTO = null;
try {
responseDTO = operationRecordResource.findAllOperationRecordByUserAndPractice(areaId, card, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("根据用户工号搜索考试操作记录")
@GetMapping("/operation_record/findAllByUserAndExam")
public RestRespDTO findAllOperationRecordByUserAndExam (
@ApiParam("工号")
@RequestParam String card,
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("页数 默认是1")
@RequestParam Integer page,
@ApiParam("每一页的条数 默认是20")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
OperationRecordExamResponseDTO responseDTO = null;
try {
responseDTO = operationRecordResource.findAllOperationRecordByUserAndExam(areaId, card, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("获取某个区域所有用户的最新登录记录")
@GetMapping("/operation_record/findAllByArea")
public RestRespDTO findAllOperationRecordByArea (
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("记录的类型 0 训练 1 考试 ")
@RequestParam Integer status,
@ApiParam("页数 默认是1")
@RequestParam Integer page,
@ApiParam("每一页的条数 默认是20")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
PageResponse<OperationRecordResponseDTO> responseDTO = null;
try {
responseDTO = operationRecordResource.findAllOperationRecordByArea(areaId, status, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("获取某个区域登录情况")
@GetMapping("/operation_record/getLoginSituation")
public RestRespDTO getLoginSituation (
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("页数 默认是1")
@RequestParam Integer page,
@ApiParam("每一页的条数 默认是20")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
PageResponse<LoginSituationResponseDTO> responseDTO = null;
try {
responseDTO = operationRecordResource.getLoginSituation(areaId, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("导出某个区域的最新考试操作记录")
@GetMapping("/operation_record/exportExcelByExam")
public void exportOperationRecordToExcelByExam (
@ApiParam("区域ID")
@RequestParam Long areaId,
HttpServletRequest request,
HttpServletResponse response){
try {
operationRecordResource.exportOperationRecordToExcelByExam(areaId, request, response);
} catch (ServerErrorException e) {
e.printStackTrace();
}
}
@ApiOperation("导出某个区域的最新训练操作记录")
@GetMapping("/operation_record/exportExcelByTrain")
public void exportOperationRecordToExcelByTrain (
@ApiParam("区域ID")
@RequestParam Long areaId,
HttpServletRequest request,
HttpServletResponse response){
try {
operationRecordResource.exportOperationRecordToExcelByTrain(areaId, request, response);
} catch (ServerErrorException e) {
e.printStackTrace();
}
}
@ApiOperation("根据用户工号导出训练操作记录")
@GetMapping("/operation_record/exportExcelByUserAndPractice")
public void exportExcelOperationRecordByUserAndPractice (
@ApiParam("工号")
@RequestParam String card,
HttpServletRequest request,
HttpServletResponse response){
try {
operationRecordResource.exportExcelOperationRecordByUserAndPractice(card, request, response);
} catch (ServerErrorException e) {
e.printStackTrace();
}
}
@ApiOperation("根据用户工号导出考试操作记录")
@GetMapping("/operation_record/exportExcelByUserAndExam")
public void exportExcelOperationRecordByUserAndExam (
@ApiParam("工号")
@RequestParam String card,
HttpServletRequest request,
HttpServletResponse response){
try {
operationRecordResource.exportExcelOperationRecordByUserAndExam(card, request, response);
} catch (ServerErrorException e) {
e.printStackTrace();
}
}
}
package cn.com.sailfish.linghang.controllers.web;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.dao.web.request.WebQuestionPaperCreateRequestDTO;
import cn.com.sailfish.linghang.dao.web.request.WebQuestionPaperOperationRequestDTO;
import cn.com.sailfish.linghang.dao.web.response.PageResponse;
import cn.com.sailfish.linghang.dao.web.response.QuestionPaperInfoResponseDTO;
import cn.com.sailfish.linghang.dao.web.response.QuestionPaperResponseDTO;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.QuestionPaperResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static cn.com.sailfish.linghang.common.ErrorConstants.*;
import static cn.com.sailfish.linghang.enumeration.QuestionPaperConstant.RANDOM_DISTRIBUTION;
import static cn.com.sailfish.linghang.enumeration.QuestionPaperConstant.UNIFORM_DISTRIBUTION;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.FLIGHT_INT;
/**
* Author: huangpeilin
* Create at: 2019-04-25 14:36:26
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "WEB 试卷管理API")
@RequestMapping("/apiv1/web")
public class WebQuestionPaperController {
public final Logger log = LoggerFactory.getLogger(WebQuestionPaperController.class);
private QuestionPaperResource questionPaperResource;
@Autowired
public WebQuestionPaperController(QuestionPaperResource questionPaperResource) {
this.questionPaperResource = questionPaperResource;
}
@ApiOperation("创建试卷")
@PostMapping("/question_paper/create")
public RestRespDTO createQuestionPaper(
@ApiParam("创建试卷的数据模型")
@RequestBody WebQuestionPaperCreateRequestDTO requestDTO){
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())) {
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
if (requestDTO.getEngineId() == null || "".equals(requestDTO.getEngineId())) {
log.error("engine id is null.");
return RestRespUtil.getErrorRsp(ENGINE_ID_IS_NULL);
}
if (requestDTO.getCourseId() == null || "".equals(requestDTO.getCourseId())) {
log.error("course id is null.");
return RestRespUtil.getErrorRsp(COURSE_ID_IS_NULL);
}
if (requestDTO.getModelId() == null || "".equals(requestDTO.getModelId())) {
log.error("model id is null.");
return RestRespUtil.getErrorRsp(MODEL_ID_IS_NULL);
}
if (requestDTO.getTitle() == null || "".equals(requestDTO.getTitle())) {
log.error("title is null.");
return RestRespUtil.getErrorRsp(QUESTION_PAPER_TITLE_IS_NULL);
}
if (requestDTO.getTestLength() == null || "".equals(requestDTO.getTestLength())) {
log.error("test length id is null.");
return RestRespUtil.getErrorRsp(QUESTION_PAPER_TEST_LENGTH_IS_NULL);
}
if (requestDTO.getRandomAbnormals() == null || "".equals(requestDTO.getRandomAbnormals())) {
log.error("random abnormal is null.");
return RestRespUtil.getErrorRsp(QUESTION_PAPER_RANDOM_ABNORMAL_IS_NULL);
}
if (!RANDOM_DISTRIBUTION.equals(requestDTO.getExceptionGenerateType()) && !UNIFORM_DISTRIBUTION.equals(requestDTO.getExceptionGenerateType())) {
log.error("exception generate type is error.");
return RestRespUtil.getErrorRsp(QUESTION_PAPER_EXCEPTION_GENERATE_TYPE_IS_ERROR);
}
Long id = null;
try {
id = questionPaperResource.createQuestionPaper(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(id);
}
@ApiOperation("获取某个区域下的所有试卷")
@GetMapping("/question_paper/findAll")
public RestRespDTO findAllQuestionPaperByArea(
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("是否搜索回收站的试卷 true 是 false 不是")
@RequestParam Boolean type,
@ApiParam("页数")
@RequestParam Integer page,
@ApiParam("每一页的条数")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
PageResponse<QuestionPaperResponseDTO> responseDTO = null;
try {
responseDTO = questionPaperResource.findAllQuestionPaperByArea(areaId, type, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("根据试卷ID获取试卷信息 ")
@GetMapping("/question_paper/findOne")
public RestRespDTO findOneQuestionPaperById(
@ApiParam("试卷ID")
@RequestParam Long id){
QuestionPaperInfoResponseDTO responseDTO = null;
try {
responseDTO = questionPaperResource.findOneQuestionPaperById(id);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("获取某个区域下的所有试卷")
@GetMapping("/question_paper/findAllByCondition")
public RestRespDTO findAllQuestionPaperByCondition(
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("机型ID")
@RequestParam(required = false) Long modelId,
@ApiParam("课程ID")
@RequestParam(required = false) Long courseId,
@ApiParam("试卷名")
@RequestParam(required = false) String title,
@ApiParam("页数")
@RequestParam Integer page,
@ApiParam("每一页的条数")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
PageResponse<QuestionPaperResponseDTO> responseDTO = null;
try {
responseDTO = questionPaperResource.findAllQuestionPaperByCondition(areaId, modelId, courseId, title, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("通过区域机型课程试卷名和创建人搜索回收站中的试卷")
@GetMapping("/question_paper/recycle/findAllByCondition")
public RestRespDTO findAllQuestionPaperInRecycleByCondition(
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("机型ID")
@RequestParam(required = false) Long modelId,
@ApiParam("课程ID")
@RequestParam(required = false) Long courseId,
@ApiParam("试卷名")
@RequestParam(required = false) String title,
@ApiParam("创建人名字")
@RequestParam(required = false) String authorName,
@ApiParam("页数")
@RequestParam Integer page,
@ApiParam("每一页的条数")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
PageResponse<QuestionPaperResponseDTO> responseDTO = null;
try {
responseDTO = questionPaperResource.findAllQuestionPaperInRecycleByCondition(areaId, modelId, courseId, title, authorName, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("通过区域机型课程试卷名和创建人搜索回收站中的试卷")
@PostMapping("/question_paper/copy")
public RestRespDTO copyQuestionPaper(
@ApiParam("拷贝试卷的数据")
@RequestBody WebQuestionPaperOperationRequestDTO requestDTO){
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
try {
questionPaperResource.copyQuestionPaper(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("将试卷放入回收站中")
@PostMapping("/question_paper/recycle")
public RestRespDTO recycleQuestionPaper(
@ApiParam("将试卷放入回收站的数据模型")
@RequestBody WebQuestionPaperOperationRequestDTO requestDTO){
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
try {
questionPaperResource.recycleQuestionPaper(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("将试卷放入回收站中")
@PostMapping("/question_paper/recover")
public RestRespDTO recoverQuestionPaper(
@ApiParam("将试卷从回收站还原的数据模型")
@RequestBody WebQuestionPaperOperationRequestDTO requestDTO){
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
try {
questionPaperResource.recoverQuestionPaper(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("导入试卷数据")
@PostMapping("/question_paper/import")
public RestRespDTO importQuestionPaper(
@ApiParam("导入考试试卷数据")
@RequestParam MultipartFile file){
try {
questionPaperResource.importQuestionPaper(file);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
}
package cn.com.sailfish.linghang.controllers.web;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.dao.web.request.WebReportCardOperationRequestDTO;
import cn.com.sailfish.linghang.dao.web.response.*;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.ReportCardResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import static cn.com.sailfish.linghang.common.ErrorConstants.AREA_ID_IS_NULL;
import static cn.com.sailfish.linghang.common.ErrorConstants.ERR_BAD_PARAM;
import static cn.com.sailfish.linghang.common.ErrorConstants.REPORT_CARD_ID_IS_NULL;
import static cn.com.sailfish.linghang.enumeration.ExamConstant.COMPLETION_STATUS_UNFINISHED;
import static cn.com.sailfish.linghang.enumeration.ExamConstant.COMPLETION_STATUS_FINISHED;
/**
* Author: huangpeilin
* Create at: 2019-04-28 15:01:45
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "WEB 成绩单管理API")
@RequestMapping("/apiv1/web")
public class WebReportCardController {
public final Logger log = LoggerFactory.getLogger(WebReportCardController.class);
private ReportCardResource reportCardResource;
@Autowired
public WebReportCardController(ReportCardResource reportCardResource){
this.reportCardResource = reportCardResource;
}
@ApiOperation("查看某个学员某次考试的失分详情")
@GetMapping("/report_card/getMessage")
public RestRespDTO getMessageByReportCardId(
@ApiParam("成绩单ID")
@RequestParam Long id){
ReportCardMessageResponseDTO responseDTOList = null;
try {
responseDTOList = reportCardResource.getMessageByReportCardId(id);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTOList);
}
@ApiOperation("设置学员成绩单备注")
@GetMapping("/report_card/setRemark")
public RestRespDTO setRemarkByReportCardId(
@ApiParam("成绩单ID")
@RequestParam Long reportCardId,
@ApiParam("成绩备注")
@RequestParam(required = false) String remarks){
try {
reportCardResource.setRemarkByReportCardId(reportCardId, remarks);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("将成绩单放入回收站")
@PostMapping("/report_card/recycle")
public RestRespDTO recycleReportCard(
@ApiParam("成绩单放入回收站的模型")
@RequestBody WebReportCardOperationRequestDTO requestDTO){
if (CollectionUtils.isEmpty(requestDTO.getReportCardIds())){
log.error("report card id is null.");
return RestRespUtil.getErrorRsp(REPORT_CARD_ID_IS_NULL);
}
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
try {
reportCardResource.operationReportCardInRecycle(requestDTO, true);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("将成绩单从回收站中恢复")
@PostMapping("/report_card/restore")
public RestRespDTO restoreReportCard(
@ApiParam("成绩单还原回收站的模型")
@RequestBody WebReportCardOperationRequestDTO requestDTO){
if (CollectionUtils.isEmpty(requestDTO.getReportCardIds())){
log.error("report card id is null.");
return RestRespUtil.getErrorRsp(REPORT_CARD_ID_IS_NULL);
}
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
try {
reportCardResource.operationReportCardInRecycle(requestDTO, false);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("查看某个学员参加过的所有考试成绩")
@GetMapping("/report_card/findAllByUser")
public RestRespDTO findAllReportCardByUser (
@ApiParam("要查询的用户ID")
@RequestParam Long userId,
@ApiParam("考试的完成状态 0 完成 1 未完成")
@RequestParam Integer status,
@ApiParam("页数 默认是1")
@RequestParam Integer page,
@ApiParam("每一页的条数 默认是20")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
if (status < COMPLETION_STATUS_FINISHED && status > COMPLETION_STATUS_UNFINISHED){
log.error("status is error.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}
WebReportCardInfoResponseDTO responseDTO = null;
try {
responseDTO = reportCardResource.findAllReportCardByUser(userId, status, false, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("根据考试时间和试卷名字查看某个学员参加过的所有考试成绩")
@GetMapping("/report_card/findAllByCondition")
public RestRespDTO findAllReportCardByCondition (
@ApiParam("要查询的用户ID")
@RequestParam Long userId,
@ApiParam("是否在回收站 false 否 true 是")
@RequestParam Boolean isRecycle,
@ApiParam("考试的完成状态 0 完成 1 未完成")
@RequestParam Integer status,
@ApiParam("考试时长")
@RequestParam(required = false) Long examTime,
@ApiParam("试卷名字")
@RequestParam(required = false) String questionPaperName,
@ApiParam("页数 默认是1")
@RequestParam Integer page,
@ApiParam("每一页的条数 默认是20")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
if (status < COMPLETION_STATUS_FINISHED && status > COMPLETION_STATUS_UNFINISHED){
log.error("status is error.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}
WebReportCardInfoResponseDTO responseDTO = null;
try {
responseDTO = reportCardResource.findAllReportCardByCondition(userId, status, isRecycle, examTime, questionPaperName, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("根据考试ID获取班级统计详情")
@GetMapping("/report_card/getStatisticalDetails")
public RestRespDTO getStatisticalDetailsByExamId (
@ApiParam("考试ID")
@RequestParam Long examId,
@ApiParam("试卷ID")
@RequestParam Long questionPaperId){
ReportCardStatisticalResponseDTO reportCardStatisticalResponseDTO = null;
try {
reportCardStatisticalResponseDTO = reportCardResource.getStatisticalDetailsByExamId(examId, questionPaperId);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(reportCardStatisticalResponseDTO);
}
@ApiOperation("根据考试时间和试卷名字查看某个学员参加过的所有考试成绩")
@GetMapping("/report_card/recycle/findAllByCondition")
public RestRespDTO findAllReportCardInRecycleByCondition (
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("是否在回收站 false 否 true 是")
@RequestParam Boolean isRecycle,
@ApiParam("要查询的用户工号")
@RequestParam(required = false) String card,
@ApiParam("要查询的用户名字")
@RequestParam(required = false) String username,
@ApiParam("考试时间")
@RequestParam(required = false) Long examTime,
@ApiParam("试卷名字")
@RequestParam(required = false) String questionPaperName,
@ApiParam("班别")
@RequestParam(required = false) String classType,
@ApiParam("监考人名字")
@RequestParam(required = false) String invigilator,
@ApiParam("页数 默认是1")
@RequestParam Integer page,
@ApiParam("每一页的条数 默认是20")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
PageResponse<WebReportCardMessageResponseDTO> responseDTO = null;
try {
responseDTO = reportCardResource.findAllReportCardInRecycleByCondition(
areaId, isRecycle, card, username, questionPaperName, classType, examTime, invigilator, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("根据考试ID获取已经考完试的人的成绩单")
@GetMapping("/report_card/getClassReportCardByExam")
public RestRespDTO getClassReportCardByExam (
@ApiParam("考试ID")
@RequestParam Long examId,
@ApiParam("排序类型 0 名次排序 1 工号排序")
@RequestParam Integer sortType,
@ApiParam("页数 默认是1")
@RequestParam Integer page,
@ApiParam("每一页的条数 默认是20")
@RequestParam Integer pageSize){
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
WebClassReportCardInfoResponseDTO responseDTO = reportCardResource.getClassReportCardByExam(examId, sortType, page, pageSize);
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("导出某个学员的个人成绩单")
@GetMapping("/report_card/exportPerson")
public void exportPersonReportCard (
@ApiParam("要查询的用户ID")
@RequestParam Long userId,
HttpServletRequest request,
HttpServletResponse response){
try {
reportCardResource.exportPersonReportCard(userId, request, response);
} catch (ServerErrorException e) {
e.printStackTrace();
}
}
@ApiOperation("导出某场考试的班级成绩单")
@GetMapping("/report_card/exportClass")
public void exportClassReportCard (
@ApiParam("要查询的考试ID")
@RequestParam Long examId,
HttpServletRequest request,
HttpServletResponse response){
try {
reportCardResource.exportClassReportCard(examId, request, response);
} catch (ServerErrorException e) {
e.printStackTrace();
}
}
}
package cn.com.sailfish.linghang.controllers.web;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.dao.web.response.WebSumResponseDTO;
import cn.com.sailfish.linghang.dao.web.response.WebVrSumResponseDTO;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.UserInfoResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author lichunjiang
* @description
* @creat at 2019-10-14 08:57
*
*/
@RestController
@Api(description = "WEB 浏览统计API")
@RequestMapping("/apiv1/web")
public class WebSumController {
public final Logger log = LoggerFactory.getLogger(WebSumController.class);
private UserInfoResource userInfoResource;
@Autowired
public WebSumController(UserInfoResource userInfoResource){
this.userInfoResource=userInfoResource;
}
@ApiOperation("查询全部部门")
@PostMapping("/sum/dept")
public RestRespDTO queryAllDept(HttpServletRequest request){
List<String> deptList= null;
try {
deptList = userInfoResource.findAllDISrgUnitFullName();
} catch (Exception e) {
RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(deptList);
}
@ApiOperation("查询全部课程中文名")
@PostMapping("/sum/Course")
public RestRespDTO queryAllCourseName(){
List<String> courseList=null;
try {
courseList=userInfoResource.findAllChineseName();
} catch (Exception e) {
RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(courseList);
}
@ApiOperation("查询vr使用情况")
@PostMapping("/sum/vropr")
public RestRespDTO querySumVrOpr(@ApiParam("要查询的部门")
@RequestParam String deptment ,
@ApiParam("要查询的课程")
@RequestParam String course ,
@ApiParam("要查询的类型")
@RequestParam String type ,
@ApiParam("要查询的开始时间")
@RequestParam String startTime,
@ApiParam("要查询的终止时间")
@RequestParam String endTime) {
List<WebVrSumResponseDTO> webVrList= null;
try {
webVrList=userInfoResource.findSum(deptment ,course ,type ,startTime,endTime );
} catch (Exception e) {
RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(webVrList);
}
@ApiOperation("查询门户网站使用情况")
@PostMapping("/sum/opr")
public RestRespDTO querySumOpr(
@ApiParam("要查询的类型")
@RequestParam String type ,
@ApiParam("要查询的开始时间")
@RequestParam String startTime,
@ApiParam("要查询的终止时间")
@RequestParam String endTime){
List<WebSumResponseDTO> webList=null;
try {
webList=userInfoResource.findWebSum(type,startTime,endTime);
} catch (Exception e) {
RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(webList);
}
}
package cn.com.sailfish.linghang.controllers.web;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.dao.UserLoginStatus;
import cn.com.sailfish.linghang.dao.vr.request.VrSendMobileCodeRequestDTO;
import cn.com.sailfish.linghang.dao.web.request.*;
import cn.com.sailfish.linghang.dao.web.response.PageResponse;
import cn.com.sailfish.linghang.dao.web.response.WebUserLoginResponseDTO;
import cn.com.sailfish.linghang.dao.web.response.WebUserMessageResponseDTO;
import cn.com.sailfish.linghang.dao.web.response.WebUserResponseDTO;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.resource.UserResource;
import cn.com.sailfish.linghang.util.RestRespUtil;
import cn.com.sailfish.linghang.util.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.Instant;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static cn.com.sailfish.linghang.common.ErrorConstants.*;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.*;
import static cn.com.sailfish.linghang.security.SystemPrivilege.*;
/**
* Author: huangpeilin
* Create at: 2019-04-23 9:29:19
* Description:
*
* @author huangpeilin
*/
@RestController
@Api(description = "WEB 用户管理API")
@RequestMapping("/apiv1/web")
public class WebUserController {
public final Logger log = LoggerFactory.getLogger(WebUserController.class);
private UserResource userResource;
@Autowired
public WebUserController(UserResource userResource) {
this.userResource = userResource;
}
@ApiOperation("导入乘务用户数据")
@PostMapping("/user/importByFlight")
public RestRespDTO importUserInfoByFlight(
@ApiParam("导入乘务用户数据")
@RequestParam MultipartFile file){
Set<Long> response = new HashSet<>();
try {
response = userResource.importUserInfo(file, FLIGHT_INT);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(response);
}
@ApiOperation("导入机务用户数据")
@PostMapping("/user/importByLocomotive")
public RestRespDTO importUserInfoByLocomotive(
@ApiParam("导入机务用户数据")
@RequestParam MultipartFile file) {
Set<Long> response = new HashSet<>();
try {
response = userResource.importUserInfo(file, LOCOMOTIVE_INT);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(response);
}
@ApiOperation("导出用户信息")
@GetMapping("/user/exportExcel")
public void userExportExcel(
@ApiParam("区域ID")
@RequestParam Long areaId,
HttpServletRequest request,
HttpServletResponse response){
try {
userResource.exportExcel(areaId, request, response);
} catch (ServerErrorException e) {
e.printStackTrace();
}
}
@ApiOperation("退出登录")
@GetMapping("/user/logout")
public RestRespDTO logoutInWeb(HttpServletRequest request) {
userResource.logoutInWeb(request);
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("用户登录")
@PostMapping("/user/login")
public RestRespDTO userLoginWeb(
@ApiParam("用户登录的类")
@RequestBody WebUserLoginRequestDTO requestDTO,
HttpServletRequest request) {
if (StringUtil.isEmpty(requestDTO.getLoginName())){
log.error("user login account is null.");
return RestRespUtil.getErrorRsp(USER_LOGIN_ACCOUNT_IS_NULL);
}
if (StringUtil.isEmpty(requestDTO.getPassword())) {
log.error("user password is null.");
return RestRespUtil.getErrorRsp(USER_PASSWORD_IS_NULL);
}
if (StringUtil.isEmpty(requestDTO.getCaptcha())){
log.error("user captcha is null.");
return RestRespUtil.getErrorRsp(CAPTCHA_CODE_IS_NULL);
}
WebUserLoginResponseDTO responseDTO;
try {
responseDTO = userResource.userLoginInWeb(requestDTO, request);
} catch (ServerErrorException e) {
if (e.getErrorCode() != CAPTCHA_CODE_ERROR && e.getErrorCode() != CAPTCHA_CODE_EXPIRES){
String loginName = requestDTO.getLoginName() + "-login";
UserLoginStatus userLoginStatus = USER_LOGIN_STATUS.get(loginName);
Integer count = userLoginStatus.getCount();
userLoginStatus.setCount(count + 1);
userLoginStatus.setLoginTime(Instant.now());
USER_LOGIN_STATUS.put(loginName, userLoginStatus);
}
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("新增用户")
@PostMapping("/user/create")
public RestRespDTO userCreate(
@ApiParam("新增用户的类")
@RequestBody WebUserCreateRequestDTO requestDTO) {
if (requestDTO.getCard() == null || "".equals(requestDTO.getCard())) {
log.error("user card is null.");
return RestRespUtil.getErrorRsp(USER_CARD_IS_NULL);
}
if (requestDTO.getUsername() == null || "".equals(requestDTO.getUsername())){
log.error("username is null.");
return RestRespUtil.getErrorRsp(USERNAME_IS_NULL);
}
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
Integer authority = requestDTO.getAuthority();
switch (authority){
case SUPER_ADMIN_INT:
case ADMIN_INT:
case INSTRUCTOR_INT:
case USER_INT:
break;
default:
log.error("authority is error.");
return RestRespUtil.getErrorRsp(USER_AUTHORITY_IS_ERROR);
}
if (requestDTO.getMobilePhone() == null || "".equals(requestDTO.getMobilePhone())){
log.error("mobile phone is null.");
return RestRespUtil.getErrorRsp(MOBILE_PHONE_IS_NULL);
}
try {
userResource.userCreate(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("检测是否可以指定超级管理员(一级权限)")
@GetMapping("/user/checkAddSuper")
public RestRespDTO checkAddSuper(
@ApiParam("用户ID")
@RequestParam Long id) {
return RestRespUtil.getSuccessRsp(userResource.checkAddSuper(id));
}
@ApiOperation("修改用户信息")
@PostMapping("/user/modify")
public RestRespDTO userModify(
@ApiParam("修改用户信息的类")
@RequestBody WebUserUpdateRequestDTO requestDTO) {
if (requestDTO.getCard() == null || "".equals(requestDTO.getCard())) {
log.error("user card is null.");
return RestRespUtil.getErrorRsp(USER_CARD_IS_NULL);
}
if (requestDTO.getUsername() == null || "".equals(requestDTO.getUsername())){
log.error("username is null.");
return RestRespUtil.getErrorRsp(USERNAME_IS_NULL);
}
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area id is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
Integer authority = requestDTO.getAuthority();
switch (authority){
case DEVELOPER_INT:
case SUPER_ADMIN_INT:
case ADMIN_INT:
case INSTRUCTOR_INT:
case USER_INT:
break;
default:
log.error("authority is error.");
return RestRespUtil.getErrorRsp(USER_AUTHORITY_IS_ERROR);
}
if (requestDTO.getMobilePhone() == null || "".equals(requestDTO.getMobilePhone())){
log.error("mobile phone is null.");
return RestRespUtil.getErrorRsp(MOBILE_PHONE_IS_NULL);
}
try {
userResource.userModify(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("根据用户ID获取用户信息")
@GetMapping("/user/findOne")
public RestRespDTO findOneById(
@ApiParam("用户ID")
@RequestParam Long id) {
return RestRespUtil.getSuccessRsp(userResource.findOneById(id));
}
@ApiOperation("获取当前用户信息")
@GetMapping("/user/getCurrentInfo")
public RestRespDTO getCurrentUser() {
WebUserResponseDTO responseDTO;
try {
responseDTO = userResource.getCurrentUser();
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTO);
}
@ApiOperation("根据有没有加入考试队列的状态分页获取某个区域下的所有人")
@GetMapping("/user/findAllByArea")
public RestRespDTO findAllByAreaAndExamType(
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("考试队列的状态 0 所有人 1 没有加入考试队列的人 2 加入考试队列的人")
@RequestParam Integer type,
@ApiParam("页数")
@RequestParam Integer page,
@ApiParam("每一页的条数")
@RequestParam Integer pageSize) {
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
PageResponse<WebUserResponseDTO> userPage = null;
try {
userPage = userResource.findAllByAreaAndExamType(areaId, type, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(userPage);
}
@ApiOperation("根据工号,姓名,班别,负责人搜索用户")
@PostMapping("/user/findAllByCondition")
public RestRespDTO findAllUserByCondition(
@ApiParam("条件搜索用户的类")
@RequestBody WebUserConditionRequestDTO requestDTO) {
if (requestDTO.getPage() < 1){
requestDTO.setPage(1);
}
if(requestDTO.getPageSize() < 1){
requestDTO.setPageSize(20);
}
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area is is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
if (requestDTO.getType() == null || "".equals(requestDTO.getType())){
log.error("type is is null.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}
PageResponse<WebUserResponseDTO> userPage = null;
try {
userPage = userResource.findAllUserByCondition(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(userPage);
}
@ApiOperation("批量将用户放入回收站中")
@PostMapping("/user/recycle")
public RestRespDTO recycleUser(
@ApiParam("回收用户的类")
@RequestBody WebUserBatchOperationRequestDTO requestDTO) {
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area is is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
if (CollectionUtils.isEmpty(requestDTO.getIds())){
log.error("user id is null.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}
try {
userResource.operationUserInRecycle(requestDTO, false);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("检查用户是否可以放入回收站中")
@PostMapping("/user/recycle/check")
public RestRespDTO checkRecycleUser(
@ApiParam("回收用户的类")
@RequestBody WebUserBatchOperationRequestDTO requestDTO) {
if (CollectionUtils.isEmpty(requestDTO.getIds())){
log.error("user id is null.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}
Long areaId = requestDTO.getAreaId();
if (areaId == null || "".equals(areaId)){
log.error("area is is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
List<String> response;
try {
response = userResource.checkUserToRecycle(requestDTO.getIds(), areaId);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(response);
}
@ApiOperation("搜索回收站中的用户")
@GetMapping("/user/getRecycle")
public RestRespDTO getRecycleUser(
@ApiParam("名字或者工号")
@RequestParam String column,
@ApiParam("区域ID")
@RequestParam Long areaId) {
List<WebUserResponseDTO> responseDTOList = null;
try {
responseDTOList = userResource.getRecycleUser(column, areaId);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTOList);
}
@ApiOperation("根据工号或名字搜索某个职位的所有教员(学员)")
@GetMapping("/user/findAllByPosition")
public RestRespDTO findAllByPosition(
@ApiParam("名字或者工号")
@RequestParam String column,
@ApiParam("获取用户类型 0 学员 1 教员 2 所有")
@RequestParam Integer type,
@ApiParam("区域ID")
@RequestParam Long areaId) {
List<WebUserResponseDTO> responseDTOList = null;
try {
responseDTOList = userResource.findAllByPosition(column, areaId, type);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTOList);
}
@ApiOperation("根据工号、姓名、班别、部门搜索回收站的人员")
@PostMapping("/user/recycle/findAll")
public RestRespDTO findAllRecycleUser(
@ApiParam("条件搜索回收站用户的类")
@RequestBody WebUserRecycleConditionRequestDTO requestDTO) {
if (requestDTO.getPage() < 1){
requestDTO.setPage(1);
}
if(requestDTO.getPageSize() < 1){
requestDTO.setPageSize(20);
}
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area is is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
PageResponse<WebUserResponseDTO> userPage = null;
try {
userPage = userResource.findAllRecycleUser(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(userPage);
}
@ApiOperation("批量将用户从回收站中还原")
@PostMapping("/user/restore")
public RestRespDTO restoreUser(
@ApiParam("还原用户的类")
@RequestBody WebUserBatchOperationRequestDTO requestDTO) {
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area is is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
if (CollectionUtils.isEmpty(requestDTO.getIds())){
log.error("user id is null.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}
try {
userResource.operationUserInRecycle(requestDTO, true);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("根据工号、姓名搜索不在回收站的人员")
@GetMapping("/user/findAll")
public RestRespDTO findAllUserByCardOrUsername(
@ApiParam("区域ID")
@RequestParam Long areaId,
@ApiParam("工号")
@RequestParam(required = false) String card,
@ApiParam("名字")
@RequestParam(required = false) String username,
@ApiParam("页数")
@RequestParam Integer page,
@ApiParam("每一页的条数")
@RequestParam Integer pageSize) {
if (page < 1){
page = 1;
}
if(pageSize < 1){
pageSize = 20;
}
PageResponse<WebUserResponseDTO> responseDTOList = null;
try {
responseDTOList = userResource.findAllUserByCardOrUsername(areaId, true, card, username, page, pageSize);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(responseDTOList);
}
@ApiOperation("批量启用用户权限")
@PostMapping("/user/enableAuthority")
public RestRespDTO enableUserAuthority(
@ApiParam("还原用户的类")
@RequestBody WebUserBatchOperationRequestDTO requestDTO) {
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area is is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
if (CollectionUtils.isEmpty(requestDTO.getIds())){
log.error("user id is null.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}
try {
userResource.enableUserAuthority(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("批量关闭用户权限")
@PostMapping("/user/disableAuthority")
public RestRespDTO disableUserAuthority(
@ApiParam("还原用户的类")
@RequestBody WebUserBatchOperationRequestDTO requestDTO) {
if (requestDTO.getAreaId() == null || "".equals(requestDTO.getAreaId())){
log.error("area is is null.");
return RestRespUtil.getErrorRsp(AREA_ID_IS_NULL);
}
if (CollectionUtils.isEmpty(requestDTO.getIds())){
log.error("user id is null.");
return RestRespUtil.getErrorRsp(ERR_BAD_PARAM);
}
try {
userResource.disableUserAuthority(requestDTO);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp();
}
@ApiOperation("根据区域ID获取区域人员")
@GetMapping("/user/findAllByAreaId")
public RestRespDTO findAllUserByAreaId(
@ApiParam("区域ID")
@RequestParam Long id) {
List<WebUserMessageResponseDTO> requestDTO = null;
try {
requestDTO = userResource.findAllUserByAreaId(id);
} catch (ServerErrorException e) {
return RestRespUtil.getErrorRsp(e);
}
return RestRespUtil.getSuccessRsp(requestDTO);
}
@ApiOperation("发送验证码")
@PostMapping("/user/sendMobileCode")
public RestRespDTO mobileCodeInVr(
@ApiParam("获取验证码的类")
@RequestBody VrSendMobileCodeRequestDTO requestDTO,
HttpServletRequest request) {
if (StringUtil.isEmpty(requestDTO.getLoginName())) {
log.error("user login account is null.");
return RestRespUtil.getErrorRsp(USER_LOGIN_ACCOUNT_IS_NULL);
}
if (StringUtil.isEmpty(requestDTO.getToken())){
log.error("user login account is null.");
return RestRespUtil.getErrorRsp(USER_LOGIN_ACCOUNT_IS_NULL);
}
return userResource.requestMobileCode(requestDTO, request);
}
}
package cn.com.sailfish.linghang.dao;
import java.time.Instant;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-05-28 18:33:31
* Description:
*/
public class CaptchaValidateDTO {
private String captcha;
private Instant activeTime;
public String getCaptcha() {
return captcha;
}
public void setCaptcha(String captcha) {
this.captcha = captcha;
}
public Instant getActiveTime() {
return activeTime;
}
public void setActiveTime(Instant activeTime) {
this.activeTime = activeTime;
}
@Override
public String toString() {
return "CaptchaValidateDTO{" +
"captcha='" + captcha + '\'' +
", activeTime=" + activeTime +
'}';
}
}
package cn.com.sailfish.linghang.dao;
import cn.com.sailfish.linghang.domain.Exam;
import cn.com.sailfish.linghang.domain.QuestionPaper;
import cn.com.sailfish.linghang.domain.User;
import javax.persistence.*;
import java.time.Instant;
/**
* Author: huangpeilin
* Create at: 2019-05-08 16:23:49
* Description:
*
* @author huangpeilin
*/
@Entity
public class ReportCardRank {
@Id
private Long id;
private Float score;
private String card;
private String username;
private Integer assessment;
private String remarks;
private Integer completionStatus;
private Integer switchStatus;
private Instant examTime;
private Boolean bIsDelete;
@ManyToOne
private QuestionPaper questionPaper;
@ManyToOne
private Exam exam;
private Integer rank;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Float getScore() {
return score;
}
public void setScore(Float score) {
this.score = score;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getAssessment() {
return assessment;
}
public void setAssessment(Integer assessment) {
this.assessment = assessment;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Integer getCompletionStatus() {
return completionStatus;
}
public void setCompletionStatus(Integer completionStatus) {
this.completionStatus = completionStatus;
}
public Integer getSwitchStatus() {
return switchStatus;
}
public void setSwitchStatus(Integer switchStatus) {
this.switchStatus = switchStatus;
}
public Instant getExamTime() {
return examTime;
}
public void setExamTime(Instant examTime) {
this.examTime = examTime;
}
public Boolean getbIsDelete() {
return bIsDelete;
}
public void setbIsDelete(Boolean bIsDelete) {
this.bIsDelete = bIsDelete;
}
public QuestionPaper getQuestionPaper() {
return questionPaper;
}
public void setQuestionPaper(QuestionPaper questionPaper) {
this.questionPaper = questionPaper;
}
public Exam getExam() {
return exam;
}
public void setExam(Exam exam) {
this.exam = exam;
}
public Integer getRank() {
return rank;
}
public void setRank(Integer rank) {
this.rank = rank;
}
@Override
public String toString() {
return "ReportCardRank{" +
"id=" + id +
", score=" + score +
", card='" + card + '\'' +
", username='" + username + '\'' +
", assessment=" + assessment +
", remarks='" + remarks + '\'' +
", completionStatus=" + completionStatus +
", switchStatus=" + switchStatus +
", examTime=" + examTime +
", bIsDelete=" + bIsDelete +
", questionPaper=" + questionPaper +
", exam=" + exam +
", rank=" + rank +
'}';
}
}
package cn.com.sailfish.linghang.dao;
import java.time.Instant;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-08-02 18:11:52
* Description:
*/
public class UserLoginStatus {
/**
* 次数
*/
private Integer count;
/**
* 登录时间
*/
private Instant loginTime;
@Override
public String toString() {
return "UserLoginStatus{" +
"count=" + count +
", loginTime=" + loginTime +
'}';
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public Instant getLoginTime() {
return loginTime;
}
public void setLoginTime(Instant loginTime) {
this.loginTime = loginTime;
}
}
package cn.com.sailfish.linghang.dao.vr.request;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-05-07 9:58:58
* Description:
*
* @author huangpeilin
*/
public class VrExamResultRequestDTO {
private Long reportCardId;
private Float score;
private Integer assessment;
private List<VrOptionDetailsDTO> list;
@Override
public String toString() {
return "VrExamResultRequestDTO{" +
"reportCardId=" + reportCardId +
", score=" + score +
", assessment=" + assessment +
", list=" + list +
'}';
}
public Long getReportCardId() {
return reportCardId;
}
public void setReportCardId(Long reportCardId) {
this.reportCardId = reportCardId;
}
public Float getScore() {
return score;
}
public void setScore(Float score) {
this.score = score;
}
public Integer getAssessment() {
return assessment;
}
public void setAssessment(Integer assessment) {
this.assessment = assessment;
}
public List<VrOptionDetailsDTO> getList() {
return list;
}
public void setList(List<VrOptionDetailsDTO> list) {
this.list = list;
}
}
package cn.com.sailfish.linghang.dao.vr.request;
/**
* Author: huangpeilin
* Create at: 2019-05-07 10:54:45
* Description:
*
* @author huangpeilin
*/
public class VrOperationRecordRequestDTO {
/**
* 操作类型 0 训练 1 考试
*/
private Integer type;
/**
* 考试ID 类型是考试的时候必传
*/
private Long id;
/**
* 课程英文名字 类型是训练的时候必传
*/
private String courseName;
/**
* 是否结束 false代表不是(开启) true代表是(结束)
*/
private Boolean bIsEnd;
/**
* 登录时间
*/
private Long loginTime;
@Override
public String toString() {
return "VrOperationRecordRequestDTO{" +
"type=" + type +
", id=" + id +
", courseName='" + courseName + '\'' +
", bIsEnd=" + bIsEnd +
'}';
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Boolean getbIsEnd() {
return bIsEnd;
}
public void setbIsEnd(Boolean bIsEnd) {
this.bIsEnd = bIsEnd;
}
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
public Long getLoginTime() {
return loginTime;
}
public void setLoginTime(Long loginTime) {
this.loginTime = loginTime;
}
}
package cn.com.sailfish.linghang.dao.vr.request;
/**
* Author: huangpeilin
* Create at: 2019-05-07 10:01:49
* Description:
*
* @author huangpeilin
*/
public class VrOptionDetailsDTO {
/**
* 检查项ID或者异常项ID
*/
private Long id;
/**
* 回答类型 0 检查项 1 异常项
*/
private Integer type;
/**
* 代表选项的对错
*/
private Boolean answer;
@Override
public String toString() {
return "VrOptionDetailsDTO{" +
"id=" + id +
", type=" + type +
", answer=" + answer +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Boolean getAnswer() {
return answer;
}
public void setAnswer(Boolean answer) {
this.answer = answer;
}
}
package cn.com.sailfish.linghang.dao.vr.request;
public class VrSendMobileCodeRequestDTO {
private String loginName;
private String token;
public void setToken(String token) {
this.token = token;
}
public String getToken() {
return token;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getLoginName() {
return loginName;
}
@Override
public String toString() {
return "VrSendMobileCodeRequestDTO{" +
", loginName=" + loginName +
", token=" + token +
'}';
}
}
package cn.com.sailfish.linghang.dao.vr.request;
/**
* Author: huangpeilin
* Create at: 2019-05-06 17:21:46
* Description:
*
* @author huangpeilin
*/
public class VrUserLoginRequestDTO {
private String loginName;
private String password;
private String queueName;
private String token;
private String commonMobile;
private String mobileCode;
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getQueueName() {
return queueName;
}
public void setQueueName(String queueName) {
this.queueName = queueName;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getCommonMobile() {
return commonMobile;
}
public void setCommonMobile(String commonMobile) {
this.commonMobile = commonMobile;
}
public String getMobileCode() {
return mobileCode;
}
public void setMobileCode(String mobileCode) {
this.mobileCode = mobileCode;
}
@Override
public String toString() {
return "VrUserLoginRequestDTO{" +
"loginName='" + loginName + '\'' +
", password='" + password + '\'' +
", queueName='" + queueName + '\'' +
", token='" + token + '\'' +
", commonMobile='" + commonMobile + '\'' +
", mobileCode='" + mobileCode + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.dao.vr.request;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-05-23 14:06:05
* Description:
*/
public class VrUserRegisterRequestDTO {
private String loginName;
private String password;
private Integer position;
private String remarks;
@Override
public String toString() {
return "VrUserRegisterRequestDTO{" +
"loginName='" + loginName + '\'' +
", password='" + password + '\'' +
", position=" + position +
", remarks='" + remarks + '\'' +
'}';
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
}
package cn.com.sailfish.linghang.dao.vr.response;
import cn.com.sailfish.linghang.dao.web.response.*;
import javax.persistence.Column;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-05-06 18:07:10
* Description:
*
* @author huangpeilin
*/
public class VrQuestionPaperInfoResponseDTO {
/**
* 成绩单ID
*/
private Long reportCardId;
/**
* 考试ID
*/
private Long examId;
/**
* 创建人名字
*/
private String author;
/**
* 考试时间
*/
private Long examTime;
/**
* 试卷ID
*/
private Long id;
/**
* 区域ID
*/
private Long areaId;
/**
* 试卷名字
*/
private String title;
/**
* 试卷描述
*/
private String description;
/**
* 考试时长
*/
private Integer testLength;
/**
* 人为设定异常数量
*/
private Integer randomAbnormals;
/**
* 异常生成类型
*/
private Integer exceptionGenerateType;
/**
* 是否具有部位浮标功能
*/
private Boolean bIsPartsOfBuoy;
/**
* 是否具有位置提示功能
*/
private Boolean bIsLocationHints;
/**
* 是否具有环境声效功能
*/
private Boolean bIsEnvironmentalSound;
/**
* 是否具有操作提示功能
*/
private Boolean bIsOperatingHints;
/**
* 是否具有语音提示功能
*/
private Boolean bIsVoiceHints;
/**
* 是否具有名称标签功能
*/
private Boolean bIsNameTag;
/**
* 是否具有图文弹窗功能
*/
private Boolean bIsGraphicPopupWindow;
/**
* 是否具有警示注意功能
*/
private Boolean bIsWarningNotice;
/**
* 特殊项合格所需数量
*/
private Integer qualifiedQuantity;
/**
* 创建时间 时间戳
*/
private Long createTime;
/**
* 机型数据模型
*/
private ModelResponseDTO model;
/**
* 发动机数据模型
*/
private EngineResponseDTO engine;
/**
* 课程/工卡数据模型
*/
private CourseResponseDTO course;
/**
* 检查项列表
*/
private List<CheckItemResponseDTO> checkItemList;
/**
* 异常项列表
*/
private List<ExceptionItemResponseDTO> exceptionItemList;
/**
* 特殊项列表
*/
private List<ExceptionItemResponseDTO> specialItemList;
/**
* 试卷总分
*/
private Float score;
/**
* 及格分数
*/
private Float passingScore;
@Override
public String toString() {
return "VrQuestionPaperInfoResponseDTO{" +
"reportCardId=" + reportCardId +
", examId=" + examId +
", author='" + author + '\'' +
", examTime=" + examTime +
", id=" + id +
", areaId=" + areaId +
", title='" + title + '\'' +
", description='" + description + '\'' +
", testLength=" + testLength +
", randomAbnormals=" + randomAbnormals +
", exceptionGenerateType=" + exceptionGenerateType +
", bIsPartsOfBuoy=" + bIsPartsOfBuoy +
", bIsLocationHints=" + bIsLocationHints +
", bIsEnvironmentalSound=" + bIsEnvironmentalSound +
", bIsOperatingHints=" + bIsOperatingHints +
", bIsVoiceHints=" + bIsVoiceHints +
", bIsNameTag=" + bIsNameTag +
", bIsGraphicPopupWindow=" + bIsGraphicPopupWindow +
", bIsWarningNotice=" + bIsWarningNotice +
", qualifiedQuantity=" + qualifiedQuantity +
", createTime=" + createTime +
", model=" + model +
", engine=" + engine +
", course=" + course +
", checkItemList=" + checkItemList +
", exceptionItemList=" + exceptionItemList +
", specialItemList=" + specialItemList +
'}';
}
public Long getReportCardId() {
return reportCardId;
}
public void setReportCardId(Long reportCardId) {
this.reportCardId = reportCardId;
}
public Long getExamId() {
return examId;
}
public void setExamId(Long examId) {
this.examId = examId;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public Long getExamTime() {
return examTime;
}
public void setExamTime(Long examTime) {
this.examTime = examTime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getTestLength() {
return testLength;
}
public void setTestLength(Integer testLength) {
this.testLength = testLength;
}
public Integer getRandomAbnormals() {
return randomAbnormals;
}
public void setRandomAbnormals(Integer randomAbnormals) {
this.randomAbnormals = randomAbnormals;
}
public Integer getExceptionGenerateType() {
return exceptionGenerateType;
}
public void setExceptionGenerateType(Integer exceptionGenerateType) {
this.exceptionGenerateType = exceptionGenerateType;
}
public Boolean getbIsPartsOfBuoy() {
return bIsPartsOfBuoy;
}
public void setbIsPartsOfBuoy(Boolean bIsPartsOfBuoy) {
this.bIsPartsOfBuoy = bIsPartsOfBuoy;
}
public Boolean getbIsLocationHints() {
return bIsLocationHints;
}
public void setbIsLocationHints(Boolean bIsLocationHints) {
this.bIsLocationHints = bIsLocationHints;
}
public Boolean getbIsEnvironmentalSound() {
return bIsEnvironmentalSound;
}
public void setbIsEnvironmentalSound(Boolean bIsEnvironmentalSound) {
this.bIsEnvironmentalSound = bIsEnvironmentalSound;
}
public Boolean getbIsOperatingHints() {
return bIsOperatingHints;
}
public void setbIsOperatingHints(Boolean bIsOperatingHints) {
this.bIsOperatingHints = bIsOperatingHints;
}
public Boolean getbIsVoiceHints() {
return bIsVoiceHints;
}
public void setbIsVoiceHints(Boolean bIsVoiceHints) {
this.bIsVoiceHints = bIsVoiceHints;
}
public Boolean getbIsNameTag() {
return bIsNameTag;
}
public void setbIsNameTag(Boolean bIsNameTag) {
this.bIsNameTag = bIsNameTag;
}
public Boolean getbIsGraphicPopupWindow() {
return bIsGraphicPopupWindow;
}
public void setbIsGraphicPopupWindow(Boolean bIsGraphicPopupWindow) {
this.bIsGraphicPopupWindow = bIsGraphicPopupWindow;
}
public Boolean getbIsWarningNotice() {
return bIsWarningNotice;
}
public void setbIsWarningNotice(Boolean bIsWarningNotice) {
this.bIsWarningNotice = bIsWarningNotice;
}
public Integer getQualifiedQuantity() {
return qualifiedQuantity;
}
public void setQualifiedQuantity(Integer qualifiedQuantity) {
this.qualifiedQuantity = qualifiedQuantity;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public ModelResponseDTO getModel() {
return model;
}
public void setModel(ModelResponseDTO model) {
this.model = model;
}
public EngineResponseDTO getEngine() {
return engine;
}
public void setEngine(EngineResponseDTO engine) {
this.engine = engine;
}
public CourseResponseDTO getCourse() {
return course;
}
public void setCourse(CourseResponseDTO course) {
this.course = course;
}
public List<CheckItemResponseDTO> getCheckItemList() {
return checkItemList;
}
public void setCheckItemList(List<CheckItemResponseDTO> checkItemList) {
this.checkItemList = checkItemList;
}
public List<ExceptionItemResponseDTO> getExceptionItemList() {
return exceptionItemList;
}
public void setExceptionItemList(List<ExceptionItemResponseDTO> exceptionItemList) {
this.exceptionItemList = exceptionItemList;
}
public List<ExceptionItemResponseDTO> getSpecialItemList() {
return specialItemList;
}
public void setSpecialItemList(List<ExceptionItemResponseDTO> specialItemList) {
this.specialItemList = specialItemList;
}
public Float getScore() {
return score;
}
public void setScore(Float score) {
this.score = score;
}
public Float getPassingScore() {
return passingScore;
}
public void setPassingScore(Float passingScore) {
this.passingScore = passingScore;
}
}
package cn.com.sailfish.linghang.dao.vr.response;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-06-19 16:11:51
* Description:
*/
public class VrUserLoginResponseDTO {
private Long id;
private String token;
private Long loginTime;
/**
* 职位 0:乘务; 1:机务
*/
private Integer position;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public Long getLoginTime() {
return loginTime;
}
public void setLoginTime(Long loginTime) {
this.loginTime = loginTime;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
@Override
public String toString() {
return "VrUserLoginResponseDTO{" +
"id=" + id +
", token='" + token + '\'' +
", loginTime=" + loginTime +
'}';
}
}
package cn.com.sailfish.linghang.dao.web;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-05-29 15:53:29
* Description:
*/
public class CheckUserTestQueueDTO {
/**
* 用户ID
*/
private Long userId;
/**
* 考试的开启状态 0 开启 1 关闭
*/
private Integer switchStatus;
@Override
public String toString() {
return "CheckUserTestQueueDTO{" +
"userId=" + userId +
", switchStatus=" + switchStatus +
'}';
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Integer getSwitchStatus() {
return switchStatus;
}
public void setSwitchStatus(Integer switchStatus) {
this.switchStatus = switchStatus;
}
}
package cn.com.sailfish.linghang.dao.web;
import cn.com.sailfish.linghang.domain.CheckItem;
import cn.com.sailfish.linghang.domain.ExceptionItem;
import java.util.List;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-06-04 11:34:08
* Description:
*/
public class CourseImportModel {
private Long id;
private String name;
private String chineseName;
private Integer division;
private Integer airFramer;
private Integer planeModel;
private Integer engineType;
private List<CheckItem> checkItemList;
private List<ExceptionItem> exceptionItemList;
@Override
public String toString() {
return "CourseImportModel{" +
"id=" + id +
", name='" + name + '\'' +
", chineseName='" + chineseName + '\'' +
", division=" + division +
", airFramer=" + airFramer +
", planeModel=" + planeModel +
", engineType=" + engineType +
", checkItemList=" + checkItemList +
", exceptionItemList=" + exceptionItemList +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getChineseName() {
return chineseName;
}
public void setChineseName(String chineseName) {
this.chineseName = chineseName;
}
public Integer getDivision() {
return division;
}
public void setDivision(Integer division) {
this.division = division;
}
public Integer getAirFramer() {
return airFramer;
}
public void setAirFramer(Integer airFramer) {
this.airFramer = airFramer;
}
public Integer getPlaneModel() {
return planeModel;
}
public void setPlaneModel(Integer planeModel) {
this.planeModel = planeModel;
}
public Integer getEngineType() {
return engineType;
}
public void setEngineType(Integer engineType) {
this.engineType = engineType;
}
public List<CheckItem> getCheckItemList() {
return checkItemList;
}
public void setCheckItemList(List<CheckItem> checkItemList) {
this.checkItemList = checkItemList;
}
public List<ExceptionItem> getExceptionItemList() {
return exceptionItemList;
}
public void setExceptionItemList(List<ExceptionItem> exceptionItemList) {
this.exceptionItemList = exceptionItemList;
}
}
package cn.com.sailfish.linghang.dao.web;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-06-03 15:28:45
* Description:
*/
public class ItemImportModel {
/**
* 检查项ID
*/
private Long id;
/**
* 检查项名字(英文)
*/
private String name;
/**
* 检查项中文名字
*/
private String desc;
private String region;
/**
* 飞机型号 0:A320, 1:A380
*/
private Integer planeModel;
/**
* 0:非发动机; 1:V2500; 2:CFM56; 3:PW1100
*/
private Integer engineType;
@Override
public String toString() {
return "ItemImportModel{" +
"id=" + id +
", name='" + name + '\'' +
", desc='" + desc + '\'' +
", region='" + region + '\'' +
", planeModel=" + planeModel +
", engineType=" + engineType +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public Integer getPlaneModel() {
return planeModel;
}
public void setPlaneModel(Integer planeModel) {
this.planeModel = planeModel;
}
public Integer getEngineType() {
return engineType;
}
public void setEngineType(Integer engineType) {
this.engineType = engineType;
}
}
package cn.com.sailfish.linghang.dao.web;
import cn.com.sailfish.linghang.domain.Course;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-06-05 16:38:23
* Description:
*/
public class QuestionPaperImportModel {
private Long id;
private String name;
private String desc;
private String authorId;
private Integer paperType;
private Course course;
private Integer totalAbnormal;
private Integer randomAbnormal;
private Integer abnormalGenerateType;
private Integer examTimeSpan;
private Float score;
private Float passingScore;
@Override
public String toString() {
return "QuestionPaperImportModel{" +
"id=" + id +
", name='" + name + '\'' +
", desc='" + desc + '\'' +
", authorId='" + authorId + '\'' +
", paperType=" + paperType +
", Course=" + course +
", totalAbnormal=" + totalAbnormal +
", randomAbnormal=" + randomAbnormal +
", abnormalGenerateType=" + abnormalGenerateType +
", examTimeSpan=" + examTimeSpan +
", score=" + score +
", passingScore=" + passingScore +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getAuthorId() {
return authorId;
}
public void setAuthorId(String authorId) {
this.authorId = authorId;
}
public Integer getPaperType() {
return paperType;
}
public void setPaperType(Integer paperType) {
this.paperType = paperType;
}
public Course getCourse() {
return course;
}
public void setCourse(Course course) {
this.course = course;
}
public Integer getTotalAbnormal() {
return totalAbnormal;
}
public void setTotalAbnormal(Integer totalAbnormal) {
this.totalAbnormal = totalAbnormal;
}
public Integer getRandomAbnormal() {
return randomAbnormal;
}
public void setRandomAbnormal(Integer randomAbnormal) {
this.randomAbnormal = randomAbnormal;
}
public Integer getAbnormalGenerateType() {
return abnormalGenerateType;
}
public void setAbnormalGenerateType(Integer abnormalGenerateType) {
this.abnormalGenerateType = abnormalGenerateType;
}
public Integer getExamTimeSpan() {
return examTimeSpan;
}
public void setExamTimeSpan(Integer examTimeSpan) {
this.examTimeSpan = examTimeSpan;
}
public Float getScore() {
return score;
}
public void setScore(Float score) {
this.score = score;
}
public Float getPassingScore() {
return passingScore;
}
public void setPassingScore(Float passingScore) {
this.passingScore = passingScore;
}
}
package cn.com.sailfish.linghang.dao.web;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-06-06 10:13:28
* Description:
*/
public class RabbitMqExamMessage {
}
package cn.com.sailfish.linghang.dao.web.request;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-26 18:16:42
* Description:
*
* @author huangpeilin
*/
public class AppointUserTestRequestDTO {
private Long areaId;
private Long examTime;
private List<Long> invigilatorIds;
private List<Long> examUserIds;
private Long questionPaperId;
/**
* 0 新增考试 1 覆盖考试
*/
private Integer type;
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public Long getExamTime() {
return examTime;
}
public void setExamTime(Long examTime) {
this.examTime = examTime;
}
public List<Long> getInvigilatorIds() {
return invigilatorIds;
}
public void setInvigilatorIds(List<Long> invigilatorIds) {
this.invigilatorIds = invigilatorIds;
}
public List<Long> getExamUserIds() {
return examUserIds;
}
public void setExamUserIds(List<Long> examUserIds) {
this.examUserIds = examUserIds;
}
public Long getQuestionPaperId() {
return questionPaperId;
}
public void setQuestionPaperId(Long questionPaperId) {
this.questionPaperId = questionPaperId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
@Override
public String toString() {
return "AppointUserTestRequestDTO{" +
"examTime=" + examTime +
", invigilatorIds=" + invigilatorIds +
", examUserIds=" + examUserIds +
", questionPaperId=" + questionPaperId +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.request;
/**
* Author: huangpeilin
* Create at: 2019-04-28 11:12:16
* Description:
*
* @author huangpeilin
*/
public class ExamRequestDTO {
private Long examId;
private Long questionPaperId;
private Long examUserId;
public Long getExamId() {
return examId;
}
public void setExamId(Long examId) {
this.examId = examId;
}
public Long getQuestionPaperId() {
return questionPaperId;
}
public void setQuestionPaperId(Long questionPaperId) {
this.questionPaperId = questionPaperId;
}
public Long getExamUserId() {
return examUserId;
}
public void setExamUserId(Long examUserId) {
this.examUserId = examUserId;
}
@Override
public String toString() {
return "ExamRequestDTO{" +
"examId=" + examId +
", questionPaperId=" + questionPaperId +
", examUserId=" + examUserId +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.request;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-28 11:11:05
* Description:
*
* @author huangpeilin
*/
public class OperationUserTestRequestDTO {
private Long areaId;
private List<ExamRequestDTO> list;
@Override
public String toString() {
return "OperationUserTestRequestDTO{" +
"areaId=" + areaId +
", list=" + list +
'}';
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public List<ExamRequestDTO> getList() {
return list;
}
public void setList(List<ExamRequestDTO> list) {
this.list = list;
}
}
package cn.com.sailfish.linghang.dao.web.request;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-28 13:18:54
* Description:
*
* @author huangpeilin
*/
public class UserTestQueueRequestDTO {
private Long areaId;
private List<Long> examUserIds;
@Override
public String toString() {
return "UserTestQueueRequestDTO{" +
"areaId=" + areaId +
", examUserIds=" + examUserIds +
'}';
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public List<Long> getExamUserIds() {
return examUserIds;
}
public void setExamUserIds(List<Long> examUserIds) {
this.examUserIds = examUserIds;
}
}
package cn.com.sailfish.linghang.dao.web.request;
import cn.com.sailfish.linghang.dao.web.CheckUserTestQueueDTO;
import java.util.List;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-05-29 15:49:20
* Description:
*/
public class WebCheckUserTestQueueRequestDTO {
/**
* 区域ID
*/
private Long areaId;
private List<CheckUserTestQueueDTO> list;
@Override
public String toString() {
return "WebCheckUserTestQueueRequestDTO{" +
"areaId=" + areaId +
", list=" + list +
'}';
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public List<CheckUserTestQueueDTO> getList() {
return list;
}
public void setList(List<CheckUserTestQueueDTO> list) {
this.list = list;
}
}
package cn.com.sailfish.linghang.dao.web.request;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-05-05 10:31:30
* Description:
*
* @author huangpeilin
*/
public class WebExamOperationRequestDTO {
private Long areaId;
private List<Long> ids;
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public List<Long> getIds() {
return ids;
}
public void setIds(List<Long> ids) {
this.ids = ids;
}
@Override
public String toString() {
return "WebExamOperationRequestDTO{" +
"areaId=" + areaId +
", ids=" + ids +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.request;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-25 14:44:30
* Description:
*
* @author huangpeilin
*/
public class WebQuestionPaperCreateRequestDTO {
/**
* 机型ID
*/
private Long modelId;
/**
* 区域ID
*/
private Long areaId;
/**
* 发动机ID
*/
private Long engineId;
/**
* 课程ID
*/
private Long courseId;
/**
* 试卷名字
*/
private String title;
/**
* 试卷描述
*/
private String description;
/**
* 考试时长
*/
private Integer testLength;
/**
* 人为设定异常数量
*/
private Integer randomAbnormals;
/**
* 异常生成类型
*/
private Integer exceptionGenerateType;
/**
* 是否具有部位浮标功能
*/
private Boolean bIsPartsOfBuoy;
/**
* 是否具有位置提示功能
*/
private Boolean bIsLocationHints;
/**
* 是否具有环境声效功能
*/
private Boolean bIsEnvironmentalSound;
/**
* 是否具有操作提示功能
*/
private Boolean bIsOperatingHints;
/**
* 是否具有语音提示功能
*/
private Boolean bIsVoiceHints;
/**
* 是否具有名称标签功能
*/
private Boolean bIsNameTag;
/**
* 是否具有图文弹窗功能
*/
private Boolean bIsGraphicPopupWindow;
/**
* 是否具有警示注意功能
*/
private Boolean bIsWarningNotice;
/**
* 特殊项的ID集合
*/
private List<Long> specialIds;
/**
* 特殊项合格所需数量
*/
private Integer qualifiedQuantity;
@Override
public String toString() {
return "WebQuestionPaperCreateRequestDTO{" +
"modelId=" + modelId +
", areaId=" + areaId +
", engineId=" + engineId +
", courseId=" + courseId +
", title='" + title + '\'' +
", description='" + description + '\'' +
", testLength=" + testLength +
", randomAbnormals=" + randomAbnormals +
", exceptionGenerateType=" + exceptionGenerateType +
", bIsPartsOfBuoy=" + bIsPartsOfBuoy +
", bIsLocationHints=" + bIsLocationHints +
", bIsEnvironmentalSound=" + bIsEnvironmentalSound +
", bIsOperatingHints=" + bIsOperatingHints +
", bIsVoiceHints=" + bIsVoiceHints +
", bIsNameTag=" + bIsNameTag +
", bIsGraphicPopupWindow=" + bIsGraphicPopupWindow +
", bIsWarningNotice=" + bIsWarningNotice +
", specialIds=" + specialIds +
", qualifiedQuantity=" + qualifiedQuantity +
'}';
}
public Long getModelId() {
return modelId;
}
public void setModelId(Long modelId) {
this.modelId = modelId;
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public Long getEngineId() {
return engineId;
}
public void setEngineId(Long engineId) {
this.engineId = engineId;
}
public Long getCourseId() {
return courseId;
}
public void setCourseId(Long courseId) {
this.courseId = courseId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getTestLength() {
return testLength;
}
public void setTestLength(Integer testLength) {
this.testLength = testLength;
}
public Integer getRandomAbnormals() {
return randomAbnormals;
}
public void setRandomAbnormals(Integer randomAbnormals) {
this.randomAbnormals = randomAbnormals;
}
public Integer getExceptionGenerateType() {
return exceptionGenerateType;
}
public void setExceptionGenerateType(Integer exceptionGenerateType) {
this.exceptionGenerateType = exceptionGenerateType;
}
public Boolean getbIsPartsOfBuoy() {
return bIsPartsOfBuoy;
}
public void setbIsPartsOfBuoy(Boolean bIsPartsOfBuoy) {
this.bIsPartsOfBuoy = bIsPartsOfBuoy;
}
public Boolean getbIsLocationHints() {
return bIsLocationHints;
}
public void setbIsLocationHints(Boolean bIsLocationHints) {
this.bIsLocationHints = bIsLocationHints;
}
public Boolean getbIsEnvironmentalSound() {
return bIsEnvironmentalSound;
}
public void setbIsEnvironmentalSound(Boolean bIsEnvironmentalSound) {
this.bIsEnvironmentalSound = bIsEnvironmentalSound;
}
public Boolean getbIsOperatingHints() {
return bIsOperatingHints;
}
public void setbIsOperatingHints(Boolean bIsOperatingHints) {
this.bIsOperatingHints = bIsOperatingHints;
}
public Boolean getbIsVoiceHints() {
return bIsVoiceHints;
}
public void setbIsVoiceHints(Boolean bIsVoiceHints) {
this.bIsVoiceHints = bIsVoiceHints;
}
public Boolean getbIsNameTag() {
return bIsNameTag;
}
public void setbIsNameTag(Boolean bIsNameTag) {
this.bIsNameTag = bIsNameTag;
}
public Boolean getbIsGraphicPopupWindow() {
return bIsGraphicPopupWindow;
}
public void setbIsGraphicPopupWindow(Boolean bIsGraphicPopupWindow) {
this.bIsGraphicPopupWindow = bIsGraphicPopupWindow;
}
public Boolean getbIsWarningNotice() {
return bIsWarningNotice;
}
public void setbIsWarningNotice(Boolean bIsWarningNotice) {
this.bIsWarningNotice = bIsWarningNotice;
}
public List<Long> getSpecialIds() {
return specialIds;
}
public void setSpecialIds(List<Long> specialIds) {
this.specialIds = specialIds;
}
public Integer getQualifiedQuantity() {
return qualifiedQuantity;
}
public void setQualifiedQuantity(Integer qualifiedQuantity) {
this.qualifiedQuantity = qualifiedQuantity;
}
}
package cn.com.sailfish.linghang.dao.web.request;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-26 14:08:23
* Description:
*
* @author huangpeilin
*/
public class WebQuestionPaperOperationRequestDTO {
/**
* 区域ID
*/
private Long areaId;
/**
* 试卷ID的集合
*/
private List<Long> questionPapers;
@Override
public String toString() {
return "WebQuestionPaperOperationRequestDTO{" +
"areaId=" + areaId +
", questionPapers=" + questionPapers +
'}';
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public List<Long> getQuestionPapers() {
return questionPapers;
}
public void setQuestionPapers(List<Long> questionPapers) {
this.questionPapers = questionPapers;
}
}
package cn.com.sailfish.linghang.dao.web.request;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-28 16:56:06
* Description:
*
* @author huangpeilin
*/
public class WebReportCardOperationRequestDTO {
private Long areaId;
private List<Long> reportCardIds;
@Override
public String toString() {
return "WebReportCardOperationRequestDTO{" +
"areaId=" + areaId +
", reportCardIds=" + reportCardIds +
'}';
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public List<Long> getReportCardIds() {
return reportCardIds;
}
public void setReportCardIds(List<Long> reportCardIds) {
this.reportCardIds = reportCardIds;
}
}
package cn.com.sailfish.linghang.dao.web.request;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-28 16:41:50
* Description:
*
* @author huangpeilin
*/
public class WebReportCardRemarkRequestDTO {
private String remark;
private List<Long> reportCardIds;
@Override
public String toString() {
return "WebReportCardRemarkRequestDTO{" +
"remark='" + remark + '\'' +
", reportCardIds=" + reportCardIds +
'}';
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public List<Long> getReportCardIds() {
return reportCardIds;
}
public void setReportCardIds(List<Long> reportCardIds) {
this.reportCardIds = reportCardIds;
}
}
package cn.com.sailfish.linghang.dao.web.request;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-24 15:39:54
* Description:
*
* @author huangpeilin
*/
public class WebUserBatchOperationRequestDTO {
private Long areaId;
private List<Long> ids;
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public List<Long> getIds() {
return ids;
}
public void setIds(List<Long> ids) {
this.ids = ids;
}
@Override
public String toString() {
return "WebUserRecycleRequestDTO{" +
"areaId=" + areaId +
", ids=" + ids +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.request;
/**
* Author: huangpeilin
* Create at: 2019-04-24 10:52:01
* Description: 条件搜索用户的DTO
*
* @author huangpeilin
*/
public class WebUserConditionRequestDTO {
private Long areaId;
private Integer type;
private String card;
private String username;
private String classType;
private String leader;
private Integer page;
private Integer pageSize;
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public String getLeader() {
return leader;
}
public void setLeader(String leader) {
this.leader = leader;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
@Override
public String toString() {
return "WebUserConditionRequestDTO{" +
"areaId=" + areaId +
", type=" + type +
", card='" + card + '\'' +
", username='" + username + '\'' +
", classType='" + classType + '\'' +
", leader='" + leader + '\'' +
", page=" + page +
", pageSize=" + pageSize +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.request;
/**
* Author: huangpeilin
* Create at: 2019-04-23 18:47:20
* Description:
*
* @author huangpeilin
*/
public class WebUserCreateRequestDTO {
private String username;
private String card;
private String mobilePhone;
private String email;
private Long areaId;
private Integer authority;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getMobilePhone() {
return mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public Integer getAuthority() {
return authority;
}
public void setAuthority(Integer authority) {
this.authority = authority;
}
@Override
public String toString() {
return "WebUserCreateRequestDTO{" +
"username='" + username + '\'' +
", card='" + card + '\'' +
", mobilePhone='" + mobilePhone + '\'' +
", email='" + email + '\'' +
", areaId='" + areaId + '\'' +
", authority=" + authority +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.request;
/**
* Author: huangpeilin
* Create at: 2019-04-23 18:08:04
* Description:
*
* @author huangpeilin
*/
public class WebUserLoginRequestDTO {
private String loginName;
private String password;
private String captcha;
private String token;
private String commonMobile;
private String mobileCode;
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getCommonMobile() {
return commonMobile;
}
public void setCommonMobile(String commonMobile) {
this.commonMobile = commonMobile;
}
public void setMobileCode(String mobileCode) {
this.mobileCode = mobileCode;
}
public String getMobileCode() {
return mobileCode;
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getCaptcha() {
return captcha;
}
public void setCaptcha(String captcha) {
this.captcha = captcha;
}
@Override
public String toString() {
return "WebUserLoginRequestDTO{" +
"loginName='" + loginName + '\'' +
", password='" + password + '\'' +
", captcha='" + captcha + '\'' +
", token='" + token + '\'' +
", commonMobile='" + commonMobile + '\'' +
", mobileCode='" + mobileCode + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.request;
/**
* Author: huangpeilin
* Create at: 2019-04-24 17:15:32
* Description:
*
* @author huangpeilin
*/
public class WebUserRecycleConditionRequestDTO {
private Long areaId;
private String card;
private String username;
private String classType;
private Integer position;
private Integer page;
private Integer pageSize;
@Override
public String toString() {
return "WebUserRecycleConditionRequestDTO{" +
"areaId=" + areaId +
", card='" + card + '\'' +
", username='" + username + '\'' +
", classType='" + classType + '\'' +
", position=" + position +
", page=" + page +
", pageSize=" + pageSize +
'}';
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
}
package cn.com.sailfish.linghang.dao.web.request;
/**
* Author: huangpeilin
* Create at: 2019-05-05 9:48:34
* Description:
*
* @author huangpeilin
*/
public class WebUserUpdateRequestDTO {
private Long id;
private String username;
private String card;
private Long areaId;
private Integer type;
private String classType;
private Integer authority;
private Boolean enable;
private Long leaderId;
private String mobilePhone;
private String email;
private String userImage;
private String remarks;
@Override
public String toString() {
return "WebUserUpdateRequestDTO{" +
"id=" + id +
", username='" + username + '\'' +
", card='" + card + '\'' +
", areaId=" + areaId +
", type=" + type +
", classType='" + classType + '\'' +
", authority=" + authority +
", enable=" + enable +
", leaderId=" + leaderId +
", mobilePhone='" + mobilePhone + '\'' +
", email='" + email + '\'' +
", userImage='" + userImage + '\'' +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public Integer getAuthority() {
return authority;
}
public void setAuthority(Integer authority) {
this.authority = authority;
}
public Boolean getEnable() {
return enable;
}
public void setEnable(Boolean enable) {
this.enable = enable;
}
public Long getLeaderId() {
return leaderId;
}
public void setLeaderId(Long leaderId) {
this.leaderId = leaderId;
}
public String getMobilePhone() {
return mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getUserImage() {
return userImage;
}
public void setUserImage(String userImage) {
this.userImage = userImage;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-04-24 18:42:57
* Description:
*
* @author huangpeilin
*/
public class AreaResponseDTO {
private Long id;
private String name;
private Integer position;
@Override
public String toString() {
return "AreaResponseDTO{" +
"id=" + id +
", name='" + name + '\'' +
", position=" + position +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-28 10:41:41
* Description:
*
* @author huangpeilin
*/
public class CheckExamUserTestResponseDTO {
private Boolean result;
private List<String> usernameList;
@Override
public String toString() {
return "CheckExamUserTestResponseDTO{" +
"result=" + result +
", usernameList=" + usernameList +
'}';
}
public Boolean getResult() {
return result;
}
public void setResult(Boolean result) {
this.result = result;
}
public List<String> getUsernameList() {
return usernameList;
}
public void setUsernameList(List<String> usernameList) {
this.usernameList = usernameList;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import com.fasterxml.jackson.annotation.JsonInclude;
/**
* Author: huangpeilin
* Create at: 2019-04-25 18:59:04
* Description:
*
* @author huangpeilin
*/
public class CheckItemResponseDTO {
private Long id;
private String name;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String region;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String chineseName;
private Integer engineType;
@Override
public String toString() {
return "CheckItemResponseDTO{" +
"id=" + id +
", name='" + name + '\'' +
", engineType='" + engineType + '\'' +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public String getChineseName() {
return chineseName;
}
public void setChineseName(String chineseName) {
this.chineseName = chineseName;
}
public Integer getEngineType() {
return engineType;
}
public void setEngineType(Integer engineType) {
this.engineType = engineType;
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-05-09 10:01:12
* Description:
*
* @author huangpeilin
*/
public class ClassReportCardMessageDTO {
private Long userId;
private String card;
private String username;
private Long reportCardId;
private String classType;
private String remarks;
private Float score;
private Integer assessment;
private Integer position;
private String areaName;
private Integer rank;
@Override
public String toString() {
return "ClassReportCardMessageDTO{" +
"userId=" + userId +
", card='" + card + '\'' +
", username='" + username + '\'' +
", reportCardId=" + reportCardId +
", classType='" + classType + '\'' +
", remarks='" + remarks + '\'' +
", score=" + score +
", assessment=" + assessment +
", position=" + position +
", areaName='" + areaName + '\'' +
'}';
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Long getReportCardId() {
return reportCardId;
}
public void setReportCardId(Long reportCardId) {
this.reportCardId = reportCardId;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Float getScore() {
return score;
}
public void setScore(Float score) {
this.score = score;
}
public Integer getAssessment() {
return assessment;
}
public void setAssessment(Integer assessment) {
this.assessment = assessment;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public Integer getRank() {
return rank;
}
public void setRank(Integer rank) {
this.rank = rank;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-30 15:05:20
* Description:
*
* @author huangpeilin
*/
public class CourseInfoResponseDTO {
/**
* 课程ID
*/
private Long id;
/**
* 课程名字
*/
private String name;
/**
* 课程中文名字
*/
private String chineseName;
/**
* 职位 0:乘务; 1:机务
*/
private Integer division;
/**
* 异常数量
*/
private Integer totalAbnormals;
/**
* 创建时间 时间戳
*/
private Long createTime;
/**
* 机型数据模型
*/
private ModelResponseDTO model;
/**
* 发动机数据模型
*/
private EngineResponseDTO engine;
/**
* 检查项列表
*/
private List<CheckItemResponseDTO> checkItemList;
/**
* 异常项列表
*/
private List<ExceptionItemResponseDTO> exceptionItemList;
@Override
public String toString() {
return "CourseInfoResponseDTO{" +
"id=" + id +
", name='" + name + '\'' +
", chineseName='" + chineseName + '\'' +
", division=" + division +
", totalAbnormals=" + totalAbnormals +
", createTime=" + createTime +
", model=" + model +
", engine=" + engine +
", checkItemList=" + checkItemList +
", exceptionItemList=" + exceptionItemList +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getChineseName() {
return chineseName;
}
public void setChineseName(String chineseName) {
this.chineseName = chineseName;
}
public Integer getDivision() {
return division;
}
public void setDivision(Integer division) {
this.division = division;
}
public Integer getTotalAbnormals() {
return totalAbnormals;
}
public void setTotalAbnormals(Integer totalAbnormals) {
this.totalAbnormals = totalAbnormals;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public ModelResponseDTO getModel() {
return model;
}
public void setModel(ModelResponseDTO model) {
this.model = model;
}
public EngineResponseDTO getEngine() {
return engine;
}
public void setEngine(EngineResponseDTO engine) {
this.engine = engine;
}
public List<CheckItemResponseDTO> getCheckItemList() {
return checkItemList;
}
public void setCheckItemList(List<CheckItemResponseDTO> checkItemList) {
this.checkItemList = checkItemList;
}
public List<ExceptionItemResponseDTO> getExceptionItemList() {
return exceptionItemList;
}
public void setExceptionItemList(List<ExceptionItemResponseDTO> exceptionItemList) {
this.exceptionItemList = exceptionItemList;
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-04-25 18:57:05
* Description:
*
* @author huangpeilin
*/
public class CourseResponseDTO {
private Long id;
private String name;
private String chineseName;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getChineseName() {
return chineseName;
}
public void setChineseName(String chineseName) {
this.chineseName = chineseName;
}
@Override
public String toString() {
return "CourseResponseDTO{" +
"id=" + id +
", name='" + name + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-04-25 14:15:14
* Description:
*
* @author huangpeilin
*/
public class EngineResponseDTO {
private Long id;
private String name;
private Integer type;
@Override
public String toString() {
return "EngineResponseDTO{" +
"id=" + id +
", name='" + name + '\'' +
", type=" + type +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-04-30 18:01:17
* Description:
*
* @author huangpeilin
*/
public class ExamMessageResponseDTO {
private Long examId;
private Long examTime;
private Long questionPaperId;
private String questionPaperName;
private String classType;
private String remark;
private String invigilator;
@Override
public String toString() {
return "ExamMessageResponseDTO{" +
"examId=" + examId +
", examTime=" + examTime +
", questionPaperId=" + questionPaperId +
", questionPaperName='" + questionPaperName + '\'' +
", classType='" + classType + '\'' +
", remark='" + remark + '\'' +
", invigilator=" + invigilator +
'}';
}
public Long getExamId() {
return examId;
}
public void setExamId(Long examId) {
this.examId = examId;
}
public Long getExamTime() {
return examTime;
}
public void setExamTime(Long examTime) {
this.examTime = examTime;
}
public Long getQuestionPaperId() {
return questionPaperId;
}
public void setQuestionPaperId(Long questionPaperId) {
this.questionPaperId = questionPaperId;
}
public String getQuestionPaperName() {
return questionPaperName;
}
public void setQuestionPaperName(String questionPaperName) {
this.questionPaperName = questionPaperName;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getInvigilator() {
return invigilator;
}
public void setInvigilator(String invigilator) {
this.invigilator = invigilator;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import com.fasterxml.jackson.annotation.JsonInclude;
/**
* Author: huangpeilin
* Create at: 2019-04-25 19:03:34
* Description:
*
* @author huangpeilin
*/
public class ExceptionItemResponseDTO {
private Long id;
private String name;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String region;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String chineseName;
private Integer engineType;
@Override
public String toString() {
return "ExceptionItemResponseDTO{" +
"id=" + id +
", name='" + name + '\'' +
", engineType='" + engineType + '\'' +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public String getChineseName() {
return chineseName;
}
public void setChineseName(String chineseName) {
this.chineseName = chineseName;
}
public Integer getEngineType() {
return engineType;
}
public void setEngineType(Integer engineType) {
this.engineType = engineType;
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-04-28 15:26:19
* Description:
*
* @author huangpeilin
*/
public class ItemAnswerMessageDTO {
private Long id;
private String name;
private String details;
private String region;
private Integer answer;
private String choice;
@Override
public String toString() {
return "ItemAnswerMessageDTO{" +
"id=" + id +
", name='" + name + '\'' +
", details='" + details + '\'' +
", region='" + region + '\'' +
", answer='" + answer + '\'' +
", choice='" + choice + '\'' +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDetails() {
return details;
}
public void setDetails(String details) {
this.details = details;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public Integer getAnswer() {
return answer;
}
public void setAnswer(Integer answer) {
this.answer = answer;
}
public String getChoice() {
return choice;
}
public void setChoice(String choice) {
this.choice = choice;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-30 19:06:58
* Description:
*
* @author huangpeilin
*/
public class ItemChoiceInfoDTO {
private Long id;
private String name;
private String details;
private String region;
private Integer sum;
private List<UserMessageDTO> choosePeople;
@Override
public String toString() {
return "ItemChoiceInfoDTO{" +
"id=" + id +
", name='" + name + '\'' +
", details='" + details + '\'' +
", region='" + region + '\'' +
", sum=" + sum +
", choosePeople=" + choosePeople +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDetails() {
return details;
}
public void setDetails(String details) {
this.details = details;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public Integer getSum() {
return sum;
}
public void setSum(Integer sum) {
this.sum = sum;
}
public List<UserMessageDTO> getChoosePeople() {
return choosePeople;
}
public void setChoosePeople(List<UserMessageDTO> choosePeople) {
this.choosePeople = choosePeople;
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-05-08 9:52:37
* Description:
*
* @author huangpeilin
*/
public class LoginSituationResponseDTO {
private Long userId;
private String card;
private String username;
private String classType;
private Integer status;
private String operationalContext;
private Long loginTime;
@Override
public String toString() {
return "LoginSituationResponseDTO{" +
"userId=" + userId +
", card='" + card + '\'' +
", username='" + username + '\'' +
", classType='" + classType + '\'' +
", status=" + status +
", operationalContext='" + operationalContext + '\'' +
", loginTime=" + loginTime +
'}';
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getOperationalContext() {
return operationalContext;
}
public void setOperationalContext(String operationalContext) {
this.operationalContext = operationalContext;
}
public Long getLoginTime() {
return loginTime;
}
public void setLoginTime(Long loginTime) {
this.loginTime = loginTime;
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-04-25 11:28:35
* Description:
*
* @author huangpeilin
*/
public class ModelResponseDTO {
private Long id;
private String name;
private String brand;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
@Override
public String toString() {
return "ModelResponseDTO{" +
"id=" + id +
", name='" + name + '\'' +
", brand='" + brand + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-05-05 16:31:44
* Description:
*
* @author huangpeilin
*/
public class OperationRecordExamDTO {
private Long questionPaperId;
private String title;
private Long reportCardId;
private String invigilators;
private Float score;
private Integer assessment;
private Long loginTime;
private Long logoutTime;
private Long startTime;
private Long endTime;
@Override
public String toString() {
return "OperationRecordExamDTO{" +
"questionPaperId=" + questionPaperId +
", title='" + title + '\'' +
", reportCardId=" + reportCardId +
", invigilators=" + invigilators +
", score=" + score +
", assessment=" + assessment +
", loginTime=" + loginTime +
", logoutTime=" + logoutTime +
'}';
}
public Long getQuestionPaperId() {
return questionPaperId;
}
public void setQuestionPaperId(Long questionPaperId) {
this.questionPaperId = questionPaperId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Long getReportCardId() {
return reportCardId;
}
public void setReportCardId(Long reportCardId) {
this.reportCardId = reportCardId;
}
public String getInvigilators() {
return invigilators;
}
public void setInvigilators(String invigilators) {
this.invigilators = invigilators;
}
public Float getScore() {
return score;
}
public void setScore(Float score) {
this.score = score;
}
public Integer getAssessment() {
return assessment;
}
public void setAssessment(Integer assessment) {
this.assessment = assessment;
}
public Long getLoginTime() {
return loginTime;
}
public void setLoginTime(Long loginTime) {
this.loginTime = loginTime;
}
public Long getLogoutTime() {
return logoutTime;
}
public void setLogoutTime(Long logoutTime) {
this.logoutTime = logoutTime;
}
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Long getEndTime() {
return endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-05-05 16:31:11
* Description:
*
* @author huangpeilin
*/
public class OperationRecordExamResponseDTO {
private Long totalCount;
private Integer totalPageCount;
private Integer pageSize;
private Integer pageIndex;
private Long userId;
private String card;
private String username;
private Integer position;
private String classType;
private String organizationName;
private List<OperationRecordExamDTO> list;
@Override
public String toString() {
return "OperationRecordExamResponseDTO{" +
"totalCount=" + totalCount +
", totalPageCount=" + totalPageCount +
", pageSize=" + pageSize +
", pageIndex=" + pageIndex +
", userId=" + userId +
", card='" + card + '\'' +
", username='" + username + '\'' +
", position=" + position +
", classType='" + classType + '\'' +
", organizationName='" + organizationName + '\'' +
", list=" + list +
'}';
}
public Long getTotalCount() {
return totalCount;
}
public void setTotalCount(Long totalCount) {
this.totalCount = totalCount;
}
public Integer getTotalPageCount() {
return totalPageCount;
}
public void setTotalPageCount(Integer totalPageCount) {
this.totalPageCount = totalPageCount;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Integer getPageIndex() {
return pageIndex;
}
public void setPageIndex(Integer pageIndex) {
this.pageIndex = pageIndex;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public String getOrganizationName() {
return organizationName;
}
public void setOrganizationName(String organizationName) {
this.organizationName = organizationName;
}
public List<OperationRecordExamDTO> getList() {
return list;
}
public void setList(List<OperationRecordExamDTO> list) {
this.list = list;
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-05-05 16:08:06
* Description:
*
* @author huangpeilin
*/
public class OperationRecordPracticeDTO {
private Long courseId;
private String courseName;
private String courseChineseName;
private Long loginTime;
private Long logoutTime;
private Long startTime;
private Long endTime;
@Override
public String toString() {
return "OperationRecordPracticeDTO{" +
"courseId=" + courseId +
", courseName='" + courseName + '\'' +
", courseChineseName='" + courseChineseName + '\'' +
", loginTime=" + loginTime +
", logoutTime=" + logoutTime +
'}';
}
public Long getCourseId() {
return courseId;
}
public void setCourseId(Long courseId) {
this.courseId = courseId;
}
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
public String getCourseChineseName() {
return courseChineseName;
}
public void setCourseChineseName(String courseChineseName) {
this.courseChineseName = courseChineseName;
}
public Long getLoginTime() {
return loginTime;
}
public void setLoginTime(Long loginTime) {
this.loginTime = loginTime;
}
public Long getLogoutTime() {
return logoutTime;
}
public void setLogoutTime(Long logoutTime) {
this.logoutTime = logoutTime;
}
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Long getEndTime() {
return endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-05-05 16:03:49
* Description:
*
* @author huangpeilin
*/
public class OperationRecordPracticeResponseDTO {
private Long totalCount;
private Integer totalPageCount;
private Integer pageSize;
private Integer pageIndex;
private Long userId;
private String card;
private String username;
private Integer position;
private String classType;
private String organizationName;
private List<OperationRecordPracticeDTO> list;
@Override
public String toString() {
return "OperationRecordPracticeResponseDTO{" +
"totalCount=" + totalCount +
", totalPageCount=" + totalPageCount +
", pageSize=" + pageSize +
", pageIndex=" + pageIndex +
", userId=" + userId +
", card='" + card + '\'' +
", username='" + username + '\'' +
", position=" + position +
", classType='" + classType + '\'' +
", organizationName='" + organizationName + '\'' +
", list=" + list +
'}';
}
public Long getTotalCount() {
return totalCount;
}
public void setTotalCount(Long totalCount) {
this.totalCount = totalCount;
}
public Integer getTotalPageCount() {
return totalPageCount;
}
public void setTotalPageCount(Integer totalPageCount) {
this.totalPageCount = totalPageCount;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Integer getPageIndex() {
return pageIndex;
}
public void setPageIndex(Integer pageIndex) {
this.pageIndex = pageIndex;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public String getOrganizationName() {
return organizationName;
}
public void setOrganizationName(String organizationName) {
this.organizationName = organizationName;
}
public List<OperationRecordPracticeDTO> getList() {
return list;
}
public void setList(List<OperationRecordPracticeDTO> list) {
this.list = list;
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-05-05 12:59:32
* Description:
*
* @author huangpeilin
*/
public class OperationRecordResponseDTO {
private Long userId;
private String card;
private String username;
private Long loginTime;
private Long logoutTime;
private String operationName;
private String ip;
@Override
public String toString() {
return "OperationRecordResponseDTO{" +
"userId=" + userId +
", card='" + card + '\'' +
", username='" + username + '\'' +
", loginTime=" + loginTime +
", logoutTime=" + logoutTime +
", operationName='" + operationName + '\'' +
", ip='" + ip + '\'' +
'}';
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Long getLoginTime() {
return loginTime;
}
public void setLoginTime(Long loginTime) {
this.loginTime = loginTime;
}
public Long getLogoutTime() {
return logoutTime;
}
public void setLogoutTime(Long logoutTime) {
this.logoutTime = logoutTime;
}
public String getOperationName() {
return operationName;
}
public void setOperationName(String operationName) {
this.operationName = operationName;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.io.Serializable;
import java.util.List;
/**
* @author admin
* @ClassName: PageResponseDTO
* @Description: @Description
* @date 2018/3/16 16:01
*/
public class PageResponse<T> implements Serializable {
private List<T> list;
private long totalCount;
private Integer totalPageCount;
private Integer pageSize;
private Integer pageIndex;
public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
public long getTotalCount() {
return totalCount;
}
public void setTotalCount(long totalCount) {
this.totalCount = totalCount;
}
public Integer getTotalPageCount() {
return totalPageCount;
}
public void setTotalPageCount(Integer totalPageCount) {
this.totalPageCount = totalPageCount;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Integer getPageIndex() {
return pageIndex;
}
public void setPageIndex(Integer pageIndex) {
this.pageIndex = pageIndex;
}
@Override
public String toString() {
return "PageResponse{" +
"list=" + list +
", totalCount=" + totalCount +
", totalPageCount=" + totalPageCount +
", pageSize=" + pageSize +
", pageIndex=" + pageIndex +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-25 18:49:43
* Description:
*
* @author huangpeilin
*/
public class QuestionPaperInfoResponseDTO {
/**
* 试卷ID
*/
private Long id;
/**
* 区域ID
*/
private Long areaId;
/**
* 区域名字
*/
private String areaName;
/**
* 创建者名字
*/
private String authorName;
/**
* 试卷名字
*/
private String title;
/**
* 试卷描述
*/
private String description;
/**
* 考试时长
*/
private Integer testLength;
/**
* 人为设定异常数量
*/
private Integer randomAbnormals;
/**
* 异常生成类型
*/
private Integer exceptionGenerateType;
/**
* 是否具有部位浮标功能
*/
private Boolean bIsPartsOfBuoy;
/**
* 是否具有位置提示功能
*/
private Boolean bIsLocationHints;
/**
* 是否具有环境声效功能
*/
private Boolean bIsEnvironmentalSound;
/**
* 是否具有操作提示功能
*/
private Boolean bIsOperatingHints;
/**
* 是否具有语音提示功能
*/
private Boolean bIsVoiceHints;
/**
* 是否具有名称标签功能
*/
private Boolean bIsNameTag;
/**
* 是否具有图文弹窗功能
*/
private Boolean bIsGraphicPopupWindow;
/**
* 是否具有警示注意功能
*/
private Boolean bIsWarningNotice;
/**
* 特殊项的ID集合
*/
private List<Long> specialIds;
/**
* 特殊项合格所需数量
*/
private Integer qualifiedQuantity;
/**
* 创建时间 时间戳
*/
private Long createTime;
/**
* 机型数据模型
*/
private ModelResponseDTO model;
/**
* 发动机数据模型
*/
private EngineResponseDTO engine;
/**
* 课程/工卡数据模型
*/
private CourseResponseDTO course;
/**
* 检查项列表
*/
private List<CheckItemResponseDTO> checkItemList;
/**
* 异常项列表
*/
private List<ExceptionItemResponseDTO> exceptionItemList;
/**
* 特殊项列表
*/
private List<ExceptionItemResponseDTO> specialItemList;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getAuthorName() {
return authorName;
}
public void setAuthorName(String authorName) {
this.authorName = authorName;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getTestLength() {
return testLength;
}
public void setTestLength(Integer testLength) {
this.testLength = testLength;
}
public Integer getRandomAbnormals() {
return randomAbnormals;
}
public void setRandomAbnormals(Integer randomAbnormals) {
this.randomAbnormals = randomAbnormals;
}
public Integer getExceptionGenerateType() {
return exceptionGenerateType;
}
public void setExceptionGenerateType(Integer exceptionGenerateType) {
this.exceptionGenerateType = exceptionGenerateType;
}
public Boolean getbIsPartsOfBuoy() {
return bIsPartsOfBuoy;
}
public void setbIsPartsOfBuoy(Boolean bIsPartsOfBuoy) {
this.bIsPartsOfBuoy = bIsPartsOfBuoy;
}
public Boolean getbIsLocationHints() {
return bIsLocationHints;
}
public void setbIsLocationHints(Boolean bIsLocationHints) {
this.bIsLocationHints = bIsLocationHints;
}
public Boolean getbIsEnvironmentalSound() {
return bIsEnvironmentalSound;
}
public void setbIsEnvironmentalSound(Boolean bIsEnvironmentalSound) {
this.bIsEnvironmentalSound = bIsEnvironmentalSound;
}
public Boolean getbIsOperatingHints() {
return bIsOperatingHints;
}
public void setbIsOperatingHints(Boolean bIsOperatingHints) {
this.bIsOperatingHints = bIsOperatingHints;
}
public Boolean getbIsVoiceHints() {
return bIsVoiceHints;
}
public void setbIsVoiceHints(Boolean bIsVoiceHints) {
this.bIsVoiceHints = bIsVoiceHints;
}
public Boolean getbIsNameTag() {
return bIsNameTag;
}
public void setbIsNameTag(Boolean bIsNameTag) {
this.bIsNameTag = bIsNameTag;
}
public Boolean getbIsGraphicPopupWindow() {
return bIsGraphicPopupWindow;
}
public void setbIsGraphicPopupWindow(Boolean bIsGraphicPopupWindow) {
this.bIsGraphicPopupWindow = bIsGraphicPopupWindow;
}
public Boolean getbIsWarningNotice() {
return bIsWarningNotice;
}
public void setbIsWarningNotice(Boolean bIsWarningNotice) {
this.bIsWarningNotice = bIsWarningNotice;
}
public List<Long> getSpecialIds() {
return specialIds;
}
public void setSpecialIds(List<Long> specialIds) {
this.specialIds = specialIds;
}
public Integer getQualifiedQuantity() {
return qualifiedQuantity;
}
public void setQualifiedQuantity(Integer qualifiedQuantity) {
this.qualifiedQuantity = qualifiedQuantity;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public ModelResponseDTO getModel() {
return model;
}
public void setModel(ModelResponseDTO model) {
this.model = model;
}
public EngineResponseDTO getEngine() {
return engine;
}
public void setEngine(EngineResponseDTO engine) {
this.engine = engine;
}
public CourseResponseDTO getCourse() {
return course;
}
public void setCourse(CourseResponseDTO course) {
this.course = course;
}
public List<CheckItemResponseDTO> getCheckItemList() {
return checkItemList;
}
public void setCheckItemList(List<CheckItemResponseDTO> checkItemList) {
this.checkItemList = checkItemList;
}
public List<ExceptionItemResponseDTO> getExceptionItemList() {
return exceptionItemList;
}
public void setExceptionItemList(List<ExceptionItemResponseDTO> exceptionItemList) {
this.exceptionItemList = exceptionItemList;
}
public List<ExceptionItemResponseDTO> getSpecialItemList() {
return specialItemList;
}
public void setSpecialItemList(List<ExceptionItemResponseDTO> specialItemList) {
this.specialItemList = specialItemList;
}
@Override
public String toString() {
return "QuestionPaperInfoResponseDTO{" +
"id=" + id +
", areaId=" + areaId +
", title='" + title + '\'' +
", description='" + description + '\'' +
", testLength=" + testLength +
", randomAbnormals=" + randomAbnormals +
", exceptionGenerateType=" + exceptionGenerateType +
", bIsPartsOfBuoy=" + bIsPartsOfBuoy +
", bIsLocationHints=" + bIsLocationHints +
", bIsEnvironmentalSound=" + bIsEnvironmentalSound +
", bIsOperatingHints=" + bIsOperatingHints +
", bIsVoiceHints=" + bIsVoiceHints +
", bIsNameTag=" + bIsNameTag +
", bIsGraphicPopupWindow=" + bIsGraphicPopupWindow +
", bIsWarningNotice=" + bIsWarningNotice +
", specialIds=" + specialIds +
", qualifiedQuantity=" + qualifiedQuantity +
", createTime=" + createTime +
", model=" + model +
", engine=" + engine +
", course=" + course +
", checkItemList=" + checkItemList +
", exceptionItemList=" + exceptionItemList +
", specialItemList=" + specialItemList +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-04-25 17:26:52
* Description:
*
* @author huangpeilin
*/
public class QuestionPaperResponseDTO {
private Long id;
private String title;
private String description;
private String authorName;
private String modelName;
private String courseName;
private String courseChineseName;
private String areaName;
@Override
public String toString() {
return "QuestionPaperResponseDTO{" +
"id=" + id +
", title='" + title + '\'' +
", description='" + description + '\'' +
", authorName='" + authorName + '\'' +
", modelName='" + modelName + '\'' +
", courseName='" + courseName + '\'' +
'}';
}
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getAuthorName() {
return authorName;
}
public void setAuthorName(String authorName) {
this.authorName = authorName;
}
public String getModelName() {
return modelName;
}
public void setModelName(String modelName) {
this.modelName = modelName;
}
public String getCourseChineseName() {
return courseChineseName;
}
public void setCourseChineseName(String courseChineseName) {
this.courseChineseName = courseChineseName;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-28 17:42:35
* Description:
*
* @author huangpeilin
*/
public class ReportCardMessageDTO {
private Long questionPaperId;
private Long reportCardId;
private Long examTime;
private String classType;
private String title;
private String invigilators;
private String remarks;
private Float score;
private Integer assessment;
public Long getReportCardId() {
return reportCardId;
}
public void setReportCardId(Long reportCardId) {
this.reportCardId = reportCardId;
}
public Long getExamTime() {
return examTime;
}
public void setExamTime(Long examTime) {
this.examTime = examTime;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getInvigilators() {
return invigilators;
}
public void setInvigilators(String invigilators) {
this.invigilators = invigilators;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Float getScore() {
return score;
}
public void setScore(Float score) {
this.score = score;
}
public Integer getAssessment() {
return assessment;
}
public void setAssessment(Integer assessment) {
this.assessment = assessment;
}
public Long getQuestionPaperId() {
return questionPaperId;
}
public void setQuestionPaperId(Long questionPaperId) {
this.questionPaperId = questionPaperId;
}
@Override
public String toString() {
return "ReportCardMessageDTO{" +
"questionPaperId=" + questionPaperId +
", reportCardId=" + reportCardId +
", examTime=" + examTime +
", classType='" + classType + '\'' +
", title='" + title + '\'' +
", invigilators=" + invigilators +
", remarks='" + remarks + '\'' +
", score=" + score +
", assessment=" + assessment +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-28 15:29:37
* Description:
*
* @author huangpeilin
*/
public class ReportCardMessageResponseDTO {
private Long userId;
private String card;
private String username;
private String position;
private String organizationName;
private String title;
private String invigilators;
private Float score;
private Integer assessment;
private List<ItemAnswerMessageDTO> checkItemList;
private List<ItemAnswerMessageDTO> exceptionItemList;
private List<ItemAnswerMessageDTO> specialItemList;
@Override
public String toString() {
return "ReportCardMessageResponseDTO{" +
"userId=" + userId +
", card='" + card + '\'' +
", username='" + username + '\'' +
", position='" + position + '\'' +
", organizationName='" + organizationName + '\'' +
", title='" + title + '\'' +
", invigilators=" + invigilators +
", score=" + score +
", assessment=" + assessment +
", checkItemList=" + checkItemList +
", exceptionItemList=" + exceptionItemList +
", specialItemList=" + specialItemList +
'}';
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public String getOrganizationName() {
return organizationName;
}
public void setOrganizationName(String organizationName) {
this.organizationName = organizationName;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getInvigilators() {
return invigilators;
}
public void setInvigilators(String invigilators) {
this.invigilators = invigilators;
}
public Float getScore() {
return score;
}
public void setScore(Float score) {
this.score = score;
}
public Integer getAssessment() {
return assessment;
}
public void setAssessment(Integer assessment) {
this.assessment = assessment;
}
public List<ItemAnswerMessageDTO> getCheckItemList() {
return checkItemList;
}
public void setCheckItemList(List<ItemAnswerMessageDTO> checkItemList) {
this.checkItemList = checkItemList;
}
public List<ItemAnswerMessageDTO> getExceptionItemList() {
return exceptionItemList;
}
public void setExceptionItemList(List<ItemAnswerMessageDTO> exceptionItemList) {
this.exceptionItemList = exceptionItemList;
}
public List<ItemAnswerMessageDTO> getSpecialItemList() {
return specialItemList;
}
public void setSpecialItemList(List<ItemAnswerMessageDTO> specialItemList) {
this.specialItemList = specialItemList;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-30 19:04:30
* Description:
*
* @author huangpeilin
*/
public class ReportCardStatisticalResponseDTO {
private Long examId;
private Long examTime;
private Long questionPaperId;
private String title;
private String invigilators;
private String classType;
private List<ItemChoiceInfoDTO> checkItemList;
private List<ItemChoiceInfoDTO> exceptionItemList;
private List<ItemChoiceInfoDTO> specialItemList;
@Override
public String toString() {
return "ReportCardStatisticalResponseDTO{" +
"examId=" + examId +
", examTime=" + examTime +
", questionPaperId=" + questionPaperId +
", title='" + title + '\'' +
", invigilators=" + invigilators +
", classType='" + classType + '\'' +
", checkItemList=" + checkItemList +
", exceptionItemList=" + exceptionItemList +
", specialItemList=" + specialItemList +
'}';
}
public Long getExamId() {
return examId;
}
public void setExamId(Long examId) {
this.examId = examId;
}
public Long getExamTime() {
return examTime;
}
public void setExamTime(Long examTime) {
this.examTime = examTime;
}
public Long getQuestionPaperId() {
return questionPaperId;
}
public void setQuestionPaperId(Long questionPaperId) {
this.questionPaperId = questionPaperId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getInvigilators() {
return invigilators;
}
public void setInvigilators(String invigilators) {
this.invigilators = invigilators;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public List<ItemChoiceInfoDTO> getCheckItemList() {
return checkItemList;
}
public void setCheckItemList(List<ItemChoiceInfoDTO> checkItemList) {
this.checkItemList = checkItemList;
}
public List<ItemChoiceInfoDTO> getExceptionItemList() {
return exceptionItemList;
}
public void setExceptionItemList(List<ItemChoiceInfoDTO> exceptionItemList) {
this.exceptionItemList = exceptionItemList;
}
public List<ItemChoiceInfoDTO> getSpecialItemList() {
return specialItemList;
}
public void setSpecialItemList(List<ItemChoiceInfoDTO> specialItemList) {
this.specialItemList = specialItemList;
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-04-30 19:09:53
* Description:
*
* @author huangpeilin
*/
public class UserMessageDTO {
private Long userId;
private String username;
private String card;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
@Override
public String toString() {
return "UserMessageDTO{" +
"userId=" + userId +
", username='" + username + '\'' +
", card='" + card + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-05-29 15:57:00
* Description:
*/
public class WebCheckUserTestQueueResponseDTO {
/**
* true代表可以删除 false代表不可以删除
*/
private Boolean result;
private List<WebUserMessageResponseDTO> list;
@Override
public String toString() {
return "WebCheckUserTestQueueResponseDTO{" +
"result=" + result +
", list=" + list +
'}';
}
public Boolean getResult() {
return result;
}
public void setResult(Boolean result) {
this.result = result;
}
public List<WebUserMessageResponseDTO> getList() {
return list;
}
public void setList(List<WebUserMessageResponseDTO> list) {
this.list = list;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-05-09 9:59:23
* Description:
*
* @author huangpeilin
*/
public class WebClassReportCardInfoResponseDTO {
private Integer totalCount;
private Long totalPageCount;
private Integer pageSize;
private Integer pageIndex;
private Long questionPaperId;
private String title;
private String invigilators;
private Long examTime;
private String classType;
private List<ClassReportCardMessageDTO> reportCardList;
@Override
public String toString() {
return "WebClaseReportCardInfoResponseDTO{" +
"totalCount=" + totalCount +
", totalPageCount=" + totalPageCount +
", pageSize=" + pageSize +
", pageIndex=" + pageIndex +
", questionPaperId=" + questionPaperId +
", title='" + title + '\'' +
", invigilators='" + invigilators + '\'' +
", examTime=" + examTime +
", classType='" + classType + '\'' +
", reportCardList=" + reportCardList +
'}';
}
public Integer getTotalCount() {
return totalCount;
}
public void setTotalCount(Integer totalCount) {
this.totalCount = totalCount;
}
public Long getTotalPageCount() {
return totalPageCount;
}
public void setTotalPageCount(Long totalPageCount) {
this.totalPageCount = totalPageCount;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Integer getPageIndex() {
return pageIndex;
}
public void setPageIndex(Integer pageIndex) {
this.pageIndex = pageIndex;
}
public Long getQuestionPaperId() {
return questionPaperId;
}
public void setQuestionPaperId(Long questionPaperId) {
this.questionPaperId = questionPaperId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getInvigilators() {
return invigilators;
}
public void setInvigilators(String invigilators) {
this.invigilators = invigilators;
}
public Long getExamTime() {
return examTime;
}
public void setExamTime(Long examTime) {
this.examTime = examTime;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public List<ClassReportCardMessageDTO> getReportCardList() {
return reportCardList;
}
public void setReportCardList(List<ClassReportCardMessageDTO> reportCardList) {
this.reportCardList = reportCardList;
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-04-26 17:53:17
* Description:
*
* @author huangpeilin
*/
public class WebExamInvigilatorResponseDTO {
/**
* 用户ID
*/
private Long userId;
/**
* 用户工号
*/
private String card;
/**
* 用户名
*/
private String username;
/**
* 部门
*/
private String areaName;
/**
* 用户类别 0 代表学员 1 代表教员
*/
private Integer userType;
@Override
public String toString() {
return "WebExamInvigilatorResponseDTO{" +
"userId=" + userId +
", card='" + card + '\'' +
", username='" + username + '\'' +
", areaName='" + areaName + '\'' +
", userType=" + userType +
'}';
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public Integer getUserType() {
return userType;
}
public void setUserType(Integer userType) {
this.userType = userType;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-26 15:54:56
* Description:
*
* @author huangpeilin
*/
public class WebExamUserMessageResponseDTO {
private Long userId;
private String card;
private String username;
private String classType;
private String leaderName;
private Long questionPaperId;
private String questionPaperName;
private Integer completionStatus;
private Integer switchStatus;
private Long examId;
private String invigilator;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public String getLeaderName() {
return leaderName;
}
public void setLeaderName(String leaderName) {
this.leaderName = leaderName;
}
public Long getQuestionPaperId() {
return questionPaperId;
}
public void setQuestionPaperId(Long questionPaperId) {
this.questionPaperId = questionPaperId;
}
public String getQuestionPaperName() {
return questionPaperName;
}
public void setQuestionPaperName(String questionPaperName) {
this.questionPaperName = questionPaperName;
}
public Integer getCompletionStatus() {
return completionStatus;
}
public void setCompletionStatus(Integer completionStatus) {
this.completionStatus = completionStatus;
}
public Integer getSwitchStatus() {
return switchStatus;
}
public void setSwitchStatus(Integer switchStatus) {
this.switchStatus = switchStatus;
}
public Long getExamId() {
return examId;
}
public void setExamId(Long examId) {
this.examId = examId;
}
public String getInvigilator() {
return invigilator;
}
public void setInvigilator(String invigilator) {
this.invigilator = invigilator;
}
@Override
public String toString() {
return "WebExamUserMessageResponseDTO{" +
"userId=" + userId +
", card='" + card + '\'' +
", username='" + username + '\'' +
", classType='" + classType + '\'' +
", leaderName='" + leaderName + '\'' +
", questionPaperId=" + questionPaperId +
", questionPaperName='" + questionPaperName + '\'' +
", completionStatus=" + completionStatus +
", switchStatus=" + switchStatus +
", examId=" + examId +
", invigilator=" + invigilator +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-28 17:41:49
* Description:
*
* @author huangpeilin
*/
public class WebReportCardInfoResponseDTO {
private Long totalCount;
private Integer totalPageCount;
private Integer pageSize;
private Integer pageIndex;
private Integer position;
private Long userId;
private String card;
private String username;
private String organizationName;
private List<ReportCardMessageDTO> examList;
public Long getTotalCount() {
return totalCount;
}
public void setTotalCount(Long totalCount) {
this.totalCount = totalCount;
}
public Integer getTotalPageCount() {
return totalPageCount;
}
public void setTotalPageCount(Integer totalPageCount) {
this.totalPageCount = totalPageCount;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Integer getPageIndex() {
return pageIndex;
}
public void setPageIndex(Integer pageIndex) {
this.pageIndex = pageIndex;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getOrganizationName() {
return organizationName;
}
public void setOrganizationName(String organizationName) {
this.organizationName = organizationName;
}
public List<ReportCardMessageDTO> getExamList() {
return examList;
}
public void setExamList(List<ReportCardMessageDTO> examList) {
this.examList = examList;
}
@Override
public String toString() {
return "WebReportCardInfoResponseDTO{" +
"totalCount=" + totalCount +
", totalPageCount=" + totalPageCount +
", pageSize=" + pageSize +
", pageIndex=" + pageIndex +
", position=" + position +
", userId=" + userId +
", card='" + card + '\'' +
", username='" + username + '\'' +
", organizationName='" + organizationName + '\'' +
", examList=" + examList +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.response;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-05-05 18:04:49
* Description:
*
* @author huangpeilin
*/
public class WebReportCardMessageResponseDTO {
private Long reportCardId;
private Long userId;
private String card;
private String username;
private String classType;
private Long questionPaperId;
private String questionPaperName;
private String invigilator;
private Float score;
private Integer assessment;
private Long examTime;
@Override
public String toString() {
return "WebReportCardMessageResponseDTO{" +
"reportCardId=" + reportCardId +
", userId=" + userId +
", card='" + card + '\'' +
", username='" + username + '\'' +
", classType='" + classType + '\'' +
", questionPaperId='" + questionPaperId + '\'' +
", questionPaperName='" + questionPaperName + '\'' +
", invigilator=" + invigilator +
", score=" + score +
", assessment=" + assessment +
", examTime=" + examTime +
'}';
}
public Long getReportCardId() {
return reportCardId;
}
public void setReportCardId(Long reportCardId) {
this.reportCardId = reportCardId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public Long getQuestionPaperId() {
return questionPaperId;
}
public void setQuestionPaperId(Long questionPaperId) {
this.questionPaperId = questionPaperId;
}
public String getQuestionPaperName() {
return questionPaperName;
}
public void setQuestionPaperName(String questionPaperName) {
this.questionPaperName = questionPaperName;
}
public String getInvigilator() {
return invigilator;
}
public void setInvigilator(String invigilator) {
this.invigilator = invigilator;
}
public Float getScore() {
return score;
}
public void setScore(Float score) {
this.score = score;
}
public Integer getAssessment() {
return assessment;
}
public void setAssessment(Integer assessment) {
this.assessment = assessment;
}
public Long getExamTime() {
return examTime;
}
public void setExamTime(Long examTime) {
this.examTime = examTime;
}
}
package cn.com.sailfish.linghang.dao.web.response;
public class WebSumResponseDTO {
//身份;
private String type;
//统计时间段;
private String parttime;
//浏览人次;
private String usercount;
//浏览时长
private String usertimecount;
public WebSumResponseDTO() {
}
public WebSumResponseDTO(String type, String parttime, String usercount, String usertimecount) {
this.type = type;
this.parttime = parttime;
this.usercount = usercount;
this.usertimecount = usertimecount;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getParttime() {
return parttime;
}
public void setParttime(String parttime) {
this.parttime = parttime;
}
public String getUsercount() {
return usercount;
}
public void setUsercount(String usercount) {
this.usercount = usercount;
}
public String getUsertimecount() {
return usertimecount;
}
public void setUsertimecount(String usertimecount) {
this.usertimecount = usertimecount;
}
@Override
public String toString() {
return "WebSumResponseDTO{" +
"type='" + type + '\'' +
", parttime='" + parttime + '\'' +
", usercount='" + usercount + '\'' +
", usertimecount='" + usertimecount + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-04-23 18:12:45
* Description:
*
* @author huangpeilin
*/
public class WebUserLoginResponseDTO {
private Long id;
private String token;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
@Override
public String toString() {
return "WebUserLoginResponseDTO{" +
"id=" + id +
", token='" + token + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-05-05 14:39:18
* Description:
*
* @author huangpeilin
*/
public class WebUserMessageResponseDTO {
private Long id;
private String username;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Override
public String toString() {
return "WebUserMessageResponseDTO{" +
"id=" + id +
", username='" + username + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.dao.web.response;
/**
* Author: huangpeilin
* Create at: 2019-04-23 19:17:53
* Description:
*
* @author huangpeilin
*/
public class WebUserResponseDTO {
/**
* 用户ID
*/
private Long id;
/**
* 用户名字
*/
private String username;
/**
* 用户工号
*/
private String card;
/**
* 区域ID
*/
private Long areaId;
/**
* 区域名字
*/
private String areaName;
/**
* 学员类别 0 代表学员 1 代表教员
*/
private Integer type;
/**
* 学员班别 初训 复训
*/
private String classType;
/**
* 负责人ID
*/
private Long leaderId;
/**
* 负责人名字
*/
private String leaderName;
/**
* 手机号码
*/
private String mobilePhone;
/**
* 电子邮箱
*/
private String email;
/**
* 用户头像
*/
private String userImage;
/**
* 用户权限
*/
private Integer authority;
/**
* 用户状态 0 训练 1 考试 2 离线 3 在线
*/
private Integer status;
/**
* 用户备注
*/
private String remarks;
/**
* 用户职位 0:乘务; 1:机务
*/
private Integer position;
/**
* 是否启用权限
*/
private Boolean enable;
/**
* 性别 0:女; 1:男
*/
private Integer gender;
@Override
public String toString() {
return "WebUserResponseDTO{" +
"id=" + id +
", username='" + username + '\'' +
", card='" + card + '\'' +
", areaId=" + areaId +
", areaName='" + areaName + '\'' +
", type=" + type +
", classType='" + classType + '\'' +
", leaderId=" + leaderId +
", mobilePhone='" + mobilePhone + '\'' +
", email='" + email + '\'' +
", userImage='" + userImage + '\'' +
", authority=" + authority +
", status=" + status +
", remarks='" + remarks + '\'' +
", position=" + position +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public Long getLeaderId() {
return leaderId;
}
public void setLeaderId(Long leaderId) {
this.leaderId = leaderId;
}
public String getLeaderName() {
return leaderName;
}
public void setLeaderName(String leaderName) {
this.leaderName = leaderName;
}
public String getMobilePhone() {
return mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getUserImage() {
return userImage;
}
public void setUserImage(String userImage) {
this.userImage = userImage;
}
public Integer getAuthority() {
return authority;
}
public void setAuthority(Integer authority) {
this.authority = authority;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
public Boolean getEnable() {
return enable;
}
public void setEnable(Boolean enable) {
this.enable = enable;
}
public Integer getGender() {
return gender;
}
public void setGender(Integer gender) {
this.gender = gender;
}
}
package cn.com.sailfish.linghang.dao.web.response;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;
@Entity
public class WebVrSumResponseDTO implements Serializable {
@Id
//部门;
private String deptment;
//课程;
private String course;
//类型;
private String type;
//统计时间段;
private String partrtime;
//使用人次;
private String usercount ;
//使用总时长;
private String usertime;
public WebVrSumResponseDTO() {
}
public WebVrSumResponseDTO(String deptment, String course, String type, String partrtime, String usercount, String usertime) {
this.deptment = deptment;
this.course = course;
this.type = type;
this.partrtime = partrtime;
this.usercount = usercount;
this.usertime = usertime;
}
public String getDeptment() {
return deptment;
}
public void setDeptment(String deptment) {
this.deptment = deptment;
}
public String getCourse() {
return course;
}
public void setCourse(String course) {
this.course = course;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getPartrtime() {
return partrtime;
}
public void setPartrtime(String partrtime) {
this.partrtime = partrtime;
}
public String getUsercount() {
return usercount;
}
public void setUsercount(String usercount) {
this.usercount = usercount;
}
public String getUsertime() {
return usertime;
}
public void setUsertime(String usertime) {
this.usertime = usertime;
}
@Override
public String toString() {
return "WebSumRequestDTO{" +
"deptment='" + deptment + '\'' +
", course='" + course + '\'' +
", type='" + type + '\'' +
", partrtime='" + partrtime + '\'' +
", usercount=" + usercount +
", usertime='" + usertime + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.dao.web;
/**
* Author: huangpeilin
* Create at: 2019-04-23 11:29:28
* Description:
*
* @author huangpeilin
*/
public class UserImportModel {
/**
* 用户卡号
*/
private String card;
/**
* 用户名字
*/
private String username;
/**
* 组织机构名字
*/
private String organization;
/**
* 学员类别 0 学员 1 教员
*/
private Integer userType;
/**
* 联系电话
*/
private String mobilePhone;
/**
* 电子邮箱
*/
private String email;
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getOrganization() {
return organization;
}
public void setOrganization(String organization) {
this.organization = organization;
}
public Integer getUserType() {
return userType;
}
public void setUserType(Integer userType) {
this.userType = userType;
}
public String getMobilePhone() {
return mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return "UserImportModel{" +
"card='" + card + '\'' +
", username='" + username + '\'' +
", organization='" + organization + '\'' +
", userType='" + userType + '\'' +
", mobilePhone='" + mobilePhone + '\'' +
", email='" + email + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 区域表
*/
@Entity
@Table(name = "area")
public class Area extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "position")
private Integer position; // 职位 0:乘务; 1:机务
@Column(name = "name", length = 50)
private String name; // 区域名字 唯一
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getPosition() {
return this.position;
}
public void setPosition(Integer position) {
this.position = position;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ Area: { " +
"'id': '" + getId() + "'" +
", 'position': '" + getPosition() + "'" +
", 'name': '" + getName() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 检查项表
*/
@Entity
@Table(name = "check_item")
public class CheckItem extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "import_id")
private Long importId; // 检查项导入表的ID值
@Column(name = "name")
private String name; // 课程英文名字
@Column(name = "chinese_name")
private String chineseName; // 课程中文名称
@Column(name = "region")
private String region; // 所属的区域 比如 A区,B区 CD区
@ManyToOne
@JoinColumn(name = "engine_id")
private Engine engine;
@ManyToOne
@JoinColumn(name = "model_id")
private Model model;
@ManyToMany(mappedBy = "checkItem")
private List<Course> course;
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Long getImportId() {
return this.importId;
}
public void setImportId(Long importId) {
this.importId = importId;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getChineseName() {
return this.chineseName;
}
public void setChineseName(String chineseName) {
this.chineseName = chineseName;
}
public String getRegion() {
return this.region;
}
public void setRegion(String region) {
this.region = region;
}
public Engine getEngine() {
return this.engine;
}
public void setEngine(Engine engine) {
this.engine = engine;
}
public Model getModel() {
return this.model;
}
public void setModel(Model model) {
this.model = model;
}
public List<Course> getCourse() {
return this.course;
}
public void setCourse(List<Course> course) {
this.course = course;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ CheckItem: { " +
"'id': '" + getId() + "'" +
", 'importId': '" + getImportId() + "'" +
", 'name': '" + getName() + "'" +
", 'chineseName': '" + getChineseName() + "'" +
", 'region': '" + getRegion() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 课程、工卡信息表
*/
@Entity
@Table(name = "course")
public class Course extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "import_id")
private Long importId; // 课程导入表的ID值
@Column(name = "name")
@Size(min = 1, max = 50)
private String name; // 课程英文名字, 长度大于1小于50, 不为空
@Column(name = "chinese_name")
@Size(min = 1, max = 50)
private String chineseName; // 课程中文名称,长度大于1小于50,允许为空
@Column(name = "division")
private Integer division; // 部门 0:乘务; 1:机务
@Column(name = "total_abnormals")
private Integer totalAbnormals; // 异常总数量
@ManyToOne
@JoinColumn(name = "model_id")
private Model model;
@ManyToOne
@JoinColumn(name = "engine_id")
private Engine engine;
@ManyToMany
@JoinTable(name = "course_check_item",
joinColumns = @JoinColumn(name = "course_id"),
inverseJoinColumns = @JoinColumn(name = "check_item_id"))
private List<CheckItem> checkItem;
@ManyToMany
@JoinTable(name = "course_exception_item",
joinColumns = @JoinColumn(name = "course_id"),
inverseJoinColumns = @JoinColumn(name = "exception_item_id"))
private List<ExceptionItem> exceptionItem;
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Long getImportId() {
return this.importId;
}
public void setImportId(Long importId) {
this.importId = importId;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getChineseName() {
return this.chineseName;
}
public void setChineseName(String chineseName) {
this.chineseName = chineseName;
}
public Integer getDivision() {
return this.division;
}
public void setDivision(Integer division) {
this.division = division;
}
public Integer getTotalAbnormals() {
return this.totalAbnormals;
}
public void setTotalAbnormals(Integer totalAbnormals) {
this.totalAbnormals = totalAbnormals;
}
public Model getModel() {
return this.model;
}
public void setModel(Model model) {
this.model = model;
}
public Engine getEngine() {
return this.engine;
}
public void setEngine(Engine engine) {
this.engine = engine;
}
public List<CheckItem> getCheckItem() {
return this.checkItem;
}
public void setCheckItem(List<CheckItem> checkItem) {
this.checkItem = checkItem;
}
public List<ExceptionItem> getExceptionItem() {
return this.exceptionItem;
}
public void setExceptionItem(List<ExceptionItem> exceptionItem) {
this.exceptionItem = exceptionItem;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ Course: { " +
"'id': '" + getId() + "'" +
", 'importId': '" + getImportId() + "'" +
", 'name': '" + getName() + "'" +
", 'chineseName': '" + getChineseName() + "'" +
", 'division': '" + getDivision() + "'" +
", 'totalAbnormals': '" + getTotalAbnormals() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:24
*/
/**
* 发动机信息表
*/
@Entity
@Table(name = "engine")
public class Engine extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "name")
@Size(min = 1, max = 50)
private String name; // 发动机名字, 长度大于1小于50, 不为空且唯一
@Column(name = "type")
private Integer type; // 发动机和名字对应的值 0:非发动机检查项; 1:V2500; 2:CFM56; 3:PW1100
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public Integer getType() {
return this.type;
}
public void setType(Integer type) {
this.type = type;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ Engine: { " +
"'id': '" + getId() + "'" +
", 'name': '" + getName() + "'" +
", 'type': '" + getType() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 考试信息表
*/
@Entity
@Table(name = "exam")
public class Exam extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "name")
private String name; // 考试名字
@Column(name = "class_type")
private String classType; // 班别 初训 复训
@Column(name = "remarks")
private String remarks; // 考试备注
@Column(name = "exam_time")
private Instant examTime; // 考试日期
@Column(name = "invigilator")
private String invigilator; // 监考人集合
@Column(name = "b_is_delete")
private Boolean bIsDelete; // 是否已经在回收站中, 默认是false
@ManyToOne
@JoinColumn(name = "area_id")
private Area area;
@ManyToOne
@JoinColumn(name = "question_paper_id")
private QuestionPaper questionPaper;
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getClassType() {
return this.classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public String getRemarks() {
return this.remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Instant getExamTime() {
return this.examTime;
}
public void setExamTime(Instant examTime) {
this.examTime = examTime;
}
public String getInvigilator() {
return this.invigilator;
}
public void setInvigilator(String invigilator) {
this.invigilator = invigilator;
}
public Boolean getBIsDelete() {
return this.bIsDelete;
}
public void setBIsDelete(Boolean bIsDelete) {
this.bIsDelete = bIsDelete;
}
public Area getArea() {
return this.area;
}
public void setArea(Area area) {
this.area = area;
}
public QuestionPaper getQuestionPaper() {
return this.questionPaper;
}
public void setQuestionPaper(QuestionPaper questionPaper) {
this.questionPaper = questionPaper;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ Exam: { " +
"'id': '" + getId() + "'" +
", 'name': '" + getName() + "'" +
", 'classType': '" + getClassType() + "'" +
", 'remarks': '" + getRemarks() + "'" +
", 'examTime': '" + getExamTime() + "'" +
", 'invigilator': '" + getInvigilator() + "'" +
", 'bIsDelete': '" + getBIsDelete() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 异常项表
*/
@Entity
@Table(name = "exception_item")
public class ExceptionItem extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "import_id")
private Long importId; // 异常项导入表的ID值
@Column(name = "name")
private String name; // 异常名字
@Column(name = "details")
private String details; // 详情
@Column(name = "region")
private String region; // 所属的区域 比如 A区,B区 CD区
@ManyToMany(mappedBy = "exceptionItem")
private List<Course> course;
@ManyToOne
@JoinColumn(name = "model_id")
private Model model;
@ManyToOne
@JoinColumn(name = "engine_id")
private Engine engine;
@ManyToOne
@JoinColumn(name = "check_item_id")
private CheckItem checkItem;
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Long getImportId() {
return this.importId;
}
public void setImportId(Long importId) {
this.importId = importId;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getDetails() {
return this.details;
}
public void setDetails(String details) {
this.details = details;
}
public String getRegion() {
return this.region;
}
public void setRegion(String region) {
this.region = region;
}
public List<Course> getCourse() {
return this.course;
}
public void setCourse(List<Course> course) {
this.course = course;
}
public Model getModel() {
return this.model;
}
public void setModel(Model model) {
this.model = model;
}
public Engine getEngine() {
return this.engine;
}
public void setEngine(Engine engine) {
this.engine = engine;
}
public CheckItem getCheckItem() {
return this.checkItem;
}
public void setCheckItem(CheckItem checkItem) {
this.checkItem = checkItem;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ ExceptionItem: { " +
"'id': '" + getId() + "'" +
", 'importId': '" + getImportId() + "'" +
", 'name': '" + getName() + "'" +
", 'details': '" + getDetails() + "'" +
", 'region': '" + getRegion() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 文件信息表,表名file_info,如无指定@(主键)则默认创建id字段并设为主键
*/
@Entity
@Table(name = "file_info")
public class FileInfo extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "type")
private String type; // 文件类型,png,jpg,avi,mp3
@Column(name = "path")
private String path; // 文件路径
@Column(name = "title")
private String title; // 文件标题
@Column(name = "size")
private Long size; // 文件大小
@Column(name = "key_name", length = 128, nullable = false)
private String keyName; // 文件的关键key
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getType() {
return this.type;
}
public void setType(String type) {
this.type = type;
}
public String getPath() {
return this.path;
}
public void setPath(String path) {
this.path = path;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public Long getSize() {
return this.size;
}
public void setSize(Long size) {
this.size = size;
}
public String getKeyName() {
return this.keyName;
}
public void setKeyName(String keyName) {
this.keyName = keyName;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ FileInfo: { " +
"'id': '" + getId() + "'" +
", 'type': '" + getType() + "'" +
", 'path': '" + getPath() + "'" +
", 'title': '" + getTitle() + "'" +
", 'size': '" + getSize() + "'" +
", 'keyName': '" + getKeyName() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 机型信息表
*/
@Entity
@Table(name = "model")
public class Model extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "name")
@Size(min = 1, max = 50)
private String name; // 机型名字, 长度大于1小于50, 不为空且唯一
@Column(name = "name_type")
private Integer nameType; // 机型和名字对应的值 0:A320 1:A380 2:A330 3:B737 4:B777 5:C919
@Column(name = "brand")
@Size(min = 1, max = 50)
private String brand; // 飞机制造商 可以为 空中客车 波音 中国商飞
@Column(name = "brand_type")
private Integer brandType; // 飞机制造商和名字对应的值 0:空客; 1:波音; 2:商飞
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public Integer getNameType() {
return this.nameType;
}
public void setNameType(Integer nameType) {
this.nameType = nameType;
}
public String getBrand() {
return this.brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public Integer getBrandType() {
return this.brandType;
}
public void setBrandType(Integer brandType) {
this.brandType = brandType;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ Model: { " +
"'id': '" + getId() + "'" +
", 'name': '" + getName() + "'" +
", 'nameType': '" + getNameType() + "'" +
", 'brand': '" + getBrand() + "'" +
", 'brandType': '" + getBrandType() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 操作记录表
*/
@Entity
@Table(name = "operation_record")
public class OperationRecord extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "login_time")
private Instant loginTime; // 登录时间
@Column(name = "logout_time")
private Instant logoutTime; // 登出时间
@Column(name = "start_time")
private Instant startTime; // 开始时间
@Column(name = "end_time")
private Instant endTime; // 结束时间
@Column(name = "status", nullable = false)
private Integer status; // 是否是最新状态 0 是 1 不是
@Column(name = "ip")
private String ip; // 登录的终端IP
@Column(name = "type")
private Integer type; // 操作的类型 1 考试 0 训练
@Column(name = "card")
private String card; // 用户工号
@Column(name = "username")
private String username; // 用户名字
@Column(name = "exam_id")
private Long examId; // 所属考试的ID 操作类型为考试时此处不为空
@Column(name = "type_name")
private String typeName; // 试卷名字或者课程名字
@Column(name = "score")
private Float score; // 考试成绩
@Column(name = "assessment")
private Integer assessment; // 评定 0 及格 1 不及格 2 通过 3 不通过
@Column(name = "invigilator")
private String invigilator; // 监考人集合
@Column(name = "course_id")
private Long courseId; // 所属课程的ID 操作类型为训练时此处不为空
@ManyToOne
@JoinColumn(name = "area_id")
private Area area;
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Instant getLoginTime() {
return this.loginTime;
}
public void setLoginTime(Instant loginTime) {
this.loginTime = loginTime;
}
public Instant getLogoutTime() {
return this.logoutTime;
}
public void setLogoutTime(Instant logoutTime) {
this.logoutTime = logoutTime;
}
public Instant getStartTime() {
return this.startTime;
}
public void setStartTime(Instant startTime) {
this.startTime = startTime;
}
public Instant getEndTime() {
return this.endTime;
}
public void setEndTime(Instant endTime) {
this.endTime = endTime;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getIp() {
return this.ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public Integer getType() {
return this.type;
}
public void setType(Integer type) {
this.type = type;
}
public String getCard() {
return this.card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public Long getExamId() {
return this.examId;
}
public void setExamId(Long examId) {
this.examId = examId;
}
public String getTypeName() {
return this.typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public Float getScore() {
return this.score;
}
public void setScore(Float score) {
this.score = score;
}
public Integer getAssessment() {
return this.assessment;
}
public void setAssessment(Integer assessment) {
this.assessment = assessment;
}
public String getInvigilator() {
return this.invigilator;
}
public void setInvigilator(String invigilator) {
this.invigilator = invigilator;
}
public Long getCourseId() {
return this.courseId;
}
public void setCourseId(Long courseId) {
this.courseId = courseId;
}
public Area getArea() {
return this.area;
}
public void setArea(Area area) {
this.area = area;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ OperationRecord: { " +
"'id': '" + getId() + "'" +
", 'loginTime': '" + getLoginTime() + "'" +
", 'logoutTime': '" + getLogoutTime() + "'" +
", 'startTime': '" + getStartTime() + "'" +
", 'endTime': '" + getEndTime() + "'" +
", 'status': '" + getStatus() + "'" +
", 'ip': '" + getIp() + "'" +
", 'type': '" + getType() + "'" +
", 'card': '" + getCard() + "'" +
", 'username': '" + getUsername() + "'" +
", 'examId': '" + getExamId() + "'" +
", 'typeName': '" + getTypeName() + "'" +
", 'score': '" + getScore() + "'" +
", 'assessment': '" + getAssessment() + "'" +
", 'invigilator': '" + getInvigilator() + "'" +
", 'courseId': '" + getCourseId() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import cn.com.sailfish.linghang.common.auditor.Auditable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
* @auther lichunjiang
* @description 部门表;
* @date 2019/10/15 08/39
*
*/
@Entity
@Table(name="org_info_form")
public class OrgInfoForm extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
//HR部门号
@Id
private String orgUnitID;
//部门名称
private String orgUnitName;
//部门全称
private String orgUnitFullName;
//机构性质 普通部门、虚拟部门;可空
private String orgUnitRole;
//机构级别 一级机构、二级机构、三级机构、四级机构、五级机构、其他;可空
private String orgUnitLevel;
//机构类型 总部机关部门、驻场单位、分公司、基地、国内营业部、国外办事处、航空子公司、特设机构、其他控股子公司、联营及参股子公司、合营公司;可空
private String orgUnitType;
//业务系统 飞行、客舱、保卫、机关、航务、客运、货运、地服、财务、机务、信息、航服、航食、三产、后保、其他;可空
private String orgUnitAttribute;
//地区分布 行政区划;可空
private String orgUnitGeoZone;
//HR父部门号
private String parentOrgUnitId;
//部门/组织标识 部门/组织
private String hrOrgDeptFlag;
//启用状态 1=未启用,2=已启用,3=已停用
private String enableState;
//排序号
private String displayorder;
//最后更新日期
private String lastUpdatedTime;
public OrgInfoForm() {
}
public OrgInfoForm(String orgUnitID, String orgUnitName, String orgUnitFullName, String orgUnitRole, String orgUnitLevel, String orgUnitType, String orgUnitAttribute, String orgUnitGeoZone, String parentOrgUnitId, String hrOrgDeptFlag, String enableState, String displayorder, String lastUpdatedTime) {
this.orgUnitID = orgUnitID;
this.orgUnitName = orgUnitName;
this.orgUnitFullName = orgUnitFullName;
this.orgUnitRole = orgUnitRole;
this.orgUnitLevel = orgUnitLevel;
this.orgUnitType = orgUnitType;
this.orgUnitAttribute = orgUnitAttribute;
this.orgUnitGeoZone = orgUnitGeoZone;
this.parentOrgUnitId = parentOrgUnitId;
this.hrOrgDeptFlag = hrOrgDeptFlag;
this.enableState = enableState;
this.displayorder = displayorder;
this.lastUpdatedTime = lastUpdatedTime;
}
public String getOrgUnitID() {
return orgUnitID;
}
public void setOrgUnitID(String orgUnitID) {
this.orgUnitID = orgUnitID;
}
public String getOrgUnitName() {
return orgUnitName;
}
public void setOrgUnitName(String orgUnitName) {
this.orgUnitName = orgUnitName;
}
public String getOrgUnitFullName() {
return orgUnitFullName;
}
public void setOrgUnitFullName(String orgUnitFullName) {
this.orgUnitFullName = orgUnitFullName;
}
public String getOrgUnitRole() {
return orgUnitRole;
}
public void setOrgUnitRole(String orgUnitRole) {
this.orgUnitRole = orgUnitRole;
}
public String getOrgUnitLevel() {
return orgUnitLevel;
}
public void setOrgUnitLevel(String orgUnitLevel) {
this.orgUnitLevel = orgUnitLevel;
}
public String getOrgUnitType() {
return orgUnitType;
}
public void setOrgUnitType(String orgUnitType) {
this.orgUnitType = orgUnitType;
}
public String getOrgUnitAttribute() {
return orgUnitAttribute;
}
public void setOrgUnitAttribute(String orgUnitAttribute) {
this.orgUnitAttribute = orgUnitAttribute;
}
public String getOrgUnitGeoZone() {
return orgUnitGeoZone;
}
public void setOrgUnitGeoZone(String orgUnitGeoZone) {
this.orgUnitGeoZone = orgUnitGeoZone;
}
public String getParentOrgUnitId() {
return parentOrgUnitId;
}
public void setParentOrgUnitId(String parentOrgUnitId) {
this.parentOrgUnitId = parentOrgUnitId;
}
public String getHrOrgDeptFlag() {
return hrOrgDeptFlag;
}
public void setHrOrgDeptFlag(String hrOrgDeptFlag) {
this.hrOrgDeptFlag = hrOrgDeptFlag;
}
public String getEnableState() {
return enableState;
}
public void setEnableState(String enableState) {
this.enableState = enableState;
}
public String getDisplayorder() {
return displayorder;
}
public void setDisplayorder(String displayorder) {
this.displayorder = displayorder;
}
public String getLastUpdatedTime() {
return lastUpdatedTime;
}
public void setLastUpdatedTime(String lastUpdatedTime) {
this.lastUpdatedTime = lastUpdatedTime;
}
@Override
public String toString() {
return "OrgInfoResponseDTO{" +
"orgUnitID='" + orgUnitID + '\'' +
", orgUnitName='" + orgUnitName + '\'' +
", orgUnitFullName='" + orgUnitFullName + '\'' +
", orgUnitRole='" + orgUnitRole + '\'' +
", orgUnitLevel='" + orgUnitLevel + '\'' +
", orgUnitType='" + orgUnitType + '\'' +
", orgUnitAttribute='" + orgUnitAttribute + '\'' +
", orgUnitGeoZone='" + orgUnitGeoZone + '\'' +
", parentOrgUnitId='" + parentOrgUnitId + '\'' +
", hrOrgDeptFlag='" + hrOrgDeptFlag + '\'' +
", enableState='" + enableState + '\'' +
", displayorder='" + displayorder + '\'' +
", lastUpdatedTime='" + lastUpdatedTime + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 试卷信息表
*/
@Entity
@Table(name = "question_paper")
public class QuestionPaper extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "import_id")
private Long importId; // 试卷导入表的ID值
@Column(name = "title", length = 50)
private String title; // 试卷标题
@Column(name = "description")
private String description; // 试卷描述
@Column(name = "test_length")
private Integer testLength; // 考试时长,单位是分钟
@Column(name = "type", nullable = false)
private Integer type; // 试卷类型 0:考试卷; 1:练习卷 默认是0
@Column(name = "b_is_parts_of_buoy")
private Boolean bIsPartsOfBuoy; // 是否具有部位浮标功能
@Column(name = "b_is_location_hints")
private Boolean bIsLocationHints; // 是否具有位置提示功能
@Column(name = "b_is_environmental_sound")
private Boolean bIsEnvironmentalSound; // 是否具有环境声效功能
@Column(name = "b_is_operating_hints")
private Boolean bIsOperatingHints; // 是否具有操作提示功能
@Column(name = "b_is_voice_hints")
private Boolean bIsVoiceHints; // 是否具有语音提示功能
@Column(name = "b_is_name_tag")
private Boolean bIsNameTag; // 是否具有名称标签功能
@Column(name = "b_is_graphic_popup_window")
private Boolean bIsGraphicPopupWindow; // 是否具有图文弹窗功能
@Column(name = "b_is_warning_notice")
private Boolean bIsWarningNotice; // 是否具有警示注意功能
@Column(name = "b_is_delete")
private Boolean bIsDelete; // 试卷是否已经在回收站中, 默认是false
@Column(name = "random_abnormals")
private Integer randomAbnormals; // 人为设定的部件异常出现数量
@Column(name = "exception_generate_type", nullable = false)
private Integer exceptionGenerateType; // 异常生成类型 0:随机分布; 1:均匀分布 默认为0
@Column(name = "qualified_quantity")
private Integer qualifiedQuantity; // 特殊项合格所需数量
@Column(name = "score")
private Float score; // 试卷总分
@Column(name = "passing_score")
private Float passingScore; // 及格分数
@ManyToOne
@JoinColumn(name = "author_id")
private User author;
@ManyToOne
@JoinColumn(name = "course_id")
private Course course;
@ManyToOne
@JoinColumn(name = "area_id")
private Area area;
@ManyToOne
@JoinColumn(name = "model_id")
private Model model;
@ManyToOne
@JoinColumn(name = "engine_id")
private Engine engine;
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Long getImportId() {
return this.importId;
}
public void setImportId(Long importId) {
this.importId = importId;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getTestLength() {
return this.testLength;
}
public void setTestLength(Integer testLength) {
this.testLength = testLength;
}
public Integer getType() {
return this.type;
}
public void setType(Integer type) {
this.type = type;
}
public Boolean getBIsPartsOfBuoy() {
return this.bIsPartsOfBuoy;
}
public void setBIsPartsOfBuoy(Boolean bIsPartsOfBuoy) {
this.bIsPartsOfBuoy = bIsPartsOfBuoy;
}
public Boolean getBIsLocationHints() {
return this.bIsLocationHints;
}
public void setBIsLocationHints(Boolean bIsLocationHints) {
this.bIsLocationHints = bIsLocationHints;
}
public Boolean getBIsEnvironmentalSound() {
return this.bIsEnvironmentalSound;
}
public void setBIsEnvironmentalSound(Boolean bIsEnvironmentalSound) {
this.bIsEnvironmentalSound = bIsEnvironmentalSound;
}
public Boolean getBIsOperatingHints() {
return this.bIsOperatingHints;
}
public void setBIsOperatingHints(Boolean bIsOperatingHints) {
this.bIsOperatingHints = bIsOperatingHints;
}
public Boolean getBIsVoiceHints() {
return this.bIsVoiceHints;
}
public void setBIsVoiceHints(Boolean bIsVoiceHints) {
this.bIsVoiceHints = bIsVoiceHints;
}
public Boolean getBIsNameTag() {
return this.bIsNameTag;
}
public void setBIsNameTag(Boolean bIsNameTag) {
this.bIsNameTag = bIsNameTag;
}
public Boolean getBIsGraphicPopupWindow() {
return this.bIsGraphicPopupWindow;
}
public void setBIsGraphicPopupWindow(Boolean bIsGraphicPopupWindow) {
this.bIsGraphicPopupWindow = bIsGraphicPopupWindow;
}
public Boolean getBIsWarningNotice() {
return this.bIsWarningNotice;
}
public void setBIsWarningNotice(Boolean bIsWarningNotice) {
this.bIsWarningNotice = bIsWarningNotice;
}
public Boolean getBIsDelete() {
return this.bIsDelete;
}
public void setBIsDelete(Boolean bIsDelete) {
this.bIsDelete = bIsDelete;
}
public Integer getRandomAbnormals() {
return this.randomAbnormals;
}
public void setRandomAbnormals(Integer randomAbnormals) {
this.randomAbnormals = randomAbnormals;
}
public Integer getExceptionGenerateType() {
return this.exceptionGenerateType;
}
public void setExceptionGenerateType(Integer exceptionGenerateType) {
this.exceptionGenerateType = exceptionGenerateType;
}
public Integer getQualifiedQuantity() {
return this.qualifiedQuantity;
}
public void setQualifiedQuantity(Integer qualifiedQuantity) {
this.qualifiedQuantity = qualifiedQuantity;
}
public Float getScore() {
return this.score;
}
public void setScore(Float score) {
this.score = score;
}
public Float getPassingScore() {
return this.passingScore;
}
public void setPassingScore(Float passingScore) {
this.passingScore = passingScore;
}
public User getAuthor() {
return this.author;
}
public void setAuthor(User author) {
this.author = author;
}
public Course getCourse() {
return this.course;
}
public void setCourse(Course course) {
this.course = course;
}
public Area getArea() {
return this.area;
}
public void setArea(Area area) {
this.area = area;
}
public Model getModel() {
return this.model;
}
public void setModel(Model model) {
this.model = model;
}
public Engine getEngine() {
return this.engine;
}
public void setEngine(Engine engine) {
this.engine = engine;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ QuestionPaper: { " +
"'id': '" + getId() + "'" +
", 'importId': '" + getImportId() + "'" +
", 'title': '" + getTitle() + "'" +
", 'description': '" + getDescription() + "'" +
", 'testLength': '" + getTestLength() + "'" +
", 'type': '" + getType() + "'" +
", 'bIsPartsOfBuoy': '" + getBIsPartsOfBuoy() + "'" +
", 'bIsLocationHints': '" + getBIsLocationHints() + "'" +
", 'bIsEnvironmentalSound': '" + getBIsEnvironmentalSound() + "'" +
", 'bIsOperatingHints': '" + getBIsOperatingHints() + "'" +
", 'bIsVoiceHints': '" + getBIsVoiceHints() + "'" +
", 'bIsNameTag': '" + getBIsNameTag() + "'" +
", 'bIsGraphicPopupWindow': '" + getBIsGraphicPopupWindow() + "'" +
", 'bIsWarningNotice': '" + getBIsWarningNotice() + "'" +
", 'bIsDelete': '" + getBIsDelete() + "'" +
", 'randomAbnormals': '" + getRandomAbnormals() + "'" +
", 'exceptionGenerateType': '" + getExceptionGenerateType() + "'" +
", 'qualifiedQuantity': '" + getQualifiedQuantity() + "'" +
", 'score': '" + getScore() + "'" +
", 'passingScore': '" + getPassingScore() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 成绩单
*/
@Entity
@Table(name = "report_card")
public class ReportCard extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "score")
private Float score; // 分数
@Column(name = "card")
private String card; // 考试的用户的卡号
@Column(name = "username")
private String username; // 考试的用户的名字
@Column(name = "assessment")
private Integer assessment; // 评定 0 及格 1 不及格 2 通过 3 不通过
@Column(name = "remarks")
private String remarks; // 备注
@Column(name = "completion_status", nullable = false)
private Integer completionStatus; // 考试完成状态 0 完成 1 未完成
@Column(name = "switch_status", nullable = false)
private Integer switchStatus; // 考试开启状态 0 开启 1 关闭
@Column(name = "exam_time")
private Instant examTime; // 参加考试的时间
@Column(name = "b_is_delete")
private Boolean bIsDelete; // 是否已经在回收站中, 默认是false
@ManyToOne
@JoinColumn(name = "question_paper_id")
private QuestionPaper questionPaper;
@ManyToOne
@JoinColumn(name = "exam_id")
private Exam exam;
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Float getScore() {
return this.score;
}
public void setScore(Float score) {
this.score = score;
}
public String getCard() {
return this.card;
}
public void setCard(String card) {
this.card = card;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getAssessment() {
return this.assessment;
}
public void setAssessment(Integer assessment) {
this.assessment = assessment;
}
public String getRemarks() {
return this.remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Integer getCompletionStatus() {
return this.completionStatus;
}
public void setCompletionStatus(Integer completionStatus) {
this.completionStatus = completionStatus;
}
public Integer getSwitchStatus() {
return this.switchStatus;
}
public void setSwitchStatus(Integer switchStatus) {
this.switchStatus = switchStatus;
}
public Instant getExamTime() {
return this.examTime;
}
public void setExamTime(Instant examTime) {
this.examTime = examTime;
}
public Boolean getBIsDelete() {
return this.bIsDelete;
}
public void setBIsDelete(Boolean bIsDelete) {
this.bIsDelete = bIsDelete;
}
public QuestionPaper getQuestionPaper() {
return this.questionPaper;
}
public void setQuestionPaper(QuestionPaper questionPaper) {
this.questionPaper = questionPaper;
}
public Exam getExam() {
return this.exam;
}
public void setExam(Exam exam) {
this.exam = exam;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ ReportCard: { " +
"'id': '" + getId() + "'" +
", 'score': '" + getScore() + "'" +
", 'card': '" + getCard() + "'" +
", 'username': '" + getUsername() + "'" +
", 'assessment': '" + getAssessment() + "'" +
", 'remarks': '" + getRemarks() + "'" +
", 'completionStatus': '" + getCompletionStatus() + "'" +
", 'switchStatus': '" + getSwitchStatus() + "'" +
", 'examTime': '" + getExamTime() + "'" +
", 'bIsDelete': '" + getBIsDelete() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 成绩详情
*/
@Entity
@Table(name = "report_card_details")
public class ReportCardDetails extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "special")
private Integer special; // 是否为特殊题目 默认为否,0:否; 1:是
@Column(name = "answer")
private Integer answer; // 代表选项的对错 0 代表错,1代表对
@Column(name = "choice")
private String choice; // 代表的是哪个成绩单的哪个项的选择
@ManyToOne
@JoinColumn(name = "report_card_id")
private ReportCard reportCard;
@ManyToOne
@JoinColumn(name = "check_item_id")
private CheckItem checkItem;
@ManyToOne
@JoinColumn(name = "exception_message_id")
private ExceptionItem exceptionItem;
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getSpecial() {
return this.special;
}
public void setSpecial(Integer special) {
this.special = special;
}
public Integer getAnswer() {
return this.answer;
}
public void setAnswer(Integer answer) {
this.answer = answer;
}
public String getChoice() {
return this.choice;
}
public void setChoice(String choice) {
this.choice = choice;
}
public ReportCard getReportCard() {
return this.reportCard;
}
public void setReportCard(ReportCard reportCard) {
this.reportCard = reportCard;
}
public CheckItem getCheckItem() {
return this.checkItem;
}
public void setCheckItem(CheckItem checkItem) {
this.checkItem = checkItem;
}
public ExceptionItem getExceptionItem() {
return this.exceptionItem;
}
public void setExceptionItem(ExceptionItem exceptionItem) {
this.exceptionItem = exceptionItem;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ ReportCardDetails: { " +
"'id': '" + getId() + "'" +
", 'special': '" + getSpecial() + "'" +
", 'answer': '" + getAnswer() + "'" +
", 'choice': '" + getChoice() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 试卷异常项记录表
*/
@Entity
@Table(name = "test_abnormal_item_info")
public class TestAbnormalItemInfo extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "special")
private Integer special; // 是否为特殊题目 默认为否,0:否; 1:是
@ManyToOne
@JoinColumn(name = "question_paper_id")
private QuestionPaper questionPaper;
@ManyToOne
@JoinColumn(name = "course_id")
private Course course;
@ManyToOne
@JoinColumn(name = "exception_item_id")
private ExceptionItem exceptionItem;
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getSpecial() {
return this.special;
}
public void setSpecial(Integer special) {
this.special = special;
}
public QuestionPaper getQuestionPaper() {
return this.questionPaper;
}
public void setQuestionPaper(QuestionPaper questionPaper) {
this.questionPaper = questionPaper;
}
public Course getCourse() {
return this.course;
}
public void setCourse(Course course) {
this.course = course;
}
public ExceptionItem getExceptionItem() {
return this.exceptionItem;
}
public void setExceptionItem(ExceptionItem exceptionItem) {
this.exceptionItem = exceptionItem;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ TestAbnormalItemInfo: { " +
"'id': '" + getId() + "'" +
", 'special': '" + getSpecial() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;
import java.util.List;
import cn.com.sailfish.linghang.common.auditor.Auditable;
/**
* @author: AutoCoder (maintained by newma<newma@live.cn>)
* @create: 2019-07-11 11:19:25
*/
/**
* 用户信息表
*/
@Entity
@Table(name = "user")
public class User extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "username", nullable = false)
@Size(min = 1, max = 50)
private String username; // 用户名 长度在1到50个字符串之间,不为空,允许重复
@Column(name = "password", nullable = false)
private String password; // 密码, 长度255, 不为空
@Column(name = "card")
@Size(min = 6, max = 18)
private String card; // 用户工号,长度在6到18之间,不为空且唯一
@Column(name = "user_image")
private String userImage; // 用户头像
@Column(name = "gender")
private Integer gender; // 性别 0:女; 1:男
@Column(name = "mobile_phone", length = 11)
private String mobilePhone; // 用户的手机号码, 长度是11,手机号码不为空且唯一
@Column(name = "type")
private Integer type; // 用户类型 0 代表学员 1 代表教员
@Column(name = "class_type")
private String classType; // 班别 0初训 1复训
@Column(name = "remarks")
private String remarks; // 备注
@Column(name = "email")
@Size(min = 0, max = 50)
private String email; // 用户的邮箱, 长度是50,唯一, 允许为空
@Column(name = "last_login_ip")
@Size(min = 0, max = 20)
private String lastLoginIp; // 上次登录的IP, 允许为空
@Column(name = "last_login_time")
private Instant lastLoginTime; // 上次登录的时间
@Column(name = "b_is_test_queue", nullable = false)
private Boolean bIsTestQueue; // 是否在考试队列中 true 代表在 false代表不在
@Column(name = "b_is_new_add_test_queue", nullable = false)
private Boolean bIsNewAddTestQueue; // 是否是新添加到考试队列 true 代表是 false代表不是
@Column(name = "status", nullable = false)
private Integer status; // 用户当前状态:0 训练 1 考试 2 离线 3 在线,默认值为2
@Column(name = "activation", nullable = false)
private Boolean activation; // 用户激活状态:true 激活 false 未激活(回收站), 默认值为true
@Column(name = "authority", nullable = false)
private Integer authority; // 用户的权限:1 开发者权限 2 超级管理员 4 机构管理员 8 教员 16 普通用户, 默认值是16
@Column(name = "invigilator_message")
private String invigilatorMessage; // 最近指定的监考员信息
@Column(name = "queue_name")
private String queueName; // 登录的VR设备的队列名
@Column(name = "enable", nullable = false)
private Boolean enable; // 用户是否启用权限:true 启用 false 不启用, 默认值为true
@ManyToOne
@JoinColumn(name = "leader_id")
private User leader;
@ManyToOne
@JoinColumn(name = "area_id")
private Area area;
// getter and setter
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
public String getCard() {
return this.card;
}
public void setCard(String card) {
this.card = card;
}
public String getUserImage() {
return this.userImage;
}
public void setUserImage(String userImage) {
this.userImage = userImage;
}
public Integer getGender() {
return this.gender;
}
public void setGender(Integer gender) {
this.gender = gender;
}
public String getMobilePhone() {
return this.mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
public Integer getType() {
return this.type;
}
public void setType(Integer type) {
this.type = type;
}
public String getClassType() {
return this.classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public String getRemarks() {
return this.remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public String getLastLoginIp() {
return this.lastLoginIp;
}
public void setLastLoginIp(String lastLoginIp) {
this.lastLoginIp = lastLoginIp;
}
public Instant getLastLoginTime() {
return this.lastLoginTime;
}
public void setLastLoginTime(Instant lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
public Boolean getBIsTestQueue() {
return this.bIsTestQueue;
}
public void setBIsTestQueue(Boolean bIsTestQueue) {
this.bIsTestQueue = bIsTestQueue;
}
public Boolean getBIsNewAddTestQueue() {
return this.bIsNewAddTestQueue;
}
public void setBIsNewAddTestQueue(Boolean bIsNewAddTestQueue) {
this.bIsNewAddTestQueue = bIsNewAddTestQueue;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Boolean getActivation() {
return this.activation;
}
public void setActivation(Boolean activation) {
this.activation = activation;
}
public Integer getAuthority() {
return this.authority;
}
public void setAuthority(Integer authority) {
this.authority = authority;
}
public String getInvigilatorMessage() {
return this.invigilatorMessage;
}
public void setInvigilatorMessage(String invigilatorMessage) {
this.invigilatorMessage = invigilatorMessage;
}
public String getQueueName() {
return this.queueName;
}
public void setQueueName(String queueName) {
this.queueName = queueName;
}
public Boolean getEnable() {
return this.enable;
}
public void setEnable(Boolean enable) {
this.enable = enable;
}
public User getLeader() {
return this.leader;
}
public void setLeader(User leader) {
this.leader = leader;
}
public Area getArea() {
return this.area;
}
public void setArea(Area area) {
this.area = area;
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "{ User: { " +
"'id': '" + getId() + "'" +
", 'username': '" + getUsername() + "'" +
", 'password': '" + getPassword() + "'" +
", 'card': '" + getCard() + "'" +
", 'userImage': '" + getUserImage() + "'" +
", 'gender': '" + getGender() + "'" +
", 'mobilePhone': '" + getMobilePhone() + "'" +
", 'type': '" + getType() + "'" +
", 'classType': '" + getClassType() + "'" +
", 'remarks': '" + getRemarks() + "'" +
", 'email': '" + getEmail() + "'" +
", 'lastLoginIp': '" + getLastLoginIp() + "'" +
", 'lastLoginTime': '" + getLastLoginTime() + "'" +
", 'bIsTestQueue': '" + getBIsTestQueue() + "'" +
", 'bIsNewAddTestQueue': '" + getBIsNewAddTestQueue() + "'" +
", 'status': '" + getStatus() + "'" +
", 'activation': '" + getActivation() + "'" +
", 'authority': '" + getAuthority() + "'" +
", 'invigilatorMessage': '" + getInvigilatorMessage() + "'" +
", 'queueName': '" + getQueueName() + "'" +
", 'enable': '" + getEnable() + "'" +
" }}";
}
}
package cn.com.sailfish.linghang.domain;
import cn.com.sailfish.linghang.common.auditor.Auditable;
import com.google.common.annotations.VisibleForTesting;
import javax.persistence.*;
import java.io.Serializable;
/**
* @author lichunjiang
* @descripttion 南航HR系统返回信息;
* @create At 2019/10/15 10/09
*
*/
@Entity
@Table(name = "user_info_form")
public class UserInfoForm extends Auditable implements Serializable {
private static final long serialVersionUID = 1L;
//工作号
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "empid")
private String empid;
//姓名
@Column(name="personName")
private String personName;
//性别
@Column(name="gender")
private String gender;
//证件类型
@Column(name="idType")
private String idType;
//证件号码
@Column(name="identityNum")
private String identityNum;
//出生日期
@Column(name="birthDate")
private String birthDate;
//国籍
@Column(name="nationality")
private String nationality;
//民族
@Column(name="nation")
private String nation;
//出生地
@Column(name="birthPlace")
private String birthPlace;
//籍贯
@Column(name="nativePlace")
private String nativePlace;
//户籍地
@Column(name="residence")
private String residence;
//户口性质
@Column(name="typeOfResidence")
private String typeOfResidence;
//学历
@Column(name="educationLevel")
private String educationLevel;
//学位
@Column(name="educationDegree")
private String educationDegree;
//政治面貌
@Column(name="politicalStand")
private String politicalStand;
//婚姻状况
@Column(name="marrigeStatus")
private String marrigeStatus;
//HR部门号
@Column(name="orgUnitId")
private String orgUnitId;
//岗位ID
@Column(name="postCode")
private String postCode;
//岗位名称
@Column(name="position")
private String position;
//职称资格
@Column(name="qualifyTitle")
private String qualifyTitle;
//职务级别编码
@Column(name="rankCode")
private String rankCode;
//职务级别
@Column(name="appointRank")
private String appointRank;
//职业分类
@Column(name="occupation")
private String occupation;
//参加工作时间
@Column(name="dateOfWork")
private String dateOfWork;
//进入南航时间
@Column(name="dateOfHire")
private String dateOfHire;
//用工类别
@Column(name="statusType")
private String statusType;
//人员类别
@Column(name="personType")
private String personType;
//在岗状态
@Column(name="activeStatus")
private String activeStatus;
//手机号
@Column(name="mobile")
private String mobile;
//邮箱
@Column(name="o_EmailAddress")
private String o_EmailAddress;
//办公电话
@Column(name="o_Telephone")
private String o_Telephone;
//最后更新时间
@Column(name="lastUpdatedTime")
private String lastUpdatedTime;
public UserInfoForm() {
}
public UserInfoForm(String empid, String personName, String gender, String idType, String identityNum, String birthDate, String nationality, String nation, String birthPlace, String nativePlace, String residence, String typeOfResidence, String educationLevel, String educationDegree, String politicalStand, String marrigeStatus, String orgUnitId, String postCode, String position, String qualifyTitle, String rankCode, String appointRank, String occupation, String dateOfWork, String dateOfHire, String statusType, String personType, String activeStatus, String mobile, String o_EmailAddress, String o_Telephone, String lastUpdatedTime) {
this.empid = empid;
this.personName = personName;
this.gender = gender;
this.idType = idType;
this.identityNum = identityNum;
this.birthDate = birthDate;
this.nationality = nationality;
this.nation = nation;
this.birthPlace = birthPlace;
this.nativePlace = nativePlace;
this.residence = residence;
this.typeOfResidence = typeOfResidence;
this.educationLevel = educationLevel;
this.educationDegree = educationDegree;
this.politicalStand = politicalStand;
this.marrigeStatus = marrigeStatus;
this.orgUnitId = orgUnitId;
this.postCode = postCode;
this.position = position;
this.qualifyTitle = qualifyTitle;
this.rankCode = rankCode;
this.appointRank = appointRank;
this.occupation = occupation;
this.dateOfWork = dateOfWork;
this.dateOfHire = dateOfHire;
this.statusType = statusType;
this.personType = personType;
this.activeStatus = activeStatus;
this.mobile = mobile;
this.o_EmailAddress = o_EmailAddress;
this.o_Telephone = o_Telephone;
this.lastUpdatedTime = lastUpdatedTime;
}
public String getEmpid() {
return empid;
}
public void setEmpid(String empid) {
this.empid = empid;
}
public String getPersonName() {
return personName;
}
public void setPersonName(String personName) {
this.personName = personName;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getIdType() {
return idType;
}
public void setIdType(String idType) {
this.idType = idType;
}
public String getIdentityNum() {
return identityNum;
}
public void setIdentityNum(String identityNum) {
this.identityNum = identityNum;
}
public String getBirthDate() {
return birthDate;
}
public void setBirthDate(String birthDate) {
this.birthDate = birthDate;
}
public String getNationality() {
return nationality;
}
public void setNationality(String nationality) {
this.nationality = nationality;
}
public String getNation() {
return nation;
}
public void setNation(String nation) {
this.nation = nation;
}
public String getBirthPlace() {
return birthPlace;
}
public void setBirthPlace(String birthPlace) {
this.birthPlace = birthPlace;
}
public String getNativePlace() {
return nativePlace;
}
public void setNativePlace(String nativePlace) {
this.nativePlace = nativePlace;
}
public String getResidence() {
return residence;
}
public void setResidence(String residence) {
this.residence = residence;
}
public String getTypeOfResidence() {
return typeOfResidence;
}
public void setTypeOfResidence(String typeOfResidence) {
this.typeOfResidence = typeOfResidence;
}
public String getEducationLevel() {
return educationLevel;
}
public void setEducationLevel(String educationLevel) {
this.educationLevel = educationLevel;
}
public String getEducationDegree() {
return educationDegree;
}
public void setEducationDegree(String educationDegree) {
this.educationDegree = educationDegree;
}
public String getPoliticalStand() {
return politicalStand;
}
public void setPoliticalStand(String politicalStand) {
this.politicalStand = politicalStand;
}
public String getMarrigeStatus() {
return marrigeStatus;
}
public void setMarrigeStatus(String marrigeStatus) {
this.marrigeStatus = marrigeStatus;
}
public String getOrgUnitId() {
return orgUnitId;
}
public void setOrgUnitId(String orgUnitId) {
this.orgUnitId = orgUnitId;
}
public String getPostCode() {
return postCode;
}
public void setPostCode(String postCode) {
this.postCode = postCode;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public String getQualifyTitle() {
return qualifyTitle;
}
public void setQualifyTitle(String qualifyTitle) {
this.qualifyTitle = qualifyTitle;
}
public String getRankCode() {
return rankCode;
}
public void setRankCode(String rankCode) {
this.rankCode = rankCode;
}
public String getAppointRank() {
return appointRank;
}
public void setAppointRank(String appointRank) {
this.appointRank = appointRank;
}
public String getOccupation() {
return occupation;
}
public void setOccupation(String occupation) {
this.occupation = occupation;
}
public String getDateOfWork() {
return dateOfWork;
}
public void setDateOfWork(String dateOfWork) {
this.dateOfWork = dateOfWork;
}
public String getDateOfHire() {
return dateOfHire;
}
public void setDateOfHire(String dateOfHire) {
this.dateOfHire = dateOfHire;
}
public String getStatusType() {
return statusType;
}
public void setStatusType(String statusType) {
this.statusType = statusType;
}
public String getPersonType() {
return personType;
}
public void setPersonType(String personType) {
this.personType = personType;
}
public String getActiveStatus() {
return activeStatus;
}
public void setActiveStatus(String activeStatus) {
this.activeStatus = activeStatus;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getO_EmailAddress() {
return o_EmailAddress;
}
public void setO_EmailAddress(String o_EmailAddress) {
this.o_EmailAddress = o_EmailAddress;
}
public String getO_Telephone() {
return o_Telephone;
}
public void setO_Telephone(String o_Telephone) {
this.o_Telephone = o_Telephone;
}
public String getLastUpdatedTime() {
return lastUpdatedTime;
}
public void setLastUpdatedTime(String lastUpdatedTime) {
this.lastUpdatedTime = lastUpdatedTime;
}
@Override
public String toString() {
return "UserInfoResponseDTO{" +
"empid='" + empid + '\'' +
", personName='" + personName + '\'' +
", gender='" + gender + '\'' +
", idType='" + idType + '\'' +
", identityNum='" + identityNum + '\'' +
", birthDate='" + birthDate + '\'' +
", nationality='" + nationality + '\'' +
", nation='" + nation + '\'' +
", birthPlace='" + birthPlace + '\'' +
", nativePlace='" + nativePlace + '\'' +
", residence='" + residence + '\'' +
", typeOfResidence='" + typeOfResidence + '\'' +
", educationLevel='" + educationLevel + '\'' +
", educationDegree='" + educationDegree + '\'' +
", politicalStand='" + politicalStand + '\'' +
", marrigeStatus='" + marrigeStatus + '\'' +
", orgUnitId='" + orgUnitId + '\'' +
", postCode='" + postCode + '\'' +
", position='" + position + '\'' +
", qualifyTitle='" + qualifyTitle + '\'' +
", rankCode='" + rankCode + '\'' +
", appointRank='" + appointRank + '\'' +
", occupation='" + occupation + '\'' +
", dateOfWork='" + dateOfWork + '\'' +
", dateOfHire='" + dateOfHire + '\'' +
", statusType='" + statusType + '\'' +
", personType='" + personType + '\'' +
", activeStatus='" + activeStatus + '\'' +
", mobile='" + mobile + '\'' +
", o_EmailAddress='" + o_EmailAddress + '\'' +
", o_Telephone='" + o_Telephone + '\'' +
", lastUpdatedTime='" + lastUpdatedTime + '\'' +
'}';
}
}
package cn.com.sailfish.linghang.enumeration;
/**
* Author: huangpeilin
* Create at: 2019-04-24 10:13:32
* Description: 存储全局变量类
*
* @author huangpeilin
*/
public class Constants {
/**
* 排序字段 创建时间
*/
public final static String GMT_CREATED = "gmtCreated";
/**
* 排序字段 修改时间
*/
public final static String GMT_MODIFIED = "gmtModified";
/**
* 排序字段 用户工号
*/
public final static String CARD = "card";
/**
* 排序方式 用户工号 - 1
*/
public final static Integer CARD_INT = 1;
/**
* 排序字段 成绩
*/
public final static String SCORE = "score";
/**
* 排序方式 成绩 - 0
*/
public final static Integer SCORE_INT = 0;
/**
* 公共部门的职位
*/
public final static Integer COMMON_AREA_POSITION = 2;
/**
* 公共乘务区域的ID
*/
public final static Long COMMON_FLIGHT_AREA_ID = 1L;
/**
* 公共机务区域的ID
*/
public final static Long COMMON_LOCOMOTIVE_AREA_ID = 2L;
/**
* 公共部门的ID
*/
public final static Long COMMON_PUBLIC_AREA_ID = 4L;
}
package cn.com.sailfish.linghang.enumeration;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-06-04 14:25:47
* Description:
*/
public class CourseInfoConstant {
/**
* 课程导入表中的ID
*/
public static final int ID = 0;
/**
* 课程导入表中的姓名
*/
public static final int NAME = 1;
/**
* 课程导入表中的中文姓名
*/
public static final int CHINESE_NAME = 2;
/**
* 课程导入表中的职位 0:乘务; 1:机务
*/
public static final int DIVISION = 3;
/**
* 课程导入表中的飞机制造商 0:空客; 1:波音; 2:商飞
*/
public static final int AIR_FRAMER = 4;
/**
* 课程导入表中的机型 0:A320, 1:A380
*/
public static final int PLANE_MODEL = 5;
/**
* 课程导入表中的发动机类型 0:非发动机; 1:V2500; 2:CFM56; 3:PW1100
*/
public static final int ENGINE_TYPE = 6;
/**
* 课程导入表中的检查项
*/
public static final int CHECK_ITEM = 7;
/**
* 课程导入表中的异常项
*/
public static final int EXCEPTION_ITEM = 8;
}
package cn.com.sailfish.linghang.enumeration;
/**
* Author: huangpeilin
* Create at: 2019-04-26 18:59:32
* Description:
*
* @author huangpeilin
*/
public class ExamConstant {
/**
* 监考人的最大个数
*/
public static final int MAX = 2;
/**
* 指定考试的时候重复考试的试卷新增
*/
public static final int TYPE_CREATE = 0;
/**
* 指定考试的时候重复考试的试卷覆盖
*/
public static final int TYPE_UPDATE = 1;
/**
* 考试开启的状态
*/
public static final int SWITCH_STATUS_START = 0;
/**
* 考试关闭的状态
*/
public static final int SWITCH_STATUS_CLOSE = 1;
/**
* 考试完成的状态
*/
public static final int COMPLETION_STATUS_FINISHED = 0;
/**
* 考试未完成的状态
*/
public static final int COMPLETION_STATUS_UNFINISHED = 1;
/**
* 评定 1 及格
*/
public final static int ASSESSMENT_TYPE_PASS = 1;
/**
* 评定 2 不及格
*/
public final static int ASSESSMENT_TYPE_NO_PASS = 2;
/**
* 评定 4 通过
*/
public final static int ASSESSMENT_TYPE_GO = 4;
/**
* 评定 8 不通过
*/
public final static int ASSESSMENT_TYPE_NOT_GO = 8;
/**
* 评定通过
*/
public final static String ASSESSMENT_GO = "通过";
/**
* 评定不通过
*/
public final static String ASSESSMENT_NOT_GO = "不通过";
/**
* 回答题目的类型 - 检查项
*/
public final static int ANSWER_TYPE_CHECK_ITEM = 0;
/**
* 回答题目的类型 - 异常项
*/
public final static int ANSWER_TYPE_EXCEPTION_ITEM = 1;
}
package cn.com.sailfish.linghang.enumeration;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-06-03 15:38:42
* Description:
*/
public class ItemInfoConstant {
/**
* 检查项导入表中的ID
*/
public static final int ID = 0;
/**
* 检查项导入表中的姓名
*/
public static final int NAME = 1;
/**
* 检查项导入表中的中文姓名
*/
public static final int CHINESE_NAME = 2;
/**
* 检查项导入表中的区域
*/
public static final int REGION = 3;
/**
* 检查项导入表中的机型
*/
public static final int PLANE_MODEL = 4;
/**
* 检查项导入表中的发动机类型
*/
public static final int ENGINE_TYPE = 5;
}
package cn.com.sailfish.linghang.enumeration;
/**
* Author: huangpeilin
* Create at: 2019-05-05 14:21:06
* Description:
*
* @author huangpeilin
*/
public class OperationRecordConstant {
/**
* 操作的类型 - 考试
*/
public static final int OPERATION_RECORD_TYPE_EXAM = 1;
/**
* 操作的类型 - 训练
*/
public static final int OPERATION_RECORD_TYPE_EXERCISE = 0;
/**
* 操作是否是最新的 - 是
*/
public static final Integer OPERATION_RECORD_STATUS_IS_NEWEST = 0;
/**
* 操作是否是最新的 - 不是
*/
public static final Integer OPERATION_RECORD_STATUS_IS_NOT_NEWEST = 1;
/**
* 导出考试(训练)记录的用户工号
*/
public final static int OPERATION_RECORD_USER_CARD = 0;
/**
* 导出考试(训练)记录的用户名字
*/
public final static int OPERATION_RECORD_USERNAME = 1;
/**
* 导出考试(训练)记录的用户的最近登录时间
*/
public final static int OPERATION_RECORD_LAST_LOGIN_TIME = 2;
/**
* 导出考试(训练)记录的用户的最近登录的登录时长
*/
public final static int OPERATION_RECORD_LOGIN_TIME = 3;
/**
* 导出考试(训练)记录的用户最近的考试(训练)
*/
public final static int OPERATION_RECORD_TITLE = 4;
/**
* 导出训练操作记录详情的登入时间
*/
public final static int PERSON_TRAIN_OPERATION_RECORD_LOGIN_TIME = 0;
/**
* 导出训练操作记录详情的登出时间
*/
public final static int PERSON_TRAIN_OPERATION_RECORD_LOGOUT_TIME = 1;
/**
* 导出训练操作记录详情的课程名字
*/
public final static int PERSON_TRAIN_OPERATION_RECORD_COURSE_NAME = 2;
/**
* 导出考试操作记录详情的登入时间
*/
public final static int PERSON_EXAM_OPERATION_RECORD_LOGIN_TIME = 0;
/**
* 导出考试操作记录详情的登出时间
*/
public final static int PERSON_EXAM_OPERATION_RECORD_LOGOUT_TIME = 1;
/**
* 导出考试操作记录详情的试卷名字
*/
public final static int PERSON_EXAM_OPERATION_RECORD_QUESTION_PAPER_NAME = 2;
/**
* 导出考试操作记录详情的用户分数
*/
public final static int PERSON_EXAM_OPERATION_RECORD_SCORE = 3;
/**
* 导出考试操作记录详情的用户评定
*/
public final static int PERSON_EXAM_OPERATION_RECORD_ASSESSMENT = 4;
}
package cn.com.sailfish.linghang.enumeration;
/**
* Author: huangpeilin
* Create at: 2019-04-25 15:31:55
* Description:
*
* @author huangpeilin
*/
public class QuestionPaperConstant {
/**
* 异常分布类型 - 随机分布
*/
public static final Integer RANDOM_DISTRIBUTION = 0;
/**
* 异常分布类型 - 均匀分布
*/
public static final Integer UNIFORM_DISTRIBUTION = 1;
/**
* 试卷的总分 - 100
*/
public static final Float SCORE = 100.00f;
/**
* 试卷的及格分数 - 70
*/
public static final Float PASSING_SCORE = 70.00f;
/**
* 试卷的类型 - 训练
*/
public static final Integer QUESTION_PAPER_TYPE_EXERCISE = 0;
/**
* 试卷的类型 - 考试
*/
public static final Integer QUESTION_PAPER_TYPE_EXAM = 1;
/**
* 异常项不是特殊项
*/
public static final Integer EXCEPTION_ITEM_IS_NOT_SPECIAL_ITEM = 0;
/**
* 异常项是特殊项
*/
public static final Integer EXCEPTION_ITEM_IS_SPECIAL_ITEM = 1;
/**
* 试卷导入表中的导入ID
*/
public static final int IMPORT_ID = 0;
/**
* 试卷导入表中的名字
*/
public static final int NAME = 1;
/**
* 试卷导入表中的描述
*/
public static final int DESC = 2;
/**
* 试卷导入表中的创建时间
*/
public static final int CREATED = 3;
/**
* 试卷导入表中的作者
*/
public static final int AUTHOR_ID = 4;
/**
* 试卷导入表中的试卷类型
*/
public static final int PAPER_TYPE = 5;
/**
* 试卷导入表中的课程导入ID
*/
public static final int COURSE_ID = 6;
/**
* 试卷导入表中的异常总数
*/
public static final int TOTAL_ABNORMAL = 7;
/**
* 试卷导入表中人为设定的部件异常出现数量
*/
public static final int RANDOM_ABNORMAL = 8;
/**
* 试卷导入表中的异常生成类型 0:随机分布; 1:均匀分布
*/
public static final int ABNORMAL_GENERATE_TYPE = 9;
/**
* 试卷导入表中考试时长
*/
public static final int EXAM_TIME_SPAN = 10;
/**
* 试卷导入表中的试卷总分
*/
public static final int QUESTION_PAPER_SCORE = 11;
/**
* 试卷导入表中的试卷通过分数
*/
public static final int QUESTION_PAPER_PASSING_SCORE = 12;
}
package cn.com.sailfish.linghang.enumeration;
/**
* Author: huangpeilin
* Create at: 2019-05-07 14:23:03
* Description:
*
* @author huangpeilin
*/
public class RabbitmqMessageConstant {
/**
* 开始考试
*/
public final static String EXAM_START = "EXAM_START";
/**
*
* 结束考试
*/
public final static String EXAM_END = "EXAM_END";
/**
* 在其他设备登录
*/
public final static String LOGIN_BY_ANOTHER_DEVICE = "LOGIN_BY_ANOTHER_DEVICE";
}
package cn.com.sailfish.linghang.enumeration;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-06-11 16:17:39
* Description:
*/
public class ReportCardInfoConstant {
/**
* 导出个人成绩单的考试时间
*/
public static final int PERSON_EXAM_TIME = 0;
/**
* 导出个人成绩单的试卷名字
*/
public static final int PERSON_QUESTION_PAPER_NAME = 1;
/**
* 导出个人成绩单的班别
*/
public static final int PERSON_CLASS_TYPE = 2;
/**
* 导出个人成绩单的监考人
*/
public static final int PERSON_INVIGILATOR = 3;
/**
* 导出个人成绩单的分数
*/
public static final int PERSON_SCORE = 4;
/**
* 导出个人成绩单的评定
*/
public static final int PERSON_ASSESSMENT = 5;
/**
* 导出班级成绩单的名次
*/
public final static int CLASS_REPORT_CARD_RANKING = 0;
/**
* 导出班级成绩单的用户工号
*/
public final static int CLASS_REPORT_CARD_USERCARD = 1;
/**
* 导出班级成绩单的用户名
*/
public final static int CLASS_REPORT_CARD_USERNAME = 2;
/**
* 导出班级成绩单的用户的公司部门
*/
public final static int CLASS_REPORT_CARD_ORGANIZATION = 3;
/**
* 导出班级成绩单的用户职位
*/
public final static int CLASS_REPORT_CARD_USER_POSITION = 4;
/**
* 导出班级成绩单的用户分数
*/
public final static int CLASS_REPORT_CARD_USER_SCORE = 5;
/**
* 导出班级成绩单的用户评定
*/
public final static int CLASS_REPORT_CARD_ASSESSMENT = 6;
}
package cn.com.sailfish.linghang.enumeration;
import cn.com.sailfish.linghang.dao.UserLoginStatus;
import java.util.HashMap;
import java.util.Map;
/**
* Author: huangpeilin
* Create at: 2019-04-23 11:05:19
* Description:
*
* @author huangpeilin
*/
public class UserInfoConstant {
/**
* 乘务 INT
*/
public static final Integer FLIGHT_INT = 0;
/**
* 机务 INT
*/
public static final Integer LOCOMOTIVE_INT = 1;
/**
* 公共区域 INT
*/
public static final Integer PUBLIC_SECTOR_INT = 2;
/**
* 公共区域 INT
*/
public static final Integer PUBLIC_INT = 3;
/**
* 乘务
*/
public static final String FLIGHT = "乘务";
/**
* 机务
*/
public static final String LOCOMOTIVE = "机务";
/**
* 公共区域
*/
public static final String PUBLIC = "公共区域";
/**
* 用户类别 学员
*/
public static final String STUDENT = "学员";
/**
* 用户类别 学员 0
*/
public static final Integer STUDENT_INT = 0;
/**
* 用户类别 教员
*/
public static final String TEACHER = "教员";
/**
* 用户类别 教员 1
*/
public static final Integer TEACHER_INT = 1;
/**
* 用户类别 所有 2
*/
public static final Integer ALL_INT = 2;
/**
* 用户当前状态 - 训练
*/
public static final Integer USER_STATUS_TRAIN = 0;
/**
* 用户当前状态 - 考试
*/
public static final Integer USER_STATUS_EXAM = 1;
/**
* 用户当前状态 - 离线
*/
public static final Integer USER_STATUS_OFFLINE = 2;
/**
* 用户当前状态 - 在线
*/
public static final Integer USER_STATUS_ONLINE = 3;
/**
* 用户班别 - 初训
*/
public static final String CLASS_TYPE_JUNIOR = "初训";
/**
* 用户班别 - 复训
*/
public static final String CLASS_TYPE_HIGH = "复训";
/**
* 用户导入导出表中的卡号
*/
public static final int CARD = 0;
/**
* 用户导入导出表中的姓名
*/
public static final int USERNAME = 1;
/**
* 用户导入导出表中的组织机构
*/
public static final int ORGANIZATION = 2;
/**
* 用户导入导出表中的用户类别
*/
public static final int USER_TYPE = 3;
/**
* 用户导入表中的联系方式
*/
public static final int MOBILE_PHONE = 4;
/**
* 用户导入表中的电子邮箱
*/
public static final int EMAIL = 5;
/**
* 缓存客户端的token信息
*/
public static Map<String, String> USER_TOKEN = new HashMap<>();
/**
* 缓存客户登录的情况
*/
public static Map<String, UserLoginStatus> USER_LOGIN_STATUS = new HashMap<>();
/**
* 用户导出表中的工作表 第一个
*/
public static final int FIRST_SHEET = 0;
/**
* 用户导出表中的班别
*/
public static final int CLASS_TYPE = 4;
/**
* 用户导出表中的负责人
*/
public static final int LEADER = 5;
}
package cn.com.sailfish.linghang.enumeration;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-05-31 10:44:16
* Description:
*/
public class WebSocketConstant {
/**
* 接收客户端发给服务器的消息类型
*/
public static int INIT_COMMAND_C2S = 1;
/**
* 服务器向客户端发送接受客户端监听请求的消息类型
*/
public static int INIT_COMMAND_S2C = 2;
/**
* 服务器向客户端发送MQ服务器的消息类型
*/
public static int MESSAGE_COMMAND_S2C = 4;
/**
* 系统服务器支持的消息版本
*/
public static String SOCKET_VERSION = "1.0.0";
}
package cn.com.sailfish.linghang.exception;
import cn.com.sailfish.linghang.common.ErrorConstants;
import cn.com.sailfish.linghang.common.ErrorMessages;
/**
* Author: huangpeilin
* Create at: 2018-12-12 14:19:46
* Description:
*
* @author huangpeilin
*/
public class ServerErrorException extends Exception {
private int errorCode;
public ServerErrorException(int errorCode, String message) {
super(message);
this.errorCode = errorCode;
}
public ServerErrorException(String message) {
super(message);
this.errorCode = ErrorConstants.ERR_UNKNOWN;
}
public ServerErrorException(int errorCode) {
super(ErrorMessages.getErrorMessage(errorCode));
this.errorCode = errorCode;
}
public int getErrorCode() {
return errorCode;
}
public void setErrorCode(int errorCode) {
this.errorCode = errorCode;
}
}
package cn.com.sailfish.linghang.exception;
import org.springframework.security.core.AuthenticationException;
/**
* Author: huangpeilin
* Create at: 2018-12-12 14:22:58
* Description:
*
* @author huangpeilin
*/
public class UserNotActivatedException extends AuthenticationException {
private static final long serialVersionUID = 1L;
public UserNotActivatedException(String message) {
super(message);
}
public UserNotActivatedException(String message, Throwable t) {
super(message, t);
}
}
package cn.com.sailfish.linghang.filter;
import cn.com.sailfish.linghang.domain.User;
import cn.com.sailfish.linghang.repository.UserRepository;
import cn.com.sailfish.linghang.security.jwt.JWTConfigurer;
import cn.com.sailfish.linghang.security.jwt.TokenProvider;
import cn.com.sailfish.linghang.util.IPUtil;
import cn.com.sailfish.linghang.util.SecurityUtil;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.util.StringUtils;
import org.springframework.web.filter.GenericFilterBean;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import static cn.com.sailfish.linghang.common.ErrorConstants.*;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.USER_TOKEN;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:50:48
* Description: Filters incoming requests and installs a Spring Security principal if a header corresponding to a valid user is found.
*
* @author huangpeilin
*/
public class JWTFilter extends GenericFilterBean {
private static Logger log = LoggerFactory.getLogger(JWTFilter.class);
private TokenProvider tokenProvider;
private UserRepository userRepository;
public JWTFilter(TokenProvider tokenProvider, UserRepository userRepository) {
this.tokenProvider = tokenProvider;
this.userRepository = userRepository;
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException {
HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
String jwt = resolveToken(httpServletRequest);
JSONObject responseObject = new JSONObject();
if (StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt)) {
Authentication authentication = this.tokenProvider.getAuthentication(jwt);
SecurityContextHolder.getContext().setAuthentication(authentication);
// 校验token
String card = null;
String loginAccount = SecurityUtil.getCurrentUserLogin();
User user = null;
if (loginAccount != null){
user = userRepository.findOneByCard(loginAccount).orElse(null);
if (user == null) {
user = userRepository.findOneByMobilePhone(loginAccount).orElse(null);
}
}
if (user == null) {
responseObject.put("errorMessage", "user is not exists.");
sendResult((HttpServletResponse) servletResponse, responseObject, USER_IS_NOT_EXISTS);
}
card = user.getCard();
do {
if (card == null){
break;
}
String url = getRequestUrl(httpServletRequest);
if (url.startsWith("/apiv1/vr/")){
card = card + "-vr";
}else{
card = card + "-web";
}
String oldToken = USER_TOKEN.get(card);
if (oldToken == null){
break;
}
if (oldToken.equals(jwt)){
break;
}
responseObject.put("errorMessage", "user remote login.");
sendResult((HttpServletResponse) servletResponse, responseObject, USER_REMOTE_LOGIN);
return;
}while (false);
log.info(httpServletRequest.getMethod() + " " + httpServletRequest.getRequestURL() + " " + IPUtil.getLoginIP(httpServletRequest) + " " + card);
filterChain.doFilter(servletRequest, servletResponse);
}else{
filterChain.doFilter(servletRequest, servletResponse);
}
}
private String resolveToken(HttpServletRequest request){
String bearerToken = request.getHeader(JWTConfigurer.AUTHORIZATION_HEADER);
if (StringUtils.hasText(bearerToken) && bearerToken.startsWith("Bearer ")) {
return bearerToken.substring(7);
}
return null;
}
private void sendResult(HttpServletResponse servletResponse, JSONObject responseObject, int userRemoteLogin) throws IOException {
responseObject.put("errorCode", userRemoteLogin);
HttpServletResponse httpServletResponse = servletResponse;
httpServletResponse.setHeader("Content-type","application/json;charset=UTF-8");
httpServletResponse.setStatus(200);
OutputStream stream = httpServletResponse.getOutputStream();
stream.write(responseObject.toJSONString().getBytes(StandardCharsets.UTF_8));
}
private String getRequestUrl(HttpServletRequest request){
return request.getRequestURI();
}
}
package cn.com.sailfish.linghang.filter;
import org.springframework.http.HttpMethod;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.web.filter.CommonsRequestLoggingFilter;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:26:38
* Description:
*
* @author huangpeilin
*/
public class RequestLoggingFilter extends CommonsRequestLoggingFilter {
protected List<AntPathRequestMatcher> disallowUrls = new ArrayList<>();
private HttpMethod requestMethod;
public RequestLoggingFilter() {
super();
setIncludeQueryString(true);
setIncludePayload(true);
setIncludeClientInfo(true);
setMaxPayloadLength(1024);
setIncludeHeaders(false);
setAfterMessagePrefix("REQUEST DATA : ");
}
public RequestLoggingFilter get() {
requestMethod = HttpMethod.GET;
return this;
}
public RequestLoggingFilter post() {
requestMethod = HttpMethod.POST;
return this;
}
public RequestLoggingFilter exclude(String requestPattern) {
disallowUrls.add(new AntPathRequestMatcher(requestPattern, requestMethod.toString()));
return this;
}
@Override
protected boolean shouldLog(HttpServletRequest request) {
for (AntPathRequestMatcher matcher : disallowUrls) {
if (matcher.matches(request)) {
return false;
}
}
return true;
}
}
package cn.com.sailfish.linghang;
import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.core.env.Environment;
import java.net.InetAddress;
import java.net.UnknownHostException;
@SpringBootApplication
@EnableAdminServer
public class LinghangApplication extends SpringBootServletInitializer {
private static final Logger log = LoggerFactory.getLogger(LinghangApplication.class);
// 重载SpringBootServletInitializer.configure是为了打包成war包后能在tomcat中顺利运行
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder app) {
return app.sources(LinghangApplication.class);
}
public static void main(String[] args) throws UnknownHostException {
SpringApplication app = new SpringApplication(LinghangApplication.class);
Environment env = app.run(args).getEnvironment();
String protocol = "http";
if (env.getProperty("server.ssl.key-store") != null) {
protocol = "https";
}
log.info("\n----------------------------------------------------------\n\t" +
"Application '{}' is running! Access URLs:\n\t" +
"Local: \t\t{}://localhost:{}\n\t" +
"External: \t{}://{}:{}\n\t" +
"Profile(s): \t{}\n----------------------------------------------------------",
env.getProperty("spring.application.name"),
protocol,
env.getProperty("server.port"),
protocol,
InetAddress.getLocalHost().getHostAddress(),
env.getProperty("server.port"),
env.getActiveProfiles());
String configServerStatus = env.getProperty("configserver.status");
log.info("\n-------------------------- spring cloud --------------------------------\n\t" +
"Config Server: \t{}\n----------------------------------------------------------",
configServerStatus == null ? "Not found or not setup for this application" : configServerStatus);
}
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.Area;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
* @Author huangpeilin
*/
@Repository
public interface AreaRepository extends JpaRepository<Area, Long> {
/**
* 根据区域名字查找区域
* @param name 区域名字
* @return
*/
Area findOneByName(String name);
/**
* 根据ID查询区域
* @param areaId 区域ID
* @return
*/
Area findOneById(Long areaId);
/**
* 根据区域ID和职位查询区域信息
* @param areaId 区域ID
* @param position 职位
* @return
*/
Area findOneByIdAndPosition(Long areaId, Integer position);
/**
* 根据职位查找区域
* @param position
* @return
*/
List<Area> findAllByPosition(Integer position);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.CheckItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
*
* @author huangpeilin
*/
@Repository
public interface CheckItemRepository extends JpaRepository<CheckItem, Long> {
CheckItem findOneById(Long id);
CheckItem findOneByImportId(Long id);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.Course;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
* @author huangpeilin
*/
@Repository
public interface CourseRepository extends JpaRepository<Course, Long> {
/**
* 通过课程ID查找课程
* @param id
* @return
*/
Course findOneById(Long id);
/**
* 根据课程的英文名字查找课程
* @param courseName
* @return
*/
Course findOneByName(String courseName);
/**
* 根据导入的课程ID查找课程
* @param courseId
* @return
*/
Course findOneByImportId(Long courseId);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.Engine;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:03
* @author huangpeilin
*/
@Repository
public interface EngineRepository extends JpaRepository<Engine, Long> {
/**
* 根据发动机ID查找发动机
* @param id
* @return
*/
Engine findOneById(Long id);
/**
* 根据发动机和名字对应的值查找发动机
* @param type
* @return
*/
Engine findOneByType(Integer type);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.Area;
import cn.com.sailfish.linghang.domain.Exam;
import cn.com.sailfish.linghang.domain.QuestionPaper;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.time.Instant;
import java.util.List;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
* @author huangpeilin
*/
@Repository
public interface ExamRepository extends JpaRepository<Exam, Long> {
/**
* 通过区域分页获取考试信息
* @param area 区域
* @param pageable
* @return
*/
Page<Exam> findAllByAreaAndBIsDelete(Area area, boolean bIsDelete, Pageable pageable);
/**
* 通过区域和试卷名字搜索考试
* @param area 区域
* @param bIsDelete 是否在回收站中 false 没有 true 是
* @param questionPaperName 试卷名字
* @param pageable
* @return
*/
@Query("select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.questionPaper.title like %?3%")
Page<Exam> findAllByAreaAndBIsDeleteAndQuestionPaperTitleLike(Area area, boolean bIsDelete, String questionPaperName, Pageable pageable);
/**
* 通过区域和班别获取考试
* @param area 区域
* @param classType 班别
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.classType = ?3")
Page<Exam> findAllByAreaAndBIsDeleteAndClassType(Area area, Boolean bIsDelete, String classType, Pageable pageable);
/**
* 通过区域,班别和试卷名字获取考试
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param classType 班别
* @param questionPaperName 试卷名字
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.classType = ?3 and e.questionPaper.title like %?4%")
Page<Exam> findAllByAreaAndBIsDeleteAndClassTypeAndQuestionPaperTitleLike(Area area, Boolean bIsDelete, String classType, String questionPaperName, Pageable pageable);
/**
* 根据区域和监考人名字分页获取考试
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param invigilator 监考人名字
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.invigilator like %?3%")
Page<Exam> findAllByAreaAndBIsDeleteAndInvigilatorLike(Area area, Boolean bIsDelete, String invigilator, Pageable pageable);
/**
* 根据区域,监考人名字和试卷名字分页获取考试信息
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param questionPaperName 试卷名字
* @param invigilator 监考人名字
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.questionPaper.title like %?3% and e.invigilator like %?4% ")
Page<Exam> findAllByAreaAndBIsDeleteAndQuestionPaperTitleLikeAndInvigilatorLike(Area area, Boolean bIsDelete, String questionPaperName, String invigilator, Pageable pageable);
/**
* 根据区域,监考人名字和班别分页获取考试信息
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param classType 班别
* @param invigilator 监考人名字
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.classType = ?3 and e.invigilator like %?4% ")
Page<Exam> findAllByAreaAndBIsDeleteAndClassTypeAndInvigilatorLike(Area area, Boolean bIsDelete, String classType, String invigilator, Pageable pageable);
/**
* 根据区域,监考人名字,试卷名字和班别分页获取考试信息
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param classType 班别
* @param questionPaperName 试卷名字
* @param invigilator 监考人名字
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.classType = ?3 and e.questionPaper.title like %?4% and e.invigilator like %?5% ")
Page<Exam> findAllByAreaAndBIsDeleteAndClassTypeAndQuestionPaperTitleLikeAndInvigilatorLike(
Area area, Boolean bIsDelete, String classType, String questionPaperName, String invigilator, Pageable pageable);
/**
* 根据区域分页获取某段时间考试信息
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.examTime between ?3 and ?4")
Page<Exam> findAllByAreaAndBIsDeleteAndExamTimeBetween(Area area, Boolean bIsDelete, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据区域和试卷名字分页获取某段时间考试信息
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param questionPaperName 试卷名字
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.questionPaper.title like %?3% and e.examTime between ?4 and ?5")
Page<Exam> findAllByAreaAndBIsDeleteAndQuestionPaperTitleLikeAndExamTimeBetween(Area area, Boolean bIsDelete, String questionPaperName, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据区域和班别分页获取某段时间考试信息
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param classType 班别
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.classType = ?3 and e.examTime between ?4 and ?5")
Page<Exam> findAllByAreaAndBIsDeleteAndClassTypeAndExamTimeBetween(Area area, Boolean bIsDelete, String classType, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据区域,试卷名字和班别分页获取某段时间考试信息
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param classType 班别
* @param questionPaperName 试卷名字
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.classType = ?3 and e.questionPaper.title like %?4% and e.examTime between ?5 and ?6")
Page<Exam> findAllByAreaAndBIsDeleteAndClassTypeAndQuestionPaperTitleLikeAndExamTimeBetween(
Area area, Boolean bIsDelete, String classType, String questionPaperName, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据区域和监考人名字分页获取某段时间考试信息
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param invigilator 监考人名字
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.invigilator like %?3% and e.examTime between ?4 and ?5")
Page<Exam> findAllByAreaAndBIsDeleteAndInvigilatorLikeAndExamTimeBetween(Area area, Boolean bIsDelete, String invigilator, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据区域,试卷名字和监考人名字分页获取某段时间考试信息
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param questionPaperName 试卷名字
* @param invigilator 监考人名字
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.questionPaper.title like %?3% and e.invigilator like %?4% and e.examTime between ?5 and ?6")
Page<Exam> findAllByAreaAndBIsDeleteAndQuestionPaperTitleLikeAndInvigilatorLikeAndExamTimeBetween(
Area area, Boolean bIsDelete, String questionPaperName, String invigilator, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据区域,班别和监考人名字分页获取某段时间考试信息
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param invigilator 监考人名字
* @param classType 班别
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.classType = ?3 and e.invigilator like %?4% and e.examTime between ?5 and ?6")
Page<Exam> findAllByAreaAndBIsDeleteAndClassTypeAndInvigilatorLikeAndExamTimeBetween(
Area area, Boolean bIsDelete, String classType, String invigilator, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据区域,试卷名字和监考人名字分页获取某段时间考试信息
* @param area 区域
* @param bIsDelete 是否在回收站中 false没有 true 是
* @param classType 班别
* @param questionPaperName 试卷名字
* @param invigilator 监考人名字
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query(value = "select e from Exam e where e.area = ?1 and e.bIsDelete = ?2 and e.classType = ?3 and e.questionPaper.title like %?4% and e.invigilator like %?5% and e.examTime between ?6 and ?7")
Page<Exam> findAllByAreaAndBIsDeleteAndClassTypeAndQuestionPaperTitleLikeAndInvigilatorLikeAndExamTimeBetween(
Area area, Boolean bIsDelete, String classType, String questionPaperName, String invigilator, Instant startTime, Instant endTime, Pageable pageable);
/**
* 通过考试ID查找考试
* @param id
* @return
*/
Exam findOneById(Long id);
List<Exam> findAllByQuestionPaper(QuestionPaper questionPaper);
/**
* 获取某个区域的所有考试
* @param area
* @return
*/
List<Exam> findAllByArea(Area area);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.ExceptionItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
*
* @author huangpeilin
*/
@Repository
public interface ExceptionItemRepository extends JpaRepository<ExceptionItem, Long> {
ExceptionItem findOneById(Long id);
ExceptionItem findOneByImportId(Long importId);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.FileInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
* @author huangpeilin
*/
@Repository
public interface FileInfoRepository extends JpaRepository<FileInfo, Long> {
/**
* 根据文件的key获取文件信息
* @param keyName
* @return
*/
FileInfo findOneByKeyName(String keyName);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.Model;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
*
* @author huangpeilin
*/
@Repository
public interface ModelRepository extends JpaRepository<Model, Long> {
/**
* 根据飞机品牌查询机型
* @param brand
* @return
*/
List<Model> findAllByBrand(String brand);
/**
* 根据机型ID查找机型
* @param id
* @return
*/
Model findOneById(Long id);
/**
* 根据机型和名字对应的值查找机型
* @param planeModel
* @return
*/
Model findOneByNameType(Integer planeModel);
/**
* 根据机型和飞机制造商名字对应的值查找机型
* @param planeModel
* @param airFramer
* @return
*/
Model findOneByNameTypeAndBrandType(Integer planeModel, Integer airFramer);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.Area;
import cn.com.sailfish.linghang.domain.OperationRecord;
import cn.com.sailfish.linghang.domain.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestParam;
import java.time.Instant;
import java.util.List;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
*
* @author huangpeilin
*/
@Repository
public interface OperationRecordRepository extends JpaRepository<OperationRecord, Long> {
/**
* 根据操作类型获取操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param pageable
* @return
*/
Page<OperationRecord> findAllByAreaAndTypeAndStatus(Area area, Integer type, Integer status, Pageable pageable);
/**
* 根据操作类型和用户名获取操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param username 用户名
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.username like %?4%")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndUsernameLike(Area area, Integer type, Integer status, String username, Pageable pageable);
/**
* 根据操作类型和工号获取操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param card 工号
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.card like %?4%")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndCardLike(Area area, Integer type, Integer status, String card, Pageable pageable);
/**
* 根据操作类型,用户名和工号获取操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param username 用户名字
* @param card 用户工号
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.username like %?4% and o.card like %?5%")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndUsernameLikeAndCardLike(Area area, Integer type, Integer status, String username, String card, Pageable pageable);
/**
* 根据操作类型和试卷名字(课程名字)获取操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param typeName 试卷名字(课程名字)
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.typeName like %?4%")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndTypeNameLike(Area area, Integer type, Integer status, String typeName, Pageable pageable);
/**
* 根据操作类型,试卷名字(课程名字)和用户名获取操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param typeName 试卷名字(课程名字)
* @param username 用户名
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.typeName like %?4% and o.username like %?5%")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndTypeNameLikeAndUsernameLike(Area area, Integer type, Integer status, String typeName, String username, Pageable pageable);
/**
* 根据操作类型,试卷名字(课程名字)和用户工号获取操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param card 用户工号
* @param name 试卷名字(课程名字)
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.card like %?4% and o.typeName like %?5%")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndCardLikeAndTypeNameLike(Area area, Integer type, Integer status, String card, String name, Pageable pageable);
/**
* 根据操作类型,试卷名字(课程名字)、用户名字和用户工号获取操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param username 用户名
* @param card 用户工号
* @param name 试卷名字(课程名字)
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.username like %?4% and o.card like %?5% and o.typeName like %?6%")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndUsernameLikeAndCardLikeAndTypeNameLike(Area area, Integer type, Integer status, String username, String card, String name, Pageable pageable);
/**
* 根据操作类型获取某个时间端内的操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.loginTime between ?4 and ?5")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndLoginTimeBetween(Area area,Integer type, Integer status, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据操作类型和用户名字获取某个时间端内的操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param username 用户名字
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.username like %?4% and o.loginTime between ?5 and ?6")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndUsernameLikeAndLoginTimeBetween(Area area, Integer type, Integer status, String username, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据操作类型和用户卡号获取某个时间端内的操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param card 用户工卡
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.card like %?4% and o.loginTime between ?5 and ?6")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndCardLikeAndLoginTimeBetween(Area area, Integer type, Integer status, String card, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据操作类型、用户卡号和用户名字获取某个时间端内的操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param username 用户名字
* @param card 用户工卡
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.username like %?4% and o.card like %?5% and o.loginTime between ?6 and ?7")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndUsernameLikeAndCardLikeAndLoginTimeBetween(Area area, Integer type, Integer status, String username, String card, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据操作类型和试卷名字(课程名字)获取某个时间端内的操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param name 试卷名字(课程名字)
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.typeName like %?4% and o.loginTime between ?5 and ?6")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndTypeNameLikeAndLoginTimeBetween(Area area, Integer type, Integer status, String name, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据操作类型、试卷名字(课程名字)和用户名字获取某个时间端内的操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param name 试卷名字(课程名字)
* @param username 用户名字
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.typeName like %?4% and o.username like %?5% and o.loginTime between ?6 and ?7")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndTypeNameLikeAndUsernameLikeAndLoginTimeBetween(Area area, Integer type, Integer status, String name, String username, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据操作类型、试卷名字(课程名字)和用户卡号获取某个时间端内的操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param card 用户卡号
* @param name 试卷名字(课程名字)
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.card like %?4% and o.typeName like %?5% and o.loginTime between ?6 and ?7")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndCardLikeAndTypeNameLikeAndLoginTimeBetween(Area area, Integer type, Integer status, String card, String name, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据操作类型、试卷名字(课程名字)、用户名字和用户卡号获取某个时间端内的操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @param username 用户名字
* @param card 用户卡号
* @param name 试卷名字(课程名字)
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.status = ?3 and o.username like %?4% and o.card like %?5% and o.typeName like %?6% and o.loginTime between ?7 and ?8")
Page<OperationRecord> findAllByAreaAndTypeAndStatusAndUsernameLikeAndCardLikeAndTypeNameLikeAndLoginTimeBetween(Area area, Integer type, Integer status, String username, String card, String name, Instant startTime, Instant endTime, Pageable pageable);
Page<OperationRecord> findAllByAreaAndStatus(Area area, Integer status, Pageable pageable);
/**
* 根据用户卡号和操作类型获取最新的操作记录
* @param card 用户卡号
* @param status 是否是最新状态 0 是 1 不是
* @param type 操作类型
* @return
*/
OperationRecord findOneByCardAndStatusAndType(String card, Integer status, Integer type);
/**
* 根据区域和操作类型获取操作记录
* @param area 区域
* @param type 操作类型
* @param pageable
* @return
*/
Page<OperationRecord> findAllByAreaAndType(Area area, Integer type, Pageable pageable);
/**
* 根据操作类型和状态获取某个区域的操作记录
* @param area 区域
* @param type 操作类型
* @param status 是否是最新状态 0 是 1 不是
* @return
*/
List<OperationRecord> findAllByAreaAndTypeAndStatus(Area area, Integer type, Integer status);
/**
* 根据用户卡号和操作类型获取操作记录
* @param type 操作类型
* @param card 用户卡号
* @return
*/
@Query("select o from OperationRecord o where o.type = ?1 and o.card = ?2 and (o.courseId is not null or o.examId is not null )")
List<OperationRecord> findAllByTypeAndCard(Integer type, String card);
/**
* 根据卡号获取登出时间为空的操作记录
* @param card
* @return
*/
List<OperationRecord> findAllByCardAndLogoutTimeIsNull(String card);
/**
* 根据卡号,操作类型和登录时间获取操作记录
* @param card 用户工卡
* @param type 操作类型
* @param loginTime 登录时间
* @return
*/
List<OperationRecord> findAllByCardAndTypeAndLoginTime(String card, Integer type, Instant loginTime);
/**
* 根据卡号和操作类型获取操作记录
* @param area
* @param type
* @param card
* @param pageable
* @return
*/
@Query("select o from OperationRecord o where o.area = ?1 and o.type = ?2 and o.card = ?3 and (o.courseId is not null or o.examId is not null )")
Page<OperationRecord> findAllByAreaAndTypeAndCard(Area area, Integer type, String card, Pageable pageable);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.OrgInfoForm;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface OrgInfoFormRepository extends JpaRepository<OrgInfoForm,Long> {
OrgInfoForm findOrgInfoFormByOrgUnitID(String orgUnitID);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.Area;
import cn.com.sailfish.linghang.domain.QuestionPaper;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
*
* @author huangpeilin
*/
@Repository
public interface QuestionPaperRepository extends JpaRepository<QuestionPaper, Long> {
/**
* 通过试卷标题和试卷备注查找试卷
* @param title
* @param description
* @return
*/
QuestionPaper findOneByTitleAndDescription(String title, String description);
/**
* 通过区域查找试卷
* @param area 区域
* @param bIsDelete 是否搜索回收站的试卷 true 是 false 不是
* @param pageable
* @return
*/
Page<QuestionPaper> findAllByAreaAndBIsDelete(Area area, Boolean bIsDelete, Pageable pageable);
/**
* 通过试卷ID获取试卷
* @param id
* @return
*/
QuestionPaper findOneById(Long id);
/**
* 根据区域和创建人名字搜索试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param authorName 创建人名字 模糊
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.author.username like %?3%")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndAuthorUsernameLike(Area area, boolean bIsDelete, String authorName, Pageable pageable);
/**
* 根据区域和试卷名字搜索试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param title 试卷名字 模糊
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.title like %?3%")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndTitleLike(Area area, boolean bIsDelete, String title, Pageable pageable);
/**
* 根据区域和试卷名字搜索试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param title 试卷名字 模糊
* @param authorName 创建人名字 模糊
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.title like %?3% and q.author.username like %?4%")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndTitleLikeAndAuthorUsernameLike(Area area, boolean bIsDelete, String title, String authorName, Pageable pageable);
/**
* 根据区域和机型ID查找试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param modelId 机型ID
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.model.id =?3")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndModelId(Area area, boolean bIsDelete, Long modelId, Pageable pageable);
/**
* 根据区域,机型ID和创建人名字查找试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param modelId 机型ID
* @param authorName 创建人名字 模糊
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.model.id = ?3 and q.author.username like %?4%")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndModelIdAndAuthorUsernameLike(Area area, boolean bIsDelete, Long modelId, String authorName, Pageable pageable);
/**
* 根据区域,课程ID和创建人名字查找试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param courseId 课程ID
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.course.id = ?3")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndCourseId(Area area, boolean bIsDelete, Long courseId, Pageable pageable);
/**
* 根据区域,课程ID和创建人名字查找试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param courseId 课程ID
* @param authorName 创建人名字 模糊
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.course.id = ?3 and q.author.username like %?4%")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndCourseIdAndAuthorUsernameLike(Area area, boolean bIsDelete, Long courseId, String authorName, Pageable pageable);
/**
* 根据区域,课程ID和试卷名字查找试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param courseId 课程ID
* @param title 试卷名字 模糊
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.course.id = ?3 and q.title like %?4%")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndCourseIdAndTitleLike(Area area, boolean bIsDelete, Long courseId, String title, Pageable pageable);
/**
* 根据区域,课程ID和试卷名字查找试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param courseId 课程ID
* @param title 试卷名字 模糊
* @param authorName 创建人名字 模糊
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.course.id = ?3 and q.title like %?4% and q.author.username like %?5%")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndCourseIdAndTitleLikeAndAuthorUsernameLike(Area area, boolean bIsDelete, Long courseId, String title, String authorName, Pageable pageable);
/**
* 根据区域,机型ID和试卷名字查找试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param modelId 机型ID
* @param title 试卷名字 模糊
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.model.id = ?3 and q.title like %?4%")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndModelIdAndTitleLike(Area area, boolean bIsDelete, Long modelId, String title, Pageable pageable);
/**
* 根据区域,机型ID和试卷名字查找试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param modelId 机型ID
* @param title 试卷名字 模糊
* @param authorName 创建人名字 模糊
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.model.id = ?3 and q.title like %?4% and q.author.username like %?5%")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndModelIdAndTitleLikeAndAuthorUsernameLike(Area area, boolean bIsDelete, Long modelId, String title, String authorName, Pageable pageable);
/**
* 根据区域,机型ID和试卷名字查找试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param courseId 课程ID
* @param modelId 机型ID
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.course.id = ?3 and q.model.id = ?4")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndCourseIdAndModelId(Area area, boolean bIsDelete, Long courseId, Long modelId, Pageable pageable);
/**
* 根据区域,课程ID,机型ID和创建人名字查找试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param courseId 课程ID
* @param modelId 机型ID
* @param authorName 创建人名字 模糊
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.course.id = ?3 and q.model.id = ?4 and q.author.username like %?5%")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndCourseIdAndModelIdAndAuthorUsernameLike(Area area, boolean bIsDelete, Long courseId, Long modelId, String authorName, Pageable pageable);
/**
* 根据区域,课程ID,机型ID和试卷名字查找试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param courseId 课程ID
* @param modelId 机型ID
* @param title 试卷名字 模糊
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.course.id = ?3 and q.model.id = ?4 and q.title like %?5%")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndCourseIdAndModelIdAndTitleLike(Area area, boolean bIsDelete, Long courseId, Long modelId, String title, Pageable pageable);
/**
* 根据区域,课程ID,机型ID,试卷名字和创建人名字查找试卷
* @param area 区域
* @param bIsDelete 是否在回收站中 false代表不是 true代表是
* @param courseId 课程ID
* @param modelId 机型ID
* @param title 试卷名字 模糊
* @param authorName 创建人名字 模糊
* @param pageable
* @return
*/
@Query("select q from QuestionPaper q where q.area = ?1 and q.bIsDelete = ?2 and q.course.id = ?3 and q.model.id = ?4 and q.title like %?5% and q.author.username like %?6%")
Page<QuestionPaper> findAllByAreaAndBIsDeleteAndCourseIdAndModelIdAndTitleLikeAndAuthorUsernameLike(Area area, boolean bIsDelete, Long courseId, Long modelId, String title, String authorName, Pageable pageable);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.CheckItem;
import cn.com.sailfish.linghang.domain.ExceptionItem;
import cn.com.sailfish.linghang.domain.ReportCard;
import cn.com.sailfish.linghang.domain.ReportCardDetails;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
*
* @author
*/
@Repository
public interface ReportCardDetailsRepository extends JpaRepository<ReportCardDetails, Long> {
/**
* 根据成绩单获取所有成绩单详情
* @param reportCard
* @return
*/
List<ReportCardDetails> findAllByReportCard(ReportCard reportCard);
/**
* 根据成绩单和检查项不为空查找成绩详情
* @param reportCard
* @return
*/
List<ReportCardDetails> findAllByReportCardAndCheckItemIsNotNull(ReportCard reportCard);
/**
* 根据成绩单和检查项查找检查项的详细信息
* @param reportCard
* @param checkItem
* @return
*/
ReportCardDetails findOneByReportCardAndCheckItem(ReportCard reportCard, CheckItem checkItem);
/**
* 根据成绩单和异常项(特殊项)查找成绩详情
* @param reportCard
* @param exceptionItem
* @param special
* @return
*/
ReportCardDetails findOneByReportCardAndExceptionItemAndSpecial(ReportCard reportCard, ExceptionItem exceptionItem, int special);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.dao.ReportCardRank;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-05-08 16:22:22
* Description:
*
* @author huangpeilin
*/
@Repository
public interface ReportCardRankRepository extends JpaRepository<ReportCardRank, Long> {
/**
* 根据考试ID,成绩降序查找班级成绩单
* @param examId
* @param page
* @param pageSize
* @return
*/
@Query(value = "select r.*," +
"(SELECT COUNT(score) FROM report_card rs WHERE rs.exam_id = ?1 and rs.switch_status = 1 and rs.completion_status = 0 and rs.b_is_delete = FALSE and r.score < rs.score) + 1 AS rank " +
"FROM report_card r WHERE r.exam_id = ?1 and r.switch_status = 1 and r.completion_status = 0 and r.b_is_delete = FALSE " +
"order by r.score DESC limit ?2,?3", nativeQuery = true)
List<ReportCardRank> findAllByExamIdAndScoreDesc(Long examId, Integer page, Integer pageSize);
/**
* 根据考试ID,工号降序查找班级成绩单
* @param examId
* @param page
* @param pageSize
* @return
*/
@Query(value = "select r.*," +
"(SELECT COUNT(score) FROM report_card rs WHERE rs.exam_id = ?1 and rs.switch_status = 1 and rs.completion_status = 0 and rs.b_is_delete = FALSE and r.score < rs.score) + 1 AS rank " +
"FROM report_card r WHERE r.exam_id = ?1 and r.switch_status = 1 and r.completion_status = 0 and r.b_is_delete = FALSE " +
"order by r.card DESC limit ?2,?3", nativeQuery = true)
List<ReportCardRank> findAllByExamIdAndCardDesc(Long examId, Integer page, Integer pageSize);
/**
* 获取班级成绩单的总数
* @param examId
* @return
*/
@Query(value = "select COUNT(*) FROM report_card r WHERE r.exam_id = ?1", nativeQuery = true)
Integer findAllByExamId(Long examId);
/**
* 根据考试ID,工号降序查找班级成绩单
* @param examId
* @return
*/
@Query(value = "select r.*," +
"(SELECT COUNT(score) FROM report_card rs WHERE rs.exam_id = ?1 and rs.switch_status = 1 and rs.completion_status = 0 and rs.b_is_delete = FALSE and r.score < rs.score) + 1 AS rank " +
"FROM report_card r WHERE r.exam_id = ?1 and r.switch_status = 1 and r.completion_status = 0 and r.b_is_delete = FALSE " +
"order by r.card DESC", nativeQuery = true)
List<ReportCardRank> findAllByExamIdAndCardDesc(Long examId);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.time.Instant;
import java.util.List;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
*
* @author huangpeilin
*/
@Repository
public interface ReportCardRepository extends JpaRepository<ReportCard, Long> {
/**
* 根据用户查找成绩单
* @param card 用户工号
* @param bIsDelete 是否在回收站中
* @param sort
* @return
*/
List<ReportCard> findAllByCardAndBIsDelete(String card, boolean bIsDelete, Sort sort);
/**
* 根据用户和考试的开启状态查找成绩单
* @param card 用户工号
* @param bIsDelete 是否在回收站中
* @param switchStatus 考试的开启状态 0 开启 1 关闭
* @return
*/
List<ReportCard> findAllByCardAndBIsDeleteAndSwitchStatus(String card, boolean bIsDelete, Integer switchStatus);
/**
* 根据用户和试卷查找成绩单
* @param card 用户
* @param questionPaper 试卷
* @param sort
* @return
*/
List<ReportCard> findAllByCardAndQuestionPaper(String card, QuestionPaper questionPaper, Sort sort);
/**
* 根据考试ID,试卷ID,用户工号获取成绩单
* @param examId 考试ID
* @param questionPaperId 试卷ID
* @param card 用户工号
* @return
*/
@Query(value = "select r from ReportCard r where r.exam.id = ?1 and r.questionPaper.id = ?2 and r.card = ?3")
ReportCard findOneByExamIdAndQuestionPaperIdAndUserCard(Long examId, Long questionPaperId, String card);
/**
* 根据成绩单ID查找成绩单
* @param id
* @return
*/
ReportCard findOneById(Long id);
/**
* 根据用户和考试完成状态分页获取成绩单
* @param card 用户工号
* @param status 考试完成状态
* @param bIsDelete 是否在回收站中
* @param pageable
* @return
*/
Page<ReportCard> findAllByCardAndCompletionStatusAndBIsDelete(String card, Integer status, Boolean bIsDelete, Pageable pageable);
/**
* 根据用户和考试完成状态获取成绩单
* @param card 用户工号
* @param status 考试完成状态
* @param bIsDelete 是否在回收站中
* @return
*/
List<ReportCard> findAllByCardAndCompletionStatusAndBIsDelete(String card, Integer status, Boolean bIsDelete);
/**
* 根据用户,考试完成状态和试卷名字分页获取成绩单
* @param card 用户工号
* @param status 考试完成状态
* @param bIsDelete 是否在回收站中
* @param questionPaperName 试卷名字
* @param pageable
* @return
*/
@Query("select r from ReportCard r where r.card = ?1 and r.completionStatus = ?2 and r.bIsDelete = ?3 and r.questionPaper.title like %?4%")
Page<ReportCard> findAllByCradAndCompletionStatusAndBIsDeleteAndQuestionPaperTitleLike(String card, Integer status, boolean bIsDelete, String questionPaperName, Pageable pageable);
/**
* 根据用户,考试完成状态分页获取某个时间段的成绩单
* @param card 用户工号
* @param status 考试完成状态
* @param bIsDelete 是否在回收站中
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query("select r from ReportCard r where r.card = ?1 and r.completionStatus = ?2 and r.bIsDelete = ?3 and r.examTime between ?4 and ?5")
Page<ReportCard> findAllByCardAndCompletionStatusAndBIsDeleteAndExamTimeBetween(String card, Integer status, boolean bIsDelete, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据用户,考试完成状态和试卷名字分页获取某个时间段的成绩单
* @param card 用户工号
* @param status 考试完成状态
* @param bIsDelete 是否在回收站中
* @param questionPaperName 试卷名字
* @param startTime 开始时间
* @param endTime 结束时间
* @param pageable
* @return
*/
@Query("select r from ReportCard r where r.card = ?1 and r.completionStatus = ?2 and r.bIsDelete = ?3 and r.questionPaper.title like %?4% and r.examTime between ?5 and ?6")
Page<ReportCard> findAllByCardAndCompletionStatusAndBIsDeleteAndQuestionPaperTitleLikeAndExamTimeBetween(String card, Integer status, boolean bIsDelete, String questionPaperName, Instant startTime, Instant endTime, Pageable pageable);
/**
* 根据考试获取班级成绩单
* @param exam 考试
* @param bIsDelete 是否在回收站中 true 是 false 否
* @return
*/
List<ReportCard> findAllByExamAndBIsDelete(Exam exam, Boolean bIsDelete);
/**
* 根据考试ID获取所有成绩单
* @param exam
* @return
*/
List<ReportCard> findAllByExam(Exam exam);
ReportCard findOneByExamAndCard(Exam exam, String card);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2")
Page<ReportCard> findAllByAreaAndBIsDelete(Area area, Boolean bIsDelete, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.exam.invigilator like %?3% ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamInvigilatorLike(Area area, Boolean bIsDelete, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.exam.classType = ?3")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamClassType(Area area, Boolean bIsDelete, String classType, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.exam.classType = ?3 and r.exam.invigilator like %?4%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamClassTypeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String classType, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.questionPaper.title like %?3%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndQuestionPaperTitleLike(Area area, Boolean bIsDelete, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.questionPaper.title like %?3% and r.exam.invigilator like %?4%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.exam.classType = ?3 and r.questionPaper.title like %?4%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamClassTypeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, String classType, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.exam.classType = ?3 and r.questionPaper.title like %?4% and r.exam.invigilator like %?5%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamClassTypeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String classType, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.username like %?3%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndUsernameLike(Area area, Boolean bIsDelete, String username, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.username like %?3% and r.exam.invigilator like %?4%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndUsernameLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String username, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.username like %?3% and r.exam.classType = ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndUsernameLikeAndExamClassType(
Area area, Boolean bIsDelete, String username, String classType, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.username like %?3% and r.exam.classType = ?4 and r.exam.invigilator like %?5%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndUsernameLikeAndExamClassTypeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String username, String classType, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.username like %?3% and r.questionPaper.title like %?4%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndUsernameLikeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, String username, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.username like %?3% and r.questionPaper.title like %?4% and r.exam.invigilator like %?5%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndUsernameLikeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String username, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.username like %?3% and r.exam.classType = ?4 and r.questionPaper.title like %?5%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndUsernameLikeAndExamClassTypeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, String username, String classType, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.username like %?3% and r.exam.classType = ?4 " +
"and r.questionPaper.title like %?5% and r.exam.invigilator like %?6%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndUsernameLikeAndExamClassTypeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String username, String classType, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLike(Area area, Boolean bIsDelete, String card, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% and r.exam.invigilator like %?4%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% and r.exam.classType = ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamClassType(Area area, Boolean bIsDelete, String card, String classType, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% and r.exam.classType = ?4 and r.exam.invigilator like %?5%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamClassTypeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, String classType, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% and r.questionPaper.title like %?4%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, String card, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% and r.questionPaper.title like %?4% and r.exam.invigilator like %?5%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% and r.exam.classType = ?4 and r.questionPaper.title like %?5%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamClassTypeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, String card, String classType, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% and r.exam.classType = ?4 " +
"and r.questionPaper.title like %?5% and r.exam.invigilator like %?6%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamClassTypeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, String classType, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% and r.username like %?4%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndUsernameLike(Area area, Boolean bIsDelete, String card, String username, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?4% and r.exam.invigilator like %?5%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndUsernameLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, String username, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?4% and r.exam.classType = ?5")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndUsernameLikeAndExamClassType(
Area area, Boolean bIsDelete, String card, String username, String classType, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?4% and r.exam.classType = ?5 and r.exam.invigilator like %?6%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndUsernameLikeAndExamClassTypeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, String username, String classType, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?4% and r.questionPaper.title like %?5% and r.exam.invigilator like %?6%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndUsernameLikeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, String username, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?4% and r.questionPaper.title like %?5%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndUsernameLikeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, String card, String username, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?4% and r.exam.classType = ?5 and r.questionPaper.title like %?6%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndUsernameLikeAndExamClassTypeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, String card, String username, String classType, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?4% and r.exam.classType = ?5 and r.questionPaper.title like %?6% and r.exam.invigilator like %?7%")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndUsernameLikeAndExamClassTypeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, String username, String classType, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.examTime between ?4 and ?5")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetween(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.exam.invigilator like %?6% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.exam.classType = ?6 and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndExamClassType(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String classType, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.exam.classType = ?6 and r.exam.invigilator like %?7% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndExamClassTypeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String classType, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.questionPaper.title like %?6% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.questionPaper.title like %?6% and r.exam.invigilator like %?7% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.exam.classType = ?6 and r.questionPaper.title like %?7% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndExamClassTypeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String classType, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.exam.classType = ?6 and r.questionPaper.title like %?7% and r.exam.invigilator like %?8% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndExamClassTypeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String classType, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?6% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndUsernameLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String username, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?6% and r.exam.invigilator like %?7% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndUsernameLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String username, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?6% and r.exam.classType = ?7 and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndUsernameLikeAndExamClassType(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String username, String classType, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?6% and r.exam.classType = ?7 and r.exam.invigilator like %?8% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndUsernameLikeAndExamClassTypeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String username, String classType, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?6% and r.questionPaper.title like %?7% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndUsernameLikeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String username, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?6% and r.questionPaper.title like %?7% and r.exam.invigilator like %?8% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndUsernameLikeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String username, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?6% and r.exam.classType = ?7 and r.questionPaper.title like %?8% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndUsernameLikeAndExamClassTypeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String username, String classType, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.card like %?3% " +
"and r.username like %?6% and r.exam.classType = ?7 and r.questionPaper.title like %?8% " +
"and r.exam.invigilator like %?9% and r.examTime between ?4 and ?5 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndCardLikeAndExamTimeBetweenAndUsernameLikeAndExamClassTypeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, String card, Instant startTime, Instant endTime, String username, String classType,
String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 and r.examTime between ?3 and ?4 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetween(Area area, Boolean bIsDelete, Instant startTime, Instant endTime, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.exam.invigilator like %?5% and r.examTime between ?3 and ?4 ")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndExamInvigilatorLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.exam.classType = ?5 and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndExamClassType(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String classType, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.exam.classType = ?5 and r.exam.invigilator like %?6% and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndExamClassTypeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String classType, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.questionPaper.title like %?5% and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
" and r.questionPaper.title like %?5% and r.exam.invigilator like %?6% and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.exam.classType = ?5 and r.questionPaper.title like %?6% and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndExamClassTypeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String classType, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.exam.classType = ?5 and r.questionPaper.title like %?6% and r.exam.invigilator like %?7% and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndExamClassTypeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String classType, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.username like %?5% and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndUsernameLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String username, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.username like %?5% and r.exam.invigilator like %?6% and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndUsernameLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String username, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.username like %?5% and r.exam.classType = ?6 and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndUsernameLikeAndExamClassType(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String username, String classType, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.username like %?5% and r.exam.classType = ?6 and r.exam.invigilator like %?7% and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndUsernameLikeAndExamClassTypeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String username, String classType, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.username like %?5% and r.questionPaper.title like %?6% and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndUsernameLikeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String username, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.username like %?5% and r.questionPaper.title like %?6% and r.exam.invigilator like %?7% and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndUsernameLikeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String username, String questionPaperName, String invigilator, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.username like %?5% and r.exam.classType = ?6 and r.questionPaper.title like %?7% and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndUsernameLikeAndExamClassTypeAndQuestionPaperTitleLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String username, String classType, String questionPaperName, Pageable pageable);
@Query("select r from ReportCard r where r.exam.area = ?1 and r.bIsDelete = ?2 " +
"and r.username like %?5% and r.exam.classType = ?6 " +
"and r.questionPaper.title like %?7% and r.exam.invigilator like %?8% and r.examTime between ?3 and ?4")
Page<ReportCard> findAllByAreaAndBIsDeleteAndExamTimeBetweenAndUsernameLikeAndExamClassTypeAndQuestionPaperTitleLikeAndExamInvigilatorLike(
Area area, Boolean bIsDelete, Instant startTime, Instant endTime, String username,
String classType, String questionPaperName, String invigilator, Pageable pageable);
ReportCard findOneByCardAndSwitchStatusAndCompletionStatus(String card, int switchStatus, int completionStatus);
/**
* 根据卡号获取成绩单
* @param card
* @return
*/
List<ReportCard> findAllByCard(String card);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.Course;
import cn.com.sailfish.linghang.domain.ExceptionItem;
import cn.com.sailfish.linghang.domain.QuestionPaper;
import cn.com.sailfish.linghang.domain.TestAbnormalItemInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
*
* @author huangpeilin
*/
@Repository
public interface TestAbnormalItemInfoRepository extends JpaRepository<TestAbnormalItemInfo, Long> {
/**
* 根据试卷,课程和是否为特殊项查找异常项
* @param questionPaper 试卷
* @param course 课程
* @param special 是否为特殊项 0 不是 1 是
* @return
*/
List<TestAbnormalItemInfo> findAllByQuestionPaperAndCourseAndSpecial(QuestionPaper questionPaper, Course course, Integer special);
/**
* 获取特殊项
* @param questionPaper
* @param exceptionItem
* @param special
* @return
*/
TestAbnormalItemInfo findOneByQuestionPaperAndExceptionItemAndSpecial(QuestionPaper questionPaper, ExceptionItem exceptionItem, Integer special);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.dao.web.response.WebVrSumResponseDTO;
import cn.com.sailfish.linghang.domain.UserInfoForm;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface UserInfoRepository extends JpaRepository<UserInfoForm,Long> {
UserInfoForm findUserInfoFormByEmpid(String empid);
}
package cn.com.sailfish.linghang.repository;
import cn.com.sailfish.linghang.domain.Area;
import cn.com.sailfish.linghang.domain.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Optional;
/**
* Author: AutoCoder (maintained by newma<newma@live.cn>)
* Create: 2019-04-23 15:12:04
*/
@Repository
public interface UserRepository extends JpaRepository<User, Long> {
/**
* 根据手机电话查找用户
* @param mobilePhone
* @return
*/
Optional<User> findOneByMobilePhone(String mobilePhone);
/**
* 根据卡号查找用户
* @param card
* @return
*/
Optional<User> findOneByCard(String card);
/**
* 根据电子邮箱查找用户
* @param email
* @return
*/
Optional<User> findOneByEmail(String email);
/**
* 根据用户ID查找用户
* @param id
* @return
*/
User findOneById(Long id);
/**
* 根据区域分页查找用户
* @param area 区域
* @param activation 是否在回收站
* @param authority 用户权限
* @param pageable
* @return
*/
Page<User> findAllByAreaAndActivationAndAuthorityGreaterThanEqual(Area area, boolean activation, Integer authority, Pageable pageable);
/**
* 根据区域和是否在考试队列分页查找用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param authority 用户权限
* @param pageable
* @return
*/
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, Integer authority, Pageable pageable);
/**
* 根据区域和负责人名字(模糊)分页查找用户
* @param area 区域
* @param activation 是否在回收站
* @param leader 负责人名字 模糊查询
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.leader.username like %?3% and u.authority >= ?4")
Page<User> findAllByAreaAndActivationAndLeaderUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String leader, Integer authority, Pageable pageable);
/**
* 根据区域和班别分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param classType 班别
* @param authority 用户权限
* @param pageable
* @return
*/
Page<User> findAllByAreaAndActivationAndClassTypeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String classType, Integer authority, Pageable pageable);
/**
* 根据区域,班别,负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param classType 班别
* @param leader 负责人名字
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.classType = ?3 and u.leader.username like %?4% and u.authority >= ?5")
Page<User> findAllByAreaAndActivationAndClassTypeAndLeaderUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String classType, String leader, Integer authority, Pageable pageable);
/**
* 根据区域,用户名分业务查询用户
* @param area 区域
* @param activation 是否在回收站
* @param username 用户名 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.username like %?3% and u.authority >= ?4")
Page<User> findAllByAreaAndActivationAndUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String username, Integer authority, Pageable pageable);
/**
* 根据区域,用户名和负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param username 用户名 模糊
* @param leader 负责人名字 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.username like %?3% and u.leader.username like %?4% and u.authority >= ?5")
Page<User> findAllByAreaAndActivationAndUsernameAndLeaderUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String username, String leader, Integer authority, Pageable pageable);
/**
* 根据区域,用户名和班别分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param classType 班别
* @param username 用户名 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.classType = ?3 and u.username like %?4% and u.authority >= ?5")
Page<User> findAllByAreaAndActivationAndClassTypeAndUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String classType, String username, Integer authority, Pageable pageable);
/**
* 根据区域,用户名,班别和负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param classType 班别
* @param username 用户名 模糊
* @param leader 负责人名字 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.classType = ?3 and u.username like %?4% and u.leader.username like %?5% and u.authority >= ?6")
Page<User> findAllByAreaAndActivationAndClassTypeAndUsernameAndLeaderUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String classType, String username, String leader, Integer authority, Pageable pageable);
/**
* 根据区域,卡号分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.card like %?3% and u.authority >= ?4")
Page<User> findAllByAreaAndActivationAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String card, Integer authority, Pageable pageable);
/**
* 根据区域,卡号和负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param card 卡号 模糊
* @param leader 负责人名字 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.card like %?3% and u.leader.username like %?4% and u.authority >= ?5")
Page<User> findAllByAreaAndActivationAndCardAndLeaderUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String card, String leader, Integer authority, Pageable pageable);
/**
* 根据区域,卡号和班别分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param classType 班别
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.classType = ?3 and u.card like %?4% and u.authority >= ?5")
Page<User> findAllByAreaAndActivationAndClassTypeAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String classType, String card, Integer authority, Pageable pageable);
/**
* 根据区域,卡号,班别和负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param classType 班别
* @param leader 负责人名字 模糊
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.classType = ?3 and u.leader.username like %?4% and u.card like %?5% " +
"and u.authority >= ?6")
Page<User> findAllByAreaAndActivationAndClassTypeAndLeaderUsernameLikeAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String classType, String leader, String card, Integer authority, Pageable pageable);
/**
* 根据区域,用户名,卡号分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param username 用户名 模糊
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.username like %?3% and u.card like %?4% and u.authority >= ?5")
Page<User> findAllByAreaAndActivationAndUsernameLikeAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String username, String card, Integer authority, Pageable pageable);
/**
* 根据区域,用户名,负责人名字和卡号分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param username 用户名 模糊
* @param leader 负责人名字 模糊
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.username like %?3% and u.leader.username like %?4% and u.card like %?5% " +
"and u.authority >= ?6")
Page<User> findAllByAreaAndActivationAndUsernameAndLeaderUsernameLikeAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String username, String leader, String card, Integer authority, Pageable pageable);
/**
* 根据区域,用户名和班别分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param classType 班别
* @param username 用户名 模糊
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.classType = ?3 and u.username like %?4% and u.card like %?5% " +
"and u.authority >= ?6")
Page<User> findAllByAreaAndActivationAndClassTypeAndUsernameLikeAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String classType, String username, String card, Integer authority, Pageable pageable);
/**
* 根据区域,用户名,班别和负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param classType 班别
* @param username 用户名 模糊
* @param leader 负责人名字 模糊
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.classType = ?3 and u.username like %?4% and u.leader.username like %?5% " +
"and u.card like %?6% and u.authority >= ?7")
Page<User> findAllByAreaAndActivationAndClassTypeAndUsernameAndLeaderUsernameLikeAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String classType, String username, String leader, String card, Integer authority, Pageable pageable);
/**
* 根据区域和负责人名字(模糊)分页查找用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param leader 负责人名字 模糊查询
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.leader.username like %?4% and u.authority >= ?5")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndLeaderUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String leader, Integer authority, Pageable pageable);
/**
* 根据区域和班别分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param authority 用户权限
* @param pageable
* @return
*/
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String classType, Integer authority, Pageable pageable);
/**
* 根据区域,班别,负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param leader 负责人名字
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.classType = ?4 and u.leader.username like %?5% " +
"and u.authority >= ?6")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndLeaderUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String classType, String leader, Integer authority, Pageable pageable);
/**
* 根据区域,用户名分业务查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param username 用户名 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.username like %?4% and u.authority >= ?5")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String username, Integer authority, Pageable pageable);
/**
* 根据区域,用户名和负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param username 用户名 模糊
* @param leader 负责人名字 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.username like %?4% and u.leader.username like %?5% " +
"and u.authority >= ?6")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndUsernameAndLeaderUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String username, String leader, Integer authority, Pageable pageable);
/**
* 根据区域,用户名和班别分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param username 用户名 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.classType = ?4 and u.username like %?5% and u.authority >= ?6")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String classType, String username, Integer authority, Pageable pageable);
/**
* 根据区域,用户名,班别和负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param username 用户名 模糊
* @param leader 负责人名字 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.classType = ?4 and u.username like %?5% " +
"and u.leader.username like %?6% and u.authority >= ?7")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndUsernameLikeAndLeaderUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String classType, String username, String leader, Integer authority, Pageable pageable);
/**
* 根据区域,卡号分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.card like %?4% and u.authority >= ?5")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String card, Integer authority, Pageable pageable);
/**
* 根据区域,卡号和负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param card 卡号 模糊
* @param leader 负责人名字 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.card like %?4% and u.leader.username like %?5% " +
"and u.authority >= ?6")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndCardAndLeaderUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String card, String leader, Integer authority, Pageable pageable);
/**
* 根据区域,卡号和班别分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.classType = ?4 and u.card like %?5% " +
"and u.authority >= ?6")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String classType, String card, Integer authority, Pageable pageable);
/**
* 根据区域,卡号,班别和负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param leader 负责人名字 模糊
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.classType = ?4 and u.leader.username like %?5% " +
"and u.card like %?6% and u.authority >= ?7")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndLeaderUsernameLikeAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String classType, String leader, String card, Integer authority, Pageable pageable);
/**
* 根据区域,用户名,卡号分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param username 用户名 模糊
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.username like %?4% and u.card like %?5% " +
"and u.authority >= ?6")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndUsernameLikeAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String username, String card, Integer authority, Pageable pageable);
/**
* 根据区域,用户名,负责人名字和卡号分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param username 用户名 模糊
* @param leader 负责人名字 模糊
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.username like %?4% and u.leader.username like %?5% " +
"and u.card like %?6% and u.authority >= ?7")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndUsernameAndLeaderUsernameLikeAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String username, String leader, String card, Integer authority, Pageable pageable);
/**
* 根据区域,用户名和班别分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param username 用户名 模糊
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.classType = ?4 and u.username like %?5% " +
"and u.card like %?6% and u.authority >= ?7")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndUsernameLikeAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String classType, String username, String card, Integer authority, Pageable pageable);
/**
* 根据区域,用户名,班别和负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param username 用户名 模糊
* @param leader 负责人名字 模糊
* @param card 卡号 模糊
* @param authority 用户权限
* @param pageable
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.classType = ?4 and u.username like %?5% " +
"and u.leader.username like %?6% and u.card like %?7% and u.authority >= ?8")
Page<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndUsernameLikeAndLeaderUsernameLikeAndCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String classType,
String username, String leader, String card, Integer authority, Pageable pageable);
/**
* 根据用户ID和区域查找用户
* @param id 用户ID
* @param area 区域
* @return
*/
User findOneByIdAndArea(Long id, Area area);
/**
* 根据区域,用户名或者卡号查询所有用户
* @param area 区域
* @param activation 是否在回收站
* @param column 用户名或者工号 模糊
* @param authority 用户权限
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and (u.username like %?3% or u.card like %?3%) and u.authority >= ?4")
List<User> findAllByAreaAndActivationAndUsernameLikeOrCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, String column, Integer authority);
/**
* 根据区域,用户类型,用户名或者卡号查询所有用户
* @param area 区域
* @param activation 是否在回收站中
* @param type 用户类型 1 教员 0 学员
* @param column 用户名或者工号 模糊
* @param authority 用户权限
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.type = ?3 and (u.username like %?4% or u.card like %?4%) and u.authority >= ?5")
List<User> findAllByAreaAndActivationAndTypeAndUsernameLikeOrCardLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, Integer type, String column, Integer authority);
/**
* 根据区域和是否在考试队列查找用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param authority 用户权限
* @return
*/
List<User> findAllByAreaAndActivationAndBIsTestQueueAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, Integer authority);
/**
* 根据区域和负责人名字(模糊)查找用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param leader 负责人名字 模糊查询
* @param authority 用户权限
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.leader.username like %?4% and u.authority >= ?5")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndLeaderUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String leader, Integer authority);
/**
* 根据区域和班别查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param authority 用户权限
* @return
*/
List<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String classType, Integer authority);
/**
* 根据区域,班别,负责人名字查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param leader 负责人名字
* @param authority 用户权限
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 " +
"and u.bIsTestQueue = ?3 and u.classType = ?4 and u.leader.username like %?5% " +
"and u.authority >= ?6")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndLeaderUsernameLikeAndAuthorityGreaterThanEqual(
Area area, boolean activation, boolean bIsTestQueue, String classType, String leader, Integer authority);
/**
* 根据区域,用户名查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param username 用户名 模糊
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.bIsTestQueue = ?3 and u.username like %?4%")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndUsernameLike(Area area, boolean activation, boolean bIsTestQueue, String username);
/**
* 根据区域,用户名和负责人名字分页查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param username 用户名 模糊
* @param leader 负责人名字 模糊
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.bIsTestQueue = ?3 and u.username like %?4% and u.leader.username like %?5%")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndUsernameAndLeaderUsernameLike(Area area, boolean activation, boolean bIsTestQueue, String username, String leader);
/**
* 根据区域,用户名和班别查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param username 用户名 模糊
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.bIsTestQueue = ?3 and u.classType = ?4 and u.username like %?5%")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndUsernameLike(Area area, boolean activation, boolean bIsTestQueue, String classType, String username);
/**
* 根据区域,用户名,班别和负责人名字查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param username 用户名 模糊
* @param leader 负责人名字 模糊
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.bIsTestQueue = ?3 and u.classType = ?4 and u.username like %?5% and u.leader.username like %?6%")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndUsernameLikeAndLeaderUsernameLike(Area area, boolean activation, boolean bIsTestQueue, String classType, String username, String leader);
/**
* 根据区域,卡号查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param card 卡号 模糊
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.bIsTestQueue = ?3 and u.card like %?4%")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndCardLike(Area area, boolean activation, boolean bIsTestQueue, String card);
/**
* 根据区域,卡号和负责人名字查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param card 卡号 模糊
* @param leader 负责人名字 模糊
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.bIsTestQueue = ?3 and u.card like %?4% and u.leader.username like %?5%")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndCardAndLeaderUsernameLike(Area area, boolean activation, boolean bIsTestQueue, String card, String leader);
/**
* 根据区域,卡号和班别查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param card 卡号 模糊
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.bIsTestQueue = ?3 and u.classType = ?4 and u.card like %?5%")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndCardLike(Area area, boolean activation, boolean bIsTestQueue, String classType, String card);
/**
* 根据区域,卡号,班别和负责人名字查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param leader 负责人名字 模糊
* @param card 卡号 模糊
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.bIsTestQueue = ?3 and u.classType = ?4 and u.leader.username like %?5% and u.card like %?6%")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndLeaderUsernameLikeAndCardLike(Area area, boolean activation, boolean bIsTestQueue, String classType, String leader, String card);
/**
* 根据区域,用户名,卡号查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param username 用户名 模糊
* @param card 卡号 模糊
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.bIsTestQueue = ?3 and u.username like %?4% and u.card like %?5%")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndUsernameLikeAndCardLike(Area area, boolean activation, boolean bIsTestQueue, String username, String card);
/**
* 根据区域,用户名,负责人名字和卡号查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param username 用户名 模糊
* @param leader 负责人名字 模糊
* @param card 卡号 模糊
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.bIsTestQueue = ?3 and u.username like %?4% and u.leader.username like %?5% and u.card like %?6%")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndUsernameAndLeaderUsernameLikeAndCardLike(Area area, boolean activation, boolean bIsTestQueue, String username, String leader, String card);
/**
* 根据区域,用户名和班别查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param username 用户名 模糊
* @param card 卡号 模糊
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.bIsTestQueue = ?3 and u.classType = ?4 and u.username like %?5% and u.card like %?6%")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndUsernameLikeAndCardLike(
Area area, boolean activation, boolean bIsTestQueue, String classType, String username, String card);
/**
* 根据区域,用户名,班别和负责人名字查询用户
* @param area 区域
* @param activation 是否在回收站
* @param bIsTestQueue 是否在考试队列中
* @param classType 班别
* @param username 用户名 模糊
* @param leader 负责人名字 模糊
* @param card 卡号 模糊
* @return
*/
@Query(value = "select u from User u where u.area = ?1 and u.activation = ?2 and u.bIsTestQueue = ?3 and u.classType = ?4 and u.username like %?5% and u.leader.username like %?6% and u.card like %?7%")
List<User> findAllByAreaAndActivationAndBIsTestQueueAndClassTypeAndUsernameLikeAndLeaderUsernameLikeAndCardLike(
Area area, boolean activation, boolean bIsTestQueue, String classType, String username, String leader, String card);
/**
* 根据用户名查找用户
* @param username
* @return
*/
@Query(value = "select u from User u where u.username like %?1%")
List<User> findAllByUsernameLike(String username);
/**
* 根据区域获取用户
* @param area 区域
* @param activation 是否在回收站
* @return
*/
List<User> findAllByAreaAndActivation(Area area, boolean activation);
/**
* 根据区域获取正在考试或者训练的所有用户
* @param area 区域
* @param statusList 状态集合
* @param pageable
* @return
*/
Page<User> findAllByAreaAndStatusIn(Area area, List<Integer> statusList, Pageable pageable);
/**
* 根据区域获取用户
* @param area
* @return
*/
List<User> findAllByArea(Area area);
List<User> findAllByAreaAndBIsTestQueue(Area area, boolean bIsTestQueue);
/**
* 根据用户权限查找用户
* @param authority
* @return
*/
User findOneByAuthority(Integer authority);
}
package cn.com.sailfish.linghang.resource;
import cn.com.sailfish.linghang.dao.web.response.AreaResponseDTO;
import cn.com.sailfish.linghang.dao.web.response.WebUserResponseDTO;
import cn.com.sailfish.linghang.domain.Area;
import cn.com.sailfish.linghang.domain.User;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.service.AreaService;
import cn.com.sailfish.linghang.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-24 18:25:19
* Description:
*
* @author huangpeilin
*/
@Component
public class AreaResource {
public final Logger log = LoggerFactory.getLogger(AreaResource.class);
private AreaService areaService;
private UserService userService;
@Autowired
public AreaResource(AreaService areaService, UserService userService) {
this.areaService = areaService;
this.userService = userService;
}
/**
* 获取所有的区域
* @return
*/
public List<AreaResponseDTO> findAllArea() throws ServerErrorException {
User user = userService.getCurrentUser();
List<Area> areaList = areaService.findAllArea(user);
return getAreaResponseDTOList(areaList);
}
/**
* 获取某个区域下的所有职位
* @return
*/
public List<AreaResponseDTO> findAllAreaByPosition() throws ServerErrorException {
User user = userService.getCurrentUser();
List<Area> areaList = areaService.findAllAreaByPosition(user);
return getAreaResponseDTOList(areaList);
}
private List<AreaResponseDTO> getAreaResponseDTOList(List<Area> areaList) {
List<AreaResponseDTO> areaResponseDTOList = new ArrayList<>();
if (!CollectionUtils.isEmpty(areaList)){
for (Area area : areaList) {
// 开发部为开发专用,隐藏
if (area.getId() != 3){
AreaResponseDTO areaResponseDTO = new AreaResponseDTO();
areaResponseDTO.setId(area.getId());
areaResponseDTO.setName(area.getName());
areaResponseDTO.setPosition(area.getPosition());
areaResponseDTOList.add(areaResponseDTO);
}
}
}
return areaResponseDTOList;
}
}
package cn.com.sailfish.linghang.resource;
import com.google.code.kaptcha.Producer;
import com.google.code.kaptcha.servlet.KaptchaExtend;
import com.google.code.kaptcha.util.Config;
import org.springframework.stereotype.Component;
import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Date;
import java.util.Properties;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-07-05 9:54:50
* Description:
*/
@Component
public class CaptchaResource extends KaptchaExtend {
private Properties props = new Properties();
private Producer kaptchaProducer = null;
private String sessionKeyValue = null;
private String sessionKeyDateValue = null;
public CaptchaResource() {
ImageIO.setUseCache(false);
this.props.put("kaptcha.border", "no");
this.props.put("kaptcha.textproducer.font.color", "black");
this.props.put("kaptcha.textproducer.char.string", "0123456789");
//验证码位数
this.props.put("kaptcha.textproducer.char.length", "4");
this.props.put("kaptcha.textproducer.char.space", "5");
Config config = new Config(this.props);
this.kaptchaProducer = config.getProducerImpl();
this.sessionKeyValue = config.getSessionKey();
this.sessionKeyDateValue = config.getSessionDate();
}
@Override
public void captcha(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setHeader("Cache-Control", "no-store, no-cache");
resp.setContentType("image/jpeg");
String capText = this.kaptchaProducer.createText();
req.getSession().setAttribute(this.sessionKeyValue, capText);
req.getSession().setAttribute(this.sessionKeyDateValue, new Date());
BufferedImage bi = this.kaptchaProducer.createImage(capText);
ServletOutputStream out = resp.getOutputStream();
ImageIO.write(bi, "jpg", out);
req.getSession().setAttribute(this.sessionKeyValue, capText);
req.getSession().setAttribute(this.sessionKeyDateValue, new Date());
}
@Override
public String getGeneratedKey(HttpServletRequest req) {
HttpSession session = req.getSession();
return (String)session.getAttribute("KAPTCHA_SESSION_KEY");
}
}
package cn.com.sailfish.linghang.resource;
import cn.com.sailfish.linghang.dao.web.response.*;
import cn.com.sailfish.linghang.domain.*;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.repository.CourseRepository;
import cn.com.sailfish.linghang.service.CourseService;
import org.hibernate.LazyInitializationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
import static cn.com.sailfish.linghang.enumeration.QuestionPaperConstant.EXCEPTION_ITEM_IS_NOT_SPECIAL_ITEM;
/**
* Author: huangpeilin
* Create at: 2019-04-25 15:57:13
* Description:
*
* @author huangpeilin
*/
@Component
public class CourseResource {
private final Logger log = LoggerFactory.getLogger(CourseResource.class);
private CourseService courseService;
@Autowired
public CourseResource(CourseService courseService){
this.courseService = courseService;
}
/**
* 根据课程ID获取课程信息
* @param id
* @return
* @throws ServerErrorException
*/
@Transactional(rollbackFor = LazyInitializationException.class)
public CourseInfoResponseDTO findOneCourseById(Long id) throws ServerErrorException {
Course course = courseService.confirmCourseIsExist(id);
return courseToCourseInfoResponseDTO(course, true);
}
/**
* 获取所有课程
* @return
*/
public List<CourseInfoResponseDTO> findAllCourse() {
List<Course> courseList = courseService.findAllCourse();
List<CourseInfoResponseDTO> courseInfoResponseDTOList = new ArrayList<>();
if (!CollectionUtils.isEmpty(courseList)){
for (Course course : courseList){
CourseInfoResponseDTO courseInfoResponseDTO = courseToCourseInfoResponseDTO(course, false);
courseInfoResponseDTOList.add(courseInfoResponseDTO);
}
}
return courseInfoResponseDTOList;
}
/**
* 将课程的详细信息封装为CourseInfoResponseDTO类
* @param course
* @param isAllMessage 是否获取检查项异常项的详情 true 是 false 不是
* @return
*/
private CourseInfoResponseDTO courseToCourseInfoResponseDTO(Course course, Boolean isAllMessage) {
CourseInfoResponseDTO courseInfoResponseDTO = new CourseInfoResponseDTO();
if (course != null) {
courseInfoResponseDTO.setChineseName(course.getChineseName());
if (course.getGmtCreated() != null){
courseInfoResponseDTO.setCreateTime(course.getGmtCreated().toEpochMilli());
}
courseInfoResponseDTO.setId(course.getId());
courseInfoResponseDTO.setName(course.getName());
courseInfoResponseDTO.setTotalAbnormals(course.getTotalAbnormals());
courseInfoResponseDTO.setDivision(course.getDivision());
if (course.getModel() != null) {
ModelResponseDTO modelResponseDTO = new ModelResponseDTO();
modelResponseDTO.setBrand(course.getModel().getBrand());
modelResponseDTO.setName(course.getModel().getName());
modelResponseDTO.setId(course.getModel().getId());
courseInfoResponseDTO.setModel(modelResponseDTO);
}
if (course.getEngine() != null) {
EngineResponseDTO engineResponseDTO = new EngineResponseDTO();
engineResponseDTO.setId(course.getEngine().getId());
engineResponseDTO.setType(course.getEngine().getType());
engineResponseDTO.setName(course.getEngine().getName());
courseInfoResponseDTO.setEngine(engineResponseDTO);
}
if(isAllMessage){
setCheckItemListToCourseInfoResponseDTO(courseInfoResponseDTO, course);
setExceptionItemListToCourseInfoResponseDTO(courseInfoResponseDTO, course);
}
}
return courseInfoResponseDTO;
}
/**
* 将检查项数据封装到CourseInfoResponseDTO类中
* @param courseInfoResponseDTO
* @param course
*/
public void setCheckItemListToCourseInfoResponseDTO(CourseInfoResponseDTO courseInfoResponseDTO, Course course) {
List<CheckItemResponseDTO> checkItemResponseDTOList = new ArrayList<>();
if (course != null) {
List<CheckItem> checkItemList = course.getCheckItem();
if (!CollectionUtils.isEmpty(checkItemList)) {
for (CheckItem checkItem : checkItemList) {
CheckItemResponseDTO checkItemResponseDTO = new CheckItemResponseDTO();
checkItemResponseDTO.setId(checkItem.getId());
checkItemResponseDTO.setEngineType(checkItem.getEngine().getType());
checkItemResponseDTO.setName(checkItem.getName());
checkItemResponseDTO.setChineseName(checkItem.getChineseName());
checkItemResponseDTO.setRegion(checkItem.getRegion());
checkItemResponseDTOList.add(checkItemResponseDTO);
}
}
}
courseInfoResponseDTO.setCheckItemList(checkItemResponseDTOList);
}
/**
* 将异常项项数据封装到CourseInfoResponseDTO类中
* @param courseInfoResponseDTO
* @param course
*/
public void setExceptionItemListToCourseInfoResponseDTO(CourseInfoResponseDTO courseInfoResponseDTO, Course course) {
List<ExceptionItemResponseDTO> exceptionItemResponseDTOList = new ArrayList<>();
if (course != null){
List<ExceptionItem> exceptionItemList = course.getExceptionItem();
if (!CollectionUtils.isEmpty(exceptionItemList)) {
for (ExceptionItem exceptionItem : exceptionItemList) {
ExceptionItemResponseDTO exceptionItemResponseDTO = new ExceptionItemResponseDTO();
exceptionItemResponseDTO.setEngineType(exceptionItem.getEngine().getType());
exceptionItemResponseDTO.setId(exceptionItem.getId());
exceptionItemResponseDTO.setRegion(exceptionItem.getRegion());
exceptionItemResponseDTO.setName(exceptionItem.getName());
exceptionItemResponseDTO.setChineseName(exceptionItem.getDetails());
exceptionItemResponseDTOList.add(exceptionItemResponseDTO);
}
}
}
courseInfoResponseDTO.setExceptionItemList(exceptionItemResponseDTOList);
}
public void importCourse(MultipartFile file) throws ServerErrorException {
courseService.importCourse(file);
}
}
package cn.com.sailfish.linghang.resource;
import cn.com.sailfish.linghang.dao.web.response.EngineResponseDTO;
import cn.com.sailfish.linghang.domain.Engine;
import cn.com.sailfish.linghang.service.EngineService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-25 14:09:54
* Description:
*
* @author huangpeilin
*/
@Component
public class EngineResource {
public final Logger log = LoggerFactory.getLogger(EngineResource.class);
private EngineService engineService;
@Autowired
public EngineResource(EngineService engineService){
this.engineService = engineService;
}
/**
* 获取所有发动机
* @return
*/
public List<EngineResponseDTO> findAllEngine() {
List<Engine> engineList = engineService.findAllEngine();
List<EngineResponseDTO> engineResponseDTOList = new ArrayList<>();
if (!CollectionUtils.isEmpty(engineList)){
for (Engine engine : engineList){
EngineResponseDTO engineResponseDTO = new EngineResponseDTO();
engineResponseDTO.setId(engine.getId());
engineResponseDTO.setName(engine.getName());
engineResponseDTO.setType(engine.getType());
engineResponseDTOList.add(engineResponseDTO);
}
}
return engineResponseDTOList;
}
}
package cn.com.sailfish.linghang.resource;
import cn.com.sailfish.linghang.dao.web.request.*;
import cn.com.sailfish.linghang.dao.web.response.*;
import cn.com.sailfish.linghang.domain.*;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.service.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import static cn.com.sailfish.linghang.common.ErrorConstants.INSUFFICIENT_USER_PERMISSION;
import static cn.com.sailfish.linghang.common.ErrorConstants.USER_OPERATE_ACROSS_REGION;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.CLASS_TYPE_HIGH;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.CLASS_TYPE_JUNIOR;
import static cn.com.sailfish.linghang.security.SystemPrivilege.ADMIN_INT;
import static cn.com.sailfish.linghang.security.SystemPrivilege.INSTRUCTOR_INT;
/**
* Author: huangpeilin
* Create at: 2019-04-26 15:36:34
* Description:
*
* @author huangpeilin
*/
@Component
public class ExamResource {
public final Logger log = LoggerFactory.getLogger(ExamResource.class);
private ExamService examService;
private UserService userService;
private AreaService areaService;
private ReportCardService reportCardService;
private QuestionPaperService questionPaperService;
@Autowired
public ExamResource(ExamService examService, UserService userService, AreaService areaService,
ReportCardService reportCardService, QuestionPaperService questionPaperService){
this.examService = examService;
this.userService = userService;
this.areaService = areaService;
this.reportCardService = reportCardService;
this.questionPaperService = questionPaperService;
}
/**
* 获取某个区域下所有在考试队列的人
* @param areaId 区域ID
* @param card 用户工号
* @param username 用户名字
* @param classType 班别
* @param leader 负责人名字
* @return
* @throws ServerErrorException
*/
public List<WebExamUserMessageResponseDTO> findAllUserInTheExamQueue(
Long areaId, String card, String username, String classType, String leader) throws ServerErrorException {
List<WebExamUserMessageResponseDTO> webExamUserMessageResponseDTOList = new ArrayList<>();
User currentUser = userService.getCurrentUser();
Area area = areaService.confirmAreaIsExist(areaId);
List<User> userList = new ArrayList<>();
if (currentUser.getAuthority() <= ADMIN_INT && currentUser.getEnable()){
userList = userService.findAllUserByBIsTestQueue(area, card, username, classType, leader, true);
}else if(currentUser.getAuthority() >= INSTRUCTOR_INT && currentUser.getEnable()){
if (areaId.equals(currentUser.getArea().getId())){
userList = userService.findAllUserByBIsTestQueue(area, card, username, classType, leader, true);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
if (!CollectionUtils.isEmpty(userList)){
for(User user : userList){
WebExamUserMessageResponseDTO webExamUserMessageResponseDTO = new WebExamUserMessageResponseDTO();
webExamUserMessageResponseDTO.setClassType(user.getClassType());
webExamUserMessageResponseDTO.setCard(user.getCard());
webExamUserMessageResponseDTO.setUsername(user.getUsername());
webExamUserMessageResponseDTO.setUserId(user.getId());
if (user.getLeader() != null){
webExamUserMessageResponseDTO.setLeaderName(user.getLeader().getUsername());
}
if (!user.getBIsNewAddTestQueue()){
// 获取不在回收站中的成绩单
List<ReportCard> reportCardList = reportCardService.findAllReportCardByUserCard(user.getCard(), false);
if (!CollectionUtils.isEmpty(reportCardList)){
// 获取第一条数据,最新的数据
ReportCard reportCard = reportCardList.get(0);
if (reportCard.getQuestionPaper() != null){
webExamUserMessageResponseDTO.setQuestionPaperId(reportCard.getQuestionPaper().getId());
webExamUserMessageResponseDTO.setQuestionPaperName(reportCard.getQuestionPaper().getTitle());
}
webExamUserMessageResponseDTO.setSwitchStatus(reportCard.getSwitchStatus());
webExamUserMessageResponseDTO.setCompletionStatus(reportCard.getCompletionStatus());
if (reportCard.getExam() != null){
webExamUserMessageResponseDTO.setExamId(reportCard.getExam().getId());
webExamUserMessageResponseDTO.setInvigilator(reportCard.getExam().getInvigilator());
}
}
}
webExamUserMessageResponseDTOList.add(webExamUserMessageResponseDTO);
}
}
return webExamUserMessageResponseDTOList;
}
/**
* 获取当前登录用户最近一次指定的监考人
* @return
*/
public String getInvigilator() throws ServerErrorException {
User user = userService.getCurrentUser();
return user.getInvigilatorMessage();
}
/**
* 指定用户参与考试
* @param requestDTO
*/
public void appointUserTest(AppointUserTestRequestDTO requestDTO) throws ServerErrorException {
User currentUser = userService.getCurrentUser();
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
QuestionPaper questionPaper = questionPaperService.confirmQuestionPaperIsExist(requestDTO.getQuestionPaperId());
if (currentUser.getAuthority() <= ADMIN_INT && currentUser.getEnable()){
log.info("{} designated user exam, question paper name is {}.", currentUser.getUsername(), questionPaper.getTitle());
makeUserTest(requestDTO, area, questionPaper);
}else if(currentUser.getAuthority() >= INSTRUCTOR_INT && currentUser.getEnable()){
if (requestDTO.getAreaId().equals(currentUser.getArea().getId())){
log.info("{} designated user exam, question paper name is {}.", currentUser.getUsername(), questionPaper.getTitle());
makeUserTest(requestDTO, area, questionPaper);
}else{
log.error("{} operate across regions.", currentUser.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", currentUser.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
}
/**
* 指定用户考试
* @param requestDTO
* @param questionPaper
* @throws ServerErrorException
*/
private void makeUserTest(AppointUserTestRequestDTO requestDTO, Area area, QuestionPaper questionPaper) throws ServerErrorException {
List<String> invigilators = new ArrayList<>();
for(Long invigilatorId : requestDTO.getInvigilatorIds()){
User invigilator = userService.confirmUserIsExist(invigilatorId);
invigilators.add(invigilator.getUsername());
}
// 初级班的考试用户
List<User> juniorExamUserList = new ArrayList<>();
// 高级班的考试用户
List<User> highExamUserList = new ArrayList<>();
for (Long examUserId : requestDTO.getExamUserIds()){
User examUser = userService.confirmUserIsExist(examUserId);
if (CLASS_TYPE_JUNIOR.equals(examUser.getClassType())){
juniorExamUserList.add(examUser);
}else if(CLASS_TYPE_HIGH.equals(examUser.getClassType())){
highExamUserList.add(examUser);
}
}
Long examTime = requestDTO.getExamTime();
examService.appointUserTest(area, invigilators, juniorExamUserList, highExamUserList, questionPaper, examTime, requestDTO.getType());
}
/**
* 检查是否可以指定用户考试
* @param requestDTO
* @return
*/
public CheckExamUserTestResponseDTO checkAppointUserTest(AppointUserTestRequestDTO requestDTO) throws ServerErrorException {
// 要指定的考试用户
List<User> examUserList = new ArrayList<>();
for (Long examUserId : requestDTO.getExamUserIds()){
User examUser = userService.confirmUserIsExist(examUserId);
examUserList.add(examUser);
}
QuestionPaper questionPaper = questionPaperService.confirmQuestionPaperIsExist(requestDTO.getQuestionPaperId());
List<User> userList = examService.checkAppointUserTest(questionPaper, examUserList);
return userListToCheckExamUserTestResponseDTO(userList);
}
/**
* 检测是否可以开启考试
* @param requestDTO
* @return
*/
public CheckExamUserTestResponseDTO checkTestStart(OperationUserTestRequestDTO requestDTO) throws ServerErrorException {
List<User> userList = new ArrayList<>();
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
User user = userService.getCurrentUser();
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
userList = examService.checkTestStart(requestDTO.getList());
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
userList = examService.checkTestStart(requestDTO.getList());
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return userListToCheckExamUserTestResponseDTO(userList);
}
/**
* 开启考试
* @param requestDTO
* @return
*/
public void testStart(OperationUserTestRequestDTO requestDTO) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
User user = userService.getCurrentUser();
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
log.info("{} open the test. ", user.getUsername());
examService.testStart(requestDTO.getList());
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
log.info("{} open the test. ", user.getUsername());
examService.testStart(requestDTO.getList());
}else{
log.error("{} operate across regions.", user.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", user.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
}
/**
* 关闭考试
* @param requestDTO
* @return
*/
public void testClose(OperationUserTestRequestDTO requestDTO) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
User user = userService.getCurrentUser();
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
log.info("{} close the test. ", user.getUsername());
examService.testClose(requestDTO.getList());
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
log.info("{} close the test. ", user.getUsername());
examService.testClose(requestDTO.getList());
}else{
log.error("{} operate across regions.", user.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", user.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
}
/**
* 新增或者删除考试队列的用户
* @param requestDTO
* @param isAdd
* @throws ServerErrorException
*/
public void operationUserInTheExamQueue(UserTestQueueRequestDTO requestDTO, Boolean isAdd) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
User user = userService.getCurrentUser();
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
if (isAdd) {
log.info("{} queues the user for exam.", user.getUsername());
} else {
log.info("{} moves the user out of the exam queue.", user.getUsername());
}
userService.operationUserInTheExamQueue(requestDTO.getExamUserIds(), isAdd);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
if (isAdd){
log.info("{} queues the user for exam.", user.getUsername());
}else{
log.info("{} moves the user out of the exam queue.", user.getUsername());
}
userService.operationUserInTheExamQueue(requestDTO.getExamUserIds(), isAdd);
}else{
log.error("{} operate across regions.", user.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", user.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
}
/**
* 封装重考用户数据
* @param userList
* @return
*/
private CheckExamUserTestResponseDTO userListToCheckExamUserTestResponseDTO(List<User> userList){
CheckExamUserTestResponseDTO checkExamUserTestResponseDTO = new CheckExamUserTestResponseDTO();
List<String> usernameList = new ArrayList<>();
if (!CollectionUtils.isEmpty(userList)){
checkExamUserTestResponseDTO.setResult(false);
for(User user : userList){
usernameList.add(user.getUsername());
}
}else{
checkExamUserTestResponseDTO.setResult(true);
}
checkExamUserTestResponseDTO.setUsernameList(usernameList);
return checkExamUserTestResponseDTO;
}
/**
* 新增监考老师
* @param ids
*/
public void addInvigilator(List<Long> ids) throws ServerErrorException {
userService.addInvigilator(ids);
}
/**
* 根据考试时间和试卷名字查看某个班别的所有考试
* @param areaId 区域ID
* @param bIsDelete 是否删除 false 否 true 是
* @param invigilator 监考人名字
* @param classType 班别
* @param examTime 考试时间
* @param questionPaperName 试卷名字
* @param page 页数
* @param pageSize 每一页的记录数
*/
public PageResponse<ExamMessageResponseDTO> findAllExamByCondition(
Long areaId, Boolean bIsDelete, String invigilator, String classType, Long examTime,
String questionPaperName, Integer page, Integer pageSize) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
User user = userService.getCurrentUser();
Page<Exam> examPage = null;
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
log.info("{} find all exam by condition.", user.getUsername());
examPage = examService.findAllExamByCondition(area, bIsDelete, invigilator, classType, examTime, questionPaperName, page, pageSize);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
log.info("{} find all exam by condition.", user.getUsername());
examPage = examService.findAllExamByCondition(area, bIsDelete, invigilator, classType, examTime, questionPaperName, page, pageSize);
}else{
log.error("{} operate across regions.", user.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", user.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return toExamPageResponse(examPage);
}
/**
* 操作考试的成绩单
* @param requestDTO
* @param bIsDelete
*/
public void operationExamInRecycle(WebExamOperationRequestDTO requestDTO, boolean bIsDelete) throws ServerErrorException {
User user = userService.getCurrentUser();
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
if (bIsDelete){
log.info("{} puts the transcript of an exam in the recycling bin.", user.getUsername());
}else{
log.info("{} recovers the report card from the recycle bin.", user.getUsername());
}
examService.operationExamInRecycle(requestDTO.getIds(), bIsDelete);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
if (bIsDelete){
log.info("{} puts the transcript of an exam in the recycling bin.", user.getUsername());
}else{
log.info("{} recovers the report card from the recycle bin.", user.getUsername());
}
examService.operationExamInRecycle(requestDTO.getIds(), bIsDelete);
}else{
log.error("{} operate across regions.", user.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", user.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
}
public PageResponse<ExamMessageResponseDTO> toExamPageResponse(Page<Exam> examPage){
PageResponse<ExamMessageResponseDTO> examMessageResponseDTOPage = new PageResponse<>();
List<ExamMessageResponseDTO> examMessageResponseDTOList = new ArrayList<>();
if (!CollectionUtils.isEmpty(examPage.getContent())){
for (Exam exam : examPage.getContent()){
ExamMessageResponseDTO examMessageResponseDTO = examToExamMessageResponseDTO(exam);
examMessageResponseDTOList.add(examMessageResponseDTO);
}
}
examMessageResponseDTOPage.setPageIndex(examPage.getPageable().getPageNumber() + 1);
examMessageResponseDTOPage.setPageSize(examPage.getPageable().getPageSize());
examMessageResponseDTOPage.setTotalCount(examPage.getTotalElements());
examMessageResponseDTOPage.setTotalPageCount(examPage.getTotalPages());
examMessageResponseDTOPage.setList(examMessageResponseDTOList);
return examMessageResponseDTOPage;
}
public ExamMessageResponseDTO examToExamMessageResponseDTO(Exam exam){
ExamMessageResponseDTO examMessageResponseDTO = new ExamMessageResponseDTO();
examMessageResponseDTO.setClassType(exam.getClassType());
examMessageResponseDTO.setExamId(exam.getId());
if (exam.getExamTime() != null){
examMessageResponseDTO.setExamTime(exam.getExamTime().toEpochMilli());
}
if(exam.getQuestionPaper() != null){
examMessageResponseDTO.setQuestionPaperId(exam.getQuestionPaper().getId());
examMessageResponseDTO.setQuestionPaperName(exam.getQuestionPaper().getTitle());
}
examMessageResponseDTO.setInvigilator(exam.getInvigilator());
examMessageResponseDTO.setRemark(exam.getRemarks());
return examMessageResponseDTO;
}
public WebCheckUserTestQueueResponseDTO checkRemoveUserInTheExamQueue(WebCheckUserTestQueueRequestDTO requestDTO) throws ServerErrorException {
WebCheckUserTestQueueResponseDTO webCheckUserTestQueueResponseDTO = null;
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
User user = userService.getCurrentUser();
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
webCheckUserTestQueueResponseDTO = userService.checkRemoveUserInTheExamQueue(requestDTO.getList());
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
webCheckUserTestQueueResponseDTO = userService.checkRemoveUserInTheExamQueue(requestDTO.getList());
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return webCheckUserTestQueueResponseDTO;
}
/**
* 根据考试ID设置班级成绩单的备注
* @param examId
* @param remarks
*/
public void setRemarkByExamId(Long examId, String remarks) throws ServerErrorException {
examService.setRemarkByExamId(remarks, examId);
}
}
package cn.com.sailfish.linghang.resource;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.service.FileService;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Author: huangpeilin
* Create at: 2019-05-07 14:59:49
* Description:
*
* @author huangpeilin
*/
@Component
public class FileResource {
public final Logger log = LoggerFactory.getLogger(FileResource.class);
private FileService fileService;
@Autowired
public FileResource(FileService fileService) {
this.fileService = fileService;
}
/**
* 文件下载
* @param key
* @param response
* @throws IOException
*/
public void downloadFile(String key, HttpServletResponse response) throws IOException {
fileService.downloadFile(key, response);
}
/**
* 文件上传
* @param file
* @param key
* @return
*/
public JSONObject uploadFile(MultipartFile file, String key) throws IOException, ServerErrorException {
return fileService.uploadFile(file, key);
}
/**
* 删除文件
* @param key
* @throws ServerErrorException
*/
public void deleteFile(String key) throws ServerErrorException {
fileService.deleteFile(key);
}
}
package cn.com.sailfish.linghang.resource;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.service.ItemService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
/**
* @author huangpeilin<plhuang @ sailfish.com.cn>
* Create at: 2019-06-03 15:12:21
* Description:
*/
@Component
public class ItemResource {
private final Logger log = LoggerFactory.getLogger(ItemResource.class);
private ItemService itemService;
@Autowired
public ItemResource(ItemService itemService){
this.itemService = itemService;
}
/**
* 导入检查项数据
* @param file
* @throws ServerErrorException
*/
public void importCheckItem(MultipartFile file) throws ServerErrorException {
itemService.importCheckItem(file);
}
/**
* 导入异常项数据
* @param file
*/
public void importExceptionItem(MultipartFile file) throws ServerErrorException {
itemService.importExceptionItem(file);
}
}
package cn.com.sailfish.linghang.resource;
import cn.com.sailfish.linghang.dao.web.response.ModelResponseDTO;
import cn.com.sailfish.linghang.domain.Model;
import cn.com.sailfish.linghang.service.ModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Author: huangpeilin
* Create at: 2019-04-25 10:42:54
* Description:
*
* @author huangpeilin
*/
@Component
public class ModelResource {
public final Logger log = LoggerFactory.getLogger(ModelResource.class);
private ModelService modelService;
@Autowired
public ModelResource(ModelService modelService){
this.modelService = modelService;
}
/**
* 获取系统中所有的机型品牌
* @return
*/
public List<String> findAllBrand() {
return modelService.findAllBrand();
}
/**
* 根据机型品牌获取所有机型
* @param brand 品牌
* @return
*/
public List<ModelResponseDTO> findAllModelByBrand(String brand) {
List<Model> modelList = modelService.findAllModelByBrand(brand);
return modelListToModelResponseDTOList(modelList);
}
public List<ModelResponseDTO> findAllModel() {
List<Model> modelList = modelService.findAllModel();
return modelListToModelResponseDTOList(modelList);
}
/**
* 将Model的List集合装化为ModelResponseDTO的List集合
* @param modelList
* @return
*/
private List<ModelResponseDTO> modelListToModelResponseDTOList(List<Model> modelList){
List<ModelResponseDTO> modelResponseDTOList = new ArrayList<>();
if (!CollectionUtils.isEmpty(modelList)) {
for (Model model : modelList) {
ModelResponseDTO modelResponseDTO = modelToModelResponseDTO(model);
modelResponseDTOList.add(modelResponseDTO);
}
}
return modelResponseDTOList;
}
/**
* 封装机型的装化数据
* @return
*/
private ModelResponseDTO modelToModelResponseDTO(Model model){
ModelResponseDTO modelResponseDTO = new ModelResponseDTO();
modelResponseDTO.setBrand(model.getBrand());
modelResponseDTO.setId(model.getId());
modelResponseDTO.setName(model.getName());
return modelResponseDTO;
}
}
package cn.com.sailfish.linghang.resource;
import cn.com.sailfish.linghang.dao.vr.request.VrOperationRecordRequestDTO;
import cn.com.sailfish.linghang.dao.web.response.*;
import cn.com.sailfish.linghang.domain.*;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.repository.*;
import cn.com.sailfish.linghang.service.AreaService;
import cn.com.sailfish.linghang.service.OperationRecordService;
import cn.com.sailfish.linghang.service.UserService;
import cn.com.sailfish.linghang.util.IPUtil;
import cn.com.sailfish.linghang.util.TimeUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import static cn.com.sailfish.linghang.common.ErrorConstants.*;
import static cn.com.sailfish.linghang.enumeration.Constants.GMT_CREATED;
import static cn.com.sailfish.linghang.enumeration.OperationRecordConstant.OPERATION_RECORD_TYPE_EXAM;
import static cn.com.sailfish.linghang.enumeration.OperationRecordConstant.OPERATION_RECORD_TYPE_EXERCISE;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.*;
import static cn.com.sailfish.linghang.security.SystemPrivilege.ADMIN_INT;
import static cn.com.sailfish.linghang.security.SystemPrivilege.INSTRUCTOR_INT;
/**
* Author: huangpeilin
* Create at: 2019-05-05 11:01:02
* Description:
*
* @author huangpeilin
*/
@Component
public class OperationRecordResource {
public final Logger log = LoggerFactory.getLogger(OperationRecordResource.class);
private OperationRecordService operationRecordService;
private UserRepository userRepository;
private CourseRepository courseRepository;
private ExamRepository examRepository;
private ReportCardRepository reportCardRepository;
private AreaRepository areaRepository;
private UserService userService;
private AreaService areaService;
private OperationRecordRepository operationRecordRepository;
@Autowired
public OperationRecordResource(OperationRecordService operationRecordService, UserRepository userRepository,
CourseRepository courseRepository, ExamRepository examRepository,
ReportCardRepository reportCardRepository, AreaRepository areaRepository,
UserService userService, AreaService areaService, OperationRecordRepository operationRecordRepository){
this.operationRecordService = operationRecordService;
this.userRepository = userRepository;
this.courseRepository = courseRepository;
this.examRepository = examRepository;
this.reportCardRepository = reportCardRepository;
this.areaRepository = areaRepository;
this.userService = userService;
this.areaService = areaService;
this.operationRecordRepository = operationRecordRepository;
}
/**
* 根据工号,姓名,日期,试卷或者课程名字搜索操作记录
* @param areaId
* @param type 操作的类型 0 训练 1 考试
* @param name 试卷名字或者课程名字 由操作类型决定
* @param card 工号
* @param dateTime 用户名字
* @param username 时间日期
* @param page 页数
* @param pageSize 每一页的条数
*/
public PageResponse<OperationRecordResponseDTO> findAllOperationRecordByCondition(
Long areaId, Integer type, String name, String card, Long dateTime, String username, Integer page, Integer pageSize) throws ServerErrorException {
User currentUser = userService.getCurrentUser();
Area area = areaService.confirmAreaIsExist(areaId);
Page<OperationRecord> operationRecordPage;
if (currentUser.getAuthority() <= ADMIN_INT && currentUser.getEnable()){
operationRecordPage = operationRecordService.findAllOperationRecordByCondition(area, type, name, card, dateTime, username, page, pageSize);
}else if(currentUser.getAuthority() >= INSTRUCTOR_INT && currentUser.getEnable()){
if (areaId.equals(currentUser.getArea().getId())){
operationRecordPage = operationRecordService.findAllOperationRecordByCondition(area, type, name, card, dateTime, username, page, pageSize);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return operationRecordPageToPageResponse(operationRecordPage, type);
}
/**
* 根据区域搜索操作记录
* @param areaId 区域ID
* @param status 0 考试 1 训练
* @param page
* @param pageSize
* @return
*/
public PageResponse<OperationRecordResponseDTO> findAllOperationRecordByArea(Long areaId, Integer status, Integer page, Integer pageSize) throws ServerErrorException {
User currentUser = userService.getCurrentUser();
Area area = areaService.confirmAreaIsExist(areaId);
Page<OperationRecord> operationRecordPage;
if (currentUser.getAuthority() <= ADMIN_INT && currentUser.getEnable()){
operationRecordPage = operationRecordService.findAllByArea(area, status, page, pageSize);
}else if(currentUser.getAuthority() >= INSTRUCTOR_INT && currentUser.getEnable()){
if (areaId.equals(currentUser.getArea().getId())){
operationRecordPage = operationRecordService.findAllByArea(area, status, page, pageSize);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return operationRecordPageToPageResponse(operationRecordPage, status);
}
/**
* 根据用户工号搜索训练操作记录
* @param areaId 区域ID
* @param card 工号
* @param page
* @param pageSize
* @return
*/
public OperationRecordPracticeResponseDTO findAllOperationRecordByUserAndPractice(Long areaId, String card, Integer page, Integer pageSize) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
User currentUser = userService.getCurrentUser();
OperationRecordPracticeResponseDTO operationRecordPracticeResponseDTO;
if (currentUser.getAuthority() <= ADMIN_INT && currentUser.getEnable()){
log.info("{} find practice operation record by card {}.", currentUser.getUsername(), card);
operationRecordPracticeResponseDTO = getAllOperationRecordByUserAndPractice(area, card, page, pageSize);
}else if(currentUser.getAuthority() >= INSTRUCTOR_INT && currentUser.getEnable()){
if (areaId.equals(currentUser.getArea().getId())){
log.info("{} find practice operation record by card {}.", currentUser.getUsername(), card);
operationRecordPracticeResponseDTO = getAllOperationRecordByUserAndPractice(area, card, page, pageSize);
}else{
log.error("{} operate across regions.", currentUser.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", currentUser.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return operationRecordPracticeResponseDTO;
}
/**
* 根据用户工号搜索训练操作记录
* @param area
* @param card
* @param page
* @param pageSize
* @return
* @throws ServerErrorException
*/
private OperationRecordPracticeResponseDTO getAllOperationRecordByUserAndPractice(Area area, String card, Integer page, Integer pageSize) throws ServerErrorException {
OperationRecordPracticeResponseDTO operationRecordPracticeResponseDTO = new OperationRecordPracticeResponseDTO();
User user = userService.checkUserByCard(card);
operationRecordPracticeResponseDTO.setCard(card);
operationRecordPracticeResponseDTO.setClassType(user.getClassType());
if (user.getArea() != null){
operationRecordPracticeResponseDTO.setOrganizationName(user.getArea().getName());
operationRecordPracticeResponseDTO.setPosition(user.getArea().getPosition());
}
operationRecordPracticeResponseDTO.setUserId(user.getId());
operationRecordPracticeResponseDTO.setUsername(user.getUsername());
Page<OperationRecord> operationRecordPage = operationRecordService
.findAllOperationRecordByUserCardAndType(area, OPERATION_RECORD_TYPE_EXERCISE, card, page, pageSize);
List<OperationRecordPracticeDTO> operationRecordPracticeDTOList = new ArrayList<>();
if (!CollectionUtils.isEmpty(operationRecordPage.getContent())){
for(OperationRecord operationRecord : operationRecordPage.getContent()){
OperationRecordPracticeDTO operationRecordPracticeDTO = new OperationRecordPracticeDTO();
if (operationRecord.getCourseId() != null){
operationRecordPracticeDTO.setCourseId(operationRecord.getCourseId());
Course course = courseRepository.findOneById(operationRecord.getCourseId());
if (course != null){
operationRecordPracticeDTO.setCourseChineseName(course.getChineseName());
operationRecordPracticeDTO.setCourseName(course.getName());
}
}
operationRecordPracticeDTO.setStartTime(TimeUtil.instantToTimestamp(operationRecord.getStartTime()));
operationRecordPracticeDTO.setEndTime(TimeUtil.instantToTimestamp(operationRecord.getEndTime()));
operationRecordPracticeDTO.setLoginTime(TimeUtil.instantToTimestamp(operationRecord.getLoginTime()));
operationRecordPracticeDTO.setLogoutTime(TimeUtil.instantToTimestamp(operationRecord.getLogoutTime()));
operationRecordPracticeDTOList.add(operationRecordPracticeDTO);
}
}
operationRecordPracticeResponseDTO.setPageIndex(operationRecordPage.getPageable().getPageNumber() + 1);
operationRecordPracticeResponseDTO.setTotalPageCount(operationRecordPage.getTotalPages());
operationRecordPracticeResponseDTO.setPageSize(operationRecordPage.getPageable().getPageSize());
operationRecordPracticeResponseDTO.setTotalCount(operationRecordPage.getTotalElements());
operationRecordPracticeResponseDTO.setList(operationRecordPracticeDTOList);
return operationRecordPracticeResponseDTO;
}
/**
* 根据用户工号搜索考试操作记录
*
* @param areaId 区域ID
* @param card 工号
* @param page
* @param pageSize
* @return
*/
public OperationRecordExamResponseDTO findAllOperationRecordByUserAndExam(Long areaId, String card, Integer page, Integer pageSize) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
User currentUser = userService.getCurrentUser();
OperationRecordExamResponseDTO operationRecordExamResponseDTO;
if (currentUser.getAuthority() <= ADMIN_INT && currentUser.getEnable()){
log.info("{} find exam operation record by card {}.", currentUser.getUsername(), card);
operationRecordExamResponseDTO = getAllOperationRecordByUserAndExam(area, card, page, pageSize);
}else if(currentUser.getAuthority() >= INSTRUCTOR_INT && currentUser.getEnable()){
if (areaId.equals(currentUser.getArea().getId())){
log.info("{} find exam operation record by card {}.", currentUser.getUsername(), card);
operationRecordExamResponseDTO = getAllOperationRecordByUserAndExam(area, card, page, pageSize);
}else{
log.error("{} operate across regions.", currentUser.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", currentUser.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return operationRecordExamResponseDTO;
}
/**
* 根据用户工号搜索考试操作记录
* @param area
* @param card
* @param page
* @param pageSize
* @return
* @throws ServerErrorException
*/
private OperationRecordExamResponseDTO getAllOperationRecordByUserAndExam(Area area, String card, Integer page, Integer pageSize) throws ServerErrorException {
OperationRecordExamResponseDTO operationRecordExamResponseDTO = new OperationRecordExamResponseDTO();
User user = userService.checkUserByCard(card);
operationRecordExamResponseDTO.setClassType(user.getClassType());
operationRecordExamResponseDTO.setCard(card);
operationRecordExamResponseDTO.setUsername(user.getUsername());
if (user.getArea() != null){
operationRecordExamResponseDTO.setPosition(user.getArea().getPosition());
operationRecordExamResponseDTO.setOrganizationName(user.getArea().getName());
}
operationRecordExamResponseDTO.setPosition(user.getArea().getPosition());
operationRecordExamResponseDTO.setUserId(user.getId());
Page<OperationRecord> operationRecordPage = operationRecordService
.findAllOperationRecordByUserCardAndType(area, OPERATION_RECORD_TYPE_EXAM, card, page, pageSize);
List<OperationRecordExamDTO> operationRecordExamDTOList = new ArrayList<>();
if (!CollectionUtils.isEmpty(operationRecordPage.getContent())){
for(OperationRecord operationRecord : operationRecordPage.getContent()){
OperationRecordExamDTO operationRecordExamDTO = new OperationRecordExamDTO();
operationRecordExamDTO.setAssessment(operationRecord.getAssessment());
operationRecordExamDTO.setInvigilators(operationRecord.getInvigilator());
operationRecordExamDTO.setScore(operationRecord.getScore());
if (operationRecord.getExamId() != null){
Exam exam = examRepository.findOneById(operationRecord.getExamId());
if (exam != null){
ReportCard reportCard = reportCardRepository.findOneByExamAndCard(exam, card);
if (reportCard != null){
operationRecordExamDTO.setQuestionPaperId(reportCard.getQuestionPaper().getId());
operationRecordExamDTO.setReportCardId(reportCard.getId());
operationRecordExamDTO.setTitle(reportCard.getQuestionPaper().getTitle());
}
}
}
operationRecordExamDTO.setLoginTime(TimeUtil.instantToTimestamp(operationRecord.getLoginTime()));
operationRecordExamDTO.setLogoutTime(TimeUtil.instantToTimestamp(operationRecord.getLogoutTime()));
operationRecordExamDTO.setStartTime(TimeUtil.instantToTimestamp(operationRecord.getStartTime()));
operationRecordExamDTO.setEndTime(TimeUtil.instantToTimestamp(operationRecord.getEndTime()));
operationRecordExamDTOList.add(operationRecordExamDTO);
}
}
operationRecordExamResponseDTO.setPageIndex(operationRecordPage.getPageable().getPageNumber() + 1);
operationRecordExamResponseDTO.setTotalCount(operationRecordPage.getTotalElements());
operationRecordExamResponseDTO.setPageSize(operationRecordPage.getPageable().getPageSize());
operationRecordExamResponseDTO.setTotalPageCount(operationRecordPage.getTotalPages());
operationRecordExamResponseDTO.setList(operationRecordExamDTOList);
return operationRecordExamResponseDTO;
}
/**
* 封装操作记录的数据
* @param operationRecordPage
* @return
*/
private PageResponse<OperationRecordResponseDTO> operationRecordPageToPageResponse(Page<OperationRecord> operationRecordPage, Integer type){
PageResponse<OperationRecordResponseDTO> pageResponse = new PageResponse<>();
List<OperationRecord> operationRecordList = operationRecordPage.getContent();
List<OperationRecordResponseDTO> operationRecordResponseDTOList = new ArrayList<>();
if (!CollectionUtils.isEmpty(operationRecordList)){
for(OperationRecord operationRecord : operationRecordList){
OperationRecordResponseDTO operationRecordResponseDTO = new OperationRecordResponseDTO();
User user = userRepository.findOneByCard(operationRecord.getCard()).orElse(null);
operationRecordResponseDTO.setCard(operationRecord.getCard());
operationRecordResponseDTO.setIp(operationRecord.getIp());
operationRecordResponseDTO.setOperationName(operationRecord.getTypeName());
operationRecordResponseDTO.setUsername(operationRecord.getUsername());
Instant loginTime = operationRecord.getLoginTime();
if (loginTime != null){
List<OperationRecord> operationRecords = operationRecordRepository.findAllByCardAndTypeAndLoginTime(operationRecord.getCard(), type, loginTime);
if (operationRecords.size() > 1){
operationRecordResponseDTO.setOperationName("多个, 详情请点右侧");
}
operationRecordResponseDTO.setLoginTime(loginTime.toEpochMilli());
}
if (operationRecord.getLogoutTime() != null){
operationRecordResponseDTO.setLogoutTime(operationRecord.getLogoutTime().toEpochMilli());
}
if (user != null){
operationRecordResponseDTO.setUserId(user.getId());
}
operationRecordResponseDTOList.add(operationRecordResponseDTO);
}
}
pageResponse.setPageIndex(operationRecordPage.getPageable().getPageNumber() + 1);
pageResponse.setPageSize(operationRecordPage.getPageable().getPageSize());
pageResponse.setTotalPageCount(operationRecordPage.getTotalPages());
pageResponse.setTotalCount(operationRecordPage.getTotalElements());
pageResponse.setList(operationRecordResponseDTOList);
return pageResponse;
}
/**
* 接收保存操作信息
* @param requestDTO
*/
public void saveOperationRecord(VrOperationRecordRequestDTO requestDTO, HttpServletRequest request) throws ServerErrorException {
String ip = IPUtil.getLoginIP(request);
User user = userService.getCurrentUser();
Instant loginTime = Instant.ofEpochMilli(requestDTO.getLoginTime());
if (requestDTO.getbIsEnd()){
if (requestDTO.getType().equals(OPERATION_RECORD_TYPE_EXAM)){
log.info("{} end of the test.", user.getUsername());
}else{
log.info("{} end of the training.", user.getUsername());
}
}else{
if (requestDTO.getType().equals(OPERATION_RECORD_TYPE_EXAM)){
log.info("{} begin an examination.", user.getUsername());
}else{
log.info("{} start training.", user.getUsername());
}
}
operationRecordService.saveOperationRecord(requestDTO.getType(), requestDTO.getbIsEnd(), requestDTO.getId(), requestDTO.getCourseName(), user, ip, loginTime);
}
/**
* 获取某个区域的登录情况
* @param areaId
* @param page
* @param pageSize
* @return
*/
public PageResponse<LoginSituationResponseDTO> getLoginSituation(Long areaId, Integer page, Integer pageSize) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
User currentUser = userService.getCurrentUser();
Page<User> userPage;
Pageable pageable = PageRequest.of(page - 1, pageSize, new Sort(Sort.Direction.ASC, GMT_CREATED));
List<Integer> statusList = new ArrayList<>();
statusList.add(USER_STATUS_TRAIN);
statusList.add(USER_STATUS_EXAM);
if (currentUser.getAuthority() <= ADMIN_INT && currentUser.getEnable()){
log.info("{} gets the login status of {}.", currentUser.getUsername(), area.getName());
userPage = userRepository.findAllByAreaAndStatusIn(area, statusList, pageable);
}else if(currentUser.getAuthority() >= INSTRUCTOR_INT && currentUser.getEnable()){
if (areaId.equals(currentUser.getArea().getId())){
log.info("{} gets the login status of {}.", currentUser.getUsername(), area.getName());
userPage = userRepository.findAllByAreaAndStatusIn(area, statusList, pageable);
}else{
log.error("{} operate across regions.", currentUser.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", currentUser.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return toPageResponse(userPage);
}
/**
* 封装数据
* @param userPage
* @return
*/
private PageResponse<LoginSituationResponseDTO> toPageResponse(Page<User> userPage) {
List<LoginSituationResponseDTO> loginSituationResponseDTOList = new ArrayList<>();
PageResponse<LoginSituationResponseDTO> pageResponse = new PageResponse<>();
if (userPage != null) {
if (!CollectionUtils.isEmpty(userPage.getContent())) {
for (User user : userPage.getContent()) {
LoginSituationResponseDTO loginSituationResponseDTO = new LoginSituationResponseDTO();
loginSituationResponseDTO.setCard(user.getCard());
loginSituationResponseDTO.setClassType(user.getClassType());
loginSituationResponseDTO.setStatus(user.getStatus());
loginSituationResponseDTO.setUserId(user.getId());
loginSituationResponseDTO.setUsername(user.getUsername());
OperationRecord operationRecord = operationRecordService.getLoginSituation(user);
if (operationRecord != null){
loginSituationResponseDTO.setLoginTime(operationRecord.getLoginTime().toEpochMilli());
loginSituationResponseDTO.setOperationalContext(operationRecord.getTypeName());
}
loginSituationResponseDTOList.add(loginSituationResponseDTO);
}
}
pageResponse.setPageSize(userPage.getPageable().getPageSize());
pageResponse.setTotalCount(userPage.getTotalElements());
pageResponse.setTotalPageCount(userPage.getTotalPages());
pageResponse.setPageIndex(userPage.getPageable().getPageNumber() + 1);
pageResponse.setList(loginSituationResponseDTOList);
}
return pageResponse;
}
/**
* 导出某个区域的最新考试操作记录
* @param areaId
* @param request
* @param response
*/
public void exportOperationRecordToExcelByExam(Long areaId, HttpServletRequest request, HttpServletResponse response) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
String agent = request.getHeader("user-agent");
User user = userService.getCurrentUser();
log.info("{} exports records of exam operations in {}.", user.getUsername(), area.getName());
operationRecordService.exportOperationRecordToExcel(area, OPERATION_RECORD_TYPE_EXAM, agent, response);
}
/**
* 导出某个区域的最新训练操作记录
* @param areaId
* @param request
* @param response
*/
public void exportOperationRecordToExcelByTrain(Long areaId, HttpServletRequest request, HttpServletResponse response) throws ServerErrorException {
User user = userService.getCurrentUser();
Area area = areaService.confirmAreaIsExist(areaId);
String agent = request.getHeader("user-agent");
log.info("{} exports records of training operations in {}.", user.getUsername(), area.getName());
operationRecordService.exportOperationRecordToExcel(area, OPERATION_RECORD_TYPE_EXERCISE, agent, response);
}
/**
* 根据用户工号导出训练操作记录
* @param card
* @param request
* @param response
*/
public void exportExcelOperationRecordByUserAndPractice(String card, HttpServletRequest request, HttpServletResponse response) throws ServerErrorException {
User user = userService.checkUserByCard(card);
User currentUser = userService.getCurrentUser();
String agent = request.getHeader("user-agent");
log.info("{} exports records of exam operations by card number {}.", currentUser.getUsername(), card);
operationRecordService.exportExcelOperationRecordByUserAndPractice(user, agent, response);
}
/**
* 根据用户工号导出考试操作记录
* @param card
* @param request
* @param response
* @throws ServerErrorException
*/
public void exportExcelOperationRecordByUserAndExam(String card, HttpServletRequest request, HttpServletResponse response) throws ServerErrorException {
User user = userService.checkUserByCard(card);
String agent = request.getHeader("user-agent");
User currentUser = userService.getCurrentUser();
log.info("{} exports records of training operations by card number {}.", currentUser.getUsername(), card);
operationRecordService.exportExcelOperationRecordByUserAndExam(user, agent, response);
}
}
package cn.com.sailfish.linghang.resource;
import cn.com.sailfish.linghang.dao.web.request.WebQuestionPaperCreateRequestDTO;
import cn.com.sailfish.linghang.dao.web.request.WebQuestionPaperOperationRequestDTO;
import cn.com.sailfish.linghang.dao.web.response.*;
import cn.com.sailfish.linghang.domain.*;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.service.AreaService;
import cn.com.sailfish.linghang.service.QuestionPaperService;
import cn.com.sailfish.linghang.service.TestAbnormalItemInfoService;
import cn.com.sailfish.linghang.service.UserService;
import org.hibernate.LazyInitializationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
import static cn.com.sailfish.linghang.common.ErrorConstants.INSUFFICIENT_USER_PERMISSION;
import static cn.com.sailfish.linghang.common.ErrorConstants.USER_OPERATE_ACROSS_REGION;
import static cn.com.sailfish.linghang.enumeration.QuestionPaperConstant.EXCEPTION_ITEM_IS_NOT_SPECIAL_ITEM;
import static cn.com.sailfish.linghang.enumeration.QuestionPaperConstant.EXCEPTION_ITEM_IS_SPECIAL_ITEM;
import static cn.com.sailfish.linghang.security.SystemPrivilege.ADMIN_INT;
import static cn.com.sailfish.linghang.security.SystemPrivilege.INSTRUCTOR_INT;
/**
* Author: huangpeilin
* Create at: 2019-04-25 14:38:17
* Description:
*
* @author huangpeilin
*/
@Component
public class QuestionPaperResource {
public final Logger log = LoggerFactory.getLogger(QuestionPaperResource.class);
private QuestionPaperService questionPaperService;
private AreaService areaService;
private TestAbnormalItemInfoService testAbnormalItemInfoService;
private UserService userService;
@Autowired
public QuestionPaperResource(QuestionPaperService questionPaperService, AreaService areaService,
TestAbnormalItemInfoService testAbnormalItemInfoService, UserService userService) {
this.questionPaperService = questionPaperService;
this.areaService = areaService;
this.testAbnormalItemInfoService = testAbnormalItemInfoService;
this.userService = userService;
}
/**
* 创建试卷
*
* @param requestDTO
* @return
*/
public Long createQuestionPaper(WebQuestionPaperCreateRequestDTO requestDTO) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
User currentUser = userService.getCurrentUser();
QuestionPaper questionPaper;
if (currentUser.getAuthority() <= ADMIN_INT && currentUser.getEnable()){
log.info("{} created a test called {}.", currentUser.getUsername(), requestDTO.getTitle());
questionPaper = questionPaperService.createQuestionPaper(requestDTO, area);
}else if(currentUser.getAuthority() >= INSTRUCTOR_INT && currentUser.getEnable()){
if (requestDTO.getAreaId().equals(currentUser.getArea().getId())){
log.info("{} created a test called {}.", currentUser.getUsername(), requestDTO.getTitle());
questionPaper = questionPaperService.createQuestionPaper(requestDTO, area);
}else{
log.error("{} operate across regions.", currentUser.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", currentUser.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return questionPaper.getId();
}
/**
* 获取某个区域下的所有试卷
*
* @param areaId 区域ID
* @param type 是否搜索回收站的试卷 true 是 false 不是
* @param page
* @param pageSize
* @return
*/
@Transactional(rollbackFor = LazyInitializationException.class)
public PageResponse<QuestionPaperResponseDTO> findAllQuestionPaperByArea(Long areaId, Boolean type, Integer page, Integer pageSize) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
User currentUser = userService.getCurrentUser();
Page<QuestionPaper> questionPaperPage;
if (currentUser.getAuthority() <= ADMIN_INT && currentUser.getEnable()){
if (type){
log.info("{} gets all the papers in the recycle bin under {}", currentUser.getUsername(), area.getName());
}else{
log.info("{} gets all the papers under {}", currentUser.getUsername(), area.getName());
}
questionPaperPage = questionPaperService.findAllQuestionPaperByArea(area, type, page, pageSize);
}else if(currentUser.getAuthority() >= INSTRUCTOR_INT && currentUser.getEnable()){
if (areaId.equals(currentUser.getArea().getId())){
if (type){
log.info("{} gets all the papers in the recycle bin under {}", currentUser.getUsername(), area.getName());
}else{
log.info("{} gets all the papers under {}", currentUser.getUsername(), area.getName());
}
questionPaperPage = questionPaperService.findAllQuestionPaperByArea(area, type, page, pageSize);
}else{
log.error("{} operate across regions.", currentUser.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", currentUser.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return questionPaperPageToPageResponse(questionPaperPage);
}
/**
* 根据试卷ID 获取试卷信息
*
* @param id
* @return
*/
@Transactional(rollbackFor = LazyInitializationException.class)
public QuestionPaperInfoResponseDTO findOneQuestionPaperById(Long id) throws ServerErrorException {
QuestionPaper questionPaper = questionPaperService.confirmQuestionPaperIsExist(id);
return questionPaperToQuestionPaperInfoResponseDTO(questionPaper);
}
/**
* 通过区域机型课程试卷名搜索试卷 不在回收站的试卷
* @param areaId 区域ID
* @param modelId 机型ID
* @param courseId 课程ID
* @param title 试卷名字
* @param page 页数
* @param pageSize 每一页的显示数
* @return
*/
@Transactional(rollbackFor = LazyInitializationException.class)
public PageResponse<QuestionPaperResponseDTO> findAllQuestionPaperByCondition(
Long areaId, Long modelId, Long courseId,
String title, Integer page, Integer pageSize) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
Page<QuestionPaper> questionPaperPage = questionPaperService.findAllQuestionPaperByCondition(area, modelId, courseId, title, false, null, page, pageSize);
return questionPaperPageToPageResponse(questionPaperPage);
}
/**
* 拷贝试卷
* @param requestDTO
*/
public void copyQuestionPaper(WebQuestionPaperOperationRequestDTO requestDTO) throws ServerErrorException {
User user = userService.getCurrentUser();
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
log.info("{} copies papers from {}.", user.getUsername(), area.getName());
questionPaperService.copyQuestionPaper(area, user, requestDTO.getQuestionPapers());
}else if(user.getAuthority() >= INSTRUCTOR_INT && user.getEnable()){
if (requestDTO.getAreaId().equals(user.getArea().getId())){
log.info("{} copies papers from {}.", user.getUsername(), area.getName());
questionPaperService.copyQuestionPaper(area, user, requestDTO.getQuestionPapers());
}else{
log.error("{} operate across regions.", user.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", user.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
}
/**
* 回收试卷
* @param requestDTO
*/
@Transactional(rollbackFor = Exception.class)
public void recycleQuestionPaper(WebQuestionPaperOperationRequestDTO requestDTO) throws ServerErrorException {
User user = userService.getCurrentUser();
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
log.info("{} put some papers in the recycling bin in {}.", user.getUsername(), area.getName());
questionPaperService.operationQuestionPaperInRecycle(requestDTO.getQuestionPapers(), area);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
log.info("{} put some papers in the recycling bin in {}.", user.getUsername(), area.getName());
questionPaperService.operationQuestionPaperInRecycle(requestDTO.getQuestionPapers(), area);
}else{
log.error("{} operate across regions.", user.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", user.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
}
/**
* 还原试卷
* @param requestDTO
*/
@Transactional(rollbackFor = Exception.class)
public void recoverQuestionPaper(WebQuestionPaperOperationRequestDTO requestDTO) throws ServerErrorException {
User user = userService.getCurrentUser();
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
log.info("{} recovers some papers from the recycle bin in {}.", user.getUsername(), area.getName());
questionPaperService.recoverQuestionPaper(requestDTO.getQuestionPapers());
}else if(user.getAuthority() >= INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
log.info("{} recovers some papers from the recycle bin in {}.", user.getUsername(), area.getName());
questionPaperService.recoverQuestionPaper(requestDTO.getQuestionPapers());
}else{
log.error("{} operate across regions.", user.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", user.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
}
/**
* 通过区域,机型,课程,试卷名和穿件人名字搜索试卷 在回收站的试卷
* @param areaId 区域ID
* @param modelId 机型ID
* @param courseId 课程ID
* @param title 试卷名字
* @param authorName 创建人名字
* @param page 页数
* @param pageSize 每页的条数
* @return
*/
@Transactional(rollbackFor = LazyInitializationException.class)
public PageResponse<QuestionPaperResponseDTO> findAllQuestionPaperInRecycleByCondition(
Long areaId, Long modelId, Long courseId, String title,
String authorName, Integer page, Integer pageSize) throws ServerErrorException {
User user = userService.getCurrentUser();
Area area = areaService.confirmAreaIsExist(areaId);
Page<QuestionPaper> questionPaperPage;
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
log.info("{} gets a test paper from {} in the recycle bin based on the conditions.", user.getUsername(), area.getName());
questionPaperPage = questionPaperService
.findAllQuestionPaperByCondition(area, modelId, courseId, title, true, authorName, page, pageSize);
}else if(user.getAuthority() >= INSTRUCTOR_INT && user.getEnable()){
if (areaId.equals(user.getArea().getId())){
log.info("{} gets a test paper from {} in the recycle bin based on the conditions.", user.getUsername(), area.getName());
questionPaperPage = questionPaperService
.findAllQuestionPaperByCondition(area, modelId, courseId, title, true, authorName, page, pageSize);
}else{
log.error("{} operate across regions.", user.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", user.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return questionPaperPageToPageResponse(questionPaperPage);
}
/**
* 导入试卷数据
* @param file
*/
public void importQuestionPaper(MultipartFile file) throws ServerErrorException {
questionPaperService.importQuestionPaper(file);
}
/**
* 试卷数据分装成分页数据
*
* @param questionPaperPage
* @return
*/
public PageResponse<QuestionPaperResponseDTO> questionPaperPageToPageResponse(Page<QuestionPaper> questionPaperPage) {
List<QuestionPaperResponseDTO> questionPaperResponseDTOList = new ArrayList<>();
PageResponse<QuestionPaperResponseDTO> pageResponse = new PageResponse<>();
if (questionPaperPage != null) {
if (!CollectionUtils.isEmpty(questionPaperPage.getContent())) {
for (QuestionPaper questionPaper : questionPaperPage.getContent()) {
QuestionPaperResponseDTO questionPaperResponseDTO = questionPaperToQuestionPaperResponseDTO(questionPaper);
questionPaperResponseDTOList.add(questionPaperResponseDTO);
}
}
pageResponse.setPageIndex(questionPaperPage.getPageable().getPageNumber() + 1);
pageResponse.setPageSize(questionPaperPage.getPageable().getPageSize());
pageResponse.setTotalCount(questionPaperPage.getTotalElements());
pageResponse.setTotalPageCount(questionPaperPage.getTotalPages());
pageResponse.setList(questionPaperResponseDTOList);
}
return pageResponse;
}
/**
* 将QuestionPaper的数据封装为QuestionPaperResponseDTO的数据
* @param questionPaper
* @return
*/
public QuestionPaperResponseDTO questionPaperToQuestionPaperResponseDTO(QuestionPaper questionPaper) {
QuestionPaperResponseDTO questionPaperResponseDTO = new QuestionPaperResponseDTO();
if (questionPaper != null) {
questionPaperResponseDTO.setId(questionPaper.getId());
questionPaperResponseDTO.setTitle(questionPaper.getTitle());
questionPaperResponseDTO.setDescription(questionPaper.getDescription());
if (questionPaper.getArea() != null){
questionPaperResponseDTO.setAreaName(questionPaper.getArea().getName());
}
if (questionPaper.getModel() != null) {
questionPaperResponseDTO.setModelName(questionPaper.getModel().getName());
}
if (questionPaper.getCourse() != null) {
questionPaperResponseDTO.setCourseName(questionPaper.getCourse().getName());
questionPaperResponseDTO.setCourseChineseName(questionPaper.getCourse().getChineseName());
}
if (questionPaper.getAuthor() != null) {
questionPaperResponseDTO.setAuthorName(questionPaper.getAuthor().getUsername());
}
}
return questionPaperResponseDTO;
}
/**
* 将试卷的详细信息封装为QuestionPaperInfoResponseDTO类
* @param questionPaper
* @return
*/
private QuestionPaperInfoResponseDTO questionPaperToQuestionPaperInfoResponseDTO(QuestionPaper questionPaper) {
QuestionPaperInfoResponseDTO questionPaperInfoResponseDTO = new QuestionPaperInfoResponseDTO();
if (questionPaper != null) {
questionPaperInfoResponseDTO.setbIsEnvironmentalSound(questionPaper.getBIsEnvironmentalSound());
questionPaperInfoResponseDTO.setbIsGraphicPopupWindow(questionPaper.getBIsGraphicPopupWindow());
questionPaperInfoResponseDTO.setbIsLocationHints(questionPaper.getBIsLocationHints());
questionPaperInfoResponseDTO.setbIsNameTag(questionPaper.getBIsNameTag());
questionPaperInfoResponseDTO.setbIsOperatingHints(questionPaper.getBIsOperatingHints());
questionPaperInfoResponseDTO.setbIsPartsOfBuoy(questionPaper.getBIsPartsOfBuoy());
questionPaperInfoResponseDTO.setbIsVoiceHints(questionPaper.getBIsVoiceHints());
questionPaperInfoResponseDTO.setbIsWarningNotice(questionPaper.getBIsWarningNotice());
questionPaperInfoResponseDTO.setDescription(questionPaper.getDescription());
questionPaperInfoResponseDTO.setExceptionGenerateType(questionPaper.getExceptionGenerateType());
questionPaperInfoResponseDTO.setQualifiedQuantity(questionPaper.getQualifiedQuantity());
questionPaperInfoResponseDTO.setRandomAbnormals(questionPaper.getRandomAbnormals());
questionPaperInfoResponseDTO.setTestLength(questionPaper.getTestLength());
questionPaperInfoResponseDTO.setTitle(questionPaper.getTitle());
questionPaperInfoResponseDTO.setCreateTime(questionPaper.getGmtCreated().toEpochMilli());
if (questionPaper.getAuthor() != null){
questionPaperInfoResponseDTO.setAuthorName(questionPaper.getAuthor().getUsername());
}
if (questionPaper.getArea() != null) {
questionPaperInfoResponseDTO.setAreaId(questionPaper.getArea().getId());
questionPaperInfoResponseDTO.setAreaName(questionPaper.getArea().getName());
}
if (questionPaper.getModel() != null) {
ModelResponseDTO modelResponseDTO = new ModelResponseDTO();
modelResponseDTO.setName(questionPaper.getModel().getName());
modelResponseDTO.setId(questionPaper.getModel().getId());
modelResponseDTO.setBrand(questionPaper.getModel().getBrand());
questionPaperInfoResponseDTO.setModel(modelResponseDTO);
}
if (questionPaper.getEngine() != null) {
EngineResponseDTO engineResponseDTO = new EngineResponseDTO();
engineResponseDTO.setType(questionPaper.getEngine().getType());
engineResponseDTO.setName(questionPaper.getEngine().getName());
engineResponseDTO.setId(questionPaper.getEngine().getId());
questionPaperInfoResponseDTO.setEngine(engineResponseDTO);
}
if (questionPaper.getCourse() != null) {
CourseResponseDTO courseResponseDTO = new CourseResponseDTO();
courseResponseDTO.setId(questionPaper.getCourse().getId());
courseResponseDTO.setName(questionPaper.getCourse().getName());
courseResponseDTO.setChineseName(questionPaper.getCourse().getChineseName());
questionPaperInfoResponseDTO.setCourse(courseResponseDTO);
setCheckItemListToQuestionPaperInfoResponseDTO(questionPaperInfoResponseDTO, questionPaper.getCourse());
setExceptionItemListToQuestionPaperInfoResponseDTO(questionPaperInfoResponseDTO, questionPaper, questionPaper.getCourse());
setSpecialItemListToQuestionPaperInfoResponseDTO(questionPaperInfoResponseDTO, questionPaper, questionPaper.getCourse());
}
}
return questionPaperInfoResponseDTO;
}
/**
* 将检查项数据封装到QuestionPaperInfoResponseDTO类中
*
* @param questionPaperInfoResponseDTO
* @param course
*/
public void setCheckItemListToQuestionPaperInfoResponseDTO(QuestionPaperInfoResponseDTO questionPaperInfoResponseDTO,
Course course) {
List<CheckItemResponseDTO> checkItemResponseDTOList = new ArrayList<>();
if (course != null) {
List<CheckItem> checkItemList = course.getCheckItem();
if (!CollectionUtils.isEmpty(checkItemList)) {
for (CheckItem checkItem : checkItemList) {
CheckItemResponseDTO checkItemResponseDTO = new CheckItemResponseDTO();
checkItemResponseDTO.setEngineType(checkItem.getEngine().getType());
checkItemResponseDTO.setId(checkItem.getId());
checkItemResponseDTO.setName(checkItem.getName());
checkItemResponseDTO.setRegion(checkItem.getRegion());
checkItemResponseDTO.setChineseName(checkItem.getChineseName());
checkItemResponseDTOList.add(checkItemResponseDTO);
}
}
}
questionPaperInfoResponseDTO.setCheckItemList(checkItemResponseDTOList);
}
/**
* 将异常项项数据封装到QuestionPaperInfoResponseDTO类中
* @param questionPaperInfoResponseDTO
* @param questionPaper
* @param course
*/
public void setExceptionItemListToQuestionPaperInfoResponseDTO(QuestionPaperInfoResponseDTO questionPaperInfoResponseDTO,
QuestionPaper questionPaper, Course course) {
List<ExceptionItemResponseDTO> exceptionItemResponseDTOList = new ArrayList<>();
List<TestAbnormalItemInfo> testAbnormalItemInfoList = testAbnormalItemInfoService
.findAllTestAbnormalItemInfo(questionPaper, course, EXCEPTION_ITEM_IS_NOT_SPECIAL_ITEM);
if (!CollectionUtils.isEmpty(testAbnormalItemInfoList)) {
for (TestAbnormalItemInfo testAbnormalItemInfo : testAbnormalItemInfoList) {
ExceptionItemResponseDTO exceptionItemResponseDTO = new ExceptionItemResponseDTO();
exceptionItemResponseDTO.setEngineType(testAbnormalItemInfo.getExceptionItem().getEngine().getType());
exceptionItemResponseDTO.setId(testAbnormalItemInfo.getExceptionItem().getId());
exceptionItemResponseDTO.setName(testAbnormalItemInfo.getExceptionItem().getName());
exceptionItemResponseDTO.setRegion(testAbnormalItemInfo.getExceptionItem().getRegion());
exceptionItemResponseDTO.setChineseName(testAbnormalItemInfo.getExceptionItem().getDetails());
exceptionItemResponseDTOList.add(exceptionItemResponseDTO);
}
}
questionPaperInfoResponseDTO.setExceptionItemList(exceptionItemResponseDTOList);
}
/**
* 将特殊项数据封装到QuestionPaperInfoResponseDTO类中
* @param questionPaperInfoResponseDTO
* @param questionPaper
* @param course
*/
public void setSpecialItemListToQuestionPaperInfoResponseDTO(QuestionPaperInfoResponseDTO questionPaperInfoResponseDTO,
QuestionPaper questionPaper, Course course) {
List<ExceptionItemResponseDTO> exceptionItemResponseDTOList = new ArrayList<>();
List<Long> specialIds = new ArrayList<>();
List<TestAbnormalItemInfo> testAbnormalItemInfoList = testAbnormalItemInfoService
.findAllTestAbnormalItemInfo(questionPaper, course, EXCEPTION_ITEM_IS_SPECIAL_ITEM);
if (!CollectionUtils.isEmpty(testAbnormalItemInfoList)) {
for (TestAbnormalItemInfo testAbnormalItemInfo : testAbnormalItemInfoList) {
ExceptionItemResponseDTO exceptionItemResponseDTO = new ExceptionItemResponseDTO();
specialIds.add(testAbnormalItemInfo.getExceptionItem().getId());
exceptionItemResponseDTO.setEngineType(testAbnormalItemInfo.getExceptionItem().getEngine().getType());
exceptionItemResponseDTO.setId(testAbnormalItemInfo.getExceptionItem().getId());
exceptionItemResponseDTO.setRegion(testAbnormalItemInfo.getExceptionItem().getRegion());
exceptionItemResponseDTO.setName(testAbnormalItemInfo.getExceptionItem().getName());
exceptionItemResponseDTO.setChineseName(testAbnormalItemInfo.getExceptionItem().getDetails());
exceptionItemResponseDTOList.add(exceptionItemResponseDTO);
}
}
questionPaperInfoResponseDTO.setSpecialIds(specialIds);
questionPaperInfoResponseDTO.setSpecialItemList(exceptionItemResponseDTOList);
}
}
package cn.com.sailfish.linghang.resource;
import cn.com.sailfish.linghang.dao.ReportCardRank;
import cn.com.sailfish.linghang.dao.vr.request.VrExamResultRequestDTO;
import cn.com.sailfish.linghang.dao.vr.response.VrQuestionPaperInfoResponseDTO;
import cn.com.sailfish.linghang.dao.web.request.WebReportCardOperationRequestDTO;
import cn.com.sailfish.linghang.dao.web.response.*;
import cn.com.sailfish.linghang.domain.*;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.repository.*;
import cn.com.sailfish.linghang.service.*;
import org.hibernate.LazyInitializationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import static cn.com.sailfish.linghang.common.ErrorConstants.*;
import static cn.com.sailfish.linghang.enumeration.Constants.CARD_INT;
import static cn.com.sailfish.linghang.enumeration.Constants.SCORE_INT;
import static cn.com.sailfish.linghang.enumeration.ExamConstant.COMPLETION_STATUS_FINISHED;
import static cn.com.sailfish.linghang.enumeration.ExamConstant.SWITCH_STATUS_CLOSE;
import static cn.com.sailfish.linghang.enumeration.QuestionPaperConstant.EXCEPTION_ITEM_IS_NOT_SPECIAL_ITEM;
import static cn.com.sailfish.linghang.enumeration.QuestionPaperConstant.EXCEPTION_ITEM_IS_SPECIAL_ITEM;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.*;
import static cn.com.sailfish.linghang.security.SystemPrivilege.ADMIN_INT;
import static cn.com.sailfish.linghang.security.SystemPrivilege.INSTRUCTOR_INT;
/**
* Author: huangpeilin
* Create at: 2019-04-28 15:02:43
* Description:
*
* @author huangpeilin
*/
@Component
public class ReportCardResource {
public final Logger log = LoggerFactory.getLogger(ReportCardResource.class);
private ReportCardService reportCardService;
private TestAbnormalItemInfoService testAbnormalItemInfoService;
private ReportCardDetailsRepository reportCardDetailsRepository;
private AreaService areaService;
private UserService userService;
private ExamRepository examRepository;
private QuestionPaperRepository questionPaperRepository;
private ReportCardRankRepository reportCardRankRepository;
private UserRepository userRepository;
@Autowired
public ReportCardResource(ReportCardService reportCardService, TestAbnormalItemInfoService testAbnormalItemInfoService,
ReportCardDetailsRepository reportCardDetailsRepository, AreaService areaService,
UserService userService, ExamRepository examRepository, QuestionPaperRepository questionPaperRepository,
ReportCardRankRepository reportCardRankRepository, UserRepository userRepository){
this.reportCardService = reportCardService;
this.testAbnormalItemInfoService = testAbnormalItemInfoService;
this.reportCardDetailsRepository = reportCardDetailsRepository;
this.areaService = areaService;
this.userService = userService;
this.examRepository = examRepository;
this.questionPaperRepository = questionPaperRepository;
this.reportCardRankRepository = reportCardRankRepository;
this.userRepository = userRepository;
}
/**
* 根据成绩单ID获取成绩单的信息
* @param id
* @return
*/
@Transactional(rollbackFor = LazyInitializationException.class)
public ReportCardMessageResponseDTO getMessageByReportCardId(Long id) throws ServerErrorException {
ReportCard reportCard = reportCardService.confirmReportCardIsExist(id);
User user = userService.getCurrentUser();
log.info("{} gets report details by report ID {}.", user.getUsername());
return reportCardToReportCardMessageResponseDTO(reportCard);
}
/**
* 根据成绩单ID设置学员考试备注
* @param reportCardId
* @param remark
* @throws ServerErrorException
*/
public void setRemarkByReportCardId(Long reportCardId, String remark) throws ServerErrorException {
reportCardService.setRemarkByReportCardId(remark, reportCardId);
}
/**
* 将成绩单收入回收站或者从回收站恢复
* @param requestDTO
* @param bIsDelete true代表放入回收站 false代表从回收站中恢复
* @throws ServerErrorException
*/
public void operationReportCardInRecycle(WebReportCardOperationRequestDTO requestDTO, Boolean bIsDelete) throws ServerErrorException {
User user = userService.getCurrentUser();
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
if (bIsDelete){
log.info("{} puts a report card in the recycle bin.", user.getUsername());
}else{
log.info("{} recovers the report card from the recycle bin.", user.getUsername());
}
reportCardService.operationReportCardInRecycle(requestDTO.getReportCardIds(), bIsDelete);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
if (bIsDelete){
log.info("{} puts a report card in the recycle bin.", user.getUsername());
}else{
log.info("{} recovers the report card from the recycle bin.", user.getUsername());
}
reportCardService.operationReportCardInRecycle(requestDTO.getReportCardIds(), bIsDelete);
}else{
log.error("{} operate across regions.", user.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", user.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
}
/**
* 查看某个学员参加过的所有考试成绩
* @param userId 用户ID
* @param status 考试的完成状态 0 完成 1 未完成
* @param bIsDelete 是否在回收站中
* @param page 页数 默认是1
* @param pageSize 每一页的条数 默认是20
*/
@Transactional(rollbackFor = LazyInitializationException.class)
public WebReportCardInfoResponseDTO findAllReportCardByUser(Long userId, Integer status, boolean bIsDelete, Integer page, Integer pageSize) throws ServerErrorException {
User currentUser = userService.getCurrentUser();
User user = userService.confirmUserIsExist(userId);
Page<ReportCard> reportCardPage;
if (currentUser.getAuthority() <= ADMIN_INT && currentUser.getEnable()){
if (bIsDelete){
log.info("{} gets all the recycling bin exams that {} has taken", currentUser.getUsername(), user.getUsername());
}else{
log.info("{} gets all the exams that {} has taken", currentUser.getUsername(), user.getUsername());
}
reportCardPage = reportCardService.findAllReportCardByUserCard(user.getCard(), status, bIsDelete, page, pageSize);
}else if(currentUser.getAuthority() >= INSTRUCTOR_INT && currentUser.getEnable()){
if (currentUser.getArea().getId().equals(user.getArea().getId())){
if (bIsDelete){
log.info("{} gets all the recycling bin exams that {} has taken", currentUser.getUsername(), user.getUsername());
}else{
log.info("{} gets all the exams that {} has taken", currentUser.getUsername(), user.getUsername());
}
reportCardPage = reportCardService.findAllReportCardByUserCard(user.getCard(), status, bIsDelete, page, pageSize);
}else{
log.error("{} operate across regions.", currentUser.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", currentUser.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return reportCardPageToWebReportCardInfoResponseDTO(user, reportCardPage);
}
/**
* 根据考试时间和试卷名字查看某个学员参加过的所有考试成绩
* @param userId 用户ID
* @param status 考试的完成状态 0 完成 1 未完成
* @param bIsDelete 是否在回收站中
* @param examTime 考试时间
* @param questionPaperName 试卷名字
* @param page 页数 默认是1
* @param pageSize 每一页的条数 默认是20
* @return
* @throws ServerErrorException
*/
@Transactional(rollbackFor = LazyInitializationException.class)
public WebReportCardInfoResponseDTO findAllReportCardByCondition(
Long userId, Integer status, boolean bIsDelete, Long examTime,
String questionPaperName, Integer page, Integer pageSize) throws ServerErrorException {
User currentUser = userService.getCurrentUser();
User user = userService.confirmUserIsExist(userId);
Page<ReportCard> reportCardPage;
if (currentUser.getAuthority() <= ADMIN_INT && currentUser.getEnable()){
reportCardPage = reportCardService.findAllReportCardByCondition(user.getCard(), status, bIsDelete, examTime, questionPaperName, page, pageSize);
}else if(currentUser.getAuthority() >= INSTRUCTOR_INT && currentUser.getEnable()){
if (currentUser.getArea().getId().equals(user.getArea().getId())){
reportCardPage = reportCardService.findAllReportCardByCondition(user.getCard(), status, bIsDelete, examTime, questionPaperName, page, pageSize);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return reportCardPageToWebReportCardInfoResponseDTO(user, reportCardPage);
}
/**
* 通过考试ID和试卷ID获取班级统计信息
* @param examId
* @param questionPaperId
* @return
* @throws ServerErrorException
*/
@Transactional(rollbackFor = LazyInitializationException.class)
public ReportCardStatisticalResponseDTO getStatisticalDetailsByExamId(Long examId, Long questionPaperId) throws ServerErrorException {
Exam exam = examRepository.findOneById(examId);
if (exam == null){
log.error("exam is not exist");
throw new ServerErrorException(EXAM_IS_NOT_EXISTS);
}
QuestionPaper questionPaper = questionPaperRepository.findOneById(questionPaperId);
if (exam == null){
log.error("question paper is not exist");
throw new ServerErrorException(QUESTION_PAPER_IS_NOT_EXISTS);
}
return toReportCardStatisticalResponseDTO(exam, questionPaper);
}
/**
* 根据考试和试卷封装班级统计信息
* @param exam
* @param questionPaper
* @return
*/
public ReportCardStatisticalResponseDTO toReportCardStatisticalResponseDTO(Exam exam, QuestionPaper questionPaper){
ReportCardStatisticalResponseDTO reportCardStatisticalResponseDTO = new ReportCardStatisticalResponseDTO();
Course course = questionPaper.getCourse();
List<CheckItem> checkItemList = course.getCheckItem();
List<TestAbnormalItemInfo> testExceptionItemList = testAbnormalItemInfoService.findAllTestAbnormalItemInfo(questionPaper, course, EXCEPTION_ITEM_IS_NOT_SPECIAL_ITEM);
List<TestAbnormalItemInfo> testSpecialItemList = testAbnormalItemInfoService.findAllTestAbnormalItemInfo(questionPaper, course, EXCEPTION_ITEM_IS_SPECIAL_ITEM);
List<ReportCard> reportCardList = reportCardService.findAllReportCardByExam(exam, false);
reportCardStatisticalResponseDTO.setClassType(exam.getClassType());
reportCardStatisticalResponseDTO.setExamId(exam.getId());
reportCardStatisticalResponseDTO.setInvigilators(exam.getInvigilator());
if (exam.getExamTime() != null){
reportCardStatisticalResponseDTO.setExamTime(exam.getExamTime().toEpochMilli());
}
reportCardStatisticalResponseDTO.setQuestionPaperId(questionPaper.getId());
reportCardStatisticalResponseDTO.setTitle(questionPaper.getTitle());
if (!CollectionUtils.isEmpty(reportCardList)){
// 保存检查项信息
setCheckItemListToReportCardStatisticalResponseDTO(reportCardStatisticalResponseDTO, reportCardList, checkItemList);
// 保存异常项的信息
setExceptionItemListToReportCardStatisticalResponseDTO(
reportCardStatisticalResponseDTO, EXCEPTION_ITEM_IS_NOT_SPECIAL_ITEM, reportCardList, testExceptionItemList);
// 保存异常项的信息
setExceptionItemListToReportCardStatisticalResponseDTO(
reportCardStatisticalResponseDTO, EXCEPTION_ITEM_IS_SPECIAL_ITEM, reportCardList, testSpecialItemList);
}
return reportCardStatisticalResponseDTO;
}
/**
* 保存异常项的信息到ReportCardStatisticalResponseDTO中
* @param reportCardStatisticalResponseDTO
* @param special 是否为特殊项 0 不是 1 是
* @param reportCardList
* @param testExceptionItemList
*/
private void setExceptionItemListToReportCardStatisticalResponseDTO(
ReportCardStatisticalResponseDTO reportCardStatisticalResponseDTO, Integer special,
List<ReportCard> reportCardList, List<TestAbnormalItemInfo> testExceptionItemList) {
List<ItemChoiceInfoDTO> exceptionItemChoiceInfoDTOList = new ArrayList<>();
if (!CollectionUtils.isEmpty(testExceptionItemList)) {
for (TestAbnormalItemInfo testAbnormalItemInfo : testExceptionItemList) {
ItemChoiceInfoDTO itemChoiceInfoDTO = new ItemChoiceInfoDTO();
itemChoiceInfoDTO.setDetails(testAbnormalItemInfo.getExceptionItem().getDetails());
itemChoiceInfoDTO.setId(testAbnormalItemInfo.getExceptionItem().getId());
itemChoiceInfoDTO.setName(testAbnormalItemInfo.getExceptionItem().getName());
itemChoiceInfoDTO.setRegion(testAbnormalItemInfo.getExceptionItem().getRegion());
Integer sum = 0;
List<UserMessageDTO> userMessageDTOList = new ArrayList<>();
for (ReportCard reportCard : reportCardList){
ReportCardDetails reportCardDetails = reportCardDetailsRepository
.findOneByReportCardAndExceptionItemAndSpecial(reportCard, testAbnormalItemInfo.getExceptionItem(), special);
User user = userRepository.findOneByCard(reportCard.getCard()).orElse(null);
if (reportCardDetails != null && user != null){
sum++;
UserMessageDTO userMessageDTO = new UserMessageDTO();
userMessageDTO.setCard(user.getCard());
userMessageDTO.setUserId(user.getId());
userMessageDTO.setUsername(reportCard.getUsername());
userMessageDTOList.add(userMessageDTO);
}
}
itemChoiceInfoDTO.setSum(sum);
itemChoiceInfoDTO.setChoosePeople(userMessageDTOList);
exceptionItemChoiceInfoDTOList.add(itemChoiceInfoDTO);
}
}
if (special.equals(EXCEPTION_ITEM_IS_NOT_SPECIAL_ITEM)){
reportCardStatisticalResponseDTO.setExceptionItemList(exceptionItemChoiceInfoDTOList);
}else if(special.equals(EXCEPTION_ITEM_IS_SPECIAL_ITEM)){
reportCardStatisticalResponseDTO.setSpecialItemList(exceptionItemChoiceInfoDTOList);
}
}
/**
* 保存检查项的信息到ReportCardStatisticalResponseDTO中
* @param reportCardStatisticalResponseDTO
* @param reportCardList
* @param checkItemList
*/
private void setCheckItemListToReportCardStatisticalResponseDTO(
ReportCardStatisticalResponseDTO reportCardStatisticalResponseDTO, List<ReportCard> reportCardList, List<CheckItem> checkItemList) {
List<ItemChoiceInfoDTO> checkItemChoiceInfoDTOList = new ArrayList<>();
if (!CollectionUtils.isEmpty(checkItemList)){
for (CheckItem checkItem : checkItemList){
ItemChoiceInfoDTO itemChoiceInfoDTO = new ItemChoiceInfoDTO();
itemChoiceInfoDTO.setDetails(checkItem.getChineseName());
itemChoiceInfoDTO.setId(checkItem.getId());
itemChoiceInfoDTO.setName(checkItem.getName());
itemChoiceInfoDTO.setRegion(checkItem.getRegion());
Integer sum = 0;
List<UserMessageDTO> userMessageDTOList = new ArrayList<>();
for (ReportCard reportCard : reportCardList){
ReportCardDetails reportCardDetails = reportCardDetailsRepository.findOneByReportCardAndCheckItem(reportCard, checkItem);
User user = userRepository.findOneByCard(reportCard.getCard()).orElse(null);
if (reportCardDetails != null && user != null){
UserMessageDTO userMessageDTO = new UserMessageDTO();
userMessageDTO.setCard(user.getCard());
userMessageDTO.setUserId(user.getId());
userMessageDTO.setUsername(reportCard.getUsername());
userMessageDTOList.add(userMessageDTO);
sum++;
}
}
itemChoiceInfoDTO.setSum(sum);
itemChoiceInfoDTO.setChoosePeople(userMessageDTOList);
checkItemChoiceInfoDTOList.add(itemChoiceInfoDTO);
}
}
reportCardStatisticalResponseDTO.setCheckItemList(checkItemChoiceInfoDTOList);
}
/**
* 将成绩单数据封装到WebReportCardInfoResponseDTO中
* @param user
* @param reportCardPage
* @return
*/
public WebReportCardInfoResponseDTO reportCardPageToWebReportCardInfoResponseDTO(User user, Page<ReportCard> reportCardPage){
WebReportCardInfoResponseDTO webReportCardInfoResponseDTO = new WebReportCardInfoResponseDTO();
List<ReportCardMessageDTO> reportCardMessageDTOList = new ArrayList<>();
webReportCardInfoResponseDTO.setCard(user.getCard());
webReportCardInfoResponseDTO.setUserId(user.getId());
webReportCardInfoResponseDTO.setUsername(user.getUsername());
Area area = user.getArea();
if (area != null){
webReportCardInfoResponseDTO.setOrganizationName(area.getName());
webReportCardInfoResponseDTO.setPosition(area.getPosition());
}
webReportCardInfoResponseDTO.setTotalCount(reportCardPage.getTotalElements());
webReportCardInfoResponseDTO.setPageSize(reportCardPage.getPageable().getPageSize());
webReportCardInfoResponseDTO.setTotalPageCount(reportCardPage.getTotalPages());
webReportCardInfoResponseDTO.setPageIndex(reportCardPage.getPageable().getPageNumber() + 1);
if (!CollectionUtils.isEmpty(reportCardPage.getContent())){
for (ReportCard reportCard : reportCardPage.getContent()){
ReportCardMessageDTO reportCardMessageDTO = new ReportCardMessageDTO();
reportCardMessageDTO.setAssessment(reportCard.getAssessment());
reportCardMessageDTO.setRemarks(reportCard.getRemarks());
reportCardMessageDTO.setReportCardId(reportCard.getId());
if (reportCard.getExamTime() != null){
reportCardMessageDTO.setExamTime(reportCard.getExamTime().toEpochMilli());
}
reportCardMessageDTO.setScore(reportCard.getScore());
Exam exam = reportCard.getExam();
if (exam != null){
reportCardMessageDTO.setClassType(exam.getClassType());
reportCardMessageDTO.setInvigilators(exam.getInvigilator());
}
QuestionPaper questionPaper = reportCard.getQuestionPaper();
if (questionPaper != null){
reportCardMessageDTO.setTitle(questionPaper.getTitle());
reportCardMessageDTO.setQuestionPaperId(questionPaper.getId());
}
reportCardMessageDTOList.add(reportCardMessageDTO);
}
}
webReportCardInfoResponseDTO.setExamList(reportCardMessageDTOList);
return webReportCardInfoResponseDTO;
}
public ReportCardMessageResponseDTO reportCardToReportCardMessageResponseDTO(ReportCard reportCard){
ReportCardMessageResponseDTO reportCardMessageResponseDTO = new ReportCardMessageResponseDTO();
if (reportCard != null){
reportCardMessageResponseDTO.setAssessment(reportCard.getAssessment());
reportCardMessageResponseDTO.setScore(reportCard.getScore());
User user = userRepository.findOneByCard(reportCard.getCard()).orElse(null);
// 获取考试用户的信息
if(user != null){
reportCardMessageResponseDTO.setCard(user.getCard());
reportCardMessageResponseDTO.setUserId(user.getId());
reportCardMessageResponseDTO.setUsername(reportCard.getUsername());
Area area = user.getArea();
if (area != null){
reportCardMessageResponseDTO.setOrganizationName(area.getName());
if (FLIGHT_INT.equals(area.getPosition())){
reportCardMessageResponseDTO.setPosition(FLIGHT);
}else if(LOCOMOTIVE_INT.equals(area.getPosition())){
reportCardMessageResponseDTO.setPosition(LOCOMOTIVE);
}
}
}
// 获取试卷的信息
QuestionPaper questionPaper = reportCard.getQuestionPaper();
if (questionPaper != null){
reportCardMessageResponseDTO.setTitle(questionPaper.getTitle());
}
Exam exam = reportCard.getExam();
// 获取考试的信息
if (exam != null){
reportCardMessageResponseDTO.setInvigilators(exam.getInvigilator());
setExceptionItemListToReportCardMessageResponseDTO(reportCardMessageResponseDTO, reportCard, false);
setExceptionItemListToReportCardMessageResponseDTO(reportCardMessageResponseDTO, reportCard, true);
setCheckItemListToReportCardMessageResponseDTO(reportCardMessageResponseDTO, reportCard);
}
}
return reportCardMessageResponseDTO;
}
/**
* 将异常项(特殊项)的回答数据封装到ReportCardMessageResponseDTO中
* @param reportCardMessageResponseDTO
* @param reportCard 成绩单
* @param bisSpecial 是否是特殊项 true 是 false不是
*/
public void setExceptionItemListToReportCardMessageResponseDTO(
ReportCardMessageResponseDTO reportCardMessageResponseDTO, ReportCard reportCard, Boolean bisSpecial){
QuestionPaper questionPaper = reportCard.getQuestionPaper();
List<TestAbnormalItemInfo> testAbnormalItemInfoList = new ArrayList<>();
int special;
if (bisSpecial){
testAbnormalItemInfoList = testAbnormalItemInfoService
.findAllTestAbnormalItemInfo(questionPaper, questionPaper.getCourse(), EXCEPTION_ITEM_IS_SPECIAL_ITEM);
special = EXCEPTION_ITEM_IS_SPECIAL_ITEM;
}else{
testAbnormalItemInfoList = testAbnormalItemInfoService
.findAllTestAbnormalItemInfo(questionPaper, questionPaper.getCourse(), EXCEPTION_ITEM_IS_NOT_SPECIAL_ITEM);
special = EXCEPTION_ITEM_IS_NOT_SPECIAL_ITEM;
}
List<ItemAnswerMessageDTO> exceptionItemList = new ArrayList<>();
for (TestAbnormalItemInfo testAbnormalItemInfo : testAbnormalItemInfoList){
ExceptionItem exceptionItem = testAbnormalItemInfo.getExceptionItem();
ReportCardDetails reportCardDetails = reportCardDetailsRepository
.findOneByReportCardAndExceptionItemAndSpecial(reportCard, exceptionItem, special);
if (reportCardDetails != null){
ItemAnswerMessageDTO itemAnswerMessageDTO = new ItemAnswerMessageDTO();
itemAnswerMessageDTO.setAnswer(reportCardDetails.getAnswer());
itemAnswerMessageDTO.setChoice(reportCardDetails.getChoice());
itemAnswerMessageDTO.setDetails(exceptionItem.getDetails());
itemAnswerMessageDTO.setId(reportCardDetails.getId());
itemAnswerMessageDTO.setName(exceptionItem.getName());
itemAnswerMessageDTO.setRegion(exceptionItem.getRegion());
exceptionItemList.add(itemAnswerMessageDTO);
}
}
if (bisSpecial){
reportCardMessageResponseDTO.setSpecialItemList(exceptionItemList);
}else{
reportCardMessageResponseDTO.setExceptionItemList(exceptionItemList);
}
}
/**
* 将检查项的回答数据封装到ReportCardMessageResponseDTO中
* @param reportCardMessageResponseDTO
* @param reportCard 成绩单
*/
public void setCheckItemListToReportCardMessageResponseDTO(
ReportCardMessageResponseDTO reportCardMessageResponseDTO, ReportCard reportCard){
List<ReportCardDetails> reportCardDetailsList = reportCardDetailsRepository
.findAllByReportCardAndCheckItemIsNotNull(reportCard);
List<ItemAnswerMessageDTO> checkItemList = new ArrayList<>();
if (!CollectionUtils.isEmpty(reportCardDetailsList)){
for (ReportCardDetails reportCardDetails : reportCardDetailsList){
CheckItem checkItem = reportCardDetails.getCheckItem();
ItemAnswerMessageDTO itemAnswerMessageDTO = new ItemAnswerMessageDTO();
itemAnswerMessageDTO.setAnswer(reportCardDetails.getAnswer());
itemAnswerMessageDTO.setChoice(reportCardDetails.getChoice());
itemAnswerMessageDTO.setDetails(checkItem.getChineseName());
itemAnswerMessageDTO.setId(reportCardDetails.getId());
itemAnswerMessageDTO.setName(checkItem.getName());
itemAnswerMessageDTO.setRegion(checkItem.getRegion());
checkItemList.add(itemAnswerMessageDTO);
}
}
reportCardMessageResponseDTO.setCheckItemList(checkItemList);
}
/**
* 获取个人成绩单
* @param areaId 区域ID
* @param isRecycle 是否在回收站 false 否 true 是
* @param card 工号
* @param username 姓名
* @param questionPaperName 试卷名字
* @param classType 班别
* @param examTime 考试时间
* @param invigilator 监考人名字
* @param page
* @param pageSize
* @return
*/
public PageResponse<WebReportCardMessageResponseDTO> findAllReportCardInRecycleByCondition(
Long areaId, Boolean isRecycle, String card, String username, String questionPaperName,
String classType, Long examTime, String invigilator, Integer page, Integer pageSize) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
User user = userService.getCurrentUser();
Page<ReportCard> reportCardPage = null;
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
reportCardPage = reportCardService.findAllReportCardByCondition(
area, isRecycle, card, username, questionPaperName, classType, examTime, invigilator, page, pageSize);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
reportCardPage = reportCardService.findAllReportCardByCondition(
area, isRecycle, card, username, questionPaperName, classType, examTime, invigilator, page, pageSize);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return toPageResponse(reportCardPage);
}
/**
* 封装数据
* @param reportCardPage
* @return
*/
private PageResponse<WebReportCardMessageResponseDTO> toPageResponse(Page<ReportCard> reportCardPage) {
List<WebReportCardMessageResponseDTO> webReportCardMessageResponseDTOList = new ArrayList<>();
PageResponse<WebReportCardMessageResponseDTO> pageResponse = new PageResponse<>();
if (reportCardPage != null) {
if (!CollectionUtils.isEmpty(reportCardPage.getContent())) {
for (ReportCard reportCard : reportCardPage.getContent()) {
WebReportCardMessageResponseDTO webReportCardMessageResponseDTO = reportCardToWebReportCardMessageResponseDTO(reportCard);
webReportCardMessageResponseDTOList.add(webReportCardMessageResponseDTO);
}
}
pageResponse.setPageIndex(reportCardPage.getPageable().getPageNumber() + 1);
pageResponse.setPageSize(reportCardPage.getPageable().getPageSize());
pageResponse.setTotalCount(reportCardPage.getTotalElements());
pageResponse.setTotalPageCount(reportCardPage.getTotalPages());
pageResponse.setList(webReportCardMessageResponseDTOList);
}
return pageResponse;
}
private WebReportCardMessageResponseDTO reportCardToWebReportCardMessageResponseDTO(ReportCard reportCard) {
WebReportCardMessageResponseDTO webReportCardMessageResponseDTO = new WebReportCardMessageResponseDTO();
if(reportCard.getSwitchStatus() == SWITCH_STATUS_CLOSE && reportCard.getCompletionStatus() == COMPLETION_STATUS_FINISHED){
webReportCardMessageResponseDTO.setAssessment(reportCard.getAssessment());
webReportCardMessageResponseDTO.setUsername(reportCard.getUsername());
webReportCardMessageResponseDTO.setCard(reportCard.getCard());
User user = userRepository.findOneByCard(reportCard.getCard()).orElse(null);
if (user != null){
webReportCardMessageResponseDTO.setUserId(user.getId());
}
if (reportCard.getExam() != null){
webReportCardMessageResponseDTO.setClassType(reportCard.getExam().getClassType());
webReportCardMessageResponseDTO.setInvigilator(reportCard.getExam().getInvigilator());
}
if (reportCard.getQuestionPaper() != null){
webReportCardMessageResponseDTO.setQuestionPaperId(reportCard.getQuestionPaper().getId());
webReportCardMessageResponseDTO.setQuestionPaperName(reportCard.getQuestionPaper().getTitle());
}
if (reportCard.getExamTime() != null){
webReportCardMessageResponseDTO.setExamTime(reportCard.getExamTime().toEpochMilli());
}
webReportCardMessageResponseDTO.setReportCardId(reportCard.getId());
webReportCardMessageResponseDTO.setScore(reportCard.getScore());
}
return webReportCardMessageResponseDTO;
}
/**
* VR端获取考试数据
* @return
*/
@Transactional(rollbackFor = LazyInitializationException.class)
public VrQuestionPaperInfoResponseDTO getReportCardByCurrentUser() throws ServerErrorException {
User user = userService.getCurrentUser();
ReportCard reportCard = reportCardService.getReportCardByUser(user.getCard());
return reportCardToVrQuestionPaperInfoResponseDTO(reportCard);
}
/**
* 分装VR端试卷的数据
* @param reportCard
* @return
*/
private VrQuestionPaperInfoResponseDTO reportCardToVrQuestionPaperInfoResponseDTO(ReportCard reportCard) {
VrQuestionPaperInfoResponseDTO vrQuestionPaperInfoResponseDTO = new VrQuestionPaperInfoResponseDTO();
List<CheckItemResponseDTO> checkItemResponseDTOList = new ArrayList<>();
List<ExceptionItemResponseDTO> exceptionItemResponseDTOList = new ArrayList<>();
List<ExceptionItemResponseDTO> specialItemListResponseDTOList = new ArrayList<>();
if (reportCard != null){
vrQuestionPaperInfoResponseDTO.setReportCardId(reportCard.getId());
if (reportCard.getExam() != null){
vrQuestionPaperInfoResponseDTO.setExamId(reportCard.getExam().getId());
if (reportCard.getExam().getExamTime() != null){
vrQuestionPaperInfoResponseDTO.setExamTime(reportCard.getExam().getExamTime().toEpochMilli());
}
}
QuestionPaper questionPaper = reportCard.getQuestionPaper();
if (questionPaper != null) {
vrQuestionPaperInfoResponseDTO.setScore(questionPaper.getScore());
vrQuestionPaperInfoResponseDTO.setPassingScore(questionPaper.getPassingScore());
vrQuestionPaperInfoResponseDTO.setbIsEnvironmentalSound(questionPaper.getBIsEnvironmentalSound());
vrQuestionPaperInfoResponseDTO.setbIsGraphicPopupWindow(questionPaper.getBIsGraphicPopupWindow());
vrQuestionPaperInfoResponseDTO.setbIsLocationHints(questionPaper.getBIsLocationHints());
vrQuestionPaperInfoResponseDTO.setbIsOperatingHints(questionPaper.getBIsOperatingHints());
vrQuestionPaperInfoResponseDTO.setbIsNameTag(questionPaper.getBIsNameTag());
vrQuestionPaperInfoResponseDTO.setbIsPartsOfBuoy(questionPaper.getBIsPartsOfBuoy());
vrQuestionPaperInfoResponseDTO.setbIsVoiceHints(questionPaper.getBIsVoiceHints());
vrQuestionPaperInfoResponseDTO.setbIsWarningNotice(questionPaper.getBIsWarningNotice());
vrQuestionPaperInfoResponseDTO.setDescription(questionPaper.getDescription());
vrQuestionPaperInfoResponseDTO.setQualifiedQuantity(questionPaper.getQualifiedQuantity());
vrQuestionPaperInfoResponseDTO.setExceptionGenerateType(questionPaper.getExceptionGenerateType());
vrQuestionPaperInfoResponseDTO.setRandomAbnormals(questionPaper.getRandomAbnormals());
vrQuestionPaperInfoResponseDTO.setTestLength(questionPaper.getTestLength());
vrQuestionPaperInfoResponseDTO.setTitle(questionPaper.getTitle());
if (questionPaper.getAuthor() != null){
vrQuestionPaperInfoResponseDTO.setAuthor(questionPaper.getAuthor().getUsername());
}
if (questionPaper.getGmtCreated() != null){
vrQuestionPaperInfoResponseDTO.setCreateTime(questionPaper.getGmtCreated().toEpochMilli());
}
if (questionPaper.getAuthor() != null) {
vrQuestionPaperInfoResponseDTO.setAreaId(questionPaper.getArea().getId());
}
if (questionPaper.getModel() != null) {
ModelResponseDTO modelResponseDTO = new ModelResponseDTO();
modelResponseDTO.setName(questionPaper.getModel().getName());
modelResponseDTO.setBrand(questionPaper.getModel().getBrand());
modelResponseDTO.setId(questionPaper.getModel().getId());
vrQuestionPaperInfoResponseDTO.setModel(modelResponseDTO);
}
if (questionPaper.getEngine() != null) {
EngineResponseDTO engineResponseDTO = new EngineResponseDTO();
engineResponseDTO.setId(questionPaper.getEngine().getId());
engineResponseDTO.setName(questionPaper.getEngine().getName());
engineResponseDTO.setType(questionPaper.getEngine().getType());
vrQuestionPaperInfoResponseDTO.setEngine(engineResponseDTO);
}
if (questionPaper.getCourse() != null) {
CourseResponseDTO courseResponseDTO = new CourseResponseDTO();
courseResponseDTO.setName(questionPaper.getCourse().getName());
courseResponseDTO.setId(questionPaper.getCourse().getId());
courseResponseDTO.setChineseName(questionPaper.getCourse().getChineseName());
vrQuestionPaperInfoResponseDTO.setCourse(courseResponseDTO);
checkItemResponseDTOList = getCheckItemList(checkItemResponseDTOList, questionPaper.getCourse());
exceptionItemResponseDTOList = getExceptionItemList(exceptionItemResponseDTOList, questionPaper, questionPaper.getCourse(), EXCEPTION_ITEM_IS_NOT_SPECIAL_ITEM);
specialItemListResponseDTOList = getExceptionItemList(specialItemListResponseDTOList, questionPaper, questionPaper.getCourse(), EXCEPTION_ITEM_IS_SPECIAL_ITEM);
}
}
vrQuestionPaperInfoResponseDTO.setCheckItemList(checkItemResponseDTOList);
vrQuestionPaperInfoResponseDTO.setExceptionItemList(exceptionItemResponseDTOList);
vrQuestionPaperInfoResponseDTO.setSpecialItemList(specialItemListResponseDTOList);
}else{
vrQuestionPaperInfoResponseDTO = null;
}
return vrQuestionPaperInfoResponseDTO;
}
private List<ExceptionItemResponseDTO> getExceptionItemList(
List<ExceptionItemResponseDTO> exceptionItemResponseDTOList,
QuestionPaper questionPaper, Course course, Integer special) {
List<TestAbnormalItemInfo> testAbnormalItemInfoList = testAbnormalItemInfoService
.findAllTestAbnormalItemInfo(questionPaper, course, special);
if (!CollectionUtils.isEmpty(testAbnormalItemInfoList)) {
for (TestAbnormalItemInfo testAbnormalItemInfo : testAbnormalItemInfoList) {
ExceptionItemResponseDTO exceptionItemResponseDTO = new ExceptionItemResponseDTO();
exceptionItemResponseDTO.setEngineType(testAbnormalItemInfo.getExceptionItem().getEngine().getType());
exceptionItemResponseDTO.setName(testAbnormalItemInfo.getExceptionItem().getName());
exceptionItemResponseDTO.setId(testAbnormalItemInfo.getExceptionItem().getId());
exceptionItemResponseDTOList.add(exceptionItemResponseDTO);
}
}
return exceptionItemResponseDTOList;
}
private List<CheckItemResponseDTO> getCheckItemList(List<CheckItemResponseDTO> checkItemResponseDTOList, Course course) {
if (course != null) {
List<CheckItem> checkItemList = course.getCheckItem();
if (!CollectionUtils.isEmpty(checkItemList)) {
for (CheckItem checkItem : checkItemList) {
CheckItemResponseDTO checkItemResponseDTO = new CheckItemResponseDTO();
checkItemResponseDTO.setEngineType(checkItem.getEngine().getType());
checkItemResponseDTO.setName(checkItem.getName());
checkItemResponseDTO.setId(checkItem.getId());
checkItemResponseDTOList.add(checkItemResponseDTO);
}
}
}
return checkItemResponseDTOList;
}
/**
* VR端接收考试回答的数据
* @param requestDTO
*/
public void answerExamByCurrentUser(VrExamResultRequestDTO requestDTO) throws ServerErrorException {
reportCardService.answerExamByCurrentUser(
requestDTO.getReportCardId(), requestDTO.getScore(), requestDTO.getAssessment(), requestDTO.getList());
}
/**
* 根据考试ID获取班级成绩单
* @param examId
* @param sortType
* @param page
* @param pageSize
* @return
*/
public WebClassReportCardInfoResponseDTO getClassReportCardByExam(Long examId, Integer sortType, Integer page, Integer pageSize) {
WebClassReportCardInfoResponseDTO webClassReportCardInfoResponseDTO = new WebClassReportCardInfoResponseDTO();
List<ClassReportCardMessageDTO> classReportCardMessageDTOList = new ArrayList<>();
Integer count = 0;
Exam exam = examRepository.findOneById(examId);
if (exam != null){
List<ReportCardRank> reportCardRanks = new ArrayList<>();
if (sortType.equals(CARD_INT)){
reportCardRanks = reportCardRankRepository.findAllByExamIdAndCardDesc(examId, (page - 1) * pageSize , pageSize);
}else if(sortType.equals(SCORE_INT)){
reportCardRanks = reportCardRankRepository.findAllByExamIdAndScoreDesc(examId, (page - 1) * pageSize , pageSize);
}
count = reportCardRankRepository.findAllByExamId(examId);
if (!CollectionUtils.isEmpty(reportCardRanks)) {
for (ReportCardRank reportCardRank : reportCardRanks) {
ClassReportCardMessageDTO classReportCardMessageDTO = reportCardRankToClassReportCardMessageDTO(reportCardRank);
classReportCardMessageDTOList.add(classReportCardMessageDTO);
}
}
webClassReportCardInfoResponseDTO.setClassType(exam.getClassType());
if(exam.getExamTime() != null){
webClassReportCardInfoResponseDTO.setExamTime(exam.getExamTime().toEpochMilli());
}
webClassReportCardInfoResponseDTO.setInvigilators(exam.getInvigilator());
webClassReportCardInfoResponseDTO.setQuestionPaperId(exam.getQuestionPaper().getId());
webClassReportCardInfoResponseDTO.setTitle(exam.getQuestionPaper().getTitle());
}
webClassReportCardInfoResponseDTO.setPageIndex(page);
webClassReportCardInfoResponseDTO.setPageSize(pageSize);
webClassReportCardInfoResponseDTO.setTotalCount(count);
if (count % pageSize == 0){
webClassReportCardInfoResponseDTO.setTotalPageCount(Long.valueOf(count / pageSize));
}else{
webClassReportCardInfoResponseDTO.setTotalPageCount(Long.valueOf(count / pageSize + 1));
}
webClassReportCardInfoResponseDTO.setReportCardList(classReportCardMessageDTOList);
return webClassReportCardInfoResponseDTO;
}
/**
* 将reportCardRank的数据封装到ClassReportCardMessageDTO类中
* @param reportCardRank
* @return
*/
private ClassReportCardMessageDTO reportCardRankToClassReportCardMessageDTO(ReportCardRank reportCardRank) {
ClassReportCardMessageDTO classReportCardMessageDTO = new ClassReportCardMessageDTO();
User user = userRepository.findOneByCard(reportCardRank.getCard()).orElse(null);
if (user != null){
if (user.getActivation()){
classReportCardMessageDTO.setUserId(user.getId());
classReportCardMessageDTO.setClassType(user.getClassType());
if (user.getArea() != null){
classReportCardMessageDTO.setAreaName(user.getArea().getName());
classReportCardMessageDTO.setPosition(user.getArea().getPosition());
}
classReportCardMessageDTO.setAssessment(reportCardRank.getAssessment());
classReportCardMessageDTO.setCard(reportCardRank.getCard());
classReportCardMessageDTO.setRemarks(reportCardRank.getRemarks());
classReportCardMessageDTO.setReportCardId(reportCardRank.getId());
classReportCardMessageDTO.setScore(reportCardRank.getScore());
classReportCardMessageDTO.setUsername(reportCardRank.getUsername());
classReportCardMessageDTO.setRank(reportCardRank.getRank());
}
}
return classReportCardMessageDTO;
}
/**
* 根据用户ID导出用户的个人成绩单
* @param userId
* @param request
* @param response
*/
public void exportPersonReportCard(Long userId, HttpServletRequest request, HttpServletResponse response) throws ServerErrorException {
User user = userService.confirmUserIsExist(userId);
String agent = request.getHeader("user-agent");
User currentUser = userService.getCurrentUser();
log.info("{} exports {} personal transcript.", currentUser.getUsername(), user.getUsername());
reportCardService.exportPersonReportCard(user, agent, response);
}
/**
* 导出某场考试的班级成绩单
* @param examId
* @param request
* @param response
*/
public void exportClassReportCard(Long examId, HttpServletRequest request, HttpServletResponse response) throws ServerErrorException {
Exam exam = examRepository.findOneById(examId);
if (exam == null){
log.error("exam is not exists.");
throw new ServerErrorException(EXAM_IS_NOT_EXISTS);
}
String agent = request.getHeader("user-agent");
List<ReportCardRank> reportCardRanks = reportCardRankRepository.findAllByExamIdAndCardDesc(examId);
User currentUser = userService.getCurrentUser();
log.info("{} exports a class transcript of an exam. Exam id is {}.", currentUser.getUsername(), examId);
reportCardService.exportClassReportCard(reportCardRanks, exam, agent, response);
}
}
package cn.com.sailfish.linghang.resource;
import cn.com.sailfish.linghang.dao.web.response.WebSumResponseDTO;
import cn.com.sailfish.linghang.dao.web.response.WebVrSumResponseDTO;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.service.EntityManagerService;
import cn.com.sailfish.linghang.service.UserInfoService;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author lichunjiang
* @Creat At 2019/10/16
* @description
*
*/
@Service
public class UserInfoResource {
private static final Logger log=LoggerFactory.getLogger(UserInfoResource.class);
private UserInfoService userInfoService;
private EntityManagerService entityManagerService;
@Autowired
public UserInfoResource(UserInfoService userInfoService,EntityManagerService entityManagerService){
this.userInfoService=userInfoService;
this.entityManagerService=entityManagerService;
}
/**
* description 查询系统统计;
* @param deptment
* @param course
* @param type
* @param startTime
* @param endTime
* @return List<WebVrSumResponseDTO>
* @throws ServerErrorException
*/
public List<WebVrSumResponseDTO> findSum(String deptment ,String course ,String type ,String startTime,String endTime ) {
List<WebVrSumResponseDTO> list= null;
try {
list = entityManagerService.findsum(deptment,course,type,startTime,endTime);
if(null!=type) {
for (int i = 0; i <= list.size(); i++) {
list.get(i).setType(type);
}
}
if(null!=course){
for (int i = 0; i <=list.size(); i++) {
list.get(i).setCourse(course);
}
}
if(null!=startTime&&null!=endTime){
for(int i=0;i<=list.size();i++){
list.get(i).setUsertime(startTime+"-"+endTime);
}
}
log.info("list.size() is {}",list.size());
if (null==deptment||"".equals(deptment)){
WebVrSumResponseDTO webVrSumResponseDTO=entityManagerService.findOneSum(course ,type ,startTime,endTime );
if(null!=type) {
webVrSumResponseDTO.setType(type);
}
if(null!=course){
webVrSumResponseDTO.setCourse(course);
}
if(null!=startTime&&null!=endTime){
webVrSumResponseDTO.setUsertime(startTime+"-"+endTime);
}
list.add(webVrSumResponseDTO);
log.info("list.size() is {}",list.size());
}
} catch (Exception e) {
e.printStackTrace();
}
log.info("list.size() is {}",list.size());
return list;
};
/**
* description 查询所有课程中午名;
* @return List<String>
*/
public List<String> findAllChineseName(){
List<String> list= null;
try {
list = entityManagerService.findAllChineseName();
} catch (Exception e) {
e.printStackTrace();
}
log.info("list.size() is {}",list.size());
return list;
}
/**
* description 查询所有部门;
* @return List<String>
*/
public List<String> findAllDISrgUnitFullName(){
List<String> list= null;
try {
list = entityManagerService.findAllDISrgUnitFullName();
} catch (Exception e) {
e.printStackTrace();
}
log.info("list.size() is {}",list.size());
return list;
}
/**
* description 查询网页浏览记录
* @param type
* @param startTime
* @param endTime
* @return
*/
public List<WebSumResponseDTO> findWebSum(String type, String startTime, String endTime){
List<WebSumResponseDTO> webList=null;
try {
webList=entityManagerService.findWebSum(type,startTime,endTime);
for (int i=0;i<=webList.size();i++){
if (null!=startTime && null!=endTime){
webList.get(i).setParttime(startTime+"-"+endTime);
}
}
log.info("webList.size() is {}",webList.size());
} catch (Exception e) {
e.printStackTrace();
}
return webList;
}
}
package cn.com.sailfish.linghang.resource;
import cn.com.sailfish.linghang.common.RestRespDTO;
import cn.com.sailfish.linghang.config.property.CaptchaProperty;
import cn.com.sailfish.linghang.dao.CaptchaValidateDTO;
import cn.com.sailfish.linghang.dao.UserLoginStatus;
import cn.com.sailfish.linghang.dao.vr.request.VrSendMobileCodeRequestDTO;
import cn.com.sailfish.linghang.dao.vr.request.VrUserLoginRequestDTO;
import cn.com.sailfish.linghang.dao.vr.request.VrUserRegisterRequestDTO;
import cn.com.sailfish.linghang.dao.vr.response.VrUserLoginResponseDTO;
import cn.com.sailfish.linghang.dao.web.request.*;
import cn.com.sailfish.linghang.dao.web.response.PageResponse;
import cn.com.sailfish.linghang.dao.web.response.WebUserLoginResponseDTO;
import cn.com.sailfish.linghang.dao.web.response.WebUserMessageResponseDTO;
import cn.com.sailfish.linghang.dao.web.response.WebUserResponseDTO;
import cn.com.sailfish.linghang.domain.Area;
import cn.com.sailfish.linghang.domain.User;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.repository.UserRepository;
import cn.com.sailfish.linghang.service.AreaService;
import cn.com.sailfish.linghang.service.UserService;
import cn.com.sailfish.linghang.util.IPUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.time.Instant;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static cn.com.sailfish.linghang.common.ErrorConstants.*;
import static cn.com.sailfish.linghang.common.ErrorConstants.INSUFFICIENT_USER_PERMISSION;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.USER_LOGIN_STATUS;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.USER_TOKEN;
import static cn.com.sailfish.linghang.security.SystemPrivilege.*;
/**
* Author: huangpeilin
* Create at: 2019-04-23 9:29:40
* Description:
*
* @author huangpeilin
*/
@Component
public class UserResource {
private final Logger log = LoggerFactory.getLogger(UserResource.class);
private UserService userService;
private UserRepository userRepository;
private AreaService areaService;
private CaptchaProperty captchaProperty;
@Autowired
public UserResource(UserService userService, UserRepository userRepository,
AreaService areaService, CaptchaProperty captchaProperty){
this.userService = userService;
this.userRepository = userRepository;
this.areaService = areaService;
this.captchaProperty = captchaProperty;
}
private static final String CAPTCHA_SESSION = "captchaValidate";
/**
* 最多允许登录失败的次数
*/
private static final Integer MAX_LOGIN_COUNT = 5;
/**
* 账号被锁定的时间 秒为单位
*/
private static final Integer MAX_LOGIN_LOCK_TIME = 10 * 60;
/**
* 根据导入职位导入用户数据
* @param file
* @param type 0 乘务 1 机务
* @throws ServerErrorException
*/
public Set<Long> importUserInfo(MultipartFile file, Integer type) throws ServerErrorException {
User leader = userService.getCurrentUser();
Area area = leader.getArea();
Set<Long> areaIdList = new HashSet<>();
if (leader.getAuthority() <= ADMIN_INT && leader.getEnable()){
log.info("{} imports user data.", leader.getUsername());
userService.importUserInfo(file, leader, type, areaIdList);
}else if(leader.getAuthority() == INSTRUCTOR_INT && leader.getEnable()){
if (type.equals(area.getPosition())){
log.info("{} imports user data.", leader.getUsername());
userService.importUserInfo(file, leader, type, areaIdList);
}else{
log.error("{} operate across regions.", leader.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("{} insufficient user permissions.", leader.getUsername());
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return areaIdList;
}
/**
* web端用户登录
* @param requestDTO
* @return
*/
@Transactional
public WebUserLoginResponseDTO userLoginInWeb(WebUserLoginRequestDTO requestDTO, HttpServletRequest request) throws ServerErrorException {
checkCaptcha(requestDTO.getCaptcha(), request);
checkUserLoginStatus(requestDTO.getLoginName() + "-login");
User user = userService.getUserInfoByCard(requestDTO.getLoginName());
if (user == null){
log.error("user is not exist.");
throw new ServerErrorException(USER_ACCOUNT_IS_ERROR);
}
if (!user.getActivation() || !user.getEnable()) {
log.error("user is not activated.");
throw new ServerErrorException(USER_ACCOUNT_IS_ERROR);
}
String ip = IPUtil.getLoginIP(request);
String token = userService.loginByUserInWeb(user, requestDTO.getPassword(), ip, requestDTO.getCommonMobile(), requestDTO.getMobileCode(), requestDTO.getToken());
WebUserLoginResponseDTO responseDTO = new WebUserLoginResponseDTO();
responseDTO.setId(user.getId());
responseDTO.setToken(token);
USER_TOKEN.put(requestDTO.getLoginName() + "-web", token);
USER_LOGIN_STATUS.remove(requestDTO.getLoginName() + "-login");
log.info("{} login in web. ip is {}.", user.getUsername(), ip);
return responseDTO;
}
/**
* 判断用户账号是否被锁定
* @param loginName 用户账号
*/
private synchronized void checkUserLoginStatus(String loginName) throws ServerErrorException {
UserLoginStatus userLoginStatus = USER_LOGIN_STATUS.get(loginName);
Instant now = Instant.now();
if (userLoginStatus != null){
Integer count = userLoginStatus.getCount();
Instant lastLoginTime = userLoginStatus.getLoginTime();
if (count >= MAX_LOGIN_COUNT){
// 10分钟时限
Instant unlockTime = lastLoginTime.plusSeconds(MAX_LOGIN_LOCK_TIME);
if (unlockTime.isAfter(now)){
log.info("user account is lock.");
throw new ServerErrorException(USER_ACCOUNT_IS_LOCK);
}
}
}else{
userLoginStatus = new UserLoginStatus();
userLoginStatus.setCount(0);
userLoginStatus.setLoginTime(now);
USER_LOGIN_STATUS.put(loginName, userLoginStatus);
}
}
/**
* 验证验证码是否正确
* @param captcha
* @param request
* @throws ServerErrorException
*/
private void checkCaptcha(String captcha, HttpServletRequest request) throws ServerErrorException {
captcha = captcha.toLowerCase();
HttpSession session = request.getSession();
CaptchaValidateDTO validate = (CaptchaValidateDTO) session.getAttribute(CAPTCHA_SESSION);
if (validate == null) {
log.warn("The Captcha verification code expires.");
throw new ServerErrorException(CAPTCHA_CODE_EXPIRES);
}
Instant codeActiveTime = validate.getActiveTime().plusSeconds(captchaProperty.getValidTime());
if(codeActiveTime.isBefore(Instant.now())){
session.removeAttribute(CAPTCHA_SESSION);
log.warn("The Captcha verification code expires.");
throw new ServerErrorException(CAPTCHA_CODE_EXPIRES);
}
if (!validate.getCaptcha().equals(captcha)) {
session.removeAttribute(CAPTCHA_SESSION);
log.warn("The Captcha verification code error.");
throw new ServerErrorException(CAPTCHA_CODE_ERROR);
}
session.removeAttribute(CAPTCHA_SESSION);
}
/**
* 新增用户
* @param requestDTO
*/
public void userCreate(WebUserCreateRequestDTO requestDTO) throws ServerErrorException {
User user = userService.getCurrentUser();
log.info("{} create user. User card is {}.", user.getUsername(), requestDTO.getCard());
userService.userCreate(requestDTO);
}
/**
* 根据用户ID获取用户信息
* @param id
* @return
*/
public WebUserResponseDTO findOneById(Long id) {
User user = userRepository.findOneById(id);
return userToWebUserResponseDTO(user);
}
/**
* 获取当前登录用户
* @return
* @throws ServerErrorException
*/
public WebUserResponseDTO getCurrentUser() throws ServerErrorException {
User user = userService.getCurrentUser();
return userToWebUserResponseDTO(user);
}
/**
* 根据有没有加入考试队列的状态分页获取某个区域下的所有人
* @param areaId 区域ID
* @param type 考试队列的状态 0 所有人 1 没有加入考试队列的人 2 加入考试队列的人
* @param page 页数
* @param pageSize 每一页的条数
* @return
* @throws ServerErrorException
*/
public PageResponse<WebUserResponseDTO> findAllByAreaAndExamType(Long areaId, Integer type, Integer page, Integer pageSize) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
User user = userService.getCurrentUser();
Page<User> userPage;
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
userPage = userService.findAllByAreaAndExamType(areaId, type, page, pageSize);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
userPage = userService.findAllByAreaAndExamType(areaId, type, page, pageSize);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return toPageResponse(userPage);
}
/**
* 根据工号,姓名,班别,负责人搜索用户
* @param requestDTO
* @return
*/
public PageResponse<WebUserResponseDTO> findAllUserByCondition(WebUserConditionRequestDTO requestDTO) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
User user = userService.getCurrentUser();
Page<User> userPage;
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
userPage = userService.findAllUserByCondition(requestDTO);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
userPage = userService.findAllUserByCondition(requestDTO);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return toPageResponse(userPage);
}
/**
* 将用户放入回收站或者从回收站还原
* @param requestDTO
* @param activation true 代表还原 false 代表回收
* @throws ServerErrorException
*/
public void operationUserInRecycle(WebUserBatchOperationRequestDTO requestDTO, boolean activation) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
User user = userService.getCurrentUser();
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
if (activation){
log.info("{} recovers user from the recycle bin.", user.getUsername());
}else{
log.info("{} puts user in the recycling bin", user.getUsername());
}
userService.operationUserInRecycle(requestDTO, activation);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
if (activation){
log.info("{} recovers user from the recycle bin.", user.getUsername());
}else{
log.info("{} puts user in the recycling bin", user.getUsername());
}
userService.operationUserInRecycle(requestDTO, activation);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
}
/**
* 搜索回收站中的用户
* @param column 名字或者工号
* @param areaId 区域ID
* @return
*/
public List<WebUserResponseDTO> getRecycleUser(String column, Long areaId) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
User user = userService.getCurrentUser();
List<User> userList;
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
log.info("{} gets some users in the recycle bin based on {}.", user.getUsername(), column);
userList = userService.getRecycleUser(column, areaId);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
log.info("{} gets some users in the recycle bin based on {}.", user.getUsername(), column);
userList = userService.getRecycleUser(column, areaId);
}else{
log.error("{} operate across regions.", user.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return userListToWebUserResponseDTOList(userList);
}
/**
* 根据工号或名字搜索某个职位的所有教员
* @param column 名字或者工号
* @param areaId 区域ID
* @param type 获取用户类型 0 学员 1 教员 2 所有
* @return
*/
public List<WebUserResponseDTO> findAllByPosition(String column, Long areaId, Integer type) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
User user = userService.getCurrentUser();
List<User> userList;
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
userList = userService.findAllByPosition(column, areaId, type);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
userList = userService.findAllByPosition(column, areaId, type);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return userListToWebUserResponseDTOList(userList);
}
/**
* 根据工号、姓名、班别、区域、职位搜索回收站的人员
* @param requestDTO
* @return
*/
public PageResponse<WebUserResponseDTO> findAllRecycleUser(WebUserRecycleConditionRequestDTO requestDTO) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
User user = userService.getCurrentUser();
Page<User> userPage;
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
log.info("{} gets some users in the recycle bin based on the criteria.", user.getUsername());
userPage = userService.findAllRecycleUser(requestDTO);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
log.info("{} gets some users in the recycle bin based on the criteria.", user.getUsername());
userPage = userService.findAllRecycleUser(requestDTO);
}else{
log.error("{} operate across regions.", user.getUsername());
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return toPageResponse(userPage);
}
/**
* 根据工号、姓名查找用户 工号名字为空的时候查找所有
* @param areaId 区域ID
* @param activation 是否在回收站中 true代表激活(不在回收站中) false代表未激活(在回收站中)
* @param card 工号
* @param username 名字
* @param page 页数
* @param pageSize 每一页的条数
* @return
*/
public PageResponse<WebUserResponseDTO> findAllUserByCardOrUsername(
Long areaId, boolean activation, String card,
String username, Integer page, Integer pageSize) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
User user = userService.getCurrentUser();
Page<User> userPage;
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
userPage = userService.findAllUserByCardOrUsername(areaId, activation, card, username, page, pageSize);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
userPage = userService.findAllUserByCardOrUsername(areaId, activation, card, username, page, pageSize);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
return toPageResponse(userPage);
}
/**
* 批量启用用户权限
* @param requestDTO
*/
@Transactional(rollbackFor = Exception.class)
public void enableUserAuthority(WebUserBatchOperationRequestDTO requestDTO) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
User user = userService.getCurrentUser();
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
userService.enableOrDisableUserAuthority(requestDTO, true, user);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
userService.enableOrDisableUserAuthority(requestDTO, true, user);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
}
/**
* 批量关闭用户权限
* @param requestDTO
*/
public void disableUserAuthority(WebUserBatchOperationRequestDTO requestDTO) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
User user = userService.getCurrentUser();
if (user.getAuthority() <= ADMIN_INT && user.getEnable()){
userService.enableOrDisableUserAuthority(requestDTO, false, user);
}else if(user.getAuthority() == INSTRUCTOR_INT && user.getEnable()){
if (area.getId().equals(user.getArea().getId())){
userService.enableOrDisableUserAuthority(requestDTO, false, user);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
}
/**
* 将User的List集合装化为WebUserResponseDTO的List集合
* @param userList
* @return
*/
private List<WebUserResponseDTO> userListToWebUserResponseDTOList(List<User> userList){
List<WebUserResponseDTO> webUserResponseDTOList = new ArrayList<>();
if (!CollectionUtils.isEmpty(userList)) {
for (User user : userList) {
WebUserResponseDTO webUserResponseDTO = userToWebUserResponseDTO(user);
webUserResponseDTOList.add(webUserResponseDTO);
}
}
return webUserResponseDTOList;
}
/**
* 用户数据分装成分页数据
* @param userPage
* @return
*/
private PageResponse<WebUserResponseDTO> toPageResponse(Page<User> userPage){
List<WebUserResponseDTO> webUserResponseDTOList = new ArrayList<>();
PageResponse<WebUserResponseDTO> pageResponse = new PageResponse<>();
if (userPage != null){
if (!CollectionUtils.isEmpty(userPage.getContent())) {
for (User user : userPage.getContent()) {
WebUserResponseDTO webUserResponseDTO = userToWebUserResponseDTO(user);
webUserResponseDTOList.add(webUserResponseDTO);
}
}
pageResponse.setPageIndex(userPage.getPageable().getPageNumber() + 1);
pageResponse.setPageSize(userPage.getPageable().getPageSize());
pageResponse.setTotalCount(userPage.getTotalElements());
pageResponse.setTotalPageCount(userPage.getTotalPages());
pageResponse.setList(webUserResponseDTOList);
}
return pageResponse;
}
/**
* 封装user的数据
* @param user
* @return
*/
private WebUserResponseDTO userToWebUserResponseDTO(User user) {
WebUserResponseDTO webUserResponseDTO = new WebUserResponseDTO();
if (user != null) {
webUserResponseDTO.setId(user.getId());
webUserResponseDTO.setAuthority(user.getAuthority());
webUserResponseDTO.setCard(user.getCard());
webUserResponseDTO.setClassType(user.getClassType());
webUserResponseDTO.setEmail(user.getEmail());
webUserResponseDTO.setGender(user.getGender());
webUserResponseDTO.setMobilePhone(user.getMobilePhone());
webUserResponseDTO.setType(user.getType());
webUserResponseDTO.setUserImage(user.getUserImage());
webUserResponseDTO.setUsername(user.getUsername());
webUserResponseDTO.setStatus(user.getStatus());
webUserResponseDTO.setRemarks(user.getRemarks());
webUserResponseDTO.setEnable(user.getEnable());
// 用户是开发者权限的时候 不用返回区域数据
if(user.getAuthority() != DEVELOPER_INT){
if (user.getArea() != null) {
webUserResponseDTO.setAreaId(user.getArea().getId());
webUserResponseDTO.setAreaName(user.getArea().getName());
webUserResponseDTO.setPosition(user.getArea().getPosition());
}
}
if (user.getLeader() != null) {
webUserResponseDTO.setLeaderId(user.getLeader().getId());
webUserResponseDTO.setLeaderName(user.getLeader().getUsername());
}
}
return webUserResponseDTO;
}
/**
* 修改用户信息
* @param requestDTO
*/
public void userModify(WebUserUpdateRequestDTO requestDTO) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(requestDTO.getAreaId());
User user = userService.getCurrentUser();
Integer authority = user.getAuthority();
if (authority != null && authority > requestDTO.getAuthority()){
log.error("permission denied.");
throw new ServerErrorException(USER_PERMISSION_DENIED);
}
if (authority >= ADMIN_INT){
if (!user.getId().equals(requestDTO.getId())){
if (!area.getId().equals(user.getArea().getId())){
log.error("permission denied.");
throw new ServerErrorException(USER_PERMISSION_DENIED);
}
}
}
log.info("{} modify user id is {} message.", user.getUsername(), requestDTO.getId());
userService.userModify(requestDTO, area);
}
/**
* 根据区域ID获取该区域下的用户
* @param id 区域ID
* @return
*/
public List<WebUserMessageResponseDTO> findAllUserByAreaId(Long id) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(id);
User currentUser = userService.getCurrentUser();
List<User> userList;
if (currentUser.getAuthority() <= ADMIN_INT && currentUser.getEnable()){
userList = userRepository.findAllByAreaAndActivation(area, true);
}else if(currentUser.getAuthority() == INSTRUCTOR_INT && currentUser.getEnable()){
if (area.getId().equals(currentUser.getArea().getId())){
userList = userRepository.findAllByAreaAndActivation(area, true);
}else{
log.error("users operate across regions.");
throw new ServerErrorException(USER_OPERATE_ACROSS_REGION);
}
}else{
log.error("insufficient user permissions.");
throw new ServerErrorException(INSUFFICIENT_USER_PERMISSION);
}
List<WebUserMessageResponseDTO> webUserMessageResponseDTOList = new ArrayList<>();
if (!CollectionUtils.isEmpty(userList)){
for (User user : userList){
WebUserMessageResponseDTO webUserMessageResponseDTO = new WebUserMessageResponseDTO();
webUserMessageResponseDTO.setId(user.getId());
webUserMessageResponseDTO.setUsername(user.getUsername());
webUserMessageResponseDTOList.add(webUserMessageResponseDTO);
}
}
return webUserMessageResponseDTOList;
}
/**
* 用户在VR端登陆
* @param requestDTO
* @return
*/
public VrUserLoginResponseDTO userLoginInVr(VrUserLoginRequestDTO requestDTO, HttpServletRequest request) throws ServerErrorException {
User user = userRepository.findOneByCard(requestDTO.getLoginName()).orElse(null);
if (user == null) {
log.error("user is not exists.");
throw new ServerErrorException(USER_IS_NOT_EXISTS);
}
if (!user.getActivation() || !user.getEnable()) {
log.error("user is not activated.");
throw new ServerErrorException(USER_IS_NOT_ACTIVATED);
}
String ip = IPUtil.getLoginIP(request);
String token = userService.loginByUserInVr(user, requestDTO.getPassword(), requestDTO.getQueueName(), ip, requestDTO.getCommonMobile(), requestDTO.getMobileCode(), requestDTO.getToken());
VrUserLoginResponseDTO responseDTO = new VrUserLoginResponseDTO();
responseDTO.setId(user.getId());
responseDTO.setToken(token);
responseDTO.setLoginTime(Instant.now().toEpochMilli());
responseDTO.setPosition(user.getArea().getPosition());
USER_TOKEN.put(user.getCard() + "-vr", token);
log.info("{} login in vr. ip is {}.", user.getUsername(), ip);
return responseDTO;
}
/**
* 退出登录
*/
public void logoutInVr(HttpServletRequest request) throws ServerErrorException {
userService.logoutInVr(request);
}
/**
* Vr端注册公共账号
* @param requestDTO
*/
public void registerInVr(VrUserRegisterRequestDTO requestDTO) throws ServerErrorException {
String loginName = requestDTO.getLoginName();
String password = requestDTO.getPassword();
Integer position = requestDTO.getPosition();
String remarks = requestDTO.getRemarks();
userService.registerInVr(loginName, password, position, remarks);
}
/**
* web端退出登录
*/
public void logoutInWeb(HttpServletRequest request) {
try {
User user = userService.getCurrentUser();
USER_TOKEN.remove(user.getCard() + "-web");
String ip = IPUtil.getLoginIP(request);
log.info("{} logout in web. ip is {}.", user.getUsername(), ip);
} catch (ServerErrorException e) {
log.debug(e.getMessage());
}
}
/**
* 导出某个区域的用户数据
* @param areaId
* @param request
* @param response
*/
public void exportExcel(Long areaId, HttpServletRequest request, HttpServletResponse response) throws ServerErrorException {
Area area = areaService.confirmAreaIsExist(areaId);
String agent = request.getHeader("user-agent");
User user = userService.getCurrentUser();
log.info("{} exports user data in {}.", user.getUsername(), area.getName());
userService.exportExcel(area, agent, response);
}
public List<String> checkUserToRecycle(List<Long> ids, Long areaId) throws ServerErrorException {
return userService.checkUserToRecycle(ids, areaId);
}
/**
* 检测是否可以指定超级管理员(一级权限)
* @param id
* @return
*/
public String checkAddSuper(Long id) {
return userService.checkAddSuper(id);
}
/**
*获取验证码
* @param requestDTO
* @param request
*/
public RestRespDTO requestMobileCode(VrSendMobileCodeRequestDTO requestDTO,
HttpServletRequest request) {
String ip = IPUtil.getLoginIP(request);
log.info("{} requestMobileCode data in {}."+requestDTO.getLoginName(),ip,requestDTO.getToken());
return userService.requestMobileCode(requestDTO.getLoginName(), ip, requestDTO.getToken());
}
}
package cn.com.sailfish.linghang.security;
import cn.com.sailfish.linghang.domain.User;
import cn.com.sailfish.linghang.repository.UserRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;
import java.util.Optional;
/**
* Author: huangpeilin
* Create at: 2018-12-12 14:09:16
* Description:
*
* @author huangpeilin
*/
@Component("userDetailsService")
public class DomainUserDetailsService implements UserDetailsService {
private Logger log = LoggerFactory.getLogger(DomainUserDetailsService.class);
@Autowired
UserRepository userRepository;
@Override
public UserDetails loadUserByUsername(String login) throws UsernameNotFoundException {
Optional<User> userFromDatabase = userRepository.findOneByCard(login);
if(!userFromDatabase.isPresent()) {
log.info("Not found user by card {}, try to found with user phone", login);
userFromDatabase = userRepository.findOneByMobilePhone(login);
}
return userFromDatabase.map(user -> {
return new JWTUser(user.getCard(), user.getPassword(), user.getAuthority());
}).orElseThrow(() -> new UsernameNotFoundException("User " + login + " was not found in the " +
"database"));
}
}
package cn.com.sailfish.linghang.security.jwt;
import cn.com.sailfish.linghang.filter.JWTFilter;
import cn.com.sailfish.linghang.repository.UserRepository;
import org.springframework.security.config.annotation.SecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.DefaultSecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:50:15
* Description:
*
* @author huangpeilin
*/
public class JWTConfigurer extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> {
public static final String AUTHORIZATION_HEADER = "Authorization";
private TokenProvider tokenProvider;
private UserRepository userRepository;
public JWTConfigurer(TokenProvider tokenProvider, UserRepository userRepository) {
this.tokenProvider = tokenProvider;
this.userRepository = userRepository;
}
@Override
public void configure(HttpSecurity http) throws Exception {
JWTFilter customFilter = new JWTFilter(tokenProvider, userRepository);
http.addFilterBefore(customFilter, UsernamePasswordAuthenticationFilter.class);
}
}
package cn.com.sailfish.linghang.security.jwt;
import cn.com.sailfish.linghang.config.property.SecurityProperty;
import cn.com.sailfish.linghang.repository.UserRepository;
import cn.com.sailfish.linghang.security.JWTUser;
import cn.com.sailfish.linghang.security.SystemPrivilege;
import io.jsonwebtoken.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Date;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:32:58
* Description:
*
* @author huangpeilin
*/
@Component
public class TokenProvider {
private final Logger log = LoggerFactory.getLogger(TokenProvider.class);
private static final String AUTHORITIES_KEY = "auth";
private String secretKey;
private long tokenValidityInMilliseconds;
private long tokenValidityInMillisecondsForRememberMe;
private final SecurityProperty securityProperty;
private UserRepository userRepository;
@Autowired
public TokenProvider(SecurityProperty securityProperty, UserRepository userRepository) {
this.securityProperty = securityProperty;
this.userRepository = userRepository;
}
@PostConstruct
public void init() {
this.secretKey =
securityProperty.getJwt().getSecret();
this.tokenValidityInMilliseconds =
1000 * securityProperty.getJwt().getTokenValidateInSecond();
this.tokenValidityInMillisecondsForRememberMe =
1000 * securityProperty.getJwt().getTokenValidateInSecondForRememberMe();
}
public String createToken(String loginName, Integer authority, Boolean rememberMe) {
long now = (new Date()).getTime();
Date validity;
if (rememberMe) {
validity = new Date(now + this.tokenValidityInMillisecondsForRememberMe);
} else {
validity = new Date(now + this.tokenValidityInMilliseconds);
}
return Jwts.builder()
.setSubject(loginName)
.claim(AUTHORITIES_KEY, authority.toString())
.signWith(SignatureAlgorithm.HS512, secretKey)
.setExpiration(validity)
.compact();
}
public String createToken(Authentication authentication, Boolean rememberMe) {
return createToken(authentication.getName(), SystemPrivilege.getRevertPrivileges(authentication.getAuthorities()), rememberMe);
}
public Authentication getAuthentication(String token) {
Claims claims = Jwts.parser()
.setSigningKey(secretKey)
.parseClaimsJws(token)
.getBody();
Integer authorities = Integer.valueOf(claims.get(AUTHORITIES_KEY).toString());
JWTUser principal = new JWTUser(claims.getSubject(), "", authorities);
return new UsernamePasswordAuthenticationToken(principal, token, SystemPrivilege.getPrivileges(authorities));
}
public boolean validateToken(String authToken) {
try {
Jwts.parser().setSigningKey(secretKey).parseClaimsJws(authToken);
return true;
} catch (SignatureException e) {
log.info("Invalid JWT signature.");
log.trace("Invalid JWT signature trace: {}", e);
} catch (MalformedJwtException e) {
log.info("Invalid JWT token.");
log.trace("Invalid JWT token trace: {}", e);
} catch (ExpiredJwtException e) {
log.info("Expired JWT token.");
log.trace("Expired JWT token trace: {}", e);
} catch (UnsupportedJwtException e) {
log.info("Unsupported JWT token.");
log.trace("Unsupported JWT token trace: {}", e);
} catch (IllegalArgumentException e) {
log.info("JWT token compact of handler are invalid.");
log.trace("JWT token compact of handler are invalid trace: {}", e);
}
return false;
}
}
package cn.com.sailfish.linghang.security;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Collection;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:39:44
* Description:
*
* @author huangpeilin
*/
public class JWTUser implements UserDetails {
private String loginName;
private String password;
private Integer authority; // 用户的系统权限值
public JWTUser(String loginName, String password, Integer authority) {
this.loginName = loginName;
this.password = password;
this.authority = authority;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return SystemPrivilege.getPrivileges(this.authority);
}
@Override
public String getPassword() {
return this.password;
}
@Override
public String getUsername() {
return this.loginName;
}
public Integer getAuthority() {
return this.getAuthority();
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return true;
}
}
package cn.com.sailfish.linghang.security;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import java.util.*;
/**
* Author: huangpeilin
* Create at: 2018-12-12 11:37:14
* Description: 系统权限定义列表
*
* @author huangpeilin
*/
public class SystemPrivilege {
public final static int MAX_ROLE_TYPE = 5; // 最大的用户类型定义个数
public final static String DEVELOPER = "DEVELOPER"; // 开发者权限
public final static int DEVELOPER_INT = 1; // 1
public final static String SUPER_ADMIN = "SUPER_ADMIN";// 超级用户
public final static int SUPER_ADMIN_INT = 2; // 2
public final static String ADMIN = "ADMIN"; // 后台管理员
public final static int ADMIN_INT = 4; // 4
public final static String INSTRUCTOR = "INSTRUCTOR"; // 教员
public final static int INSTRUCTOR_INT = 8; // 8
public final static String USER = "USER"; // 普通用户
public final static int USER_INT = 16; // 16
public final static String ANONYMOUS = "ANONYMOUS"; // 未登录用户
private final static int ANONYMOUS_INT = 0; // 0
private static final Map<Integer, String> PRIVILEGE;
static {
Map<Integer, String> map = new HashMap<Integer, String>();
map.put(DEVELOPER_INT, DEVELOPER);
map.put(SUPER_ADMIN_INT, SUPER_ADMIN);
map.put(ADMIN_INT, ADMIN);
map.put(INSTRUCTOR_INT, INSTRUCTOR);
map.put(USER_INT, USER);
map.put(ANONYMOUS_INT, ANONYMOUS);
PRIVILEGE = Collections.unmodifiableMap(map);
}
public static String getPrivilegeName(int authority) {
return PRIVILEGE.get(authority);
}
/**
* 通过权限的值来获取得到Spring security所需要的GrantedAuthority对象
* @param authority 用户对象中系统角色值
* @return
*/
public static List<GrantedAuthority> getPrivileges(int authority) {
List<GrantedAuthority> result = new ArrayList<>(MAX_ROLE_TYPE);
if (authority == ANONYMOUS_INT) { // 排除掉未认证的情况
result.add(new SimpleGrantedAuthority(ANONYMOUS));
} else {
int i = 0;
for (; i < MAX_ROLE_TYPE; i++) {
int type = 1 << i;
if ((type & authority) > 0 && PRIVILEGE.get(type) != null) {
result.add(new SimpleGrantedAuthority(PRIVILEGE.get(type)));
}
}
}
return result;
}
public static Integer getRevertPrivileges(Collection< ? extends GrantedAuthority> authorities) {
return authorities.stream().mapToInt(author -> {
if (author.getAuthority() == DEVELOPER) {
return DEVELOPER_INT;
} else if (author.getAuthority() == SUPER_ADMIN) {
return SUPER_ADMIN_INT;
} else if (author.getAuthority() == ADMIN) {
return ADMIN_INT;
}else if (author.getAuthority() == INSTRUCTOR) {
return INSTRUCTOR_INT;
}else if (author.getAuthority() == USER) {
return USER_INT;
}
return 0;
}).sum();
}
}
This file has been truncated, but you can view the full file.
package cn.com.sailfish.linghang.service;
import cn.com.sailfish.linghang.domain.Area;
import cn.com.sailfish.linghang.domain.User;
import cn.com.sailfish.linghang.exception.ServerErrorException;
import cn.com.sailfish.linghang.repository.AreaRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import static cn.com.sailfish.linghang.common.ErrorConstants.AREA_IS_ALREADY_EXISTS;
import static cn.com.sailfish.linghang.common.ErrorConstants.AREA_IS_NOT_EXISTS;
import static cn.com.sailfish.linghang.enumeration.Constants.COMMON_AREA_POSITION;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.FLIGHT_INT;
import static cn.com.sailfish.linghang.enumeration.UserInfoConstant.LOCOMOTIVE_INT;
import static cn.com.sailfish.linghang.security.SystemPrivilege.*;
/**
* Author: huangpeilin
* Create at: 2019-04-23 15:01:54
* Description:
*
* @author huangpeilin
*/
@Service
public class AreaService {
private final Logger log = LoggerFactory.getLogger(AreaService.class);
private AreaRepository areaRepository;
@Autowired
public AreaService(AreaRepository areaRepository){
this.areaRepository = areaRepository;
}
/**
* 根据部门名字和部门职位创建部门
* @param name
* @param position
* @return
*/
public Area create(String name, Integer position) throws ServerErrorException {
Area area = areaRepository.findOneByName(name);
if (area == null){
area = new Area();
area.setName(name);
area.setPosition(position);
area.setGmtCreated(Instant.now());
area.setGmtModified(Instant.now());
area = areaRepository.save(area);
}else{
if (!position.equals(area.getPosition())){
throw new ServerErrorException(AREA_IS_ALREADY_EXISTS);
}
}
return area;
}
/**
* 根据部门名字和部门职位创建部门
* @param name
* @param position
* @return
*/
public Area createByName(String name, Integer position) {
Area area = areaRepository.findOneByName(name);
if (area == null){
area = new Area();
area.setPosition(position);
area.setName(name);
area.setGmtCreated(Instant.now());
area.setGmtModified(Instant.now());
area = areaRepository.save(area);
}
return area;
}
/**
* 根据ID获取区域
* @param areaId
* @return
*/
public Area findOneById(Long areaId) throws ServerErrorException {
Area area = areaRepository.findOneById(areaId);
if (area == null){
throw new ServerErrorException(AREA_IS_NOT_EXISTS);
}
return area;
}
/**
* 根据ID和职位获取区域
* @param areaId
* @return
*/
public Area findOneByIdAndPosition(Long areaId, Integer position) throws ServerErrorException {
Area area = areaRepository.findOneByIdAndPosition(areaId, position);
if (area == null){
throw new ServerErrorException(AREA_IS_NOT_EXISTS);
}
return area;
}
/**
* 根据用户的权限获取区域
* @param user
* @return
*/
public List<Area> findAllArea(User user) {
List<Area> commonAreaList = new ArrayList<>();
List<Area> areaList = new ArrayList<>();
Integer authority = user.getAuthority();
switch (authority){
case DEVELOPER_INT:
areaList = areaRepository.findAll();
break;
case SUPER_ADMIN_INT:
case ADMIN_INT:
Area area = user.getArea();
if (area != null){
Integer position = area.getPosition();
areaList = areaRepository.findAllByPosition(position);
}
commonAreaList = areaRepository.findAllByPosition(COMMON_AREA_POSITION);
break;
case INSTRUCTOR_INT:
areaList.add(user.getArea());
break;
default:
commonAreaList = areaRepository.findAllByPosition(COMMON_AREA_POSITION);
if (user.getArea() != null){
areaList.add(user.getArea());
}
break;
}
areaList.addAll(commonAreaList);
return areaList;
}
/**
* 判断通过区域ID是否可以找到区域
* @param id
* @return
* @throws ServerErrorException
*/
public Area confirmAreaIsExist(Long id) throws ServerErrorException {
Area area = areaRepository.findOneById(id);
if (area == null){
log.error("area is not exist");
throw new ServerErrorException(AREA_IS_NOT_EXISTS);
}
return area;
}
/**
* 获取当前登录用户的职位的所有区域
* @param user
* @return
*/
public List<Area> findAllAreaByPosition(User user) {
List<Area> commonAreaList = new ArrayList<>();
List<Area> areaList = new ArrayList<>();
Integer authority = user.getAuthority();
switch (authority){
case DEVELOPER_INT:
areaList = areaRepository.findAll();
break;
case SUPER_ADMIN_INT:
case ADMIN_INT:
Area area = user.getArea();
if (area != null){
Integer position = area.getPosition();
areaList = areaRepository.findAllByPosition(position);
}
commonAreaList = areaRepository.findAllByPosition(COMMON_AREA_POSITION);
break;
default:
commonAreaList = areaRepository.findAllByPosition(COMMON_AREA_POSITION);
if (user.getArea() != null){
areaList = areaReposit
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment