lubian cat

master
hwf453 1 year ago
parent 233c61c5c6
commit a7eb835b98

6
.gitignore vendored

@ -17,3 +17,9 @@ buildNumber.properties
# JDT-specific (Eclipse Java Development Tools)
.classpath
/weather/target
/weather/target/*
/storm_zj_hz/target
/storm_zj_hz/target/*

@ -31,10 +31,11 @@
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.0</version>
</dependency>
<!--mysql驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.26</version>
<scope>runtime</scope>
</dependency>
<dependency>
@ -94,7 +95,7 @@
<dependency>
<groupId>com.liuhuiyu</groupId>
<artifactId>util</artifactId>
<version>2021.2.0</version>
<version>2022.1.0</version>
</dependency>
<dependency>
<groupId>com.liuhuiyu</groupId>

@ -109,7 +109,7 @@ public class ScheduledService {
/**
* @date 2022-03-16 09:41
* @description: ,
* @description: , OkHttpClient
* @Param: null
*/
//@Scheduled(cron = "0 0 10,14,18,20,22 * * *")//每天1014182022点各执行一次一天总共执行五次
@ -207,7 +207,7 @@ public class ScheduledService {
/**
* @date 2022-03-16 09:41
* @description: ,
* @description: ,
* @Param: null
*/
//@Scheduled(cron = "*/5 * * * * *")//每天0816点各执行一次一天总共执行三次
@ -234,7 +234,7 @@ public class ScheduledService {
/**
* @date 2022-03-16 09:41
* @description: ,
* @description: , OkHttpClient
* @Param: null
*/
//@Scheduled(cron = "*/10 * * * * *")//每天0816点各执行一次一天总共执行三次
@ -279,7 +279,7 @@ public class ScheduledService {
/**
* @date 2022-03-16 09:41
* @description: ,
* @description: , ,OkHttpClient
* @Param: null
*/
//@Scheduled(cron = "*/10 * * * * *")//每天0816点各执行一次一天总共执行三次
@ -328,7 +328,7 @@ public class ScheduledService {
/**
* @date 2022-03-16 09:41
* @description: ,
* @description: ,
* @Param: null
*/
//@Scheduled(cron = "*/10 * * * * *")//每天0816点各执行一次一天总共执行三次
@ -380,7 +380,7 @@ public class ScheduledService {
/**
* @date 2022-03-16 09:41
* @description: ,
* @description: ,
* @Param: null
*/
//@Scheduled(cron = "*/10 * * * * *")//每天0816点各执行一次一天总共执行三次
@ -518,10 +518,10 @@ public class ScheduledService {
/**
* @date 2022-03-16 09:41
* @description:
* @description:
* @Param: null
*/
@Scheduled(cron = "0 15 * * * *")
//@Scheduled(cron = "0 15 * * * *")
public void getNmcNowWeather() {
System.out.println("scheduledGetWeather");
System.out.println("=====>>>>>使用cron:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
@ -591,12 +591,23 @@ public class ScheduledService {
}
}
/**
* @date 2022-03-16 09:41
* @description:
* @Param: null
*/
// @Scheduled(cron = "0 48 * * * *")
// public void getZjsltHistoryStormList() {
// for(int i=1940;i<2025;i++){
// getZjsltStormList(String.valueOf(i));
// }
// }
/**
* @date 2022-03-16 09:41
* @description:
* @Param: null
*/
@Scheduled(cron = "0 10 * * * *")
//@Scheduled(cron = "0 30 * * * *")
public void getZjsltStormList() {
System.out.println("getZjsltStormList");
String strNow = String.valueOf(System.currentTimeMillis());
@ -608,12 +619,12 @@ public class ScheduledService {
.readTimeout(30, TimeUnit.SECONDS)
.build();
try {
//Thread.sleep(10000);
Thread.sleep(5000);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");
String nowDate = sdf.format(new Date());
String nowYear = sdfYear.format(new Date());
//nowYear = String.valueOf(i);
Random random = new Random();//以系统自身时间为种子数
int iRandom = random.nextInt();
Long nowLong = 13728353350362976L;
@ -681,7 +692,7 @@ public class ScheduledService {
}
}
}
} catch (IOException e) {
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
@ -767,8 +778,21 @@ public class ScheduledService {
* @description:
* @Param: null
*/
@Scheduled(cron = "0 12 * * * *")
public void getWztfStormList() {
@Scheduled(cron = "0 30 * * * *")
public void getWztfHistoryStormList() {
for(int i=1945;i<2025;i++){
getWztfStormList(String.valueOf(i));
}
//getWztfStormList(String.valueOf(1944));
}
/**
* @date 2022-03-16 09:41
* @description:
* @Param: null
*/
//@Scheduled(cron = "0 15 * * * *")
public void getWztfStormList(String nowYear) {
// 初始化 OkHttpClient
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
@ -777,11 +801,11 @@ public class ScheduledService {
.build();
try {
//Thread.sleep(1000);
Thread.sleep(3000);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");
String nowDate = sdf.format(new Date());
String nowYear = sdfYear.format(new Date());
//String nowYear = sdfYear.format(new Date());
//nowYear = String.valueOf(i);
String url = "http://data.istrongcloud.com/v2/data/complex/" + nowYear + ".json?v=" + String.valueOf(System.currentTimeMillis());
@ -794,7 +818,7 @@ public class ScheduledService {
// 得到返回Response
Response response = client.newCall(request).execute();
String body = response.body().string();
//System.out.println(body);
System.out.println(body);
if (StringUtils.hasText(body)) {
if (body.length() > 2) {
Gson gson = new Gson();
@ -840,7 +864,7 @@ public class ScheduledService {
}
}
}
} catch (IOException e) {
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}

@ -13,10 +13,10 @@ spring:
#url: jdbc:mysql://121.36.143.201:33400/hefengweather?useUnicode=true&characterEncoding=utf-8&useSSL=false
#url: jdbc:mysql://192.168.1.28:3340/hefengweather?useUnicode=true&characterEncoding=utf-8&useSSL=false
# url: jdbc:mysql://192.168.1.71:2881/hefengweather?useUnicode=true&characterEncoding=utf-8&useSSL=false
# driverClassName: com.mysql.jdbc.Driver #com.mysql.cj.jdbc.Driver com.mysql.jdbc.Driver
# url: jdbc:mysql://192.168.5.21:3306/nmcweather?useUnicode=true&characterEncoding=utf-8&useSSL=false
# username: root
# password: Skyinno251,
driverClassName: com.mysql.cj.jdbc.Driver #com.mysql.cj.jdbc.Driver com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.2.18:3306/nmcweather?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root
password: Skyinno251,
# driverClassName: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@192.168.2.18:1521/orcl
# username: maximo
@ -33,10 +33,10 @@ spring:
# url: jdbc:oracle:thin:@192.168.1.13:1521/ORCLCDB
# username: c##maximo
# password: maximo
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=weather;encrypt=false;
username: sa
password: Skyinno251,
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=weather;encrypt=false;
# username: sa
# password: Skyinno251,
# 配置 DBMS 类型
#database: sql_server
#url: jdbc:mysql://192.168.1.71:2881/hefengweather?useUnicode=true&characterEncoding=utf-8&useSSL=false
@ -66,7 +66,7 @@ spring:
# password: maximo
jpa:
# 配置 DBMS 类型
database: sql_server
database: mysql
# 配置是否将执行的 SQL 输出到日志
show-sql: false
open-in-view: true

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

Binary file not shown.

@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

316
storm_zj_hz/mvnw vendored

@ -0,0 +1,316 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /usr/local/etc/mavenrc ] ; then
. /usr/local/etc/mavenrc
fi
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="`\\unset -f command; \\command -v 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/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.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" || rm -f "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$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 \
$MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

188
storm_zj_hz/mvnw.cmd vendored

@ -0,0 +1,188 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\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/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
FOR /F "usebackq 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%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.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 "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\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%
cmd /C exit /B %ERROR_CODE%

@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.rehome</groupId>
<artifactId>storm_zj_hz</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>
<name>storm_zj_hz</name>
<description>storm_zj_hz</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.0</version>
</dependency>
<!--mysql驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.26</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<optional>true</optional>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
</dependency>
<!-- 引入poi解析excel -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.14</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.14</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>19.0.0</version>
</dependency>
<dependency>
<groupId>com.liuhuiyu</groupId>
<artifactId>util</artifactId>
<version>2022.1.0</version>
</dependency>
<dependency>
<groupId>com.liuhuiyu</groupId>
<artifactId>spring-util</artifactId>
<version>2021.1.0</version>
</dependency>
<dependency>
<groupId>com.liuhuiyu</groupId>
<artifactId>web</artifactId>
<version>2022.1.0</version>
</dependency>
<dependency>
<groupId>com.liuhuiyu</groupId>
<artifactId>jpa</artifactId>
<version>2021.1.0</version>
</dependency>
<dependency>
<groupId>com.liuhuiyu</groupId>
<artifactId>okhttp3util</artifactId>
<version>2021.2.2</version>
</dependency>
<dependency>
<groupId>com.liuhuiyu</groupId>
<artifactId>test</artifactId>
<version>2021.1.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.1.0</version>
<!-- <artifactId>ojdbc8</artifactId>-->
<!-- <version>19.3.0.0.0</version>-->
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.20</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>
<!--sqlserver驱动 -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>11.2.0.jre8</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.dameng</groupId>-->
<!-- <artifactId>DmJdbcDriver18</artifactId>-->
<!-- <version>8.1.2.141</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.dameng</groupId>-->
<!-- <artifactId>DmDialect-for-hibernate5.3</artifactId>-->
<!-- <version>8.1.2.141</version>-->
<!-- </dependency>-->
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<localRepository>C:\Users\Administrator\.m2\repository</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<!-- servers
| This is a list of authentication profiles, keyed by the server-id used within the system.
| Authentication profiles can be used whenever maven must make a connection to a remote server.
|-->
<servers>
<server>
<id>pds-repo</id>
<username>admin</username>
<password>admin1234</password>
</server>
</servers>
<!-- mirrors
| This is a list of mirrors to be used in downloading artifacts from remote repositories.
|
| It works like this: a POM may declare a repository to use in resolving certain artifacts.
| However, this repository may have problems with heavy traffic at times, so people have mirrored
| it to several places.
|
| That repository definition will have a unique id, so we can create a mirror reference for that
| repository, to be used as an alternate download site. The mirror site will be the preferred
| server for that repository.
|-->
<mirrors>
<mirror>
<id>pds-repo</id>
<name>pds-repo</name>
<url>http://192.168.1.28:8081/nexus/content/groups/public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<!-- profiles
| This is a list of profiles which can be activated in a variety of ways, and which can modify
| the build process. Profiles provided in the settings.xml are intended to provide local machine-
| specific paths and repository locations which allow the build to work in the local environment.
|
| For example, if you have an integration testing plugin - like cactus - that needs to know where
| your Tomcat instance is installed, you can provide a variable here such that the variable is
| dereferenced during the build process to configure the cactus plugin.
|
| As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
| section of this document (settings.xml) - will be discussed later. Another way essentially
| relies on the detection of a system property, either matching a particular value for the property,
| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
| value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
| Finally, the list of active profiles can be specified directly from the command line.
|
| NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
| repositories, plugin repositories, and free-form properties to be used as configuration
| variables for plugins in the POM.
|
|-->
<profiles>
<profile>
<id>dev</id>
<repositories>
<repository>
<id>pds-repo</id>
<url>http://192.168.1.28:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>
</settings>

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<localRepository>C:\Users\Administrator\.m2\repository</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<!-- servers
| This is a list of authentication profiles, keyed by the server-id used within the system.
| Authentication profiles can be used whenever maven must make a connection to a remote server.
|-->
<servers>
<server>
<id>pds-repo</id>
<username>admin</username>
<password>admin1234</password>
</server>
</servers>
<!-- mirrors
| This is a list of mirrors to be used in downloading artifacts from remote repositories.
|
| It works like this: a POM may declare a repository to use in resolving certain artifacts.
| However, this repository may have problems with heavy traffic at times, so people have mirrored
| it to several places.
|
| That repository definition will have a unique id, so we can create a mirror reference for that
| repository, to be used as an alternate download site. The mirror site will be the preferred
| server for that repository.
|-->
<mirrors>
<mirror>
<id>pds-repo</id>
<name>pds-repo</name>
<url>http://192.168.1.28:8081/repository/maven-public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<!-- profiles
| This is a list of profiles which can be activated in a variety of ways, and which can modify
| the build process. Profiles provided in the settings.xml are intended to provide local machine-
| specific paths and repository locations which allow the build to work in the local environment.
|
| For example, if you have an integration testing plugin - like cactus - that needs to know where
| your Tomcat instance is installed, you can provide a variable here such that the variable is
| dereferenced during the build process to configure the cactus plugin.
|
| As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
| section of this document (settings.xml) - will be discussed later. Another way essentially
| relies on the detection of a system property, either matching a particular value for the property,
| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
| value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
| Finally, the list of active profiles can be specified directly from the command line.
|
| NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
| repositories, plugin repositories, and free-form properties to be used as configuration
| variables for plugins in the POM.
|
|-->
<profiles>
<profile>
<id>dev</id>
<repositories>
<repository>
<id>pds-repo</id>
<url>http://192.168.1.28:8081/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>
</settings>

@ -0,0 +1,33 @@
package com.rehome.jpahefengweather;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableJpaAuditing
@EnableScheduling
@SpringBootApplication
public class JpahefengweatherApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(JpahefengweatherApplication.class, args);
}
/**
* @date 2022-03-14 15:20
* @description: springbootwar springboot
* @Param: SpringApplicationBuilder
*/
@Override
protected SpringApplicationBuilder configure(
SpringApplicationBuilder builder) {
return builder.sources(JpahefengweatherApplication.class);
}
}

@ -0,0 +1,71 @@
package com.rehome.jpahefengweather.controller;
import com.liuhuiyu.util.model.Result;
import com.rehome.jpahefengweather.dto.TyphoonBaseDto;
import com.rehome.jpahefengweather.dto.TyphoonTfidDto;
import com.rehome.jpahefengweather.dto.WztfStormInfoDto;
import com.rehome.jpahefengweather.entity.*;
import com.rehome.jpahefengweather.service.WztfStormService;
import com.rehome.jpahefengweather.service.ZjsltStormService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/typhoon")
public class TyphoonController {
@Resource
private ZjsltStormService zjsltStormService;
@Resource
private WztfStormService wztfStormService;
//region 根据年份获取台风列表
@PostMapping("/getStormListByYear")
@ApiOperation(value = "获取台风列表", notes = "获取台风列表")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "dto", value = "获取台风列表", dataTypeClass = TyphoonBaseDto.class, paramType = "body", required = true),
})
public Result<List<ZjsltStorm>> getStormListByYear(@Validated @RequestBody TyphoonBaseDto dto){
return Result.of(this.zjsltStormService.findByYear(dto.getYear()));
}
//endregion
//region 根据台风id获取单条台风数据
@PostMapping("/getTyphoonInfoByTfid")
@ApiOperation(value = "根据台风id获取单条台风数据", notes = "根据台风id获取单条台风数据")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "dto", value = "根据台风id获取单条台风数据", dataTypeClass = TyphoonTfidDto.class, paramType = "body", required = true),
})
public Result<TyphoonInfo> getTyphoonInfoByTfid(@Validated @RequestBody TyphoonTfidDto dto){
return Result.of(this.zjsltStormService.findTyphoonInfoByTfid(dto.getTfid()));
}
//endregion
//region 根据年份获取台风列表
@PostMapping("/getWztfStormListByYear")
@ApiOperation(value = "获取台风列表", notes = "获取台风列表")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "dto", value = "获取台风列表", dataTypeClass = TyphoonBaseDto.class, paramType = "body", required = true),
})
public Result<List<WztfStorm>> getWztfStormListByYear(@Validated @RequestBody TyphoonBaseDto dto){
return Result.of(this.wztfStormService.findByYear(dto.getYear()));
}
//endregion
//region 根据台风id获取单条台风数据
@PostMapping("/getWztfStormInfoByTfbh")
@ApiOperation(value = "根据台风id获取单条台风数据", notes = "根据台风id获取单条台风数据")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "dto", value = "根据台风id获取单条台风数据", dataTypeClass = WztfStormInfoDto.class, paramType = "body", required = true),
})
public Result<WztfStormInfo> getWztfStormInfoByTfbh(@Validated @RequestBody WztfStormInfoDto dto){
return Result.of(this.wztfStormService.findWztfStormInfoByTfbh(dto.getTfbh()));
}
//endregion
}

@ -0,0 +1,129 @@
package com.rehome.jpahefengweather.dao;
import com.liuhuiyu.jpa.BaseView;
import com.liuhuiyu.jpa.DaoOperator;
import com.rehome.jpahefengweather.utils.DaoUtil;
import com.rehome.jpahefengweather.utils.IPaging;
import org.springframework.data.domain.PageImpl;
import javax.sql.DataSource;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuHuiYu
* @version v1.0.0.0
* Created DateTime 2022-02-21 16:16
*/
public abstract class BaseDataCenterView extends BaseView {
public BaseDataCenterView(DataSource dataSource) {
super(dataSource);
}
/**
*
*
* @param t
* @param sql
* @param fullWhere
* @param <T>
* @return java.lang.Long
* @author LiuHuiYu
* Created DateTime 2022-02-21 16:24
*/
protected <T> Long count(T t, String sql, String baseWhere, FullWhere<T> fullWhere) {
StringBuilder sqlBuilder = new StringBuilder(sql);
sqlBuilder.append(baseWhere);
Map<String, Object> parameterMap = new HashMap<>(0);
fullWhere.fullWhere(t, sqlBuilder, parameterMap);
DaoUtil.countOracleSql(sqlBuilder);
return super.selectCount(sqlBuilder.toString(), parameterMap);
}
/**
*
* @author LiuHuiYu
* Created DateTime 2022-04-25 10:29
* @param b
* @param t
* @param sql
* @param baseWhere
* @param order
* @param fullWhere
* @param <R>
* @param <T>
* @return java.util.List<R>
*/
protected <T extends IPaging, R> List<R> pageList(DaoOperator<R> b, T t, String sql, String baseWhere, String order, FullWhere<T> fullWhere) {
StringBuilder sqlBuilder = new StringBuilder(sql);
sqlBuilder.append(baseWhere);
Map<String, Object> parameterMap = new HashMap<>(0);
fullWhere.fullWhere(t, sqlBuilder, parameterMap);
sqlBuilder.append(" ").append(order);
DaoUtil.paginationOracleSql(sqlBuilder, t.getPaging());
return super.getResultList(b, sqlBuilder.toString(), parameterMap);
}
protected <T extends IPaging, R> PageImpl<R> page(DaoOperator<R> b, T t, String sql, FullWhere<T> fullWhere, String order) {
return page(b, t, sql, " WHERE(1=1) ", order, fullWhere);
}
/**
*
* @author LiuHuiYu
* Created DateTime 2022-04-25 10:29
* @param b
* @param t
* @param sql
* @param baseWhere
* @param order
* @param fullWhere
* @param <R>
* @param <T>
* @return java.util.List<R>
*/
protected <T extends IPaging, R> List<R> list(DaoOperator<R> b, T t, String sql, String baseWhere, String order, FullWhere<T> fullWhere) {
StringBuilder sqlBuilder = new StringBuilder(sql);
sqlBuilder.append(baseWhere);
Map<String, Object> parameterMap = new HashMap<>(0);
fullWhere.fullWhere(t, sqlBuilder, parameterMap);
sqlBuilder.append(" ").append(order);
return super.getResultList(b, sqlBuilder.toString(), parameterMap);
}
/**
*
*
* @param b
* @param t
* @param sql
* @param baseWhere where
* @param order ( order by)
* @param fullWhere void fullWhere(T find, StringBuilder sqlBuilder, Map<String, Object> parameterMap)
* @param <R>
* @param <T>
* @return org.springframework.data.domain.PageImpl<R>
* @author LiuHuiYu
* Created DateTime 2022-04-09 11:41
*/
protected <T extends IPaging, R> PageImpl<R> page(DaoOperator<R> b, T t, String sql, String baseWhere, String order, FullWhere<T> fullWhere) {
Long total = this.count(t, sql, baseWhere, fullWhere);
final List<R> gatekeeperCarLogDtoList;
if (total == 0) {
gatekeeperCarLogDtoList = Collections.emptyList();
}
else if (t.getPaging().isAllInOne()) {
gatekeeperCarLogDtoList = this.list(b, t, sql, baseWhere, order, fullWhere);
}
else if (t.getPaging().getPageSize() == 0) {
gatekeeperCarLogDtoList = Collections.emptyList();
}
else {
//记录查询
gatekeeperCarLogDtoList = pageList(b, t, sql, baseWhere, order, fullWhere);
}
return new PageImpl<>(gatekeeperCarLogDtoList, t.getPaging().getPageRequest(), total);
}
}

@ -0,0 +1,22 @@
package com.rehome.jpahefengweather.dao;
import java.util.Map;
/**
* @author LiuHuiYu
* @version v1.0.0.0
* Created DateTime 2022-02-21 16:17
*/
@FunctionalInterface
public interface FullWhere<T> {
/**
*
*
* @param find
* @param sqlBuilder sql
* @param parameterMap
* @author LiuHuiYu
* Created DateTime 2022-02-21 16:19
*/
void fullWhere(T find, StringBuilder sqlBuilder, Map<String, Object> parameterMap);
}

@ -0,0 +1,17 @@
package com.rehome.jpahefengweather.dao;
import com.rehome.jpahefengweather.entity.TyphoonInfo;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* T :
* ID :OID
*
*/
public interface TyphoonInfoRepository extends JpaRepository<TyphoonInfo,String> {
//方法名称必须要遵循驼峰式命名规则findBy关键字+属性名称(首字母大写)+查询条件(首字母大写)
TyphoonInfo findByTfid(String tfid);
}

@ -0,0 +1,18 @@
package com.rehome.jpahefengweather.dao;
import com.rehome.jpahefengweather.entity.WztfStorm;
import com.rehome.jpahefengweather.entity.WztfStormInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* T :
* ID :OID
*
*/
public interface WztfStormInfoRepository extends JpaRepository<WztfStormInfo,String> {
//方法名称必须要遵循驼峰式命名规则findBy关键字+属性名称(首字母大写)+查询条件(首字母大写)
WztfStormInfo findByTfbh(String tfbh);
}

@ -0,0 +1,20 @@
package com.rehome.jpahefengweather.dao;
import com.rehome.jpahefengweather.entity.WztfStorm;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* T :
* ID :OID
*
*/
public interface WztfStormRepository extends JpaRepository<WztfStorm,String> {
//方法名称必须要遵循驼峰式命名规则findBy关键字+属性名称(首字母大写)+查询条件(首字母大写)
WztfStorm findByTfbh(String tfbh);
List<WztfStorm> findByYear(String year);
}

@ -0,0 +1,23 @@
package com.rehome.jpahefengweather.dao;
import com.rehome.jpahefengweather.entity.ZjsltStorm;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* T :
* ID :OID
*
*/
public interface ZjsltStormRepository extends JpaRepository<ZjsltStorm,String> {
//方法名称必须要遵循驼峰式命名规则findBy关键字+属性名称(首字母大写)+查询条件(首字母大写)
ZjsltStorm findByTfid(String tfid);
List<ZjsltStorm> findByYear(String year);
}

@ -0,0 +1,59 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "BaseDto", description = "接收数据")
public class BaseDto {
@ApiModelProperty("API状态码具体含义请参考状态码 200请求成功")
private String code;
@ApiModelProperty("当前API的最近更新时间")
private String updateTime;
@ApiModelProperty("当前数据的响应式页面,便于嵌入网站或应用")
private String fxLink;
/**
* map MaintenanceTemporaryFindDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.BaseDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static BaseDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, BaseDto.class);
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public String getFxLink() {
return fxLink;
}
public void setFxLink(String fxLink) {
this.fxLink = fxLink;
}
}

@ -0,0 +1,37 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "BaseFindDto", description = "接收数据")
public class BaseFindDto{
@ApiModelProperty("位置id,从城市列表获取")
private String locationId;
/**
* map MaintenanceTemporaryFindDto
*
* @param map map
* @return cc.rehome.zhanjiang.data_center_model.domain.security.authorize.maintenance_temporary.in.MaintenanceTemporaryFindDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static BaseFindDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, BaseFindDto.class);
}
public String getLocationId() {
return locationId;
}
public void setLocationId(String locationId) {
this.locationId = locationId;
}
}

@ -0,0 +1,38 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "BaseWeatherFindDto", description = "接收数据")
public class BaseWeatherFindDto extends BaseFindDto{
@ApiModelProperty("查询天气的日期")
private String weatherDate;
/**
* map MaintenanceTemporaryFindDto
*
* @param map map
* @return cc.rehome.zhanjiang.data_center_model.domain.security.authorize.maintenance_temporary.in.MaintenanceTemporaryFindDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static BaseWeatherFindDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, BaseWeatherFindDto.class);
}
public String getWeatherDate() {
return weatherDate;
}
public void setWeatherDate(String weatherDate) {
this.weatherDate = weatherDate;
}
}

@ -0,0 +1,301 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "ForecastDto", description = "实时天气数据")
public class ForecastDto {
@ApiModelProperty("预报日期")
private String fxDate;
@ApiModelProperty("日出时间")
private String sunrise;
@ApiModelProperty("日落时间")
private String sunset;
@ApiModelProperty("月升时间")
private String moonrise;
@ApiModelProperty("月落时间")
private String moonset;
@ApiModelProperty("月相名称")
private String moonPhase;
@ApiModelProperty("月相图标代码,图标可通过天气状况和图标下载")
private String moonPhaseIcon;
@ApiModelProperty("预报当天最高温度")
private String tempMax;
@ApiModelProperty("预报当天最低温度")
private String tempMin;
@ApiModelProperty("预报白天天气状况的图标代码,图标可通过天气状况和图标下载")
private String iconDay;
@ApiModelProperty("预报白天天气状况文字描述,包括阴晴雨雪等天气状态的描述")
private String textDay;
@ApiModelProperty("预报夜间天气状况的图标代码,图标可通过天气状况和图标下载")
private String iconNight;
@ApiModelProperty("预报晚间天气状况文字描述,包括阴晴雨雪等天气状态的描述")
private String textNight;
@ApiModelProperty("预报白天风向360角度")
private String wind360Day;
@ApiModelProperty("预报白天风向")
private String windDirDay;
@ApiModelProperty("预报白天风力等级")
private String windScaleDay;
@ApiModelProperty("预报白天风速,公里/小时")
private String windSpeedDay;
@ApiModelProperty("预报夜间风向360角度")
private String wind360Night;
@ApiModelProperty("预报夜间当天风向")
private String windDirNight;
@ApiModelProperty("预报夜间风力等级")
private String windScaleNight;
@ApiModelProperty("预报夜间风速,公里/小时")
private String windSpeedNight;
@ApiModelProperty("预报当天总降水量,默认单位:毫米")
private String precip;
@ApiModelProperty("紫外线强度指数")
private String uvIndex;
@ApiModelProperty("相对湿度,百分比数值")
private String humidity;
@ApiModelProperty("大气压强,默认单位:百帕")
private String pressure;
@ApiModelProperty("能见度,默认单位:公里")
private String vis;
@ApiModelProperty("云量,百分比数值。可能为空")
private String cloud;
/**
* map MaintenanceTemporaryFindDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.BaseDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static ForecastDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, ForecastDto.class);
}
public String getFxDate() {
return fxDate;
}
public void setFxDate(String fxDate) {
this.fxDate = fxDate;
}
public String getSunrise() {
return sunrise;
}
public void setSunrise(String sunrise) {
this.sunrise = sunrise;
}
public String getSunset() {
return sunset;
}
public void setSunset(String sunset) {
this.sunset = sunset;
}
public String getMoonrise() {
return moonrise;
}
public void setMoonrise(String moonrise) {
this.moonrise = moonrise;
}
public String getMoonset() {
return moonset;
}
public void setMoonset(String moonset) {
this.moonset = moonset;
}
public String getMoonPhase() {
return moonPhase;
}
public void setMoonPhase(String moonPhase) {
this.moonPhase = moonPhase;
}
public String getMoonPhaseIcon() {
return moonPhaseIcon;
}
public void setMoonPhaseIcon(String moonPhaseIcon) {
this.moonPhaseIcon = moonPhaseIcon;
}
public String getTempMax() {
return tempMax;
}
public void setTempMax(String tempMax) {
this.tempMax = tempMax;
}
public String getTempMin() {
return tempMin;
}
public void setTempMin(String tempMin) {
this.tempMin = tempMin;
}
public String getIconDay() {
return iconDay;
}
public void setIconDay(String iconDay) {
this.iconDay = iconDay;
}
public String getTextDay() {
return textDay;
}
public void setTextDay(String textDay) {
this.textDay = textDay;
}
public String getIconNight() {
return iconNight;
}
public void setIconNight(String iconNight) {
this.iconNight = iconNight;
}
public String getTextNight() {
return textNight;
}
public void setTextNight(String textNight) {
this.textNight = textNight;
}
public String getWind360Day() {
return wind360Day;
}
public void setWind360Day(String wind360Day) {
this.wind360Day = wind360Day;
}
public String getWindDirDay() {
return windDirDay;
}
public void setWindDirDay(String windDirDay) {
this.windDirDay = windDirDay;
}
public String getWindScaleDay() {
return windScaleDay;
}
public void setWindScaleDay(String windScaleDay) {
this.windScaleDay = windScaleDay;
}
public String getWindSpeedDay() {
return windSpeedDay;
}
public void setWindSpeedDay(String windSpeedDay) {
this.windSpeedDay = windSpeedDay;
}
public String getWind360Night() {
return wind360Night;
}
public void setWind360Night(String wind360Night) {
this.wind360Night = wind360Night;
}
public String getWindDirNight() {
return windDirNight;
}
public void setWindDirNight(String windDirNight) {
this.windDirNight = windDirNight;
}
public String getWindScaleNight() {
return windScaleNight;
}
public void setWindScaleNight(String windScaleNight) {
this.windScaleNight = windScaleNight;
}
public String getWindSpeedNight() {
return windSpeedNight;
}
public void setWindSpeedNight(String windSpeedNight) {
this.windSpeedNight = windSpeedNight;
}
public String getPrecip() {
return precip;
}
public void setPrecip(String precip) {
this.precip = precip;
}
public String getUvIndex() {
return uvIndex;
}
public void setUvIndex(String uvIndex) {
this.uvIndex = uvIndex;
}
public String getHumidity() {
return humidity;
}
public void setHumidity(String humidity) {
this.humidity = humidity;
}
public String getPressure() {
return pressure;
}
public void setPressure(String pressure) {
this.pressure = pressure;
}
public String getVis() {
return vis;
}
public void setVis(String vis) {
this.vis = vis;
}
public String getCloud() {
return cloud;
}
public void setCloud(String cloud) {
this.cloud = cloud;
}
}

@ -0,0 +1,40 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "ForecastWeatherDto", description = "接收数据")
public class ForecastWeatherDto extends BaseDto{
@ApiModelProperty("天气预报数据")
private List<ForecastDto> daily;
/**
* map MaintenanceTemporaryFindDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.BaseDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static ForecastWeatherDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, ForecastWeatherDto.class);
}
public List<ForecastDto> getDaily() {
return daily;
}
public void setDaily(List<ForecastDto> daily) {
this.daily = daily;
}
}

@ -0,0 +1,48 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "NmcBaseDto", description = "接收数据")
public class NmcBaseDto {
@ApiModelProperty("API状态码具体含义请参考状态码 0请求成功")
private int code;
@ApiModelProperty("当前API的最近更新时间")
private String msg;
/**
* map NmcBaseDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.NmcBaseDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static NmcBaseDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, NmcBaseDto.class);
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}

@ -0,0 +1,38 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "NmcForecastWeatherDto", description = "接收数据")
public class NmcForecastWeatherDto extends NmcBaseDto{
@ApiModelProperty("实时天气数据")
private List<List<String>> data;
/**
* map NmcNowWeatherDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.NmcNowWeatherDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static NmcForecastWeatherDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, NmcForecastWeatherDto.class);
}
public List<List<String>> getData() {
return data;
}
public void setData(List<List<String>> data) {
this.data = data;
}
}

@ -0,0 +1,39 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import com.rehome.jpahefengweather.dto.bean.NmcNowData;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "NmcNowWeatherDto", description = "接收数据")
public class NmcNowWeatherDto extends NmcBaseDto{
@ApiModelProperty("实时天气数据")
private NmcNowData data;
/**
* map NmcNowWeatherDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.NmcNowWeatherDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static NmcNowWeatherDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, NmcNowWeatherDto.class);
}
public NmcNowData getData() {
return data;
}
public void setData(NmcNowData data) {
this.data = data;
}
}

@ -0,0 +1,179 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "NowDto", description = "实时天气数据")
public class NowDto {
@ApiModelProperty("数据观测时间")
private String obsTime;
@ApiModelProperty("温度,默认单位:摄氏度")
private String temp;
@ApiModelProperty("体感温度,默认单位:摄氏度")
private String feelsLike;
@ApiModelProperty("天气状况和图标的代码,图标可通过天气状况和图标下载")
private String icon;
@ApiModelProperty("天气状况的文字描述,包括阴晴雨雪等天气状态的描述")
private String text;
@ApiModelProperty("风向360角度")
private String wind360;
@ApiModelProperty("风向")
private String windDir;
@ApiModelProperty("风力等级")
private String windScale;
@ApiModelProperty("风速,公里/小时")
private String windSpeed;
@ApiModelProperty("相对湿度,百分比数值")
private String humidity;
@ApiModelProperty("当前小时累计降水量,默认单位:毫米")
private String precip;
@ApiModelProperty("大气压强,默认单位:百帕")
private String pressure;
@ApiModelProperty("能见度,默认单位:公里")
private String vis;
@ApiModelProperty("云量,百分比数值。可能为空")
private String cloud;
@ApiModelProperty("露点温度。可能为空")
private String dew;
/**
* map MaintenanceTemporaryFindDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.BaseDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static NowDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, NowDto.class);
}
public String getObsTime() {
return obsTime;
}
public void setObsTime(String obsTime) {
this.obsTime = obsTime;
}
public String getTemp() {
return temp;
}
public void setTemp(String temp) {
this.temp = temp;
}
public String getFeelsLike() {
return feelsLike;
}
public void setFeelsLike(String feelsLike) {
this.feelsLike = feelsLike;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public String getWind360() {
return wind360;
}
public void setWind360(String wind360) {
this.wind360 = wind360;
}
public String getWindDir() {
return windDir;
}
public void setWindDir(String windDir) {
this.windDir = windDir;
}
public String getWindScale() {
return windScale;
}
public void setWindScale(String windScale) {
this.windScale = windScale;
}
public String getWindSpeed() {
return windSpeed;
}
public void setWindSpeed(String windSpeed) {
this.windSpeed = windSpeed;
}
public String getHumidity() {
return humidity;
}
public void setHumidity(String humidity) {
this.humidity = humidity;
}
public String getPrecip() {
return precip;
}
public void setPrecip(String precip) {
this.precip = precip;
}
public String getPressure() {
return pressure;
}
public void setPressure(String pressure) {
this.pressure = pressure;
}
public String getVis() {
return vis;
}
public void setVis(String vis) {
this.vis = vis;
}
public String getCloud() {
return cloud;
}
public void setCloud(String cloud) {
this.cloud = cloud;
}
public String getDew() {
return dew;
}
public void setDew(String dew) {
this.dew = dew;
}
}

@ -0,0 +1,38 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "NowWeatherDto", description = "接收数据")
public class NowWeatherDto extends BaseDto{
@ApiModelProperty("实时天气数据")
private NowDto now;
/**
* map MaintenanceTemporaryFindDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.BaseDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static NowWeatherDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, NowWeatherDto.class);
}
public NowDto getNow() {
return now;
}
public void setNow(NowDto now) {
this.now = now;
}
}

@ -0,0 +1,41 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "StormDataDto", description = "接收数据")
@Data
public class StormDataDto extends BaseDto{
@ApiModelProperty("获取台风列表数据")
List<List<String>> typhoonList;
/**
* map MaintenanceTemporaryFindDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.BaseDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static StormDataDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, StormDataDto.class);
}
public List<List<String>> getTyphoonList() {
return typhoonList;
}
public void setTyphoonList(List<List<String>> typhoonList) {
this.typhoonList = typhoonList;
}
}

@ -0,0 +1,190 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-08-23 11:13
*/
@ApiModel(value = "TyhoonActivityDto", description = "实时活跃台风")
public class TyhoonActivityDto {
@ApiModelProperty("台风英文名")
private String enname;
@ApiModelProperty("纬度")
private String lat;
@ApiModelProperty("经度")
private String lng;
@ApiModelProperty("台风移动方向")
private String movedirection;
@ApiModelProperty("台风移动速速")
private String movespeed;
@ApiModelProperty("台风中文名")
private String name;
@ApiModelProperty("台风风力等级")
private String power;
@ApiModelProperty("中心气压,大气压强,默认单位:百帕")
private String pressure;
@ApiModelProperty("七级风速圈半径")
private String radius7;
@ApiModelProperty("十级风速圈半径")
private String radius10;
@ApiModelProperty("十二级风速圈半径")
private String radius12;
@ApiModelProperty("台风风速")
private String speed;
@ApiModelProperty("台风等级名称")
private String strong;
@ApiModelProperty("台风id")
private String tfid;
@ApiModelProperty("发布时间")
private String time;
@ApiModelProperty("发布时间格式化")
private String timeformate;
/**
* map TyhoonActivityDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.TyhoonActivityDto
* @author HuangWenFei
* Created DateTime 2022-08-23 11:13
*/
public static TyhoonActivityDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, TyhoonActivityDto.class);
}
public String getEnname() {
return enname;
}
public void setEnname(String enname) {
this.enname = enname;
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat;
}
public String getLng() {
return lng;
}
public void setLng(String lng) {
this.lng = lng;
}
public String getMovedirection() {
return movedirection;
}
public void setMovedirection(String movedirection) {
this.movedirection = movedirection;
}
public String getMovespeed() {
return movespeed;
}
public void setMovespeed(String movespeed) {
this.movespeed = movespeed;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPower() {
return power;
}
public void setPower(String power) {
this.power = power;
}
public String getPressure() {
return pressure;
}
public void setPressure(String pressure) {
this.pressure = pressure;
}
public String getRadius7() {
return radius7;
}
public void setRadius7(String radius7) {
this.radius7 = radius7;
}
public String getRadius10() {
return radius10;
}
public void setRadius10(String radius10) {
this.radius10 = radius10;
}
public String getRadius12() {
return radius12;
}
public void setRadius12(String radius12) {
this.radius12 = radius12;
}
public String getSpeed() {
return speed;
}
public void setSpeed(String speed) {
this.speed = speed;
}
public String getStrong() {
return strong;
}
public void setStrong(String strong) {
this.strong = strong;
}
public String getTfid() {
return tfid;
}
public void setTfid(String tfid) {
this.tfid = tfid;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getTimeformate() {
return timeformate;
}
public void setTimeformate(String timeformate) {
this.timeformate = timeformate;
}
}

@ -0,0 +1,40 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "TyphoonBaseDto", description = "实时天气数据")
public class TyphoonBaseDto {
@ApiModelProperty("数据观测时间")
private String year;
/**
* map MaintenanceTemporaryFindDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.BaseDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static TyphoonBaseDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, TyphoonBaseDto.class);
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
}

@ -0,0 +1,40 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "TyphoonTfidDto", description = "实时天气数据")
public class TyphoonTfidDto {
@ApiModelProperty("数据观测时间")
private String tfid;
/**
* map MaintenanceTemporaryFindDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.BaseDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static TyphoonTfidDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, TyphoonTfidDto.class);
}
public String getTfid() {
return tfid;
}
public void setTfid(String tfid) {
this.tfid = tfid;
}
}

@ -0,0 +1,40 @@
package com.rehome.jpahefengweather.dto;
import com.liuhuiyu.util.map.MapUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
/**
* @author HuangWenFei
* @version v1.0.0.0
* Created DateTime 2022-05-01 16:22
*/
@ApiModel(value = "WztfStormInfoDto", description = "实时天气数据")
public class WztfStormInfoDto {
@ApiModelProperty("数据观测时间")
private String tfbh;
/**
* map MaintenanceTemporaryFindDto
*
* @param map map
* @return com.rehome.jpahefengweather.dto.BaseDto
* @author HuangWenFei
* Created DateTime 2022-04-19 10:02
*/
public static WztfStormInfoDto ofSelfMap(Map<String, Object> map) {
return MapUtil.fromMap(map, WztfStormInfoDto.class);
}
public String getTfbh() {
return tfbh;
}
public void setTfbh(String tfbh) {
this.tfbh = tfbh;
}
}

@ -0,0 +1,12 @@
package com.rehome.jpahefengweather.dto.bean;
import lombok.Data;
@Data
public class Air {
private String forecasttime;
private int aqi;
private int aq;
private String text;
private String aqiCode;
}

@ -0,0 +1,4 @@
package com.rehome.jpahefengweather.dto.bean;
public class NmcForecastData {
}

@ -0,0 +1,16 @@
package com.rehome.jpahefengweather.dto.bean;
import com.rehome.jpahefengweather.dto.NmcBaseDto;
import lombok.Data;
import java.util.List;
@Data
public class NmcNowData {
//实时天气
Real real;
//空气
Air air;
//温度变化图表曲线图数据
List<Tempchart> tempchart;
}

@ -0,0 +1,12 @@
package com.rehome.jpahefengweather.dto.bean;
import lombok.Data;
@Data
public class Real {
private String publish_time;
private Station station;
private Weather weather;
private Wind wind;
private Warn warn;
}

@ -0,0 +1,11 @@
package com.rehome.jpahefengweather.dto.bean;
import lombok.Data;
@Data
public class Station {
private String code;
private String province;
private String city;
private String url;
}

@ -0,0 +1,14 @@
package com.rehome.jpahefengweather.dto.bean;
import lombok.Data;
@Data
public class Tempchart {
private String time;
private int max_temp;
private int min_temp;
private String day_img;
private String day_text;
private String night_img;
private String night_text;
}

@ -0,0 +1,17 @@
package com.rehome.jpahefengweather.dto.bean;
import lombok.Data;
@Data
public class Warn {
private String alert;
private String pic;
private String province;
private String city;
private String url;
private String issuecontent;
private String fmeans;
private String signaltype;
private String signallevel;
private String pic2;
}

@ -0,0 +1,17 @@
package com.rehome.jpahefengweather.dto.bean;
import lombok.Data;
@Data
public class Weather {
private double temperature;
private double temperatureDiff;
private int airpressure;
private int humidity;
private int rain;
private int rcomfort;
private int icomfort;
private String info;
private String img;
private double feelst;
}

@ -0,0 +1,11 @@
package com.rehome.jpahefengweather.dto.bean;
import lombok.Data;
@Data
public class Wind {
private String direct;
private int degree;
private String power;
private double speed;
}

@ -0,0 +1,31 @@
package com.rehome.jpahefengweather.entity;
import lombok.Data;
import org.hibernate.annotations.Proxy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@EntityListeners(AuditingEntityListener.class)
@Proxy(lazy = false)
@Data
@Entity
public class TyphoonInfo implements Serializable {
@Id
private String tfid;
//存放长文本
@Lob
@Basic(fetch=FetchType.LAZY)
private String stormData;
@Temporal(TemporalType.TIMESTAMP)
private Date createDate;
@Temporal(TemporalType.TIMESTAMP)
private Date lastUpdateDate;
}

@ -0,0 +1,44 @@
package com.rehome.jpahefengweather.entity;
import lombok.Data;
import org.hibernate.annotations.Proxy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@EntityListeners(AuditingEntityListener.class)
@Proxy(lazy = false)
@Data
@Entity
public class WztfStorm implements Serializable {
@Id
private String tfbh;
//台风中文名称
private String name ;
//台风英文名称
private String ename;
//台风结束时间
private String end_time ;
//台风开始时间
private String begin_time ;
//台风标识
private String ident;
//是否为活跃台风 1:活跃台风 0:台风已停止
private int is_current ;
//台风所处年份
private String year ;
@Temporal(TemporalType.TIMESTAMP)
private Date createDate;
}

@ -0,0 +1,31 @@
package com.rehome.jpahefengweather.entity;
import lombok.Data;
import org.hibernate.annotations.Proxy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@EntityListeners(AuditingEntityListener.class)
@Proxy(lazy = false)
@Data
@Entity
public class WztfStormInfo implements Serializable {
@Id
private String tfbh;
//存放长文本
@Lob
@Basic(fetch=FetchType.LAZY)
private String stormData;
@Temporal(TemporalType.TIMESTAMP)
private Date createDate;
@Temporal(TemporalType.TIMESTAMP)
private Date lastUpdateDate;
}

@ -0,0 +1,44 @@
package com.rehome.jpahefengweather.entity;
import lombok.Data;
import org.hibernate.annotations.Proxy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@EntityListeners(AuditingEntityListener.class)
@Proxy(lazy = false)
@Data
@Entity
public class ZjsltStorm implements Serializable {
@Id
private String tfid;
//台风英文名称
private String enname;
//台风中文名称
private String name ;
//台风结束时间
private String endtime ;
//台风开始时间
private String starttime ;
//提示等级
private String warnlevel;
//是否为活跃台风 1:活跃台风 0:台风已停止
private String isactive ;
//台风所处年份
private String year ;
@Temporal(TemporalType.TIMESTAMP)
private Date createDate;
}

@ -0,0 +1,47 @@
package com.rehome.jpahefengweather.service.Impl;
import com.rehome.jpahefengweather.dao.TyphoonInfoRepository;
import com.rehome.jpahefengweather.dao.WztfStormInfoRepository;
import com.rehome.jpahefengweather.dao.WztfStormRepository;
import com.rehome.jpahefengweather.dao.ZjsltStormRepository;
import com.rehome.jpahefengweather.entity.WztfStorm;
import com.rehome.jpahefengweather.entity.WztfStormInfo;
import com.rehome.jpahefengweather.service.WztfStormService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class WztfStormServiceImpl implements WztfStormService {
@Resource
private WztfStormRepository wztfStormRepository;
@Resource
private WztfStormInfoRepository wztfStormInfoRepository;
@Override
public WztfStorm findByTfbh(String tfbh) {
return this.wztfStormRepository.findByTfbh(tfbh);
}
@Override
public List<WztfStorm> findByYear(String year) {
return this.wztfStormRepository.findByYear(year);
}
@Override
public void saveWztfStorm(WztfStorm wztfStorm) {
this.wztfStormRepository.save(wztfStorm);
}
@Override
public WztfStormInfo findWztfStormInfoByTfbh(String tfbh) {
return this.wztfStormInfoRepository.findByTfbh(tfbh);
}
@Override
public void saveWztfStormInfo(WztfStormInfo wztfStormInfo) {
this.wztfStormInfoRepository.save(wztfStormInfo);
}
}

@ -0,0 +1,45 @@
package com.rehome.jpahefengweather.service.Impl;
import com.rehome.jpahefengweather.dao.TyphoonInfoRepository;
import com.rehome.jpahefengweather.dao.ZjsltStormRepository;
import com.rehome.jpahefengweather.entity.TyphoonInfo;
import com.rehome.jpahefengweather.entity.ZjsltStorm;
import com.rehome.jpahefengweather.service.ZjsltStormService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class ZjsltStormServiceImpl implements ZjsltStormService {
@Resource
private ZjsltStormRepository zjsltStormRepository;
@Resource
private TyphoonInfoRepository typhoonInfoRepository;
@Override
public ZjsltStorm findByTfid(String tfid) {
return this.zjsltStormRepository.findByTfid(tfid);
}
@Override
public List<ZjsltStorm> findByYear(String year) {
return this.zjsltStormRepository.findByYear(year);
}
@Override
public void saveZjsltStorm(ZjsltStorm zjsltStorm) {
this.zjsltStormRepository.save(zjsltStorm);
}
@Override
public TyphoonInfo findTyphoonInfoByTfid(String tfid) {
return this.typhoonInfoRepository.findByTfid(tfid);
}
@Override
public void saveTyphoonInfo(TyphoonInfo typhoonInfo) {
this.typhoonInfoRepository.save(typhoonInfo);
}
}

@ -0,0 +1,384 @@
package com.rehome.jpahefengweather.service;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.liuhuiyu.spring_util.SpringUtil;
import com.rehome.jpahefengweather.dto.NmcBaseDto;
import com.rehome.jpahefengweather.entity.*;
import com.rehome.jpahefengweather.utils.OkHttpUtil;
import okhttp3.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Type;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
* @author huangwenfei
* @version v1.0.0.0
* Created DateTime 2021-04-26 14:35
* @description:
*/
@Component
public class ScheduledService {
@Value("${rehome.resources-path}")
private String resourcesPath;
@Resource
private ZjsltStormService zjsltStormService;
@Resource
private WztfStormService wztfStormService;
/**
* @date 2022-03-16 09:41
* @description:
* @Param: null
*/
// @Scheduled(cron = "0 48 * * * *")
// public void getZjsltHistoryStormList() {
// for(int i=1940;i<2025;i++){
// getZjsltStormList(String.valueOf(i));
// }
// }
/**
* @date 2022-03-16 09:41
* @description:
* @Param: null
*/
@Scheduled(cron = "0 2 * * * *")
public void getZjsltStormList() {
System.out.println("getZjsltStormList");
String strNow = String.valueOf(System.currentTimeMillis());
// 初始化 OkHttpClient
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.build();
try {
Thread.sleep(5000);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");
String nowDate = sdf.format(new Date());
String nowYear = sdfYear.format(new Date());
Random random = new Random();//以系统自身时间为种子数
int iRandom = random.nextInt();
Long nowLong = 13728353350362976L;
Long nowLongTemp = nowLong + iRandom;
String url = "https://typhoon.slt.zj.gov.cn/Api/TyphoonList/" + nowYear + "?callback=jQuery" + "1830" + String.valueOf(nowLongTemp) + "_" + strNow + "&_=" + String.valueOf(System.currentTimeMillis());
System.out.println(url);
// 初始化请求体
Request request = new Request.Builder()
.get()
.url(url)
.build();
// 得到返回Response
Response response = client.newCall(request).execute();
String body = response.body().string();
//System.out.println(body);
if (StringUtils.hasText(body)) {
if (body.length() > 0) {
Gson gson = new Gson();
int startIndex = body.indexOf("[");
int endIndex = body.lastIndexOf("]");
// System.out.println(body.indexOf("["));
// System.out.println(body.lastIndexOf("]"));
String stormStr = body.substring(startIndex, endIndex + 1);
//System.out.println(stormStr);
if (stormStr != null && stormStr.length() > 2) {
Type type = new TypeToken<ArrayList<ZjsltStorm>>() {
}.getType();
List<ZjsltStorm> stormList = gson.fromJson(stormStr, type);
//打印测试
for (ZjsltStorm storm : stormList) {
storm.setYear(nowYear);
storm.setCreateDate(new Date());
System.out.println(gson.toJson(storm));
ZjsltStorm stormDB = this.zjsltStormService.findByTfid(storm.getTfid());
if (stormDB == null) {
//数据库无数据,第一次插入,同时从第三方平台拉取台风路径数据入库
this.zjsltStormService.saveZjsltStorm(storm);
this.saveOrUpdateTyphoonInfo(storm);
} else {
//数据库有数据
if (stormDB.getIsactive().equals("1")) {
if (storm.getIsactive().equals("0")) {
//数据库里面台风数据是活跃状态,第三方平台台风数据已变成不活跃状态,更新数据库台风状态,同时更新台风路径
stormDB.setIsactive(storm.getIsactive());
this.zjsltStormService.saveZjsltStorm(stormDB);
this.saveOrUpdateTyphoonInfo(stormDB);
} else {
//数据库里面台风数据是活跃状态,第三方平台台风数据也是活跃状态
if ((!storm.getEndtime().equals(stormDB.getEndtime())) || (!storm.getEnname().equals(stormDB.getEnname())) || (!storm.getName().equals(stormDB.getName()))) {
//台风列表数据有变化,更新台风列表数据
stormDB.setEndtime(storm.getEndtime());
stormDB.setEnname(storm.getEnname());
stormDB.setName(storm.getName());
this.zjsltStormService.saveZjsltStorm(stormDB);
}
//更新台风路径
this.saveOrUpdateTyphoonInfo(stormDB);
}
} else {
//数据库里面台风数据是不活跃状态,无需做任何事情
//this.saveOrUpdateTyphoonInfo(storm);
}
}
}
}
}
}
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
/**
* @date 2022-03-16 09:41
* @description:
* @Param: null
*/
public void saveOrUpdateTyphoonInfo(ZjsltStorm storm) {
System.out.println("saveOrUpdateTyphoonInfo");
String strNow = String.valueOf(System.currentTimeMillis());
// 初始化 OkHttpClient
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.build();
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");
String nowDate = sdf.format(new Date());
String nowYear = sdfYear.format(new Date());
Random random = new Random();//以系统自身时间为种子数
int iRandom = random.nextInt();
Long nowLong = 25528353350362976L;
Long nowLongTemp = nowLong + iRandom;
String url = "https://typhoon.slt.zj.gov.cn/Api/TyphoonInfo/" + storm.getTfid() + "?callback=jQuery" + "1830" + String.valueOf(nowLongTemp) + "_" + strNow + "&_=" + String.valueOf(System.currentTimeMillis());
System.out.println(url);
// 初始化请求体
Request request = new Request.Builder()
.get()
.url(url)
.build();
// 得到返回Response
Response response = client.newCall(request).execute();
String body = response.body().string();
//System.out.println(body);
if (StringUtils.hasText(body)) {
if (body.length() > 0) {
Gson gson = new Gson();
int startIndex = body.indexOf("[");
int endIndex = body.lastIndexOf("]");
// System.out.println(body.indexOf("["));
// System.out.println(body.lastIndexOf("]"));
String typhoonInfoArryStr = body.substring(startIndex, endIndex + 1);
//System.out.println(typhoonInfoArryStr);
if (typhoonInfoArryStr != null && typhoonInfoArryStr.length() > 2) {
int startIndex0 = typhoonInfoArryStr.indexOf("{");
int endIndex0 = typhoonInfoArryStr.lastIndexOf("}");
// System.out.println(startIndex0);
// System.out.println(endIndex0);
String typhoonInfoStr = typhoonInfoArryStr.substring(startIndex0, endIndex0 + 1);
//System.out.println(typhoonInfoStr);
TyphoonInfo typhoonInfoDB = this.zjsltStormService.findTyphoonInfoByTfid(storm.getTfid());
TyphoonInfo typhoonInfo = new TyphoonInfo();
if (typhoonInfoDB == null) {
//数据库无数据,保存风路径数据入库
typhoonInfo.setTfid(storm.getTfid());
typhoonInfo.setStormData(typhoonInfoStr);
typhoonInfo.setCreateDate(new Date());
typhoonInfo.setLastUpdateDate(new Date());
this.zjsltStormService.saveTyphoonInfo(typhoonInfo);
} else {
//数据库有数据,更新台风路径数据
typhoonInfoDB.setStormData(typhoonInfoStr);
typhoonInfoDB.setLastUpdateDate(new Date());
this.zjsltStormService.saveTyphoonInfo(typhoonInfoDB);
}
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* @date 2022-03-16 09:41
* @description:
* @Param: null
*/
// @Scheduled(cron = "0 30 * * * *")
// public void getWztfHistoryStormList() {
// for(int i=1945;i<2025;i++){
// getWztfStormList(String.valueOf(i));
// }
// //getWztfStormList(String.valueOf(1944));
// }
/**
* @date 2022-03-16 09:41
* @description:
* @Param: null
*/
@Scheduled(cron = "0 3 * * * *")
public void getWztfStormList() {
// 初始化 OkHttpClient
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.build();
try {
Thread.sleep(3000);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");
String nowDate = sdf.format(new Date());
String nowYear = sdfYear.format(new Date());
String url = "http://data.istrongcloud.com/v2/data/complex/" + nowYear + ".json?v=" + String.valueOf(System.currentTimeMillis());
System.out.println(url);
// 初始化请求体
Request request = new Request.Builder()
.get()
.url(url)
.build();
// 得到返回Response
Response response = client.newCall(request).execute();
String body = response.body().string();
System.out.println(body);
if (StringUtils.hasText(body)) {
if (body.length() > 2) {
Gson gson = new Gson();
Type type = new TypeToken<ArrayList<WztfStorm>>() {
}.getType();
List<WztfStorm> stormList = gson.fromJson(body, type);
//打印测试
for (WztfStorm storm : stormList) {
storm.setYear(nowYear);
storm.setCreateDate(new Date());
//System.out.println(gson.toJson(storm));
WztfStorm stormDB = this.wztfStormService.findByTfbh(storm.getTfbh());
if (stormDB == null) {
//数据库无数据,第一次插入,同时从第三方平台拉取台风路径数据入库
this.wztfStormService.saveWztfStorm(storm);
this.saveOrUpdateWztfStormInfo(storm);
} else {
//数据库有数据
if (stormDB.getIs_current() == 1) {
if (storm.getIs_current() == 0) {
//数据库里面台风数据是活跃状态,第三方平台台风数据已变成不活跃状态,更新数据库台风状态,同时更新台风路径
stormDB.setIs_current(storm.getIs_current());
this.wztfStormService.saveWztfStorm(stormDB);
this.saveOrUpdateWztfStormInfo(stormDB);
} else {
//数据库里面台风数据是活跃状态,第三方平台台风数据也是活跃状态
if ((!storm.getEnd_time().equals(stormDB.getEnd_time())) || (!storm.getEname().equals(stormDB.getEname())) || (!storm.getName().equals(stormDB.getName())) || (!storm.getIdent().equals(stormDB.getIdent()))) {
//台风列表数据有变化,更新台风列表数据
stormDB.setEnd_time(storm.getEnd_time());
stormDB.setEname(storm.getEname());
stormDB.setName(storm.getName());
stormDB.setIdent(storm.getIdent());
this.wztfStormService.saveWztfStorm(stormDB);
}
//更新台风路径
this.saveOrUpdateWztfStormInfo(stormDB);
}
} else {
//数据库里面台风数据是不活跃状态,无需做任何事情
//this.saveOrUpdateWztfStormInfo(storm);
}
}
}
}
}
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
/**
* @date 2022-03-16 09:41
* @description:
* @Param: null
*/
public void saveOrUpdateWztfStormInfo(WztfStorm storm) {
System.out.println("saveOrUpdateTyphoonInfo");
// 初始化 OkHttpClient
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.build();
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");
String nowDate = sdf.format(new Date());
String nowYear = sdfYear.format(new Date());
String url = "http://data.istrongcloud.com/v2/data/complex/" + storm.getTfbh() + ".json?v=" + String.valueOf(System.currentTimeMillis());
System.out.println(url);
// 初始化请求体
Request request = new Request.Builder()
.get()
.url(url)
.build();
// 得到返回Response
Response response = client.newCall(request).execute();
String body = response.body().string();
//System.out.println(body);
if (StringUtils.hasText(body)) {
if (body.length() > 2) {
Gson gson = new Gson();
int startIndex0 = body.indexOf("{");
int endIndex0 = body.lastIndexOf("}");
String typhoonInfoStr = body.substring(startIndex0, endIndex0 + 1);
//System.out.println(typhoonInfoStr);
WztfStormInfo wztfStormInfoDB = this.wztfStormService.findWztfStormInfoByTfbh(storm.getTfbh());
WztfStormInfo wztfStormInfo = new WztfStormInfo();
if (wztfStormInfoDB == null) {
//数据库无数据,保存风路径数据入库
wztfStormInfo.setTfbh(storm.getTfbh());
wztfStormInfo.setStormData(typhoonInfoStr);
wztfStormInfo.setCreateDate(new Date());
wztfStormInfo.setLastUpdateDate(new Date());
this.wztfStormService.saveWztfStormInfo(wztfStormInfo);
} else {
//数据库有数据,更新台风路径数据
wztfStormInfoDB.setStormData(typhoonInfoStr);
wztfStormInfoDB.setLastUpdateDate(new Date());
this.wztfStormService.saveWztfStormInfo(wztfStormInfoDB);
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}

@ -0,0 +1,24 @@
package com.rehome.jpahefengweather.service;
import com.rehome.jpahefengweather.entity.WztfStorm;
import com.rehome.jpahefengweather.entity.WztfStormInfo;
import java.util.List;
public interface WztfStormService {
//根据id查询台风
WztfStorm findByTfbh(String tfbh);
//根据年份查询台风列表
List<WztfStorm> findByYear(String year);
/**
*
*/
void saveWztfStorm(WztfStorm wztfStorm);
WztfStormInfo findWztfStormInfoByTfbh(String tfbh);
/**
*
*/
void saveWztfStormInfo(WztfStormInfo wztfStormInfo);
}

@ -0,0 +1,25 @@
package com.rehome.jpahefengweather.service;
import com.rehome.jpahefengweather.entity.TyphoonInfo;
import com.rehome.jpahefengweather.entity.ZjsltStorm;
import java.util.List;
public interface ZjsltStormService {
//根据id查询台风
ZjsltStorm findByTfid(String tfid);
//根据年份查询台风列表
List<ZjsltStorm> findByYear(String year);
/**
*
*/
void saveZjsltStorm(ZjsltStorm zjsltStorm);
TyphoonInfo findTyphoonInfoByTfid(String tfid);
/**
*
*/
void saveTyphoonInfo(TyphoonInfo typhoonInfo);
}

@ -0,0 +1,88 @@
package com.rehome.jpahefengweather.utils;
import java.util.Arrays;
import java.util.Locale;
/**
* dao
*
* @author LiuHuiYu
* @version v1.0.0.0
* Created DateTime 2022-01-12 9:38
*/
public class DaoUtil {
/**
* oracle
*
* @param sqlBuilder sql
* @param paging
* @author LiuHuiYu
* Created DateTime 2022-01-12 9:39
*/
public static void paginationOracleSql(StringBuilder sqlBuilder, Paging paging) {
String rowNumName;
for(int i=0;;i++){
rowNumName = "rowno_" + i;
if(!sqlBuilder.toString().toLowerCase(Locale.ROOT).contains(rowNumName)){
break;
}
}
sqlBuilder.insert(0, "SELECT * FROM (SELECT t_pagination.*, ROWNUM AS " + rowNumName + " FROM(");
sqlBuilder.append(") t_pagination WHERE ROWNUM <= ")
.append(paging.endRowNo())
.append(") table_alias WHERE table_alias.")
.append(rowNumName)
.append(" >= ")
.append(paging.beginRowNo());
}
/**
* sql
*
* @param sqlBuilder sql StringBuilder
* @author LiuHuiYu
* Created DateTime 2022-01-12 9:57
*/
public static void countOracleSql(StringBuilder sqlBuilder) {
int index = sqlBuilder.toString().toLowerCase().indexOf(" from ");
sqlBuilder.replace(0, index, "select count(1)");
}
/**
* sql
*
* @param sqlBuilder sql StringBuilder
* @author LiuHuiYu
* @deprecated
* Created DateTime 2022-01-12 9:57
*/
@Deprecated
public static void countOracleSql2(StringBuilder sqlBuilder) {
String fromString = " from ";
int f = 0;
int level = 0;
for (int i = 0; i < sqlBuilder.length(); i++) {
//字符串检测
if (Arrays.asList('\'', '\"').contains(sqlBuilder.charAt(i))) {
throw new RuntimeException("当前解析无法解析包含字符串的sql语句");
}
//包含检测
if (sqlBuilder.charAt(i) == '(') {
level++;
}
else if (sqlBuilder.charAt(i) == ')') {
level--;
}
if (level < 0) {
throw new RuntimeException("输入的sql语句异常");
}
// if (f == fromString.length() && level == 0) {
// ;
// }
}
int index = sqlBuilder.toString().toLowerCase().indexOf(" from ");
sqlBuilder.replace(0, index, "select count(1)");
}
}

@ -0,0 +1,100 @@
package com.rehome.jpahefengweather.utils;
import org.apache.poi.hssf.usermodel.*;
import java.util.List;
/**
* @author LiuHuiYu
* @version v1.0.0.0
* Created DateTime 2022-03-24 15:19
*/
public class ExcelUtil {
/**
* Excel
*
* @param sheetName sheet
* @param title
* @param values
* @param wb HSSFWorkbook
* @return HSSFWorkbook
*/
public static HSSFWorkbook getWorkbook(String sheetName, String[] title, String[][] values, HSSFWorkbook wb) {
// 第一步创建一个HSSFWorkbook对应一个Excel文件
if (wb == null) {
wb = new HSSFWorkbook();
}
// 第二步在workbook中添加一个sheet,对应Excel文件中的sheet
HSSFSheet sheet = wb.createSheet(sheetName);
// 第三步在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制
HSSFRow row = sheet.createRow(0);
// 第四步,创建单元格,并设置值表头 设置表头居中
HSSFCellStyle style = wb.createCellStyle();
// 创建一个居中格式
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
//声明列对象
HSSFCell cell;
//创建标题
for (int i = 0; i < title.length; i++) {
cell = row.createCell(i);
cell.setCellValue(title[i]);
cell.setCellStyle(style);
}
//创建内容
for (int i = 0; i < values.length; i++) {
row = sheet.createRow(i + 1);
for (int j = 0; j < values[i].length; j++) {
//将内容按顺序赋给对应的列对象
row.createCell(j).setCellValue(values[i][j]);
}
}
return wb;
}
public static HSSFWorkbook getWorkbook(String sheetName, String[] title, List<String[]> values, HSSFWorkbook wb) {
// 第一步创建一个HSSFWorkbook对应一个Excel文件
if (wb == null) {
wb = new HSSFWorkbook();
}
// 第二步在workbook中添加一个sheet,对应Excel文件中的sheet
HSSFSheet sheet = wb.createSheet(sheetName);
// 第三步在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制
HSSFRow row = sheet.createRow(0);
// 第四步,创建单元格,并设置值表头 设置表头居中
HSSFCellStyle style = wb.createCellStyle();
// 创建一个居中格式
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
//声明列对象
HSSFCell cell;
//创建标题
for (int i = 0; i < title.length; i++) {
cell = row.createCell(i);
cell.setCellValue(title[i]);
cell.setCellStyle(style);
}
//创建内容
for (int i = 0; i < values.size(); i++) {
row = sheet.createRow(i + 1);
for (int j = 0; j < values.get(i).length; j++) {
//将内容按顺序赋给对应的列对象
row.createCell(j).setCellValue(values.get(i)[j]);
}
}
return wb;
}
}

@ -0,0 +1,38 @@
package com.rehome.jpahefengweather.utils;
/**
*
* <pre>
* &#x40;ApiModelProperty("分页信息")
* private Paging paging = new Paging();
*
* &#x40;Override
* public Paging getPaging() {
* return paging;
* }
*
* &#x40;Override
* public void setPaging(Paging paging) {
* this.paging = paging;
* }
* </pre>
* @author LiuHuiYu
* @version v1.0.0.0
* Created DateTime 2022-01-12 10:22
*/
public interface IPaging {
/**
*
* @author LiuHuiYu
* Created DateTime 2022-01-20 15:29
* @return cc.rehome.zhanjiang.data_center_model.domain.Paging
*/
Paging getPaging();
/**
*
* @author LiuHuiYu
* Created DateTime 2022-01-20 15:29
* @param paging
*/
void setPaging(Paging paging);
}

@ -0,0 +1,18 @@
package com.rehome.jpahefengweather.utils;
import java.io.Serializable;
/**
* @author LiuHuiYu
* @version v1.0.0.0
* Created DateTime 2022-01-08 9:45
*/
public interface ISerializationJson extends Serializable {
/**
* json
* @author LiuHuiYu
* Created DateTime 2022-01-20 15:30
* @return java.lang.String
*/
String toJson();
}

@ -0,0 +1,86 @@
package com.rehome.jpahefengweather.utils;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import com.liuhuiyu.spring_util.SpringUtil;
import okhttp3.ConnectionPool;
import okhttp3.OkHttpClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Created by qhong on 2018/7/3 16:52
**/
@Configuration
public class OkHttpConfig {
public static OkHttpConfig getInstance() {
return SpringUtil.getBean(OkHttpConfig.class);
}
public OkHttpConfig() {}
public OkHttpClient okHttpClient;
public OkHttpClient getOkHttpClient(){
if(okHttpClient==null){
okHttpClient=OkHttpConfig.getInstance().okHttpClient();
}
return okHttpClient;
}
@Bean
public X509TrustManager x509TrustManager() {
return new X509TrustManager() {
@Override
public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
}
@Override
public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
};
}
@Bean
public SSLSocketFactory sslSocketFactory() {
try {
//信任任何链接
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, new TrustManager[]{x509TrustManager()}, new SecureRandom());
return sslContext.getSocketFactory();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (KeyManagementException e) {
e.printStackTrace();
}
return null;
}
/**
* Create a new connection pool with tuning parameters appropriate for a single-user application.
* The tuning parameters in this pool are subject to change in future OkHttp releases. Currently
*/
@Bean
public ConnectionPool pool() {
return new ConnectionPool(200, 5, TimeUnit.MINUTES);
}
@Bean
public OkHttpClient okHttpClient() {
return new OkHttpClient.Builder()
.sslSocketFactory(sslSocketFactory(), x509TrustManager())
.retryOnConnectionFailure(true)//是否开启缓存
.connectionPool(pool())//连接池
.connectTimeout(10L, TimeUnit.SECONDS)
.readTimeout(30L, TimeUnit.SECONDS)
.build();
}
}

@ -0,0 +1,133 @@
package com.rehome.jpahefengweather.utils;
import java.util.Iterator;
import java.util.Map;
import com.liuhuiyu.spring_util.SpringUtil;
import okhttp3.FormBody;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
/**
* Created by qhong on 2018/7/3 16:55
**/
public class OkHttpUtil{
/**
* mapget
* @param queries
* @return
*/
public static StringBuffer getQueryString(String url,Map<String,String> queries){
StringBuffer sb = new StringBuffer(url);
if (queries != null && queries.keySet().size() > 0) {
boolean firstFlag = true;
Iterator iterator = queries.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry<String, String>) iterator.next();
if (firstFlag) {
sb.append("?" + entry.getKey() + "=" + entry.getValue());
firstFlag = false;
} else {
sb.append("&" + entry.getKey() + "=" + entry.getValue());
}
}
}
return sb;
}
/**
* okhttpnewCall
* @param request
* @return
*/
private static String execNewCall(Request request){
Response response = null;
try {
OkHttpClient okHttpClient = OkHttpConfig.getInstance().getOkHttpClient();
response = okHttpClient.newCall(request).execute();
int status = response.code();
if (response.isSuccessful()&&status==200) {
return response.body().string();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (response != null) {
response.close();
}
}
return "";
}
/**
* get
* @param url url
* @param queries null
* @return
*/
public static String get(String url, Map<String, String> queries) {
StringBuffer sb = getQueryString(url,queries);
Request request = new Request.Builder()
.url(sb.toString())
.build();
return execNewCall(request);
}
/**
* post
*
* @param url url
* @param params post form
* @return
*/
public static String postFormParams(String url, Map<String, String> params) {
FormBody.Builder builder = new FormBody.Builder();
//添加参数
if (params != null && params.keySet().size() > 0) {
for (String key : params.keySet()) {
builder.add(key, params.get(key));
}
}
Request request = new Request.Builder()
.url(url)
.post(builder.build())
.build();
return execNewCall(request);
}
/**
* PostJSON....{"name":"zhangsan","pwd":"123456"}
* Url
* JSON
*
*/
public static String postJsonParams(String url, String jsonParams) {
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), jsonParams);
Request request = new Request.Builder()
.url(url)
.post(requestBody)
.build();
return execNewCall(request);
}
/**
* Postxml....
* Url
* xmlString
*
*/
public static String postXmlParams(String url, String xml) {
RequestBody requestBody = RequestBody.create(MediaType.parse("application/xml; charset=utf-8"), xml);
Request request = new Request.Builder()
.url(url)
.post(requestBody)
.build();
return execNewCall(request);
}
}

@ -0,0 +1,82 @@
package com.rehome.jpahefengweather.utils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.data.domain.PageRequest;
/**
*
*
* @author LiuHuiYu
* @version v1.0.0.0
* Created DateTime 2021-12-20 16:13
*/
@ApiModel(value = "Paging", description = "分页信息")
public class Paging {
@ApiModelProperty("当前页面索引0开始")
private int pageIndex;
@ApiModelProperty("页面大小(0表示不会有列表信息)")
private int pageSize;
@ApiModelProperty("全部数据放入一个页面不分页")
private boolean allInOne;
public static final int FIRST_PAGE_INDEX = 0;
public static final int DEFAULT_PAGE_SIZE = 20;
public static final int MIN_PAGE_SIZE = 0;
public Paging() {
pageIndex = FIRST_PAGE_INDEX;
pageSize = DEFAULT_PAGE_SIZE;
}
public int getPageIndex() {
return pageIndex;
}
public void setPageIndex(int pageIndex) {
this.pageIndex = Math.max(pageIndex, FIRST_PAGE_INDEX);
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize < MIN_PAGE_SIZE ? DEFAULT_PAGE_SIZE : pageSize;
}
public boolean isAllInOne() {
return allInOne;
}
public void setAllInOne(boolean allInOne) {
this.allInOne = allInOne;
}
/**
* Pageable bean
*
* @return org.springframework.data.domain.PageRequest
* @author LiuHuiYu
* Created DateTime 2022-02-11 11:19
*/
public PageRequest getPageRequest() {
return PageRequest.of(this.pageIndex, this.pageSize == 0 ? 1 : this.pageSize);
}
/**
* NO1
* @author LiuHuiYu
* Created DateTime 2022-04-01 16:00
* @return java.lang.Integer
*/
public Integer beginRowNo() {
return this.pageIndex * pageSize + 1;
}
/**
* NO(NO)
* @author LiuHuiYu
* Created DateTime 2022-04-01 16:01
* @return java.lang.Integer
*/
public Integer endRowNo() {
return beginRowNo() + pageSize - 1;
}
}

@ -0,0 +1,33 @@
package com.rehome.jpahefengweather.utils;
import com.google.gson.Gson;
/**
*
*
* @author LiuHuiYu
* @version v1.0.0.0
* Created DateTime 2022-03-21 17:28
*/
public class PagingImplDto implements IPaging, ISerializationJson {
Paging paging;
public PagingImplDto() {
this.paging = new Paging();
}
@Override
public Paging getPaging() {
return this.paging;
}
@Override
public void setPaging(Paging paging) {
this.paging = paging;
}
@Override
public String toJson() {
return new Gson().toJson(this);
}
}

@ -0,0 +1,107 @@
package com.rehome.jpahefengweather.utils;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
/**
* @author LiuHuiYu
* @version v1.0.0.0
* Created DateTime 2022-01-06 15:35
*/
public class TimestampUtil {
public static final String FORMAT_YEAR_MONTH_DAY = "yyyy-MM-dd";
public static final String FORMAT_YEAR_MONTH_DAY_HOUR = "yyyy-MM-dd HH";
public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE = "yyyy-MM-dd HH:mm";
public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = "yyyy-MM-dd HH:mm:ss";
/**
*
*
* @param value
* @return java.sql.Timestamp
* @author LiuHuiYu
* Created DateTime 2022-01-06 15:38
*/
public static Timestamp beginTime(String value) {
try {
String tempV = value;
if (tempV.length() == FORMAT_YEAR_MONTH_DAY.length()) {
tempV += " 00:00:00";
}
else if (tempV.length() == FORMAT_YEAR_MONTH_DAY_HOUR.length()) {
tempV += ":00:00";
}
else if (tempV.length() == FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE.length()) {
tempV += ":00";
}
return Timestamp.valueOf(tempV);
}
catch (Exception e) {
return null;
}
}
/**
*
*
* @param value
* @return java.sql.Timestamp
* @author LiuHuiYu
* Created DateTime 2022-01-06 15:38
*/
public static Timestamp endTime(String value) {
try {
String tempV = value;
if (tempV.length() == FORMAT_YEAR_MONTH_DAY.length()) {
tempV += " 23:59:59";
}
else if (tempV.length() == FORMAT_YEAR_MONTH_DAY_HOUR.length()) {
tempV += ":59:59";
}
else if (tempV.length() == FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE.length()) {
tempV += ":59";
}
return Timestamp.valueOf(tempV);
}
catch (Exception e) {
return null;
}
}
/**
* Timestamp
*
* @param value
* @return boolean
* @author LiuHuiYu
* Created DateTime 2022-01-06 15:37
*/
public static boolean isTimestampString(String value) {
try {
String tempV = value;
if (tempV.length() == FORMAT_YEAR_MONTH_DAY.length()) {
tempV += " 23:59:59";
}
else if (tempV.length() == FORMAT_YEAR_MONTH_DAY_HOUR.length()) {
tempV += ":59:59";
}
else if (tempV.length() == FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE.length()) {
tempV += ":59";
}
Timestamp.valueOf(tempV);
return true;
}
catch (Exception e) {
return false;
}
}
public static String toString(Timestamp timestamp, String format) {
try {
return new SimpleDateFormat(format).format(timestamp);
}
catch (Exception ex) {
return "";
}
}
}

@ -0,0 +1,77 @@
#1.项目启动的端口
server:
port: 48080
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
#driverClassName: com.mysql.jdbc.Driver #com.mysql.cj.jdbc.Driver com.mysql.jdbc.Driver
#driverClassName: com.mysql.cj.jdbc.Driver #com.mysql.cj.jdbc.Driver com.mysql.jdbc.Driver
#url: jdbc:mysql://localhost:3306/head_office_data_center?characterEncoding=utf-8&serverTimezone=UTC&autoReconnect=true
#url: jdbc:mysql://127.0.0.1:3306/head_office_data_center?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true
#url: jdbc:mysql://localhost:3306/head_office_data_center?useUnicode=true&characterEncoding=utf-8&useSSL=true&nullCatalogMeansCurrent=true&serverTimezone=UTC
#url: jdbc:mysql://121.36.143.201:33400/hefengweather?useUnicode=true&characterEncoding=utf-8&useSSL=false
#url: jdbc:mysql://192.168.1.28:3340/hefengweather?useUnicode=true&characterEncoding=utf-8&useSSL=false
# url: jdbc:mysql://192.168.1.71:2881/hefengweather?useUnicode=true&characterEncoding=utf-8&useSSL=false
#url: jdbc:mysql://192.168.2.18:3306/nmcweather?useUnicode=true&characterEncoding=utf-8&useSSL=false
driverClassName: com.mysql.cj.jdbc.Driver #com.mysql.cj.jdbc.Driver com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.3.7:3306/nmcweather?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root
password: Skyinno251,
# driverClassName: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@192.168.2.18:1521/orcl
# username: maximo
# password: maximo
# driverClassName: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@192.168.1.9:1521/orcl
# username: huangwenfei
# password: huangwenfei
# driverClassName: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@192.168.1.40:1521/orcl
# username: maximo
# password: maximo
# driverClassName: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@192.168.1.13:1521/ORCLCDB
# username: c##maximo
# password: maximo
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=weather;encrypt=false;
# username: sa
# password: Skyinno251,
# 配置 DBMS 类型
#database: sql_server
#url: jdbc:mysql://192.168.1.71:2881/hefengweather?useUnicode=true&characterEncoding=utf-8&useSSL=false
# driverClassName: com.mysql.cj.jdbc.Driver #com.mysql.cj.jdbc.Driver com.mysql.jdbc.Driver
# url: jdbc:mysql://192.168.5.21:3306/weather?useUnicode=true&characterEncoding=utf-8&useSSL=false
# username: root
# password: Skyinno251,
# driverClassName: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@192.168.2.18:1521/orcl
# username: maximo
# password: maximo
# driverClassName: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@192.168.1.9:1521/orcl
# username: huangwenfei
# password: huangwenfei
# driverClassName: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@192.168.1.40:1521/orcl
# username: maximo
# password: maximo
# driverClassName: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@192.168.1.13:1521/ORCLCDB
# username: c##maximo
# password: maximo
# driverClassName: oracle.jdbc.driver.OracleDriver
# url: jdbc:oracle:thin:@192.168.5.9:1521/orcl
# username: maximo
# password: maximo
jpa:
# 配置 DBMS 类型
database: mysql
# 配置是否将执行的 SQL 输出到日志
show-sql: false
open-in-view: true
hibernate:
ddl-auto: update # 第一次建表create 后面用update要不然每次重启都会新建表
rehome:
resources-path: /Users/wenfeihuang/storage # 外部资源文件存储路径 格式:/Users/edao/storage

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

@ -0,0 +1,13 @@
package com.rehome.jpahefengweather;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class JpahefengweatherApplicationTests {
@Test
void contextLoads() {
}
}
Loading…
Cancel
Save