From ff57cdbbb8eb3ddebe3e49a9d6b7eeec828f14ce Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期五, 14 七月 2023 12:07:26 +0800 Subject: [PATCH] 删除所有代码 --- /dev/null | 43 ------------------------------------------- 说明.txt | 4 ++-- 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/mvnw b/mvnw deleted file mode 100644 index d2f0ea3..0000000 --- a/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -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.5/maven-wrapper-0.5.5.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.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 "$@" diff --git a/mvnw.cmd b/mvnw.cmd deleted file mode 100644 index b26ab24..0000000 --- a/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@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 http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@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.5/maven-wrapper-0.5.5.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.5/maven-wrapper-0.5.5.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% diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 1d0ffd2..0000000 --- a/pom.xml +++ /dev/null @@ -1,327 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-parent</artifactId> - <version>2.3.3.RELEASE</version> - </parent> - - <packaging>war</packaging> - <groupId>com.yssh</groupId> - <artifactId>yssh</artifactId> - <version>1.0.0</version> - <name>yssh</name> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <java.version>1.8</java.version> - </properties> - - <dependencies> - <!--logback--> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-core</artifactId> - <version>1.1.3</version> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-access</artifactId> - <version>1.1.3</version> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - <version>1.1.3</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.6</version> - </dependency> - <!--log4j--> - <!--dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.17</version> - </dependency--> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-aop</artifactId> - </dependency> - <dependency> - <groupId>mysql</groupId> - <artifactId>mysql-connector-java</artifactId> - </dependency> - <dependency> - <groupId>org.mybatis.spring.boot</groupId> - <artifactId>mybatis-spring-boot-starter</artifactId> - <version>1.3.0</version> - </dependency> - <!--spring-boot--> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> - <!--鎺掗櫎鍐呯疆tomcat瀹瑰櫒锛岃澶栭儴瀹瑰櫒杩愯spring-boot椤圭洰--> - <exclusions> - <exclusion> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-tomcat</artifactId> - </exclusion> - </exclusions> - </dependency> - <!--tomcat--> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-tomcat</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-devtools</artifactId> - <optional>true</optional> - </dependency> - <!--娣诲姞Swagger渚濊禆--> - <!--<dependency> - <groupId>io.springfox</groupId> - <artifactId>springfox-swagger2</artifactId> - <version>2.7.0</version> - </dependency> - <dependency> - <groupId>io.springfox</groupId> - <artifactId>springfox-swagger-ui</artifactId> - <version>2.7.0</version> - </dependency>--> - <!--<dependency> - <groupId>io.springfox</groupId> - <artifactId>springfox-boot-starter</artifactId> - <version>3.0.0</version> - </dependency>--> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-tx</artifactId> - </dependency> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - </dependency> - <dependency> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </dependency> - <dependency> - <groupId>org.openjdk.jol</groupId> - <artifactId>jol-core</artifactId> - <version>0.9</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-test</artifactId> - <exclusions> - <exclusion> - <groupId>org.junit.vintage</groupId> - <artifactId>junit-vintage-engine</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - <version>3.12.0</version> - </dependency> - <dependency> - <groupId>org.apache.maven.surefire</groupId> - <artifactId>surefire-booter</artifactId> - <version>2.22.2</version> - </dependency> - <!--闃块噷杩炴帴姹� --> - <dependency> - <groupId>com.alibaba</groupId> - <artifactId>druid</artifactId> - <version>1.1.10</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-configuration-processor</artifactId> - <optional>true</optional> - </dependency> - <dependency> - <groupId>com.github.biyanwen</groupId> - <artifactId>easycsv</artifactId> - <version>1.0.0</version> - </dependency> - - <dependency> - <groupId>com.github.xiaoymin</groupId> - <artifactId>knife4j-spring-boot-starter</artifactId> - <version>3.0.3</version> - </dependency> - <!-- 浜岀淮绌洪棿璋撹瘝鍜屽嚱鏁扮殑Java API --> - <dependency> - <groupId>org.locationtech.jts</groupId> - <artifactId>jts-core</artifactId> - <version>1.18.2</version> - </dependency> - <!-- geotools渚濊禆 --> - <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt-shapefile</artifactId> - <version>22.0</version> - </dependency> - <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt-main</artifactId> - <version>22.0</version> - </dependency> - <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt-epsg-hsql</artifactId> - <version>22.0</version> - </dependency> - <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt-geotiff</artifactId> - <version>22.0</version> - </dependency> - <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt-geojson</artifactId> - <version>22.0</version> - </dependency> - <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt-api</artifactId> - <version>20.0</version> - </dependency> - <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt-metadata</artifactId> - <version>22.0</version> - </dependency> - <dependency> - <groupId>org.geotools</groupId> - <artifactId>gt-opengis</artifactId> - <version>22.0</version> - <scope>compile</scope> - </dependency> - <!--Caffeine缂撳瓨--> - <dependency> - <groupId>com.github.ben-manes.caffeine</groupId> - <artifactId>caffeine</artifactId> - <version>2.9.3</version> - </dependency> - </dependencies> - - <profiles> - <profile> - <id>test</id> - <properties> - <activatedProperties>test</activatedProperties> - </properties> - </profile> - <profile> - <id>dev</id> - <properties> - <activatedProperties>dev</activatedProperties> - </properties> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - </profile> - <profile> - <id>prod</id> - <properties> - <activatedProperties>prod</activatedProperties> - </properties> - </profile> - </profiles> - <build> - <finalName>yssh</finalName> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-war-plugin</artifactId> - <version>3.0.0</version> - <configuration> - <!--濡傛灉鎯冲湪娌℃湁web.xml鏂囦欢鐨勬儏鍐典笅鏋勫缓WAR锛岃璁剧疆涓篺alse銆� --> - <failOnMissingWebXml>false</failOnMissingWebXml> - </configuration> - </plugin> - <!--<plugin> - <groupId>org.codehaus.cargo</groupId> - <artifactId>cargo-maven2-plugin</artifactId> - <version>1.5.0</version> - <configuration> - <container> - <containerId>tomcat8x</containerId> - <type>remote</type> - <timeout>1200000</timeout> - </container> - <configuration> - <type>runtime</type> - <properties> - <cargo.remote.username>admin</cargo.remote.username> - <cargo.remote.password>terra</cargo.remote.password> - <cargo.remote.uri>http://183.162.245.49:2228/manager/text</cargo.remote.uri> - </properties> - </configuration> - </configuration> - </plugin>--> - </plugins> - </build> - - <repositories> - <repository> - <id>osgeo</id> - <name>OSGeo Release Repository</name> - <url>https://repo.osgeo.org/repository/release/</url> - <snapshots> - <enabled>false</enabled> - </snapshots> - <releases> - <enabled>true</enabled> - </releases> - </repository> - <repository> - <id>osgeo-snapshot</id> - <name>OSGeo Snapshot Repository</name> - <url>https://repo.osgeo.org/repository/snapshot/</url> - <snapshots> - <enabled>true</enabled> - </snapshots> - <releases> - <enabled>false</enabled> - </releases> - </repository> - <repository> - <id>public</id> - <name>aliyun nexus</name> - <url>http://maven.aliyun.com/nexus/content/groups/public/</url> - <releases> - <enabled>true</enabled> - </releases> - </repository> - </repositories> - - <pluginRepositories> - <pluginRepository> - <id>public</id> - <name>aliyun nexus</name> - <url>http://maven.aliyun.com/nexus/content/groups/public/</url> - <releases> - <enabled>true</enabled> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </pluginRepository> - </pluginRepositories> -</project> \ No newline at end of file diff --git a/src/main/java/com/yssh/Application.java b/src/main/java/com/yssh/Application.java deleted file mode 100644 index 90afe18..0000000 --- a/src/main/java/com/yssh/Application.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yssh; - -import java.net.UnknownHostException; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.scheduling.annotation.EnableAsync; -import org.springframework.scheduling.annotation.EnableScheduling; - -import com.yssh.utils.ServletInitializer; - -/** - * @author wMeng - * @ClassName Application - * @Description TODO - * @date 2022/10/30 13:00 - * @Version 1.0 - */ -@SpringBootApplication -@EnableScheduling -@EnableAsync(proxyTargetClass=true) -public class Application extends ServletInitializer { - - public static void main(String[] args) throws UnknownHostException { - SpringApplication.run(Application.class, args); - } -} \ No newline at end of file diff --git a/src/main/java/com/yssh/config/CorsConfig.java b/src/main/java/com/yssh/config/CorsConfig.java deleted file mode 100644 index 5e326a2..0000000 --- a/src/main/java/com/yssh/config/CorsConfig.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.yssh.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.UrlBasedCorsConfigurationSource; -import org.springframework.web.filter.CorsFilter; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; - -/** - * @author wMeng - * @ClassName CorsConfig - * @Description 璺ㄥ煙閰嶇疆 - * @date 2022/10/31 16:42 - * @Version 1.0 - */ -@Configuration -public class CorsConfig extends WebMvcConfigurationSupport { - - @Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE") - .maxAge(3600) - .allowCredentials(true); - } - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - //璁剧疆闈欐�佽祫婧愭槧灏� - registry.addResourceHandler("/backend/**").addResourceLocations("classpath:/backend/"); - registry.addResourceHandler("/front/**").addResourceLocations("classpath:/front/"); - - registry.addResourceHandler("/**").addResourceLocations("classpath:/static/"); - registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/"); - registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); - } - - @Bean - public CorsFilter corsFilter() { - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - CorsConfiguration corsConfiguration = new CorsConfiguration(); - corsConfiguration.addAllowedOrigin("*"); - corsConfiguration.addAllowedHeader("*"); - corsConfiguration.addAllowedMethod("*"); - source.registerCorsConfiguration("/**", corsConfiguration); - return new CorsFilter(source); - } -} diff --git a/src/main/java/com/yssh/config/CsvFilePathConfig.java b/src/main/java/com/yssh/config/CsvFilePathConfig.java deleted file mode 100644 index f309337..0000000 --- a/src/main/java/com/yssh/config/CsvFilePathConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.yssh.config; - -import lombok.Data; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -@Data -@Component -@ConfigurationProperties(prefix = "csv") -public class CsvFilePathConfig { - private String filePath; - - public String getFilePath() { - return filePath; - } - - public void setFilePath(String filePath) { - this.filePath = filePath; - } - - private String vocPath; - - public String getVocPath() { - return vocPath; - } - - public void setVocPath(String vocPath) { - this.vocPath = vocPath; - } -} diff --git a/src/main/java/com/yssh/config/DatFilePathConfig.java b/src/main/java/com/yssh/config/DatFilePathConfig.java deleted file mode 100644 index a422f6d..0000000 --- a/src/main/java/com/yssh/config/DatFilePathConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.yssh.config; - -import lombok.Data; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -@Data -@Component -@ConfigurationProperties(prefix = "dat") -public class DatFilePathConfig { - - private String filePath2d; - private String filePath3d; - - public String getFilePath2d() { - return filePath2d; - } - - public void setFilePath2d(String filePath2d) { - this.filePath2d = filePath2d; - } - - public String getFilePath3d() { - return filePath3d; - } - - public void setFilePath3d(String filePath3d) { - this.filePath3d = filePath3d; - } -} diff --git a/src/main/java/com/yssh/config/Knife4jConfig.java b/src/main/java/com/yssh/config/Knife4jConfig.java deleted file mode 100644 index 5680f35..0000000 --- a/src/main/java/com/yssh/config/Knife4jConfig.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.yssh.config; - -import io.swagger.annotations.ApiOperation; - -import org.springframework.beans.factory.annotation.Value; -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.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; - -import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; - -/** - * @author wMeng - * @ClassName SwaggerConfig - * @Description TODO - * @date 2022/10/31 18:55 - * @Version 1.0 - */ -@Configuration -@EnableKnife4j -public class Knife4jConfig { - - @Value("${knife4j.enabled}") - private boolean enabled; - - /** 璁剧疆璇锋眰鐨勭粺涓�鍓嶇紑 */ - @Value("${knife4j.pathMapping}") - private String pathMapping; - - @Bean - public Docket createRestApi() { - return new Docket(DocumentationType.OAS_30) - // 鏄惁鍚敤Swagger - .enable(enabled) - // 鐢ㄦ潵鍒涘缓璇PI鐨勫熀鏈俊鎭紝灞曠ず鍦ㄦ枃妗g殑椤甸潰涓紙鑷畾涔夊睍绀虹殑淇℃伅锛� - .apiInfo(apiInfo()) - // 鍒嗙粍鍚嶇О - .groupName("鏈嶅姟") - // 璁剧疆鍝簺鎺ュ彛鏆撮湶缁橲wagger灞曠ず - .select() - // 鎵弿鎵�鏈夋湁娉ㄨВ鐨刟pi锛岀敤杩欑鏂瑰紡鏇寸伒娲� - .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) - // 鎵弿鎸囧畾鍖呬腑鐨剆wagger娉ㄨВ - // .apis(RequestHandlerSelectors.basePackage("com.cn.project.tool.swagger")) - // 鎵弿鎵�鏈� .apis(RequestHandlerSelectors.any()) - .paths(PathSelectors.any()) - .build() - /* 璁剧疆瀹夊叏妯″紡锛宻wagger鍙互璁剧疆璁块棶token */ - // .securitySchemes(securitySchemes()) - .pathMapping(pathMapping); - - } - - - private ApiInfo apiInfo() { - return new ApiInfoBuilder() - //鎻忚堪瀛楁鏀寔Markdown璇硶 - .description("鎴戠殑鎺ュ彛娴嬭瘯鏂囨。") - .contact(new Contact("寮犺吘椋�", "http://127.0.0.1:8099/doc.html", "893732661@qq.com")) - .version("2.0.0") - .title("鐕曞北鐭冲寲API鎺ュ彛娴嬭瘯鏂囨。") - .build(); - } -} diff --git a/src/main/java/com/yssh/config/ThreadPoolConfig.java b/src/main/java/com/yssh/config/ThreadPoolConfig.java deleted file mode 100644 index 1a03fbf..0000000 --- a/src/main/java/com/yssh/config/ThreadPoolConfig.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.yssh.config; - -import java.util.concurrent.ThreadPoolExecutor; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.EnableAsync; -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; - -/** - * 绾跨▼姹犻厤缃� - * - * @author tam - **/ -@Configuration -@EnableAsync -public class ThreadPoolConfig { - // 鏍稿績绾跨▼姹犲ぇ灏� - private int corePoolSize = 50; - - // 鏈�澶у彲鍒涘缓鐨勭嚎绋嬫暟 - private int maxPoolSize = 200; - - // 闃熷垪鏈�澶ч暱搴� - private int queueCapacity = 1000; - - // 绾跨▼姹犵淮鎶ょ嚎绋嬫墍鍏佽鐨勭┖闂叉椂闂� - private int keepAliveSeconds = 300; - - //閰嶇疆绾跨▼姹犱腑鐨勭嚎绋嬬殑鍚嶇О鍓嶇紑 - private String threadNamePrefix = "async-importDB-"; - - @Bean(name = "threadPoolTaskExecutor") - public ThreadPoolTaskExecutor threadPoolTaskExecutor() { - ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setMaxPoolSize(maxPoolSize); - executor.setCorePoolSize(corePoolSize); - executor.setQueueCapacity(queueCapacity); - executor.setKeepAliveSeconds(keepAliveSeconds); - executor.setThreadNamePrefix(threadNamePrefix); - // 绾跨▼姹犲鎷掔粷浠诲姟(鏃犵嚎绋嬪彲鐢�)鐨勫鐞嗙瓥鐣� - executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); - return executor; - } - -} diff --git a/src/main/java/com/yssh/controller/AlertConfigController.java b/src/main/java/com/yssh/controller/AlertConfigController.java deleted file mode 100644 index dd29ecd..0000000 --- a/src/main/java/com/yssh/controller/AlertConfigController.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.yssh.controller; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; - -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.yssh.entity.AlertConfig; -import com.yssh.service.IAlertConfigService; -import com.yssh.utils.Result; - -@Api(tags="鍛婅閰嶇疆") -@RestController -@RequestMapping("/config") -@SuppressWarnings("rawtypes") -public class AlertConfigController { - - @Autowired - private IAlertConfigService alertConfigService; - - @ApiOperationSupport(order = 1) - @ApiOperation(value = "鏌ヨ鎵�鏈夊憡璀﹂厤缃暟鎹�", notes = "鏌ヨ鎵�鏈夊憡璀﹂厤缃暟鎹�") - @GetMapping("/all") - public Result getAll(){ - List<AlertConfig> list = alertConfigService.getAll(); - return Result.OK(list); - } - - @ApiOperationSupport(order = 2) - @ApiImplicitParam(name = "id", value = "鍛婅閰嶇疆缂栧彿", required = true, type = "int") - @ApiOperation(value = "鏍规嵁缂栧彿鏌ヨ鍛婅閰嶇疆鏁版嵁璇︽儏", notes = "鏍规嵁缂栧彿鏌ヨ鍛婅閰嶇疆鏁版嵁璇︽儏") - @GetMapping("/query/{id}") - public Result query(@PathVariable("id") Integer id){ - List<AlertConfig> data = alertConfigService.query(id); - return Result.OK(data); - } - - @ApiOperationSupport(order = 3) - @ApiOperation(value = "鏇存柊鍛婅閰嶇疆鏁版嵁", notes = "鏍规嵁鍛婅閰嶇疆缂栧彿淇敼鍛婅閰嶇疆鏁版嵁鍐呭") - @PutMapping - public Result update(@RequestBody AlertConfig config){ - int row = alertConfigService.update(config); - if(row == 0){ - return Result.error("鏇存柊澶辫触"); - } - return Result.OK("鏇存柊鎴愬姛"); - } - - @ApiOperationSupport(order = 4) - @ApiOperation(value = "鏂板鍛婅閰嶇疆鏁版嵁", notes = "鏂板鍛婅閰嶇疆璇︽儏鏁版嵁") - @PostMapping - public Result add(@RequestBody AlertConfig alert){ - int row = alertConfigService.insert(alert); - if(row == 0){ - return Result.error("鏂板澶辫触"); - } - return Result.OK("鏂板鎴愬姛"); - } - - @ApiOperationSupport(order = 5) - @ApiOperation(value = "鍒犻櫎鍛婅閰嶇疆鏁版嵁", notes = "鍒犻櫎鍛婅閰嶇疆璇︽儏鏁版嵁") - @DeleteMapping("/{id}") - public Result delete(@PathVariable Integer id){ - int row = alertConfigService.delete(id); - if(row == 0){ - return Result.error("鍒犻櫎澶辫触"); - } - return Result.OK("鍒犻櫎鎴愬姛"); - } - -} diff --git a/src/main/java/com/yssh/controller/CountController.java b/src/main/java/com/yssh/controller/CountController.java deleted file mode 100644 index 4578d44..0000000 --- a/src/main/java/com/yssh/controller/CountController.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.yssh.controller; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; - -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import com.yssh.service.ICountService; -import com.yssh.utils.Result; - -@Api(tags="缁熻") -@RestController -@RequestMapping("/count") -@SuppressWarnings("rawtypes") -public class CountController { - - @Autowired - private ICountService countService; - - @GetMapping("/accuracy") - @ApiOperation(value = "鏌ヨ鍑嗙‘鐜囩粺璁�", notes = "鏌ヨ鍑嗙‘鐜囩粺璁℃暟鎹紝杩斿洖鍙傛暟涓璮orecastRate涓洪娴嬪噯纭巼锛宲racticalRate涓烘函婧愬噯纭巼") - public Result getAccuracyAvg(){ - Map<String, Double> accuracyAvg = countService.selectAccuracyAvg(); - return Result.OK(accuracyAvg); - } -} diff --git a/src/main/java/com/yssh/controller/EmissionController.java b/src/main/java/com/yssh/controller/EmissionController.java deleted file mode 100644 index 43e5255..0000000 --- a/src/main/java/com/yssh/controller/EmissionController.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.yssh.controller; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; - -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import com.yssh.entity.Emission; -import com.yssh.service.IEmissionService; -import com.yssh.utils.Result; - -/** - * @author lishijia - * @ClassName YsshPfshController - * @Description TODO - * @date 2022/11/24 14:44 - * @Version 1.0 - */ -@Api(tags="鎺掓斁鐐�") -@RestController -@RequestMapping("/emission") -@SuppressWarnings("rawtypes") -public class EmissionController { - - @Autowired - private IEmissionService emissionService; - - @ApiOperation(value = "鍚嶇О鏌ヨ鎺掓斁鏁版嵁", notes = "鏍规嵁鍚嶇О鏌ヨ鎺掓斁璇︾粏淇℃伅") - @ApiImplicitParam(name = "name", value = "鍚嶇О", required = true, type = "String") - @GetMapping("/query/{name}") - public Result query(@PathVariable("name") String name){ - List<Emission> data = emissionService.query(name); - return Result.OK(data); - } - - @ApiOperation(value = "鏌ヨ鎵�鏈夋帓鏀剧偣鏁版嵁", notes = "鏌ヨ鎵�鏈夊巶鍖烘帓鏀剧偣鏁版嵁") - @GetMapping("/getAll") - public Result getAll(){ - List<Emission> list = emissionService.getAll(); - return Result.OK(list); - } - - @PostMapping("/insert") - @ApiOperation("鎻掑叆鏁版嵁") - public Result insert(@RequestBody Emission emission){ - int i = emissionService.insert(emission); - if(i == 0){ - return Result.error("鎻掑叆澶辫触"); - } - return Result.OK("鎻掑叆鎴愬姛"); - } - - @DeleteMapping("/delete/{id}") - @ApiOperation("鍒犻櫎鏁版嵁") - public Result delete(@PathVariable("id") String id){ - int i = emissionService.delete(id); - if(i == 0){ - return Result.error("鍒犻櫎澶辫触"); - } - return Result.OK("鍒犻櫎鎴愬姛"); - } -} diff --git a/src/main/java/com/yssh/controller/ExpPointController.java b/src/main/java/com/yssh/controller/ExpPointController.java deleted file mode 100644 index e2db695..0000000 --- a/src/main/java/com/yssh/controller/ExpPointController.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.yssh.controller; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; - -import java.io.IOException; - -import org.geotools.geojson.geom.GeometryJSON; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import com.yssh.service.IExpPointServer; -import com.yssh.utils.Result; - -@Api(tags="鍕樻帰鐐�") -@RestController -@RequestMapping("/exp") -@SuppressWarnings("rawtypes") -public class ExpPointController { - - @Autowired - private IExpPointServer expPointServer; - - @GetMapping("/list") - @ApiOperation(value = "鑾峰彇鎵�鏈夊嫎鎺㈢偣", notes = "鑾峰彇鎵�鏈夊嫎鎺㈢偣") - public Result getList(){ - GeometryJSON geo = null; - try { - geo = expPointServer.selectList(); - } catch (IOException e) { - e.printStackTrace(); - } - return Result.OK(geo); - } - -} diff --git a/src/main/java/com/yssh/controller/FeedbackController.java b/src/main/java/com/yssh/controller/FeedbackController.java deleted file mode 100644 index d1deeea..0000000 --- a/src/main/java/com/yssh/controller/FeedbackController.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.yssh.controller; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.yssh.service.IFeedbackService; -import com.yssh.utils.Result; - -@Api(tags="婧簮鍙嶉") -@RestController -@RequestMapping("/feedback") -@SuppressWarnings("rawtypes") -public class FeedbackController { - - @Autowired - private IFeedbackService feedbackService; - - @GetMapping("/feedback") - @ApiOperation(value = "婧簮鍙嶉", notes = "杩涜婧簮鍙嶉") - public Result suYuanFeedback( - @RequestParam(value = "id", required = true) Long id, @RequestParam(value = "practicalId", required = true) String practicalId, - @RequestParam(value = "practicalVocsName", required = true) String practicalVocsName, @RequestParam(value = "practicalValue", required = true) double practicalValue){ - return Result.OK(feedbackService.suYuanFeedback(id, practicalId, practicalVocsName, practicalValue)); - } -} diff --git a/src/main/java/com/yssh/controller/ForecastAnalyseController.java b/src/main/java/com/yssh/controller/ForecastAnalyseController.java deleted file mode 100644 index a2ec6f5..0000000 --- a/src/main/java/com/yssh/controller/ForecastAnalyseController.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.yssh.controller; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; - -import java.util.Date; -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.format.annotation.DateTimeFormat; -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 com.yssh.entity.vo.ForecastAnalyseVo; -import com.yssh.service.IForecastAnalyseService; -import com.yssh.utils.Result; - -@Api(tags="棰勬祴鍒嗘瀽") -@RestController -@RequestMapping("/forecast") -@SuppressWarnings("rawtypes") -public class ForecastAnalyseController { - - @Autowired - private IForecastAnalyseService forecastAnalyseService; - - @GetMapping("/forecastAnalyse") - @ApiOperation(value = "鏌ヨ棰勮鍙婂叾瀹為檯鐩戞祴鏁版嵁", notes = "鏍规嵁鎵�閫夌偣浣嶅悕绉板強鍏舵墍閫夋椂闂存锛屾煡璇㈣鐐逛綅鍦ㄦ寚瀹氭椂闂存鍐呯殑鐩戞祴鏁版嵁鍙婂叾棰勬祴鏁版嵁") - public Result getForecastAnalyse( - @RequestParam(value = "name", required = true) String name, - @RequestParam(value = "beginTime", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date beginTime, - @RequestParam(value = "endTime", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime){ - List<ForecastAnalyseVo> list = forecastAnalyseService.getForecastAnalyse(name, beginTime, endTime); - return Result.OK(list); - } -} diff --git a/src/main/java/com/yssh/controller/LocationController.java b/src/main/java/com/yssh/controller/LocationController.java deleted file mode 100644 index f3e727e..0000000 --- a/src/main/java/com/yssh/controller/LocationController.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.yssh.controller; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; - -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.yssh.entity.Location; -import com.yssh.service.ILocationService; -import com.yssh.utils.Result; - -/** - * @author wMeng - * @ClassName YsshLocationController - * @Description YsshLocationController - * @date 2022/10/30 13:21 - * @Version 1.0 - */ -@Api(tags="鍘傚尯鐑偣鐐逛綅") -@RestController -@RequestMapping("/location") -@SuppressWarnings("rawtypes") -public class LocationController { - - @Autowired - private ILocationService locationService; - - @ApiOperation(value = "鏉′欢鏌ヨ鐐逛綅鏁版嵁", notes = "鏍规嵁鍚嶇О鍙婂叾绫诲瀷鏌ヨ鐐逛綅璇︾粏淇℃伅") - @GetMapping("/query") - public Result query( - @RequestParam(value = "name", required = false) String name, - @RequestParam(value = "type", required = true) String type){ - List<Location> data = locationService.query(name, type); - return Result.OK(data); - } - - - @GetMapping("/list") - @ApiOperation(value = "鏌ヨ鎵�鏈夌偣浣嶆暟鎹�", notes = "鏌ヨ鎵�鏈夊巶鍖虹儹鐐圭偣浣嶆暟鎹�") - public Result list(){ - List<Location> list = locationService.getAll(); - return Result.OK(list); - } - - - @ApiOperation(value = "鏂板鐐逛綅鏁版嵁", notes = "鏂板鐐逛綅璇︽儏鏁版嵁") - @PostMapping - public Result insertLocation(@RequestBody Location location){ - int i = locationService.insertLocation(location); - if(i == 0){ - return Result.error("鎻掑叆澶辫触"); - } - return Result.OK("鎻掑叆鎴愬姛"); - } - - @ApiOperation(value = "鍒犻櫎鐐逛綅鏁版嵁", notes = "鍒犻櫎鐐逛綅璇︽儏鏁版嵁") - @DeleteMapping("/{id}") - public Result deleteLocation(@PathVariable String id){ - int i = locationService.deleteLocation(id); - if(i == 0){ - return Result.error("鍒犻櫎澶辫触"); - } - return Result.OK("鍒犻櫎鎴愬姛"); - } -} diff --git a/src/main/java/com/yssh/controller/SuYuanController.java b/src/main/java/com/yssh/controller/SuYuanController.java deleted file mode 100644 index 97e4c73..0000000 --- a/src/main/java/com/yssh/controller/SuYuanController.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.yssh.controller; - -import com.yssh.entity.*; -import com.yssh.service.ICommonService; -import com.yssh.service.VocValsService; -import com.yssh.utils.StringUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.yssh.service.ISuYuanService; -import com.yssh.utils.Result; - -import javax.annotation.Resource; - -/** - * @author lishijia - * @ClassName Yssh2dreliController - * @Description Yssh2dreliController - * @date 2022/12/3 21:21 - * @Version 1.0 - */ -@Api(tags="婧簮淇℃伅") -@RestController -@RequestMapping("/suYuan") -@SuppressWarnings("rawtypes") -public class SuYuanController { - @Resource - private ICommonService commonService; - - @Resource - private ISuYuanService suYuanService; - - @Resource - private VocValsService vocValsService; - - private final static SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHH"); - - @ApiOperation(value = "鏌ヨ2d鐑姏鍥炬暟鎹�", notes = "鏍规嵁鏃堕棿鏌ヨ2d鐑姏鍥炬暟鎹�") - @ApiOperationSupport(order = 1) - @GetMapping("/get2d") - public Result get2d( - @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) { - List<SuYuan2d> list = suYuanService.selectSuYuan2d(date); - return Result.OK(list); - } - - @ApiOperation(value = "鏌ヨ3d鐑姏鍥炬暟鎹�", notes = "鏍规嵁鏃堕棿鏌ヨ3d鐑姏鍥炬暟鎹�") - @ApiOperationSupport(order = 2) - @GetMapping("/get3d") - public Result get3d( - @RequestParam(value = "name", required = true) String name, - @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) { - List<SuYuan3d> list = suYuanService.selectSuYuan3d(name, date); - return Result.OK(list); - } - - @ApiOperation(value = "鏌ヨ婧簮100鐑姏鍥炬暟鎹�", notes = "鏍规嵁鏃堕棿鏌ヨ婧簮100鐑姏鍥炬暟鎹紝result杩斿洖鍊间腑data瀵瑰簲鍊间负鐑姏鍥炬暟鎹紝feedbackId涓哄弽棣堜富閿紪鍙凤紝鍦ㄨ繘琛屽弽棣堜腑闇�瑕佷紶閫�") - @ApiOperationSupport(order = 3) - @GetMapping("/get100") - public Result get100( - @RequestParam(value = "name", required = true) String name, - @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date - ) { - return Result.OK(suYuanService.selectSuYuan100(name, date)); - } - - @ApiOperation(value = "鏌ヨ婧簮200鐑姏鍥炬暟鎹�", notes = "鏍规嵁鏃堕棿鏌ヨ婧簮200鐑姏鍥炬暟鎹紝result杩斿洖鍊间腑data瀵瑰簲鍊间负鐑姏鍥炬暟鎹紝feedbackId涓哄弽棣堜富閿紪鍙凤紝鍦ㄨ繘琛屽弽棣堜腑闇�瑕佷紶閫�") - @ApiOperationSupport(order = 4) - @GetMapping("/get200") - public Result get200( - @RequestParam(value = "name", required = true) String name, - @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date - ) { - return Result.OK(suYuanService.selectSuYuan200(name, date)); - } - - @ApiOperation(value = "鏌ヨ婧簮300鐑姏鍥炬暟鎹�", notes = "鏍规嵁鏃堕棿鏌ヨ婧簮300鐑姏鍥炬暟鎹紝result杩斿洖鍊间腑data瀵瑰簲鍊间负鐑姏鍥炬暟鎹紝feedbackId涓哄弽棣堜富閿紪鍙凤紝鍦ㄨ繘琛屽弽棣堜腑闇�瑕佷紶閫�") - @ApiOperationSupport(order = 5) - @GetMapping("/get300") - public Result get300( - @RequestParam(value = "name", required = true) String name, - @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date - ) { - return Result.OK(suYuanService.selectSuYuan300(name, date)); - } - - @ApiOperation(value = "鏌ヨ婧簮500鐑姏鍥炬暟鎹�", notes = "鏍规嵁鏃堕棿鏌ヨ婧簮500鐑姏鍥炬暟鎹紝result杩斿洖鍊间腑data瀵瑰簲鍊间负鐑姏鍥炬暟鎹紝feedbackId涓哄弽棣堜富閿紪鍙凤紝鍦ㄨ繘琛屽弽棣堜腑闇�瑕佷紶閫�") - @ApiOperationSupport(order = 6) - @GetMapping("/get500") - public Result get500( - @RequestParam(value = "name", required = true) String name, - @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date - ) { - return Result.OK(suYuanService.selectSuYuan500(name, date)); - } - - @ApiOperation(value = "鑾峰彇鎵�鏈夌洃娴嬫暟鎹�", notes = "鑾峰彇鎵�鏈夌洃娴嬫暟鎹�") - @ApiOperationSupport(order = 7) - @GetMapping("/query/{name}") - public Result getMonitorData(@PathVariable("name") String name) { - List<SuYuanMonitorData> list = suYuanService.getMonitorData(name); - return Result.OK(list); - } - - @ApiOperation(value = "鏇存柊Vocs鍚嶇О", notes = "鏇存柊Vocs鍚嶇О") - @ApiOperationSupport(order = 8) - @GetMapping("/updateVocsName") - public Result updateVocsName(@RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date, - @RequestParam(value = "id", required = true) String id, - @RequestParam(value = "vocsName", required = true) String vocsName - ) { - return Result.OK(suYuanService.updateVocsName(date, id, vocsName)); - } - - @ApiOperation(value = "鏍规嵁鍚嶇О鑾峰彇鍧愭爣鍊�", notes = "鏍规嵁鍚嶇О鑾峰彇鍧愭爣鍊�") - @ApiOperationSupport(order = 9) - @GetMapping("/getCoordByName/{name}") - public Result getCoordByName(@PathVariable("name") String name) { - MonitorPointPosition point = StringUtils.isEmpty(name) ? null : commonService.select3dCheckPointByName(name); - - return Result.OK(point); - } - - @ApiOperation(value = "鏍规嵁Qxsh鍊�", notes = "鏍规嵁Qxsh鍊�") - @ApiOperationSupport(order = 10) - @GetMapping("/queryQxsh") - public Result queryQxsh(@RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) { - List<Qxsh> list = suYuanService.queryQxsh(date); - - return Result.OK(list); - } - - @ApiOperation(value = "鏍规嵁鏃堕棿鏌ヨVoc鍊�", notes = "鏍规嵁鏃堕棿鏌ヨVoc鍊�") - @ApiOperationSupport(order = 11) - @GetMapping("/selectVocByTime") - public Result selectVocByTime(@RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) { - List<VocVals> list = vocValsService.selectByTime(format.format(date)); - - return Result.OK(list); - } - - @ApiOperation(value = "鏍规嵁X锛孻鍊兼煡璇㈠湴鍧�", notes = "鏍规嵁X锛孻鍊兼煡璇㈠湴鍧�") - @ApiOperationSupport(order = 12) - @GetMapping("/selectCoords") - public Result selectVocByTime(@RequestParam(value = "x", required = false) Integer x, @RequestParam(value = "y", required = false) Integer y) { - return Result.OK(vocValsService.selectCoords(x, y)); - } - - @ApiOperation(value = "鏍规嵁X銆乊鍊兼煡璇㈢煩褰㈡", notes = "鏍规嵁X銆乊鍊兼煡璇㈢煩褰㈡") - @ApiOperationSupport(order = 13) - @GetMapping("/selectRects") - public Result selectRects(@RequestParam(value = "x[]", required = true) Double[] x, @RequestParam(value = "y[]", required = true) Double[] y) { - if (null == x || null == y || x.length == 0 || x.length != y.length) return Result.OK(null); - - return Result.OK(suYuanService.selectRects(x, y)); - } - - @ApiOperation(value = "鏍规嵁ID鍜屾棩鏈熸煡璇㈡函婧�700琛�", notes = "鏍规嵁ID鍜屾棩鏈熸煡璇㈡函婧�700琛�") - @ApiOperationSupport(order = 14) - @GetMapping("/selectSuYuan700ById") - public Result selectSuYuan700ById(@RequestParam(value = "id", required = true) String id, @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) { - return Result.OK(suYuanService.selectSuYuan700ById(id, date)); - } - - @ApiOperation(value = "鏍规嵁ID鍜屾棩鏈熸煡璇㈡函婧�46琛�", notes = "鏍规嵁ID鍜屾棩鏈熸煡璇㈡函婧�46琛�") - @ApiOperationSupport(order = 15) - @GetMapping("/selectSuYuan46ById") - public Result selectSuYuan46ById(@RequestParam(value = "id", required = true) String id, @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) { - return Result.OK(suYuanService.selectSuYuan46ById(id, date)); - } - - @ApiOperation(value = "鏍规嵁缁忕含搴︽煡璇㈠湴鍚�", notes = "鏍规嵁缁忕含搴︽煡璇㈠湴鍚�") - @ApiOperationSupport(order = 16) - @GetMapping("/selectAddrByXY") - public Result selectAddrByXY(@RequestParam(value = "x", required = true) double x, @RequestParam(value = "y", required = true) double y) { - return Result.OK(suYuanService.selectAddrByXY(x, y)); - } -} diff --git a/src/main/java/com/yssh/controller/WarningAnalyseController.java b/src/main/java/com/yssh/controller/WarningAnalyseController.java deleted file mode 100644 index 4fd7aca..0000000 --- a/src/main/java/com/yssh/controller/WarningAnalyseController.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.yssh.controller; - -import com.yssh.entity.Qxsh; -import com.yssh.utils.CacheUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.format.annotation.DateTimeFormat; -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 com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.yssh.service.IWarningAnalyseService; -import com.yssh.utils.Result; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -@Api(tags = "鍛婅鍒嗘瀽") -@RequestMapping("/warning") -@RestController -@SuppressWarnings("rawtypes") -public class WarningAnalyseController { - - @Autowired - private IWarningAnalyseService warningService; - - private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); - - /** - * 1.鏌ヨ褰撳墠鏃堕棿鐨勬墍鏈夌偣浣峷alue鍊硷紙浠�47.dat鏌ヨ鍗冲彲锛� - * 2.绛涢�夊ぇ浜巠ssh_bjyj涓殑jcbj瀛楁鐨勫�� 杩斿洖id+缁忕含搴�+value - */ - @ApiOperationSupport(order = 1) - @ApiOperation(value = "鑾峰彇瀹炴椂鎶ヨ", notes = "鑾峰彇瀹炴椂鎶ヨ鍒嗘瀽鏁版嵁") - @GetMapping("/runAlarm") - public Result alarmAnalyse() { - return Result.OK(warningService.getRunTimeAlarmAnalyse()); - } - - /** - * 1.鏌ヨ褰撳墠鏃堕棿鐨勬墍鏈夌偣浣峷alue鍊硷紙浠�47.dat鏌ヨ鍗冲彲锛� - * 2.绛涢�夊ぇ浜巠ssh_bjyj涓殑jcyj瀛楁鐨勫�� 杩斿洖id+缁忕含搴�+value - */ - @ApiOperationSupport(order = 2) - @ApiOperation(value = "鑾峰彇瀹炴椂棰勮", notes = "鑾峰彇瀹炴椂棰勮鍒嗘瀽鏁版嵁") - @GetMapping("/runWarning") - public Result warningAnalyse() { - return Result.OK(warningService.getRunTimeWarningAnalyse()); - } - - @ApiOperationSupport(order = 3) - @ApiOperation(value = "鏈湀棰勮銆佹姤璀︾粺璁�", notes = "鏈湀棰勮銆佹姤璀︾粺璁★紝杩斿洖鍙傛暟alarmNumber瀵瑰簲鍊间负鏈湀鎶ヨ鏁版嵁閲忥紝鍙傛暟warningNumber瀵瑰簲鍊间负鏈湀棰勮鏁版嵁閲�") - @GetMapping("/monthCount") - public Result thisMonthCount() { - return Result.OK(warningService.countThisMonthAlarmAndWarning()); - } - - @ApiOperationSupport(order = 4) - @ApiOperation(value = "姣忔棩棰勮銆佹姤璀︽暟閲忓彉鍖栬秼鍔�", notes = "涓�鍛ㄦ瘡鏃ラ璀︺�佹姤璀︽暟閲忕粺璁★紝杩斿洖鍙傛暟alarmDayCount涓轰竴鍛ㄦ瘡鏃ユ姤璀︾粺璁℃暟閲忓垪琛紝鍙傛暟warningDayCount涓轰竴鍛ㄦ瘡鏃ラ璀︾粺璁℃暟閲忓垪琛�") - @GetMapping("/everydayCount") - public Result everydayCount() { - return Result.OK(warningService.countEverydayAlarmAndWarning()); - } - - @ApiOperationSupport(order = 4) - @ApiOperation(value = "涓夊皬鏃剁洃娴嬬珯鐐规暟鎹彉鍖栬秼鍔�", notes = "杩斿洖鍊间负涓夊皬鏃剁洃娴嬬珯鐐圭洃娴嬫暟鎹紝杩斿洖鍊间负map闆嗗悎锛屽叾涓璳ey涓虹珯鐐瑰悕绉帮紝value涓簂ist闆嗗悎锛屼繚瀛樻瘡澶╃洃娴嬫暟鍊兼暟鎹�") - @GetMapping("/locationDataChange") - public Result locationDataChange() { - //return Result.OK(warningService.selectEachLocationDataChange()); - - String key = dateFormat.format(new Date()) + "_local"; - Object obj = CacheUtils.get(key); - Map<String, List<Double>> map; - - //if (null != obj) { - // map = (Map<String, List<Double>>) obj; - //} else { - //map = warningService.selectEachLocationDataChange(); - map = warningService.select3Hours(); - // if (null != map && map.size() > 0) { - // CacheUtils.put(key, map); - // } - //} - - return Result.ok(map); - } - - @ApiOperationSupport(order = 4) - @ApiOperation(value = "鑾峰彇鏈湀鐩戞祴澶ф暟鎹珯鐐规渶澶у�糡OP10", notes = "鑾峰彇鏈湀鐩戞祴澶ф暟鎹珯鐐规渶澶у�糡OP10鏁伴噺鍒楄〃") - @GetMapping("/monthTop10") - public Result monthTop10() { - //return Result.OK(warningService.selectThisMonthLocationValueDataTop10()); - - //String key = dateFormat.format(new Date()) + "_top10"; - //Object obj = CacheUtils.get(key); - List<Qxsh> list; - - //if (null != obj) { - // list = (List<Qxsh>) obj; - //} else { - //list = warningService.selectThisMonthLocationValueDataTop10(); - list = warningService.selectMonthTop10(); - // if (null != list && list.size() > 0) { - // CacheUtils.put(key, list); - // } - //} - - return Result.ok(list); - } - - @ApiOperationSupport(order = 5) - @ApiOperation(value = "鏍规嵁鏃堕棿鑾峰彇鎶ヨ鍜岄璀︿俊鎭�", notes = "鏍规嵁鏃堕棿鑾峰彇鎶ヨ鍜岄璀︿俊鎭�") - @GetMapping("/getAlarmAndWarnByTime") - public Result getAlarmAndWarnByTime( - @RequestParam(value = "begin", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date begin, - @RequestParam(value = "end", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date end) { - if (null == begin || null == end) { - return Result.error(null); - } - - if (begin.getTime() > end.getTime()) { - Date tmp = end; - begin = end; - end = tmp; - } - - return Result.OK(warningService.getAlarmAndWarnByTime(begin, end)); - } -} diff --git a/src/main/java/com/yssh/controller/WeatherController.java b/src/main/java/com/yssh/controller/WeatherController.java deleted file mode 100644 index f84a16a..0000000 --- a/src/main/java/com/yssh/controller/WeatherController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.yssh.controller; - -import com.yssh.entity.Weather; -import com.yssh.service.IWeatherService; -import com.yssh.utils.Result; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * @author wMeng - * @ClassName YsshWeatherController - * @Description TODO - * @date 2022/10/30 13:21 - * @Version 1.0 - */ -@Api(tags="澶╂皵") -@RestController -@RequestMapping("/weather") -@SuppressWarnings("rawtypes") -public class WeatherController { - @Autowired - private IWeatherService weatherService; - - private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH:00:00"); - - @ApiOperation(value = "鏃堕棿鏌ヨ澶╂皵鏁版嵁", notes = "鏍规嵁寮�濮嬫椂闂村強鍏剁粨鏉熸椂闂存煡璇㈠ぉ姘旇缁嗕俊鎭�") - @ApiImplicitParams({ - @ApiImplicitParam(name = "begin", value = "鐐逛綅鍚嶇О", required = true, type = "String"), - @ApiImplicitParam(name = "end", value = "鐐逛綅绫诲瀷", required = true, type = "String"), - }) - @GetMapping("/query/{begin}/{end}") - public Result query(@PathVariable("begin") String begin, @PathVariable("end") String end) { - List<Weather> data = new ArrayList<>(); - try { - if (null != begin && begin.length() != 19) { - begin = null; - } - if (null != end && end.length() != 19) { - end = null; - } - if (null == begin && null == end) { - begin = dateFormat.format(new Date()); - } - - data = weatherService.query(begin, end); - } catch (Exception e) { - return Result.error(e.getMessage()); - } - return Result.OK(data); - } - - @GetMapping("/getAll") - @ApiOperation(value = "鏌ヨ鎵�鏈夊ぉ姘旀暟鎹�", notes = "鏌ヨ鎵�鏈夊ぉ姘旇缁嗘暟鎹�") - public Result getAll() { - List<Weather> list = weatherService.getAll(); - return Result.OK(list); - } - - @PostMapping("/insert") - @ApiOperation("鎻掑叆鏁版嵁") - public Result insert(@RequestBody Weather ysshWeather) { - int i = weatherService.insert(ysshWeather); - if (i == 0) { - return Result.error("鎻掑叆澶辫触"); - } - return Result.OK("鎻掑叆鎴愬姛"); - } - - @ApiOperation("鍒犻櫎鏁版嵁") - @ApiImplicitParam(name = "id", value = "缂栧彿", required = true, type = "String") - @DeleteMapping("/delete/{id}") - public Result delete(@PathVariable("id") String id) { - int i = weatherService.delete(id); - if (i == 0) { - return Result.error("鍒犻櫎澶辫触"); - } - return Result.OK("鍒犻櫎鎴愬姛"); - } -} diff --git a/src/main/java/com/yssh/dao/AlertConfigMapper.java b/src/main/java/com/yssh/dao/AlertConfigMapper.java deleted file mode 100644 index e02d17d..0000000 --- a/src/main/java/com/yssh/dao/AlertConfigMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.yssh.dao; - -import java.util.List; - -import org.apache.ibatis.annotations.Mapper; - -import com.yssh.entity.AlertConfig; - -@Mapper -public interface AlertConfigMapper { - - List<AlertConfig> query(Integer id); - - List<AlertConfig> getAll(); - - String getAlert(); - - int update(AlertConfig alert); - - int insert(AlertConfig alert); - - int delete(Integer id); - -} diff --git a/src/main/java/com/yssh/dao/BaseMapper.java b/src/main/java/com/yssh/dao/BaseMapper.java deleted file mode 100644 index 908b5e6..0000000 --- a/src/main/java/com/yssh/dao/BaseMapper.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.yssh.dao; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; - - -public interface BaseMapper { - - <T> int batchInsert(@Param("tableName") String tableName, @Param("datas") List<T> datas); -} diff --git a/src/main/java/com/yssh/dao/CommonMapper.java b/src/main/java/com/yssh/dao/CommonMapper.java deleted file mode 100644 index 6fe47ea..0000000 --- a/src/main/java/com/yssh/dao/CommonMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.yssh.dao; - -import java.util.Map; - -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -/** - * @ClassName: CommonMapper - * @Description: 閫氱敤鐨刴apper - * @author zhangtengfei - * @date 2023骞�2鏈�27鏃ヤ笅鍗�2:27:55 - */ -@Mapper -public interface CommonMapper{ - - /** - * 浣跨敤information_schema妫�鏌ヨ〃鏄惁瀛樺湪 - * @param tableSchema - * @param tableName - * @return - */ - Integer checkTableExistsWithSchema(@Param("tableSchema")String tableSchema, @Param("tableName")String tableName); - - /** - * 浣跨敤show tables妫�鏌ヨ〃鏄惁瀛樺湪 - * @param tableName - * @return - */ - Map<String, String> checkTableExistsWithShow(@Param("tableName")String tableName); -} diff --git a/src/main/java/com/yssh/dao/DictRecordMapper.java b/src/main/java/com/yssh/dao/DictRecordMapper.java deleted file mode 100644 index 98a86c7..0000000 --- a/src/main/java/com/yssh/dao/DictRecordMapper.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.yssh.dao; - -import java.util.List; - -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import com.yssh.entity.DictRecord; - -/** - * 瀛楀吀璁板綍Mapper鎺ュ彛 - * - * @author xingjinshuang@smartearth.cn - * @date 2023-02-06 - */ -@Mapper -public interface DictRecordMapper { - - /** - * 鏌ヨ瀛楀吀璁板綍鍒楄〃 - * @param dictRecord 瀛楀吀璁板綍 - * @return 瀛楀吀璁板綍闆嗗悎 - */ - public List<DictRecord> selectDictRecordList(DictRecord dictRecord); - - public List<DictRecord> selectByTimeDictRecordList(@Param("startTime") Long startTime, @Param("endTime") Long endTime); - - public DictRecord selectByCreateTime(Long createTime); - - public List<DictRecord> selectByTime(String start, String end); - - /** - * 鏂板瀛楀吀璁板綍 - * @param dictRecord 瀛楀吀璁板綍 - * @return 缁撴灉 - */ - public int insertDictRecord(DictRecord dictRecord); - - /** - * 鍒犻櫎瀛楀吀璁板綍 - * @param id 瀛楀吀璁板綍ID - * @return 缁撴灉 - */ - public int deleteDictRecordById(Long id); - - /** - * 鎵归噺鍒犻櫎瀛楀吀璁板綍 - * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID - * @return 缁撴灉 - */ - public int deleteDictRecordByIds(Long[] ids); - - /** - * 鍒涘缓瀛楀吀璁板綍琛ㄦ帴鍙� - */ - public int createDictRecoTable(); - -} \ No newline at end of file diff --git a/src/main/java/com/yssh/dao/EmissionMapper.java b/src/main/java/com/yssh/dao/EmissionMapper.java deleted file mode 100644 index 8ee4b67..0000000 --- a/src/main/java/com/yssh/dao/EmissionMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yssh.dao; - -import java.util.List; - -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import com.yssh.entity.Emission; - -/** - * @author wMeng - * @ClassName YsshQxshMapper - * @Description TODO - * @date 2022/10/31 14:45 - * @Version 1.0 - */ -@Mapper -public interface EmissionMapper { - List<Emission> query(@Param("name") String name); - List<Emission> getAll(); - int insert(Emission emission); - int delete(String id); -} diff --git a/src/main/java/com/yssh/dao/ExpPointMapper.java b/src/main/java/com/yssh/dao/ExpPointMapper.java deleted file mode 100644 index c54747e..0000000 --- a/src/main/java/com/yssh/dao/ExpPointMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.yssh.dao; - -import java.util.List; - -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import com.yssh.entity.ExpPoint; - -@Mapper -public interface ExpPointMapper { - - List<ExpPoint> selectList(); - - List<ExpPoint> selectByExpSiteNumbers(@Param("expSiteNumbers") List<String> expSiteNumbers); -} diff --git a/src/main/java/com/yssh/dao/FeedbackMapper.java b/src/main/java/com/yssh/dao/FeedbackMapper.java deleted file mode 100644 index b8e3805..0000000 --- a/src/main/java/com/yssh/dao/FeedbackMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.yssh.dao; - -import org.apache.ibatis.annotations.Mapper; - -import com.yssh.entity.FeedbackDetail; - -@Mapper -public interface FeedbackMapper { - - int insert(FeedbackDetail feedbackDetail); - - FeedbackDetail selectById(Long id); - - int update(FeedbackDetail feedbackDetail); - - Double selectSevenDayAccuracyAvg(Long beginTime); -} diff --git a/src/main/java/com/yssh/dao/LocationMapper.java b/src/main/java/com/yssh/dao/LocationMapper.java deleted file mode 100644 index 35f1fd4..0000000 --- a/src/main/java/com/yssh/dao/LocationMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yssh.dao; - -import com.yssh.entity.Location; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * @author wMeng - * @date 2022/10/30 13:37 - * @version 1.0 - */ -@Mapper -public interface LocationMapper { - List<Location> query(@Param("name") String name, @Param("type") String type); - - List<Location> getAll(); - - int insertLocation(Location ysshLocation); - - int deleteLocation(String id); - - List<Location> selectByXY(@Param("x") double x, @Param("y") double y); - - List<Location> selectVocAddrs(); -} diff --git a/src/main/java/com/yssh/dao/QxshMapper.java b/src/main/java/com/yssh/dao/QxshMapper.java deleted file mode 100644 index e658653..0000000 --- a/src/main/java/com/yssh/dao/QxshMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.yssh.dao; - -import com.yssh.entity.Qxsh; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * @author WWW - * @date 2023-05-18 - * QxshMapper - */ -@Mapper -public interface QxshMapper { - public List<Qxsh> selectByTime(String time); - - public List<Qxsh> selectMonthTop10(String time); - - public List<Qxsh> select3Hours(@Param("times") List<String> times); -} diff --git a/src/main/java/com/yssh/dao/StratumMapper.java b/src/main/java/com/yssh/dao/StratumMapper.java deleted file mode 100644 index da23b5b..0000000 --- a/src/main/java/com/yssh/dao/StratumMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.yssh.dao; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import com.yssh.entity.Stratum; - -@Mapper -public interface StratumMapper { - - //@Param("expSiteNumber") String expSiteNumber, @Param("begin") Integer begin, @Param("end") Integer end - List<Stratum> select(Map<String, Object> param); - - List<Stratum> selectByExpSiteNumbers(@Param("expSiteNumbers") List<String> expSiteNumbers); - - //@Param("expSiteNumber") String expSiteNumber, @Param("geotechnicalName") String geotechnicalName - Stratum selectByGeotechnicalName(Map<String, Object> param); -} diff --git a/src/main/java/com/yssh/dao/SuYuanMapper.java b/src/main/java/com/yssh/dao/SuYuanMapper.java deleted file mode 100644 index 1127982..0000000 --- a/src/main/java/com/yssh/dao/SuYuanMapper.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.yssh.dao; - -import java.util.List; -import java.util.Map; - -import com.yssh.entity.*; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -@Mapper -public interface SuYuanMapper extends BaseMapper { - Integer isTableExists(String tableName); - - int createTable(@Param("tableName") String tableName); - - List<SuYuan2d> get2d(@Param("tableName") String tableName, @Param("ids") List<String> ids); - - List<SuYuan3d> get3d(@Param("tableName") String tableName, @Param("ids") List<String> ids); - - List<DistanceSuYuan> getDistanceSuYuan(@Param("tableName") String tableName, @Param("ids") List<String> ids); - - DistanceSuYuan getSuYuan500Max(@Param("tableName") String tableName, @Param("ids") List<String> ids); - - DistanceSuYuan getSuYuanById(@Param("tableName") String tableName, @Param("id") String id); - - List<Temporary> getTemporary(@Param("tableName") String tableName, @Param("ids") List<String> ids); - - int update(@Param("tableName") String tableName, @Param("id") String id, @Param("value") String value); - - List<SuYuan2d> getAlarmsAnalyse(@Param("tableName") String tableName, @Param("ids") List<String> ids); - - List<SuYuan2d> getWarningAnalyse(@Param("tableName") String tableName, @Param("ids") List<String> ids); - - List<SuYuanMonitorData> getMonitorData(@Param("tableNames") List<String> tableNames, @Param("id") String id); - - List<SuYuanMonitorData> getNewMonitorData(String name, String start, String end); - - //鑾峰彇鏈湀鎸囧畾鐩戞祴绔欑偣鐩戞祴鍊煎澶х殑鏁版嵁 - Map<String, Object> getMonthValueDataMax(@Param("tableNames") List<String> tableNames, @Param("id") String id); - - int updateVocsName(String table, String id, String vocsName); - - SuYuan700 selectSuYuan700ById(@Param("id") String id, @Param("time") String time); - - SuYuan700 selectSuYuan46ById(@Param("id") String id, @Param("time") String time); -} diff --git a/src/main/java/com/yssh/dao/ThuAccuracyMapper.java b/src/main/java/com/yssh/dao/ThuAccuracyMapper.java deleted file mode 100644 index 75d7253..0000000 --- a/src/main/java/com/yssh/dao/ThuAccuracyMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yssh.dao; - - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.annotations.Mapper; - -import com.yssh.entity.ThuAccuracy; - -@Mapper -public interface ThuAccuracyMapper { - - //鏌ヨ杩囧幓涓冨ぉ绮剧‘骞冲潎鍊肩粺璁� - public Double selectSevenDayAccuracyAvg(Long beginTime); - - public List<ThuAccuracy> getForecastData(Map<String, Object> map); -} diff --git a/src/main/java/com/yssh/dao/VocValsMapper.java b/src/main/java/com/yssh/dao/VocValsMapper.java deleted file mode 100644 index e870c8b..0000000 --- a/src/main/java/com/yssh/dao/VocValsMapper.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.yssh.dao; - -import com.yssh.entity.VocCoords; -import com.yssh.entity.VocVals; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Voc鍊糓apper鎺ュ彛 - * @author WWW - * @date 2023-06-05 - */ -@Mapper -public interface VocValsMapper { - /** - * 鏍规嵁鏃堕棿鏌ヨ - * - * @param time 鏃堕棿锛堢ず渚嬶細2023060514锛� - * @return - */ - public List<VocVals> selectByTime(@Param("time") String time); - - /** - * 鏍规嵁鏃堕棿缁熻 - * - * @param time 鏃堕棿锛堢ず渚嬶細2023060514锛� - * @return 琛屾暟 - */ - public int countByTime(@Param("time") String time); - - /** - * 鏍规嵁X锛孻鍊兼煡璇㈠湴鍧� - * - * @param x X鍊� - * @param y Y鍊� - * @return 鍦板潃 - */ - public List<VocCoords> selectCoords(@Param("x") Integer x, @Param("y") Integer y); - - /** - * 鎻掑叆涓�鏉℃暟鎹� - * - * @param vv Voc瀹炰綋绫� - * @return 褰卞搷琛屾暟 - */ - public int insert(VocVals vv); - - /** - * 鎻掑叆澶氭潯鏁版嵁 - * - * @param list Voc闆嗗悎 - * @return 褰卞搷琛屾暟 - */ - public int inserts(List<VocVals> list); - - /** - * 鍒犻櫎鍘诲勾鐨勬暟鎹� - * - * @return 褰卞搷琛屾暟 - */ - public int deleteLastYear(); - - /** - * 鏍规嵁鏃堕棿鍒犻櫎鏁版嵁 - * - * @param time 鏃堕棿锛堢ず渚嬶細2023060514锛� - * @return 褰卞搷琛屾暟 - */ - public int deleteByTime(@Param("time") String time); -} diff --git a/src/main/java/com/yssh/dao/WarningDetailMapper.java b/src/main/java/com/yssh/dao/WarningDetailMapper.java deleted file mode 100644 index bcc2118..0000000 --- a/src/main/java/com/yssh/dao/WarningDetailMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yssh.dao; - -import java.util.List; -import java.util.Map; - -import com.yssh.entity.WarningDetail; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import com.yssh.entity.vo.WarningVo; - -@Mapper -public interface WarningDetailMapper extends BaseMapper { - - //List<WarningVo> getRunTimeAlarmAnalyse(); - - //@Param("startTime") Date startTime, - List<WarningVo> selectWarningDetailByType(@Param("type") Integer type); - - List<WarningVo> selectWarningDetailByMap(Map<String, Object> param); - - List<Map<String, Object>> selectWarningDayCountByMap(Map<String, Object> param); - - List<WarningDetail> selectByTime(@Param("startTime") String startTime, @Param("endTime") String endTime); - - List<WarningDetail> selectByTimeForYj(@Param("startTime") String startTime, @Param("endTime") String endTime); - - List<WarningDetail> selectByTimeForBj(@Param("startTime") String startTime, @Param("endTime") String endTime); - - Double getLastYearVal(@Param("id") long id); - - Integer countWarnByMap(Map<String, Object> param); - - Integer countAlarmByMap(Map<String, Object> param); -} diff --git a/src/main/java/com/yssh/dao/WeatherMapper.java b/src/main/java/com/yssh/dao/WeatherMapper.java deleted file mode 100644 index e32f3e2..0000000 --- a/src/main/java/com/yssh/dao/WeatherMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yssh.dao; - -import com.yssh.entity.Weather; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * @author wMeng - * @ClassName YsshWeatherMapper - * @Description TODO - * @date 2022/10/30 14:16 - * @Version 1.0 - */ -@Mapper -public interface WeatherMapper { - List<Weather> query(@Param("begin") String begin,@Param("end") String end); - List<Weather> getAll(); - int insert(Weather weather); - int delete(String id); -} diff --git a/src/main/java/com/yssh/entity/AlertConfig.java b/src/main/java/com/yssh/entity/AlertConfig.java deleted file mode 100644 index c97f7a4..0000000 --- a/src/main/java/com/yssh/entity/AlertConfig.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.yssh.entity; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.ToString; - -@ApiModel(value = "鍛婅閰嶇疆鏁版嵁",description = "鍛婅閰嶇疆鏁版嵁") -@NoArgsConstructor -@AllArgsConstructor -@ToString -@Data -public class AlertConfig implements Serializable{ - - private static final long serialVersionUID = -7332928315187861105L; - @ApiModelProperty(value = "涓婚敭") - private Integer id; - @ApiModelProperty(value = "鐩戞祴棰勮鍊�") - private Double jcyj; - @ApiModelProperty(value = "鐩戞祴鎶ヨ鍊�") - private Double jcbj; - @ApiModelProperty(value = "鎺掓斁棰勮鍊�") - private Double pfyj; - @ApiModelProperty(value = "鎺掓斁鎶ヨ鍊�") - private Double pfbj; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Double getJcyj() { - return jcyj; - } - - public void setJcyj(Double jcyj) { - this.jcyj = jcyj; - } - - public Double getJcbj() { - return jcbj; - } - - public void setJcbj(Double jcbj) { - this.jcbj = jcbj; - } - - public Double getPfyj() { - return pfyj; - } - - public void setPfyj(Double pfyj) { - this.pfyj = pfyj; - } - - public Double getPfbj() { - return pfbj; - } - - public void setPfbj(Double pfbj) { - this.pfbj = pfbj; - } -} diff --git a/src/main/java/com/yssh/entity/Coordinate.java b/src/main/java/com/yssh/entity/Coordinate.java deleted file mode 100644 index 988cf4d..0000000 --- a/src/main/java/com/yssh/entity/Coordinate.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.yssh.entity; - -/** - * 鍧愭爣 - * @author WWW - * @date 2023-06-18 - */ -public class Coordinate { - private double x; - - private double y; - - public Coordinate() { - } - - public Coordinate(double x, double y) { - this.x = x; - this.y = y; - } - - public double getX() { - return x; - } - - public void setX(double x) { - this.x = x; - } - - public double getY() { - return y; - } - - public void setY(double y) { - this.y = y; - } -} diff --git a/src/main/java/com/yssh/entity/DictRecord.java b/src/main/java/com/yssh/entity/DictRecord.java deleted file mode 100644 index 53f7c5b..0000000 --- a/src/main/java/com/yssh/entity/DictRecord.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.yssh.entity; - -import java.io.Serializable; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.ToString; - -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; - -/** - * 瀛楀吀璁板綍瀵硅薄 yssh_dict_record - * - * @author xingjinshuang@smartearth.cn - * @date 2023-02-06 - */ -//@NoArgsConstructor -//@AllArgsConstructor -@ToString -@Data -public class DictRecord implements Serializable { - /** - * @Fields field:field:{todo}(鐢ㄤ竴鍙ヨ瘽鎻忚堪杩欎釜鍙橀噺琛ㄧず浠�涔�) - */ - private static final long serialVersionUID = -3279329060924610189L; - - /** - * ID - */ - @JsonSerialize(using = ToStringSerializer.class) - private Long id; - - /** - * 琛ㄥ悕绉� - */ - private String tableName; - - /** - * 鍒涘缓鏃堕棿 - */ - private Long createTime; - - /** - * 澶囨敞 - */ - private String remarks; - - public DictRecord() { - } - - public DictRecord(Long id, String tableName, Long createTime, String remarks) { - this.id = id; - this.tableName = tableName; - this.createTime = createTime; - this.remarks = remarks; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getTableName() { - return tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public String getRemarks() { - return remarks; - } - - public void setRemarks(String remarks) { - this.remarks = remarks; - } -} diff --git a/src/main/java/com/yssh/entity/DistanceSuYuan.java b/src/main/java/com/yssh/entity/DistanceSuYuan.java deleted file mode 100644 index 66833f8..0000000 --- a/src/main/java/com/yssh/entity/DistanceSuYuan.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.yssh.entity; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.math.RoundingMode; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.yssh.utils.CalculateUtils; - -import lombok.AllArgsConstructor; -import lombok.NoArgsConstructor; -import lombok.ToString; - -@NoArgsConstructor -@AllArgsConstructor -@ToString -@SuppressWarnings("unused") -public class DistanceSuYuan implements Serializable, Comparable<DistanceSuYuan>{ - - private static final long serialVersionUID = -115407591473808022L; - private String name;//ai-01 - private String vocsName;//ai-01-001 - private double vocsValue;// - - private String id; - @JsonIgnore - private Integer x; - @JsonIgnore - private Integer y; - @JsonIgnore - private double u; - @JsonIgnore - private double v; - - private double windSpeed; - private double windDirection; - private double lon; - private double lat; - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public Integer getX() { - return x; - } - public void setX(Integer x) { - this.x = x; - } - public Integer getY() { - return y; - } - public void setY(Integer y) { - this.y = y; - } - public double getLon() { - return CalculateUtils.getLon(x, y); - } - - public double getLat() { - return CalculateUtils.getLat(x, y); - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public String getVocsName() { - return vocsName; - } - public void setVocsName(String vocsName) { - this.vocsName = vocsName; - } - public double getVocsValue() { - return vocsValue; - } - public void setVocsValue(double vocsValue) { - this.vocsValue = vocsValue; - } - public void setU(double u) { - this.u = u; - } - public void setV(double v) { - this.v = v; - } - public double getWindSpeed() { - return new BigDecimal(CalculateUtils.getWindSpeed(v, u)).setScale(2, RoundingMode.HALF_UP).doubleValue(); - } - public double getWindDirection() { - return new BigDecimal(CalculateUtils.getWindDirection(v, u)).setScale(2, RoundingMode.HALF_UP).doubleValue(); - } - @Override - public int compareTo(DistanceSuYuan o) { - if (vocsValue > o.getVocsValue()) { - return -1; - }else if(vocsValue == o.getVocsValue()){ - return 0; - } - return 1; - } - - public double getU() { - return u; - } - - public double getV() { - return v; - } - - public void setWindSpeed(double windSpeed) { - this.windSpeed = windSpeed; - } - - public void setWindDirection(double windDirection) { - this.windDirection = windDirection; - } - - public void setLon(double lon) { - this.lon = lon; - } - - public void setLat(double lat) { - this.lat = lat; - } -} diff --git a/src/main/java/com/yssh/entity/Emission.java b/src/main/java/com/yssh/entity/Emission.java deleted file mode 100644 index 9cd5e8e..0000000 --- a/src/main/java/com/yssh/entity/Emission.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.yssh.entity; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@Data -@ApiModel(value = "鎺掓斁鐐圭偣浣�",description = "鎺掓斁鐐圭偣浣�") -public class Emission implements Serializable{ - - private static final long serialVersionUID = -6398611940241117240L; - - @ApiModelProperty(value = "涓婚敭") - private int id; - @ApiModelProperty(value = "鐐逛綅鍚嶇О") - private String name; - @ApiModelProperty(value = "缁忓害") - private double lon; - @ApiModelProperty(value = "绾害") - private float lat; - @ApiModelProperty(value = "鏁板��") - private String value; - @ApiModelProperty(value = "鏃堕棿") - private String time; - @ApiModelProperty(value = "鐘舵�佸��") - private int property; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public double getLon() { - return lon; - } - - public void setLon(double lon) { - this.lon = lon; - } - - public float getLat() { - return lat; - } - - public void setLat(float lat) { - this.lat = lat; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getTime() { - return time; - } - - public void setTime(String time) { - this.time = time; - } - - public int getProperty() { - return property; - } - - public void setProperty(int property) { - this.property = property; - } -} diff --git a/src/main/java/com/yssh/entity/ExpPoint.java b/src/main/java/com/yssh/entity/ExpPoint.java deleted file mode 100644 index bfea555..0000000 --- a/src/main/java/com/yssh/entity/ExpPoint.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.yssh.entity; - -import java.util.Date; - -import lombok.Data; - -@Data -public class ExpPoint { - private Long id; - private String expSiteNumber; - private String expPointType; - private double ordinateX; - private double abscissaY; - private double elevation; - private double explorationDepth; - private Date expStartDate; - private Date expEndDate; - private double groundwaterDepth; - private String waveSpeedInstrument; - private String waveVelocityMethod; - private String waveVelocityExcitationDistance; - private String waterDepth; - private int isParticipate; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getExpSiteNumber() { - return expSiteNumber; - } - - public void setExpSiteNumber(String expSiteNumber) { - this.expSiteNumber = expSiteNumber; - } - - public String getExpPointType() { - return expPointType; - } - - public void setExpPointType(String expPointType) { - this.expPointType = expPointType; - } - - public double getOrdinateX() { - return ordinateX; - } - - public void setOrdinateX(double ordinateX) { - this.ordinateX = ordinateX; - } - - public double getAbscissaY() { - return abscissaY; - } - - public void setAbscissaY(double abscissaY) { - this.abscissaY = abscissaY; - } - - public double getElevation() { - return elevation; - } - - public void setElevation(double elevation) { - this.elevation = elevation; - } - - public double getExplorationDepth() { - return explorationDepth; - } - - public void setExplorationDepth(double explorationDepth) { - this.explorationDepth = explorationDepth; - } - - public Date getExpStartDate() { - return expStartDate; - } - - public void setExpStartDate(Date expStartDate) { - this.expStartDate = expStartDate; - } - - public Date getExpEndDate() { - return expEndDate; - } - - public void setExpEndDate(Date expEndDate) { - this.expEndDate = expEndDate; - } - - public double getGroundwaterDepth() { - return groundwaterDepth; - } - - public void setGroundwaterDepth(double groundwaterDepth) { - this.groundwaterDepth = groundwaterDepth; - } - - public String getWaveSpeedInstrument() { - return waveSpeedInstrument; - } - - public void setWaveSpeedInstrument(String waveSpeedInstrument) { - this.waveSpeedInstrument = waveSpeedInstrument; - } - - public String getWaveVelocityMethod() { - return waveVelocityMethod; - } - - public void setWaveVelocityMethod(String waveVelocityMethod) { - this.waveVelocityMethod = waveVelocityMethod; - } - - public String getWaveVelocityExcitationDistance() { - return waveVelocityExcitationDistance; - } - - public void setWaveVelocityExcitationDistance(String waveVelocityExcitationDistance) { - this.waveVelocityExcitationDistance = waveVelocityExcitationDistance; - } - - public String getWaterDepth() { - return waterDepth; - } - - public void setWaterDepth(String waterDepth) { - this.waterDepth = waterDepth; - } - - public int getIsParticipate() { - return isParticipate; - } - - public void setIsParticipate(int isParticipate) { - this.isParticipate = isParticipate; - } -} diff --git a/src/main/java/com/yssh/entity/FeedbackDetail.java b/src/main/java/com/yssh/entity/FeedbackDetail.java deleted file mode 100644 index a12a8bb..0000000 --- a/src/main/java/com/yssh/entity/FeedbackDetail.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.yssh.entity; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; -import java.util.Date; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.ToString; - -@ToString -@Data -@ApiModel(value = "婧簮鍙嶉",description = "婧簮鍙嶉") -public class FeedbackDetail implements Serializable{ - public FeedbackDetail() { - } - - public FeedbackDetail(Long id, String tableName, String locationName, String detectionId, String detectionVocsName, Double detectionValue, String practicalId, String practicalVocsName, Double practicalValue, Date createTime) { - this.id = id; - this.tableName = tableName; - this.locationName = locationName; - this.detectionId = detectionId; - this.detectionVocsName = detectionVocsName; - this.detectionValue = detectionValue; - this.practicalId = practicalId; - this.practicalVocsName = practicalVocsName; - this.practicalValue = practicalValue; - this.createTime = createTime; - } - - private static final long serialVersionUID = 6877008992053903605L; - - @ApiModelProperty(value = "涓婚敭") - private Long id; - @ApiModelProperty(value = "琛ㄥ悕") - private String tableName; - @ApiModelProperty(value = "鐐逛綅鍚嶇О") - private String locationName; - @ApiModelProperty(value = "妫�娴嬬紪鍙�") - private String detectionId; - @ApiModelProperty(value = "妫�娴媣ocs鍚嶇О") - private String detectionVocsName; - @ApiModelProperty(value = "妫�娴嬪��") - private Double detectionValue; - @ApiModelProperty(value = "瀹為檯缂栧彿") - private String practicalId; - @ApiModelProperty(value = "瀹為檯vocs鍚嶇О") - private String practicalVocsName; - @ApiModelProperty(value = "瀹為檯鍊�") - private Double practicalValue; - @ApiModelProperty(value = "鍒涘缓鏃堕棿") - private Date createTime; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getTableName() { - return tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public String getLocationName() { - return locationName; - } - - public void setLocationName(String locationName) { - this.locationName = locationName; - } - - public String getDetectionId() { - return detectionId; - } - - public void setDetectionId(String detectionId) { - this.detectionId = detectionId; - } - - public String getDetectionVocsName() { - return detectionVocsName; - } - - public void setDetectionVocsName(String detectionVocsName) { - this.detectionVocsName = detectionVocsName; - } - - public Double getDetectionValue() { - return detectionValue; - } - - public void setDetectionValue(Double detectionValue) { - this.detectionValue = detectionValue; - } - - public String getPracticalId() { - return practicalId; - } - - public void setPracticalId(String practicalId) { - this.practicalId = practicalId; - } - - public String getPracticalVocsName() { - return practicalVocsName; - } - - public void setPracticalVocsName(String practicalVocsName) { - this.practicalVocsName = practicalVocsName; - } - - public Double getPracticalValue() { - return practicalValue; - } - - public void setPracticalValue(Double practicalValue) { - this.practicalValue = practicalValue; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } -} diff --git a/src/main/java/com/yssh/entity/Location.java b/src/main/java/com/yssh/entity/Location.java deleted file mode 100644 index ab5a31d..0000000 --- a/src/main/java/com/yssh/entity/Location.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.yssh.entity; - -import java.io.Serializable; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 鍘傚尯鐑偣鐐逛綅 - * @author wMeng - * @date 2022/10/30 13:16 - * @version 1.0 - */ -@Data -@ApiModel(value = "鍘傚尯鐑偣鐐逛綅",description = "鍘傚尯鐑偣鐐逛綅") -public class Location implements Serializable { - private static final long serialVersionUID = -2728687771987124891L; - - @ApiModelProperty(value = "涓婚敭") - private int id; - @ApiModelProperty(value = "鐐逛綅鍚嶇О") - private String name; - @ApiModelProperty(value = "鐐逛綅绫诲瀷") - private String type; - @ApiModelProperty(value = "鐐逛綅缁忓害") - private double lon; - @ApiModelProperty(value = "鐐逛綅绾害") - private double lat; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public double getLon() { - return lon; - } - - public void setLon(double lon) { - this.lon = lon; - } - - public double getLat() { - return lat; - } - - public void setLat(double lat) { - this.lat = lat; - } -} diff --git a/src/main/java/com/yssh/entity/MonitorPointPosition.java b/src/main/java/com/yssh/entity/MonitorPointPosition.java deleted file mode 100644 index 617972e..0000000 --- a/src/main/java/com/yssh/entity/MonitorPointPosition.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.yssh.entity; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; - - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@ApiModel(value="鐩戞祴鐐逛綅瀵硅薄", description="鐩戞祴鐐逛綅瀵硅薄") -public class MonitorPointPosition implements Serializable { - private static final long serialVersionUID = -7054999641619312155L; - - private String id; - @ApiModelProperty(value = "鐐逛綅鍚嶇О") - private String name; - private Integer x; - private Integer y; - private Integer z; - @ApiModelProperty(value = "缁忓害") - private Double lon; - @ApiModelProperty(value = "绾害") - private Double lat; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getX() { - return x; - } - - public void setX(Integer x) { - this.x = x; - } - - public Integer getY() { - return y; - } - - public void setY(Integer y) { - this.y = y; - } - - public Integer getZ() { - return z; - } - - public void setZ(Integer z) { - this.z = z; - } - - public Double getLon() { - return lon; - } - - public void setLon(Double lon) { - this.lon = lon; - } - - public Double getLat() { - return lat; - } - - public void setLat(Double lat) { - this.lat = lat; - } -} diff --git a/src/main/java/com/yssh/entity/Qxsh.java b/src/main/java/com/yssh/entity/Qxsh.java deleted file mode 100644 index 8fcf7b2..0000000 --- a/src/main/java/com/yssh/entity/Qxsh.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.yssh.entity; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @author WWW - * @date 2023-05-18 - * qxsh - */ -@Data -@ApiModel(value = "Qxsh",description = "Qxsh") -public class Qxsh { - @ApiModelProperty(value = "涓婚敭") - private Integer id; - - @ApiModelProperty(value = "鍚嶇О") - private String name; - - @ApiModelProperty(value = "缁忓害") - private Double lon; - - @ApiModelProperty(value = "绾害") - private Double lat; - - @ApiModelProperty(value = "鏁板��") - private Double value; - - @ApiModelProperty(value = "鏃堕棿") - private String time; - - public Qxsh() { - } - - 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; - } - - public Double getLon() { - return lon; - } - - public void setLon(Double lon) { - this.lon = lon; - } - - public Double getLat() { - return lat; - } - - public void setLat(Double lat) { - this.lat = lat; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public String getTime() { - return time; - } - - public void setTime(String time) { - this.time = time; - } -} diff --git a/src/main/java/com/yssh/entity/Report.java b/src/main/java/com/yssh/entity/Report.java deleted file mode 100644 index bd41333..0000000 --- a/src/main/java/com/yssh/entity/Report.java +++ /dev/null @@ -1,199 +0,0 @@ -package com.yssh.entity; - -import com.yssh.utils.CalculateUtils; -import io.swagger.annotations.ApiModelProperty; - -/** - * 鎶ュ憡 - * @author WWW - * @date 2023-06-18 - */ -public class Report { - @ApiModelProperty(value = "婧簮ID") - private String id; - - @ApiModelProperty(value = "鐐逛綅鍚嶇О") - private String name; - - @ApiModelProperty(value = "缁忓害") - private double lon; - - @ApiModelProperty(value = "绾害") - private double lat; - - @ApiModelProperty(value = "鏁板��") - private double val; - - @ApiModelProperty(value = "鍘诲勾鏁板��") - private Double lastVal; - - @ApiModelProperty(value = "鏃堕棿") - private String time; - - @ApiModelProperty(value = "椋庨��") - private double speed; - - @ApiModelProperty(value = "鏂瑰悜") - private String dir; - - @ApiModelProperty(value = "500m鑼冨洿鏈�澶у��") - private double maxVal; - - @ApiModelProperty(value = "璺濈") - private double dis; - - @ApiModelProperty(value = "500m鑼冨洿鏈�澶у�肩殑椋庡悜") - private String maxDir; - - @ApiModelProperty(value = "鏄惁涓�鑷�") - private int isSame; - - public Report() { - } - - public Report(String id, String name, double lon, double lat, double val, String time, double speed, String dir, double maxVal, double dis, String maxDir, int isSame) { - this.id = id; - this.name = name; - this.lon = lon; - this.lat = lat; - this.val = val; - this.time = time; - this.speed = speed; - this.dir = dir; - this.maxVal = maxVal; - this.dis = dis; - this.maxDir = maxDir; - this.isSame = isSame; - } - - /** - * 璁$畻鐢熸垚鎶ュ憡 - */ - public static Report calcReport(WarningDetail wd, DistanceSuYuan suYuan, DistanceSuYuan suMax) { - Coordinate c1 = CalculateUtils.getCoordinate(suYuan); - Coordinate c2 = CalculateUtils.getCoordinate(suMax); - - String time = wd.getTableName().replace("su_yuan_", ""); - double speed1 = CalculateUtils.round2(CalculateUtils.getWindSpeed(suYuan.getV(), suYuan.getU())); - double direction1 = CalculateUtils.getWindDirection(suYuan.getV(), suYuan.getU()); - String dir = CalculateUtils.getDir(direction1); - - double maxVal = suMax.getVocsValue(); - - //double dis = CalculateUtils.getDistance2(c1.getX(), c1.getY(), c2.getX(), c2.getY()); - double dis1 = CalculateUtils.getDistance1(c1.getX(), c1.getY(), c2.getX(), c2.getY()); - double angle = CalculateUtils.getAngle2(c1.getX(), c1.getY(), c2.getX(), c2.getY()); - - double speed2 = CalculateUtils.getWindSpeed(suMax.getV(), suMax.getU()); - double direction2 = CalculateUtils.getWindDirection(suMax.getV(), suMax.getU()); - String maxDir = CalculateUtils.getDir(direction2); // CalculateUtils.getDir(angle); - int isSame = (Math.abs(direction1 - direction2) <= 45 && Math.abs(speed1 - speed2) <= 0.5) ? 1 : 0; - - return new Report(wd.getSuYuanId(), wd.getLocationName(), c1.getX(), c1.getY(), wd.getValue(), time, - speed1, dir, maxVal, dis1, maxDir, isSame); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public double getLon() { - return lon; - } - - public void setLon(double lon) { - this.lon = lon; - } - - public double getLat() { - return lat; - } - - public void setLat(double lat) { - this.lat = lat; - } - - public double getVal() { - return val; - } - - public void setVal(double val) { - this.val = val; - } - - public Double getLastVal() { - return lastVal; - } - - public void setLastVal(Double lastVal) { - this.lastVal = lastVal; - } - - public String getTime() { - return time; - } - - public void setTime(String time) { - this.time = time; - } - - public double getSpeed() { - return speed; - } - - public void setSpeed(double speed) { - this.speed = speed; - } - - public String getDir() { - return dir; - } - - public void setDir(String dir) { - this.dir = dir; - } - - public double getMaxVal() { - return maxVal; - } - - public void setMaxVal(double maxVal) { - this.maxVal = maxVal; - } - - public double getDis() { - return dis; - } - - public void setDis(double dis) { - this.dis = dis; - } - - public String getMaxDir() { - return maxDir; - } - - public void setMaxDir(String maxDir) { - this.maxDir = maxDir; - } - - public int getIsSame() { - return isSame; - } - - public void setIsSame(int isSame) { - this.isSame = isSame; - } -} diff --git a/src/main/java/com/yssh/entity/Stratum.java b/src/main/java/com/yssh/entity/Stratum.java deleted file mode 100644 index 9083da4..0000000 --- a/src/main/java/com/yssh/entity/Stratum.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.yssh.entity; - -import lombok.Data; -import lombok.ToString; - -@Data -@ToString -public class Stratum { - private Long id; - private String expSiteNumber; - private Integer primaryLayerNumber; - private Integer sublayerNumber; - private String geologicalEra; - private String geologicalGenesis; - private Double layerDepth; - private String geotechnicalName; - private String geotechnicalCategory; - private String description; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getExpSiteNumber() { - return expSiteNumber; - } - - public void setExpSiteNumber(String expSiteNumber) { - this.expSiteNumber = expSiteNumber; - } - - public Integer getPrimaryLayerNumber() { - return primaryLayerNumber; - } - - public void setPrimaryLayerNumber(Integer primaryLayerNumber) { - this.primaryLayerNumber = primaryLayerNumber; - } - - public Integer getSublayerNumber() { - return sublayerNumber; - } - - public void setSublayerNumber(Integer sublayerNumber) { - this.sublayerNumber = sublayerNumber; - } - - public String getGeologicalEra() { - return geologicalEra; - } - - public void setGeologicalEra(String geologicalEra) { - this.geologicalEra = geologicalEra; - } - - public String getGeologicalGenesis() { - return geologicalGenesis; - } - - public void setGeologicalGenesis(String geologicalGenesis) { - this.geologicalGenesis = geologicalGenesis; - } - - public Double getLayerDepth() { - return layerDepth; - } - - public void setLayerDepth(Double layerDepth) { - this.layerDepth = layerDepth; - } - - public String getGeotechnicalName() { - return geotechnicalName; - } - - public void setGeotechnicalName(String geotechnicalName) { - this.geotechnicalName = geotechnicalName; - } - - public String getGeotechnicalCategory() { - return geotechnicalCategory; - } - - public void setGeotechnicalCategory(String geotechnicalCategory) { - this.geotechnicalCategory = geotechnicalCategory; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } -} diff --git a/src/main/java/com/yssh/entity/SuYuan.java b/src/main/java/com/yssh/entity/SuYuan.java deleted file mode 100644 index 93fe990..0000000 --- a/src/main/java/com/yssh/entity/SuYuan.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.yssh.entity; - -import java.io.Serializable; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import com.github.biyanwen.annotation.CsvProperty; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SuYuan implements Serializable { - - private static final long serialVersionUID = 2004641202487367361L; - private String id; - @CsvProperty(index = 0) - private Integer x; - @CsvProperty(index = 1) - private Integer y; - @CsvProperty(index = 2) - private Integer z; - @CsvProperty(index = 3) - private Double u; - @CsvProperty(index = 4) - private Double v; - @CsvProperty(index = 5) - private Double w; - @CsvProperty(index = 6) - private Double c; - /*private Double lon; - private Double lat; - private Date time;*/ - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Integer getX() { - return x; - } - - public void setX(Integer x) { - this.x = x; - } - - public Integer getY() { - return y; - } - - public void setY(Integer y) { - this.y = y; - } - - public Integer getZ() { - return z; - } - - public void setZ(Integer z) { - this.z = z; - } - - public Double getU() { - return u; - } - - public void setU(Double u) { - this.u = u; - } - - public Double getV() { - return v; - } - - public void setV(Double v) { - this.v = v; - } - - public Double getW() { - return w; - } - - public void setW(Double w) { - this.w = w; - } - - public Double getC() { - return c; - } - - public void setC(Double c) { - this.c = c; - } -} diff --git a/src/main/java/com/yssh/entity/SuYuan2d.java b/src/main/java/com/yssh/entity/SuYuan2d.java deleted file mode 100644 index 742fe00..0000000 --- a/src/main/java/com/yssh/entity/SuYuan2d.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.yssh.entity; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.yssh.utils.CalculateUtils; - -import lombok.ToString; - -@ToString -@ApiModel(value="婧簮2d瀵硅薄", description="婧簮2d瀵硅薄") -public class SuYuan2d implements Serializable { - - private static final long serialVersionUID = -4652224366972823014L; - @ApiModelProperty(value = "涓婚敭") - private String id; - @JsonIgnore - private Integer x; - @JsonIgnore - private Integer y; - @ApiModelProperty(value = "缁忓害") - private double lon; - @ApiModelProperty(value = "绾害") - private double lat; - @ApiModelProperty(value = "鏁板��") - private double value; - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public Integer getX() { - return x; - } - public void setX(Integer x) { - this.x = x; - } - public Integer getY() { - return y; - } - public void setY(Integer y) { - this.y = y; - } - public double getLon() { - return CalculateUtils.getLon(x, y); - } - - public double getLat() { - return CalculateUtils.getLat(x, y); - } - - public double getValue() { - return value; - } - public void setValue(double value) { - this.value = value; - } - - public void setLon(double lon) { - this.lon = lon; - } - - public void setLat(double lat) { - this.lat = lat; - } -} diff --git a/src/main/java/com/yssh/entity/SuYuan3d.java b/src/main/java/com/yssh/entity/SuYuan3d.java deleted file mode 100644 index 8d0054e..0000000 --- a/src/main/java/com/yssh/entity/SuYuan3d.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.yssh.entity; - - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.yssh.utils.CalculateUtils; - -import lombok.AllArgsConstructor; -import lombok.NoArgsConstructor; -import lombok.ToString; - -@NoArgsConstructor -@AllArgsConstructor -@ToString -@ApiModel(value = "3d鏁版嵁",description = "3d鏁版嵁") -public class SuYuan3d implements Serializable{ - - /** - * @Fields field:field:{todo}(鐢ㄤ竴鍙ヨ瘽鎻忚堪杩欎釜鍙橀噺琛ㄧず浠�涔�) - */ - private static final long serialVersionUID = 5955771070977977633L; - @ApiModelProperty(value = "涓婚敭") - private String id; - @JsonIgnore - private Integer x; - @JsonIgnore - private Integer y; - @ApiModelProperty(value = "缁忓害") - private double lon; - @ApiModelProperty(value = "绾害") - private double lat; - private double height0 = 0.0; - private double height10 = 0.0; - private double height20 = 0.0; - private double height30 = 0.0; - private double height40 = 0.0; - private double height50 = 0.0; - private double height60 = 0.0; - private double height70 = 0.0; - private double height80 = 0.0; - private double height90 = 0.0; - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public Integer getX() { - return x; - } - public void setX(Integer x) { - this.x = x; - } - public Integer getY() { - return y; - } - public void setY(Integer y) { - this.y = y; - } - public double getLon() { - return CalculateUtils.getLon(x, y); - } - - public double getLat() { - return CalculateUtils.getLat(x, y); - } - public double getHeight0() { - return height0; - } - public void setHeight0(double height0) { - this.height0 = height0; - } - public double getHeight10() { - return height10; - } - public void setHeight10(double height10) { - this.height10 = height10; - } - public double getHeight20() { - return height20; - } - public void setHeight20(double height20) { - this.height20 = height20; - } - public double getHeight30() { - return height30; - } - public void setHeight30(double height30) { - this.height30 = height30; - } - public double getHeight40() { - return height40; - } - public void setHeight40(double height40) { - this.height40 = height40; - } - public double getHeight50() { - return height50; - } - public void setHeight50(double height50) { - this.height50 = height50; - } - public double getHeight60() { - return height60; - } - public void setHeight60(double height60) { - this.height60 = height60; - } - public double getHeight70() { - return height70; - } - public void setHeight70(double height70) { - this.height70 = height70; - } - public double getHeight80() { - return height80; - } - public void setHeight80(double height80) { - this.height80 = height80; - } - public double getHeight90() { - return height90; - } - public void setHeight90(double height90) { - this.height90 = height90; - } -} diff --git a/src/main/java/com/yssh/entity/SuYuan700.java b/src/main/java/com/yssh/entity/SuYuan700.java deleted file mode 100644 index 4f1aa92..0000000 --- a/src/main/java/com/yssh/entity/SuYuan700.java +++ /dev/null @@ -1,187 +0,0 @@ -package com.yssh.entity; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; -import java.util.Date; - -/** - * 婧簮700琛� - * @author www - * @date 2023-06-23 - */ -@Data -public class SuYuan700 implements Serializable { - private static final long serialVersionUID = 2023062302487367361L; - - @ApiModelProperty(value = "涓婚敭ID") - private Long id; - - @ApiModelProperty(value = "婧簮ID") - private String suYuanId; - - @ApiModelProperty(value = "鍦板潃1") - private String addr1; - - @ApiModelProperty(value = "姒傜巼1") - private Double odds1; - - @ApiModelProperty(value = "X1") - private Double x1; - - @ApiModelProperty(value = "Y1") - private Double y1; - - @ApiModelProperty(value = "鍦板潃2") - private String addr2; - - @ApiModelProperty(value = "姒傜巼2") - private Double odds2; - - @ApiModelProperty(value = "X2") - private Double x2; - - @ApiModelProperty(value = "Y2") - private Double y2; - - @ApiModelProperty(value = "鍦板潃3") - private String addr3; - - @ApiModelProperty(value = "姒傜巼3") - private Double odds3; - - @ApiModelProperty(value = "X3") - private Double x3; - - @ApiModelProperty(value = "Y3") - private Double y3; - - @ApiModelProperty(value = "鏃堕棿") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; - - public SuYuan700() { - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getSuYuanId() { - return suYuanId; - } - - public void setSuYuanId(String suYuanId) { - this.suYuanId = suYuanId; - } - - public String getAddr1() { - return addr1; - } - - public void setAddr1(String addr1) { - this.addr1 = addr1; - } - - public Double getOdds1() { - return odds1; - } - - public void setOdds1(Double odds1) { - this.odds1 = odds1; - } - - public Double getX1() { - return x1; - } - - public void setX1(Double x1) { - this.x1 = x1; - } - - public Double getY1() { - return y1; - } - - public void setY1(Double y1) { - this.y1 = y1; - } - - public String getAddr2() { - return addr2; - } - - public void setAddr2(String addr2) { - this.addr2 = addr2; - } - - public Double getOdds2() { - return odds2; - } - - public void setOdds2(Double odds2) { - this.odds2 = odds2; - } - - public Double getX2() { - return x2; - } - - public void setX2(Double x2) { - this.x2 = x2; - } - - public Double getY2() { - return y2; - } - - public void setY2(Double y2) { - this.y2 = y2; - } - - public String getAddr3() { - return addr3; - } - - public void setAddr3(String addr3) { - this.addr3 = addr3; - } - - public Double getOdds3() { - return odds3; - } - - public void setOdds3(Double odds3) { - this.odds3 = odds3; - } - - public Double getX3() { - return x3; - } - - public void setX3(Double x3) { - this.x3 = x3; - } - - public Double getY3() { - return y3; - } - - public void setY3(Double y3) { - this.y3 = y3; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } -} diff --git a/src/main/java/com/yssh/entity/SuYuanMonitorData.java b/src/main/java/com/yssh/entity/SuYuanMonitorData.java deleted file mode 100644 index 586ac6c..0000000 --- a/src/main/java/com/yssh/entity/SuYuanMonitorData.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.yssh.entity; - -import java.io.Serializable; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@ApiModel(value = "婧簮鐩戞祴鏁版嵁",description = "婧簮鐩戞祴鏁版嵁") -public class SuYuanMonitorData implements Serializable{ - - private static final long serialVersionUID = -7472189043893753483L; - @ApiModelProperty(value = "涓婚敭") - private String id; - @ApiModelProperty(value = "鏁板��") - private Double value; - @ApiModelProperty(value = "鏃堕棿") - private Integer time; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } - - public Integer getTime() { - return time; - } - - public void setTime(Integer time) { - this.time = time; - } -} diff --git a/src/main/java/com/yssh/entity/Temporary.java b/src/main/java/com/yssh/entity/Temporary.java deleted file mode 100644 index c493766..0000000 --- a/src/main/java/com/yssh/entity/Temporary.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.yssh.entity; - - -import java.io.Serializable; - -import lombok.AllArgsConstructor; -import lombok.NoArgsConstructor; - -import com.github.biyanwen.annotation.CsvProperty; -import com.yssh.utils.CalculateUtils; - -@NoArgsConstructor -@AllArgsConstructor -public class Temporary implements Serializable{ - - private static final long serialVersionUID = 8801687493177033295L; - private Integer x; - private Integer y; - @CsvProperty(index = 0) - private Double lon; - @CsvProperty(index = 1) - private Double lat; - @CsvProperty(index = 2) - private Integer z; - @CsvProperty(index = 3) - private Double u; - @CsvProperty(index = 4) - private Double v; - @CsvProperty(index = 5) - private Double w; - @CsvProperty(index = 6) - private Double c; - public Integer getX() { - return x; - } - public void setX(Integer x) { - this.x = x; - } - public Integer getY() { - return y; - } - public void setY(Integer y) { - this.y = y; - } - public Integer getZ() { - return z; - } - public void setZ(Integer z) { - this.z = z; - } - public double getLon() { - return CalculateUtils.getLon(x, y); - } - public double getLat() { - return CalculateUtils.getLat(x, y); - } - public Double getU() { - return u; - } - public void setU(Double u) { - this.u = u; - } - public Double getV() { - return v; - } - public void setV(Double v) { - this.v = v; - } - public Double getW() { - return w; - } - public void setW(Double w) { - this.w = w; - } - public Double getC() { - return c; - } - public void setC(Double c) { - this.c = c; - } - - public void setLon(Double lon) { - this.lon = lon; - } - - public void setLat(Double lat) { - this.lat = lat; - } -} diff --git a/src/main/java/com/yssh/entity/ThuAccuracy.java b/src/main/java/com/yssh/entity/ThuAccuracy.java deleted file mode 100644 index a346e60..0000000 --- a/src/main/java/com/yssh/entity/ThuAccuracy.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.yssh.entity; - -import java.io.Serializable; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.ToString; - -@Data -@ToString -@NoArgsConstructor -@AllArgsConstructor -public class ThuAccuracy implements Serializable{ - - private static final long serialVersionUID = 3859561604842988730L; - - private int id; - private String name; - private float lon; - private float lat; - private String value; - private String time; - private int property; - private String wg100; - private String wg200; - private String wg300; - private String wg500; - private Double accuracy; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public float getLon() { - return lon; - } - - public void setLon(float lon) { - this.lon = lon; - } - - public float getLat() { - return lat; - } - - public void setLat(float lat) { - this.lat = lat; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getTime() { - return time; - } - - public void setTime(String time) { - this.time = time; - } - - public int getProperty() { - return property; - } - - public void setProperty(int property) { - this.property = property; - } - - public String getWg100() { - return wg100; - } - - public void setWg100(String wg100) { - this.wg100 = wg100; - } - - public String getWg200() { - return wg200; - } - - public void setWg200(String wg200) { - this.wg200 = wg200; - } - - public String getWg300() { - return wg300; - } - - public void setWg300(String wg300) { - this.wg300 = wg300; - } - - public String getWg500() { - return wg500; - } - - public void setWg500(String wg500) { - this.wg500 = wg500; - } - - public Double getAccuracy() { - return accuracy; - } - - public void setAccuracy(Double accuracy) { - this.accuracy = accuracy; - } -} diff --git a/src/main/java/com/yssh/entity/VocCoords.java b/src/main/java/com/yssh/entity/VocCoords.java deleted file mode 100644 index d6d67e9..0000000 --- a/src/main/java/com/yssh/entity/VocCoords.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.yssh.entity; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.github.biyanwen.annotation.CsvProperty; -import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; - -public class VocCoords implements Serializable { - private static final long serialVersionUID = -20230606150000000L; - - @JsonIgnore - @ApiModelProperty(value = "涓婚敭") - private Integer id; - - @CsvProperty(index = 0) - @ApiModelProperty(value = "X") - private Integer x; - - @CsvProperty(index = 1) - @ApiModelProperty(value = "Y") - private Integer y; - - @CsvProperty(index = 2) - @ApiModelProperty(value = "鍦板潃") - private String addr; - - public VocCoords() { - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getX() { - return x; - } - - public void setX(Integer x) { - this.x = x; - } - - public Integer getY() { - return y; - } - - public void setY(Integer y) { - this.y = y; - } - - public String getAddr() { - return addr; - } - - public void setAddr(String addr) { - this.addr = addr; - } -} diff --git a/src/main/java/com/yssh/entity/VocVals.java b/src/main/java/com/yssh/entity/VocVals.java deleted file mode 100644 index afbfa61..0000000 --- a/src/main/java/com/yssh/entity/VocVals.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.yssh.entity; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.github.biyanwen.annotation.CsvProperty; -import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; -import java.math.BigInteger; -import java.util.Date; - -public class VocVals implements Serializable { - private static final long serialVersionUID = -20230605145412000L; - - @JsonIgnore - @ApiModelProperty(value = "涓婚敭") - private BigInteger id; - - @ApiModelProperty(value = "婧簮ID") - private String suYuanId; - - @CsvProperty(index = 0) - @ApiModelProperty(value = "X") - private Integer x; - - @CsvProperty(index = 1) - @ApiModelProperty(value = "Y") - private Integer y; - - @CsvProperty(index = 2) - @ApiModelProperty(value = "鍊�") - private Double val; - - @JsonIgnore - @ApiModelProperty(value = "鍒涘缓鏃堕棿") - private Date createTime; - - @ApiModelProperty(value = "鍦板潃") - private String addr; - - public VocVals() { - } - - public BigInteger getId() { - return id; - } - - public void setId(BigInteger id) { - this.id = id; - } - - public String getSuYuanId() { - return x + "_" + y + "_0"; - } - - public Integer getX() { - return x; - } - - public void setX(Integer x) { - this.x = x; - } - - public Integer getY() { - return y; - } - - public void setY(Integer y) { - this.y = y; - } - - public Double getVal() { - return val; - } - - public void setVal(Double val) { - this.val = val; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public String getAddr() { - return addr; - } - - public void setAddr(String addr) { - this.addr = addr; - } -} diff --git a/src/main/java/com/yssh/entity/WarningDetail.java b/src/main/java/com/yssh/entity/WarningDetail.java deleted file mode 100644 index b30abec..0000000 --- a/src/main/java/com/yssh/entity/WarningDetail.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.yssh.entity; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; -import java.util.Date; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.ToString; - -@Data -@ToString -@ApiModel(value="鎶ヨ/棰勮瀵硅薄", description="鎶ヨ/棰勮瀵硅薄") -public class WarningDetail implements Serializable{ - public WarningDetail() { - } - - public WarningDetail(Long id, String tableName, String suYuanId, String locationName, Date createTime, Integer type, Double value) { - this.id = id; - this.tableName = tableName; - this.suYuanId = suYuanId; - this.locationName = locationName; - this.createTime = createTime; - this.type = type; - this.value = value; - } - - private static final long serialVersionUID = 1610250573910282005L; - @ApiModelProperty(value = "涓婚敭") - private Long id; - @ApiModelProperty(value = "婧簮鏁版嵁琛ㄥ悕") - private String tableName; - @ApiModelProperty(value = "婧簮鏁版嵁缂栧彿") - private String suYuanId; - @ApiModelProperty(value = "鐐逛綅鍚嶇О") - private String locationName;; - @ApiModelProperty(value = "鏃堕棿") - private Date createTime; - @ApiModelProperty(value = "绫诲瀷") - private Integer type; - @ApiModelProperty(value = "鏁板��") - private Double value; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getTableName() { - return tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public String getSuYuanId() { - return suYuanId; - } - - public void setSuYuanId(String suYuanId) { - this.suYuanId = suYuanId; - } - - public String getLocationName() { - return locationName; - } - - public void setLocationName(String locationName) { - this.locationName = locationName; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public Double getValue() { - return value; - } - - public void setValue(Double value) { - this.value = value; - } -} diff --git a/src/main/java/com/yssh/entity/Weather.java b/src/main/java/com/yssh/entity/Weather.java deleted file mode 100644 index f433771..0000000 --- a/src/main/java/com/yssh/entity/Weather.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.yssh.entity; - -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * @author wMeng - * @ClassName YsshWeather - * @Description 澶╂皵鏁版嵁 - * @date 2022/10/30 13:18 - * @Version 1.0 - */ -@Data -@ApiModel(value = "澶╂皵鏁版嵁",description = "澶╂皵鏁版嵁") -public class Weather { - @ApiModelProperty(value = "涓婚敭") - private int id; - @ApiModelProperty(value = "鏃堕棿") - private String time; - @ApiModelProperty(value = "椋庨��") - private String windSpeed; - @ApiModelProperty(value = "椋庡悜") - private String windDirection; - @ApiModelProperty(value = "澶╂皵鐘跺喌") - private String weatherCondition; - @ApiModelProperty(value = "姘旀俯") - private String temperature; - - public String getTime() { - return time; - } - - public void setTime(String time) { - this.time = time; - } - - public String getWindSpeed() { - return windSpeed; - } - - public void setWindSpeed(String windSpeed) { - this.windSpeed = windSpeed; - } - - public String getWindDirection() { - return windDirection; - } - - public void setWindDirection(String windDirection) { - this.windDirection = windDirection; - } - - public String getWeatherCondition() { - return weatherCondition; - } - - public void setWeatherCondition(String weatherCondition) { - this.weatherCondition = weatherCondition; - } - - public String getTemperature() { - return temperature; - } - - public void setTemperature(String temperature) { - this.temperature = temperature; - } -} diff --git a/src/main/java/com/yssh/entity/dto/YsshSuYuanX00UpdateBatchParam.java b/src/main/java/com/yssh/entity/dto/YsshSuYuanX00UpdateBatchParam.java deleted file mode 100644 index 57f0d9b..0000000 --- a/src/main/java/com/yssh/entity/dto/YsshSuYuanX00UpdateBatchParam.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.yssh.entity.dto; - -import lombok.Data; - -import java.util.List; - -/** - * @author lishijia - * @ClassName YsshSuYuanX00 - * @Description TODO - * @date 2022/11/28 10:37 - * @Version 1.0 - */ -@Data -public class YsshSuYuanX00UpdateBatchParam { - private String newName; - private List<Integer> ids; - - public String getNewName() { - return newName; - } - - public void setNewName(String newName) { - this.newName = newName; - } - - public List<Integer> getIds() { - return ids; - } - - public void setIds(List<Integer> ids) { - this.ids = ids; - } -} diff --git a/src/main/java/com/yssh/entity/vo/ForecastAnalyseVo.java b/src/main/java/com/yssh/entity/vo/ForecastAnalyseVo.java deleted file mode 100644 index 7f44557..0000000 --- a/src/main/java/com/yssh/entity/vo/ForecastAnalyseVo.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.yssh.entity.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.ToString; - -@ToString -@ApiModel(value="棰勬祴鍒嗘瀽灞曠ず瀵硅薄", description="棰勬祴鍒嗘瀽灞曠ず瀵硅薄") -@Data -public class ForecastAnalyseVo { - public ForecastAnalyseVo() { - } - - public ForecastAnalyseVo(Double forecastValue, Double practicalValue, Long time) { - this.forecastValue = forecastValue; - this.practicalValue = practicalValue; - this.time = time; - } - - @ApiModelProperty(value = "棰勬祴鍊�") - private Double forecastValue; - @ApiModelProperty(value = "瀹為檯鍊�") - private Double practicalValue; - @ApiModelProperty(value = "鏃堕棿") - private Long time; - - public Double getForecastValue() { - return forecastValue; - } - - public void setForecastValue(Double forecastValue) { - this.forecastValue = forecastValue; - } - - public Double getPracticalValue() { - return practicalValue; - } - - public void setPracticalValue(Double practicalValue) { - this.practicalValue = practicalValue; - } - - public Long getTime() { - return time; - } - - public void setTime(Long time) { - this.time = time; - } -} diff --git a/src/main/java/com/yssh/entity/vo/WarningVo.java b/src/main/java/com/yssh/entity/vo/WarningVo.java deleted file mode 100644 index 77b6e47..0000000 --- a/src/main/java/com/yssh/entity/vo/WarningVo.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.yssh.entity.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; - -import lombok.ToString; - -import com.yssh.utils.CalculateUtils; - -@ToString -@ApiModel(value="鎶ヨ/棰勮灞曠ず瀵硅薄", description="鎶ヨ/棰勮灞曠ず瀵硅薄") -public class WarningVo implements Serializable { - public WarningVo() { - } - - public WarningVo(String locationName, String suYuanId, double lon, double lat, double value, String time) { - this.locationName = locationName; - this.suYuanId = suYuanId; - this.lon = lon; - this.lat = lat; - this.value = value; - this.time = time; - } - - private static final long serialVersionUID = 3440478664982471286L; - @ApiModelProperty(value = "鐐逛綅鍚嶇О") - private String locationName; - - //@JsonIgnore - private String suYuanId; - - @ApiModelProperty(value = "缁忓害") - private double lon; - - @ApiModelProperty(value = "绾害") - private double lat; - - @ApiModelProperty(value = "鏁板��") - private double value; - - @ApiModelProperty(value = "鏃堕棿") - private String time; - - public String getLocationName() { - return locationName; - } - - public void setLocationName(String locationName) { - this.locationName = locationName; - } - - public void setSuYuanId(String suYuanId) { - this.suYuanId = suYuanId; - } - - public double getLon() { - String[] split = suYuanId.split("_"); - return CalculateUtils.getLon(Integer.parseInt(split[0]), Integer.parseInt(split[1])); - } - - public double getLat() { - String[] split = suYuanId.split("_"); - return CalculateUtils.getLat(Integer.parseInt(split[0]), Integer.parseInt(split[1])); - } - - public double getValue() { - return value; - } - - public void setValue(double value) { - this.value = value; - } - - public String getSuYuanId() { - return suYuanId; - } - - public void setLon(double lon) { - this.lon = lon; - } - - public void setLat(double lat) { - this.lat = lat; - } - - public String getTime() { - return time; - } - - public void setTime(String time) { - this.time = time; - } -} diff --git a/src/main/java/com/yssh/run/InitDataRunner.java b/src/main/java/com/yssh/run/InitDataRunner.java deleted file mode 100644 index 18030f4..0000000 --- a/src/main/java/com/yssh/run/InitDataRunner.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.yssh.run; - -import com.yssh.scheduled.ReadCsvTask; -import com.yssh.service.impl.WarningAnalyseServiceImpl; -import com.yssh.utils.CacheUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; -import org.springframework.stereotype.Component; - -import com.yssh.service.ICommonService; -import com.yssh.service.IDictRecordService; - -import javax.annotation.Resource; -import java.util.Calendar; - -@Component -public class InitDataRunner implements ApplicationRunner { - //protected final Log logger = LogFactory.getLog(this.getClass()); - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - - @Autowired - private ICommonService commonService; - - @Autowired - private IDictRecordService dictRecordService; - - @Resource - WarningAnalyseServiceImpl warningAnalyseService; - - @Resource - ReadCsvTask task; - - @Override - public void run(ApplicationArguments args) throws Exception { - CacheUtils.init(); - - boolean tableExists = commonService.checkTableExists("dict_record"); - if (!tableExists) { - dictRecordService.createDictRecoTable(); - } - // 璇诲彇dat鏁版嵁 - commonService.readDatData(); - - //test(); - logger.info("***************** 绯荤粺鍚姩瀹屾瘯 *****************" + "\n"); - } - - private void test() { - task.corpReserveDataSync(); - - Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.MONTH, 5); - calendar.set(Calendar.DAY_OF_MONTH, 8); - calendar.set(Calendar.HOUR_OF_DAY, 16); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND, 0); - - //warningAnalyseService.warningOperationStorage(calendar.getTime()); - } -} diff --git a/src/main/java/com/yssh/scheduled/ReadCsvTask.java b/src/main/java/com/yssh/scheduled/ReadCsvTask.java deleted file mode 100644 index abb55ac..0000000 --- a/src/main/java/com/yssh/scheduled/ReadCsvTask.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.yssh.scheduled; - -import java.io.File; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import com.yssh.entity.VocVals; -import com.yssh.service.VocValsService; -import com.yssh.utils.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import com.github.biyanwen.EasyCsv; -import com.yssh.config.CsvFilePathConfig; -import com.yssh.entity.DictRecord; -import com.yssh.entity.SuYuan; -import com.yssh.service.IDictRecordService; -import com.yssh.service.IWarningAnalyseService; -import com.yssh.service.impl.SuYuanServiceImpl; - -import javax.annotation.Resource; - -@Component -public class ReadCsvTask { - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - - @Resource - private VocValsService vocValsService; - - @Resource - private SuYuanServiceImpl suYuanService; - - @Resource - private CsvFilePathConfig csvFilePathConfig; - - @Resource - private IDictRecordService dictRecordService; - - @Resource - private IWarningAnalyseService warningAnalyseService; - - @Value("${csv.voc_max}") - private int vocMax = 96; - - @Value("${csv.cron_max}") - private int cronMax = 48; - - private final static List<String> md5List = new ArrayList<>(); - - private final static SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHH"); - - public void corpReserveDataSync() { - loadVocSync(); - loadCsvSync(); - } - - @Scheduled(cron = "${csv.voc}") - private void loadVocSync() { - vocValsService.deleteLastYear(); - Calendar calendar = getCalendar(96); - for (int i = 0; i < vocMax; i++) { - calendar.add(Calendar.HOUR, -1); - String time = format.format(calendar.getTime()); - String filePath = csvFilePathConfig.getVocPath() + File.separator + time + ".csv"; - - File file = new File(filePath); - if (!file.exists()) { - logger.info(file.getAbsolutePath() + " is not exist 锛�"); - continue; - } - - String md5 = FileUtils.getFileMd5(filePath); - if (null != md5 && md5List.contains(md5)) { - continue; // csv宸插叆搴� - } - - int count = vocValsService.countByTime(time); - if (count > 0) { - vocValsService.deleteByTime(time); // 鍒犻櫎宸插叆搴� - } - addFileMd5(md5); - - try { - logger.info("loadVocSync: " + filePath); - Date date = (Date) calendar.getTime().clone(); - EasyCsv.read(filePath, VocVals.class, new VocParser(vocValsService, date)).doRead(); - - // Thread.sleep(3 * 1000); - } catch (Exception e) { - logger.error(e.getMessage(), e); - } - } - } - - private void addFileMd5(String md5) { - md5List.add(md5); - if (md5List.size() > 512) { - md5List.remove(0); - } - } - - @Scheduled(cron = "${csv.cron}") - private void loadCsvSync() { - Calendar calendar = getCalendar(1); - for (int i = 0; i < cronMax; i++) { - calendar.add(Calendar.HOUR, -1); - String time = format.format(calendar.getTime()); - String filePath = csvFilePathConfig.getFilePath() + File.separator + time + ".csv"; - - File file = new File(filePath); - if (!file.exists()) { - logger.info(file.getAbsolutePath() + " is not exist 锛�"); - continue; - } - - // 鍒涘缓琛� - String newTableName = TableStrategy.getTableStrategy(time); - Integer rows = suYuanService.isTableExists(newTableName); - if (rows > 0) { - continue; - } - - suYuanService.createNewTable(newTableName); - - Long createTime = Long.parseLong(time); - DictRecord dr = dictRecordService.selectByCreateTime(createTime); - if (null == dr) { - dictRecordService.insertDictRecord(new DictRecord(1L, newTableName, Long.parseLong(time), "")); - } - - logger.info("loadCsvSync: " + filePath); - EasyCsv.read(filePath, SuYuan.class, new CsvParser(suYuanService, time)).doRead(); - -// try { -// // 璁$畻棰勮/鎶ヨ,骞朵笖杩涜鍏ュ簱鎿嶄綔 -// Thread.sleep(2 * 60 * 1000); -// } catch (InterruptedException e) { -// logger.error("鐫$湢涓�鍒嗛挓鍚庢墽琛岄璀�/鎶ヨ璁$畻,骞朵笖杩涜鍏ュ簱鎿嶄綔鍑虹幇寮傚父锛屽紓甯稿師鍥犳槸锛�", e); -// e.printStackTrace(); -// } - warningAnalyseService.warningOperationStorage(calendar.getTime()); - } - } - - public Calendar getCalendar(int start) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); - calendar.add(Calendar.HOUR, start); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND, 0); - - // 娴嬭瘯 -> 2023-04-23 19:00 - //calendar.set(Calendar.MONTH, 3); - //calendar.set(Calendar.DAY_OF_MONTH, 23); - //calendar.set(Calendar.HOUR_OF_DAY, 20); - - return calendar; - } - - private void loadCsv_old() { - Date date = DateUtils.getNowDate(); - String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, date); - String filePath = csvFilePathConfig.getFilePath() + "\\\\" + time + ".csv"; - File file = new File(filePath); - if (!file.exists()) { - logger.info(file.getAbsolutePath() + " is not exist 锛�"); - return; - } - //鍒涘缓琛� - String newTableName = TableStrategy.getTableStrategy(time); - suYuanService.createNewTable(newTableName); - dictRecordService.insertDictRecord(new DictRecord(1L, newTableName, Long.parseLong(time), "")); - EasyCsv.read(filePath, SuYuan.class, new CsvParser(suYuanService, time)).doRead(); - //璁$畻棰勮/鎶ヨ,骞朵笖杩涜鍏ュ簱鎿嶄綔 - try { - Thread.sleep(60 * 1000); - } catch (InterruptedException e) { - logger.error("鐫$湢涓�鍒嗛挓鍚庢墽琛岄璀�/鎶ヨ璁$畻,骞朵笖杩涜鍏ュ簱鎿嶄綔鍑虹幇寮傚父锛屽紓甯稿師鍥犳槸锛�", e); - e.printStackTrace(); - } - warningAnalyseService.warningOperationStorage(date); - } -} diff --git a/src/main/java/com/yssh/service/IAlertConfigService.java b/src/main/java/com/yssh/service/IAlertConfigService.java deleted file mode 100644 index fde032a..0000000 --- a/src/main/java/com/yssh/service/IAlertConfigService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.yssh.service; - -import java.util.List; - -import com.yssh.entity.AlertConfig; - -public interface IAlertConfigService { - - List<AlertConfig> getAll(); - - List<AlertConfig> query(Integer id); - - int update(AlertConfig config); - - int insert(AlertConfig config); - - int delete(Integer id); - -} diff --git a/src/main/java/com/yssh/service/IAsyncService.java b/src/main/java/com/yssh/service/IAsyncService.java deleted file mode 100644 index 8184d9e..0000000 --- a/src/main/java/com/yssh/service/IAsyncService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.yssh.service; - -import java.util.List; -import java.util.concurrent.CountDownLatch; - -import com.yssh.dao.BaseMapper; - -public interface IAsyncService { - final Integer BATCH_INSERT_NUMBER = 1000; - - final Integer BATCH_INSERT_500 = 500; - - <T> void executeAsync(String tableName, List<T> lists, BaseMapper mapper, CountDownLatch countDownLatch); -} diff --git a/src/main/java/com/yssh/service/ICommonService.java b/src/main/java/com/yssh/service/ICommonService.java deleted file mode 100644 index 149e842..0000000 --- a/src/main/java/com/yssh/service/ICommonService.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yssh.service; - -import java.util.List; - -import com.yssh.entity.MonitorPointPosition; - -public interface ICommonService { - - public boolean checkTableExists(String tableName); - - public void readDatData() throws Exception; - - public List<MonitorPointPosition> getCheckPoints2d(); - - public List<MonitorPointPosition> getCheckPoints3d(); - - public MonitorPointPosition select2dCheckPointByName(String name); - - public MonitorPointPosition select3dCheckPointByName(String name); - - public MonitorPointPosition select2dCheckPointById(String id); - - public MonitorPointPosition select3dCheckPointById(String id); - -} diff --git a/src/main/java/com/yssh/service/ICountService.java b/src/main/java/com/yssh/service/ICountService.java deleted file mode 100644 index a4a9047..0000000 --- a/src/main/java/com/yssh/service/ICountService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.yssh.service; - -import java.util.Map; - -public interface ICountService { - - Map<String, Double> selectAccuracyAvg(); -} diff --git a/src/main/java/com/yssh/service/IDictRecordService.java b/src/main/java/com/yssh/service/IDictRecordService.java deleted file mode 100644 index d9ed630..0000000 --- a/src/main/java/com/yssh/service/IDictRecordService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.yssh.service; - -import com.yssh.entity.DictRecord; - -import java.util.List; - -/** - * 瀛楀吀璁板綍Service鎺ュ彛 - * - * @author xingjinshuang@smartearth.cn - * @date 2023-02-06 - */ -public interface IDictRecordService { - - /** - * 鏌ヨ瀛楀吀璁板綍鍒楄〃 - * - * @param dictRecord 瀛楀吀璁板綍 - * @return 瀛楀吀璁板綍闆嗗悎 - */ - public List<DictRecord> selectDictRecordList(DictRecord dictRecord); - - /** - * 鏍规嵁鍒涘缓鏃堕棿鏌ヨ - * - * @param createTime - * @return - */ - public DictRecord selectByCreateTime(Long createTime); - - /** - * 鏂板瀛楀吀璁板綍 - * - * @param dictRecord 瀛楀吀璁板綍 - * @return 缁撴灉 - */ - public int insertDictRecord(DictRecord dictRecord); - - /** - * 鎵归噺鍒犻櫎瀛楀吀璁板綍 - * - * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID - * @return 缁撴灉 - */ - public int deleteDictRecordByIds(Long[] ids); - - /** - * 鍒犻櫎瀛楀吀璁板綍淇℃伅 - * - * @param id 瀛楀吀璁板綍ID - * @return 缁撴灉 - */ - public int deleteDictRecordById(Long id); - - /** - * 鍒涘缓瀛楀吀璁板綍淇℃伅琛� - */ - int createDictRecoTable(); -} diff --git a/src/main/java/com/yssh/service/IEmissionService.java b/src/main/java/com/yssh/service/IEmissionService.java deleted file mode 100644 index 9c9c490..0000000 --- a/src/main/java/com/yssh/service/IEmissionService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.yssh.service; - -import com.yssh.entity.Emission; - -import java.util.List; - -/** - * @author wMeng - * @ClassName YsshQxshService - * @Description TODO - * @date 2022/10/31 14:45 - * @Version 1.0 - */ -public interface IEmissionService { - List<Emission> query(String name); - List<Emission> getAll(); - public int insert(Emission emission); - int delete(String id); -} diff --git a/src/main/java/com/yssh/service/IExpPointServer.java b/src/main/java/com/yssh/service/IExpPointServer.java deleted file mode 100644 index 672c687..0000000 --- a/src/main/java/com/yssh/service/IExpPointServer.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.yssh.service; - -import java.io.IOException; - -import org.geotools.geojson.geom.GeometryJSON; - -public interface IExpPointServer { - - GeometryJSON selectList() throws IOException ; - -} diff --git a/src/main/java/com/yssh/service/IFeedbackService.java b/src/main/java/com/yssh/service/IFeedbackService.java deleted file mode 100644 index cb44d98..0000000 --- a/src/main/java/com/yssh/service/IFeedbackService.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.yssh.service; - -public interface IFeedbackService { - - int suYuanFeedback(Long id, String practicalId, String practicalVocsName, double practicalValue); - -} diff --git a/src/main/java/com/yssh/service/IForecastAnalyseService.java b/src/main/java/com/yssh/service/IForecastAnalyseService.java deleted file mode 100644 index d805f7c..0000000 --- a/src/main/java/com/yssh/service/IForecastAnalyseService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.yssh.service; - -import java.util.Date; -import java.util.List; - -import com.yssh.entity.vo.ForecastAnalyseVo; - -public interface IForecastAnalyseService { - - List<ForecastAnalyseVo> getForecastAnalyse(String name, Date beginTime, Date endTime); - -} diff --git a/src/main/java/com/yssh/service/ILocationService.java b/src/main/java/com/yssh/service/ILocationService.java deleted file mode 100644 index 7c6baf4..0000000 --- a/src/main/java/com/yssh/service/ILocationService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yssh.service; - -import com.yssh.entity.Location; - -import java.util.List; - -/** - * @author wMeng - * @date 2022/10/30 13:25 - * @version 1.0 - */ -public interface ILocationService { - List<Location> query(String name, String type); - - List<Location> getAll(); - - int insertLocation(Location ysshLocation); - - int deleteLocation(String id); - - List<Location> selectVocAddrs(double x, double y); -} diff --git a/src/main/java/com/yssh/service/ISuYuanService.java b/src/main/java/com/yssh/service/ISuYuanService.java deleted file mode 100644 index 31eece2..0000000 --- a/src/main/java/com/yssh/service/ISuYuanService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.yssh.service; - -import java.util.Date; -import java.util.List; -import java.util.Map; - -import com.yssh.entity.*; - -public interface ISuYuanService { - public Integer isTableExists(String tableName); - - public void insertSuYuanDatas(List<SuYuan> lists, String time) throws Exception; - - int createNewTable(String tableName); - - public List<SuYuan2d> selectSuYuan2d(Date date); - - public List<SuYuan3d> selectSuYuan3d(String name, Date date); - - public Map<String, Object> selectSuYuan100(String name, Date date); - - public Map<String, Object> selectSuYuan200(String name, Date date); - - public Map<String, Object> selectSuYuan300(String name, Date date); - - public Map<String, Object> selectSuYuan500(String name, Date date); - - public List<SuYuanMonitorData> getMonitorData(String name); - - //public List<Temporary> temporary(String name, Date date); - - public int updateVocsName(Date date, String id, String vocsName); - - public List<Qxsh> queryQxsh(Date date); - - public List<List<Coordinate>> selectRects(Double[] x, Double[] y); - - public SuYuan700 selectSuYuan700ById(String id, Date date); - - public SuYuan700 selectSuYuan46ById(String id, Date date); - - public String selectAddrByXY(double x, double y); -} diff --git a/src/main/java/com/yssh/service/IWarningAnalyseService.java b/src/main/java/com/yssh/service/IWarningAnalyseService.java deleted file mode 100644 index 7ea0b2b..0000000 --- a/src/main/java/com/yssh/service/IWarningAnalyseService.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yssh.service; - -import java.util.Date; -import java.util.List; -import java.util.Map; - -import com.yssh.entity.Qxsh; -import com.yssh.entity.Report; -import com.yssh.entity.WarningDetail; -import com.yssh.entity.vo.WarningVo; - -public interface IWarningAnalyseService { - - List<WarningVo> getRunTimeAlarmAnalyse(); - - List<WarningVo> getRunTimeWarningAnalyse(); - - void insertWarningDetails(List<WarningDetail> warning) throws Exception; - - void warningOperationStorage(Date date); - - Map<String, Integer> countThisMonthAlarmAndWarning(); - - Map<String, List<Map<String, Object>>> countEverydayAlarmAndWarning(); - - Map<String, List<Double>> selectEachLocationDataChange(); - - List<Map<String, Object>> selectThisMonthLocationValueDataTop10(); - - List<Qxsh> selectMonthTop10(); - - Map<String, List<Double>> select3Hours(); - - List<Report> getAlarmAndWarnByTime(Date begin, Date end); -} diff --git a/src/main/java/com/yssh/service/IWeatherService.java b/src/main/java/com/yssh/service/IWeatherService.java deleted file mode 100644 index 525188d..0000000 --- a/src/main/java/com/yssh/service/IWeatherService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.yssh.service; - -import com.yssh.entity.Weather; - -import java.util.List; - -/** - * @author wMeng - * @ClassName YsshWeatherService - * @Description TODO - * @date 2022/10/30 14:11 - * @Version 1.0 - */ -public interface IWeatherService { - List<Weather> query(String begin, String end); - List<Weather> getAll(); - public int insert(Weather ysshWeather); - int delete(String id); -} diff --git a/src/main/java/com/yssh/service/VocValsService.java b/src/main/java/com/yssh/service/VocValsService.java deleted file mode 100644 index e82dfcf..0000000 --- a/src/main/java/com/yssh/service/VocValsService.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.yssh.service; - -import com.google.common.collect.Lists; -import com.yssh.dao.VocValsMapper; -import com.yssh.entity.VocCoords; -import com.yssh.entity.VocVals; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.concurrent.CountDownLatch; - -@Service -public class VocValsService implements VocValsMapper { - @Resource - VocValsMapper vocValsMapper; - - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - - @Override - public List<VocVals> selectByTime(String time) { - return vocValsMapper.selectByTime(time); - } - - @Override - public int countByTime(String time) { - return vocValsMapper.countByTime(time); - } - - @Override - public List<VocCoords> selectCoords(Integer x, Integer y) { - return vocValsMapper.selectCoords(x, y); - } - - @Override - public int insert(VocVals vv) { - return vocValsMapper.insert(vv); - } - - @Override - public int inserts(List<VocVals> list) { - return vocValsMapper.inserts(list); - } - - @Override - public int deleteLastYear() { - return vocValsMapper.deleteLastYear(); - } - - @Override - public int deleteByTime(String time) { - return vocValsMapper.deleteByTime(time); - } - - public void insertVocSync(List<VocVals> list) { - List<List<VocVals>> subLists = Lists.partition(list, 100); - for (List<VocVals> sub : subLists) { - vocValsMapper.inserts(sub); - } - - logger.info("------ VOC.csv锛�" + list.size() + " 鏉℃暟鎹凡鍏ュ簱 ------"); - } - - @Async("threadPoolTaskExecutor") - public void insertVocVals(List<VocVals> list) throws InterruptedException { - List<List<VocVals>> lists = Lists.partition(list, IAsyncService.BATCH_INSERT_500); - - CountDownLatch countDownLatch = new CountDownLatch(list.size()); - for (List<VocVals> corpList : lists) { - executeAsync(corpList, countDownLatch); - } - - countDownLatch.await(); - logger.info("------ VOC.csv锛�" + lists.size() + " 鏉℃暟鎹凡鍏ュ簱 ------"); - } - - private void executeAsync(List<VocVals> corpList, CountDownLatch countDownLatch) { - try { - // 寮傛绾跨▼瑕佸仛鐨勪簨鎯� - vocValsMapper.inserts(corpList); - } finally { - // 寰堝叧閿�, 鏃犺涓婇潰绋嬪簭鏄惁寮傚父蹇呴』鎵цcountDown,鍚﹀垯await鏃犳硶閲婃斁 - countDownLatch.countDown(); - } - } -} diff --git a/src/main/java/com/yssh/service/impl/AlertConfigServiceImpl.java b/src/main/java/com/yssh/service/impl/AlertConfigServiceImpl.java deleted file mode 100644 index 1d03f16..0000000 --- a/src/main/java/com/yssh/service/impl/AlertConfigServiceImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yssh.service.impl; - -import java.util.List; - -import org.springframework.stereotype.Service; - -import com.yssh.dao.AlertConfigMapper; -import com.yssh.entity.AlertConfig; -import com.yssh.service.IAlertConfigService; - -import javax.annotation.Resource; - -@Service -public class AlertConfigServiceImpl implements IAlertConfigService { - @Resource - private AlertConfigMapper alertConfigMapper; - - @Override - public List<AlertConfig> getAll() { - return alertConfigMapper.getAll(); - } - - @Override - public List<AlertConfig> query(Integer id) { - return alertConfigMapper.query(id); - } - - @Override - public int update(AlertConfig config) { - return alertConfigMapper.update(config); - } - - public int insert(AlertConfig config) { - return alertConfigMapper.insert(config); - } - - @Override - public int delete(Integer id) { - return alertConfigMapper.delete(id); - } -} diff --git a/src/main/java/com/yssh/service/impl/AsyncServiceImpl.java b/src/main/java/com/yssh/service/impl/AsyncServiceImpl.java deleted file mode 100644 index b67103c..0000000 --- a/src/main/java/com/yssh/service/impl/AsyncServiceImpl.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yssh.service.impl; - -import java.util.List; -import java.util.concurrent.CountDownLatch; - -import org.springframework.stereotype.Service; - -import com.yssh.dao.BaseMapper; -import com.yssh.service.IAsyncService; - -@Service -public class AsyncServiceImpl implements IAsyncService { - @Override - public <T> void executeAsync(String tableName, List<T> lists, BaseMapper mapper, CountDownLatch countDownLatch) { - try{ - //寮傛绾跨▼瑕佸仛鐨勪簨鎯� - mapper.batchInsert(tableName, lists); - }finally { - countDownLatch.countDown();// 寰堝叧閿�, 鏃犺涓婇潰绋嬪簭鏄惁寮傚父蹇呴』鎵цcountDown,鍚﹀垯await鏃犳硶閲婃斁 - } - } -} diff --git a/src/main/java/com/yssh/service/impl/CommonServiceImpl.java b/src/main/java/com/yssh/service/impl/CommonServiceImpl.java deleted file mode 100644 index 84c5739..0000000 --- a/src/main/java/com/yssh/service/impl/CommonServiceImpl.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.yssh.service.impl; - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.yssh.config.CsvFilePathConfig; -import com.yssh.config.DatFilePathConfig; -import com.yssh.dao.CommonMapper; -import com.yssh.entity.MonitorPointPosition; -import com.yssh.service.ICommonService; -import com.yssh.utils.CalculateUtils; -import com.yssh.utils.StringUtils; - -import javax.annotation.Resource; - -@Service -public class CommonServiceImpl implements ICommonService { - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - - private static final String TABLE_SCHEMA = "yssh"; - - private List<MonitorPointPosition> checkPoints2d = new ArrayList<>(); - - private List<MonitorPointPosition> checkPoints3d = new ArrayList<>(); - - @Resource - private CommonMapper commonMapper; - - @Resource - protected DatFilePathConfig datFilePathConfig; - - /** - * 妫�鏌ヨ〃鏄惁瀛樺湪 - */ - @Override - public boolean checkTableExists(String tableName) { - try { - Integer count = commonMapper.checkTableExistsWithSchema(TABLE_SCHEMA, tableName); - return count == 1; - } catch (Exception e) { - logger.error("浣跨敤information_schema妫�娴嬭〃澶辫触", e); - Map<String, String> list = commonMapper.checkTableExistsWithShow(tableName); - if (StringUtils.isNotEmpty(list)) { - return true; - } - } - return false; - } - - @Override - public void readDatData() throws Exception { - File file2d = new File(datFilePathConfig.getFilePath2d()); - BufferedInputStream fis2d = new BufferedInputStream(new FileInputStream(file2d)); - BufferedReader reader2d = new BufferedReader(new InputStreamReader(fis2d, "utf-8"), 7 * 1024 * 1024);// 鐢�7M鐨勭紦鍐茶鍙栨枃鏈枃浠� - long count2d = 1; - String line2d = ""; - while ((line2d = reader2d.readLine()) != null) { - String[] f2d = line2d.split(" "); - Integer x = Integer.parseInt(f2d[0]); - Integer y = Integer.parseInt(f2d[1]); - int z = 0; - try { - z = new Double(Math.round(Integer.parseInt(f2d[2]) * 1.0 / 10)).intValue(); - } catch (Exception e) { - System.out.println(e.getStackTrace()); - } - //if (x <= 699 && y <= 699) - { - MonitorPointPosition monitorPointPosition = new MonitorPointPosition(); - monitorPointPosition.setId(x + "_" + y + "_" + z); - monitorPointPosition.setName("AI-" + (count2d < 10 ? "0" + count2d : count2d + "")); - monitorPointPosition.setX(x); - monitorPointPosition.setY(y); - monitorPointPosition.setZ(z); - monitorPointPosition.setLon(CalculateUtils.getLon(monitorPointPosition.getX(), monitorPointPosition.getY())); - monitorPointPosition.setLat(CalculateUtils.getLat(monitorPointPosition.getX(), monitorPointPosition.getY())); - checkPoints2d.add(monitorPointPosition); - count2d++; - } - } - reader2d.close(); - - File file = new File(datFilePathConfig.getFilePath3d()); - BufferedInputStream fis = new BufferedInputStream(new FileInputStream(file)); - BufferedReader reader = new BufferedReader(new InputStreamReader(fis, "utf-8"), 7 * 1024 * 1024);// 鐢�7M鐨勭紦鍐茶鍙栨枃鏈枃浠� - long count3d = 1; - String line = ""; - while ((line = reader.readLine()) != null) { - String[] f3d = line.split(" "); - Integer x = Integer.parseInt(f3d[0]); - Integer y = Integer.parseInt(f3d[1]); - int z = 0; - try { - z = new Double(Math.round(Integer.parseInt(f3d[2]) * 1.0 / 10)).intValue(); - } catch (Exception e) { - System.out.println(e.getStackTrace()); - } - if (count3d > 46) break; - { //if (x <= 699 && y <= 699) { - MonitorPointPosition monitorPointPosition = new MonitorPointPosition(); - monitorPointPosition.setId(x + "_" + y + "_" + z); - monitorPointPosition.setName("AI-" + (count3d < 10 ? "0" + count3d : count3d + "")); - monitorPointPosition.setX(x); - monitorPointPosition.setY(y); - monitorPointPosition.setZ(z); - monitorPointPosition.setLon(CalculateUtils.getLon(monitorPointPosition.getX(), monitorPointPosition.getY())); - monitorPointPosition.setLat(CalculateUtils.getLat(monitorPointPosition.getX(), monitorPointPosition.getY())); - checkPoints3d.add(monitorPointPosition); - count3d++; - } - } - reader.close(); - } - - public List<MonitorPointPosition> getCheckPoints2d() { - return checkPoints2d; - } - - public List<MonitorPointPosition> getCheckPoints3d() { - return checkPoints3d; - } - - @Override - public MonitorPointPosition select2dCheckPointByName(String name) { - for (MonitorPointPosition monitorPointPosition : checkPoints2d) { - if (monitorPointPosition.getName().equals(name)) { - return monitorPointPosition; - } - } - return null; - } - - @Override - public MonitorPointPosition select3dCheckPointByName(String name) { - for (MonitorPointPosition monitorPointPosition : checkPoints3d) { - if (monitorPointPosition.getName().equals(name)) { - return monitorPointPosition; - } - } - return null; - } - - @Override - public MonitorPointPosition select2dCheckPointById(String id) { - for (MonitorPointPosition monitorPointPosition : checkPoints2d) { - if (monitorPointPosition.getName().equals(id)) { - return monitorPointPosition; - } - } - return null; - } - - @Override - public MonitorPointPosition select3dCheckPointById(String id) { - for (MonitorPointPosition monitorPointPosition : checkPoints3d) { - //if (monitorPointPosition.getId().equals(id)) { - String subId = id.substring(0, id.lastIndexOf("_") + 1); - if (monitorPointPosition.getId().contains(subId)) { - return monitorPointPosition; - } - } - return null; - } -} diff --git a/src/main/java/com/yssh/service/impl/CountServiceImpl.java b/src/main/java/com/yssh/service/impl/CountServiceImpl.java deleted file mode 100644 index 840f0da..0000000 --- a/src/main/java/com/yssh/service/impl/CountServiceImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.yssh.service.impl; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.yssh.dao.FeedbackMapper; -import com.yssh.dao.ThuAccuracyMapper; -import com.yssh.service.ICountService; -import com.yssh.utils.DateUtils; - -@Service -public class CountServiceImpl implements ICountService { - - @Autowired - private ThuAccuracyMapper thuAccuracyMapper; - - @Autowired - private FeedbackMapper feedbackMapper; - - @Override - public Map<String, Double> selectAccuracyAvg() { - Map<String, Double> result = new HashMap<String, Double>(); - Date nowDate = DateUtils.getNowDate(); - Long beginTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getAPeriodOfTime(nowDate, -7, Calendar.DATE))); - Double thuAccuracy = thuAccuracyMapper.selectSevenDayAccuracyAvg(beginTime); - Double tempForecast = thuAccuracy == null ? 0.0 : thuAccuracy; - result.put("forecastRate", new BigDecimal(tempForecast).setScale(2, RoundingMode.HALF_UP).doubleValue()); - Double practical = feedbackMapper.selectSevenDayAccuracyAvg(beginTime); - Double tempPractical = practical == null ? 0.0 : practical; - result.put("practicalRate", new BigDecimal(tempPractical * 100).setScale(2, RoundingMode.HALF_UP).doubleValue()); - return result; - } - -} diff --git a/src/main/java/com/yssh/service/impl/DictRecordServiceImpl.java b/src/main/java/com/yssh/service/impl/DictRecordServiceImpl.java deleted file mode 100644 index 995eaad..0000000 --- a/src/main/java/com/yssh/service/impl/DictRecordServiceImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.yssh.service.impl; - -import java.util.List; - -import lombok.Synchronized; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.yssh.dao.DictRecordMapper; -import com.yssh.entity.DictRecord; -import com.yssh.service.IDictRecordService; - -import javax.annotation.Resource; - -/** - * 瀛楀吀璁板綍Service涓氬姟灞傚鐞� - * @author xingjinshuang@smartearth.cn - * @date 2023-02-06 - */ -@Service -public class DictRecordServiceImpl implements IDictRecordService { - @Resource - private DictRecordMapper dictRecordMapper; - - /** - * 鏌ヨ瀛楀吀璁板綍鍒楄〃 - * - * @param dictRecord 瀛楀吀璁板綍 - * @return 瀛楀吀璁板綍 - */ - @Override - public List<DictRecord> selectDictRecordList(DictRecord dictRecord) { - return dictRecordMapper.selectDictRecordList(dictRecord); - } - - @Override - public DictRecord selectByCreateTime(Long createTime) { - return dictRecordMapper.selectByCreateTime(createTime); - } - - /** - * 鏂板瀛楀吀璁板綍 - * - * @param dictRecord 瀛楀吀璁板綍 - * @return 缁撴灉 - */ - @Override - public int insertDictRecord(DictRecord dictRecord) { - return dictRecordMapper.insertDictRecord(dictRecord); - } - - /** - * 鍒犻櫎瀛楀吀璁板綍瀵硅薄 - * - * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID - * @return 缁撴灉 - */ - - @Override - public int deleteDictRecordByIds(Long[] ids) { - return dictRecordMapper.deleteDictRecordByIds(ids); - } - - /** - * 鍒犻櫎瀛楀吀璁板綍淇℃伅 - * - * @param id 瀛楀吀璁板綍ID - * @return 缁撴灉 - */ - @Override - public int deleteDictRecordById(Long id) { - return dictRecordMapper.deleteDictRecordById(id); - } - - /** - * 鍒涘缓瀛楀吀璁板綍淇℃伅琛ㄦ帴鍙� - */ - @Transactional(rollbackFor = Exception.class) - @Synchronized - @Override - public int createDictRecoTable() { - return dictRecordMapper.createDictRecoTable(); - } -} diff --git a/src/main/java/com/yssh/service/impl/EmissionServiceImpl.java b/src/main/java/com/yssh/service/impl/EmissionServiceImpl.java deleted file mode 100644 index e9ff33d..0000000 --- a/src/main/java/com/yssh/service/impl/EmissionServiceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.yssh.service.impl; - -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.yssh.dao.EmissionMapper; -import com.yssh.entity.Emission; -import com.yssh.service.IEmissionService; - -/** - * @author wMeng - * @ClassName YsshQxshServiceImpl - * @Description TODO - * @date 2022/10/31 14:45 - * @Version 1.0 - */ -@Service -public class EmissionServiceImpl implements IEmissionService { - - @Autowired - private EmissionMapper emissionMapper; - - @Override - public List<Emission> query(String name) { - return emissionMapper.query(name); - } - @Override - public List<Emission> getAll() { - return emissionMapper.getAll(); - } - @Override - public int insert(Emission emission) { - return emissionMapper.insert(emission); - } - @Override - public int delete(String id) { - return emissionMapper.delete(id); - } - -} diff --git a/src/main/java/com/yssh/service/impl/ExpPointServerImpl.java b/src/main/java/com/yssh/service/impl/ExpPointServerImpl.java deleted file mode 100644 index c5178c0..0000000 --- a/src/main/java/com/yssh/service/impl/ExpPointServerImpl.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.yssh.service.impl; - -import java.io.IOException; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; - -import org.geotools.geojson.geom.GeometryJSON; -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryFactory; -import org.locationtech.jts.triangulate.DelaunayTriangulationBuilder; -import org.locationtech.jts.triangulate.VoronoiDiagramBuilder; -import org.springframework.stereotype.Service; - -import com.yssh.dao.ExpPointMapper; -import com.yssh.entity.ExpPoint; -import com.yssh.entity.Stratum; -import com.yssh.service.IExpPointServer; -import com.yssh.utils.GisUtil; - -import javax.annotation.Resource; - -@Service -public class ExpPointServerImpl implements IExpPointServer { - @Resource - private ExpPointMapper expPointMapper; - - @Override - public GeometryJSON selectList() throws IOException { - String sourceCRS = "EPSG:4530"; - String targetCRS = "EPSG:4490"; - List<ExpPoint> list = expPointMapper.selectList(); - System.err.println(list.size()); - /*AtomicInteger i = new AtomicInteger(0); - Coordinate[] coordinates = new Coordinate[list.size()];*/ - List<Coordinate> coordinates = new ArrayList<>(); - list.forEach(e -> { - Coordinate transform = GisUtil.coordinateTransform(sourceCRS, targetCRS, e.getOrdinateX(), e.getAbscissaY()); - transform.setZ(e.getElevation()); - coordinates.add(transform); - }); - - //鍒涘缓Delaunay涓夎缃戯細 - DelaunayTriangulationBuilder builder = new DelaunayTriangulationBuilder(); - builder.setSites(coordinates); - Geometry geo = builder.getEdges(new GeometryFactory()); - - GeometryJSON geometryJson = new GeometryJSON(6); - StringWriter writer = new StringWriter(); - geometryJson.write(geo, writer); - System.err.println(writer.toString()); - writer.close(); - - int numPoints = geo.getNumPoints(); - return geometryJson; - } - - public List<ExpPoint> selectList2() { - String sourceCRS = "EPSG:4530"; - String targetCRS = "EPSG:4490"; - List<ExpPoint> list = expPointMapper.selectList(); - System.err.println(list.size()); - AtomicInteger i = new AtomicInteger(0); - Coordinate[] coordinates = new Coordinate[list.size()]; - list.forEach(e -> { - Coordinate transform = GisUtil.coordinateTransform(sourceCRS, targetCRS, e.getOrdinateX(), e.getAbscissaY()); - transform.setZ(e.getElevation()); - coordinates[i.intValue()] = transform; - }); - - //鍒涘缓Delaunay涓夎缃戯細 - /*GeometryFactory geoFactory = new GeometryFactory(); - ConformingDelaunayTriangulationBuilder builder = new ConformingDelaunayTriangulationBuilder(); - builder.setSites(geoFactory.createMultiPointFromCoords(coordinates));*/ - GeometryFactory geoFactory = new GeometryFactory(); - VoronoiDiagramBuilder voronoiBuilder = new VoronoiDiagramBuilder(); - voronoiBuilder.setSites(geoFactory.createMultiPointFromCoords(coordinates)); - Geometry geo =voronoiBuilder.getDiagram(geoFactory); - - int numPoints = geo.getNumPoints(); - - /*List<Coordinate> cs = new ArrayList<>(Arrays.asList(geo.getCoordinates())); - cs.forEach(c -> { - System.out.println(c.getY() + " " + c.getX() + " " + c.getZ()); - });*/ - System.out.println(numPoints); - - /*String text = union.toText(); - System.out.println(text);*/ - - /*List<String> expSiteNumbers = new ArrayList<>(); - list.forEach(e -> {expSiteNumbers.add(e.getExpSiteNumber());}); - //绗竴灞� - List<Stratum> one = stratumMapper.selectByExpSiteNumbers(expSiteNumbers); - //1銆佽幏鍙栦竴娆″眰缁撴瀯鍒嗙被 - List<Stratum> geotechnicalNames = filterGeotechnicalName(one); - //2銆侀亶鍘嗙粨鏋勫垎绫� - geotechnicalNames.forEach(s -> { - System.err.println(s.toString()); - Map<String, Object> param = new HashMap<>(); - param.put("expSiteNumber", s.getExpSiteNumber()); - param.put("geotechnicalName", s.getGeotechnicalName()); - param.put("start", 1); - param.put("rows", 1); - Stratum stratum = stratumMapper.selectByGeotechnicalName(param); - System.err.println(stratum); - - }); - List<String> ess = new ArrayList<>(); - one.forEach(s -> { - String geotechnicalName = "绮夎川榛忓湡"; - if (s.getGeotechnicalName().equals(geotechnicalName)) { - Map<String, Object> param = new HashMap<>(); - param.put("expSiteNumber", s.getExpSiteNumber()); - param.put("geotechnicalName", s.getGeotechnicalName()); - param.put("start", 1); - param.put("rows", 1); - Stratum stratum = stratumMapper.selectByGeotechnicalName(param); - if (StringUtils.isNotNull(stratum)) { - s.setLayerDepth(stratum.getLayerDepth()); - } - ess.add(s.getExpSiteNumber()); - } - }); - List<ExpPoint> numbers = expPointMapper.selectByExpSiteNumbers(ess); - numbers.forEach(e -> { - Coordinate transform = GisUtil.coordinateTransform(sourceCRS, targetCRS, e.getOrdinateX(), e.getAbscissaY()); - one.forEach(s -> { - if (s.getExpSiteNumber().equals(e.getExpSiteNumber())) { - e.setElevation(e.getElevation() - s.getLayerDepth()); - } - }); - System.err.println("------"); - System.out.println(transform.getY() + " " + transform.getX() + " " + e.getElevation()); - });*/ - /*Boolean flag = true; - while (flag) { - }*/ - - //绗簩灞� - /*List<Stratum> two = stratumMapper.select(e.getExpSiteNumber(), 1, 1); - two.forEach(s -> { - System.out.println(s.toString()); - }); - //绗笁灞� - List<Stratum> three = stratumMapper.select(e.getExpSiteNumber(), 2, 1); - three.forEach(s -> { - System.err.println(s.toString()); - }); - System.out.println();*/ - - //3銆佽幏鍙栫浜屽眰璇ョ粨鏋勭殑淇℃伅 - //4銆侀亶鍘嗙涓夊眰鏄弧瓒虫潯浠剁殑鐐逛綅 - return list; - } - - private List<Stratum> filterGeotechnicalName(List<Stratum> list){ - List<Stratum> result = new ArrayList<Stratum>(); - List<String> temp = new ArrayList<String>(); - list.forEach(e -> { - String geotechnicalName = e.getGeotechnicalName(); - if (!temp.contains(geotechnicalName)) { - result.add(e); - temp.add(geotechnicalName); - } - }); - return result; - } -} diff --git a/src/main/java/com/yssh/service/impl/FeedbackServiceImpl.java b/src/main/java/com/yssh/service/impl/FeedbackServiceImpl.java deleted file mode 100644 index 7c2238e..0000000 --- a/src/main/java/com/yssh/service/impl/FeedbackServiceImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.yssh.service.impl; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.yssh.dao.FeedbackMapper; -import com.yssh.dao.SuYuanMapper; -import com.yssh.entity.FeedbackDetail; -import com.yssh.service.IFeedbackService; - -@Service -public class FeedbackServiceImpl implements IFeedbackService { - - @Autowired - private FeedbackMapper feedbackMapper; - - @Autowired - private SuYuanMapper suYuanMapper; - - @Override - @Transactional - public int suYuanFeedback(Long id, String practicalId, String practicalVocsName, double practicalValue) { - FeedbackDetail feedback = feedbackMapper.selectById(id); - int i = suYuanMapper.update(feedback.getTableName(), practicalId, String.valueOf(practicalValue)); - FeedbackDetail feedbackDetail = new FeedbackDetail(); - feedbackDetail.setId(id); - feedbackDetail.setPracticalId(practicalId); - feedbackDetail.setPracticalVocsName(practicalVocsName); - feedbackDetail.setPracticalValue(practicalValue); - return feedbackMapper.update(feedbackDetail) + i; - } - -} diff --git a/src/main/java/com/yssh/service/impl/ForecastAnalyseServiceImpl.java b/src/main/java/com/yssh/service/impl/ForecastAnalyseServiceImpl.java deleted file mode 100644 index aaefe23..0000000 --- a/src/main/java/com/yssh/service/impl/ForecastAnalyseServiceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.yssh.service.impl; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.yssh.dao.DictRecordMapper; -import com.yssh.dao.SuYuanMapper; -import com.yssh.dao.ThuAccuracyMapper; -import com.yssh.entity.DictRecord; -import com.yssh.entity.MonitorPointPosition; -import com.yssh.entity.SuYuanMonitorData; -import com.yssh.entity.ThuAccuracy; -import com.yssh.entity.vo.ForecastAnalyseVo; -import com.yssh.service.ICommonService; -import com.yssh.service.IForecastAnalyseService; -import com.yssh.utils.DateUtils; -import com.yssh.utils.StringUtils; - -import javax.annotation.Resource; - -@Service -public class ForecastAnalyseServiceImpl implements IForecastAnalyseService{ - @Resource - private ICommonService commonService; - - @Resource - private SuYuanMapper suYuanMapper; - - @Resource - private DictRecordMapper dictRecordMapper; - - @Resource - private ThuAccuracyMapper thuAccuracyMapper; - - @Override - public List<ForecastAnalyseVo> getForecastAnalyse(String name, Date beginTime, Date endTime) { - List<ForecastAnalyseVo> result = new ArrayList<ForecastAnalyseVo>(); - MonitorPointPosition checkPoint = commonService.select3dCheckPointByName(name); - if (StringUtils.isNull(checkPoint)) { - return null; - } - List<DictRecord> dictRecordList = dictRecordMapper.selectByTimeDictRecordList(Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, beginTime)), Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, endTime))); - List<String> tableNames = new ArrayList<String>(); - dictRecordList.forEach(r -> {tableNames.add(r.getTableName());}); - if (StringUtils.isNotEmpty(tableNames)) { - List<SuYuanMonitorData> monitorDatas = suYuanMapper.getMonitorData(tableNames, checkPoint.getId()); - monitorDatas.forEach(m -> { - result.add(new ForecastAnalyseVo(0.0, m.getValue(), new Long(m.getTime()))); - }); - Map<String, Object> param = new HashMap<String, Object>(); - param.put("name", name); - param.put("beginTime", beginTime); - param.put("endTime", endTime); - List<ThuAccuracy> data = thuAccuracyMapper.getForecastData(param); - data.forEach(s -> { - result.forEach(r -> { - if(Long.valueOf(s.getTime()).longValue() == r.getTime().longValue()){ - r.setForecastValue(Double.valueOf(s.getValue())); - } - }); - }); - } - return result; - } -} diff --git a/src/main/java/com/yssh/service/impl/LocationServiceImpl.java b/src/main/java/com/yssh/service/impl/LocationServiceImpl.java deleted file mode 100644 index d8eec96..0000000 --- a/src/main/java/com/yssh/service/impl/LocationServiceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.yssh.service.impl; - -import com.yssh.dao.LocationMapper; -import com.yssh.entity.Location; -import com.yssh.service.ILocationService; -import com.yssh.utils.CalculateUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; - -/** - * @author wMeng - * @date 2022/10/30 13:25 - * @version 1.0 - */ -@Service -public class LocationServiceImpl implements ILocationService { - @Resource - private LocationMapper mapper; - - private static List<Location> vocAddrs = null; - - @Override - public List<Location> query(String name, String type) { - return mapper.query(name, type); - } - - @Override - public List<Location> getAll() { - return mapper.getAll(); - } - - @Override - public int insertLocation(Location location) { - return mapper.insertLocation(location); - } - - @Override - public int deleteLocation(String id) { - return mapper.deleteLocation(id); - } - - @Override - public List<Location> selectVocAddrs(double x, double y) { - if (null == vocAddrs) { - vocAddrs = mapper.selectVocAddrs(); - - for (Location loc : vocAddrs) { - double X = CalculateUtils.getLon((int) loc.getLon(), (int) loc.getLat()); - double Y = CalculateUtils.getLat((int) loc.getLon(), (int) loc.getLat()); - loc.setLon(X); - loc.setLat(Y); - } - } - - List<Location> list = new ArrayList<>(); - for (Location loc : vocAddrs) { - if (Math.abs(loc.getLon() - x) <= 0.00009 && Math.abs(loc.getLat() - y) <= 0.00009) { - list.add(loc); - } - } - - return list; - } -} diff --git a/src/main/java/com/yssh/service/impl/SuYuanServiceImpl.java b/src/main/java/com/yssh/service/impl/SuYuanServiceImpl.java deleted file mode 100644 index 9e7a9c5..0000000 --- a/src/main/java/com/yssh/service/impl/SuYuanServiceImpl.java +++ /dev/null @@ -1,330 +0,0 @@ -package com.yssh.service.impl; - -import java.util.*; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.atomic.AtomicInteger; - -import com.yssh.dao.*; -import com.yssh.entity.*; -import com.yssh.utils.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; - -import com.google.common.collect.Lists; -import com.yssh.service.IAsyncService; -import com.yssh.service.ICommonService; -import com.yssh.service.ISuYuanService; - -import javax.annotation.Resource; - -@Service -public class SuYuanServiceImpl implements ISuYuanService { - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - - @Resource - private SuYuanMapper suYuanMapper; - - @Resource - private IAsyncService asyncService; - - @Resource - private DictRecordMapper dictRecordMapper; - - @Resource - private ICommonService commonService; - - @Resource - private FeedbackMapper feedbackMapper; - - @Resource - private QxshMapper qxshMapper; - - @Resource - private LocationMapper locationMapper; - - @Resource - private LocationServiceImpl locService; - - //@Transactional - //@Override - @Async("threadPoolTaskExecutor") - public void insertSuYuanDatasAsync(List<SuYuan> lists, String time) throws Exception { - //鎻掑叆鏁版嵁 - List<List<SuYuan>> list = Lists.partition(lists, IAsyncService.BATCH_INSERT_NUMBER); - CountDownLatch countDownLatch = new CountDownLatch(list.size()); - for (List<SuYuan> corpReserveList : list) { - asyncService.executeAsync(TableStrategy.getTableStrategy(time), corpReserveList, suYuanMapper, countDownLatch); - } - countDownLatch.await(); - logger.info(lists.size() + "鏉℃暟鎹叆搴撳畬鎴�-----"); - } - - @Override - public void insertSuYuanDatas(List<SuYuan> lists, String time) { - List<List<SuYuan>> subLists = Lists.partition(lists, IAsyncService.BATCH_INSERT_NUMBER); - for (List<SuYuan> sub : subLists) { - suYuanMapper.batchInsert(TableStrategy.getTableStrategy(time), sub); - } - - logger.info("------ " + time + ".csv锛�" + lists.size() + " 鏉℃暟鎹凡鍏ュ簱 ------"); - } - - @Override - public Integer isTableExists(String tableName) { - return suYuanMapper.isTableExists(tableName); - } - - @Override - public int createNewTable(String tableName) { - return suYuanMapper.createTable(tableName); - } - - @Override - public List<SuYuan2d> selectSuYuan2d(Date date) { - String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, date); - List<String> ids2d = CalculateUtils.assembleId(commonService.getCheckPoints2d()); - DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); - if (StringUtils.isNull(dictRecord)) { - return null; - } - return suYuanMapper.get2d(dictRecord.getTableName(), ids2d); - } - - @Override - public List<SuYuan3d> selectSuYuan3d(String name, Date date) { - MonitorPointPosition checkPoint = commonService.select3dCheckPointByName(name); - if (StringUtils.isNull(checkPoint)) { - return null; - } - int range = 10; - String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, date); - List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(checkPoint, range); - DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); - if (StringUtils.isNull(dictRecord)) { - return null; - } - return suYuanMapper.get3d(dictRecord.getTableName(), ids3d); - } - - @Override - public Map<String, Object> selectSuYuan100(String name, Date date) { - Map<String, Object> result = new HashMap<String, Object>(); - MonitorPointPosition checkPoint = commonService.select3dCheckPointByName(name); - if (StringUtils.isNull(checkPoint)) { - return null; - } - int range = 10; - String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, date); - List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(checkPoint, range); - DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); - if (StringUtils.isNull(dictRecord)) { - return null; - } - List<DistanceSuYuan> list = suYuanMapper.getDistanceSuYuan(dictRecord.getTableName(), ids3d); - AtomicInteger i = new AtomicInteger(0); - list.stream().forEach(s -> { - s.setName(checkPoint.getName()); - i.getAndIncrement(); - s.setVocsName(checkPoint.getName() + "-" + i.longValue()); - }); - if (StringUtils.isNotEmpty(list)) { - Collections.sort(list); - DistanceSuYuan max = list.get(0); - FeedbackDetail feedbackDetail = new FeedbackDetail(null, dictRecord.getTableName(), - max.getName(), max.getId(), max.getVocsName(), max.getVocsValue(), null, null, null, DateUtils.getNowDate()); - feedbackMapper.insert(feedbackDetail); - result.put("feedbackId", feedbackDetail.getId()); - } - result.put("data", list); - return result; - } - - @Override - public Map<String, Object> selectSuYuan200(String name, Date date) { - Map<String, Object> result = new HashMap<String, Object>(); - MonitorPointPosition checkPoint = commonService.select3dCheckPointByName(name); - if (StringUtils.isNull(checkPoint)) { - return null; - } - int range = 20; - String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, date); - List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(checkPoint, range); - DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); - if (StringUtils.isNull(dictRecord)) { - return null; - } - List<DistanceSuYuan> list = suYuanMapper.getDistanceSuYuan(dictRecord.getTableName(), ids3d); - AtomicInteger i = new AtomicInteger(0); - list.stream().forEach(s -> { - s.setName(checkPoint.getName()); - i.getAndIncrement(); - s.setVocsName(checkPoint.getName() + "-" + i.longValue()); - }); - if (StringUtils.isNotEmpty(list)) { - Collections.sort(list); - DistanceSuYuan max = list.get(0); - FeedbackDetail feedbackDetail = new FeedbackDetail(null, dictRecord.getTableName(), - max.getName(), max.getId(), max.getVocsName(), max.getVocsValue(), null, null, null, DateUtils.getNowDate()); - feedbackMapper.insert(feedbackDetail); - result.put("feedbackId", feedbackDetail.getId()); - } - result.put("data", list); - return result; - } - - @Override - public Map<String, Object> selectSuYuan300(String name, Date date) { - Map<String, Object> result = new HashMap<String, Object>(); - MonitorPointPosition checkPoint = commonService.select3dCheckPointByName(name); - if (StringUtils.isNull(checkPoint)) { - return null; - } - int range = 30; - String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, date); - List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(checkPoint, range); - DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); - if (StringUtils.isNull(dictRecord)) { - return null; - } - List<DistanceSuYuan> list = suYuanMapper.getDistanceSuYuan(dictRecord.getTableName(), ids3d); - AtomicInteger i = new AtomicInteger(0); - list.stream().forEach(s -> { - s.setName(checkPoint.getName()); - i.getAndIncrement(); - s.setVocsName(checkPoint.getName() + "-" + i.longValue()); - }); - if (StringUtils.isNotEmpty(list)) { - Collections.sort(list); - DistanceSuYuan max = list.get(0); - FeedbackDetail feedbackDetail = new FeedbackDetail(null, dictRecord.getTableName(), - max.getName(), max.getId(), max.getVocsName(), max.getVocsValue(), null, null, null, DateUtils.getNowDate()); - feedbackMapper.insert(feedbackDetail); - result.put("feedbackId", feedbackDetail.getId()); - } - result.put("data", list); - return result; - } - - @Override - public Map<String, Object> selectSuYuan500(String name, Date date) { - Map<String, Object> result = new HashMap<String, Object>(); - MonitorPointPosition checkPoint = commonService.select3dCheckPointByName(name); - if (StringUtils.isNull(checkPoint)) { - return null; - } - int range = 50; - String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, date); - List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(checkPoint, range); - DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); - if (StringUtils.isNull(dictRecord)) { - return null; - } - List<DistanceSuYuan> list = suYuanMapper.getDistanceSuYuan(dictRecord.getTableName(), ids3d); - AtomicInteger i = new AtomicInteger(0); - list.stream().forEach(s -> { - s.setName(checkPoint.getName()); - i.getAndIncrement(); - s.setVocsName(checkPoint.getName() + "-" + i.longValue()); - }); - if (StringUtils.isNotEmpty(list)) { - Collections.sort(list); - DistanceSuYuan max = list.get(0); - FeedbackDetail feedbackDetail = new FeedbackDetail(null, dictRecord.getTableName(), - max.getName(), max.getId(), max.getVocsName(), max.getVocsValue(), null, null, null, DateUtils.getNowDate()); - feedbackMapper.insert(feedbackDetail); - result.put("feedbackId", feedbackDetail.getId()); - } - result.put("data", list); - return result; - } - - @Override - public List<SuYuanMonitorData> getMonitorData(String name) { - MonitorPointPosition checkPoint = commonService.select3dCheckPointByName(name); - if (StringUtils.isNull(checkPoint)) { - return null; - } - - /*List<DictRecord> recordList = dictRecordMapper.selectDictRecordList(new DictRecord()); - - List<String> tableNames = new ArrayList<String>(); - for (DictRecord dr : recordList) { - if (suYuanMapper.isTableExists(dr.getTableName()) > 0) { - tableNames.add(dr.getTableName()); - } - } - - return suYuanMapper.getMonitorData(tableNames, checkPoint.getX() + "_" + checkPoint.getY() + "_" + checkPoint.getZ());*/ - - Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.HOUR_OF_DAY, 23); - String end = DateUtils.getYyyyMmDdHh(calendar.getTime()); //dateFormat.format(calendar.getTime()); - - calendar.set(Calendar.HOUR_OF_DAY, 0); - calendar.add(Calendar.DATE, -7); - String start = DateUtils.getYyyyMmDdHh(calendar.getTime()); - - return suYuanMapper.getNewMonitorData(checkPoint.getName(), start, end); - } - - @Override - public int updateVocsName(Date date, String id, String vocsName) { - String table = "su_yuan_" + DateUtils.getYyyyMmDdHh(date); // new Date() - if (isTableExists(table) == 0) { - return 0; - } - - //return suYuanMapper.updateVocsName(table, id, vocsName); - return 1; - } - - @Override - public List<Qxsh> queryQxsh(Date date) { - String time = DateUtils.getYyyyMmDdHh(date); - - return qxshMapper.selectByTime(time); - } - - @Override - public List<List<Coordinate>> selectRects(Double[] x, Double[] y) { - List<List<Coordinate>> list = new ArrayList<>(); - for (int i = 0; i < x.length; i++) { - list.add(CalculateUtils.calcRect(x[i], y[i])); - } - - return list; - } - - @Override - public SuYuan700 selectSuYuan700ById(String id, Date date) { - id = id.substring(0, id.lastIndexOf("_") + 1) + "0"; - String time = DateUtils.getYyyyMmDdHhMmSs(date).substring(0, 13) + ":00:00"; - - return suYuanMapper.selectSuYuan700ById(id, time); - } - - @Override - public SuYuan700 selectSuYuan46ById(String id, Date date) { - id = id.substring(0, id.lastIndexOf("_") + 1) + "0"; - String time = DateUtils.getYyyyMmDdHhMmSs(date).substring(0, 13) + ":00:00"; - - return suYuanMapper.selectSuYuan46ById(id, time); - } - - @Override - public String selectAddrByXY(double x, double y) { - List<Location> locations = locationMapper.selectByXY(x, y); - if (null != locations && locations.size() > 0) { - return locations.get(0).getName(); - } - - locations = locService.selectVocAddrs(x, y); - if (null != locations && locations.size() > 0) { - return locations.get(0).getName(); - } - - return null; - } -} diff --git a/src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java b/src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java deleted file mode 100644 index b533339..0000000 --- a/src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java +++ /dev/null @@ -1,408 +0,0 @@ -package com.yssh.service.impl; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CountDownLatch; - -import com.yssh.dao.*; -import com.yssh.entity.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; - -import com.google.common.collect.Lists; -import com.yssh.entity.vo.WarningVo; -import com.yssh.service.IAsyncService; -import com.yssh.service.ICommonService; -import com.yssh.service.IWarningAnalyseService; -import com.yssh.utils.CalculateUtils; -import com.yssh.utils.DateUtils; -import com.yssh.utils.StringUtils; - -import javax.annotation.Resource; - -@Service -public class WarningAnalyseServiceImpl implements IWarningAnalyseService { - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - - @Resource - private WarningDetailMapper warningDetailMapper; - - @Resource - private ICommonService commonService; - - @Resource - private SuYuanMapper suYuanMapper; - - @Resource - private DictRecordMapper dictRecordMapper; - - @Resource - private IAsyncService asyncService; - - @Resource - private QxshMapper qxshMapper; - - private SimpleDateFormat ym = new SimpleDateFormat("yyyyMM%"); - - @Override - @Async("threadPoolTaskExecutor") - public void insertWarningDetails(List<WarningDetail> warning) throws Exception { - //鎻掑叆鏁版嵁 - List<List<WarningDetail>> list = Lists.partition(warning, IAsyncService.BATCH_INSERT_NUMBER); - CountDownLatch countDownLatch = new CountDownLatch(list.size()); - for (List<WarningDetail> corpReserveList : list) { - asyncService.executeAsync("", corpReserveList, warningDetailMapper, countDownLatch); - } - countDownLatch.await(); - } - - @Override - public List<WarningVo> getRunTimeAlarmAnalyse() { - List<WarningVo> result = new ArrayList<>(); - Date nowDate = DateUtils.getNowDate(); - //String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, nowDate); - //DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); - //if (StringUtils.isNull(dictRecord)) { - // nowDate = DateUtils.getAPeriodOfTime(nowDate, -1, Calendar.HOUR_OF_DAY); - //} - //List<WarningDetail> list = alarmAnalyseOperation(nowDate); - - List<WarningDetail> list = new ArrayList<>(); - Calendar calendar = getCalendar(nowDate); - for (int i = 0; i < 6; i++) { - calendar.add(Calendar.HOUR, -1); - List<WarningDetail> rs = getAlarmWarnAnalyse(calendar.getTime(), false); - if (null != rs && rs.size() > 0) { - list.addAll(rs); - } - } - list.forEach(s -> { - String time = DateUtils.getYyyyMmDdHh(s.getCreateTime()); - result.add(new WarningVo(s.getLocationName(), s.getSuYuanId(), 0.0, 0.0, s.getValue(), time)); - }); - return result; - } - - private Calendar getCalendar(Date nowDate) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(nowDate); - calendar.add(Calendar.HOUR, 1); - - return calendar; - } - - @Override - public List<WarningVo> getRunTimeWarningAnalyse() { - List<WarningVo> result = new ArrayList<>(); - Date nowDate = DateUtils.getNowDate(); - //String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, nowDate); - //DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); - //if (StringUtils.isNull(dictRecord)) { - // nowDate = DateUtils.getAPeriodOfTime(nowDate, -1, Calendar.HOUR_OF_DAY); - //} - //List<WarningDetail> list = warningAnalyseOperation(nowDate); - - List<WarningDetail> list = new ArrayList<>(); - Calendar calendar = getCalendar(nowDate); - for (int i = 0; i < 6; i++) { - calendar.add(Calendar.HOUR, -1); - List<WarningDetail> rs = getAlarmWarnAnalyse(calendar.getTime(), true); - if (null != rs && rs.size() > 0) { - list.addAll(rs); - } - } - list.forEach(s -> { - String time = DateUtils.getYyyyMmDdHh(s.getCreateTime()); - result.add(new WarningVo(s.getLocationName(), s.getSuYuanId(), 0.0, 0.0, s.getValue(), time)); - }); - return result; - } - - private List<WarningDetail> getAlarmWarnAnalyse(Date date, boolean isWarn) { - List<String> ids = CalculateUtils.assembleId(commonService.getCheckPoints3d()); - - String time = DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, date); - DictRecord dictRecord = dictRecordMapper.selectByCreateTime(Long.parseLong(time)); - if (null == dictRecord) return null; - - String tableName = dictRecord.getTableName(); - if (suYuanMapper.isTableExists(tableName) == 0) return null; - - List<SuYuan2d> list = isWarn ? suYuanMapper.getWarningAnalyse(tableName, ids) : suYuanMapper.getAlarmsAnalyse(tableName, ids); - if (null == list || list.isEmpty()) { - return null; - } - - int type = isWarn ? 1 : 0; - List<WarningDetail> result = new ArrayList<>(); - for (SuYuan2d s : list) { - String locationName = commonService.select3dCheckPointById(s.getId()).getName(); - result.add(new WarningDetail(0L, tableName, s.getId(), locationName, date, type, s.getValue())); - } - - return result; - } - - @Override - public void warningOperationStorage(Date date) { - List<WarningDetail> allData = new ArrayList<>(); - List<WarningDetail> alarms = this.getAlarmWarnAnalyse(date, false); - if (StringUtils.isNotEmpty(alarms)) { - allData.addAll(alarms); - } - - List<WarningDetail> warnings = this.getAlarmWarnAnalyse(date, true); - if (StringUtils.isNotEmpty(warnings)) { - allData.addAll(warnings); - } - - if (StringUtils.isNotEmpty(allData)) { - try { - insertWarningDetails(allData); - } catch (Exception e) { - logger.error("鎵归噺鎻掑叆鍛婅鏁版嵁鍑虹幇寮傚父锛侊紒锛�", e); - e.printStackTrace(); - } - } - } - - @Override - public Map<String, Integer> countThisMonthAlarmAndWarning() { - Map<String, Integer> result = new HashMap<>(); - Map<String, Object> param = new HashMap<>(); - param.put("startTime", DateUtils.getYyyyMmDdHhMmSs(DateUtils.getMonthStart())); - param.put("endTime", DateUtils.getYyyyMmDdHhMmSs(DateUtils.getMonthEnd())); - - /*param.put("type", 0); - List<WarningVo> alarms = warningDetailMapper.selectWarningDetailByMap(param); - if (StringUtils.isNull(alarms)) { - alarms = new ArrayList<>(); - } - result.put("alarmNumber", alarms.size());*/ - Integer alarmNum = warningDetailMapper.countAlarmByMap(param); - result.put("alarmNumber", null == alarmNum ? 0 : alarmNum); - - param.put("type", 1); - /*List<WarningVo> warnings = warningDetailMapper.selectWarningDetailByMap(param); - if (StringUtils.isNull(warnings)) { - warnings = new ArrayList<>(); - } - result.put("warningNumber", warnings.size());*/ - Integer warnNum = warningDetailMapper.countWarnByMap(param); - result.put("warningNumber", null == warnNum ? 0 : warnNum); - - return result; - } - - @Override - public Map<String, List<Map<String, Object>>> countEverydayAlarmAndWarning() { - Map<String, List<Map<String, Object>>> result = new HashMap<>(); - - Map<String, Object> param = new HashMap<String, Object>(); - Date now = new Date(); - Date last = DateUtils.getAPeriodOfTime(now, -7, Calendar.DATE); // 涓婂懆鐨勪粖澶� - param.put("startTime", DateUtils.getYyyyMmDdHhMmSs(last)); - param.put("endTime", DateUtils.getYyyyMmDdHhMmSs(now)); - - param.put("type", 0); - List<Map<String, Object>> alarmDayCount = warningDetailMapper.selectWarningDayCountByMap(param); - result.put("alarmDayCount", alarmDayCount); - - param.put("type", 1); - List<Map<String, Object>> warningDayCount = warningDetailMapper.selectWarningDayCountByMap(param); - result.put("warningDayCount", warningDayCount); - - return result; - } - - @Override - public Map<String, List<Double>> selectEachLocationDataChange() { - /*Map<String, List<Double>> result = new LinkedHashMap<>(); - List<MonitorPointPosition> checkPoints = commonService.getCheckPoints3d(); - Date nowDate = DateUtils.getNowDate(); - Long endTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, nowDate)); - Long startTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getAPeriodOfTime(nowDate, -3, Calendar.HOUR_OF_DAY))); - List<DictRecord> recordList = dictRecordMapper.selectByTimeDictRecordList(startTime, endTime); - checkPoints.forEach(c -> { - List<String> tableNames = new ArrayList<>(); - recordList.forEach(r -> { - tableNames.add(r.getTableName()); - }); - List<Double> values = new ArrayList<>(); - if (StringUtils.isNotNull(tableNames)) { - List<SuYuanMonitorData> data = suYuanMapper.getMonitorData(tableNames, c.getId()); - data.forEach(v -> { - values.add(v.getValue()); - }); - result.put(c.getName(), values); - } - }); - return result;*/ - - Map<String, List<Double>> result = new LinkedHashMap<>(); - List<MonitorPointPosition> checkPoints = commonService.getCheckPoints3d(); - Date nowDate = DateUtils.getNowDate(); - Long endTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, nowDate)); - Long startTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getAPeriodOfTime(nowDate, -3, Calendar.HOUR_OF_DAY))); - List<DictRecord> recordList = dictRecordMapper.selectByTimeDictRecordList(startTime, endTime); - - List<String> tableNames = new ArrayList<>(); - for (DictRecord dr : recordList) { - if (suYuanMapper.isTableExists(dr.getTableName()) > 0) { - tableNames.add(dr.getTableName()); - } - } - if (tableNames.isEmpty()) { - return result; - } - - for (MonitorPointPosition c : checkPoints) { - List<Double> values = new ArrayList<>(); - List<SuYuanMonitorData> data = suYuanMapper.getMonitorData(tableNames, c.getId()); - if (null != data && data.size() > 0) { - for (SuYuanMonitorData v : data) { - values.add(v.getValue()); - } - } - result.put(c.getName(), values); - } - return result; - } - - @Override - public List<Map<String, Object>> selectThisMonthLocationValueDataTop10() { - /*List<Map<String, Object>> result = new ArrayList<>(); - List<MonitorPointPosition> checkPoints = commonService.getCheckPoints3d(); - Long startTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getMonthStart())); - Long endTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getMonthEnd())); - List<DictRecord> recordList = dictRecordMapper.selectByTimeDictRecordList(startTime, endTime); - checkPoints.forEach(c -> { - List<String> tableNames = new ArrayList<>(); - recordList.forEach(r -> { - tableNames.add(r.getTableName()); - }); - Map<String, Object> map = suYuanMapper.getMonthValueDataMax(tableNames, c.getId()); - if (StringUtils.isNotNull(map) && StringUtils.isNotEmpty(map)) { - String suYuanId = map.get("id").toString(); - map.put("name", commonService.select3dCheckPointById(suYuanId).getName()); - map.remove("id"); - } - result.add(map); - }); - return CalculateUtils.sort(result, "value", true).subList(0, 10);*/ - - List<Map<String, Object>> result = new ArrayList<>(); - List<MonitorPointPosition> checkPoints = commonService.getCheckPoints3d(); - Long startTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getMonthStart())); - Long endTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getMonthEnd())); - //startTime = 2023040100L; - //endTime = 2023043023L; - - List<DictRecord> recordList = dictRecordMapper.selectByTimeDictRecordList(startTime, endTime); - - List<String> tableNames = new ArrayList<>(); - for (DictRecord dr : recordList) { - if (suYuanMapper.isTableExists(dr.getTableName()) > 0) { - tableNames.add(dr.getTableName()); - } - } - if (tableNames.isEmpty()) { - return result; - } - - /*List<String> idList = new ArrayList<>(); - for (MonitorPointPosition c : checkPoints) { - idList.add("'" + c.getId() + "'"); - } - String ids = String.join(",", idList);*/ - - for (MonitorPointPosition c : checkPoints) { - Map<String, Object> map = suYuanMapper.getMonthValueDataMax(tableNames, c.getId()); - if (null != map && map.size() > 0) { - //String suYuanId = map.get("id").toString(); - //map.put("name", commonService.select3dCheckPointById(suYuanId).getName()); - //map.remove("id"); - map.put("name", c.getName()); - result.add(map); - } - } - - return CalculateUtils.sort(result, "value", true).subList(0, 10); - } - - @Override - public List<Qxsh> selectMonthTop10() { - String time = DateUtils.getYyyyMm(new Date()); - - List<Qxsh> list = qxshMapper.selectMonthTop10(time + "%"); - - return list; - } - - @Override - public Map<String, List<Double>> select3Hours() { - Map<String, List<Double>> map = new LinkedHashMap<>(); - - List<String> times = DateUtils.get3Hours(); - List<Qxsh> list = qxshMapper.select3Hours(times); - if (null == list || list.isEmpty()) { - return map; - } - - for (Qxsh qxsh : list) { - String name = qxsh.getName(); - - List<Double> values = map.computeIfAbsent(name, k -> new ArrayList<>()); - values.add(qxsh.getValue()); - } - - return map; - } - - @Override - public List<Report> getAlarmAndWarnByTime(Date begin, Date end) { - String startTime = DateUtils.getYyyyMmDdHhMmSs(begin); - String endTime = DateUtils.getYyyyMmDdHhMmSs(end); - - List<WarningDetail> rs = new ArrayList<>(); - List<WarningDetail> rsYj = warningDetailMapper.selectByTimeForYj(startTime, endTime); - if (null != rsYj && rsYj.size() > 0) rs.addAll(rsYj); - - List<WarningDetail> rsBj = warningDetailMapper.selectByTimeForBj(startTime, endTime); - if (null != rsBj && rsBj.size() > 0) rs.addAll(rsBj); - - List<Report> list = new ArrayList<>(); - for (WarningDetail wd : rs) { - //String time = ymdh.format(wd.getCreateTime()); - //list.add(new WarningVo(wd.getLocationName(), wd.getSuYuanId(), 0.0, 0.0, wd.getValue(), time)); - - DistanceSuYuan suYuan = suYuanMapper.getSuYuanById(wd.getTableName(), wd.getSuYuanId()); - Double lastVal = warningDetailMapper.getLastYearVal(wd.getId()); - - int rows = suYuanMapper.isTableExists(wd.getTableName()); - DistanceSuYuan suMax = null; - if (rows > 0) { - MonitorPointPosition point = commonService.select3dCheckPointByName(wd.getLocationName()); - List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(point, 50); - suMax = suYuanMapper.getSuYuan500Max(wd.getTableName(), ids3d); - } else { - suMax = suYuan; - } - - Report report = Report.calcReport(wd, suYuan, suMax); - report.setLastVal(lastVal); - - list.add(report); - } - - return list; - } -} diff --git a/src/main/java/com/yssh/service/impl/WeatherServiceImpl.java b/src/main/java/com/yssh/service/impl/WeatherServiceImpl.java deleted file mode 100644 index 271ab3d..0000000 --- a/src/main/java/com/yssh/service/impl/WeatherServiceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.yssh.service.impl; - -import com.yssh.dao.WeatherMapper; -import com.yssh.entity.Weather; -import com.yssh.service.IWeatherService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * @author wMeng - * @ClassName YsshWeatherServiceImpl - * @Description TODO - * @date 2022/10/30 14:11 - * @Version 1.0 - */ -@Service -public class WeatherServiceImpl implements IWeatherService { - - @Autowired - private WeatherMapper weatherMapper; - - @Override - public List<Weather> query(String begin, String end) { - List<Weather> data = weatherMapper.query(begin,end); - return data; - } - @Override - public List<Weather> getAll() { - return weatherMapper.getAll(); - } - @Override - public int insert(Weather weather) { - return weatherMapper.insert(weather); - } - @Override - public int delete(String id) { - return weatherMapper.delete(id); - } - -} diff --git a/src/main/java/com/yssh/utils/AjaxResult.java b/src/main/java/com/yssh/utils/AjaxResult.java deleted file mode 100644 index 1d07640..0000000 --- a/src/main/java/com/yssh/utils/AjaxResult.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.yssh.utils; - -import java.util.HashMap; - -/** - * 鎿嶄綔娑堟伅鎻愰啋 - * - * @author xingjinshuang@smartearth.cn - * @date 2023-02-06 - */ -public class AjaxResult extends HashMap<String, Object> { - private static final long serialVersionUID = 1L; - - /** 鐘舵�佺爜 */ - public static final String CODE_TAG = "code"; - - /** 杩斿洖鍐呭 */ - public static final String MSG_TAG = "msg"; - - /** 鏁版嵁瀵硅薄 */ - public static final String DATA_TAG = "data"; - - /** - * 鍒濆鍖栦竴涓柊鍒涘缓鐨� AjaxResult 瀵硅薄锛屼娇鍏惰〃绀轰竴涓┖娑堟伅銆� - */ - public AjaxResult() { - } - - /** - * 鍒濆鍖栦竴涓柊鍒涘缓鐨� AjaxResult 瀵硅薄 - * - * @param code - * 鐘舵�佺爜 - * @param msg - * 杩斿洖鍐呭 - */ - public AjaxResult(int code, String msg) { - super.put(CODE_TAG, code); - super.put(MSG_TAG, msg); - } - - /** - * 鍒濆鍖栦竴涓柊鍒涘缓鐨� AjaxResult 瀵硅薄 - * - * @param code - * 鐘舵�佺爜 - * @param msg - * 杩斿洖鍐呭 - * @param data - * 鏁版嵁瀵硅薄 - */ - public AjaxResult(int code, String msg, Object data) { - super.put(CODE_TAG, code); - super.put(MSG_TAG, msg); - if (StringUtils.isNotNull(data)) { - super.put(DATA_TAG, data); - } - } - - /** - * 杩斿洖鎴愬姛娑堟伅 - * - * @return 鎴愬姛娑堟伅 - */ - public static AjaxResult success() { - return AjaxResult.success("鎿嶄綔鎴愬姛"); - } - - /** - * 杩斿洖鎴愬姛鏁版嵁 - * - * @return 鎴愬姛娑堟伅 - */ - public static AjaxResult success(Object data) { - return AjaxResult.success("鎿嶄綔鎴愬姛", data); - } - - /** - * 杩斿洖鎴愬姛娑堟伅 - * - * @param msg - * 杩斿洖鍐呭 - * @return 鎴愬姛娑堟伅 - */ - public static AjaxResult success(String msg) { - return AjaxResult.success(msg, null); - } - - /** - * 杩斿洖鎴愬姛娑堟伅 - * - * @param msg - * 杩斿洖鍐呭 - * @param data - * 鏁版嵁瀵硅薄 - * @return 鎴愬姛娑堟伅 - */ - public static AjaxResult success(String msg, Object data) { - return new AjaxResult(HttpStatus.SUCCESS, msg, data); - } - - /** - * 杩斿洖璀﹀憡娑堟伅 - * - * @param msg - * 杩斿洖鍐呭 - * @return 璀﹀憡娑堟伅 - */ - public static AjaxResult warn(String msg) { - return AjaxResult.warn(msg, null); - } - - /** - * 杩斿洖璀﹀憡娑堟伅 - * - * @param msg - * 杩斿洖鍐呭 - * @param data - * 鏁版嵁瀵硅薄 - * @return 璀﹀憡娑堟伅 - */ - public static AjaxResult warn(String msg, Object data) { - return new AjaxResult(HttpStatus.WARN, msg, data); - } - - /** - * 杩斿洖閿欒娑堟伅 - * - * @return 閿欒娑堟伅 - */ - public static AjaxResult error() { - return AjaxResult.error("鎿嶄綔澶辫触"); - } - - /** - * 杩斿洖閿欒娑堟伅 - * - * @param msg - * 杩斿洖鍐呭 - * @return 閿欒娑堟伅 - */ - public static AjaxResult error(String msg) { - return AjaxResult.error(msg, null); - } - - /** - * 杩斿洖閿欒娑堟伅 - * - * @param msg - * 杩斿洖鍐呭 - * @param data - * 鏁版嵁瀵硅薄 - * @return 閿欒娑堟伅 - */ - public static AjaxResult error(String msg, Object data) { - return new AjaxResult(HttpStatus.ERROR, msg, data); - } - - /** - * 杩斿洖閿欒娑堟伅 - * - * @param code - * 鐘舵�佺爜 - * @param msg - * 杩斿洖鍐呭 - * @return 閿欒娑堟伅 - */ - public static AjaxResult error(int code, String msg) { - return new AjaxResult(code, msg, null); - } - - /** - * 鏂逛究閾惧紡璋冪敤 - * - * @param key - * 閿� - * @param value - * 鍊� - * @return 鏁版嵁瀵硅薄 - */ - @Override - public AjaxResult put(String key, Object value) { - super.put(key, value); - return this; - } -} diff --git a/src/main/java/com/yssh/utils/CacheUtils.java b/src/main/java/com/yssh/utils/CacheUtils.java deleted file mode 100644 index 10527b1..0000000 --- a/src/main/java/com/yssh/utils/CacheUtils.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.yssh.utils; - -import com.github.benmanes.caffeine.cache.Cache; -import com.github.benmanes.caffeine.cache.Caffeine; -import org.checkerframework.checker.nullness.qual.NonNull; - -import java.util.concurrent.TimeUnit; - -public class CacheUtils { - private static @NonNull Cache<String, Object> cache; - - public static void init() { - cache = Caffeine.newBuilder() - .initialCapacity(2) - .maximumSize(1024) - .expireAfterWrite(24, TimeUnit.HOURS) - .build(); - } - - public static Object get(String key) { - return cache.getIfPresent(key); - } - - public static void put(String key, Object obj) { - cache.put(key, obj); - } - - public static void remove(String key) { - cache.invalidate(key); - } - - public static void clear() { - cache.invalidateAll(); - } -} diff --git a/src/main/java/com/yssh/utils/CalculateUtils.java b/src/main/java/com/yssh/utils/CalculateUtils.java deleted file mode 100644 index 73871a4..0000000 --- a/src/main/java/com/yssh/utils/CalculateUtils.java +++ /dev/null @@ -1,371 +0,0 @@ -package com.yssh.utils; - -import java.awt.geom.Point2D; -import java.util.*; - -import com.yssh.entity.Coordinate; -import com.yssh.entity.DistanceSuYuan; -import com.yssh.entity.MonitorPointPosition; -import org.geotools.geometry.DirectPosition2D; -import org.geotools.referencing.CRS; -import org.geotools.referencing.GeodeticCalculator; -import org.geotools.referencing.crs.DefaultGeographicCRS; -import org.opengis.referencing.crs.CoordinateReferenceSystem; - -public class CalculateUtils { - /** - * 榛樿鍦扮悆鍗婂緞,璧ら亾鍗婂緞(鍗曚綅m) - */ - private final static double EARTH_RADIUS1 = 6371000; - - /** - * 杞寲涓哄姬搴�(rad) - */ - private static double rad(double d) { - return d * Math.PI / 180.0; - } - - /** - * 璁$畻璺濈1 - */ - public static double getDistance1(double lon1, double lat1, double lon2, double lat2) { - double radLat1 = rad(lat1); - double radLat2 = rad(lat2); - double a = radLat1 - radLat2; - double b = rad(lon1) - rad(lon2); - double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2))); - - s = s * EARTH_RADIUS1; - - return round2(s); - } - - /** - * 璁$畻璺濈2 - */ - public static double getDistance2(double x1, double y1, double x2, double y2) { - // 84鍧愭爣绯绘瀯閫燝eodeticCalculator - GeodeticCalculator geodeticCalculator = new GeodeticCalculator(DefaultGeographicCRS.WGS84); - - // 璧风偣缁忕含搴� - geodeticCalculator.setStartingGeographicPoint(x1, y1); - - // 鏈偣缁忕含搴� - geodeticCalculator.setDestinationGeographicPoint(x2, y2); - - // 璁$畻璺濈锛屽崟浣嶏細绫� - double distance = geodeticCalculator.getOrthodromicDistance(); - - return round2(distance); - } - - /** - * 淇濈暀2浣嶅皬鏁� - */ - public static double round2(double d) { - return ((long) (d * 100)) / 100D; - } - - /** - * 淇濈暀6浣嶅皬鏁� - */ - public static double round6(double d) { - return ((long) (d * 1000000)) / 1000000D; - } - - /** - * 璁$畻瑙掑害 - */ - public static double getAngle(double x1, double y1, double x2, double y2) { - try { - CoordinateReferenceSystem crs = CRS.decode("EPSG:4326"); - DirectPosition2D p1 = new DirectPosition2D(crs, x1, y1); - DirectPosition2D p2 = new DirectPosition2D(crs, x2, y2); - - GeodeticCalculator gc = new GeodeticCalculator(); - gc.setStartingGeographicPoint(p1); - gc.setDestinationGeographicPoint(p2); - - double angle = gc.getAzimuth(); - - return round2(angle); - } catch (Exception ex) { - return 0; - } - } - - /** - * 璁$畻瑙掑害2 - */ - public static double getAngle2(double x1, double y1, double x2, double y2) { - try { - DirectPosition2D p1 = new DirectPosition2D(x1, y1); - DirectPosition2D p2 = new DirectPosition2D(x2, y2); - - GeodeticCalculator gc = new GeodeticCalculator(); - gc.setStartingGeographicPoint(p1); - gc.setDestinationGeographicPoint(p2); - - double angle = gc.getAzimuth(); - - return round2(angle); - } catch (Exception ex) { - return 0; - } - } - - /** - * 鑾峰彇鍧愭爣 - * - * @param su - * @return - */ - public static Coordinate getCoordinate(DistanceSuYuan su) { - String[] sirs = su.getId().split("_"); - - int x = Integer.parseInt(sirs[0]); - int y = Integer.parseInt(sirs[1]); - double lon = CalculateUtils.getLon(x, y); - double lat = CalculateUtils.getLat(x, y); - - return new Coordinate(lon, lat); - } - - /** - * 璁$畻缁忓害 - * - * @param @param x - * @param @param y - * @param @return 鍙傛暟 - * @return double 杩斿洖绫诲瀷 - * @throws - * @Title: getLon - * @Description: 璁$畻缁忓害 - */ - public static double getLon(int x, int y) { - double lon = 115.9165227 + 0.000116732 * (x - 0.5) + 0.00000116862 * (y - 0.5); - if (lon < 115 || lon > 116) { - System.out.println("lon is invalid"); - } - - return round6(lon); - } - - /** - * 璁$畻缁村害 - * - * @param @param x - * @param @param y - * @param @return 鍙傛暟 - * @return double 杩斿洖绫诲瀷 - * @throws - * @Title: getLat - * @Description: 璁$畻缁村害 - */ - public static double getLat(int x, int y) { - double lat = 39.77250000 + 0.000001000 * (x - 0.5) - 0.00009000000 * (y - 0.5); - if (lat < 39 || lat > 40) { - System.out.println("lat is invalid"); - } - - return round6(lat); - } - - /** - * @param @param checkPoints - * @param @return 鍙傛暟 - * @return List<String> 杩斿洖绫诲瀷 - * @throws - * @Title: assembleId - * @Description: 缁勮id - */ - public static List<String> assembleId(List<MonitorPointPosition> checkPoints) { - List<String> ids2d = new ArrayList<>(); - for (MonitorPointPosition point : checkPoints) { - // ids2d.add(point.getX() + "_" + point.getY() + "_" + point.getZ()); - ids2d.add(point.getX() + "_" + point.getY() + "_" + 0); - } - return ids2d; - } - - /** - * @param @param checkPoint - * @param @param range - * @param @return 鍙傛暟 - * @return List<String> 杩斿洖绫诲瀷 - * @Title: aloneCrosswiseScope - * @Description: 鍗曠嫭鐐逛綅妯悜鑼冨洿鎵╁睍 - * @backup 寮哄埗灏嗗眰绾ф敼涓� 0 - */ - public static List<String> aloneCrosswiseExtend(MonitorPointPosition checkPoint, int range) { - List<String> ids = new ArrayList<>(); - Integer x = checkPoint.getX(); - Integer y = checkPoint.getY(); - for (int i = x - range / 2; i <= x + range / 2; i++) { - for (int j = y - range / 2; j <= y + range / 2; j++) { - // ids.add(i + "_" + j + "_" + checkPoint.getZ()); - ids.add(i + "_" + j + "_" + 0); - } - } - return ids; - } - - public static List<String> temporary(MonitorPointPosition point, int range) { - List<String> ids3d = new ArrayList<>(); - Integer x = point.getX(); - Integer y = point.getY(); - Integer z = point.getZ(); - for (int i = x - range / 2; i <= x + range / 2; i++) { - for (int j = y - range / 2; j <= y + range / 2; j++) { - for (int k = z; k < 100; k++) { - ids3d.add(i + "_" + j + "_" + k); - } - } - } - return ids3d; - } - - /** - * 鑾峰彇鏂瑰悜 - */ - public static String getDir(double direction) { - if (direction < 0) { - direction = direction + 360; - } - if (direction > 360) { - direction = direction - 360; - } - - if (direction >= 22.5 && direction < 67.5) - return "涓滃寳"; - if (direction >= 67.5 && direction < 112.5) - return "涓�"; - if (direction >= 112.5 && direction < 157.5) - return "涓滃崡"; - if (direction >= 157.5 && direction < 202.5) - return "鍗�"; - if (direction >= 202.5 && direction < 247.5) - return "瑗垮崡"; - if (direction >= 247.5 && direction < 292.5) - return "瑗�"; - if (direction >= 292.5 && direction < 337.5) - return "瑗垮寳"; - - return "鍖�"; - } - - /** - * 璁$畻X銆乊鍊肩殑鐭╁舰妗� - */ - public static List<Coordinate> calcRect(double x, double y) { - double buffer = 10; - double dis = round6(Math.sqrt(Math.pow(buffer / 2, 2) * 2)); - - List<Coordinate> list = new ArrayList<>(); - list.add(getPointByDisAndAngle(x, y, 315, dis)); - list.add(getPointByDisAndAngle(x, y, 45, dis)); - list.add(getPointByDisAndAngle(x, y, 135, dis)); - list.add(getPointByDisAndAngle(x, y, 225, dis)); - - return list; - } - - /** - * 鏍规嵁璺濈鍜岃搴﹁幏鍙栫洰鏍囩偣 - */ - private static Coordinate getPointByDisAndAngle(double x, double y, double angle, double dis) { - try { - DirectPosition2D p1 = new DirectPosition2D(x, y); - - GeodeticCalculator gc = new GeodeticCalculator(); - gc.setStartingGeographicPoint(p1); - gc.setDirection(angle, dis); - - Point2D dest = gc.getDestinationGeographicPoint(); - double newX = round6(dest.getX()); - double newY = round6(dest.getY()); - - return new Coordinate(newX, newY); - } catch (Exception ex) { - return new Coordinate(); - } - } - - /** - * @param @return 鍙傛暟 - * @return Double 杩斿洖绫诲瀷 - * @throws - * @Title: getWindSpeed - * @Description: 璁$畻椋庨�� - */ - public static Double getWindSpeed(double v, double u) { - return round6(Math.sqrt(v * v + u * u)); - } - - /** - * @param @param v - * @param @param u - * @param @return 鍙傛暟 - * @return double 杩斿洖绫诲瀷 - * @throws - * @Title: getWindDirection - * @Description: 璁$畻椋庡悜 - */ - public static double getWindDirection(double v, double u) { - double result = Math.atan(u / (v + Math.pow(10, -5))) / Math.PI * 180; - if (result < 0) { - result += 180; - } else if (u < 0 && v > 0) { - result += 360; - } - - return round6(result); - } - - /** - * @param @param list 鎺掑簭瀵硅薄 - * @param @param property 鎺掑簭鍙傛暟 - * @param @param order 鎺掑簭椤哄簭 - * @param @return 鍙傛暟 - * @return List<Map < String, Object>> 杩斿洖绫诲瀷 - * @throws - * @Title: sort - * @Description: 鎺掑簭 - */ - public static List<Map<String, Object>> sort(List<Map<String, Object>> list, final String property, final boolean order) { - if (list == null || property == null) { - return null; - } - Collections.sort(list, new Comparator<Map<String, Object>>() { - @Override - public int compare(Map<String, Object> o1, Map<String, Object> o2) { - try { - Object oo1 = o1.get(property); - Object oo2 = o2.get(property); - if (oo1 == null || "null".equals(oo1.toString()) || "".equals(oo1.toString()) || oo1.toString().endsWith("999")) { - oo1 = 0; - } - if (oo2 == null || "null".equals(oo2.toString()) || "".equals(oo2.toString()) || oo2.toString().endsWith("999")) { - oo2 = 0; - } - if (order) { - if (Double.parseDouble(oo1.toString()) < Double.parseDouble(oo2.toString())) { - return 1; - } - } else { - if (Double.parseDouble(oo1.toString()) > Double.parseDouble(oo2.toString())) { - return 1; - } - } - if (Double.parseDouble(oo1.toString()) == Double.parseDouble(oo2.toString())) { - return 0; - } - } catch (Exception ex) { - System.out.println(ex.getMessage()); - } - return -1; - } - }); - return list; - } -} diff --git a/src/main/java/com/yssh/utils/CommonConstant.java b/src/main/java/com/yssh/utils/CommonConstant.java deleted file mode 100644 index b9eab01..0000000 --- a/src/main/java/com/yssh/utils/CommonConstant.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yssh.utils; - -/** - * @author wMeng - * @ClassName CommonConstant - * @Description TODO - * @date 2022/10/30 13:30 - * @Version 1.0 - */ -public interface CommonConstant { - - /** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */ - public static final Integer SC_INTERNAL_SERVER_ERROR_500 = 500; - /** {@code 200 OK} (HTTP/1.0 - RFC 1945) */ - public static final Integer SC_OK_200 = 200; - - /**璁块棶鏉冮檺璁よ瘉鏈�氳繃 510*/ - public static final Integer SC_JEECG_NO_AUTHZ=510; - - - -} diff --git a/src/main/java/com/yssh/utils/CsvParser.java b/src/main/java/com/yssh/utils/CsvParser.java deleted file mode 100644 index b3f6158..0000000 --- a/src/main/java/com/yssh/utils/CsvParser.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.yssh.utils; - -import java.util.ArrayList; -import java.util.List; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.github.biyanwen.impl.AbstractCsvFileParser; -import com.yssh.entity.SuYuan; -import com.yssh.service.ISuYuanService; - -public class CsvParser extends AbstractCsvFileParser<SuYuan> { - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - - /** - * 姣忛殧3000鏉″瓨鍌ㄦ暟鎹簱锛岀劧鍚庢竻鐞唋ist 锛屾柟渚垮唴瀛樺洖鏀� - */ - public static final int BATCH_COUNT = 100000; - - /** - * 缂撳瓨鐨勬暟鎹� - */ - private List<SuYuan> cachedData = new ArrayList<>(BATCH_COUNT); - - private ISuYuanService suYuanService; - private String time; - - public CsvParser(ISuYuanService suYuanService, String time) { - this.suYuanService = suYuanService; - this.time = time; - } - - /** - * 鎵�鏈夋暟鎹В鏋愬畬鎴愪簡 浼氭潵璋冪敤,闃叉鏈夋暟鎹病鏈夎淇濆瓨 - */ - @Override - protected void doAfterAllAnalysed() { - try { - saveSuYuanData(); - } catch (Exception e) { - logger.error("瑙f瀽淇濆瓨鏁版嵁鍑虹幇寮傚父锛屽紓甯稿師鍥犳槸锛�" + e.getMessage(), e); - e.printStackTrace(); - } - } - - @Override - protected void invoke(SuYuan t) { - t.setId(t.getX() + "_" + t.getY() + "_" + t.getZ()); - if ("0_0_0".equals(t.getId())) { - return; // 瑙e喅涓婚敭閲嶅 - } - - //System.err.println(t.getId()); - cachedData.add(t); - // 杈惧埌BATCH_COUNT浜嗭紝闇�瑕佸幓瀛樺偍涓�娆℃暟鎹簱锛岄槻姝㈡暟鎹嚑涓囨潯鏁版嵁鍦ㄥ唴瀛橈紝瀹规槗OOM - if (cachedData.size() >= BATCH_COUNT) { - try { - saveSuYuanData(); - } catch (Exception e) { - logger.error("瑙f瀽淇濆瓨鏁版嵁鍑虹幇寮傚父锛屽紓甯稿師鍥犳槸锛�" + e.getMessage(), e); - e.printStackTrace(); - } - // 瀛樺偍瀹屾垚娓呯悊 list - cachedData = new ArrayList<>(BATCH_COUNT); - } - } - - private void saveSuYuanData() throws Exception { - suYuanService.insertSuYuanDatas(cachedData, time); - } -} diff --git a/src/main/java/com/yssh/utils/DateUtils.java b/src/main/java/com/yssh/utils/DateUtils.java deleted file mode 100644 index a812576..0000000 --- a/src/main/java/com/yssh/utils/DateUtils.java +++ /dev/null @@ -1,267 +0,0 @@ -package com.yssh.utils; - -import java.lang.management.ManagementFactory; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - -import org.apache.commons.lang3.time.DateFormatUtils; - -/** - * 鏃堕棿宸ュ叿绫� - * - * @author tam - */ -public class DateUtils extends org.apache.commons.lang3.time.DateUtils { - public static String YYYY = "yyyy"; - - public static String YYYY_MM = "yyyy-MM"; - - public static String YYYY_MM_DD = "yyyy-MM-dd"; - - public static String YYYYMM = "yyyyMM"; - - public static String YYYYMMDDHH = "yyyyMMddHH"; - - public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; - - public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; - - public static String YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm"; - - public static String YYYY_MM_DD_HH = "yyyy-MM-dd HH"; - - private static String[] parsePatterns = { "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", - "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM", "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", - "yyyy.MM.dd HH:mm", "yyyy.MM" }; - - /** - * 鑾峰彇褰撳墠Date鍨嬫棩鏈� - * - * @return Date() 褰撳墠鏃ユ湡 - */ - public static Date getNowDate() { - return new Date(); - } - - /** - * 鑾峰彇褰撳墠鏃ユ湡, 榛樿鏍煎紡涓簓yyy-MM-dd - * - * @return String - */ - public static String getDate() { - return dateTimeNow(YYYY_MM_DD); - } - - public static final String getTime() { - return dateTimeNow(YYYY_MM_DD_HH_MM_SS); - } - - public static final String dateTimeNow() { - return dateTimeNow(YYYYMMDDHHMMSS); - } - - public static final String dateTimeNow(final String format) { - return parseDateToStr(format, new Date()); - } - - public static final String dateTime(final Date date) { - return parseDateToStr(YYYY_MM_DD, date); - } - - public static final String parseDateToStr(final String format, final Date date) { - return new SimpleDateFormat(format).format(date); - } - - public static final Date dateTime(final String format, final String ts) { - try { - return new SimpleDateFormat(format).parse(ts); - } catch (ParseException e) { - throw new RuntimeException(e); - } - } - - public static String getYyyyMm(Date date) { - return new SimpleDateFormat(YYYYMM).format(date); - } - - public static String getYyyyMmDdHh(Date date) { - return new SimpleDateFormat(YYYYMMDDHH).format(date); - } - - public static String getYyyyMmDdHhMmSs(Date date) { - return new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS).format(date); - } - - /** - * 鏃ユ湡璺緞 鍗冲勾/鏈�/鏃� 濡�2018/08/08 - */ - public static final String datePath() { - Date now = new Date(); - return DateFormatUtils.format(now, "yyyy/MM/dd"); - } - - /** - * 鏃ユ湡璺緞 鍗冲勾/鏈�/鏃� 濡�20180808 - */ - public static final String dateTime() { - Date now = new Date(); - return DateFormatUtils.format(now, "yyyyMMdd"); - } - - /** - * 鏃ユ湡鍨嬪瓧绗︿覆杞寲涓烘棩鏈� 鏍煎紡 - */ - public static Date parseDate(Object str) { - if (str == null) { - return null; - } - try { - return parseDate(str.toString(), parsePatterns); - } catch (ParseException e) { - return null; - } - } - - /** - * 鑾峰彇鏈嶅姟鍣ㄥ惎鍔ㄦ椂闂� - */ - public static Date getServerStartDate() { - long time = ManagementFactory.getRuntimeMXBean().getStartTime(); - return new Date(time); - } - - /** - * 璁$畻涓や釜鏃堕棿宸� - */ - public static String getDatePoor(Date endDate, Date nowDate) { - long nd = 1000 * 24 * 60 * 60; - long nh = 1000 * 60 * 60; - long nm = 1000 * 60; - // long ns = 1000; - // 鑾峰緱涓や釜鏃堕棿鐨勬绉掓椂闂村樊寮� - long diff = endDate.getTime() - nowDate.getTime(); - // 璁$畻宸灏戝ぉ - long day = diff / nd; - // 璁$畻宸灏戝皬鏃� - long hour = diff % nd / nh; - // 璁$畻宸灏戝垎閽� - long min = diff % nd % nh / nm; - // 璁$畻宸灏戠//杈撳嚭缁撴灉 - // long sec = diff % nd % nh % nm / ns; - return day + "澶�" + hour + "灏忔椂" + min + "鍒嗛挓"; - } - - /** - * @Title: differHour - * @Description: 鑾峰彇涓や釜鏃堕棿宸嚑涓皬鏃� - * @param: @param endDate - * @param: @param nowDate - * @param: @return - * @return: long - * @throws - */ - public static int differDay(Date startDate, Date endDate){ - long nd = 1000 * 24 * 60 * 60; - long diff = endDate.getTime() - startDate.getTime(); - double dd = Double.valueOf(String.valueOf(diff)) / nd; - // 璁$畻宸灏戝ぉ - return Double.valueOf(Math.ceil(dd)).intValue(); - } - - /** - * @Description: 鑾峰彇涓�娈垫椂闂撮棿闅� - * @param:date 闇�瑕佹搷浣滅殑鏃堕棿瀵硅薄 - * @param:day 鎿嶄綔鐨勬椂闂撮棿闅� - * 姝f暟涓轰箣鍚庝竴娈垫椂闂� - * 璐熸暟涓轰箣鍓嶄竴娈垫椂闂� - * @param:dateType 鎿嶄綔鐨勬椂闂存椂鍒嗙澶╅�夋嫨 - * 甯哥敤鏈夛細 - * Calendar.MINUTE 鍒� - * Calendar.HOUR_OF_DAY 鏃� - * Calendar.DATE 澶� - * Calendar.MONTH 鏈� - */ - public static Date getAPeriodOfTime(Date date, int day,int dateType) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - calendar.add(dateType, day); - return calendar.getTime(); - } - - public static List<String> get3Hours() { - List<String> times = new ArrayList<>(); - SimpleDateFormat ymdh = new SimpleDateFormat(YYYYMMDDHH); - - Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.HOUR_OF_DAY, 1); - - for (int i = 0; i < 3; i++) { - calendar.add(Calendar.HOUR_OF_DAY, -1); - String time = ymdh.format(calendar.getTime()); - // times.add(time); - times.add(0, time); - } - - return times; - } - - /** - */ - public static Map<Date, Date> segmentationDateByTimeQuantum(Date startDate, Date endDate, int timeQuantum,int dateType){ - LinkedHashMap<Date, Date> result = new LinkedHashMap<Date, Date>(); - long startTimeMillisecond= startDate.getTime(); - long endTimeMillisecond = endDate.getTime(); - Long quantumTimeMillisecond = 0L; - switch (dateType) { - case Calendar.DATE: - quantumTimeMillisecond = new Integer(1000 * 60 * 60 * 24 * timeQuantum).longValue(); - break; - case Calendar.HOUR_OF_DAY: - quantumTimeMillisecond = new Integer(1000 * 60 * 60 * timeQuantum).longValue(); - break; - case Calendar.MINUTE: - quantumTimeMillisecond = new Integer(1000 * 60 * timeQuantum).longValue(); - break; - default: - break; - } - for (long time = startTimeMillisecond; time < endTimeMillisecond; time += quantumTimeMillisecond) { - Date beginDate = new Date(time); - Date finishDate = new Date(time + quantumTimeMillisecond); - if (finishDate.getTime() > endTimeMillisecond) { - finishDate = endDate; - } - result.put(beginDate, finishDate); - } - return result; - } - - /** - * 鑾峰彇鏈湀绗竴澶� - * @return String - **/ - public static Date getMonthStart() { - Calendar cal = Calendar.getInstance(); - //cal.set(Calendar.MONTH, 3); - cal.set(Calendar.DAY_OF_MONTH, 1); - return dateTime(YYYY_MM_DD_HH_MM_SS, parseDateToStr(YYYY_MM_DD, cal.getTime()) + " 00:00:00"); - } - - /** - * 鑾峰彇鏈湀鏈�鍚庝竴澶� - * @return String - **/ - public static Date getMonthEnd() { - Calendar cal = Calendar.getInstance(); - //cal.set(Calendar.MONTH, 3); - cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); - return dateTime(YYYY_MM_DD_HH_MM_SS, parseDateToStr(YYYY_MM_DD, cal.getTime()) + " 23:59:59"); - } - - public static void main(String[] args) { - //System.out.println(parseDateToStr(YYYY_MM_DD_HH_MM_SS, getMonthStart())); - //System.err.println(parseDateToStr(YYYY_MM_DD_HH_MM_SS, getMonthEnd())); - System.out.println(parseDateToStr(YYYY_MM_DD_HH_MM_SS, getAPeriodOfTime(getNowDate(), -7, Calendar.DATE))); - } -} diff --git a/src/main/java/com/yssh/utils/FileUtils.java b/src/main/java/com/yssh/utils/FileUtils.java deleted file mode 100644 index aec2a29..0000000 --- a/src/main/java/com/yssh/utils/FileUtils.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.yssh.utils; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.channels.FileChannel; -import java.security.MessageDigest; - -/** - * 鏂囦欢宸ュ叿绫� - * @author WWW - * @date 2023-06-06 - */ -public class FileUtils { - public final static int SIXTEEN = 16; - - public static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; - - /** - * 1.鑾峰彇鏂囦欢鐨凪D5 - */ - @SuppressWarnings("unused") - public static String getFileMd5(String filePath) { - FileInputStream fis = null; - try { - MessageDigest md = MessageDigest.getInstance("MD5"); - - fis = new FileInputStream(new File(filePath)); - FileChannel fChannel = fis.getChannel(); - ByteBuffer buffer = ByteBuffer.allocateDirect(1024 * 1024); - - while (fChannel.read(buffer) != -1) { - buffer.flip(); - md.update(buffer); - buffer.compact(); - } - byte[] b = md.digest(); - - return byteToHexString(b); - } catch (Exception ex) { - ex.printStackTrace(); - return null; - } finally { - try { - if (null != fis) { - fis.close(); - } - } catch (IOException ex) { - ex.printStackTrace(); - } - } - } - - /** - * 瀛楄妭鐮佽浆16杩涘埗 - */ - public static String byteToHexString(byte[] tmp) { - // 姣忎釜瀛楄妭鐢� 16 杩涘埗琛ㄧず鐨勮瘽锛屼娇鐢ㄤ袱涓瓧绗︼紝 - char[] str = new char[16 * 2]; - - // 鎵�浠ヨ〃绀烘垚 16 杩涘埗闇�瑕� 32 涓瓧绗︼紝琛ㄧず杞崲缁撴灉涓搴旂殑瀛楃浣嶇疆 - int k = 0; - // 浠庣涓�涓瓧鑺傚紑濮嬶紝瀵� MD5 鐨勬瘡涓�涓瓧鑺� - for (int i = 0; i < SIXTEEN; i++) { - // 杞崲鎴� 16 杩涘埗瀛楃鐨勮浆鎹� - byte byte0 = tmp[i]; - // 鍙栧瓧鑺備腑楂� 4 浣嶇殑鏁板瓧杞崲 - str[k++] = HEX_DIGITS[byte0 >>> 4 & 0xf]; - // >>> 涓洪�昏緫鍙崇Щ锛屽皢绗﹀彿浣嶄竴璧峰彸绉伙紝 鍙栧瓧鑺備腑浣� 4 浣嶇殑鏁板瓧杞崲 - str[k++] = HEX_DIGITS[byte0 & 0xf]; - } - // 鎹㈠悗鐨勭粨鏋滆浆鎹负瀛楃涓� - return new String(str); - } -} diff --git a/src/main/java/com/yssh/utils/GisUtil.java b/src/main/java/com/yssh/utils/GisUtil.java deleted file mode 100644 index eba5bd6..0000000 --- a/src/main/java/com/yssh/utils/GisUtil.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.yssh.utils; - -import org.geotools.geometry.jts.JTS; -import org.geotools.referencing.CRS; -import org.locationtech.jts.geom.Coordinate; -import org.opengis.referencing.crs.CoordinateReferenceSystem; -import org.opengis.referencing.operation.MathTransform; - -public class GisUtil { - - /** - * @param srcNo - * 婧愬潗鏍囩郴EPSG浠e彿 - * @param targetNo - * 鐩爣鍧愭爣绯籈PSG浠e彿 - * @param x - * 婧愬潗鏍噚 - * @param y - * 婧愬潗鏍噛 - * @Description: 鍧愭爣绯昏浆鎹� - */ - public static Coordinate coordinateTransform(String sourceCRS, String targetCRS, - double x, double y) { - Coordinate tar = new Coordinate(); - try { - CoordinateReferenceSystem src = CRS.decode(sourceCRS); - CoordinateReferenceSystem target = CRS.decode(targetCRS); - MathTransform transform = CRS.findMathTransform(src, target, true); - Coordinate sour = new Coordinate(x, y); - return JTS.transform(sour, tar, transform); - } catch (Exception e) { - } - return tar; - - } -} diff --git a/src/main/java/com/yssh/utils/HttpStatus.java b/src/main/java/com/yssh/utils/HttpStatus.java deleted file mode 100644 index ccf4476..0000000 --- a/src/main/java/com/yssh/utils/HttpStatus.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.yssh.utils; - - -/** - * 杩斿洖鐘舵�佺爜 - * - * @author xingjinshuang@smartearth.cn - * @date 2023-02-06 - */ -public class HttpStatus -{ - /** - * 鎿嶄綔鎴愬姛 - */ - public static final int SUCCESS = 200; - - /** - * 瀵硅薄鍒涘缓鎴愬姛 - */ - public static final int CREATED = 201; - - /** - * 璇锋眰宸茬粡琚帴鍙� - */ - public static final int ACCEPTED = 202; - - /** - * 鎿嶄綔宸茬粡鎵ц鎴愬姛锛屼絾鏄病鏈夎繑鍥炴暟鎹� - */ - public static final int NO_CONTENT = 204; - - /** - * 璧勬簮宸茶绉婚櫎 - */ - public static final int MOVED_PERM = 301; - - /** - * 閲嶅畾鍚� - */ - public static final int SEE_OTHER = 303; - - /** - * 璧勬簮娌℃湁琚慨鏀� - */ - public static final int NOT_MODIFIED = 304; - - /** - * 鍙傛暟鍒楄〃閿欒锛堢己灏戯紝鏍煎紡涓嶅尮閰嶏級 - */ - public static final int BAD_REQUEST = 400; - - /** - * 鏈巿鏉� - */ - public static final int UNAUTHORIZED = 401; - - /** - * 璁块棶鍙楅檺锛屾巿鏉冭繃鏈� - */ - public static final int FORBIDDEN = 403; - - /** - * 璧勬簮锛屾湇鍔℃湭鎵惧埌 - */ - public static final int NOT_FOUND = 404; - - /** - * 涓嶅厑璁哥殑http鏂规硶 - */ - public static final int BAD_METHOD = 405; - - /** - * 璧勬簮鍐茬獊锛屾垨鑰呰祫婧愯閿� - */ - public static final int CONFLICT = 409; - - /** - * 涓嶆敮鎸佺殑鏁版嵁锛屽獟浣撶被鍨� - */ - public static final int UNSUPPORTED_TYPE = 415; - - /** - * 绯荤粺鍐呴儴閿欒 - */ - public static final int ERROR = 500; - - /** - * 鎺ュ彛鏈疄鐜� - */ - public static final int NOT_IMPLEMENTED = 501; - - /** - * 绯荤粺璀﹀憡娑堟伅 - */ - public static final int WARN = 601; -} diff --git a/src/main/java/com/yssh/utils/Result.java b/src/main/java/com/yssh/utils/Result.java deleted file mode 100644 index f667597..0000000 --- a/src/main/java/com/yssh/utils/Result.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.yssh.utils; - -import com.fasterxml.jackson.annotation.JsonIgnore; - -import lombok.Data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; - -/** - * @author wMeng - * @ClassName Result - * @Description TODO - * @date 2022/10/30 13:29 - * @Version 1.0 - */ -@Data -@ApiModel(value = "閫氱敤缁撴灉闆�",description = "閫氱敤缁撴灉闆�") -public class Result<T> implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * 鎴愬姛鏍囧織 - */ - @ApiModelProperty(value = "鎴愬姛鏍囧織绗�") - private boolean success = true; - - /** - * 杩斿洖澶勭悊娑堟伅 - */ - @ApiModelProperty(value = "澶勭悊娑堟伅") - private String message = "鎿嶄綔鎴愬姛锛�"; - - /** - * 杩斿洖浠g爜 - */ - @ApiModelProperty(value = "缁撴灉浠g爜") - private Integer code = 0; - - /** - * 杩斿洖鏁版嵁瀵硅薄 data - */ - @ApiModelProperty(value = "鏁版嵁瀵硅薄") - private T result; - - /** - * 鏃堕棿鎴� - */ - @ApiModelProperty(value = "鏃堕棿鎴�") - private long timestamp = System.currentTimeMillis(); - - public Result() { - - } - - public Result<T> success(String message) { - this.message = message; - this.code = CommonConstant.SC_OK_200; - this.success = true; - return this; - } - - @Deprecated - public static Result<Object> ok() { - Result<Object> r = new Result<Object>(); - r.setSuccess(true); - r.setCode(CommonConstant.SC_OK_200); - r.setMessage("鎴愬姛"); - return r; - } - - @Deprecated - public static Result<Object> ok(String msg) { - Result<Object> r = new Result<Object>(); - r.setSuccess(true); - r.setCode(CommonConstant.SC_OK_200); - r.setMessage(msg); - return r; - } - - @Deprecated - public static Result<Object> ok(Object data) { - Result<Object> r = new Result<Object>(); - r.setSuccess(true); - r.setCode(CommonConstant.SC_OK_200); - r.setResult(data); - return r; - } - - public static<T> Result<T> OK() { - Result<T> r = new Result<T>(); - r.setSuccess(true); - r.setCode(CommonConstant.SC_OK_200); - r.setMessage("鎴愬姛"); - return r; - } - - public static<T> Result<T> OK(T data) { - Result<T> r = new Result<T>(); - r.setSuccess(true); - r.setCode(CommonConstant.SC_OK_200); - r.setResult(data); - return r; - } - - public static<T> Result<T> OK(String msg, T data) { - Result<T> r = new Result<T>(); - r.setSuccess(true); - r.setCode(CommonConstant.SC_OK_200); - r.setMessage(msg); - r.setResult(data); - return r; - } - - public static<T> Result<T> error(String msg, T data) { - Result<T> r = new Result<T>(); - r.setSuccess(false); - r.setCode(CommonConstant.SC_INTERNAL_SERVER_ERROR_500); - r.setMessage(msg); - r.setResult(data); - return r; - } - - public static Result<Object> error(String msg) { - return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg); - } - - public static Result<Object> error(int code, String msg) { - Result<Object> r = new Result<Object>(); - r.setCode(code); - r.setMessage(msg); - r.setSuccess(false); - return r; - } - - public Result<T> error500(String message) { - this.message = message; - this.code = CommonConstant.SC_INTERNAL_SERVER_ERROR_500; - this.success = false; - return this; - } - /** - * 鏃犳潈闄愯闂繑鍥炵粨鏋� - */ - public static Result<Object> noauth(String msg) { - return error(CommonConstant.SC_JEECG_NO_AUTHZ, msg); - } - - @JsonIgnore - private String onlTable; - - -} diff --git a/src/main/java/com/yssh/utils/ServletInitializer.java b/src/main/java/com/yssh/utils/ServletInitializer.java deleted file mode 100644 index 7bd4441..0000000 --- a/src/main/java/com/yssh/utils/ServletInitializer.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.yssh.utils; - -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; - -import com.yssh.Application; - -/** - * @author wMeng - * @ClassName ServletInitializer - * @Description TODO - * @date 2022/10/31 18:46 - * @Version 1.0 - */ - -public class ServletInitializer extends SpringBootServletInitializer { - - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - // 浠g爜璁剧疆鏃ュ織 - //System.setProperty("logging.config", "classpath:logback.xml"); - return application.sources(Application.class); - } - -} - - diff --git a/src/main/java/com/yssh/utils/SpringUtils.java b/src/main/java/com/yssh/utils/SpringUtils.java deleted file mode 100644 index 48d3a50..0000000 --- a/src/main/java/com/yssh/utils/SpringUtils.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.yssh.utils; - -import org.springframework.aop.framework.AopContext; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.NoSuchBeanDefinitionException; -import org.springframework.beans.factory.config.BeanFactoryPostProcessor; -import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.stereotype.Component; - - -/** - * spring宸ュ叿绫� 鏂逛究鍦ㄩ潪spring绠$悊鐜涓幏鍙朾ean - * - * @author tam - */ -@Component -public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware { - /** Spring搴旂敤涓婁笅鏂囩幆澧� */ - private static ConfigurableListableBeanFactory beanFactory; - - private static ApplicationContext applicationContext; - - @Override - public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { - SpringUtils.beanFactory = beanFactory; - } - - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - SpringUtils.applicationContext = applicationContext; - } - - /** - * 鑾峰彇瀵硅薄 - * - * @param name - * @return Object 涓�涓互鎵�缁欏悕瀛楁敞鍐岀殑bean鐨勫疄渚� - * @throws org.springframework.beans.BeansException - * - */ - @SuppressWarnings("unchecked") - public static <T> T getBean(String name) throws BeansException { - return (T) beanFactory.getBean(name); - } - - /** - * 鑾峰彇绫诲瀷涓簉equiredType鐨勫璞� - * - * @param clz - * @return - * @throws org.springframework.beans.BeansException - * - */ - public static <T> T getBean(Class<T> clz) throws BeansException { - T result = (T) beanFactory.getBean(clz); - return result; - } - - /** - * 濡傛灉BeanFactory鍖呭惈涓�涓笌鎵�缁欏悕绉板尮閰嶇殑bean瀹氫箟锛屽垯杩斿洖true - * - * @param name - * @return boolean - */ - public static boolean containsBean(String name) { - return beanFactory.containsBean(name); - } - - /** - * 鍒ゆ柇浠ョ粰瀹氬悕瀛楁敞鍐岀殑bean瀹氫箟鏄竴涓猻ingleton杩樻槸涓�涓猵rototype銆� - * 濡傛灉涓庣粰瀹氬悕瀛楃浉搴旂殑bean瀹氫箟娌℃湁琚壘鍒帮紝灏嗕細鎶涘嚭涓�涓紓甯革紙NoSuchBeanDefinitionException锛� - * - * @param name - * @return boolean - * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException - * - */ - public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException { - return beanFactory.isSingleton(name); - } - - /** - * @param name - * @return Class 娉ㄥ唽瀵硅薄鐨勭被鍨� - * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException - * - */ - public static Class<?> getType(String name) throws NoSuchBeanDefinitionException { - return beanFactory.getType(name); - } - - /** - * 濡傛灉缁欏畾鐨刡ean鍚嶅瓧鍦╞ean瀹氫箟涓湁鍒悕锛屽垯杩斿洖杩欎簺鍒悕 - * - * @param name - * @return - * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException - * - */ - public static String[] getAliases(String name) throws NoSuchBeanDefinitionException { - return beanFactory.getAliases(name); - } - - /** - * 鑾峰彇aop浠g悊瀵硅薄 - * - * @param invoker - * @return - */ - @SuppressWarnings("unchecked") - public static <T> T getAopProxy(T invoker) { - return (T) AopContext.currentProxy(); - } - - /** - * 鑾峰彇褰撳墠鐨勭幆澧冮厤缃紝鏃犻厤缃繑鍥瀗ull - * - * @return 褰撳墠鐨勭幆澧冮厤缃� - */ - public static String[] getActiveProfiles() { - return applicationContext.getEnvironment().getActiveProfiles(); - } - - /** - * 鑾峰彇褰撳墠鐨勭幆澧冮厤缃紝褰撴湁澶氫釜鐜閰嶇疆鏃讹紝鍙幏鍙栫涓�涓� - * - * @return 褰撳墠鐨勭幆澧冮厤缃� - */ - public static String getActiveProfile() { - final String[] activeProfiles = getActiveProfiles(); - return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null; - } -} diff --git a/src/main/java/com/yssh/utils/StringUtils.java b/src/main/java/com/yssh/utils/StringUtils.java deleted file mode 100644 index 3aa0f64..0000000 --- a/src/main/java/com/yssh/utils/StringUtils.java +++ /dev/null @@ -1,528 +0,0 @@ -package com.yssh.utils; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.springframework.util.AntPathMatcher; - -/** - * 瀛楃涓插伐鍏风被 - * - * @author xingjinshuang@smartearth.cn - * @date 2023-02-06 - */ - -public class StringUtils extends org.apache.commons.lang3.StringUtils { - /** 绌哄瓧绗︿覆 */ - private static final String NULLSTR = ""; - - /** 涓嬪垝绾� */ - private static final char SEPARATOR = '_'; - - /** - * 鑾峰彇鍙傛暟涓嶄负绌哄�� - * - * @param value - * defaultValue 瑕佸垽鏂殑value - * @return value 杩斿洖鍊� - */ - public static <T> T nvl(T value, T defaultValue) { - return value != null ? value : defaultValue; - } - - /** - * * 鍒ゆ柇涓�涓狢ollection鏄惁涓虹┖锛� 鍖呭惈List锛孲et锛孮ueue - * - * @param coll - * 瑕佸垽鏂殑Collection - * @return true锛氫负绌� false锛氶潪绌� - */ - public static boolean isEmpty(Collection<?> coll) { - return isNull(coll) || coll.isEmpty(); - } - - /** - * * 鍒ゆ柇涓�涓狢ollection鏄惁闈炵┖锛屽寘鍚獿ist锛孲et锛孮ueue - * - * @param coll - * 瑕佸垽鏂殑Collection - * @return true锛氶潪绌� false锛氱┖ - */ - public static boolean isNotEmpty(Collection<?> coll) { - return !isEmpty(coll); - } - - /** - * * 鍒ゆ柇涓�涓璞℃暟缁勬槸鍚︿负绌� - * - * @param objects - * 瑕佸垽鏂殑瀵硅薄鏁扮粍 - ** @return true锛氫负绌� false锛氶潪绌� - */ - public static boolean isEmpty(Object[] objects) { - return isNull(objects) || (objects.length == 0); - } - - /** - * * 鍒ゆ柇涓�涓璞℃暟缁勬槸鍚﹂潪绌� - * - * @param objects - * 瑕佸垽鏂殑瀵硅薄鏁扮粍 - * @return true锛氶潪绌� false锛氱┖ - */ - public static boolean isNotEmpty(Object[] objects) { - return !isEmpty(objects); - } - - /** - * * 鍒ゆ柇涓�涓狹ap鏄惁涓虹┖ - * - * @param map - * 瑕佸垽鏂殑Map - * @return true锛氫负绌� false锛氶潪绌� - */ - public static boolean isEmpty(Map<?, ?> map) { - return isNull(map) || map.isEmpty(); - } - - /** - * * 鍒ゆ柇涓�涓狹ap鏄惁涓虹┖ - * - * @param map - * 瑕佸垽鏂殑Map - * @return true锛氶潪绌� false锛氱┖ - */ - public static boolean isNotEmpty(Map<?, ?> map) { - return !isEmpty(map); - } - - /** - * * 鍒ゆ柇涓�涓瓧绗︿覆鏄惁涓虹┖涓� - * - * @param str - * String - * @return true锛氫负绌� false锛氶潪绌� - */ - public static boolean isEmpty(String str) { - return isNull(str) || NULLSTR.equals(str.trim()); - } - - /** - * * 鍒ゆ柇涓�涓瓧绗︿覆鏄惁涓洪潪绌轰覆 - * - * @param str - * String - * @return true锛氶潪绌轰覆 false锛氱┖涓� - */ - public static boolean isNotEmpty(String str) { - return !isEmpty(str); - } - - /** - * * 鍒ゆ柇涓�涓璞℃槸鍚︿负绌� - * - * @param object - * Object - * @return true锛氫负绌� false锛氶潪绌� - */ - public static boolean isNull(Object object) { - return object == null; - } - - /** - * * 鍒ゆ柇涓�涓璞℃槸鍚﹂潪绌� - * - * @param object - * Object - * @return true锛氶潪绌� false锛氱┖ - */ - public static boolean isNotNull(Object object) { - return !isNull(object); - } - - /** - * * 鍒ゆ柇涓�涓璞℃槸鍚︽槸鏁扮粍绫诲瀷锛圝ava鍩烘湰鍨嬪埆鐨勬暟缁勶級 - * - * @param object - * 瀵硅薄 - * @return true锛氭槸鏁扮粍 false锛氫笉鏄暟缁� - */ - public static boolean isArray(Object object) { - return isNotNull(object) && object.getClass().isArray(); - } - - /** - * 鍘荤┖鏍� - */ - public static String trim(String str) { - return (str == null ? "" : str.trim()); - } - - /** - * 鎴彇瀛楃涓� - * - * @param str - * 瀛楃涓� - * @param start - * 寮�濮� - * @return 缁撴灉 - */ - public static String substring(final String str, int start) { - if (str == null) { - return NULLSTR; - } - - if (start < 0) { - start = str.length() + start; - } - - if (start < 0) { - start = 0; - } - if (start > str.length()) { - return NULLSTR; - } - - return str.substring(start); - } - - /** - * 鎴彇瀛楃涓� - * - * @param str - * 瀛楃涓� - * @param start - * 寮�濮� - * @param end - * 缁撴潫 - * @return 缁撴灉 - */ - public static String substring(final String str, int start, int end) { - if (str == null) { - return NULLSTR; - } - - if (end < 0) { - end = str.length() + end; - } - if (start < 0) { - start = str.length() + start; - } - - if (end > str.length()) { - end = str.length(); - } - - if (start > end) { - return NULLSTR; - } - - if (start < 0) { - start = 0; - } - if (end < 0) { - end = 0; - } - - return str.substring(start, end); - } - - /** - * 瀛楃涓茶浆set - * - * @param str - * 瀛楃涓� - * @param sep - * 鍒嗛殧绗� - * @return set闆嗗悎 - */ - public static final Set<String> str2Set(String str, String sep) { - return new HashSet<String>(str2List(str, sep, true, false)); - } - - /** - * 瀛楃涓茶浆list - * - * @param str - * 瀛楃涓� - * @param sep - * 鍒嗛殧绗� - * @param filterBlank - * 杩囨护绾┖鐧� - * @param trim - * 鍘绘帀棣栧熬绌虹櫧 - * @return list闆嗗悎 - */ - public static final List<String> str2List(String str, String sep, - boolean filterBlank, boolean trim) { - List<String> list = new ArrayList<String>(); - if (StringUtils.isEmpty(str)) { - return list; - } - - // 杩囨护绌虹櫧瀛楃涓� - if (filterBlank && StringUtils.isBlank(str)) { - return list; - } - String[] split = str.split(sep); - for (String string : split) { - if (filterBlank && StringUtils.isBlank(string)) { - continue; - } - if (trim) { - string = string.trim(); - } - list.add(string); - } - - return list; - } - - /** - * 鍒ゆ柇缁欏畾鐨剆et鍒楄〃涓槸鍚﹀寘鍚暟缁刟rray 鍒ゆ柇缁欏畾鐨勬暟缁刟rray涓槸鍚﹀寘鍚粰瀹氱殑鍏冪礌value - * - * @param 缁欏畾鐨勯泦鍚� - * @param array - * 缁欏畾鐨勬暟缁� - * @return boolean 缁撴灉 - */ - public static boolean containsAny(Collection<String> collection, - String... array) { - if (isEmpty(collection) || isEmpty(array)) { - return false; - } else { - for (String str : array) { - if (collection.contains(str)) { - return true; - } - } - return false; - } - } - - /** - * 鏌ユ壘鎸囧畾瀛楃涓叉槸鍚﹀寘鍚寚瀹氬瓧绗︿覆鍒楄〃涓殑浠绘剰涓�涓瓧绗︿覆鍚屾椂涓插拷鐣ュぇ灏忓啓 - * - * @param cs - * 鎸囧畾瀛楃涓� - * @param searchCharSequences - * 闇�瑕佹鏌ョ殑瀛楃涓叉暟缁� - * @return 鏄惁鍖呭惈浠绘剰涓�涓瓧绗︿覆 - */ - public static boolean containsAnyIgnoreCase(CharSequence cs, - CharSequence... searchCharSequences) { - if (isEmpty(cs) || isEmpty(searchCharSequences)) { - return false; - } - for (CharSequence testStr : searchCharSequences) { - if (containsIgnoreCase(cs, testStr)) { - return true; - } - } - return false; - } - - /** - * 椹煎嘲杞笅鍒掔嚎鍛藉悕 - */ - public static String toUnderScoreCase(String str) { - if (str == null) { - return null; - } - StringBuilder sb = new StringBuilder(); - // 鍓嶇疆瀛楃鏄惁澶у啓 - boolean preCharIsUpperCase = true; - // 褰撳墠瀛楃鏄惁澶у啓 - boolean curreCharIsUpperCase = true; - // 涓嬩竴瀛楃鏄惁澶у啓 - boolean nexteCharIsUpperCase = true; - for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - if (i > 0) { - preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); - } else { - preCharIsUpperCase = false; - } - - curreCharIsUpperCase = Character.isUpperCase(c); - - if (i < (str.length() - 1)) { - nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); - } - - if (preCharIsUpperCase && curreCharIsUpperCase - && !nexteCharIsUpperCase) { - sb.append(SEPARATOR); - } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) { - sb.append(SEPARATOR); - } - sb.append(Character.toLowerCase(c)); - } - - return sb.toString(); - } - - /** - * 鏄惁鍖呭惈瀛楃涓� - * - * @param str - * 楠岃瘉瀛楃涓� - * @param strs - * 瀛楃涓茬粍 - * @return 鍖呭惈杩斿洖true - */ - public static boolean inStringIgnoreCase(String str, String... strs) { - if (str != null && strs != null) { - for (String s : strs) { - if (str.equalsIgnoreCase(trim(s))) { - return true; - } - } - } - return false; - } - - /** - * 灏嗕笅鍒掔嚎澶у啓鏂瑰紡鍛藉悕鐨勫瓧绗︿覆杞崲涓洪┘宄板紡銆傚鏋滆浆鎹㈠墠鐨勪笅鍒掔嚎澶у啓鏂瑰紡鍛藉悕鐨勫瓧绗︿覆涓虹┖锛屽垯杩斿洖绌哄瓧绗︿覆銆� - * 渚嬪锛欻ELLO_WORLD->HelloWorld - * - * @param name - * 杞崲鍓嶇殑涓嬪垝绾垮ぇ鍐欐柟寮忓懡鍚嶇殑瀛楃涓� - * @return 杞崲鍚庣殑椹煎嘲寮忓懡鍚嶇殑瀛楃涓� - */ - public static String convertToCamelCase(String name) { - StringBuilder result = new StringBuilder(); - // 蹇�熸鏌� - if (name == null || name.isEmpty()) { - // 娌″繀瑕佽浆鎹� - return ""; - } else if (!name.contains("_")) { - // 涓嶅惈涓嬪垝绾匡紝浠呭皢棣栧瓧姣嶅ぇ鍐� - return name.substring(0, 1).toUpperCase() + name.substring(1); - } - // 鐢ㄤ笅鍒掔嚎灏嗗師濮嬪瓧绗︿覆鍒嗗壊 - String[] camels = name.split("_"); - for (String camel : camels) { - // 璺宠繃鍘熷瀛楃涓蹭腑寮�澶淬�佺粨灏剧殑涓嬫崲绾挎垨鍙岄噸涓嬪垝绾� - if (camel.isEmpty()) { - continue; - } - // 棣栧瓧姣嶅ぇ鍐� - result.append(camel.substring(0, 1).toUpperCase()); - result.append(camel.substring(1).toLowerCase()); - } - return result.toString(); - } - - /** - * 椹煎嘲寮忓懡鍚嶆硶 渚嬪锛歶ser_name->userName - */ - public static String toCamelCase(String s) { - if (s == null) { - return null; - } - s = s.toLowerCase(); - StringBuilder sb = new StringBuilder(s.length()); - boolean upperCase = false; - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - - if (c == SEPARATOR) { - upperCase = true; - } else if (upperCase) { - sb.append(Character.toUpperCase(c)); - upperCase = false; - } else { - sb.append(c); - } - } - return sb.toString(); - } - - /** - * 鏌ユ壘鎸囧畾瀛楃涓叉槸鍚﹀尮閰嶆寚瀹氬瓧绗︿覆鍒楄〃涓殑浠绘剰涓�涓瓧绗︿覆 - * - * @param str - * 鎸囧畾瀛楃涓� - * @param strs - * 闇�瑕佹鏌ョ殑瀛楃涓叉暟缁� - * @return 鏄惁鍖归厤 - */ - public static boolean matches(String str, List<String> strs) { - if (isEmpty(str) || isEmpty(strs)) { - return false; - } - for (String pattern : strs) { - if (isMatch(pattern, str)) { - return true; - } - } - return false; - } - - /** - * 鍒ゆ柇url鏄惁涓庤鍒欓厤缃�: ? 琛ㄧず鍗曚釜瀛楃; * 琛ㄧず涓�灞傝矾寰勫唴鐨勪换鎰忓瓧绗︿覆锛屼笉鍙法灞傜骇; ** 琛ㄧず浠绘剰灞傝矾寰�; - * - * @param pattern - * 鍖归厤瑙勫垯 - * @param url - * 闇�瑕佸尮閰嶇殑url - * @return - */ - public static boolean isMatch(String pattern, String url) { - AntPathMatcher matcher = new AntPathMatcher(); - return matcher.match(pattern, url); - } - - @SuppressWarnings("unchecked") - public static <T> T cast(Object obj) { - return (T) obj; - } - - /** - * 鏁板瓧宸﹁竟琛ラ綈0锛屼娇涔嬭揪鍒版寚瀹氶暱搴︺�傛敞鎰忥紝濡傛灉鏁板瓧杞崲涓哄瓧绗︿覆鍚庯紝闀垮害澶т簬size锛屽垯鍙繚鐣� 鏈�鍚巗ize涓瓧绗︺�� - * - * @param num - * 鏁板瓧瀵硅薄 - * @param size - * 瀛楃涓叉寚瀹氶暱搴� - * @return 杩斿洖鏁板瓧鐨勫瓧绗︿覆鏍煎紡锛岃瀛楃涓蹭负鎸囧畾闀垮害銆� - */ - public static final String padl(final Number num, final int size) { - return padl(num.toString(), size, '0'); - } - - /** - * 瀛楃涓插乏琛ラ綈銆傚鏋滃師濮嬪瓧绗︿覆s闀垮害澶т簬size锛屽垯鍙繚鐣欐渶鍚巗ize涓瓧绗︺�� - * - * @param s - * 鍘熷瀛楃涓� - * @param size - * 瀛楃涓叉寚瀹氶暱搴� - * @param c - * 鐢ㄤ簬琛ラ綈鐨勫瓧绗� - * @return 杩斿洖鎸囧畾闀垮害鐨勫瓧绗︿覆锛岀敱鍘熷瓧绗︿覆宸﹁ˉ榻愭垨鎴彇寰楀埌銆� - */ - public static final String padl(final String s, final int size, final char c) { - final StringBuilder sb = new StringBuilder(size); - if (s != null) { - final int len = s.length(); - if (s.length() <= size) { - for (int i = size - len; i > 0; i--) { - sb.append(c); - } - sb.append(s); - } else { - return s.substring(len - size, len); - } - } else { - for (int i = size; i > 0; i--) { - sb.append(c); - } - } - return sb.toString(); - } -} \ No newline at end of file diff --git a/src/main/java/com/yssh/utils/TableStrategy.java b/src/main/java/com/yssh/utils/TableStrategy.java deleted file mode 100644 index 9595ffc..0000000 --- a/src/main/java/com/yssh/utils/TableStrategy.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.yssh.utils; - -public class TableStrategy { - - public static final String SU_YUNA_TABLE_PREFIX = "su_yuan"; - - public static String getTableStrategy(String time){ - return SU_YUNA_TABLE_PREFIX + "_" + time; - } -} diff --git a/src/main/java/com/yssh/utils/VocParser.java b/src/main/java/com/yssh/utils/VocParser.java deleted file mode 100644 index 85d9889..0000000 --- a/src/main/java/com/yssh/utils/VocParser.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.yssh.utils; - -import com.github.biyanwen.impl.AbstractCsvFileParser; -import com.yssh.entity.VocVals; -import com.yssh.service.VocValsService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.math.BigInteger; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * VOC杞崲绫� - * @author WWW - * @date 2023-06-05 - */ -public class VocParser extends AbstractCsvFileParser<VocVals> { - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - - private final SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHH0000"); - - /** - * 姣忛殧5000鏉″叆搴撲竴娆� - */ - public static final int BATCH_COUNT = 100000; - - private BigInteger startId; - - private VocValsService vocValsService; - - private Date date; - - private List<VocVals> list = new ArrayList<>(BATCH_COUNT); - - public VocParser(VocValsService vocValsService, Date date) { - this.vocValsService = vocValsService; - this.date = date; - this.startId = new BigInteger(format.format(date)); - } - - public BigInteger getId() { - startId = startId.add(BigInteger.valueOf(1)); - - return startId; - } - - @Override - protected void doAfterAllAnalysed() { - inserts(); - } - - @Override - protected void invoke(VocVals vv) { - if (null == vv.getX() || vv.getX() < 0 || null == vv.getY() || vv.getY() < 0 || null == vv.getVal() || vv.getVal() <= 0) { - return; - } - - vv.setCreateTime(this.date); - vv.setId(getId()); - list.add(vv); - - if (list.size() >= BATCH_COUNT) { - inserts(); - list = new ArrayList<>(BATCH_COUNT); - } - } - - private void inserts() { - try { - if (list.size() > 0) { - //this.vocValsService.insertVocVals(list); - this.vocValsService.insertVocSync(list); - } - } catch (Exception e) { - logger.error(e.getMessage(), e); - e.printStackTrace(); - } - } -} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml deleted file mode 100644 index feb4d30..0000000 --- a/src/main/resources/application-dev.yml +++ /dev/null @@ -1,47 +0,0 @@ -# 鏁版嵁婧愰厤缃� -spring: - datasource: - type: com.alibaba.druid.pool.DruidDataSource - driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.20.228:3306/yssh?useUnicode=true&rewriteBatchedStatements=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: 123456 - # 鍒濆杩炴帴鏁� - initialSize: 10 - # 鏈�灏忚繛鎺ユ睜鏁伴噺 - minIdle: 20 - # 鏈�澶ц繛鎺ユ睜鏁伴噺 - maxActive: 100 - # 閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂� - maxWait: 600000 - # 閰嶇疆闂撮殧澶氫箙鎵嶈繘琛屼竴娆℃娴嬶紝妫�娴嬮渶瑕佸叧闂殑绌洪棽杩炴帴锛屽崟浣嶆槸姣 - timeBetweenEvictionRunsMillis: 60000 - # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�灏忕敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣 - minEvictableIdleTimeMillis: 300000 - # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�澶х敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣 - maxEvictableIdleTimeMillis: 900000 - # 閰嶇疆妫�娴嬭繛鎺ユ槸鍚︽湁鏁� - validationQuery: SELECT 1 FROM DUAL - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - webStatFilter: - enabled: true - statViewServlet: - enabled: true - # 璁剧疆鐧藉悕鍗曪紝涓嶅~鍒欏厑璁告墍鏈夎闂� - allow: - url-pattern: /druid/* - # 鎺у埗鍙扮鐞嗙敤鎴峰悕鍜屽瘑鐮� - login-username: admin - login-password: admin - filter: - stat: - enabled: true - # 鎱QL璁板綍 - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true \ No newline at end of file diff --git a/src/main/resources/application-file.yml b/src/main/resources/application-file.yml deleted file mode 100644 index dc439d0..0000000 --- a/src/main/resources/application-file.yml +++ /dev/null @@ -1,8 +0,0 @@ -#dat閰嶇疆璺緞 -dat: - filePath2d: 'D:\2022\dat\extract_mesh.dat' - filePath3d: 'D:\2022\dat\correct_jk_47.dat' -#csv閰嶇疆璺緞 -csv: - filePath: 'D:\2022\LBM_New' - vocPath: 'D:\2022\voc_all' diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml deleted file mode 100644 index 4830a99..0000000 --- a/src/main/resources/application-prod.yml +++ /dev/null @@ -1,47 +0,0 @@ -# 鏁版嵁婧愰厤缃� -spring: - datasource: - type: com.alibaba.druid.pool.DruidDataSource - driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://10.101.5.98:3306/yssh?useUnicode=true&rewriteBatchedStatements=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: 123456 - # 鍒濆杩炴帴鏁� - initialSize: 10 - # 鏈�灏忚繛鎺ユ睜鏁伴噺 - minIdle: 20 - # 鏈�澶ц繛鎺ユ睜鏁伴噺 - maxActive: 100 - # 閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂� - maxWait: 600000 - # 閰嶇疆闂撮殧澶氫箙鎵嶈繘琛屼竴娆℃娴嬶紝妫�娴嬮渶瑕佸叧闂殑绌洪棽杩炴帴锛屽崟浣嶆槸姣 - timeBetweenEvictionRunsMillis: 60000 - # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�灏忕敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣 - minEvictableIdleTimeMillis: 300000 - # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�澶х敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣 - maxEvictableIdleTimeMillis: 900000 - # 閰嶇疆妫�娴嬭繛鎺ユ槸鍚︽湁鏁� - validationQuery: SELECT 1 FROM DUAL - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - webStatFilter: - enabled: true - statViewServlet: - enabled: true - # 璁剧疆鐧藉悕鍗曪紝涓嶅~鍒欏厑璁告墍鏈夎闂� - allow: - url-pattern: /druid/* - # 鎺у埗鍙扮鐞嗙敤鎴峰悕鍜屽瘑鐮� - login-username: admin - login-password: admin - filter: - stat: - enabled: true - # 鎱QL璁板綍 - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true \ No newline at end of file diff --git a/src/main/resources/application-scheduled.yml b/src/main/resources/application-scheduled.yml deleted file mode 100644 index 5b2a072..0000000 --- a/src/main/resources/application-scheduled.yml +++ /dev/null @@ -1,5 +0,0 @@ -csv: - cron: '0 42 * * * ? ' - voc: '0 37 * * * ? ' - cron_max: 48 - voc_max: 96 diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml deleted file mode 100644 index 1726939..0000000 --- a/src/main/resources/application-test.yml +++ /dev/null @@ -1,47 +0,0 @@ -# 鏁版嵁婧愰厤缃� -spring: - datasource: - type: com.alibaba.druid.pool.DruidDataSource - driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://127.0.0.1:3306/yssh?useUnicode=true&rewriteBatchedStatements=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: mysql - # 鍒濆杩炴帴鏁� - initialSize: 10 - # 鏈�灏忚繛鎺ユ睜鏁伴噺 - minIdle: 20 - # 鏈�澶ц繛鎺ユ睜鏁伴噺 - maxActive: 100 - # 閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂� - maxWait: 600000 - # 閰嶇疆闂撮殧澶氫箙鎵嶈繘琛屼竴娆℃娴嬶紝妫�娴嬮渶瑕佸叧闂殑绌洪棽杩炴帴锛屽崟浣嶆槸姣 - timeBetweenEvictionRunsMillis: 60000 - # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�灏忕敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣 - minEvictableIdleTimeMillis: 300000 - # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�澶х敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣 - maxEvictableIdleTimeMillis: 900000 - # 閰嶇疆妫�娴嬭繛鎺ユ槸鍚︽湁鏁� - validationQuery: SELECT 1 FROM DUAL - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - webStatFilter: - enabled: true - statViewServlet: - enabled: true - # 璁剧疆鐧藉悕鍗曪紝涓嶅~鍒欏厑璁告墍鏈夎闂� - allow: - url-pattern: /druid/* - # 鎺у埗鍙扮鐞嗙敤鎴峰悕鍜屽瘑鐮� - login-username: admin - login-password: admin - filter: - stat: - enabled: true - # 鎱QL璁板綍 - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: - multi-statement-allow: true \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml deleted file mode 100644 index 26be5b1..0000000 --- a/src/main/resources/application.yml +++ /dev/null @@ -1,58 +0,0 @@ -# http://127.0.0.1:8082/doc.html -server: - port: 8082 - servlet: - # 搴旂敤鐨勮闂矾寰� - context-path: / - tomcat: - max-connections: 1000 - # tomcat鐨刄RI缂栫爜 - uri-encoding: UTF-8 - threads: - # tomcat鏈�澶х嚎绋嬫暟锛岄粯璁や负200 - max: 1000 - # Tomcat鍚姩鍒濆鍖栫殑绾跨▼鏁帮紝榛樿鍊�25 - min-spare: 25 - -spring: - jackson: - date-format: yyyy-MM-dd HH:mm:ss #鏃堕棿鎴崇粺涓�杞崲涓烘寚瀹氭牸寮� - time-zone: GMT+8 # 鏃跺尯淇敼涓轰笢8鍖� - profiles: - active: dev - include: scheduled,file -# 鏈嶅姟妯″潡 - devtools: - restart: - # 鐑儴缃插紑鍏� - enabled: true - -# 鏃ュ織閰嶇疆 -logging: - #config: classpath:logback.xml - level: - com.yssh: info - org.springframework: error - -#MyBatis閰嶇疆 -mybatis: - mapper-locations: classpath:mapping/*.xml - executor-type: batch - #浣跨敤type-aliases-package涓寚瀹歟ntity鎵弿鍖呯被璁﹎ybatis鑷畾鎵弿鍒拌嚜瀹氫箟鐨別ntity - type-aliases-package: com.yssh.**.entity - configuration: - log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl #鎸囧畾 MyBatis 鎵�鐢ㄦ棩蹇楃殑鍏蜂綋瀹炵幇锛屾湭鎸囧畾鏃跺皢鑷姩鏌ユ壘 - map-underscore-to-camel-case: true #寮�鍚嚜鍔ㄩ┘宄板懡鍚嶈鍒欙紙camel case锛夋槧灏� - lazy-loading-enabled: true #寮�鍚欢鏃跺姞杞藉紑鍏� - aggressive-lazy-loading: false #灏嗙Н鏋佸姞杞芥敼涓烘秷鏋佸姞杞斤紙鍗虫寜闇�鍔犺浇锛�,榛樿鍊煎氨鏄痜alse - lazy-load-trigger-methods: "" #闃绘尅涓嶇浉骞茬殑鎿嶄綔瑙﹀彂锛屽疄鐜版噿鍔犺浇 - cache-enabled: true #鎵撳紑鍏ㄥ眬缂撳瓨寮�鍏筹紙浜岀骇鐜锛夛紝榛樿鍊煎氨鏄痶rue - default-executor-type: SIMPLE - -knife4j: - # 鏄惁寮�鍚疭wagger - enabled: true - # 璇锋眰鍓嶇紑 - pathMapping: - # 鏄惁寮�鍚疜nife4j澧炲己妯″紡,榛樿鏄� false - enable: true \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml deleted file mode 100644 index 984f822..0000000 --- a/src/main/resources/logback.xml +++ /dev/null @@ -1,99 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<configuration> - <!-- 鏃ュ織瀛樻斁璺緞 --> - <property name="log.path" value="logs" /> - <!-- 鏃ュ織杈撳嚭鏍煎紡 --> - <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> - - <!-- 鎺у埗鍙拌緭鍑� --> - <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> - <encoder> - <pattern>${log.pattern}</pattern> - </encoder> - </appender> - - <appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender"> - <file>${log.path}/sys-debug.log</file> - <!-- 寰幆鏀跨瓥锛氬熀浜庢椂闂村垱寤烘棩蹇楁枃浠� --> - <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> - <!-- 鏃ュ織鏂囦欢鍚嶆牸寮� --> - <fileNamePattern>${log.path}/sys-debug.%d{yyyy-MM-dd}.log</fileNamePattern> - <!-- 鏃ュ織鏈�澶х殑鍘嗗彶 60澶� --> - <maxHistory>60</maxHistory> - </rollingPolicy> - <encoder> - <pattern>${log.pattern}</pattern> - </encoder> - <filter class="ch.qos.logback.classic.filter.LevelFilter"> - <!-- 杩囨护鐨勭骇鍒� --> - <level>DEBUG</level> - <!-- 鍖归厤鏃剁殑鎿嶄綔锛氭帴鏀讹紙璁板綍锛� --> - <onMatch>ACCEPT</onMatch> - <!-- 涓嶅尮閰嶆椂鐨勬搷浣滐細鎷掔粷锛堜笉璁板綍锛� --> - <onMismatch>DENY</onMismatch> - </filter> - </appender> - - <!-- 绯荤粺鏃ュ織杈撳嚭 --> - <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> - <file>${log.path}/sys-info.log</file> - <!-- 寰幆鏀跨瓥锛氬熀浜庢椂闂村垱寤烘棩蹇楁枃浠� --> - <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> - <!-- 鏃ュ織鏂囦欢鍚嶆牸寮� --> - <fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern> - <!-- 鏃ュ織鏈�澶х殑鍘嗗彶 60澶� --> - <maxHistory>60</maxHistory> - </rollingPolicy> - <encoder> - <pattern>${log.pattern}</pattern> - </encoder> - <filter class="ch.qos.logback.classic.filter.LevelFilter"> - <!-- 杩囨护鐨勭骇鍒� --> - <level>INFO</level> - <!-- 鍖归厤鏃剁殑鎿嶄綔锛氭帴鏀讹紙璁板綍锛� --> - <onMatch>ACCEPT</onMatch> - <!-- 涓嶅尮閰嶆椂鐨勬搷浣滐細鎷掔粷锛堜笉璁板綍锛� --> - <onMismatch>DENY</onMismatch> - </filter> - </appender> - - <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> - <file>${log.path}/sys-error.log</file> - <!-- 寰幆鏀跨瓥锛氬熀浜庢椂闂村垱寤烘棩蹇楁枃浠� --> - <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> - <!-- 鏃ュ織鏂囦欢鍚嶆牸寮� --> - <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern> - <!-- 鏃ュ織鏈�澶х殑鍘嗗彶 60澶� --> - <maxHistory>60</maxHistory> - </rollingPolicy> - <encoder> - <pattern>${log.pattern}</pattern> - </encoder> - <filter class="ch.qos.logback.classic.filter.LevelFilter"> - <!-- 杩囨护鐨勭骇鍒� --> - <level>ERROR</level> - <!-- 鍖归厤鏃剁殑鎿嶄綔锛氭帴鏀讹紙璁板綍锛� --> - <onMatch>ACCEPT</onMatch> - <!-- 涓嶅尮閰嶆椂鐨勬搷浣滐細鎷掔粷锛堜笉璁板綍锛� --> - <onMismatch>DENY</onMismatch> - </filter> - </appender> - - <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> - <encoder> - <pattern>${CONSOLE_LOG_PATTERN}</pattern> - </encoder> - </appender> - - <!-- 绯荤粺妯″潡鏃ュ織绾у埆鎺у埗 --> - <logger name="com.yssh" level="info" /> - <!-- Spring鏃ュ織绾у埆鎺у埗 --> - <logger name="org.springframework" level="error" /> - - <!--绯荤粺鎿嶄綔鏃ュ織--> - <root level="info"> - <appender-ref ref="file_info" /> - <appender-ref ref="file_error" /> - <appender-ref ref="console" /> - </root> -</configuration> \ No newline at end of file diff --git a/src/main/resources/mapping/AlertConfigMapper.xml b/src/main/resources/mapping/AlertConfigMapper.xml deleted file mode 100644 index 22cabb5..0000000 --- a/src/main/resources/mapping/AlertConfigMapper.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?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.yssh.dao.AlertConfigMapper"> - <resultMap id="AlertConfigResult" type="com.yssh.entity.AlertConfig"> - <id column="id" property="id" /> - <result column="jcyj" property="jcyj" /> - <result column="jcbj" property="jcbj" /> - <result column="pfyj" property="pfyj" /> - <result column="pfbj" property="pfbj" /> - </resultMap> - - <sql id="alertConfigSQL"> - SELECT id, jcyj, jcbj, pfyj, pfbj - FROM alert_config - </sql> - - <select id="getAll" resultMap="AlertConfigResult"> - <include refid="alertConfigSQL"></include> - </select> - - <select id="query" resultMap="AlertConfigResult" parameterType="Integer"> - <include refid="alertConfigSQL"></include> - WHERE id= #{id} - </select> - - <insert id="insert" parameterType="com.yssh.entity.AlertConfig"> - insert into alert_config ( - jcyj, jcbj, pfyj, pfbj - ) - values ( - #{jcyj},#{jcbj},#{pfyj},#{pfbj} - ) - </insert> - - <update id="update" parameterType="com.yssh.entity.AlertConfig"> - update alert_config - <set > - <if test="jcyj != null and jcyj != ''"> - jcyj = #{jcyj}, - </if> - <if test="jcbj != null and jcbj != ''"> - jcbj = #{jcbj}, - </if> - <if test="pfbj != null and pfbj != ''"> - pfbj = #{pfbj}, - </if> - <if test="pfyj != null and pfyj != ''"> - pfyj = #{pfyj}, - </if> - </set> - where id = #{id} - </update> - - <delete id="delete" parameterType="Integer"> - DELETE FROM alert_config WHERE id = #{id} - </delete> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/CommonMapper.xml b/src/main/resources/mapping/CommonMapper.xml deleted file mode 100644 index e535713..0000000 --- a/src/main/resources/mapping/CommonMapper.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?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.yssh.dao.CommonMapper"> - <select id="checkTableExistsWithSchema" resultType="java.lang.Integer"> - SELECT COUNT(1) FROM information_schema.tables WHERE - table_schema=#{tableSchema} AND table_name = #{tableName} - </select> - - <select id="checkTableExistsWithShow" parameterType="String" resultType="java.util.Map"> - show tables like #{tableName} - </select> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/DictRecordMapper.xml b/src/main/resources/mapping/DictRecordMapper.xml deleted file mode 100644 index 0b21e75..0000000 --- a/src/main/resources/mapping/DictRecordMapper.xml +++ /dev/null @@ -1,84 +0,0 @@ -<?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.yssh.dao.DictRecordMapper"> - - <resultMap id="DictRecordResult" type="com.yssh.entity.DictRecord"> - <id property="id" column="id" /> - <result property="tableName" column="table_name" /> - <result property="createTime" column="create_time" /> - <result property="remarks" column="remarks" /> - </resultMap> - - <sql id="selectDictRecordVo"> - SELECT id, table_name, create_time - FROM dict_record - </sql> - - <select id="selectDictRecordList" parameterType="com.yssh.entity.DictRecord" resultMap="DictRecordResult"> - <include refid="selectDictRecordVo"/> - <where> - <if test="tableName != null and tableName != ''"> and table_name like concat('%', #{tableName}, '%')</if> - </where> - ORDER BY create_time ASC - </select> - - <select id="selectByCreateTime" parameterType="Long" resultMap="DictRecordResult"> - SELECT id, table_name, create_time - FROM dict_record - WHERE create_time = #{createTime} - LIMIT 0, 1 - </select> - - <select id="selectByTime" resultMap="DictRecordResult"> - SELECT id, table_name, create_time - FROM dict_record - where str_to_date(create_time, '%Y%m%d%H') between #{start} and #{end} - order by create_time; - </select> - - <select id="selectByTimeDictRecordList" resultMap="DictRecordResult"> - SELECT id, table_name, create_time - FROM dict_record - WHERE create_time > #{startTime} - AND create_time <= #{endTime} - ORDER BY create_time ASC - </select> - - <insert id="insertDictRecord" parameterType="com.yssh.entity.DictRecord" useGeneratedKeys="true" keyProperty="id"> - insert into dict_record - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="tableName != null and tableName != ''">table_name,</if> - <if test="createTime != null">create_time,</if> - <if test="remarks != null">remarks,</if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="tableName != null and tableName != ''">#{tableName},</if> - <if test="createTime != null">#{createTime},</if> - <if test="remarks != null">#{remarks},</if> - </trim> - </insert> - - <delete id="deleteDictRecordById" parameterType="Long"> - delete from dict_record where id = #{id} - </delete> - - <delete id="deleteDictRecordByIds" parameterType="Long"> - delete from dict_record where id in - <foreach item="id" collection="array" open="(" separator="," close=")"> - #{id} - </foreach> - </delete> - - <!--鍒涘缓琛ㄧ殑 SQL 璇彞--> - <update id="createDictRecoTable"> - CREATE TABLE `dict_record` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '缂栧彿', - `table_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '琛ㄥ悕绉�', - `create_time` bigint(20) NULL DEFAULT NULL COMMENT '鍒涘缓鏃堕棿', - `remarks` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '澶囨敞', - PRIMARY KEY (`id`) USING BTREE - ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - </update> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/EmissionMapper.xml b/src/main/resources/mapping/EmissionMapper.xml deleted file mode 100644 index e0c00d5..0000000 --- a/src/main/resources/mapping/EmissionMapper.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?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.yssh.dao.EmissionMapper"> - <resultMap id="EmissionResult" type="com.yssh.entity.Emission"> - <id column="id" property="id" /> - <result column="name" property="name" /> - <result column="lon" property="lon" /> - <result column="lat" property="lat" /> - <result column="value" property="value" /> - <result column="time" property="time" /> - <result column="property" property="property" /> - </resultMap> - <select id="query" resultMap="EmissionResult"> - select id, name, lon, lat, format(value, 2) "value", time, property - from emission - <where> - <if test="name != null and name != ''"> - and name = #{name} - </if> - </where> - order by time desc - </select> - - <select id="getAll" resultMap="EmissionResult"> - select id, name, lon, lat, format(value, 2) "value", time, property - from emission - </select> - - <insert id="insert" parameterType="com.yssh.entity.Emission"> - insert into emission ( - name, lon, lat, value, time, property - ) - values ( - #{name},#{lon},#{lat},#{value},#{time},#{property} - ) - </insert> - <delete id="delete"> - delete from emission where id = #{id} - </delete> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/ExpPointMapper.xml b/src/main/resources/mapping/ExpPointMapper.xml deleted file mode 100644 index 84d8110..0000000 --- a/src/main/resources/mapping/ExpPointMapper.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?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.yssh.dao.ExpPointMapper"> - <resultMap id="ExpPointResult" type="com.yssh.entity.ExpPoint"> - <id column="id" property="id" /> - <result column="exp_site_number" property="expSiteNumber" /> - <result column="exp_point_type" property="expPointType" /> - <result column="ordinate_x" property="ordinateX" /> - <result column="abscissa_y" property="abscissaY" /> - <result column="elevation" property="elevation" /> - <result column="exploration_depth" property="explorationDepth" /> - <result column="exp_start_date" property="expStartDate" /> - <result column="exp_end_date" property="expEndDate" /> - <result column="groundwater_depth" property="groundwaterDepth" /> - <result column="wave_speed_instrument" property="waveSpeedInstrument" /> - <result column="wave_velocity_method" property="waveVelocityMethod" /> - <result column="wave_velocity_excitation_distance" property="waveVelocityExcitationDistance" /> - <result column="water_depth" property="waterDepth" /> - <result column="is_participate" property="isParticipate" /> - </resultMap> - - <select id="selectList" resultMap="ExpPointResult"> - SELECT * FROM exp_point - </select> - - <select id="selectByExpSiteNumbers" parameterType="java.util.List" resultMap="ExpPointResult"> - SELECT * - FROM exp_point - WHERE exp_site_number IN - <foreach collection="expSiteNumbers" item="expSiteNumber" open="(" separator="," close=")"> - #{expSiteNumber} - </foreach> - </select> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/FeedbackMapper.xml b/src/main/resources/mapping/FeedbackMapper.xml deleted file mode 100644 index 601c85b..0000000 --- a/src/main/resources/mapping/FeedbackMapper.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?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.yssh.dao.FeedbackMapper"> - <resultMap id="FeedbackDetailResult" type="com.yssh.entity.FeedbackDetail"> - <id property="id" column="id" /> - <result property="tableName" column="table_name" /> - <result property="locationName" column="location_name" /> - <result property="detectionId" column="detection_id" /> - <result property="detectionVocsName" column="detection_vocs_name" /> - <result property="detectionValue" column="detection_value" /> - <result property="practicalId" column="practical_id" /> - <result property="practicalVocsName" column="practical_vocs_name" /> - <result property="practicalValue" column="practical_value" /> - <result property="createTime" column="create_time" /> - </resultMap> - - <sql id="feedbackDetailSql"> - SELECT id, table_name, location_name, detection_id, detection_vocs_name, format(detection_value, 2) detection_value, - practical_id, practical_vocs_name, format(practical_value, 2) practical_value, create_time - FROM feedback - </sql> - - <select id="selectById" parameterType="java.lang.Long" resultMap="FeedbackDetailResult"> - <include refid="feedbackDetailSql"></include> - WHERE id = #{id} - </select> - - <select id="selectSevenDayAccuracyAvg" parameterType="java.lang.Long" resultType="java.lang.Double"> - SELECT COUNT(id)/(SELECT COUNT(id) FROM feedback - WHERE CONVERT(date_format(create_time, '%Y%m%d%H%'), SIGNED) >= #{beginTime}) FROM feedback - WHERE CONVERT(date_format(create_time, '%Y%m%d%H%'), SIGNED) >= #{beginTime} - AND practical_id IS NULL - </select> - - <insert id="insert" parameterType="com.yssh.entity.FeedbackDetail" useGeneratedKeys="true" keyProperty="id"> - INSERT INTO feedback - (table_name, location_name, detection_id, - detection_vocs_name, detection_value, practical_id, - practical_vocs_name, practical_value, create_time) - VALUES - (#{tableName}, #{locationName}, #{detectionId}, - #{detectionVocsName}, #{detectionValue}, #{practicalId}, - #{practicalVocsName}, #{practicalValue}, #{createTime}) - </insert> - - <update id="update" parameterType="com.yssh.entity.FeedbackDetail"> - UPDATE feedback SET - practical_id = #{practicalId}, practical_vocs_name = #{practicalVocsName}, practical_value = #{practicalValue} - WHERE id = #{id} - </update> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/LocationMapper.xml b/src/main/resources/mapping/LocationMapper.xml deleted file mode 100644 index e6665d9..0000000 --- a/src/main/resources/mapping/LocationMapper.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?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.yssh.dao.LocationMapper"> - <resultMap id="locationResult" type="com.yssh.entity.Location"> - <id column="id" property="id" javaType="java.lang.Integer" /> - <id column="name" property="name" javaType="java.lang.String" jdbcType="VARCHAR" /> - <id column="type" property="type" javaType="java.lang.String" jdbcType="VARCHAR"/> - <id column="lon" property="lon" javaType="java.lang.Float" jdbcType="DOUBLE"/> - <id column="lat" property="lat" javaType="java.lang.Float" jdbcType="DOUBLE"/> - </resultMap> - - <sql id="locationSql"> - SELECT id, name, type, format(lon, 6) lon, format(lat, 6) lat FROM location - </sql> - - <select id="selectByXY" resultMap="locationResult"> - <include refid="locationSql"></include> - <where> - lon between (#{x} - 0.000045) and (#{x} + 0.000045) - and - lat between (#{y} - 0.000045) and (#{y} + 0.000045) - </where> - </select> - - <select id="selectVocAddrs" resultMap="locationResult"> - select id, x "lon", y "lat", addr "name" - from voc_addr - where length(addr) > 0; - </select> - - <select id="query" resultMap="locationResult"> - <include refid="locationSql"></include> - <where> - <if test="name != null and name != ''"> - AND name LIKE concat('%', #{name}, '%') - </if> - <if test="type != null and type != ''"> - AND type = #{type} - </if> - </where> - </select> - - <select id="getAll" resultMap="locationResult"> - <include refid="locationSql"></include> - </select> - - <insert id="insertLocation" parameterType="com.yssh.entity.Location"> - insert into location( - name, type, lon, lat - ) - values ( - #{name},#{type},#{lon},#{lat} - ) - </insert> - - <delete id="deleteLocation"> - delete from location where id = #{id} - </delete> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/QxshMapper.xml b/src/main/resources/mapping/QxshMapper.xml deleted file mode 100644 index 74a41cd..0000000 --- a/src/main/resources/mapping/QxshMapper.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?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.yssh.dao.QxshMapper"> - <select id="selectByTime" resultType="com.yssh.entity.Qxsh"> - select id, name, lon, lat, format(value, 2) "value", time - from yssh_qxsh - where time = #{time} - order by name; - </select> - - <select id="selectMonthTop10" resultType="com.yssh.entity.Qxsh"> - with rs as ( - select id, name, format(value, 2) "value", time - from yssh_qxsh - where time like #{time} and name like 'AI-%' - ) - select id, name, value, time from rs - order by value desc - limit 10; - </select> - - <select id="select3Hours" resultType="com.yssh.entity.Qxsh"> - select id, name, format(value, 2) "value", time - from yssh_qxsh - where name like 'AI-%' and time in - <foreach collection="times" item="time" open="(" separator="," close=")"> - #{time} - </foreach> - order by name, time; - </select> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/StratumMapper.xml b/src/main/resources/mapping/StratumMapper.xml deleted file mode 100644 index f280b94..0000000 --- a/src/main/resources/mapping/StratumMapper.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?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.yssh.dao.StratumMapper"> - <resultMap id="StratumResult" type="com.yssh.entity.Stratum"> - <id column="id" property="id" /> - <result column="exp_site_number" property="expSiteNumber" /> - <result column="primary_layer_number" property="primaryLayerNumber" /> - <result column="sublayer_number" property="sublayerNumber" /> - <result column="geological_era" property="geologicalEra" /> - <result column="geological_genesis" property="geologicalGenesis" /> - <result column="layer_depth" property="layerDepth" /> - <result column="geotechnical_name" property="geotechnicalName" /> - <result column="geotechnical_category" property="geotechnicalCategory" /> - <result column="description" property="description" /> - </resultMap> - - <select id="select" parameterType="java.util.Map" resultMap="StratumResult"> - SELECT * - FROM stratum - WHERE exp_site_number = #{expSiteNumber} - LIMIT #{begin},#{end} - </select> - - <select id="selectByExpSiteNumbers" resultMap="StratumResult"> - SELECT * - FROM stratum - WHERE exp_site_number IN - <foreach collection="expSiteNumbers" item="expSiteNumber" open="(" separator="," close=")"> - #{expSiteNumber} - </foreach> - GROUP BY exp_site_number - </select> - - <select id="selectByGeotechnicalName" parameterType="java.util.Map" resultMap="StratumResult"> - SELECT * - FROM stratum - WHERE exp_site_number = #{expSiteNumber} - AND geotechnical_name = #{geotechnicalName} - LIMIT #{start}, #{rows} - </select> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/SuYuanMapper.xml b/src/main/resources/mapping/SuYuanMapper.xml deleted file mode 100644 index f30e3c7..0000000 --- a/src/main/resources/mapping/SuYuanMapper.xml +++ /dev/null @@ -1,232 +0,0 @@ -<?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.yssh.dao.SuYuanMapper"> - <resultMap id="SuYuan2dResult" type="com.yssh.entity.SuYuan2d"> - <result property="id" column="id" /> - <result property="x" column="x" /> - <result property="y" column="y" /> - <result property="value" column="c" /> - </resultMap> - - <resultMap id="SuYuan3dResult" type="com.yssh.entity.SuYuan3d"> - <result property="id" column="id" /> - <result property="x" column="x" /> - <result property="y" column="y" /> - <result property="height0" column="height0" /> - <result property="height10" column="height10" /> - <result property="height20" column="height20" /> - <result property="height30" column="height30" /> - <result property="height40" column="height40" /> - <result property="height50" column="height50" /> - <result property="height60" column="height60" /> - <result property="height70" column="height70" /> - <result property="height80" column="height80" /> - <result property="height90" column="height90" /> - </resultMap> - - <resultMap id="DistanceSuYuanResult" type="com.yssh.entity.DistanceSuYuan"> - <result property="id" column="id" /> - <result property="x" column="x" /> - <result property="y" column="y" /> - <result property="u" column="u" /> - <result property="v" column="v" /> - <result property="vocsValue" column="c" /> - </resultMap> - - <resultMap id="TemporaryResult" type="com.yssh.entity.Temporary"> - <result property="id" column="id" /> - <result property="x" column="x" /> - <result property="y" column="y" /> - <result property="z" column="z" /> - <result property="u" column="u" /> - <result property="v" column="v" /> - <result property="w" column="w" /> - <result property="c" column="c" /> - </resultMap> - - <resultMap id="SuYuanMonitorDataResult" type="com.yssh.entity.SuYuanMonitorData"> - <result property="id" column="id" /> - <result property="value" column="c" /> - <result property="time" column="time" /> - </resultMap> - - <select id="get2d" resultMap="SuYuan2dResult"> - SELECT id, x, y, format(c, 2) "c" - FROM ${tableName} - WHERE id IN - <foreach collection="ids" item="item" open="(" separator="," close=")"> - #{item} - </foreach> - ORDER BY z ASC, x ASC, y DESC - </select> - - <select id="get3d" resultMap="SuYuan3dResult"> - SELECT sy.id, sy.x, sy.y, sy.id, sy.x, sy.y, ( - SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2), 0) - ) AS height0, ( - SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2), 1) - ) AS height10, ( - SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2), 2) - ) AS height20, ( - SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2), 3) - ) AS height30, ( - SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2), 4) - ) AS height40, ( - SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2), 5) - ) AS height50, ( - SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2), 6) - ) AS height60, ( - SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2), 7) - ) AS height70, ( - SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2), 8) - ) AS height80, ( - SELECT format(c, 2) "c" FROM ${tableName} WHERE id = concat_ws('_', SUBSTRING_INDEX(sy.id,'_',2), 9) - ) AS height90 - FROM ${tableName} AS sy - WHERE id IN - <foreach collection="ids" item="item" open="(" separator="," close=")"> - #{item} - </foreach> - ORDER BY sy.z ASC, sy.x ASC, sy.y DESC - </select> - - <select id="getDistanceSuYuan" resultMap="DistanceSuYuanResult"> - SELECT id, x, y, format(c, 2) "c", u, v - FROM ${tableName} - WHERE id IN - <foreach collection="ids" item="item" open="(" separator="," close=")"> - #{item} - </foreach> - ORDER BY z ASC, x ASC, y DESC - </select> - - <select id="getSuYuan500Max" resultMap="DistanceSuYuanResult"> - select id, x, y, format(c, 2) "c", u, v - from ${tableName} - where id in - <foreach collection="ids" item="item" open="(" separator="," close=")"> - #{item} - </foreach> - order by c desc - limit 1; - </select> - - <select id="getSuYuanById" resultMap="DistanceSuYuanResult"> - select id, x, y, format(c, 2) "c", u, v - from ${tableName} - where id = #{id} - </select> - - <select id="getAlarmsAnalyse" resultMap="SuYuan2dResult"> - SELECT id, x, y, format(c, 2) "c" - FROM ${tableName} - WHERE id IN - <foreach collection="ids" item="item" open="(" separator="," close=")"> - #{item} - </foreach> - AND c >= (SELECT jcbj FROM alert_config LIMIT 1) - </select> - - <select id="getWarningAnalyse" resultMap="SuYuan2dResult"> - SELECT id, x, y, format(c, 2) "c" - FROM ${tableName} - WHERE id IN - <foreach collection="ids" item="item" open="(" separator="," close=")"> - #{item} - </foreach> - and c >= (select jcyj from alert_config limit 1) and c < (select jcbj from alert_config limit 1) - </select> - - <select id="getMonitorData" resultMap="SuYuanMonitorDataResult"> - <foreach collection="tableNames" item="tableName" separator=" UNION "> - SELECT id, format(c, 2) "c", SUBSTRING_INDEX(#{tableName}, '_', -1) AS time - FROM ${tableName} - WHERE id = #{id} - </foreach> - </select> - - <select id="getNewMonitorData" resultType="com.yssh.entity.SuYuanMonitorData"> - select id, format(value, 2) "value", time - from yssh_qxsh - where name = #{name} and Cast(time as signed) between ${start} and ${end} - order by time desc; - </select> - - <select id="getMonthValueDataMax" resultType="java.util.Map"> - <foreach collection="tableNames" item="tableName" separator=" UNION "> - SELECT format(c, 2) AS value, SUBSTRING_INDEX(#{tableName}, '_', -1) AS time - FROM ${tableName} - WHERE id = #{id} - </foreach> - ORDER BY value DESC - LIMIT 1 - </select> - - <select id="selectSuYuan700ById" resultType="com.yssh.entity.SuYuan700"> - select * from suyuan_700 - where su_yuan_id = #{id} and create_time = #{time} - limit 1; - </select> - - <select id="selectSuYuan46ById" resultType="com.yssh.entity.SuYuan700"> - select * from suyuan_46 - where su_yuan_id = #{id} and create_time = #{time} - limit 1; - </select> - - <select id="getTemporary" resultMap="TemporaryResult"> - SELECT x, y, z, u, v, w, format(c, 2) "c" - FROM ${tableName} - WHERE id IN - <foreach collection="ids" item="item" open="(" separator="," close=")"> - #{item} - </foreach> - ORDER BY z ASC, x ASC, y DESC - </select> - - <insert id="batchInsert"> - INSERT INTO ${tableName} ( - id,x,y,z,u,v,w,c - )VALUES - <foreach collection="datas" item="item" separator=","> - ( - #{item.id}, - #{item.x}, - #{item.y}, - #{item.z}, - #{item.u}, - #{item.v}, - #{item.w}, - #{item.c} - ) - </foreach> - </insert> - - <select id="isTableExists" resultType="java.lang.Integer"> - select count(*) from information_schema.tables where table_name = #{tableName}; - </select> - - <update id="createTable" parameterType="java.lang.String"> - CREATE TABLE ${tableName} ( - `id` varchar(255) NOT NULL COMMENT '涓婚敭', - `x` int(7) NULL DEFAULT NULL, - `y` int(7) NULL DEFAULT NULL, - `z` int(7) NULL DEFAULT NULL, - `u` double NULL DEFAULT NULL, - `v` double NULL DEFAULT NULL, - `w` double NULL DEFAULT NULL, - `c` double NULL DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE - ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - </update> - - <update id="update" > - UPDATE ${tableName} SET c = #{value} WHERE id = #{id} - </update> - - <update id="updateVocsName"> - update ${table} set vocsName = #{vocsName} where id = #{id}; - </update> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/ThuAccuracyMapper.xml b/src/main/resources/mapping/ThuAccuracyMapper.xml deleted file mode 100644 index c4bab7b..0000000 --- a/src/main/resources/mapping/ThuAccuracyMapper.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?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.yssh.dao.ThuAccuracyMapper"> - <resultMap id="ThuAccuracyResult" type="com.yssh.entity.ThuAccuracy"> - <id column="id" property="id" /> - <result column="name" property="name" /> - <result column="lon" property="lon" /> - <result column="lat" property="lat" /> - <result column="value" property="value" /> - <result column="time" property="time" /> - <result column="property" property="property" /> - <result column="wg100" property="wg100" /> - <result column="wg200" property="wg200" /> - <result column="wg300" property="wg300" /> - <result column="wg500" property="wg500" /> - <result column="accuracy" property="accuracy" /> - </resultMap> - - <sql id="ThuAccuracySql"> - SELECT id, name, lon, lat, value, time, property, wg100, wg200, wg300, wg500, accuracy - FROM thu_accuracy - </sql> - - <select id="selectSevenDayAccuracyAvg" parameterType="java.lang.Long" resultType="java.lang.Double"> - SELECT sum(accuracy)/count(id) AS accuracy - FROM thu_accuracy - <!-- WHERE accuracy > 0 --> - WHERE CONVERT(time, unsigned) >= #{beginTime} - </select> - - <select id="getForecastData" parameterType="java.util.Map" resultMap="ThuAccuracyResult"> - SELECT TRIM(ta.name), ta.value, ta.time - FROM thu_accuracy AS ta - WHERE CONVERT(TRIM(ta.time), SIGNED) >= CONVERT(date_format(#{beginTime}, '%Y%m%d%H%'), SIGNED) - AND CONVERT(TRIM(ta.time), SIGNED) <= CONVERT(date_format(#{endTime}, '%Y%m%d%H%'), SIGNED) - AND ta.name = #{name} - </select> - - - <delete id="delete"> - delete from thu_accuracy where id = #{id} - </delete> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/VocValsMapper.xml b/src/main/resources/mapping/VocValsMapper.xml deleted file mode 100644 index 8155c12..0000000 --- a/src/main/resources/mapping/VocValsMapper.xml +++ /dev/null @@ -1,62 +0,0 @@ -<?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.yssh.dao.VocValsMapper"> - <resultMap id="selectMap" type="com.yssh.entity.VocVals"> - <id property="id" column="id" /> - <result property="x" column="x" /> - <result property="y" column="y" /> - <result property="val" column="val" /> - <result property="createTime" column="create_time" /> - <result property="addr" column="addr" /> - </resultMap> - - <select id="selectByTime" resultMap="selectMap"> - select a.x, a.y, format(a.val, 2) "val", b.addr - from voc_vals a inner join voc_addr b - on a.x = b.x and a.y = b.y - where date_format(a.create_time, '%Y%m%d%H') = ${time} - and a.val > (select jcyj from alert_config); - </select> - - <select id="countByTime" resultType="java.lang.Integer"> - select count(*) - from voc_vals - where date_format(create_time, '%Y%m%d%H') = ${time}; - </select> - - <select id="selectCoords" resultType="com.yssh.entity.VocCoords"> - select x, y, addr - from voc_addr - <where> - 1 = 1 - <if test="x != null"> - and x = ${x} - </if> - <if test="y != null"> - and y = ${y} - </if> - </where> - </select> - - <insert id="insert" parameterType="com.yssh.entity.VocVals" useGeneratedKeys="false" keyProperty="id"> - insert into voc_vals (id, x, y, val, create_time) values - (${id}, ${x}, ${y}, ${val}, ${createTime}); - </insert> - - <insert id="inserts" parameterType="com.yssh.entity.VocVals" useGeneratedKeys="false" keyProperty="id"> - insert into voc_vals (id, x, y, val, create_time) values - <foreach collection="list" item="item" index="index" separator=","> - (${item.id}, #{item.x},#{item.y},#{item.val},#{item.createTime}) - </foreach> - </insert> - - <delete id="deleteLastYear"> - delete from voc_vals - where create_time < date_sub(now(), interval 1 year); - </delete> - - <delete id="deleteByTime"> - delete from voc_vals - where date_format(create_time, '%Y%m%d%H') = ${time}; - </delete> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/WarningDetailMapper.xml b/src/main/resources/mapping/WarningDetailMapper.xml deleted file mode 100644 index 1084d04..0000000 --- a/src/main/resources/mapping/WarningDetailMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ -<?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.yssh.dao.WarningDetailMapper"> - <resultMap id="WarningDetailResult" type="com.yssh.entity.WarningDetail"> - <id property="id" column="id" /> - <result property="tableName" column="table_name" /> - <result property="suYuanId" column="su_yuan_id" /> - <result property="locationName" column="location_name" /> - <result property="type" column="type" /> - <result property="createTime" column="create_time" /> - <result property="value" column="value" /> - </resultMap> - - <resultMap id="WarningVoResult" type="com.yssh.entity.vo.WarningVo"> - <result property="location_name" column="locationName" /> - <result property="suYuanId" column="su_yuan_id" /> - <result property="value" column="value" /> - </resultMap> - - <select id="selectWarningDetailByType" resultMap="WarningVoResult"> - SELECT location_name, su_yuan_id, format(value, 2) "value" - FROM warning_detail - WHERE date_format(create_time, '%Y%m%d%H%I') >= date_format(NOW(), '%Y%m%d%H%I') - AND type = #{type} - </select> - - <select id="selectWarningDetailByMap_old" parameterType="java.util.Map" resultMap="WarningVoResult"> - SELECT location_name, su_yuan_id, format(value, 2) "value" - FROM warning_detail - WHERE date_format(create_time, '%Y%m%d%H%I%S') >= date_format(#{startTime}, '%Y%m%d%H%I%S') - AND date_format(create_time, '%Y%m%d%H%I%S') <= date_format(#{endTime}, '%Y%m%d%H%I%S') - AND type = #{type} - </select> - - <select id="selectWarningDetailByMap" parameterType="java.util.Map" resultMap="WarningVoResult"> - select location_name, su_yuan_id, format(value, 2) "value" - from warning_detail - where create_time between #{startTime} and #{endTime} and type = #{type}; - </select> - - <select id="countWarnByMap" resultType="java.lang.Integer"> - with rs as (select jcyj, jcbj from alert_config limit 1) - select count(*) - from warning_detail - where create_time between #{startTime} and #{endTime} - and value >= (select jcyj from rs) and value < (select jcbj from rs); - </select> - - <select id="countAlarmByMap" resultType="java.lang.Integer"> - with rs as (select jcyj, jcbj from alert_config limit 1) - select count(*) - from warning_detail - where create_time between #{startTime} and #{endTime} - and value >= (select jcbj from rs); - </select> - - <select id="selectWarningDayCountByMap_old" parameterType="java.util.Map" resultType="java.util.Map"> - SELECT date_format(create_time,'%Y%m%d') AS createTime, count(id) AS num - FROM warning_detail - WHERE date_format(create_time, '%Y%m%d%H%I%S') >= date_format(#{startTime}, '%Y%m%d%H%I%S') - AND date_format(create_time, '%Y%m%d%H%I%S') <= date_format(#{endTime}, '%Y%m%d%H%I%S') - AND type = #{type} - GROUP BY DATE_FORMAT(create_time,'%Y%m%d%') - ORDER BY create_time ASC - </select> - - <select id="selectWarningDayCountByMap" parameterType="java.util.Map" resultType="java.util.Map"> - with rs as ( - select date_format(create_time, '%Y%m%d') AS ct, id, type - from warning_detail - where create_time between #{startTime} and #{endTime} and type = #{type} - ) - select ct as createTime, count(id) as num - from rs - group by ct - order by ct asc; - </select> - - <select id="selectByTime" resultMap="WarningDetailResult"> - select id, table_name, su_yuan_id, location_name, type, create_time, format(value, 2) "value" - from warning_detail - where create_time between #{startTime} and #{endTime} - order by create_time; - </select> - - <select id="selectByTimeForYj" resultMap="WarningDetailResult"> - with rs as (select jcyj, jcbj from alert_config limit 1) - select id, table_name, su_yuan_id, location_name, 1 "type", create_time, format(value, 2) "value" - from warning_detail - where create_time between #{startTime} and #{endTime} - and value >= (select jcyj from rs) and value < (select jcbj from rs) - order by value; - </select> - - <select id="selectByTimeForBj" resultMap="WarningDetailResult"> - with rs as (select jcyj, jcbj from alert_config limit 1) - select id, table_name, su_yuan_id, location_name, 0 "type", create_time, format(value, 2) "value" - from warning_detail - where create_time between #{startTime} and #{endTime} - and value >= (select jcbj from rs) - order by value; - </select> - - <select id="getLastYearVal" resultType="java.lang.Double"> - with rs as ( - select su_yuan_id "id", date_sub(create_time, interval 1 year) "time" - from warning_detail where id = ${id}) - select format(value, 2) "val" - from warning_detail - where su_yuan_id = (select id from rs) and create_time = (select time from rs); - </select> - - <insert id="batchInsert"> - INSERT INTO warning_detail (table_name, su_yuan_id, location_name, type, create_time, value)VALUES - <foreach collection="datas" item="item" separator=","> - ( - #{item.tableName}, - #{item.suYuanId}, - #{item.locationName}, - #{item.type}, - #{item.createTime}, - #{item.value} - ) - </foreach> - </insert> -</mapper> \ No newline at end of file diff --git a/src/main/resources/mapping/WeatherMapper.xml b/src/main/resources/mapping/WeatherMapper.xml deleted file mode 100644 index fafc4a4..0000000 --- a/src/main/resources/mapping/WeatherMapper.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?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.yssh.dao.WeatherMapper"> - <resultMap id="WeatherResult" type="com.yssh.entity.Weather"> - <id column="id" property="id" javaType="java.lang.Integer" /> - <id column="time" property="time" javaType="java.lang.String" jdbcType="VARCHAR" /> - <id column="wind_Speed" property="windSpeed" javaType="java.lang.String" jdbcType="VARCHAR"/> - <id column="wind_direction" property="windDirection" javaType="java.lang.String" jdbcType="VARCHAR"/> - <id column="weather_condition" property="weatherCondition" javaType="java.lang.String" jdbcType="VARCHAR"/> - <id column="temperature" property="temperature" javaType="java.lang.String" jdbcType="VARCHAR"/> - </resultMap> - - <select id="query" resultMap="WeatherResult"> - select id, time, format(wind_speed, 2) "wind_speed", wind_direction, weather_condition, format(temperature, 2) "temperature" - from yssh_weather - <where> - 1 = 1 - <if test="begin != null"> - and str_to_date(time, '%Y-%m-%d-%H:%i:%S') >= #{begin} - </if> - <if test="end != null"> - and str_to_date(time, '%Y-%m-%d-%H:%i:%S') <= #{end} - </if> - </where> - </select> - - <select id="getAll" resultMap="WeatherResult"> - select id, time, format(wind_speed, 2) "wind_speed", wind_direction, weather_condition, format(temperature, 2) "temperature" - from yssh_weather - </select> - - <insert id="insert" parameterType="com.yssh.entity.Weather"> - insert into yssh_weather ( - time, wind_speed, wind_direction, weather_condition, temperature - ) - values ( - #{time},#{windSpeed},#{windDirection},#{weatherCondition},#{temperature} - ) - </insert> - <delete id="delete"> - delete from yssh_weather where id = #{id} - </delete> -</mapper> \ No newline at end of file diff --git "a/\350\257\264\346\230\216.txt" "b/\350\257\264\346\230\216.txt" index 377813d..25bfb94 100644 --- "a/\350\257\264\346\230\216.txt" +++ "b/\350\257\264\346\230\216.txt" @@ -4,9 +4,9 @@ reset master; 2.澶栫綉浜戠櫥褰曟柟寮忥細 ->1.鐧诲綍澶栫綉浜戯紝鐢ㄦ埛鍚嶆槸maxy628 123.114.233.55锛岃緭鍏ラ獙璇佺爜 +>1.鐧诲綍澶栫綉浜戯紝鐢ㄦ埛鍚嶆槸maxy628 123.114.233.55锛岃緭鍏ラ獙璇佺爜锛宲assd123!@#.. >2.杩涘叆浜戞闈� 锛屾祻瑙堝櫒璁块棶10.101.3.183 杩涘叆鍫″瀿鏈虹郴缁� - 鐢ㄦ埛璐﹀彿锛歮axy628.yssh 瀵嗙爜锛歽ssh1234@#.. + 鐢ㄦ埛璐﹀彿锛歮axy628.yssh 瀵嗙爜锛歽ssh1234@#..锛寉ssh1234@#628 >3. 鍏ㄥ眬鎼滅储 98銆�101銆�102銆�103 3.瀹㈡埛绔湴鍧�锛� -- Gitblit v1.9.3