Compare commits

...

No commits in common. "main" and "master" have entirely different histories.
main ... master

97 changed files with 24850 additions and 0 deletions

View File

8
demo/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/../../../../../../:\Users\Administrator\IdeaProjects\demo\.idea/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

40
demo/.idea/artifacts/demo_jar.xml generated Normal file
View File

@ -0,0 +1,40 @@
<component name="ArtifactManager">
<artifact type="jar" name="demo:jar">
<output-path>$PROJECT_DIR$/out/artifacts/demo_jar</output-path>
<root id="archive" name="demo.jar">
<element id="module-output" name="demo" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.11.2/jackson-annotations-2.11.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.11.2/jackson-module-parameter-names-2.11.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/spring-core/5.2.8.RELEASE/spring-core-5.2.8.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/spring-beans/5.2.8.RELEASE/spring-beans-5.2.8.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/spring-expression/5.2.8.RELEASE/spring-expression-5.2.8.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.13.3/log4j-to-slf4j-2.13.3.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.3.3.RELEASE/spring-boot-starter-json-2.3.3.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/spring-context/5.2.8.RELEASE/spring-context-5.2.8.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.3.3.RELEASE/spring-boot-starter-web-2.3.3.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.3.3.RELEASE/spring-boot-starter-logging-2.3.3.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.11.2/jackson-core-2.11.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/boot/spring-boot/2.3.3.RELEASE/spring-boot-2.3.3.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/spring-aop/5.2.8.RELEASE/spring-aop-5.2.8.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.3.3.RELEASE/spring-boot-autoconfigure-2.3.3.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.2/jackson-databind-2.11.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.37/tomcat-embed-core-9.0.37.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/yaml/snakeyaml/1.26/snakeyaml-1.26.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.37/tomcat-embed-websocket-9.0.37.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.3.3.RELEASE/spring-boot-starter-tomcat-2.3.3.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/spring-web/5.2.8.RELEASE/spring-web-5.2.8.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/spring-jcl/5.2.8.RELEASE/spring-jcl-5.2.8.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/boot/spring-boot-starter/2.3.3.RELEASE/spring-boot-starter-2.3.3.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/glassfish/jakarta.el/3.0.3/jakarta.el-3.0.3.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.11.2/jackson-datatype-jsr310-2.11.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.11.2/jackson-datatype-jdk8-2.11.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.m2/repository/org/springframework/spring-webmvc/5.2.8.RELEASE/spring-webmvc-5.2.8.RELEASE.jar" path-in-jar="/" />
</root>
</artifact>
</component>

18
demo/.idea/compiler.xml generated Normal file
View File

@ -0,0 +1,18 @@
<?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="demo" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="demo" options="-parameters" />
</option>
</component>
</project>

9
demo/.idea/encodings.xml generated Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" native2AsciiForPropertiesFiles="true" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources/application.yml" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

30
demo/.idea/jarRepositories.xml generated Normal file
View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="central" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.github.xiaoymin:swagger-bootstrap-ui:1.9.6">
<CLASSES>
<root url="jar://D:/Program Files/apache-maven-3.6.1/responity/com/github/xiaoymin/swagger-bootstrap-ui/1.9.6/swagger-bootstrap-ui-1.9.6.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/Program Files/apache-maven-3.6.1/responity/com/github/xiaoymin/swagger-bootstrap-ui/1.9.6/swagger-bootstrap-ui-1.9.6-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/Program Files/apache-maven-3.6.1/responity/com/github/xiaoymin/swagger-bootstrap-ui/1.9.6/swagger-bootstrap-ui-1.9.6-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.javassist:javassist:3.25.0-GA">
<CLASSES>
<root url="jar://D:/Program Files/apache-maven-3.6.1/responity/org/javassist/javassist/3.25.0-GA/javassist-3.25.0-GA.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/Program Files/apache-maven-3.6.1/responity/org/javassist/javassist/3.25.0-GA/javassist-3.25.0-GA-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/Program Files/apache-maven-3.6.1/responity/org/javassist/javassist/3.25.0-GA/javassist-3.25.0-GA-sources.jar!/" />
</SOURCES>
</library>
</component>

17
demo/.idea/misc.xml generated Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<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>

8
demo/.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/demo.iml" filepath="$PROJECT_DIR$/demo.iml" />
</modules>
</component>
</project>

124
demo/.idea/uiDesigner.xml generated Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

6
demo/.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

9
demo/HELP.md Normal file
View File

@ -0,0 +1,9 @@
# Getting Started
### Reference Documentation
For further reference, please consider the following sections:
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.3.3.RELEASE/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.3.3.RELEASE/maven-plugin/reference/html/#build-image)

17
demo/demo.iml Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<webroots />
<sourceRoots>
<root url="file://$MODULE_DIR$/src/main/java" />
<root url="file://$MODULE_DIR$/src/main/resources" />
</sourceRoots>
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
</module>

310
demo/mvnw vendored Normal file
View File

@ -0,0 +1,310 @@
#!/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.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven 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
# ----------------------------------------------------------------------------
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)`"
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
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
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 $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
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
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
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 "$@"

182
demo/mvnw.cmd vendored Normal file
View File

@ -0,0 +1,182 @@
@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 Maven 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 keystroke 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
@REM set title of command window
title %0
@REM enable echoing by 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.5.6/maven-wrapper-0.5.6.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% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%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%

175
demo/pom.xml Normal file
View File

@ -0,0 +1,175 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId> <!-- 父项目的 groupId -->
<artifactId>spring-boot-starter-parent</artifactId> <!-- 父项目的 artifactId -->
<version>2.3.3.RELEASE</version> <!-- 父项目的版本 -->
<relativePath/> <!-- 从仓库中查找父项目 -->
</parent>
<groupId>com.huake</groupId> <!-- 项目的 groupId -->
<artifactId>demo</artifactId> <!-- 项目的 artifactId -->
<version>1.0.0</version> <!-- 项目的版本 -->
<name>demo</name> <!-- 项目的名称 -->
<description>Demo project for Spring Boot</description> <!-- 项目的描述 -->
<properties>
<java.version>1.8</java.version> <!-- Java 版本 -->
<srping.version>2.3.3.RELEASE</srping.version> <!-- 注意:拼写错误,应为 spring.version -->
</properties>
<repositories>
<repository>
<id>central</id> <!-- 仓库 ID -->
<url>https://repo.maven.apache.org/maven2</url> <!-- Maven 中央仓库 URL -->
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId> <!-- Spring Boot 启动器 -->
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <!-- Spring Boot Web 启动器 -->
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <!-- Spring Boot 测试启动器 -->
<scope>test</scope> <!-- 测试范围 -->
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId> <!-- 排除 JUnit 复古引擎 -->
</exclusion>
</exclusions>
</dependency>
<!-- MyBatis 框架包 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.2</version> <!-- MyBatis Spring Boot 启动器版本 -->
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.2.0</version> <!-- MyBatis Plus 启动器版本 -->
</dependency>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.7</version> <!-- MyBatis 代码生成器核心版本 -->
</dependency>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.7</version> <!-- MyBatis 代码生成器 Maven 插件版本 -->
<exclusions>
<exclusion>
<artifactId>plexus-utils</artifactId>
<groupId>org.codehaus.plexus</groupId> <!-- 排除 Plexus 工具 -->
</exclusion>
</exclusions>
</dependency>
<!-- Swagger 文档生成 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version> <!-- Swagger 版本 -->
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version> <!-- Swagger UI 版本 -->
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.54</version> <!-- FastJSON 版本 -->
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20210307</version> <!-- 请检查最新版本 -->
</dependency>
<!-- 数据库连接 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.21</version> <!-- MySQL 连接器版本 -->
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.17</version> <!-- Druid 数据库连接池启动器版本 -->
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version> <!-- Log4j 日志框架版本 -->
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version> <!-- Selenium 版本 -->
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-jre</version> <!-- Guava 库版本 -->
</dependency>
<!-- Apache HttpClient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
<!-- 你可以使用最新版本 -->
</dependency>
<!-- Apache HttpCore (HttpClient 的核心库) -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.15</version> <!-- 你可以使用最新版本 -->
</dependency>
<dependency>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-core</artifactId>
<version>2.1.5</version> <!-- BrowserMob 版本 -->
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.68.Final</version> <!-- 使用最新版本 -->
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <!-- Spring Boot Maven 插件 -->
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,19 @@
package com.huake.demo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@EnableScheduling
@MapperScan("com.huake.demo.dao")
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}

View File

@ -0,0 +1,64 @@
package com.huake.demo.common;
import org.json.JSONException;
import org.json.JSONObject;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import java.io.IOException;
public class CaptchaHandler {
/**
* WebElement 获取 Base64 编码的图片数据
* @param driver WebDriver 实例
* @param element WebElement 图像元素
* @return Base64 编码的字符串
*/
public static String getBase64FromElement(WebDriver driver, WebElement element) {
JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
String script = "var canvas = document.createElement('canvas');" +
"var ctx = canvas.getContext('2d');" +
"canvas.width = arguments[0].naturalWidth;" +
"canvas.height = arguments[0].naturalHeight;" +
"ctx.drawImage(arguments[0], 0, 0);" +
"return canvas.toDataURL('image/png').split(',')[1];";
return (String) jsExecutor.executeScript(script, element);
}
/**
* 发送验证码图片请求并获取验证码文本
* @param base64Image Base64 编码的验证码图片
* @return 验证码文本
*/
public static String sendCaptchaRequest(String base64Image) {
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpPost post = new HttpPost("http://api.ttshitu.com/predict");
post.setHeader("Content-Type", "application/json");
String json = String.format("{\"username\": \"luffy230505\", \"password\": \"XIAOmi123\", \"typeid\": \"1003\", \"image\": \"%s\"}", base64Image);
post.setEntity(new StringEntity(json));
try (CloseableHttpResponse response = httpClient.execute(post)) {
String responseBody = EntityUtils.toString(response.getEntity());
JSONObject jsonObject = new JSONObject(responseBody);
if (jsonObject.getBoolean("success")) {
return jsonObject.getJSONObject("data").getString("result");
} else {
System.err.println("请求失败: " + jsonObject.getString("message"));
return "";
}
}
} catch (IOException | JSONException e) {
e.printStackTrace();
return "";
}
}
}

View File

@ -0,0 +1,70 @@
package com.huake.demo.common;
/**
* HTTP结果封装
* @author Louis
* @date Jun 29, 2019
*/
public class HttpResult {
private int code = 200;
private String msg;
private Object data;
public static HttpResult error() {
return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员");
}
public static HttpResult error(String msg) {
return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg);
}
public static HttpResult error(int code, String msg) {
HttpResult r = new HttpResult();
r.setCode(code);
r.setMsg(msg);
return r;
}
public static HttpResult ok(String msg) {
HttpResult r = new HttpResult();
r.setMsg(msg);
return r;
}
public static HttpResult ok(Object data) {
HttpResult r = new HttpResult();
r.setData(data);
return r;
}
public static HttpResult ok() {
return new HttpResult();
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}

View File

@ -0,0 +1,148 @@
package com.huake.demo.common;
/**
* Constants enumerating the HTTP status codes.
* All status codes defined in RFC1945 (HTTP/1.0), RFC2616 (HTTP/1.1), and
* RFC2518 (WebDAV) are listed.
*
*
* @since 4.0
*/
public interface HttpStatus {
// --- 1xx Informational ---
/** {@code 100 Continue} (HTTP/1.1 - RFC 2616) */
public static final int SC_CONTINUE = 100;
/** {@code 101 Switching Protocols} (HTTP/1.1 - RFC 2616)*/
public static final int SC_SWITCHING_PROTOCOLS = 101;
/** {@code 102 Processing} (WebDAV - RFC 2518) */
public static final int SC_PROCESSING = 102;
// --- 2xx Success ---
/** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
public static final int SC_OK = 200;
/** {@code 201 Created} (HTTP/1.0 - RFC 1945) */
public static final int SC_CREATED = 201;
/** {@code 202 Accepted} (HTTP/1.0 - RFC 1945) */
public static final int SC_ACCEPTED = 202;
/** {@code 203 Non Authoritative Information} (HTTP/1.1 - RFC 2616) */
public static final int SC_NON_AUTHORITATIVE_INFORMATION = 203;
/** {@code 204 No Content} (HTTP/1.0 - RFC 1945) */
public static final int SC_NO_CONTENT = 204;
/** {@code 205 Reset Content} (HTTP/1.1 - RFC 2616) */
public static final int SC_RESET_CONTENT = 205;
/** {@code 206 Partial Content} (HTTP/1.1 - RFC 2616) */
public static final int SC_PARTIAL_CONTENT = 206;
/**
* {@code 207 Multi-Status} (WebDAV - RFC 2518)
* or
* {@code 207 Partial Update OK} (HTTP/1.1 - draft-ietf-http-v11-spec-rev-01?)
*/
public static final int SC_MULTI_STATUS = 207;
// --- 3xx Redirection ---
/** {@code 300 Mutliple Choices} (HTTP/1.1 - RFC 2616) */
public static final int SC_MULTIPLE_CHOICES = 300;
/** {@code 301 Moved Permanently} (HTTP/1.0 - RFC 1945) */
public static final int SC_MOVED_PERMANENTLY = 301;
/** {@code 302 Moved Temporarily} (Sometimes {@code Found}) (HTTP/1.0 - RFC 1945) */
public static final int SC_MOVED_TEMPORARILY = 302;
/** {@code 303 See Other} (HTTP/1.1 - RFC 2616) */
public static final int SC_SEE_OTHER = 303;
/** {@code 304 Not Modified} (HTTP/1.0 - RFC 1945) */
public static final int SC_NOT_MODIFIED = 304;
/** {@code 305 Use Proxy} (HTTP/1.1 - RFC 2616) */
public static final int SC_USE_PROXY = 305;
/** {@code 307 Temporary Redirect} (HTTP/1.1 - RFC 2616) */
public static final int SC_TEMPORARY_REDIRECT = 307;
// --- 4xx Client Error ---
/** {@code 400 Bad Request} (HTTP/1.1 - RFC 2616) */
public static final int SC_BAD_REQUEST = 400;
/** {@code 401 Unauthorized} (HTTP/1.0 - RFC 1945) */
public static final int SC_UNAUTHORIZED = 401;
/** {@code 402 Payment Required} (HTTP/1.1 - RFC 2616) */
public static final int SC_PAYMENT_REQUIRED = 402;
/** {@code 403 Forbidden} (HTTP/1.0 - RFC 1945) */
public static final int SC_FORBIDDEN = 403;
/** {@code 404 Not Found} (HTTP/1.0 - RFC 1945) */
public static final int SC_NOT_FOUND = 404;
/** {@code 405 Method Not Allowed} (HTTP/1.1 - RFC 2616) */
public static final int SC_METHOD_NOT_ALLOWED = 405;
/** {@code 406 Not Acceptable} (HTTP/1.1 - RFC 2616) */
public static final int SC_NOT_ACCEPTABLE = 406;
/** {@code 407 Proxy Authentication Required} (HTTP/1.1 - RFC 2616)*/
public static final int SC_PROXY_AUTHENTICATION_REQUIRED = 407;
/** {@code 408 Request Timeout} (HTTP/1.1 - RFC 2616) */
public static final int SC_REQUEST_TIMEOUT = 408;
/** {@code 409 Conflict} (HTTP/1.1 - RFC 2616) */
public static final int SC_CONFLICT = 409;
/** {@code 410 Gone} (HTTP/1.1 - RFC 2616) */
public static final int SC_GONE = 410;
/** {@code 411 Length Required} (HTTP/1.1 - RFC 2616) */
public static final int SC_LENGTH_REQUIRED = 411;
/** {@code 412 Precondition Failed} (HTTP/1.1 - RFC 2616) */
public static final int SC_PRECONDITION_FAILED = 412;
/** {@code 413 Request Entity Too Large} (HTTP/1.1 - RFC 2616) */
public static final int SC_REQUEST_TOO_LONG = 413;
/** {@code 414 Request-URI Too Long} (HTTP/1.1 - RFC 2616) */
public static final int SC_REQUEST_URI_TOO_LONG = 414;
/** {@code 415 Unsupported Media Type} (HTTP/1.1 - RFC 2616) */
public static final int SC_UNSUPPORTED_MEDIA_TYPE = 415;
/** {@code 416 Requested Range Not Satisfiable} (HTTP/1.1 - RFC 2616) */
public static final int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
/** {@code 417 Expectation Failed} (HTTP/1.1 - RFC 2616) */
public static final int SC_EXPECTATION_FAILED = 417;
/**
* Static constant for a 418 error.
* {@code 418 Unprocessable Entity} (WebDAV drafts?)
* or {@code 418 Reauthentication Required} (HTTP/1.1 drafts?)
*/
// not used
// public static final int SC_UNPROCESSABLE_ENTITY = 418;
/**
* Static constant for a 419 error.
* {@code 419 Insufficient Space on Resource}
* (WebDAV - draft-ietf-webdav-protocol-05?)
* or {@code 419 Proxy Reauthentication Required}
* (HTTP/1.1 drafts?)
*/
public static final int SC_INSUFFICIENT_SPACE_ON_RESOURCE = 419;
/**
* Static constant for a 420 error.
* {@code 420 Method Failure}
* (WebDAV - draft-ietf-webdav-protocol-05?)
*/
public static final int SC_METHOD_FAILURE = 420;
/** {@code 422 Unprocessable Entity} (WebDAV - RFC 2518) */
public static final int SC_UNPROCESSABLE_ENTITY = 422;
/** {@code 423 Locked} (WebDAV - RFC 2518) */
public static final int SC_LOCKED = 423;
/** {@code 424 Failed Dependency} (WebDAV - RFC 2518) */
public static final int SC_FAILED_DEPENDENCY = 424;
// --- 5xx Server Error ---
/** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
public static final int SC_INTERNAL_SERVER_ERROR = 500;
/** {@code 501 Not Implemented} (HTTP/1.0 - RFC 1945) */
public static final int SC_NOT_IMPLEMENTED = 501;
/** {@code 502 Bad Gateway} (HTTP/1.0 - RFC 1945) */
public static final int SC_BAD_GATEWAY = 502;
/** {@code 503 Service Unavailable} (HTTP/1.0 - RFC 1945) */
public static final int SC_SERVICE_UNAVAILABLE = 503;
/** {@code 504 Gateway Timeout} (HTTP/1.1 - RFC 2616) */
public static final int SC_GATEWAY_TIMEOUT = 504;
/** {@code 505 HTTP Version Not Supported} (HTTP/1.1 - RFC 2616) */
public static final int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
/** {@code 507 Insufficient Storage} (WebDAV - RFC 2518) */
public static final int SC_INSUFFICIENT_STORAGE = 507;
}

View File

@ -0,0 +1,189 @@
package com.huake.demo.common;
import com.huake.demo.dao.HeadMapper;
import com.huake.demo.entity.Dlx;
import com.huake.demo.entity.Dlxurl;
import com.huake.demo.entity.Head;
import com.huake.demo.entity.Heads;
import com.huake.demo.service.headService;
import com.huake.demo.service.headsService;
import io.netty.handler.codec.http.HttpHeaders;
import net.lightbody.bmp.BrowserMobProxy;
import net.lightbody.bmp.BrowserMobProxyServer;
import net.lightbody.bmp.client.ClientUtil;
import org.apache.log4j.Logger;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.net.ssl.*;
import java.security.cert.X509Certificate;
@Component
public class MultiSiteLoginAutomation {
private static final String CHROME_DRIVER_PATH = "D:\\sc\\chromedriver-win64\\chromedriver.exe"; // Chrome驱动路径
private static final int WAIT_TIMEOUT = 10; // 等待超时设置
private static final Logger logger = Logger.getLogger(MultiSiteLoginAutomation.class);
@Autowired
private headService headservice; // 注入服务
@Autowired
private headsService headsservice; // 注入服务
public void runAutomation(Dlxurl dlxurl, Dlx dlx) throws InterruptedException {
disableSSLVerification(); // 忽略SSL证书验证
String[] urls = {dlxurl.getKyurl(), dlxurl.getHthurl(), dlxurl.getJyurl()}; // 要登录的URL
String[] emails = {dlx.getKy(), dlx.getHth(), dlx.getJy()}; // 用户名
String[] passwords = {"tg666888", "tg666888", "tg666888"}; // 密码
for (int i = 0; i < 3; i++) { // 对每个网站进行登录
BrowserMobProxy proxy = new BrowserMobProxyServer(); // 创建代理服务器
proxy.start(0); // 启动代理
Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxy); // 创建Selenium代理
ChromeOptions options = new ChromeOptions(); // Chrome选项
options.addArguments("--ignore-certificate-errors"); // 忽略证书错误
options.setProxy(seleniumProxy); // 设置代理
loginWithRetries(options, urls[i], emails[i], passwords[i], proxy,dlx.getUserId());
proxy.stop(); // 停止代理
}
}
private void loginWithRetries(ChromeOptions options, String url, String email, String password, BrowserMobProxy proxy,Integer userid) throws InterruptedException {
WebDriver driver = initializeWebDriver(options); // 初始化WebDriver
boolean loggedIn = false; // 登录状态
proxy.newHar("login"); // 创建新的HAR文件
// 添加请求过滤器
proxy.addRequestFilter((request, contents, messageInfo) -> {
String interceptedUrl = messageInfo.getUrl(); // 拦截到的请求URL
if (interceptedUrl.contains("/agent/api/v1/front/getAgentDataVisualList")) {
// 处理特定请求
HttpHeaders headers = request.headers(); // 获取请求头
update(email,headers,userid);
logger.info("--------------------------------------开始--------------------------------------");
logger.info("拦截到请求: " + interceptedUrl);
logger.info("X-Api-Token: " + headers.get("X-Api-Token"));
logger.info("X-Api-Uuid: " + headers.get("X-Api-Uuid"));
logger.info("X-Api-Xxx: " + headers.get("X-Api-Xxx"));
logger.info("--------------------------------------结束--------------------------------------");
} else if (interceptedUrl.contains("/agent/api/v1/front/banner")) {
// 处理其他逻辑
HttpHeaders headers = request.headers();
updates(email,headers,userid);
// 获取请求头
logger.info("--------------------------------------开始2--------------------------------------");
logger.info("拦截到请求2: " + interceptedUrl);
logger.info("X-Api-Token: " + headers.get("X-Api-Token"));
logger.info("X-Api-Uuid: " + headers.get("X-Api-Uuid"));
logger.info("X-Api-Xxx: " + headers.get("X-Api-Xxx"));
logger.info("--------------------------------------结束--------------------------------------");
}
return null; // 继续请求
});
while (!loggedIn) { // 循环直到成功登录
try {
loggedIn = loginToSite(driver, url, email, password); // 尝试登录
} catch (Exception e) {
e.printStackTrace(); // 打印异常
} finally {
if (!loggedIn) { // 如果登录失败重启WebDriver
driver.quit();
driver = initializeWebDriver(options);
}
}
}
Thread.sleep(3000);
driver.quit(); // 退出WebDriver
}
//banner接口数据
private void updates(String email, HttpHeaders headers, Integer userId) {
try {
Heads heads = new Heads(headers.get("X-Api-Token"), headers.get("X-Api-Uuid"), headers.get("X-Api-Xxx"), userId, email);
headsservice.updateUser(heads);
}catch (Exception e){
e.printStackTrace();
}
}
private void update(String email, HttpHeaders headers, Integer userId) {
try {
Head head = new Head(headers.get("X-Api-Token"), headers.get("X-Api-Uuid"), headers.get("X-Api-Xxx"), userId, email);
headservice.updateUser(head);
}catch (Exception e){
e.printStackTrace();
}
}
private WebDriver initializeWebDriver(ChromeOptions options) {
System.setProperty("webdriver.chrome.driver", CHROME_DRIVER_PATH); // 设置Chrome驱动路径
return new ChromeDriver(options); // 返回新实例
}
private boolean loginToSite(WebDriver driver, String url, String email, String password) throws InterruptedException {
WebDriverWait wait = new WebDriverWait(driver, WAIT_TIMEOUT); // 初始化等待
driver.get(url); // 访问登录页面
// 使用显式等待获取验证码图片
WebElement captchaImage = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("boxModle"))); // 等待并获取验证码图片
String base64Captcha = CaptchaHandler.getBase64FromElement(driver, captchaImage); // 获取验证码
String captchaCode = CaptchaHandler.sendCaptchaRequest(base64Captcha); // 发送验证码请求
// 填写用户名密码和验证码
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input.ant-input[placeholder='用户名']"))).sendKeys(email);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input[type='password']"))).sendKeys(password);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input.ant-input[placeholder='请输入验证码']"))).sendKeys(captchaCode);
// 点击登录按钮
WebElement finalLoginButton = wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("button.ant-btn.ant-btn-primary")));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", finalLoginButton);
((JavascriptExecutor) driver).executeScript("arguments[0].click();", finalLoginButton);
Thread.sleep(1500); // 等待页面加载
try {
wait.until(ExpectedConditions.urlContains("/app/home?showWelcome=false")); // 检查是否登录成功
return true; // 登录成功
} catch (Exception e) {
logger.info("登录失败,重新尝试...");
return false; // 登录失败
}
}
private void disableSSLVerification() { // 禁用SSL验证
try {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
public void checkClientTrusted(X509Certificate[] certs, String authType) {}
public void checkServerTrusted(X509Certificate[] certs, String authType) {}
}
};
SSLContext sc = SSLContext.getInstance("TLS");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
HttpsURLConnection.setDefaultHostnameVerifier((hostname, session) -> true); // 允许所有主机
} catch (Exception e) {
e.printStackTrace(); // 打印异常
}
}
}

View File

@ -0,0 +1,117 @@
package com.huake.demo.common;
import com.huake.demo.entity.Dlx;
import com.huake.demo.entity.Dlxurl;
import com.huake.demo.service.UserService;
import com.huake.demo.service.dlxService;
import com.huake.demo.service.dlxurlService;
import org.apache.log4j.Logger;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
@Component
public class login {
@Autowired
private UserService userService;
@Autowired
private com.huake.demo.service.dlxService dlxService;
@Autowired
private MultiSiteLoginAutomation ysqd;
@Autowired
private com.huake.demo.service.dlxurlService dlxurlService;
private static final Logger logger = Logger.getLogger(login.class);
@PostConstruct
public void init() throws InterruptedException {
getUrl();
jb();
}
@Scheduled(cron = "0 20 2,10,11,14,17,21 * * ?")
@Scheduled(cron = "0 50 23 * * ?")
public void jb() throws InterruptedException {
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String formattedDateTime = now.format(formatter);
logger.info("原神启动!");
logger.info("当前时间:"+formattedDateTime);
List<Dlx> dlxes = dlxService.selectAll();
Dlxurl dlxurl = dlxurlService.selectAll();
for (Dlx dlx : dlxes) {
ysqd.runAutomation(dlxurl,dlx);
}
logger.info("脚本执行成功");
}
@Scheduled(cron = "0 0/30 * * * ?")
private void getUrl(){
try {
JSONObject result = fetchJsonData("http://qsbdt.com/geturl.json");
// 单独获取每一条数据
String kyUrl = result.getString("kyurl");
String hthUrl = result.getString("hthurl");
String jyUrl = result.getString("jyurl");
logger.info("最新链接为:"+result.toString(2));
Dlxurl dlxurl = new Dlxurl();
dlxurl.setKyurl(kyUrl);
dlxurl.setHthurl(hthUrl);
dlxurl.setJyurl(jyUrl);
int i = dlxurlService.updateUrl(dlxurl);
logger.info("最新链接为:"+result.toString(2));
} catch (Exception e) {
e.printStackTrace();
}
}
public static JSONObject fetchJsonData(String urlString) {
try {
URL url = new URL(urlString);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setConnectTimeout(5000);
conn.setReadTimeout(5000);
// 检查响应代码
if (conn.getResponseCode() != 200) {
throw new RuntimeException("Failed: HTTP error code: " + conn.getResponseCode());
}
// 读取响应
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
StringBuilder response = new StringBuilder();
String inputLine;
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
// 返回JSONObject
return new JSONObject(response.toString());
} catch (Exception e) {
e.printStackTrace();
return null; // 出现异常时返回null
}
}
}

View File

@ -0,0 +1,93 @@
package com.huake.demo.config;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.support.http.StatViewServlet;
import com.alibaba.druid.support.http.WebStatFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.Filter;
import javax.servlet.Servlet;
import javax.sql.DataSource;
import java.sql.SQLException;
@Configuration
@EnableConfigurationProperties({DruidDataSourceProperties.class})
public class DruidConfig {
@Autowired
private DruidDataSourceProperties properties;
@Bean
@ConditionalOnMissingBean
public DataSource druidDataSource() {
DruidDataSource druidDataSource = new DruidDataSource();
druidDataSource.setDriverClassName(properties.getDriverClassName());
druidDataSource.setUrl(properties.getUrl());
druidDataSource.setUsername(properties.getUsername());
druidDataSource.setPassword(properties.getPassword());
druidDataSource.setInitialSize(properties.getInitialSize());
druidDataSource.setMinIdle(properties.getMinIdle());
druidDataSource.setMaxActive(properties.getMaxActive());
druidDataSource.setMaxWait(properties.getMaxWait());
druidDataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis());
druidDataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis());
druidDataSource.setValidationQuery(properties.getValidationQuery());
druidDataSource.setTestWhileIdle(properties.isTestWhileIdle());
druidDataSource.setTestOnBorrow(properties.isTestOnBorrow());
druidDataSource.setTestOnReturn(properties.isTestOnReturn());
druidDataSource.setPoolPreparedStatements(properties.isPoolPreparedStatements());
druidDataSource.setMaxPoolPreparedStatementPerConnectionSize(properties.getMaxPoolPreparedStatementPerConnectionSize());
try {
druidDataSource.setFilters(properties.getFilters());
druidDataSource.init();
} catch (SQLException e) {
e.printStackTrace();
}
return druidDataSource;
}
/**
* 注册Servlet信息 配置监控视图
*
* @return
*/
@Bean
@ConditionalOnMissingBean
public ServletRegistrationBean<Servlet> druidServlet() {
ServletRegistrationBean<Servlet> servletRegistrationBean = new ServletRegistrationBean<Servlet>(new StatViewServlet(), "/druid/*");
//白名单
servletRegistrationBean.addInitParameter("allow","127.0.0.1");
//IP黑名单 (存在共同时deny优先于allow) : 如果满足deny的话提示:Sorry, you are not permitted to view this page.
servletRegistrationBean.addInitParameter("deny","192.168.1.119");
//登录查看信息的账号密码, 用于登录Druid监控后台
servletRegistrationBean.addInitParameter("loginUsername", "admin");
servletRegistrationBean.addInitParameter("loginPassword", "admin");
//是否能够重置数据.
servletRegistrationBean.addInitParameter("resetEnable", "true");
return servletRegistrationBean;
}
/**
* 注册Filter信息, 监控拦截器
*
* @return
*/
@Bean
@ConditionalOnMissingBean
public FilterRegistrationBean<Filter> filterRegistrationBean() {
FilterRegistrationBean<Filter> filterRegistrationBean = new FilterRegistrationBean<Filter>();
filterRegistrationBean.setFilter(new WebStatFilter());
filterRegistrationBean.addUrlPatterns("/*");
filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
return filterRegistrationBean;
}
}

View File

@ -0,0 +1,164 @@
package com.huake.demo.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "spring.datasource.druid")
public class DruidDataSourceProperties {
// jdbc
private String driverClassName;
private String url;
private String username;
private String password;
// jdbc connection pool
private int initialSize;
private int minIdle;
private int maxActive = 100;
private long maxWait;
private long timeBetweenEvictionRunsMillis;
private long minEvictableIdleTimeMillis;
private String validationQuery;
private boolean testWhileIdle;
private boolean testOnBorrow;
private boolean testOnReturn;
private boolean poolPreparedStatements;
private int maxPoolPreparedStatementPerConnectionSize;
// filter
private String filters;
public int getInitialSize() {
return initialSize;
}
public void setInitialSize(int initialSize) {
this.initialSize = initialSize;
}
public int getMinIdle() {
return minIdle;
}
public void setMinIdle(int minIdle) {
this.minIdle = minIdle;
}
public int getMaxActive() {
return maxActive;
}
public void setMaxActive(int maxActive) {
this.maxActive = maxActive;
}
public long getMaxWait() {
return maxWait;
}
public void setMaxWait(long maxWait) {
this.maxWait = maxWait;
}
public long getTimeBetweenEvictionRunsMillis() {
return timeBetweenEvictionRunsMillis;
}
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) {
this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
}
public long getMinEvictableIdleTimeMillis() {
return minEvictableIdleTimeMillis;
}
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
}
public String getValidationQuery() {
return validationQuery;
}
public void setValidationQuery(String validationQuery) {
this.validationQuery = validationQuery;
}
public boolean isTestWhileIdle() {
return testWhileIdle;
}
public void setTestWhileIdle(boolean testWhileIdle) {
this.testWhileIdle = testWhileIdle;
}
public boolean isTestOnBorrow() {
return testOnBorrow;
}
public void setTestOnBorrow(boolean testOnBorrow) {
this.testOnBorrow = testOnBorrow;
}
public boolean isTestOnReturn() {
return testOnReturn;
}
public void setTestOnReturn(boolean testOnReturn) {
this.testOnReturn = testOnReturn;
}
public boolean isPoolPreparedStatements() {
return poolPreparedStatements;
}
public void setPoolPreparedStatements(boolean poolPreparedStatements) {
this.poolPreparedStatements = poolPreparedStatements;
}
public int getMaxPoolPreparedStatementPerConnectionSize() {
return maxPoolPreparedStatementPerConnectionSize;
}
public void setMaxPoolPreparedStatementPerConnectionSize(int maxPoolPreparedStatementPerConnectionSize) {
this.maxPoolPreparedStatementPerConnectionSize = maxPoolPreparedStatementPerConnectionSize;
}
public String getFilters() {
return filters;
}
public void setFilters(String filters) {
this.filters = filters;
}
public String getDriverClassName() {
return driverClassName;
}
public void setDriverClassName(String driverClassName) {
this.driverClassName = driverClassName;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}

View File

@ -0,0 +1,26 @@
package com.huake.demo.config;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.HashMap;
/**
* 存储token
*/
@Component
public class FactoryConfig {
//存储华创的token
public static HashMap<String,String> tokenMap = new HashMap(2);
//获取华创接口token
public static String getToken(){
return tokenMap.get("token");
}
public static void setToken(String token){
tokenMap.put("token",token);
System.out.println("华创更新token:"+token);
}
}

View File

@ -0,0 +1,29 @@
package com.huake.demo.config;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import javax.sql.DataSource;
@Configuration
@MapperScan("com.huake.demo.**.dao") // 扫描DAO
public class MybatisConfig {
@Autowired
private DataSource dataSource;
@Bean
public SqlSessionFactory sqlSessionFactory() throws Exception {
SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
sessionFactory.setDataSource(dataSource);
sessionFactory.setTypeAliasesPackage("com.huake.demo.**.entity"); // 扫描Model
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
sessionFactory.setMapperLocations(resolver.getResources("classpath*:mapper/one/*.xml")); // 扫描映射文件
return sessionFactory.getObject();
}
}

View File

@ -0,0 +1,38 @@
package com.huake.demo.config;
/**
* 创建RestTemplate对象用来访问接口
* @author long.yu
* @date 2020-3-25
*/
//import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
@Configuration
public class RestTemplateConfig {
@Bean
// @LoadBalanced
public RestTemplate createTemplate(){
RestTemplate restTemplate = new RestTemplate();
//restTemplate错误接受处理
restTemplate.setErrorHandler(new DefaultResponseErrorHandler(){
@Override
public boolean hasError(ClientHttpResponse response) throws IOException{
if(response.getStatusCode() != HttpStatus.UNAUTHORIZED){
super.hasError(response);
return false;
}
return true;
};
});
return restTemplate;
}
}

View File

@ -0,0 +1,35 @@
package com.huake.demo.config;
import com.google.common.base.Predicates;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket createRestApi(){
return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.any())
.paths(Predicates.not(PathSelectors.regex("/error.*")))//错误路径不监控
.paths(PathSelectors.any()).build();
}
private ApiInfo apiInfo(){
return new ApiInfoBuilder()
.title("机器人后台接口")
.description("This is a restful api document of Spring Boot.")
.version("1.0")
.build();
}
}

View File

@ -0,0 +1,23 @@
package com.huake.demo.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
//配置跨域
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") // 允许跨域访问的路径
.allowedOrigins("*") // 允许跨域访问的源
.allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE") // 允许请求方法
.maxAge(168000) // 预检间隔时间
.allowedHeaders("*") // 允许头部设置
.allowCredentials(true); // 是否发送cookie
}
}

View File

@ -0,0 +1,232 @@
package com.huake.demo.controller;
import com.huake.demo.common.HttpResult;
import com.huake.demo.common.MultiSiteLoginAutomation;
import com.huake.demo.common.login;
import com.huake.demo.entity.*;
import com.huake.demo.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.log4j.Logger;
import org.json.JSONObject;
import org.openqa.selenium.json.Json;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
/**
* 仅用于测试框架
*/
@Api(tags = "用户管理")
@RestController
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
@Autowired
private dlxService dlxService;
@Autowired
private MultiSiteLoginAutomation ysqd;
@Autowired
private dlxurlService dlxurlService;
@Autowired
private headService headService;
@Autowired
private headsService headsService;
private static final Logger logger = Logger.getLogger(UserController.class);
@ApiOperation(value = "数据查询 ", notes = "数据查询")
@ApiImplicitParam(name = "userid", value = "用户ID", required = true, dataType = "String", paramType = "query",example = "1")
@GetMapping("/select")
public String select(Integer userid) throws Exception {
JSONObject Param =new JSONObject();
List<Head> getAgentDataVisualList = headService.getUserById(userid);
for (Head head : getAgentDataVisualList) {
LinkedHashMap<String, Object> jsonObject =new LinkedHashMap<>();
jsonObject.put("id",head.getName());
jsonObject.put("url",url(Stringsplit(head.getName())));
jsonObject.put("X-Api-Token",head.getToken());
jsonObject.put("X-Api-Uuid",head.getUuid());
jsonObject.put("X-Api-Xxx-getAgentDataVisualList",head.getXxx());
jsonObject.put("X-Api-Xxx-banner",banner(head.getName()));
Param.put(Stringsplit(head.getName()),jsonObject);
}
logger.info(Param.toString(2));
return Param.toString(2);
}
private String banner(String head){
return headsService.getName(head).getXxx();
}
private String Stringsplit (String input){
String target = "tg";
int targetIndex = input.indexOf(target);
String result = (targetIndex != -1) ? input.substring(0, targetIndex) : input;
Map<String, String> dayMap = new HashMap<>();
dayMap.put("ky3", "ky");
dayMap.put("h", "hth");
dayMap.put("jy3", "jy");
return dayMap.getOrDefault(result,"搞错了搞错了!!!");
}
private String url (String dl){
Dlxurl dlxurl = dlxurlService.selectAll();
Map<String, String> dayMap = new HashMap<>();
dayMap.put("ky",dlxurl.getKyurl());
dayMap.put("hth",dlxurl.getHthurl());
dayMap.put("jy",dlxurl.getJyurl());
return dayMap.getOrDefault(dl,"搞错了搞错了!!!");
}
// @GetMapping("/geturl")
// public void geturl(){
// try {
// JSONObject result = fetchJsonData("http://qsbdt.com/geturl.json");
//
// // 单独获取每一条数据
// String kyUrl = result.getString("kyurl");
// String hthUrl = result.getString("hthurl");
// String jyUrl = result.getString("jyurl");
//
// // 打印每一条数据
// logger.info("KY URL: " + kyUrl);
// logger.info("HTH URL: " + hthUrl);
// logger.info("JY URL: " + jyUrl);
//
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
//
// public static JSONObject fetchJsonData(String urlString) {
// try {
// URL url = new URL(urlString);
// HttpURLConnection conn = (HttpURLConnection) url.openConnection();
// conn.setRequestMethod("GET");
// conn.setConnectTimeout(5000);
// conn.setReadTimeout(5000);
//
// // 检查响应代码
// if (conn.getResponseCode() != 200) {
// throw new RuntimeException("Failed: HTTP error code: " + conn.getResponseCode());
// }
//
// // 读取响应
// BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// StringBuilder response = new StringBuilder();
// String inputLine;
//
// while ((inputLine = in.readLine()) != null) {
// response.append(inputLine);
// }
// in.close();
//
// // 返回JSONObject
// return new JSONObject(response.toString());
//
// } catch (Exception e) {
// e.printStackTrace();
// return null; // 出现异常时返回null
// }
// }
// @ApiOperation(value = "新增用户 ", notes = "新增用户")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "name", value = "用户名字", required = true, dataType = "String", paramType = "query",example = "1"),
// @ApiImplicitParam(name = "userid", value = "机器人id", required = true, dataType = "String", paramType = "query",example = "1"),
// @ApiImplicitParam(name = "chatid", value = "群聊id", required = true, dataType = "String", paramType = "query",example = "1"),
// @ApiImplicitParam(name = "ky", value = "开云", required = true, dataType = "String", paramType = "query",example = "1"),
// @ApiImplicitParam(name = "hth", value = "华体会", required = true, dataType = "String", paramType = "query",example = "1"),
// @ApiImplicitParam(name = "jy", value = "九游", required = true, dataType = "String", paramType = "query",example = "1"),
// @ApiImplicitParam(name = "pswd", value = "密码", required = true, dataType = "String", paramType = "query",example = "1"),
// }
// )
// @GetMapping("/insert")
// public HttpResult insert(String name,String userid ,String chatid,String ky,String hth,String jy,String pswd) throws Exception {
// User user = new User();
// int i = random.nextInt(100);
// user.setId(i);
// user.setName(name);
// user.setUserid(userid);
// user.setChatid(chatid);
// String insert = userService.insert(user);
// dlxinsert(i,ky,hth,jy,pswd);
// return HttpResult.ok(insert);
// }
//
// @ApiOperation(value = "未完善", notes = "未完善")
// @GetMapping("/selectByPrimaryKey")
// public HttpResult selectByPrimaryKey(Integer id) throws Exception {
// User user = userService.selectByPrimaryKey(id);
//
// return HttpResult.ok(user);
// }
//
// @ApiOperation(value = "未完善", notes = "未完善")
// @GetMapping("/selectAll")
// public HttpResult selectAll() throws Exception {
// List<User> users = userService.selectAll();
// return HttpResult.ok(users);
// }
//
// @ApiOperation(value = "未完善", notes = "未完善")
// @GetMapping("/updateByPrimaryKey")
// public HttpResult updateByPrimaryKey(Integer id,String name,String userid ,String chatid) throws Exception {
// User user = new User();
// user.setId(id);
// user.setName(name);
// user.setUserid(userid);
// user.setChatid(chatid);
// String insert = userService.updateByPrimaryKey(user);
// return HttpResult.ok(insert);
// }
//
// private String dlxinsert(Integer userid,String ky,String hth,String jy,String pswd){
// Dlx dlx = new Dlx();
// dlx.setUserId(userid);
// dlx.setKy(ky);
// dlx.setHth(hth);
// dlx.setJy(jy);
// dlx.setPassword(pswd);
// String insert = dlxService.insert(dlx);
// return insert;
// }
//
// @GetMapping("/ysqd")
// public HttpResult jb() throws InterruptedException {
// List<Dlx> dlxes = dlxService.selectAll();
// Dlxurl dlxurl = dlxurlService.selectAll();
// for (Dlx dlx : dlxes) {
// ysqd.runAutomation(dlxurl,dlx);
// }
// return HttpResult.ok("脚本执行成功");
// }
}

View File

@ -0,0 +1,15 @@
package com.huake.demo.dao;
import com.huake.demo.entity.Dlx;
import java.util.List;
public interface DlxMapper {
int insert(Dlx record);
List<Dlx> selectAll();
Dlx selectByPrimaryKey(Integer id);
int deleteByPrimaryKey(Integer id);
}

View File

@ -0,0 +1,14 @@
package com.huake.demo.dao;
import com.huake.demo.entity.Dlxurl;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DlxurlMapper {
int insert(Dlxurl record);
Dlxurl selectAll();
int updateUrl(Dlxurl dlxurl);
}

View File

@ -0,0 +1,19 @@
package com.huake.demo.dao;
import com.huake.demo.entity.Head;
import java.util.List;
public interface HeadMapper {
int insert(Head record);
List<Head> selectAll();
List<Head> getUserById(Integer userId);
void updateUser(Head head);
}

View File

@ -0,0 +1,20 @@
package com.huake.demo.dao;
import com.huake.demo.entity.Head;
import com.huake.demo.entity.Heads;
import java.util.List;
public interface HeadsMapper {
int insert(Heads record);
List<Heads> selectAll();
List<Heads> getUserById(Integer userId);
void updateUser(Heads head);
Heads getName(String name);
}

View File

@ -0,0 +1,7 @@
package com.huake.demo.dao;
import com.huake.demo.entity.User;
public interface IUserDao {
User selectUser(long id);
}

View File

@ -0,0 +1,16 @@
package com.huake.demo.dao;
import com.huake.demo.entity.User;
import java.util.List;
public interface UserMapper {
int deleteByPrimaryKey(Integer id);
int insert(User record);
User selectByPrimaryKey(Integer id);
List<User> selectAll();
int updateByPrimaryKey(User record);
}

View File

@ -0,0 +1,68 @@
package com.huake.demo.entity;
public class Dlx {
private String ky;
private String hth;
private String jy;
private Integer userId;
private String password;
public String getKy() {
return ky;
}
public void setKy(String ky) {
this.ky = ky == null ? null : ky.trim();
}
public String getHth() {
return hth;
}
public void setHth(String hth) {
this.hth = hth == null ? null : hth.trim();
}
public String getJy() {
return jy;
}
public void setJy(String jy) {
this.jy = jy == null ? null : jy.trim();
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", ky=").append(ky);
sb.append(", hth=").append(hth);
sb.append(", jy=").append(jy);
sb.append(", userId=").append(userId);
sb.append(", password=").append(password);
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,55 @@
package com.huake.demo.entity;
public class Dlxurl {
private String kyurl;
private String hthurl;
private String jyurl;
public String getKyurl() {
return kyurl;
}
public void setKyurl(String kyurl) {
this.kyurl = kyurl == null ? null : kyurl.trim();
}
public String getHthurl() {
return hthurl;
}
public void setHthurl(String hthurl) {
this.hthurl = hthurl == null ? null : hthurl.trim();
}
public String getJyurl() {
return jyurl;
}
public void setJyurl(String jyurl) {
this.jyurl = jyurl == null ? null : jyurl.trim();
}
public Dlxurl(String kyurl, String hthurl, String jyurl) {
this.kyurl = kyurl;
this.hthurl = hthurl;
this.jyurl = jyurl;
}
public Dlxurl() {
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", kyurl=").append(kyurl);
sb.append(", hthurl=").append(hthurl);
sb.append(", jyurl=").append(jyurl);
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,76 @@
package com.huake.demo.entity;
public class Head {
private String token;
private String uuid;
private String xxx;
private Integer userId;
private String name;
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token == null ? null : token.trim();
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid == null ? null : uuid.trim();
}
public String getXxx() {
return xxx;
}
public void setXxx(String xxx) {
this.xxx = xxx == null ? null : xxx.trim();
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Head(String token, String uuid, String xxx, Integer userId, String name) {
this.token = token;
this.uuid = uuid;
this.xxx = xxx;
this.userId = userId;
this.name = name;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", token=").append(token);
sb.append(", uuid=").append(uuid);
sb.append(", xxx=").append(xxx);
sb.append(", userId=").append(userId);
sb.append(", name=").append(name);
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,77 @@
package com.huake.demo.entity;
public class Heads {
private String token;
private String uuid;
private String xxx;
private Integer userId;
private String name;
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token == null ? null : token.trim();
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid == null ? null : uuid.trim();
}
public String getXxx() {
return xxx;
}
public void setXxx(String xxx) {
this.xxx = xxx == null ? null : xxx.trim();
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Heads(String token, String uuid, String xxx, Integer userId, String name) {
this.token = token;
this.uuid = uuid;
this.xxx = xxx;
this.userId = userId;
this.name = name;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", token=").append(token);
sb.append(", uuid=").append(uuid);
sb.append(", xxx=").append(xxx);
sb.append(", userId=").append(userId);
sb.append(", name=").append(name);
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,79 @@
package com.huake.demo.entity;
public class User {
private Integer id;
private String name;
private String dlxuesr;
private String dlxpasd;
private String userid;
private String chatid;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDlxuesr() {
return dlxuesr;
}
public void setDlxuesr(String dlxuesr) {
this.dlxuesr = dlxuesr == null ? null : dlxuesr.trim();
}
public String getDlxpasd() {
return dlxpasd;
}
public void setDlxpasd(String dlxpasd) {
this.dlxpasd = dlxpasd == null ? null : dlxpasd.trim();
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid == null ? null : userid.trim();
}
public String getChatid() {
return chatid;
}
public void setChatid(String chatid) {
this.chatid = chatid == null ? null : chatid.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", dlxuesr=").append(dlxuesr);
sb.append(", dlxpasd=").append(dlxpasd);
sb.append(", userid=").append(userid);
sb.append(", chatid=").append(chatid);
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,162 @@
package com.huake.demo.generator;
import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.config.*;
import org.mybatis.generator.exception.InvalidConfigurationException;
import org.mybatis.generator.internal.DefaultShellCallback;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
/**
* MyBatis-Generator 代码生成工具
* 根据数据库表可以自动构建JavaBean/*.XML文件
* mysql生成的 ***mapper.xml需注意可能需要手动处理(表名后面多个点 test..user)
* oracle测试未发现问题
* pg库未发现问题
* @author long.yu
* @date 2019-12-09
* @mark 工具类
*/
public class MyBatisGeneratorUtil {
public static void main(String[] args) throws IOException {
Properties properties = new Properties();
//配置数据库连接信息
// properties.setProperty("driveClass","oracle.jdbc.OracleDriver");
// properties.setProperty("url","jdbc:oracle:thin:localhost:1521:orcl");
// properties.setProperty("userName","cim");
// properties.setProperty("password","cim_123$");
// //配置生成的包名和存放路径
// properties.setProperty("package","com.huake.demo.pojo");
// //设置生成路径
// properties.setProperty("location","D:/resources/generator");
// //设置表名
// properties.setProperty("tableName","outline");
// //设置数据库名称
// properties.setProperty("schema","cim");
properties.setProperty("driveClass","com.mysql.cj.jdbc.Driver");
properties.setProperty("url","jdbc:mysql://154.208.207.2:3306/ky_bot?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&nullCatalogMeansCurrent=true&ignoreQualifiersAtRuntime=true");
properties.setProperty("userName","ky_bot");
properties.setProperty("password","LK6NScKBzMP75n74");
//配置生成的包名和存放路径
properties.setProperty("package","com.huake.demo");
//设置生成路径
properties.setProperty("location","D:/sc");
//设置表名
properties.setProperty("tableName","heads");
//设置数据库名称
properties.setProperty("schema","ky_bot");
List warnings = new ArrayList<String>();
boolean overwrite = true;
Configuration configuration = new Configuration();
Context context = new Context(ModelType.CONDITIONAL);
context.setTargetRuntime("MyBatis3Simple");
context.setId("simple");
//自动识别数据库关键字默认false如果设置为true
//根据SqlReservedWords中定义的关键字列表一般保留默认值遇到数据库关键字Java关键字
//使用columnOverride覆盖
context.addProperty("autoDelimitKeywords","true");
//生成的Java文件的编码
context.addProperty("javaFileEncoding","utf-8");
context.addProperty("beginningDelimiter","`");
context.addProperty("endingDelimiter","`");
//格式化java代码
context.addProperty("javaFormatter","org.mybatis.generator.api.dom.DefaultJavaFormatter");
//格式化xml代码
context.addProperty("xmlFormatter","org.mybatis.generator.api.dom.DefaultXmlFormatter");
//格式化信息
PluginConfiguration pluginConfiguration = new PluginConfiguration();
pluginConfiguration.setConfigurationType("org.mybatis.generator.plugins.SerializablePlugin");
pluginConfiguration.setConfigurationType("org.mybatis.generator.plugins.ToStringPlugin");
context.addPluginConfiguration(pluginConfiguration);
//设置是否生成注释
CommentGeneratorConfiguration commentGeneratorConfiguration = new CommentGeneratorConfiguration();
commentGeneratorConfiguration.addProperty("suppressAllComments","true");
commentGeneratorConfiguration.addProperty("suppressDate","true");
context.setCommentGeneratorConfiguration(commentGeneratorConfiguration);
//设置连接数据库
JDBCConnectionConfiguration jdbcConnectionConfiguration = new JDBCConnectionConfiguration();
jdbcConnectionConfiguration.setDriverClass(properties.getProperty("driveClass"));
jdbcConnectionConfiguration.setConnectionURL(properties.getProperty("url"));
jdbcConnectionConfiguration.setPassword(properties.getProperty("password"));
jdbcConnectionConfiguration.setUserId(properties.getProperty("userName"));
context.setJdbcConnectionConfiguration(jdbcConnectionConfiguration);
JavaTypeResolverConfiguration javaTypeResolverConfiguration = new JavaTypeResolverConfiguration();
//是否使用bigDecimal false可自动转化以下类型Long, Integer, Short, etc.
javaTypeResolverConfiguration.addProperty("forceBigDecimals","false");
context.setJavaTypeResolverConfiguration(javaTypeResolverConfiguration);
//生成实体类的地址
JavaModelGeneratorConfiguration javaModelGeneratorConfiguration = new JavaModelGeneratorConfiguration();
javaModelGeneratorConfiguration.setTargetPackage(properties.getProperty("package"));
javaModelGeneratorConfiguration.setTargetProject(properties.getProperty("location"));
javaModelGeneratorConfiguration.addProperty("enableSubPackages","false");
javaModelGeneratorConfiguration.addProperty("trimStrings","true");
context.setJavaModelGeneratorConfiguration(javaModelGeneratorConfiguration);
//生成的xml的地址
SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration = new SqlMapGeneratorConfiguration();
sqlMapGeneratorConfiguration.setTargetProject(properties.getProperty("location"));
sqlMapGeneratorConfiguration.setTargetPackage("mappers");
sqlMapGeneratorConfiguration.addProperty("enableSubPackages","false");
context.setSqlMapGeneratorConfiguration(sqlMapGeneratorConfiguration);
//dao
JavaClientGeneratorConfiguration javaClientGeneratorConfiguration = new JavaClientGeneratorConfiguration();
javaClientGeneratorConfiguration.setTargetPackage(properties.getProperty("package"));
javaClientGeneratorConfiguration.setTargetProject(properties.getProperty("location"));
javaClientGeneratorConfiguration.setConfigurationType("XMLMAPPER");
javaClientGeneratorConfiguration.addProperty("enableSubPackages","false");
context.setJavaClientGeneratorConfiguration(javaClientGeneratorConfiguration);
TableConfiguration tableConfiguration = new TableConfiguration(context);
tableConfiguration.setTableName(properties.getProperty("tableName"));
tableConfiguration.setCountByExampleStatementEnabled(true);
tableConfiguration.setUpdateByExampleStatementEnabled(true);
tableConfiguration.setDeleteByExampleStatementEnabled(true);
tableConfiguration.setInsertStatementEnabled(true);
tableConfiguration.setDeleteByPrimaryKeyStatementEnabled(true);
tableConfiguration.setSchema(properties.getProperty("schema"));
// tableConfiguration.setCatalog(properties.getProperty("schema"));
// GeneratedKey generatedKey=new GeneratedKey("id","MySql",true,null);
// tableConfiguration.setGeneratedKey(generatedKey);
context.addTableConfiguration(tableConfiguration);
configuration.addContext(context);
DefaultShellCallback callback = new DefaultShellCallback(overwrite);
try{
MyBatisGenerator myBatisGenerator = new MyBatisGenerator(configuration, callback, warnings);
myBatisGenerator.generate(null);
}catch (IOException ie){
ie.printStackTrace();
}catch (InterruptedException ite){
ite.printStackTrace();
}catch (SQLException se){
System.err.println("SQL语句异常");
se.printStackTrace();
}catch (InvalidConfigurationException ive){
System.err.println("配置信息存在无效数据!");
ive.printStackTrace();
}finally {
Desktop.getDesktop().open(new File("D:/sc"));
}
}
}

View File

@ -0,0 +1,10 @@
package com.huake.demo.service;
import com.huake.demo.entity.User;
import org.springframework.stereotype.Service;
public interface IUserService {
User selectUser(long userId);
}

View File

@ -0,0 +1,17 @@
package com.huake.demo.service;
import com.huake.demo.entity.User;
import java.util.List;
public interface UserService {
String deleteByPrimaryKey(Integer id);
String insert(User record);
User selectByPrimaryKey(Integer id);
List<User> selectAll();
String updateByPrimaryKey(User record);
}

View File

@ -0,0 +1,17 @@
package com.huake.demo.service;
import com.huake.demo.entity.Dlx;
import java.util.List;
public interface dlxService {
String insert(Dlx record);
List<Dlx> selectAll();
Dlx selectByPrimaryKey(Integer id);
String deleteByPrimaryKey(Integer id);
}

View File

@ -0,0 +1,16 @@
package com.huake.demo.service;
import com.huake.demo.entity.Dlx;
import com.huake.demo.entity.Dlxurl;
import java.util.List;
public interface dlxurlService {
int insert(Dlxurl record);
Dlxurl selectAll();
int updateUrl(Dlxurl dlxurl);
}

View File

@ -0,0 +1,16 @@
package com.huake.demo.service;
import com.huake.demo.entity.Head;
import java.util.List;
public interface headService {
int insert(Head record);
List<Head> selectAll();
List<Head> getUserById(Integer userId);
void updateUser(Head user);
}

View File

@ -0,0 +1,19 @@
package com.huake.demo.service;
import com.huake.demo.entity.Head;
import com.huake.demo.entity.Heads;
import java.util.List;
public interface headsService {
int insert(Heads record);
List<Heads> selectAll();
List<Heads> getUserById(Integer userId);
void updateUser(Heads user);
Heads getName(String name);
}

View File

@ -0,0 +1,89 @@
package com.huake.demo.service.impl;
import com.huake.demo.dao.IUserDao;
import com.huake.demo.dao.UserMapper;
import com.huake.demo.service.IUserService;
import com.huake.demo.entity.User;
import com.huake.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserMapper userMapper;
@Override
public String deleteByPrimaryKey(Integer id) {
try {
if (id!=0){
int i = userMapper.deleteByPrimaryKey(id);
if (i==0){
return "删除成功!";
}else {
return "删除失败!!";
}
}
}catch (Exception e){
return e.toString();
}
return "未知异常,查看日志!";
}
@Override
public String insert(User record) {
try {
System.out.println("用户iD"+record.getId());
System.out.println("用户名:"+record.getName());
System.out.println("机器人id"+record.getUserid());
System.out.println("机器人群聊id"+record.getChatid());
int insert = userMapper.insert(record);
if (insert>0){
return "添加成功";
}else {
return "添加失败";
}
}catch (Exception e)
{
return e.toString();
}
}
@Override
public User selectByPrimaryKey(Integer id) {
User user = userMapper.selectByPrimaryKey(id);
return user;
}
@Override
public List<User> selectAll() {
List<User> users = userMapper.selectAll();
return users;
}
@Override
public String updateByPrimaryKey(User record) {
try {
User user1 = new User();
user1.setId(record.getId());
user1.setName(record.getName());
user1.setUserid(record.getUserid());
user1.setChatid(record.getChatid());
int i = userMapper.updateByPrimaryKey(user1);
return "修改成功";
}catch (Exception e){
return e.toString();
}
}
}

View File

@ -0,0 +1,68 @@
package com.huake.demo.service.impl;
import com.huake.demo.dao.DlxMapper;
import com.huake.demo.dao.UserMapper;
import com.huake.demo.entity.Dlx;
import com.huake.demo.entity.User;
import com.huake.demo.service.UserService;
import com.huake.demo.service.dlxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
@Service
public class dlxServiceImpl implements dlxService {
@Autowired
private DlxMapper dlxMapper;
@Override
public String deleteByPrimaryKey(Integer id) {
try {
int i = dlxMapper.deleteByPrimaryKey(id);
if (i==0){
return "删除成功!";
}else {
return "删除失败!!";
}
}catch (Exception e){
return e.toString();
}
}
@Override
public String insert(Dlx record) {
try {
int insert = dlxMapper.insert(record);
if (insert>0){
return "添加成功";
}else {
return "添加失败";
}
}catch (Exception e)
{
return e.toString();
}
}
@Override
public List<Dlx> selectAll() {
return dlxMapper.selectAll();
}
@Override
public Dlx selectByPrimaryKey(Integer id) {
Dlx dlx = dlxMapper.selectByPrimaryKey(id);
if (dlx!=null){
return dlx;
}else {
return null;
}
}
}

View File

@ -0,0 +1,30 @@
package com.huake.demo.service.impl;
import com.huake.demo.dao.DlxurlMapper;
import com.huake.demo.entity.Dlxurl;
import com.huake.demo.service.dlxurlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class dlxurlServiceImpl implements dlxurlService {
@Autowired
private DlxurlMapper dlxurlMapper;
@Override
public int insert(Dlxurl record) {
return 0;
}
@Override
public Dlxurl selectAll() {
return dlxurlMapper.selectAll();
}
@Override
public int updateUrl(Dlxurl dlxurl) {
int i = dlxurlMapper.updateUrl(dlxurl);
return i;
}
}

View File

@ -0,0 +1,57 @@
package com.huake.demo.service.impl;
import com.huake.demo.dao.DlxMapper;
import com.huake.demo.dao.HeadMapper;
import com.huake.demo.entity.Dlx;
import com.huake.demo.entity.Head;
import com.huake.demo.service.headService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
@Service
public class headServiceImpl implements headService {
@Autowired
private HeadMapper headMapper;
@Override
public int insert(Head record) {
try {
if (record!=null){
headMapper.insert(record);
System.out.println("保存成功");
}else {
System.out.println("数据不得为空,请重试");
}
}catch (Exception e){
e.printStackTrace();
return 0;
}
return 0;
}
@Override
public List<Head> selectAll() {
return Collections.emptyList();
}
@Override
public List<Head> getUserById(Integer userId) {
return headMapper.getUserById(userId);
}
@Override
public void updateUser(Head user) {
if (user!=null){
headMapper.updateUser(user);
}else {
System.out.println("未知异常");
}
}
}

View File

@ -0,0 +1,59 @@
package com.huake.demo.service.impl;
import com.huake.demo.dao.HeadsMapper;
import com.huake.demo.entity.Heads;
import com.huake.demo.service.headsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
@Service
public class headsServiceImpl implements headsService {
@Autowired
private HeadsMapper headMapper;
@Override
public int insert(Heads record) {
try {
if (record!=null){
headMapper.insert(record);
System.out.println("保存成功");
}else {
System.out.println("数据不得为空,请重试");
}
}catch (Exception e){
e.printStackTrace();
return 0;
}
return 0;
}
@Override
public List<Heads> selectAll() {
return Collections.emptyList();
}
@Override
public List<Heads> getUserById(Integer userId) {
return headMapper.getUserById(userId);
}
@Override
public void updateUser(Heads user) {
if (user!=null){
headMapper.updateUser(user);
}else {
System.out.println("未知异常");
}
}
@Override
public Heads getName(String name) {
return headMapper.getName(name);
}
}

View File

@ -0,0 +1,8 @@
package com.huake.demo.task;
import org.springframework.stereotype.Component;
@Component
public class UpdateTokenTask {
}

View File

@ -0,0 +1,57 @@
package com.huake.demo.utils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by 89456 on 2021/4/23.
*/
public class DataTimeUtil {
/*
* 将时间转换为时间戳
*/
public static String dateToStamp(String s){
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = null;
try {
date = simpleDateFormat.parse(s);
} catch (ParseException e) {
e.printStackTrace();
}
long ts = date.getTime();
res = String.valueOf(ts);
return res;
}
/*
* 将时间戳转换为时间
*/
public static String stampToDate(String s){
if(s.length() == 10) s+="000";
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd HH:mm:ss");
long lt = new Long(s);
Date date = new Date(lt);
res = simpleDateFormat.format(date);
return res;
}
//温度 5min
//角度x 1min
//角度y 1min
//角度z 1min
//加速度x 1min
//加速度y 1min
//加速度z 1min
//水位 1min
//位移 5min
public static void main(String[] args) {
System.out.println(System.currentTimeMillis());
System.out.println(stampToDate("1615342200000"));
System.out.println(stampToDate("1615342140000"));
System.out.println((1615342200-60*60*24*1)+"000");
System.out.println(stampToDate((1615342200-60*60*24*1)+"000"));
}
}

View File

@ -0,0 +1,39 @@
package com.huake.demo.utils;
import java.util.UUID;
/**
* 主键生成策略
*/
public class UUIDUtil {
private UUIDUtil() {
};
public static String getUUID(){
return UUID.randomUUID().toString().toUpperCase() + "-" + (int)((Math.random()*9+1)*10000);
}
public static String getLowerUUID() {
return UUID.randomUUID().toString().toLowerCase();
}
}

View File

@ -0,0 +1,46 @@
#开发环境
server:
port:
28088
#华创接口配置
hcserver:
user: test001
pass: 47ec2dd791e31e2ef2076caf64ed9b3d
guid: 9c7609c1-6cda-47bf-93ae-c364ab61c7fd
url: http://120.26.14.213:8861
#谷元接口配置
#gyserver:
# user:
# pass:
# guid:
# url:
# DataSource
spring:
datasource:
name: druidDataSource
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:localhost:1521:orcl
username: cim
password: cim_123$
filters: stat,wall,log4j,config
max-active: 100
initial-size: 1
max-wait: 60000
min-idle: 1
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM dual
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: true
max-open-prepared-statements: 50
max-pool-prepared-statement-per-connection-size: 20
#日志配置
logging:
config: classpath:logback-spring.xml

View File

@ -0,0 +1,46 @@
#生产环境
server:
port:
28088
#华创接口配置
hcserver:
user: test001
pass: 47ec2dd791e31e2ef2076caf64ed9b3d
guid: 9c7609c1-6cda-47bf-93ae-c364ab61c7fd
url: http://120.26.14.213:8861
#谷元接口配置
#gyserver:
# user:
# pass:
# guid:
# url:
# DataSource
spring:
datasource:
name: druidDataSource
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:localhost:1521:orcl
username: cim
password: cim_123$
filters: stat,wall,log4j,config
max-active: 100
initial-size: 1
max-wait: 60000
min-idle: 1
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM dual
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: true
max-open-prepared-statements: 50
max-pool-prepared-statement-per-connection-size: 20
#日志配置
logging:
config: classpath:logback-spring.xml

View File

@ -0,0 +1,36 @@
#测试环境
server:
port:
80
nginxUrl: http://
# DataSource
spring:
datasource:
name: druidDataSource
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://154.208.207.2:3306/ky_bot?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
username: ky_bot
password: LK6NScKBzMP75n74
filters: stat,wall,log4j,config
max-active: 100
initial-size: 1
max-wait: 60000
min-idle: 1
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 'x'
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: true
max-open-prepared-statements: 50
max-pool-prepared-statement-per-connection-size: 20
#日志配置
logging:
config: classpath:logback-spring.xml

View File

@ -0,0 +1,3 @@
spring:
profiles:
active: test

View File

@ -0,0 +1,4 @@
log4j.rootLogger=DEBUG, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n

View File

@ -0,0 +1,49 @@
<configuration>
<!--定义日志文件的存储地址目录 -->
<!--<property name="LOG_HOME" value="/Users/baikun/Desktop/workplace/河北检修项目new/带权限/overhaul/log/springboot-test07" />-->
<property name="LOG_HOME" value="D://log" />
<!-- %m输出的信息,%p日志级别,%t线程名,%d日期,%c类的全名,%i索引【从数字0开始递增】,,, -->
<!-- appender是configuration的子节点是负责写日志的组件。 -->
<!-- ConsoleAppender把日志输出到控制台 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<!--格式化输出:%d表示日期%thread表示线程名%-5level级别从左显示5个字符宽度%msg日志消息%n是换行符 -->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<!-- RollingFileAppender滚动记录文件先将日志记录到指定文件当符合某个条件时将日志记录到其他文件 -->
<!-- 以下的大概意思是1.先按日期存日志日期变了将前一天的日志文件名重命名为XXX%日期%索引新的日志仍然是sys.log -->
<!-- 2.如果日期没有发生变化但是当前日志的文件大小超过1KB时对当前日志进行分割 重命名-->
<appender name="syslog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${LOG_HOME}/sys.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 活动文件的名字会根据fileNamePattern的值每隔一段时间改变一次 -->
<!-- 文件名log/sys.2017-12-05.0.log -->
<fileNamePattern>${LOG_HOME}/sys.%d.%i.log.zip</fileNamePattern>
<!-- 每产生一个日志文件该日志文件的保存期限为30天 -->
<maxHistory>30</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<!--格式化输出:%d表示日期%thread表示线程名%-5level级别从左显示5个字符宽度%msg日志消息%n是换行符 -->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<!-- 控制台输出日志级别 -->
<root level="info">
<appender-ref ref="STDOUT" />
</root>
<!-- 指定项目中某个包,当有日志操作行为时的日志记录级别 -->
<!-- com.appley为根包也就是只要是发生在这个根包下面的所有日志操作行为的权限都是DEBUG -->
<!-- 级别依次为【从高到低】FATAL > ERROR > WARN > INFO > DEBUG > TRACE -->
<logger name="com.huake.demo" level="DEBUG">
<appender-ref ref="syslog" />
</logger>
</configuration>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huake.demo.dao.DlxMapper">
<resultMap id="BaseResultMap" type="com.huake.demo.entity.Dlx">
<result column="ky" jdbcType="VARCHAR" property="ky" />
<result column="hth" jdbcType="VARCHAR" property="hth" />
<result column="jy" jdbcType="VARCHAR" property="jy" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="password" jdbcType="VARCHAR" property="password" />
</resultMap>
<insert id="insert" parameterType="com.huake.demo.entity.Dlx">
insert into dlx (ky, hth, jy,
user_id, `password`)
values (#{ky,jdbcType=VARCHAR}, #{hth,jdbcType=VARCHAR}, #{jy,jdbcType=VARCHAR},
#{userId,jdbcType=INTEGER}, #{password,jdbcType=VARCHAR})
</insert>
<select id="selectAll" resultMap="BaseResultMap">
select ky, hth, jy, user_id, `password`
from dlx
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select user_id, ky, hth, jy, password
from dlx
where user_id = #{userId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from dlx
where user_id = #{userId,jdbcType=INTEGER}
</delete>
</mapper>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huake.demo.dao.DlxurlMapper">
<resultMap id="BaseResultMap" type="com.huake.demo.entity.Dlxurl">
<result column="kyurl" jdbcType="VARCHAR" property="kyurl" />
<result column="hthurl" jdbcType="VARCHAR" property="hthurl" />
<result column="jyurl" jdbcType="VARCHAR" property="jyurl" />
</resultMap>
<insert id="insert" parameterType="com.huake.demo.entity.Dlxurl">
insert into dlxurl (kyurl, hthurl, jyurl
)
values (#{kyurl,jdbcType=VARCHAR}, #{hthurl,jdbcType=VARCHAR}, #{jyurl,jdbcType=VARCHAR}
)
</insert>
<select id="selectAll" resultMap="BaseResultMap">
select * from dlxurl
</select>
<update id="updateUrl" parameterType="com.huake.demo.entity.Dlxurl">
UPDATE dlxurl
SET kyurl = #{kyurl}, hthurl = #{hthurl}, jyurl = #{jyurl}
</update>
</mapper>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huake.demo.dao.HeadMapper">
<resultMap id="BaseResultMap" type="com.huake.demo.entity.Head">
<result column="Token" jdbcType="VARCHAR" property="token" />
<result column="Uuid" jdbcType="VARCHAR" property="uuid" />
<result column="Xxx" jdbcType="VARCHAR" property="xxx" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="name" jdbcType="VARCHAR" property="name" />
</resultMap>
<insert id="insert" parameterType="com.huake.demo.entity.Head">
insert into head (Token, Uuid, Xxx,
user_id, `name`)
values (#{token,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}, #{xxx,jdbcType=VARCHAR},
#{userId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR})
</insert>
<select id="selectAll" resultMap="BaseResultMap">
select Token, Uuid, Xxx, user_id, `name`
from head
</select>
<select id="getUserById" parameterType="java.lang.Integer" resultType="com.huake.demo.entity.Head">
SELECT * FROM head WHERE user_id = #{userId}
</select>
<update id="updateUser" parameterType="com.huake.demo.entity.Head">
UPDATE head
SET token = #{token}, uuid = #{uuid}, xxx = #{xxx}
WHERE user_id = #{userId} AND name = #{name}
</update>
</mapper>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huake.demo.dao.HeadsMapper">
<resultMap id="BaseResultMap" type="com.huake.demo.entity.Heads">
<result column="Token" jdbcType="VARCHAR" property="token" />
<result column="Uuid" jdbcType="VARCHAR" property="uuid" />
<result column="Xxx" jdbcType="VARCHAR" property="xxx" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="name" jdbcType="VARCHAR" property="name" />
</resultMap>
<insert id="insert" parameterType="com.huake.demo.entity.Heads">
insert into heads (Token, Uuid, Xxx,
user_id, `name`)
values (#{token,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}, #{xxx,jdbcType=VARCHAR},
#{userId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR})
</insert>
<select id="selectAll" resultMap="BaseResultMap">
select Token, Uuid, Xxx, user_id, `name`
from heads
</select>
<select id="getUserById" parameterType="java.lang.Integer" resultType="com.huake.demo.entity.Heads">
SELECT * FROM heads WHERE user_id = #{userId}
</select>
<select id="getName" parameterType="java.lang.String" resultType="com.huake.demo.entity.Heads">
SELECT * FROM heads WHERE name = #{name}
</select>
<update id="updateUser" parameterType="com.huake.demo.entity.Heads">
UPDATE heads
SET token = #{token}, uuid = #{uuid}, xxx = #{xxx}
WHERE user_id = #{userId} AND name = #{name}
</update>
</mapper>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huake.demo.dao.UserMapper">
<resultMap id="BaseResultMap" type="com.huake.demo.entity.User">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="dlxUesr" jdbcType="VARCHAR" property="dlxuesr" />
<result column="dlxPasd" jdbcType="VARCHAR" property="dlxpasd" />
<result column="userID" jdbcType="VARCHAR" property="userid" />
<result column="chatID" jdbcType="VARCHAR" property="chatid" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from user
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.huake.demo.entity.User">
insert into user (id, `name`, dlxUesr,
dlxPasd, userID, chatID
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{dlxuesr,jdbcType=VARCHAR},
#{dlxpasd,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, #{chatid,jdbcType=VARCHAR}
)
</insert>
<update id="updateByPrimaryKey" parameterType="com.huake.demo.entity.User">
update user
set `name` = #{name,jdbcType=VARCHAR},
dlxUesr = #{dlxuesr,jdbcType=VARCHAR},
dlxPasd = #{dlxpasd,jdbcType=VARCHAR},
userID = #{userid,jdbcType=VARCHAR},
chatID = #{chatid,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select id, `name`, dlxUesr, dlxPasd, userID, chatID
from user
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select id, `name`, dlxUesr, dlxPasd, userID, chatID
from user
</select>
</mapper>

View File

@ -0,0 +1,411 @@
input::-webkit-input-placeholder{
color:#585c89;
}
input::-moz-placeholder{ /* Mozilla Firefox 19+ */
color:#585c89;
}
input:-moz-placeholder{ /* Mozilla Firefox 4 to 18 */
color:#585c89;
}
input:-ms-input-placeholder { /* Internet Explorer 10-11 */
color: #585c89;
}
.downLiicon_style{
width:20px;height: 20px;background-color: transparent;
}
.ulStyle_FL{
position: absolute;
top: 25px;
width: 240px;
max-height: 250px;
overflow-x: hidden;
background-color: #15323C;
color: #B1BBBF;
list-style: none;
border:1px solid #53BCCC;
font-size: 13px;
left: 10px;
}
.ulStyle_FL li{
display: flex;
justify-content: flex-start;
box-sizing: border-box;
padding: 3px 5px;
background-color: #102F42;
}
.ulStyle_FL li:hover{
background-color:#0A1E2A;
}
.Ui_Box{
width: 870px;height: 590px;position: absolute;z-index: 999;left: 24%;top: 21%;
/*border: 1px solid #53BBC9;*/
background: url(../img/quejiaobiankuang.png)no-repeat center center;
background-size:100% 100%;
box-sizing: border-box;
padding: 10px;
/*-webkit-box-shadow:#07417a 0 0 10px;-moz-box-shadow:#07417a 0 0 10px;box-shadow:inset 0 0 30px #07417a;*/
/*background-image:-webkit-radial-gradient(250px 250px at 50% 50%,hsla(209,99%,32%,28),hsla(228,100%,0%,0));
background-image:radial-gradient(250px 250px at 50% 50%,hsla(209,99%,32%,28),hsla(228,100%,0%,0))*/
}
.Ui_Box .title{
height: 40px;width: 100%;display: flex;background: radial-gradient(#204e61,transparent);
position: relative;
}
.Ui_Box .title .title_text{
text-align: center;line-height: 40px;flex:1;color: #7ec4d6;font-size: 16px;font-weight: bold;
}
.Ui_Box .title .title_btn_close{
box-sizing: border-box;
padding: 5px 5px;
text-align: center;
display: flex;
justify-content: center;
align-content: center;
background: url(../img/quxiao.png) no-repeat center center;
background-size:100% 100%;
width: 30px;
height: 30px;
position: relative;
left: 10px;
top:-10px ;
}
.Ui_Box .content{
display: flex;height: 530px
}
.Ui_Box .content .title_inner{
height: 30px;
color: #7ec4d6;
}
.Ui_Box .content .foot{
height:50px;display: flex;justify-content: center;align-items: center
}
.Ui_Box .content .foot .foot_btn{
box-sizing: border-box;
padding: 10px 20px;
border:1px solid #1E201C;
border-radius: 5px;
color: #0e1112;
height: 38px;
background: linear-gradient(to top, #0a6886, #14394d);
color: #fff0f6;
display: flex;
justify-content: center;
align-items: center;
}
.content_middle{
flex: 1;background-color:rgba(68,108,119,.7);overflow-x: hidden;color: #f2f4f7;
}
.content_middle table{
width: 100%;border-collapse: collapse;table-layout: fixed;font-size: 14px;
}
.content_middle table input{
background-color: transparent;border: 1px solid #dde0ec;
}
.content_middle table tr:first-child{
text-align: center;
}
.content_middle .th_btn{
margin-left: 10px;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #53BBC9;
border-radius: 5px;
background: linear-gradient(to top, #0a6886, #14394d);
color:#fff0f6;
font-size: 13px;
box-sizing: border-box;
padding: 0px 5px;
}
.content_middle .th_btn:hover{
color: #02dde3;
}
.content_middle .tablecol1{width: 40px}
.content_middle .tablecol3{width: 160px;font-size: 14px;}
.content_middle .tablecol4{width: 150px}
.btn_tongYong{
background: linear-gradient(to top, #0a6886, #14394d);
display: flex;
justify-content: center;
align-items: center;
border:1px solid #37335a;
border-radius: 5px;
color: #fff0f6;
box-sizing: border-box;
padding: 2px 3px;
margin-top: 3px;
font-size: 13px;
}
.btn_tongYong:hover{
background-color: #1E9FFF;
color: #1E9FFF;
}
.classStyle_none{
background-color: rgba(16,69,91,.6);
}
.classStyle_chang{
background-color: rgba(37,194,235,.2);
}
.Generalstyle_background_linear{
background: linear-gradient(to top, #0a6886, #14394d);
}
.shade_rightdown{
box-shadow: 10px 10px 23px -8px rgba(0,0,0,0.75);
-webkit-box-shadow: 10px 10px 23px -8px rgba(0,0,0,0.75);
-moz-box-shadow: 10px 10px 23px -8px rgba(0,0,0,0.75);
}
#baogaoBox {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
background-color: green;
}
#baogaoBox td{
box-sizing: border-box;
padding: 2px;
color: #000;
width: 154px;
}
#baogaoBox .toPdfDown_btnSty{
font-size: 14px;
margin-right: 20px;
color: #fff;
border: 1px solid #FFF;
box-sizing: border-box;
padding: 1px 5px;
border-radius: 5px;
}
.BaoGao_title{
height: 70px;
background-color: #B8CCE4;
display: flex;
font-weight: bold;
font-size: 23px;
line-height: 70px;
justify-content: center;
color: #000;
}
.BaoGao_left_table{
border-bottom: 1px solid #fff!important;
background-color: #4F81BD!important;
height: 40px;
display: flex;
align-items: center;
justify-content: flex-end;
color: #fff!important;
box-sizing: border-box;
padding: 0 10px;
font-weight: bold;
}
.BaoGao_div_left{
justify-content: flex-start;
}
.BaoGao_right_table{
border-bottom: 1px solid #fff;
background-color: #C5D9F1;
height: 40px;
text-align: left;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0 10px;
color: #000!important;
border-bottom: 1px solid #fff!important;
}
.BaoGao_table1{
width: 100%;
table-layout:fixed;
word-break: break-all;
}
.BaoGao_table1 th{
color: #000;
font-weight: bold;
background-color:#918485 ;
border: 1px solid #fff;
border-left: none;
border-top: none;
}
.BaoGao_table1 tr{
text-align: center;
color: #000;
border: 1px solid #fff;
border-left: none;
background-color:#D2CECE ;
}
BaoGao_table1_col1{
width: 5%;
}
BaoGao_table1_col2{
width: 15%;
}
BaoGao_table1_col3{
width: 8%;
}
BaoGao_table1_col4{
width: 15%;
}
BaoGao_table1_col5{
}
.BaoGao_table2{
width: 60%;
table-layout:fixed
}
.BaoGao_table2 td{
border: 1px solid #000;
color: #000;
width: 154px;
}
.BaoGao_table2_col1{
font-weight: bold;
text-align: right;
border-right: none;
border: 1px solid #000;
}
.BaoGao_table2_col2 {
width: 50%;
border: 1px solid #000;
}
.BaoGao_table1_col2{
}
.BaoGao_table3{
width: 100%;
table-layout:fixed
}
.BaoGao_table3 th{
color: #fff;
font-weight: bold;
background-color:#4F81BD ;
border: 1px solid #fff;
border-left: none;
border-top: none;
}
.BaoGao_table3 tr:nth-child(odd){
text-align: center;
color: #000;
border: 1px solid #fff;
border-left: none;
background-color:#fff;
}
.BaoGao_table3 tr:nth-child(even){
text-align: center;
color: #000;
border: 1px solid #fff;
border-left: none;
background-color:#DCE6F1;
}
#toolBox{
}
#tuozhuai{
cursor: move;
position: absolute;
display: flex;
flex-direction: column;
z-index: 9999;
left: 35%;
top: 13%;
width: 500px;
background: url(../img/quejiaobiankuang.png)no-repeat center center;
background-size:100% 100%;
background-color:rgba(0,61,101,.7);
}
#toolBox_close{
width: 20px;
height: 20px;
font-size: 16px;
display: flex;
justify-content: center;
align-content: center;
background: url(../img/quxiao.png)no-repeat center center;
background-size:100% 100%;
}
.toolBtn{}
.toolBtn button{
background: linear-gradient(to top, #0c5a75, #33627b);
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border: 1px solid #37335a;
border-radius: 5px;
color: #fff0f6;
box-sizing: border-box;
padding: 6px 3px;
margin-top: 3px;
font-size: 14px;
}
.toolBtn button:hover{
background: linear-gradient(to top, #2485a5, #3b6e8a);
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border: 1px solid #37335a;
border-radius: 5px;
color: #fff0f6;
box-sizing: border-box;
padding: 6px 3px;
margin-top: 3px;
font-size: 14px;
}
#tip_mouseoverBoxBtn{
width: 20px;
height: 20px;
border-radius: 50%;
background: url(../img/wenhao.png) no-repeat center center;
background-size:70% 70%;
background-color: #365965;
}
.Left_SJ{
width: 0;
height: 0;
border-right: 10px solid cyan;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
}
/*
@media print {
@page {
size: portrait;
margin: 0;
}
body {
margin: 1cm;
}
}*/

View File

@ -0,0 +1,114 @@
<!--
* @Descripttion:
* @version:
* @Author: kun·bai
* @Date: 2020-08-10 16:55:07
* @LastEditors: kun·bai
* @LastEditTime: 2020-08-13 17:55:57
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/main_Ui.css">
<script src="lib/jquery/jquery-1.9.0.js"></script>
</head>
<body>
<button id="takeReport" onclick="show()" style=" /*margin-left: 750px;margin-top: 250px;width: 500px;height: 500px;font-size: 110px;*/">生成报告</button>
<!--生成报告界面-->
<div id="baogaoBox" style="position: absolute;top:0;background-color: rgba(22,22,22,.2);width: 100%;height: 100%;z-index: 999;display: none">
<div style="width: 800px;margin: 0 auto;height: 90%;margin-top:3%;display: flex;flex-direction: column">
<div class="BaoGao_head Generalstyle_background_linear" style="height: 30px;width: 100%;display: flex;justify-content: flex-end;align-items: center">
<!--<div class="toPdfDown_btnSty" onclick="toPdfDown('print_box')">下载PDF</div>-->
<div class="toPdfDown_btnSty" onclick="doPrint()">下载PDF</div>
<div style="font-size: 25px;color: #fff;margin-right: 10px;" onclick="$('#baogaoBox').hide();">x</div>
</div>
<!--以下样式写内联-->
<!--startprintBG-->
<div id="print_box" class="shade_rightdown" style="flex: 1; background-color: #fff;overflow-x:hidden!important;display: flex;flex-direction: column;box-sizing: border-box;padding: 20px">
<div class="BaoGao_title">变(输)电设备数字化设计成果校核报表</div>
<div style="display: flex;margsin-top:20px">
<div style="width: 30%">
<div class="BaoGao_left_table">站 点 名 称:</div>
<div class="BaoGao_left_table">校 核 人 员:</div>
<div class="BaoGao_left_table">校 核 时 间:</div>
<div class="BaoGao_left_table">检 查 编 号:</div>
</div>
<div style="width: 70%">
<div id="print_stationName" class="BaoGao_right_table">赤松变</div>
<div class="BaoGao_right_table">国网运检管控项目组-陈铭宇</div>
<div id="print_CreationTimedata" class="BaoGao_right_table">20210301</div>
<div class="BaoGao_right_table">20210301JL01</div>
</div>
</div>
<div style="display: flex;justify-content: center;margin-top: 20px;flex-direction: column;align-items: center">
<div class="BaoGao_left_table BaoGao_div_left" style="width: 100%">差异统计及得分</div>
<table style="width: 100%;border-collapse:collapse;border-spacing:0px;">
<tr>
<td class="BaoGao_table2_col1">
<div >模型冗余:</div>
</td>
<td class="BaoGao_table2_col2" id="modelMore">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1">
<div> 模型缺失:</div>
</td>
<td class="BaoGao_table2_col2" id="modelMiss">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>外观形态差异:</div></td>
<td class="BaoGao_table2_col2" id="aspectInconformity">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>设备连接不紧密:</div></td>
<td class="BaoGao_table2_col2" id="facilityGap">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>位置偏差:</div></td>
<td class="BaoGao_table2_col2" id="positionalDeviation">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>纹理缺失:</div></td>
<td class="BaoGao_table2_col2" id="textureMiss">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>设备缺失:</div></td>
<td class="BaoGao_table2_col2" id="facilityMiss">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>已校核设备:</div></td>
<td class="BaoGao_table2_col2" id="facilitySum">145台</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>得分:</div></td>
<td class="BaoGao_table2_col2" id="note">99分</td>
</tr>
</table>
</div>
<div style="margin-top: 20px">
<div class="BaoGao_left_table BaoGao_div_left">矢量化点云校验清单</div>
<table id="cloudCheckList" class="BaoGao_table1">
<tr>
<th class="BaoGao_table1_col1">序号</th>
<th class="BaoGao_table1_col2">设备名称</th>
<th class="BaoGao_table1_col3">设备差异</th>
<th class="BaoGao_table1_col4">达标率</th>
<th class="BaoGao_table1_col5">备注</th>
</tr>
</table>
</div>
</div>
<!--endprintBG-->
</div>
</div>
<!--生成报告界面结束-->
</body>
<script src="js/makeReport.js"></script>
</html>

View File

@ -0,0 +1,189 @@
/*
* wmh 生成报告部分
*
* */
function show(){
$("#baogaoBox").show();
}
//打印
function doPrint() {
let winname,head,bdhtml,sprnstr,eprnstr,prnhtml;
$("html").css("height", "auto");
winname = window.open('', "_blank",'');
head =
'<style>#baogaoBox{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-color:green;}#baogaoBox td{box-sizing:border-box;padding:2px;color:#000;}#baogaoBox .toPdfDown_btnSty{font-size:14px;margin-right:20px;color:#fff;border:1px solid #FFF;box-sizing:border-box;padding:1px 5px;border-radius:5px;}.BaoGao_title{color:#000;height:70px;background-color:#B8CCE4!important;display:flex;font-weight:bold;font-size:23px;line-height:70px;justify-content:center;}.BaoGao_left_table{border-bottom:1px solid #fff!important;background-color:#4F81BD!important;height:40px;display:flex;align-items:center;justify-content:flex-end;color:#fff!important;box-sizing:border-box;padding:0 10px;font-weight:bold;}.BaoGao_div_left{justify-content:flex-start;}.BaoGao_right_table{box-sizing:border-box;padding:0 10px;color:#000!important;border-bottom:1px solid #fff!important;background-color:#C5D9F1!important;height:40px;text-align:left;display:flex;align-items:center;}.BaoGao_table1{table-layout:fixed!important;width: 100%;word-break: break-all;}.BaoGao_table1 th{color:#000!important;font-weight:bold;background-color:#918485!important;border:1px solid #fff;border-left:none;border-top:none;}.BaoGao_table1 tr{text-align:center;color:#000!important;border:1px solid #fff;border-left:none;background-color:#D2CECE!important;}BaoGao_table1_col1{width:5%;}BaoGao_table1_col2{width:15%;}BaoGao_table1_col3{width:8%;}BaoGao_table1_col4{width:15%;}BaoGao_table1_col5{}.BaoGao_table2{width:60%;table-layout:fixed;border-collapse:collapse;border-spacing:0;}.BaoGao_table2 td{border:1px solid #000;}.BaoGao_table2_col1{font-weight:bold;width:50%;border:1px solid #000;}.BaoGao_table2_col1 div{width:150px;text-align:justify;text-align-last:justify;float:right;}.BaoGao_table2_col2{width:50%;border:1px solid #000;text-align: center}.BaoGao_table3{width:100%;table-layout:fixed}.BaoGao_table3 th{color:#fff!important;font-weight:bold;background-color:#4F81BD!important;border:1px solid #fff;border-left:none;border-top:none;}.BaoGao_table3 tr:nth-child(odd){text-align:center;color:#000!important;border:1px solid #fff;border-left:none;background-color:#fff!important;}.BaoGao_table3 tr:nth-child(even){text-align:center;color:#000!important;border:1px solid #fff;border-left:none;background-color:#DCE6F1!important;}.Generalstyle_background_linear{background:linear-gradient(to top,#0a6886,#14394d);}</style>>';
bdhtml=window.document.body.innerHTML;
sprnstr="<!--startprintBG-->";
eprnstr="<!--endprintBG-->";
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+19);
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
winname.document.head.innerHTML=head;
winname.document.body.innerHTML=prnhtml;
winname.print();
$("html").css("height", "100%");
}
$("#takeReport").click(function () {
//通过后台获取数据
$.ajax({
url: "selectAllEquipmentCheck",
type: "post",
dataType: "json",
success: function (result) {
if(result!=""&&result!=null){
addBaogaoList(result);
setstatistical(result);
$("#baogaoBox").show();
}
}
})
})
/*添加list到报表中*/
function addBaogaoList(testList){
//清空报告列表
let indexCloudCheck = 0;
let tabletrLenght = $("#cloudCheckList tr").length;
//console.log(cloudCheckList)
for (var i=tabletrLenght;i>=1;i--){
$("#cloudCheckList tr").eq(i).remove();
}
let htmlstr = "";
if (testList.length>0){
testList.forEach((item,index)=>{
//添加查询出的列表
indexCloudCheck++;
htmlstr += '<tr><td class="BaoGao_table1_col1">'+indexCloudCheck+'</td><td class="BaoGao_table1_col2">'+item.deviceCode+'</td><td class="BaoGao_table1_col3">'+checkType(item.differenceType)+'</td><td class="BaoGao_table1_col4">'+percentPass(item.differenceType)+'</td><td class="BaoGao_table1_col5">'+item.differenceDescribe+'</td></tr>'
})
}
$("#cloudCheckList").append(htmlstr);
}
/*判断list差异类型显示内容*/
function checkType(typeArr){
let typearrStr = "";
let typeArrTemp = "";
if(typeArr!=""&&typeArr!=null) {
typeArrTemp = typeArr.split(";");
typeArrTemp.forEach((item,index)=>{
switch (item) {
case "1":typearrStr += "模型冗余,";break;
case "2":typearrStr += "模型缺失,";break;
case "3":typearrStr += "外观形态差异,";break;
case "4":typearrStr += "设备连接不紧密,";break;
case "5":typearrStr += "位置偏差,";break;
case "6":typearrStr += "纹理缺失,";break;
case "7":typearrStr += "设备缺失,";break;
default:break;
};
})
}
/*console.log(typearrStr)*/
return typearrStr
}
//设置统计
function setstatistical(data) {
let statisticalResultArr = statisticalResult(data)
$("#modelMore").html("共"+statisticalResultArr.modelMore+"处")
$("#modelMiss").html("共"+statisticalResultArr.modelMiss+"处")
$("#aspectInconformity").html("共"+statisticalResultArr.aspectInconformity+"处")
$("#facilityGap").html("共"+statisticalResultArr.facilityGap+"处")
$("#positionalDeviation").html("共"+statisticalResultArr.positionalDeviation+"处")
$("#textureMiss").html("共"+statisticalResultArr.textureMiss+"处")
$("#facilityMiss").html("共"+statisticalResultArr.facilityMiss+"处")
$("#facilitySum").html("共"+statisticalResultArr.facilitySum+"台")
$("#note").html(statisticalResultArr.note+"分")
//时间
$("#print_CreationTimedata").html(statisticalResultArr.print_CreationTimedata)
}
//达标率
function percentPass(typeArr) {
if(typeArr!=null&&typeArr!=""){
let typeArrTemp = typeArr.split(";");
let typeArrTempNotrmi=[];
//去除"";
if (typeArrTemp.length>0){
typeArrTemp.forEach((item,index)=>{
if(item!=""&&item!="0"){
typeArrTempNotrmi.push(item);
}
})
}
return parseInt((7-typeArrTempNotrmi.length)/7*100)+"%"
}
return "缺少数据"
}
//统计数值
function statisticalResult(dataArr){
let modelMore=0; //模型冗余
let modelMiss=0; //模型缺失
let aspectInconformity =0; //外观形态差异
let facilityGap=0; //设备连接不紧密
let positionalDeviation=0; //位置偏差
let textureMiss=0; //纹理缺失
let facilityMiss=0; //设备缺失
let facilitySum = dataArr.length;//已校核设备总数
let perfect = 0; //缺陷设备总数
let print_CreationTimedata ="";
let d =new Date();
print_CreationTimedata = d.getFullYear()+"/"+(d.getMonth()+1)+"/"+d.getDate()+"/"+d.getHours()+""+d.getMinutes()
if (dataArr.length>0){
dataArr.forEach((item,index)=>{
if(item.differenceType!=null&&item.differenceType!=""){
let typeArr = item.differenceType.split(";");
let no = 7;
typeArr.forEach((item1,index1)=>{
switch (item1) {
case "1":modelMore++; no--;break;
case "2":modelMiss++; no--;break;
case "3":aspectInconformity++;no--; break;
case "4":facilityGap++; no--;break;
case "5":positionalDeviation++; no--;break;
case "6":textureMiss++; no--;break;
case "7":facilityMiss++; no--;break;
}
})
perfect+=no;
}
})
}
let note = Number((perfect/(dataArr.length*7))*100).toFixed(2)
return {
"modelMore":modelMore,
"modelMiss":modelMiss,
"aspectInconformity":aspectInconformity,
"facilityGap":facilityGap,
"positionalDeviation":positionalDeviation,
"textureMiss":textureMiss,
"facilityMiss":facilityMiss,
"facilitySum":facilitySum,
"note": note,
"print_CreationTimedata":print_CreationTimedata
}
}
/*
* wmh生成报告结束
* */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
package com.huake.demo;
import com.huake.demo.dao.DlxurlMapper;
import com.huake.demo.entity.Dlxurl;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.List;
@SpringBootTest
class DemoApplicationTests {
@Autowired
private DlxurlMapper dlxurlMapper;
@Test
void contextLoads() {
}
}

View File

@ -0,0 +1,41 @@
package com.huake.demo;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
public class HttpClientHelper {
public static String sendPostRequest(String url, String json) {
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpPost post = new HttpPost(url);
post.setHeader("Content-Type", "application/json");
post.setEntity(new StringEntity(json));
try (CloseableHttpResponse response = httpClient.execute(post)) {
String responseBody = EntityUtils.toString(response.getEntity());
return responseBody;
}
} catch (IOException e) {
e.printStackTrace();
return "";
}
}
public static String extractCaptchaResult(String responseBody) throws JSONException {
JSONObject jsonObject = new JSONObject(responseBody);
if (jsonObject.getBoolean("success")) {
return jsonObject.getJSONObject("data").getString("result");
} else {
System.err.println("请求失败: " + jsonObject.getString("message"));
return "";
}
}
}

View File

@ -0,0 +1,112 @@
//package com.huake.demo;
//
//import com.huake.demo.common.CaptchaHandler;
//import com.huake.demo.dao.DlxurlMapper;
//import com.huake.demo.entity.Dlxurl;
//import com.huake.demo.service.dlxurlService;
//import net.lightbody.bmp.BrowserMobProxy;
//import net.lightbody.bmp.BrowserMobProxyServer;
//import net.lightbody.bmp.client.ClientUtil;
//import org.openqa.selenium.By;
//import org.openqa.selenium.JavascriptExecutor;
//import org.openqa.selenium.Proxy;
//import org.openqa.selenium.WebDriver;
//import org.openqa.selenium.WebElement;
//import org.openqa.selenium.chrome.ChromeDriver;
//import org.openqa.selenium.chrome.ChromeOptions;
//import org.openqa.selenium.support.ui.ExpectedConditions;
//import org.openqa.selenium.support.ui.WebDriverWait;
//import io.netty.handler.codec.http.HttpHeaders;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import java.util.List;
//
//public class MultiSiteLoginAutomation {
//
// private static final String CHROME_DRIVER_PATH = "D:\\sc\\chromedriver-win64\\chromedriver.exe";
// private static final int WAIT_TIMEOUT = 10; // seconds
//
// @Autowired
// private dlxurlService dlxurlService;
//
// @Autowired
// private DlxurlMapper dlxurlMapper;
//
// public static void main(String[] args) {
// MultiSiteLoginAutomation automation = new MultiSiteLoginAutomation();
// automation.runAutomation();
// }
//
// public void runAutomation() {
// System.setProperty("webdriver.chrome.driver", CHROME_DRIVER_PATH);
//
// BrowserMobProxy proxy = new BrowserMobProxyServer();
// proxy.start(0);
// Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxy);
//
// ChromeOptions options = new ChromeOptions();
// options.setProxy(seleniumProxy);
//
// WebDriver[] drivers = new WebDriver[3];
// for (int i = 0; i < 3; i++) {
// drivers[i] = new ChromeDriver(options);
// }
//
// List<Dlxurl> dlxurls = dlxurlMapper.selectAll();
// System.out.println("开云链接"+dlxurls.get(0).getKyurl());
// String[] urls = {
// dlxurls.get(0).getKyurl(),
// dlxurls.get(0).getHthurl(),
// dlxurls.get(0).getJyurl()
// };
// String[] emails = {"ky3tg107098", "htg51172", "jy3tg107075"};
// String[] passwords = {"tg666888", "tg666888", "tg666888"};
//
// try {
// proxy.newHar("login");
//
// proxy.addRequestFilter((request, contents, messageInfo) -> {
// String interceptedUrl = messageInfo.getUrl();
// if (interceptedUrl.contains("/agent/api/v1/front/banner") ||
// interceptedUrl.contains("/agent/api/v1/front/getAgentDataVisualList")) {
// HttpHeaders headers = request.headers();
// System.out.println("拦截到请求: " + interceptedUrl);
// System.out.println("X-Api-Token: " + headers.get("X-Api-Token"));
// System.out.println("X-Api-Uuid: " + headers.get("X-Api-Uuid"));
// System.out.println("X-Api-Xxx: " + headers.get("X-Api-Xxx"));
// System.out.println("结束");
// }
// return null;
// });
//
// for (int i = 0; i < 3; i++) {
// loginToSite(drivers[i], urls[i], emails[i], passwords[i]);
// }
// } catch (Exception e) {
// e.printStackTrace();
// } finally {
// for (WebDriver driver : drivers) {
// if (driver != null) driver.quit();
// }
// if (proxy != null) {
// proxy.stop();
// }
// }
// }
//
// private void loginToSite(WebDriver driver, String url, String email, String password) throws InterruptedException {
// WebDriverWait wait = new WebDriverWait(driver, WAIT_TIMEOUT);
// driver.get(url);
// WebElement captchaImage = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("boxModle")));
// String base64Captcha = CaptchaHandler.getBase64FromElement(driver, captchaImage);
// String captchaCode = CaptchaHandler.sendCaptchaRequest(base64Captcha);
// wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input.ant-input[placeholder='用户名']"))).sendKeys(email);
// wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input[type='password']"))).sendKeys(password);
// wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input.ant-input[placeholder='请输入验证码']"))).sendKeys(captchaCode);
// Thread.sleep(1500);
// WebElement finalLoginButton = wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("button.ant-btn.ant-btn-primary")));
// ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", finalLoginButton);
// ((JavascriptExecutor) driver).executeScript("arguments[0].click();", finalLoginButton);
// wait.until(ExpectedConditions.urlContains("/app/home?showWelcome=false"));
// }
//}

View File

@ -0,0 +1,46 @@
#开发环境
server:
port:
28088
#华创接口配置
hcserver:
user: test001
pass: 47ec2dd791e31e2ef2076caf64ed9b3d
guid: 9c7609c1-6cda-47bf-93ae-c364ab61c7fd
url: http://120.26.14.213:8861
#谷元接口配置
#gyserver:
# user:
# pass:
# guid:
# url:
# DataSource
spring:
datasource:
name: druidDataSource
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:localhost:1521:orcl
username: cim
password: cim_123$
filters: stat,wall,log4j,config
max-active: 100
initial-size: 1
max-wait: 60000
min-idle: 1
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM dual
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: true
max-open-prepared-statements: 50
max-pool-prepared-statement-per-connection-size: 20
#日志配置
logging:
config: classpath:logback-spring.xml

View File

@ -0,0 +1,46 @@
#生产环境
server:
port:
28088
#华创接口配置
hcserver:
user: test001
pass: 47ec2dd791e31e2ef2076caf64ed9b3d
guid: 9c7609c1-6cda-47bf-93ae-c364ab61c7fd
url: http://120.26.14.213:8861
#谷元接口配置
#gyserver:
# user:
# pass:
# guid:
# url:
# DataSource
spring:
datasource:
name: druidDataSource
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:localhost:1521:orcl
username: cim
password: cim_123$
filters: stat,wall,log4j,config
max-active: 100
initial-size: 1
max-wait: 60000
min-idle: 1
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM dual
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: true
max-open-prepared-statements: 50
max-pool-prepared-statement-per-connection-size: 20
#日志配置
logging:
config: classpath:logback-spring.xml

View File

@ -0,0 +1,36 @@
#测试环境
server:
port:
80
nginxUrl: http://
# DataSource
spring:
datasource:
name: druidDataSource
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://154.208.207.2:3306/ky_bot?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
username: ky_bot
password: LK6NScKBzMP75n74
filters: stat,wall,log4j,config
max-active: 100
initial-size: 1
max-wait: 60000
min-idle: 1
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 'x'
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: true
max-open-prepared-statements: 50
max-pool-prepared-statement-per-connection-size: 20
#日志配置
logging:
config: classpath:logback-spring.xml

View File

@ -0,0 +1,3 @@
spring:
profiles:
active: test

View File

@ -0,0 +1,4 @@
log4j.rootLogger=DEBUG, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n

View File

@ -0,0 +1,49 @@
<configuration>
<!--定义日志文件的存储地址目录 -->
<!--<property name="LOG_HOME" value="/Users/baikun/Desktop/workplace/河北检修项目new/带权限/overhaul/log/springboot-test07" />-->
<property name="LOG_HOME" value="D://log" />
<!-- %m输出的信息,%p日志级别,%t线程名,%d日期,%c类的全名,%i索引【从数字0开始递增】,,, -->
<!-- appender是configuration的子节点是负责写日志的组件。 -->
<!-- ConsoleAppender把日志输出到控制台 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<!--格式化输出:%d表示日期%thread表示线程名%-5level级别从左显示5个字符宽度%msg日志消息%n是换行符 -->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<!-- RollingFileAppender滚动记录文件先将日志记录到指定文件当符合某个条件时将日志记录到其他文件 -->
<!-- 以下的大概意思是1.先按日期存日志日期变了将前一天的日志文件名重命名为XXX%日期%索引新的日志仍然是sys.log -->
<!-- 2.如果日期没有发生变化但是当前日志的文件大小超过1KB时对当前日志进行分割 重命名-->
<appender name="syslog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${LOG_HOME}/sys.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 活动文件的名字会根据fileNamePattern的值每隔一段时间改变一次 -->
<!-- 文件名log/sys.2017-12-05.0.log -->
<fileNamePattern>${LOG_HOME}/sys.%d.%i.log.zip</fileNamePattern>
<!-- 每产生一个日志文件该日志文件的保存期限为30天 -->
<maxHistory>30</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<!--格式化输出:%d表示日期%thread表示线程名%-5level级别从左显示5个字符宽度%msg日志消息%n是换行符 -->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<!-- 控制台输出日志级别 -->
<root level="info">
<appender-ref ref="STDOUT" />
</root>
<!-- 指定项目中某个包,当有日志操作行为时的日志记录级别 -->
<!-- com.appley为根包也就是只要是发生在这个根包下面的所有日志操作行为的权限都是DEBUG -->
<!-- 级别依次为【从高到低】FATAL > ERROR > WARN > INFO > DEBUG > TRACE -->
<logger name="com.huake.demo" level="DEBUG">
<appender-ref ref="syslog" />
</logger>
</configuration>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huake.demo.dao.DlxMapper">
<resultMap id="BaseResultMap" type="com.huake.demo.entity.Dlx">
<result column="ky" jdbcType="VARCHAR" property="ky" />
<result column="hth" jdbcType="VARCHAR" property="hth" />
<result column="jy" jdbcType="VARCHAR" property="jy" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="password" jdbcType="VARCHAR" property="password" />
</resultMap>
<insert id="insert" parameterType="com.huake.demo.entity.Dlx">
insert into dlx (ky, hth, jy,
user_id, `password`)
values (#{ky,jdbcType=VARCHAR}, #{hth,jdbcType=VARCHAR}, #{jy,jdbcType=VARCHAR},
#{userId,jdbcType=INTEGER}, #{password,jdbcType=VARCHAR})
</insert>
<select id="selectAll" resultMap="BaseResultMap">
select ky, hth, jy, user_id, `password`
from dlx
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select user_id, ky, hth, jy, password
from dlx
where user_id = #{userId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from dlx
where user_id = #{userId,jdbcType=INTEGER}
</delete>
</mapper>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huake.demo.dao.DlxurlMapper">
<resultMap id="BaseResultMap" type="com.huake.demo.entity.Dlxurl">
<result column="kyurl" jdbcType="VARCHAR" property="kyurl" />
<result column="hthurl" jdbcType="VARCHAR" property="hthurl" />
<result column="jyurl" jdbcType="VARCHAR" property="jyurl" />
</resultMap>
<insert id="insert" parameterType="com.huake.demo.entity.Dlxurl">
insert into dlxurl (kyurl, hthurl, jyurl
)
values (#{kyurl,jdbcType=VARCHAR}, #{hthurl,jdbcType=VARCHAR}, #{jyurl,jdbcType=VARCHAR}
)
</insert>
<select id="selectAll" resultMap="BaseResultMap">
select * from dlxurl
</select>
<update id="updateUrl" parameterType="com.huake.demo.entity.Dlxurl">
UPDATE dlxurl
SET kyurl = #{kyurl}, hthurl = #{hthurl}, jyurl = #{jyurl}
</update>
</mapper>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huake.demo.dao.HeadMapper">
<resultMap id="BaseResultMap" type="com.huake.demo.entity.Head">
<result column="Token" jdbcType="VARCHAR" property="token" />
<result column="Uuid" jdbcType="VARCHAR" property="uuid" />
<result column="Xxx" jdbcType="VARCHAR" property="xxx" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="name" jdbcType="VARCHAR" property="name" />
</resultMap>
<insert id="insert" parameterType="com.huake.demo.entity.Head">
insert into head (Token, Uuid, Xxx,
user_id, `name`)
values (#{token,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}, #{xxx,jdbcType=VARCHAR},
#{userId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR})
</insert>
<select id="selectAll" resultMap="BaseResultMap">
select Token, Uuid, Xxx, user_id, `name`
from head
</select>
<select id="getUserById" parameterType="java.lang.Integer" resultType="com.huake.demo.entity.Head">
SELECT * FROM head WHERE user_id = #{userId}
</select>
<update id="updateUser" parameterType="com.huake.demo.entity.Head">
UPDATE head
SET token = #{token}, uuid = #{uuid}, xxx = #{xxx}
WHERE user_id = #{userId} AND name = #{name}
</update>
</mapper>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huake.demo.dao.HeadsMapper">
<resultMap id="BaseResultMap" type="com.huake.demo.entity.Heads">
<result column="Token" jdbcType="VARCHAR" property="token" />
<result column="Uuid" jdbcType="VARCHAR" property="uuid" />
<result column="Xxx" jdbcType="VARCHAR" property="xxx" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="name" jdbcType="VARCHAR" property="name" />
</resultMap>
<insert id="insert" parameterType="com.huake.demo.entity.Heads">
insert into heads (Token, Uuid, Xxx,
user_id, `name`)
values (#{token,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}, #{xxx,jdbcType=VARCHAR},
#{userId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR})
</insert>
<select id="selectAll" resultMap="BaseResultMap">
select Token, Uuid, Xxx, user_id, `name`
from heads
</select>
<select id="getUserById" parameterType="java.lang.Integer" resultType="com.huake.demo.entity.Heads">
SELECT * FROM heads WHERE user_id = #{userId}
</select>
<select id="getName" parameterType="java.lang.String" resultType="com.huake.demo.entity.Heads">
SELECT * FROM heads WHERE name = #{name}
</select>
<update id="updateUser" parameterType="com.huake.demo.entity.Heads">
UPDATE heads
SET token = #{token}, uuid = #{uuid}, xxx = #{xxx}
WHERE user_id = #{userId} AND name = #{name}
</update>
</mapper>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huake.demo.dao.UserMapper">
<resultMap id="BaseResultMap" type="com.huake.demo.entity.User">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="dlxUesr" jdbcType="VARCHAR" property="dlxuesr" />
<result column="dlxPasd" jdbcType="VARCHAR" property="dlxpasd" />
<result column="userID" jdbcType="VARCHAR" property="userid" />
<result column="chatID" jdbcType="VARCHAR" property="chatid" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from user
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.huake.demo.entity.User">
insert into user (id, `name`, dlxUesr,
dlxPasd, userID, chatID
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{dlxuesr,jdbcType=VARCHAR},
#{dlxpasd,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, #{chatid,jdbcType=VARCHAR}
)
</insert>
<update id="updateByPrimaryKey" parameterType="com.huake.demo.entity.User">
update user
set `name` = #{name,jdbcType=VARCHAR},
dlxUesr = #{dlxuesr,jdbcType=VARCHAR},
dlxPasd = #{dlxpasd,jdbcType=VARCHAR},
userID = #{userid,jdbcType=VARCHAR},
chatID = #{chatid,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select id, `name`, dlxUesr, dlxPasd, userID, chatID
from user
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select id, `name`, dlxUesr, dlxPasd, userID, chatID
from user
</select>
</mapper>

View File

@ -0,0 +1,411 @@
input::-webkit-input-placeholder{
color:#585c89;
}
input::-moz-placeholder{ /* Mozilla Firefox 19+ */
color:#585c89;
}
input:-moz-placeholder{ /* Mozilla Firefox 4 to 18 */
color:#585c89;
}
input:-ms-input-placeholder { /* Internet Explorer 10-11 */
color: #585c89;
}
.downLiicon_style{
width:20px;height: 20px;background-color: transparent;
}
.ulStyle_FL{
position: absolute;
top: 25px;
width: 240px;
max-height: 250px;
overflow-x: hidden;
background-color: #15323C;
color: #B1BBBF;
list-style: none;
border:1px solid #53BCCC;
font-size: 13px;
left: 10px;
}
.ulStyle_FL li{
display: flex;
justify-content: flex-start;
box-sizing: border-box;
padding: 3px 5px;
background-color: #102F42;
}
.ulStyle_FL li:hover{
background-color:#0A1E2A;
}
.Ui_Box{
width: 870px;height: 590px;position: absolute;z-index: 999;left: 24%;top: 21%;
/*border: 1px solid #53BBC9;*/
background: url(../img/quejiaobiankuang.png)no-repeat center center;
background-size:100% 100%;
box-sizing: border-box;
padding: 10px;
/*-webkit-box-shadow:#07417a 0 0 10px;-moz-box-shadow:#07417a 0 0 10px;box-shadow:inset 0 0 30px #07417a;*/
/*background-image:-webkit-radial-gradient(250px 250px at 50% 50%,hsla(209,99%,32%,28),hsla(228,100%,0%,0));
background-image:radial-gradient(250px 250px at 50% 50%,hsla(209,99%,32%,28),hsla(228,100%,0%,0))*/
}
.Ui_Box .title{
height: 40px;width: 100%;display: flex;background: radial-gradient(#204e61,transparent);
position: relative;
}
.Ui_Box .title .title_text{
text-align: center;line-height: 40px;flex:1;color: #7ec4d6;font-size: 16px;font-weight: bold;
}
.Ui_Box .title .title_btn_close{
box-sizing: border-box;
padding: 5px 5px;
text-align: center;
display: flex;
justify-content: center;
align-content: center;
background: url(../img/quxiao.png) no-repeat center center;
background-size:100% 100%;
width: 30px;
height: 30px;
position: relative;
left: 10px;
top:-10px ;
}
.Ui_Box .content{
display: flex;height: 530px
}
.Ui_Box .content .title_inner{
height: 30px;
color: #7ec4d6;
}
.Ui_Box .content .foot{
height:50px;display: flex;justify-content: center;align-items: center
}
.Ui_Box .content .foot .foot_btn{
box-sizing: border-box;
padding: 10px 20px;
border:1px solid #1E201C;
border-radius: 5px;
color: #0e1112;
height: 38px;
background: linear-gradient(to top, #0a6886, #14394d);
color: #fff0f6;
display: flex;
justify-content: center;
align-items: center;
}
.content_middle{
flex: 1;background-color:rgba(68,108,119,.7);overflow-x: hidden;color: #f2f4f7;
}
.content_middle table{
width: 100%;border-collapse: collapse;table-layout: fixed;font-size: 14px;
}
.content_middle table input{
background-color: transparent;border: 1px solid #dde0ec;
}
.content_middle table tr:first-child{
text-align: center;
}
.content_middle .th_btn{
margin-left: 10px;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #53BBC9;
border-radius: 5px;
background: linear-gradient(to top, #0a6886, #14394d);
color:#fff0f6;
font-size: 13px;
box-sizing: border-box;
padding: 0px 5px;
}
.content_middle .th_btn:hover{
color: #02dde3;
}
.content_middle .tablecol1{width: 40px}
.content_middle .tablecol3{width: 160px;font-size: 14px;}
.content_middle .tablecol4{width: 150px}
.btn_tongYong{
background: linear-gradient(to top, #0a6886, #14394d);
display: flex;
justify-content: center;
align-items: center;
border:1px solid #37335a;
border-radius: 5px;
color: #fff0f6;
box-sizing: border-box;
padding: 2px 3px;
margin-top: 3px;
font-size: 13px;
}
.btn_tongYong:hover{
background-color: #1E9FFF;
color: #1E9FFF;
}
.classStyle_none{
background-color: rgba(16,69,91,.6);
}
.classStyle_chang{
background-color: rgba(37,194,235,.2);
}
.Generalstyle_background_linear{
background: linear-gradient(to top, #0a6886, #14394d);
}
.shade_rightdown{
box-shadow: 10px 10px 23px -8px rgba(0,0,0,0.75);
-webkit-box-shadow: 10px 10px 23px -8px rgba(0,0,0,0.75);
-moz-box-shadow: 10px 10px 23px -8px rgba(0,0,0,0.75);
}
#baogaoBox {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
background-color: green;
}
#baogaoBox td{
box-sizing: border-box;
padding: 2px;
color: #000;
width: 154px;
}
#baogaoBox .toPdfDown_btnSty{
font-size: 14px;
margin-right: 20px;
color: #fff;
border: 1px solid #FFF;
box-sizing: border-box;
padding: 1px 5px;
border-radius: 5px;
}
.BaoGao_title{
height: 70px;
background-color: #B8CCE4;
display: flex;
font-weight: bold;
font-size: 23px;
line-height: 70px;
justify-content: center;
color: #000;
}
.BaoGao_left_table{
border-bottom: 1px solid #fff!important;
background-color: #4F81BD!important;
height: 40px;
display: flex;
align-items: center;
justify-content: flex-end;
color: #fff!important;
box-sizing: border-box;
padding: 0 10px;
font-weight: bold;
}
.BaoGao_div_left{
justify-content: flex-start;
}
.BaoGao_right_table{
border-bottom: 1px solid #fff;
background-color: #C5D9F1;
height: 40px;
text-align: left;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0 10px;
color: #000!important;
border-bottom: 1px solid #fff!important;
}
.BaoGao_table1{
width: 100%;
table-layout:fixed;
word-break: break-all;
}
.BaoGao_table1 th{
color: #000;
font-weight: bold;
background-color:#918485 ;
border: 1px solid #fff;
border-left: none;
border-top: none;
}
.BaoGao_table1 tr{
text-align: center;
color: #000;
border: 1px solid #fff;
border-left: none;
background-color:#D2CECE ;
}
BaoGao_table1_col1{
width: 5%;
}
BaoGao_table1_col2{
width: 15%;
}
BaoGao_table1_col3{
width: 8%;
}
BaoGao_table1_col4{
width: 15%;
}
BaoGao_table1_col5{
}
.BaoGao_table2{
width: 60%;
table-layout:fixed
}
.BaoGao_table2 td{
border: 1px solid #000;
color: #000;
width: 154px;
}
.BaoGao_table2_col1{
font-weight: bold;
text-align: right;
border-right: none;
border: 1px solid #000;
}
.BaoGao_table2_col2 {
width: 50%;
border: 1px solid #000;
}
.BaoGao_table1_col2{
}
.BaoGao_table3{
width: 100%;
table-layout:fixed
}
.BaoGao_table3 th{
color: #fff;
font-weight: bold;
background-color:#4F81BD ;
border: 1px solid #fff;
border-left: none;
border-top: none;
}
.BaoGao_table3 tr:nth-child(odd){
text-align: center;
color: #000;
border: 1px solid #fff;
border-left: none;
background-color:#fff;
}
.BaoGao_table3 tr:nth-child(even){
text-align: center;
color: #000;
border: 1px solid #fff;
border-left: none;
background-color:#DCE6F1;
}
#toolBox{
}
#tuozhuai{
cursor: move;
position: absolute;
display: flex;
flex-direction: column;
z-index: 9999;
left: 35%;
top: 13%;
width: 500px;
background: url(../img/quejiaobiankuang.png)no-repeat center center;
background-size:100% 100%;
background-color:rgba(0,61,101,.7);
}
#toolBox_close{
width: 20px;
height: 20px;
font-size: 16px;
display: flex;
justify-content: center;
align-content: center;
background: url(../img/quxiao.png)no-repeat center center;
background-size:100% 100%;
}
.toolBtn{}
.toolBtn button{
background: linear-gradient(to top, #0c5a75, #33627b);
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border: 1px solid #37335a;
border-radius: 5px;
color: #fff0f6;
box-sizing: border-box;
padding: 6px 3px;
margin-top: 3px;
font-size: 14px;
}
.toolBtn button:hover{
background: linear-gradient(to top, #2485a5, #3b6e8a);
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border: 1px solid #37335a;
border-radius: 5px;
color: #fff0f6;
box-sizing: border-box;
padding: 6px 3px;
margin-top: 3px;
font-size: 14px;
}
#tip_mouseoverBoxBtn{
width: 20px;
height: 20px;
border-radius: 50%;
background: url(../img/wenhao.png) no-repeat center center;
background-size:70% 70%;
background-color: #365965;
}
.Left_SJ{
width: 0;
height: 0;
border-right: 10px solid cyan;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
}
/*
@media print {
@page {
size: portrait;
margin: 0;
}
body {
margin: 1cm;
}
}*/

View File

@ -0,0 +1,114 @@
<!--
* @Descripttion:
* @version:
* @Author: kun·bai
* @Date: 2020-08-10 16:55:07
* @LastEditors: kun·bai
* @LastEditTime: 2020-08-13 17:55:57
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/main_Ui.css">
<script src="lib/jquery/jquery-1.9.0.js"></script>
</head>
<body>
<button id="takeReport" onclick="show()" style=" /*margin-left: 750px;margin-top: 250px;width: 500px;height: 500px;font-size: 110px;*/">生成报告</button>
<!--生成报告界面-->
<div id="baogaoBox" style="position: absolute;top:0;background-color: rgba(22,22,22,.2);width: 100%;height: 100%;z-index: 999;display: none">
<div style="width: 800px;margin: 0 auto;height: 90%;margin-top:3%;display: flex;flex-direction: column">
<div class="BaoGao_head Generalstyle_background_linear" style="height: 30px;width: 100%;display: flex;justify-content: flex-end;align-items: center">
<!--<div class="toPdfDown_btnSty" onclick="toPdfDown('print_box')">下载PDF</div>-->
<div class="toPdfDown_btnSty" onclick="doPrint()">下载PDF</div>
<div style="font-size: 25px;color: #fff;margin-right: 10px;" onclick="$('#baogaoBox').hide();">x</div>
</div>
<!--以下样式写内联-->
<!--startprintBG-->
<div id="print_box" class="shade_rightdown" style="flex: 1; background-color: #fff;overflow-x:hidden!important;display: flex;flex-direction: column;box-sizing: border-box;padding: 20px">
<div class="BaoGao_title">变(输)电设备数字化设计成果校核报表</div>
<div style="display: flex;margsin-top:20px">
<div style="width: 30%">
<div class="BaoGao_left_table">站 点 名 称:</div>
<div class="BaoGao_left_table">校 核 人 员:</div>
<div class="BaoGao_left_table">校 核 时 间:</div>
<div class="BaoGao_left_table">检 查 编 号:</div>
</div>
<div style="width: 70%">
<div id="print_stationName" class="BaoGao_right_table">赤松变</div>
<div class="BaoGao_right_table">国网运检管控项目组-陈铭宇</div>
<div id="print_CreationTimedata" class="BaoGao_right_table">20210301</div>
<div class="BaoGao_right_table">20210301JL01</div>
</div>
</div>
<div style="display: flex;justify-content: center;margin-top: 20px;flex-direction: column;align-items: center">
<div class="BaoGao_left_table BaoGao_div_left" style="width: 100%">差异统计及得分</div>
<table style="width: 100%;border-collapse:collapse;border-spacing:0px;">
<tr>
<td class="BaoGao_table2_col1">
<div >模型冗余:</div>
</td>
<td class="BaoGao_table2_col2" id="modelMore">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1">
<div> 模型缺失:</div>
</td>
<td class="BaoGao_table2_col2" id="modelMiss">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>外观形态差异:</div></td>
<td class="BaoGao_table2_col2" id="aspectInconformity">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>设备连接不紧密:</div></td>
<td class="BaoGao_table2_col2" id="facilityGap">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>位置偏差:</div></td>
<td class="BaoGao_table2_col2" id="positionalDeviation">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>纹理缺失:</div></td>
<td class="BaoGao_table2_col2" id="textureMiss">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>设备缺失:</div></td>
<td class="BaoGao_table2_col2" id="facilityMiss">共136处</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>已校核设备:</div></td>
<td class="BaoGao_table2_col2" id="facilitySum">145台</td>
</tr>
<tr>
<td class="BaoGao_table2_col1"><div>得分:</div></td>
<td class="BaoGao_table2_col2" id="note">99分</td>
</tr>
</table>
</div>
<div style="margin-top: 20px">
<div class="BaoGao_left_table BaoGao_div_left">矢量化点云校验清单</div>
<table id="cloudCheckList" class="BaoGao_table1">
<tr>
<th class="BaoGao_table1_col1">序号</th>
<th class="BaoGao_table1_col2">设备名称</th>
<th class="BaoGao_table1_col3">设备差异</th>
<th class="BaoGao_table1_col4">达标率</th>
<th class="BaoGao_table1_col5">备注</th>
</tr>
</table>
</div>
</div>
<!--endprintBG-->
</div>
</div>
<!--生成报告界面结束-->
</body>
<script src="js/makeReport.js"></script>
</html>

View File

@ -0,0 +1,189 @@
/*
* wmh 生成报告部分
*
* */
function show(){
$("#baogaoBox").show();
}
//打印
function doPrint() {
let winname,head,bdhtml,sprnstr,eprnstr,prnhtml;
$("html").css("height", "auto");
winname = window.open('', "_blank",'');
head =
'<style>#baogaoBox{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-color:green;}#baogaoBox td{box-sizing:border-box;padding:2px;color:#000;}#baogaoBox .toPdfDown_btnSty{font-size:14px;margin-right:20px;color:#fff;border:1px solid #FFF;box-sizing:border-box;padding:1px 5px;border-radius:5px;}.BaoGao_title{color:#000;height:70px;background-color:#B8CCE4!important;display:flex;font-weight:bold;font-size:23px;line-height:70px;justify-content:center;}.BaoGao_left_table{border-bottom:1px solid #fff!important;background-color:#4F81BD!important;height:40px;display:flex;align-items:center;justify-content:flex-end;color:#fff!important;box-sizing:border-box;padding:0 10px;font-weight:bold;}.BaoGao_div_left{justify-content:flex-start;}.BaoGao_right_table{box-sizing:border-box;padding:0 10px;color:#000!important;border-bottom:1px solid #fff!important;background-color:#C5D9F1!important;height:40px;text-align:left;display:flex;align-items:center;}.BaoGao_table1{table-layout:fixed!important;width: 100%;word-break: break-all;}.BaoGao_table1 th{color:#000!important;font-weight:bold;background-color:#918485!important;border:1px solid #fff;border-left:none;border-top:none;}.BaoGao_table1 tr{text-align:center;color:#000!important;border:1px solid #fff;border-left:none;background-color:#D2CECE!important;}BaoGao_table1_col1{width:5%;}BaoGao_table1_col2{width:15%;}BaoGao_table1_col3{width:8%;}BaoGao_table1_col4{width:15%;}BaoGao_table1_col5{}.BaoGao_table2{width:60%;table-layout:fixed;border-collapse:collapse;border-spacing:0;}.BaoGao_table2 td{border:1px solid #000;}.BaoGao_table2_col1{font-weight:bold;width:50%;border:1px solid #000;}.BaoGao_table2_col1 div{width:150px;text-align:justify;text-align-last:justify;float:right;}.BaoGao_table2_col2{width:50%;border:1px solid #000;text-align: center}.BaoGao_table3{width:100%;table-layout:fixed}.BaoGao_table3 th{color:#fff!important;font-weight:bold;background-color:#4F81BD!important;border:1px solid #fff;border-left:none;border-top:none;}.BaoGao_table3 tr:nth-child(odd){text-align:center;color:#000!important;border:1px solid #fff;border-left:none;background-color:#fff!important;}.BaoGao_table3 tr:nth-child(even){text-align:center;color:#000!important;border:1px solid #fff;border-left:none;background-color:#DCE6F1!important;}.Generalstyle_background_linear{background:linear-gradient(to top,#0a6886,#14394d);}</style>>';
bdhtml=window.document.body.innerHTML;
sprnstr="<!--startprintBG-->";
eprnstr="<!--endprintBG-->";
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+19);
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
winname.document.head.innerHTML=head;
winname.document.body.innerHTML=prnhtml;
winname.print();
$("html").css("height", "100%");
}
$("#takeReport").click(function () {
//通过后台获取数据
$.ajax({
url: "selectAllEquipmentCheck",
type: "post",
dataType: "json",
success: function (result) {
if(result!=""&&result!=null){
addBaogaoList(result);
setstatistical(result);
$("#baogaoBox").show();
}
}
})
})
/*添加list到报表中*/
function addBaogaoList(testList){
//清空报告列表
let indexCloudCheck = 0;
let tabletrLenght = $("#cloudCheckList tr").length;
//console.log(cloudCheckList)
for (var i=tabletrLenght;i>=1;i--){
$("#cloudCheckList tr").eq(i).remove();
}
let htmlstr = "";
if (testList.length>0){
testList.forEach((item,index)=>{
//添加查询出的列表
indexCloudCheck++;
htmlstr += '<tr><td class="BaoGao_table1_col1">'+indexCloudCheck+'</td><td class="BaoGao_table1_col2">'+item.deviceCode+'</td><td class="BaoGao_table1_col3">'+checkType(item.differenceType)+'</td><td class="BaoGao_table1_col4">'+percentPass(item.differenceType)+'</td><td class="BaoGao_table1_col5">'+item.differenceDescribe+'</td></tr>'
})
}
$("#cloudCheckList").append(htmlstr);
}
/*判断list差异类型显示内容*/
function checkType(typeArr){
let typearrStr = "";
let typeArrTemp = "";
if(typeArr!=""&&typeArr!=null) {
typeArrTemp = typeArr.split(";");
typeArrTemp.forEach((item,index)=>{
switch (item) {
case "1":typearrStr += "模型冗余,";break;
case "2":typearrStr += "模型缺失,";break;
case "3":typearrStr += "外观形态差异,";break;
case "4":typearrStr += "设备连接不紧密,";break;
case "5":typearrStr += "位置偏差,";break;
case "6":typearrStr += "纹理缺失,";break;
case "7":typearrStr += "设备缺失,";break;
default:break;
};
})
}
/*console.log(typearrStr)*/
return typearrStr
}
//设置统计
function setstatistical(data) {
let statisticalResultArr = statisticalResult(data)
$("#modelMore").html("共"+statisticalResultArr.modelMore+"处")
$("#modelMiss").html("共"+statisticalResultArr.modelMiss+"处")
$("#aspectInconformity").html("共"+statisticalResultArr.aspectInconformity+"处")
$("#facilityGap").html("共"+statisticalResultArr.facilityGap+"处")
$("#positionalDeviation").html("共"+statisticalResultArr.positionalDeviation+"处")
$("#textureMiss").html("共"+statisticalResultArr.textureMiss+"处")
$("#facilityMiss").html("共"+statisticalResultArr.facilityMiss+"处")
$("#facilitySum").html("共"+statisticalResultArr.facilitySum+"台")
$("#note").html(statisticalResultArr.note+"分")
//时间
$("#print_CreationTimedata").html(statisticalResultArr.print_CreationTimedata)
}
//达标率
function percentPass(typeArr) {
if(typeArr!=null&&typeArr!=""){
let typeArrTemp = typeArr.split(";");
let typeArrTempNotrmi=[];
//去除"";
if (typeArrTemp.length>0){
typeArrTemp.forEach((item,index)=>{
if(item!=""&&item!="0"){
typeArrTempNotrmi.push(item);
}
})
}
return parseInt((7-typeArrTempNotrmi.length)/7*100)+"%"
}
return "缺少数据"
}
//统计数值
function statisticalResult(dataArr){
let modelMore=0; //模型冗余
let modelMiss=0; //模型缺失
let aspectInconformity =0; //外观形态差异
let facilityGap=0; //设备连接不紧密
let positionalDeviation=0; //位置偏差
let textureMiss=0; //纹理缺失
let facilityMiss=0; //设备缺失
let facilitySum = dataArr.length;//已校核设备总数
let perfect = 0; //缺陷设备总数
let print_CreationTimedata ="";
let d =new Date();
print_CreationTimedata = d.getFullYear()+"/"+(d.getMonth()+1)+"/"+d.getDate()+"/"+d.getHours()+""+d.getMinutes()
if (dataArr.length>0){
dataArr.forEach((item,index)=>{
if(item.differenceType!=null&&item.differenceType!=""){
let typeArr = item.differenceType.split(";");
let no = 7;
typeArr.forEach((item1,index1)=>{
switch (item1) {
case "1":modelMore++; no--;break;
case "2":modelMiss++; no--;break;
case "3":aspectInconformity++;no--; break;
case "4":facilityGap++; no--;break;
case "5":positionalDeviation++; no--;break;
case "6":textureMiss++; no--;break;
case "7":facilityMiss++; no--;break;
}
})
perfect+=no;
}
})
}
let note = Number((perfect/(dataArr.length*7))*100).toFixed(2)
return {
"modelMore":modelMore,
"modelMiss":modelMiss,
"aspectInconformity":aspectInconformity,
"facilityGap":facilityGap,
"positionalDeviation":positionalDeviation,
"textureMiss":textureMiss,
"facilityMiss":facilityMiss,
"facilitySum":facilitySum,
"note": note,
"print_CreationTimedata":print_CreationTimedata
}
}
/*
* wmh生成报告结束
* */

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,3 @@
artifactId=demo
groupId=com.huake
version=1.0.0

View File

@ -0,0 +1,42 @@
com\huake\demo\service\impl\UserServiceImpl.class
com\huake\demo\entity\Dlx.class
com\huake\demo\utils\UUIDUtil.class
com\huake\demo\config\RestTemplateConfig.class
com\huake\demo\entity\Head.class
com\huake\demo\task\UpdateTokenTask.class
com\huake\demo\config\WebMvcConfig.class
com\huake\demo\dao\DlxMapper.class
com\huake\demo\entity\User.class
com\huake\demo\common\MultiSiteLoginAutomation$1.class
com\huake\demo\common\HttpResult.class
com\huake\demo\common\HttpStatus.class
com\huake\demo\common\MultiSiteLoginAutomation.class
com\huake\demo\config\DruidConfig.class
com\huake\demo\config\DruidDataSourceProperties.class
com\huake\demo\DemoApplication.class
com\huake\demo\controller\UserController.class
com\huake\demo\service\impl\dlxServiceImpl.class
com\huake\demo\service\dlxurlService.class
com\huake\demo\dao\UserMapper.class
com\huake\demo\config\SwaggerConfig.class
com\huake\demo\common\login.class
com\huake\demo\service\dlxService.class
com\huake\demo\service\headService.class
com\huake\demo\dao\HeadMapper.class
com\huake\demo\entity\Dlxurl.class
com\huake\demo\service\impl\headsServiceImpl.class
com\huake\demo\service\impl\dlxurlServiceImpl.class
com\huake\demo\service\headsService.class
com\huake\demo\entity\Heads.class
com\huake\demo\service\impl\headServiceImpl.class
com\huake\demo\dao\DlxurlMapper.class
com\huake\demo\utils\DataTimeUtil.class
com\huake\demo\generator\MyBatisGeneratorUtil.class
com\huake\demo\config\MybatisConfig.class
com\huake\demo\common\CaptchaHandler.class
com\huake\demo\dao\HeadsMapper.class
com\huake\demo\config\FactoryConfig.class
com\huake\demo\service\IUserService.class
com\huake\demo\service\UserService.class
com\huake\demo\dao\IUserDao.class
com\huake\demo\config\RestTemplateConfig$1.class

View File

@ -0,0 +1,40 @@
D:\java\demo111\src\main\java\com\huake\demo\config\DruidConfig.java
D:\java\demo111\src\main\java\com\huake\demo\common\HttpStatus.java
D:\java\demo111\src\main\java\com\huake\demo\DemoApplication.java
D:\java\demo111\src\main\java\com\huake\demo\dao\HeadsMapper.java
D:\java\demo111\src\main\java\com\huake\demo\utils\DataTimeUtil.java
D:\java\demo111\src\main\java\com\huake\demo\dao\DlxurlMapper.java
D:\java\demo111\src\main\java\com\huake\demo\common\CaptchaHandler.java
D:\java\demo111\src\main\java\com\huake\demo\config\SwaggerConfig.java
D:\java\demo111\src\main\java\com\huake\demo\entity\Heads.java
D:\java\demo111\src\main\java\com\huake\demo\common\login.java
D:\java\demo111\src\main\java\com\huake\demo\entity\Dlxurl.java
D:\java\demo111\src\main\java\com\huake\demo\entity\Head.java
D:\java\demo111\src\main\java\com\huake\demo\service\UserService.java
D:\java\demo111\src\main\java\com\huake\demo\dao\HeadMapper.java
D:\java\demo111\src\main\java\com\huake\demo\entity\Dlx.java
D:\java\demo111\src\main\java\com\huake\demo\config\FactoryConfig.java
D:\java\demo111\src\main\java\com\huake\demo\service\impl\dlxurlServiceImpl.java
D:\java\demo111\src\main\java\com\huake\demo\dao\DlxMapper.java
D:\java\demo111\src\main\java\com\huake\demo\dao\IUserDao.java
D:\java\demo111\src\main\java\com\huake\demo\config\RestTemplateConfig.java
D:\java\demo111\src\main\java\com\huake\demo\service\dlxService.java
D:\java\demo111\src\main\java\com\huake\demo\config\WebMvcConfig.java
D:\java\demo111\src\main\java\com\huake\demo\entity\User.java
D:\java\demo111\src\main\java\com\huake\demo\common\HttpResult.java
D:\java\demo111\src\main\java\com\huake\demo\config\MybatisConfig.java
D:\java\demo111\src\main\java\com\huake\demo\service\impl\headsServiceImpl.java
D:\java\demo111\src\main\java\com\huake\demo\service\headService.java
D:\java\demo111\src\main\java\com\huake\demo\config\DruidDataSourceProperties.java
D:\java\demo111\src\main\java\com\huake\demo\task\UpdateTokenTask.java
D:\java\demo111\src\main\java\com\huake\demo\common\MultiSiteLoginAutomation.java
D:\java\demo111\src\main\java\com\huake\demo\service\impl\headServiceImpl.java
D:\java\demo111\src\main\java\com\huake\demo\service\impl\dlxServiceImpl.java
D:\java\demo111\src\main\java\com\huake\demo\generator\MyBatisGeneratorUtil.java
D:\java\demo111\src\main\java\com\huake\demo\service\impl\UserServiceImpl.java
D:\java\demo111\src\main\java\com\huake\demo\dao\UserMapper.java
D:\java\demo111\src\main\java\com\huake\demo\service\IUserService.java
D:\java\demo111\src\main\java\com\huake\demo\service\dlxurlService.java
D:\java\demo111\src\main\java\com\huake\demo\controller\UserController.java
D:\java\demo111\src\main\java\com\huake\demo\utils\UUIDUtil.java
D:\java\demo111\src\main\java\com\huake\demo\service\headsService.java

View File

@ -0,0 +1,2 @@
com\huake\demo\HttpClientHelper.class
com\huake\demo\DemoApplicationTests.class

View File

@ -0,0 +1,3 @@
D:\java\demo111\src\test\java\com\huake\demo\HttpClientHelper.java
D:\java\demo111\src\test\java\com\huake\demo\DemoApplicationTests.java
D:\java\demo111\src\test\java\com\huake\demo\MultiSiteLoginAutomation.java