init version for new gitea
This commit is contained in:
33
.gitignore
vendored
Normal file
33
.gitignore
vendored
Normal file
@@ -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/
|
||||
92
README.md
Normal file
92
README.md
Normal file
@@ -0,0 +1,92 @@
|
||||
# hrsmiddle
|
||||
|
||||
|
||||
|
||||
## Getting started
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
|
||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
||||
|
||||
## Add your files
|
||||
|
||||
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
||||
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin http://192.168.10.240/kelfy/hrsmiddle.git
|
||||
git branch -M main
|
||||
git push -uf origin main
|
||||
```
|
||||
|
||||
## Integrate with your tools
|
||||
|
||||
- [ ] [Set up project integrations](http://192.168.10.240/kelfy/hrsmiddle/-/settings/integrations)
|
||||
|
||||
## Collaborate with your team
|
||||
|
||||
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
||||
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
||||
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
||||
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
||||
|
||||
## Test and Deploy
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
|
||||
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
||||
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
||||
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
||||
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
||||
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
||||
|
||||
***
|
||||
|
||||
# Editing this README
|
||||
|
||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||
|
||||
## Suggestions for a good README
|
||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||
|
||||
## Name
|
||||
Choose a self-explaining name for your project.
|
||||
|
||||
## Description
|
||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
||||
|
||||
## Badges
|
||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
||||
|
||||
## Visuals
|
||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
||||
|
||||
## Installation
|
||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
||||
|
||||
## Usage
|
||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
||||
|
||||
## Support
|
||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
|
||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
||||
|
||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
||||
|
||||
## Authors and acknowledgment
|
||||
Show your appreciation to those who have contributed to the project.
|
||||
|
||||
## License
|
||||
For open source projects, say how it is licensed.
|
||||
|
||||
## Project status
|
||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
||||
310
mvnw
vendored
Normal file
310
mvnw
vendored
Normal file
@@ -0,0 +1,310 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Maven Start Up Batch script
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# M2_HOME - location of maven2's installed home dir
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||
else
|
||||
export JAVA_HOME="/Library/Java/Home"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=`java-config --jre-home`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$M2_HOME" ] ; then
|
||||
## resolve links - $0 may be a link to maven's home
|
||||
PRG="$0"
|
||||
|
||||
# need this for relative symlinks
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG="`dirname "$PRG"`/$link"
|
||||
fi
|
||||
done
|
||||
|
||||
saveddir=`pwd`
|
||||
|
||||
M2_HOME=`dirname "$PRG"`/..
|
||||
|
||||
# make it fully qualified
|
||||
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||
|
||||
cd "$saveddir"
|
||||
# echo Using m2 at $M2_HOME
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="`which javac`"
|
||||
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=`which readlink`
|
||||
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||
else
|
||||
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||
fi
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
else
|
||||
JAVACMD="`which java`"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=`cd "$wdir/.."; pwd`
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
echo "${basedir}"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
echo "$(tr -s '\n' ' ' < "$1")"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
##########################################################################################
|
||||
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
##########################################################################################
|
||||
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||
fi
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||
fi
|
||||
if [ -n "$MVNW_REPOURL" ]; then
|
||||
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
else
|
||||
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
fi
|
||||
while IFS="=" read key value; do
|
||||
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||
esac
|
||||
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Downloading from: $jarUrl"
|
||||
fi
|
||||
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||
if $cygwin; then
|
||||
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||
fi
|
||||
|
||||
if command -v wget > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found wget ... using wget"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
wget "$jarUrl" -O "$wrapperJarPath"
|
||||
else
|
||||
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
|
||||
fi
|
||||
elif command -v curl > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found curl ... using curl"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||
else
|
||||
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||
fi
|
||||
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Falling back to using Java to download"
|
||||
fi
|
||||
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||
# For Cygwin, switch paths to Windows format before running javac
|
||||
if $cygwin; then
|
||||
javaClass=`cygpath --path --windows "$javaClass"`
|
||||
fi
|
||||
if [ -e "$javaClass" ]; then
|
||||
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
# Compiling the Java class
|
||||
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||
fi
|
||||
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
# Running the downloader
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Running MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
##########################################################################################
|
||||
# End of extension
|
||||
##########################################################################################
|
||||
|
||||
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo $MAVEN_PROJECTBASEDIR
|
||||
fi
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||
fi
|
||||
|
||||
# Provide a "standardized" way to retrieve the CLI args that will
|
||||
# work with both Windows and non-Windows executions.
|
||||
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||
export MAVEN_CMD_LINE_ARGS
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||
182
mvnw.cmd
vendored
Normal file
182
mvnw.cmd
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Maven Start Up Batch script
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM M2_HOME - location of maven2's installed home dir
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM set title of command window
|
||||
title %0
|
||||
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
|
||||
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||
)
|
||||
|
||||
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
if exist %WRAPPER_JAR% (
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Found %WRAPPER_JAR%
|
||||
)
|
||||
) else (
|
||||
if not "%MVNW_REPOURL%" == "" (
|
||||
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
)
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||
echo Downloading from: %DOWNLOAD_URL%
|
||||
)
|
||||
|
||||
powershell -Command "&{"^
|
||||
"$webclient = new-object System.Net.WebClient;"^
|
||||
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||
"}"^
|
||||
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||
"}"
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Finished downloading %WRAPPER_JAR%
|
||||
)
|
||||
)
|
||||
@REM End of extension
|
||||
|
||||
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||
@REM work with both Windows and non-Windows executions.
|
||||
set MAVEN_CMD_LINE_ARGS=%*
|
||||
|
||||
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||
|
||||
exit /B %ERROR_CODE%
|
||||
50
pom.xml
Normal file
50
pom.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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.saye</groupId>
|
||||
<artifactId>hrsmiddle</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<name>hrsmiddle</name>
|
||||
<description>hrsmiddle</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>log4j-to-slf4j</artifactId>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- <fork>true</fork> -->
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
16
src/main/java/com/saye/hrs/HrsApplication.java
Normal file
16
src/main/java/com/saye/hrs/HrsApplication.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.saye.hrs;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
public class HrsApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(HrsApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
13
src/main/java/com/saye/hrs/ServletInitializer.java
Normal file
13
src/main/java/com/saye/hrs/ServletInitializer.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.saye.hrs;
|
||||
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
public class ServletInitializer extends SpringBootServletInitializer {
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
return application.sources(HrsApplication.class);
|
||||
}
|
||||
|
||||
}
|
||||
82
src/main/java/com/saye/hrs/commons/IPUtil.java
Normal file
82
src/main/java/com/saye/hrs/commons/IPUtil.java
Normal file
@@ -0,0 +1,82 @@
|
||||
package com.saye.hrs.commons;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description: IP
|
||||
* @author zmc
|
||||
*/
|
||||
public class IPUtil {
|
||||
|
||||
/**
|
||||
* @description: 获取ip
|
||||
* @param
|
||||
* @return java.lang.String
|
||||
* @author zmc
|
||||
*/
|
||||
public static String getIp() {
|
||||
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletRequest request = requestAttributes.getRequest();
|
||||
return getIp(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取ip
|
||||
* @param request
|
||||
* @return java.lang.String
|
||||
* @author zmc
|
||||
*/
|
||||
public static String getIp(HttpServletRequest request) {
|
||||
if (request == null) {
|
||||
return null;
|
||||
}
|
||||
String ip = request.getHeader("X-Forwarded-For");
|
||||
if (!StringUtils.isEmpty(ip) && !"unknown".equalsIgnoreCase(ip.toLowerCase())) {
|
||||
//多次反向代理后会有多个ip值,第一个ip才是真实ip
|
||||
int index = ip.indexOf(",");
|
||||
if (index != -1) {
|
||||
return ip.substring(0, index);
|
||||
} else {
|
||||
return ip;
|
||||
}
|
||||
}
|
||||
ip = request.getHeader("X-Real-IP");
|
||||
if (!StringUtils.isEmpty(ip) && !"unknown".equalsIgnoreCase(ip.toLowerCase())) {
|
||||
return ip;
|
||||
}
|
||||
return request.getRemoteAddr();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 将IP地址的中间两段转星号隐藏处理
|
||||
* @param ip
|
||||
* @return java.lang.String
|
||||
* @author zmc
|
||||
*/
|
||||
// public static String hideIP(String ip) {
|
||||
// if(null == ip) {
|
||||
// return null;
|
||||
// }
|
||||
// List<String> newIPList = new ArrayList<>();
|
||||
// String[] ipArr = org.apache.commons.lang3.StringUtils.splitByWholeSeparatorPreserveAllTokens(ip, ".");
|
||||
// int i = 0;
|
||||
// int len = ipArr.length;
|
||||
// for (String str : ipArr) {
|
||||
// if(i > 0 && i < len - 1) {
|
||||
// str = "*";
|
||||
// }
|
||||
// newIPList.add(str);
|
||||
// i++;
|
||||
// }
|
||||
// String newIP = newIPList.stream().collect(Collectors.joining("."));
|
||||
// return newIP;
|
||||
// }
|
||||
|
||||
}
|
||||
329
src/main/java/com/saye/hrs/commons/date/DateDUtil.java
Normal file
329
src/main/java/com/saye/hrs/commons/date/DateDUtil.java
Normal file
@@ -0,0 +1,329 @@
|
||||
package com.saye.hrs.commons.date;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class DateDUtil {
|
||||
|
||||
|
||||
public static String yyyy_MM_dd = "yyyy-MM-dd";
|
||||
public static String yyyyMMdd = "yyyyMMdd";
|
||||
public static String yyyyMM = "yyyyMM";
|
||||
public static String yyyy_MM = "yyyy-MM";
|
||||
public static String yyyy_MM_dd_HH_00 = "yyyy-MM-dd HH:00";
|
||||
public static String yyyy_MM_dd_HH_mm = "yyyy-MM-dd HH:mm";
|
||||
public static String yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss";
|
||||
public static String yyyy_MM_dd_HH_mm_ss_SS = "yyyy-MM-dd HH:mm:ss.SS";
|
||||
public static String yyyyMMddHHmm = "yyyyMMddHHmm";
|
||||
public static String yyyyMMddHHmmss = "yyyyMMddHHmmss";
|
||||
public static String yyyyMMddHHmmssSS = "yyyyMMddHHmmssSS";
|
||||
public static String yyMMdd = "yyMMdd";
|
||||
public static String yyyy_MM_dd_00_00 = "yyyy-MM-dd 00:00";
|
||||
|
||||
/**
|
||||
* 将字符串时间改成Date类型
|
||||
* @param format
|
||||
* @param dateStr
|
||||
* @return
|
||||
*/
|
||||
public static Date strToDate(String format,String dateStr) {
|
||||
|
||||
Date date = null;
|
||||
|
||||
try {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
|
||||
date = simpleDateFormat.parse(dateStr);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将Date时间转成字符串
|
||||
* @param format
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static String DateToStr(String format,Date date){
|
||||
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
|
||||
|
||||
return simpleDateFormat.format(date);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取2个字符日期的天数差
|
||||
* @param p_startDate
|
||||
* @param p_endDate
|
||||
* @return 天数差
|
||||
*/
|
||||
public static long getDaysOfTowDiffDate( String p_startDate, String p_endDate ){
|
||||
|
||||
Date l_startDate = DateDUtil.strToDate(DateDUtil.yyyy_MM_dd, p_startDate);
|
||||
Date l_endDate = DateDUtil.strToDate(DateDUtil.yyyy_MM_dd, p_endDate);
|
||||
long l_startTime = l_startDate.getTime();
|
||||
long l_endTime = l_endDate.getTime();
|
||||
long betweenDays = (long) ( ( l_endTime - l_startTime ) / ( 1000 * 60 * 60 * 24 ) );
|
||||
return betweenDays;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取2个字符日期的天数差
|
||||
* @param l_startDate
|
||||
* @param l_endDate
|
||||
* @return 天数差
|
||||
*/
|
||||
public static long getDaysOfTowDiffDate( Date l_startDate, Date l_endDate ){
|
||||
|
||||
long l_startTime = l_startDate.getTime();
|
||||
long l_endTime = l_endDate.getTime();
|
||||
long betweenDays = (long) ( ( l_endTime - l_startTime ) / ( 1000 * 60 * 60 * 24 ) );
|
||||
return betweenDays;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 给出日期添加一段时间后的日期
|
||||
* @param dateStr
|
||||
* @param plus
|
||||
* @return
|
||||
*/
|
||||
public static String getPlusDays(String format,String dateStr,long plus){
|
||||
|
||||
Date date = DateDUtil.strToDate(format, dateStr);
|
||||
|
||||
long time = date.getTime()+ plus*24*60*60*1000;
|
||||
|
||||
|
||||
return DateDUtil.DateToStr(format,new Date(time));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 给出日期添加一段时间后的日期
|
||||
* @param format
|
||||
* @param date
|
||||
* @param plus
|
||||
* @return
|
||||
*/
|
||||
public static String getPlusDays(String format,Date date,long plus){
|
||||
|
||||
|
||||
long time = date.getTime()+ plus*24*60*60*1000;
|
||||
|
||||
|
||||
return DateDUtil.DateToStr(format,new Date(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* 给出日期添加一段时间前的日期
|
||||
* @param format
|
||||
* @param date
|
||||
* @param forth
|
||||
* @return
|
||||
*/
|
||||
public static String getForthDays(String format,Date date,long forth){
|
||||
|
||||
|
||||
long time = date.getTime()- forth*24*60*60*1000;
|
||||
|
||||
|
||||
return DateDUtil.DateToStr(format,new Date(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* 给出时间添加几个小时后的时间
|
||||
* @param format
|
||||
* @param dateStr
|
||||
* @param plus
|
||||
* @return
|
||||
*/
|
||||
public static String getPlusHours(String format,String dateStr,long plus){
|
||||
|
||||
Date date = DateDUtil.strToDate(format, dateStr);
|
||||
|
||||
long time = date.getTime()+ plus*60*60*1000;
|
||||
|
||||
|
||||
return DateDUtil.DateToStr(format,new Date(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* 给出时间添加几个分钟后的时间
|
||||
* @param format
|
||||
* @param dateStr
|
||||
* @param plus
|
||||
* @return
|
||||
*/
|
||||
public static String getPlusMinutes(String format,String dateStr,long plus){
|
||||
|
||||
Date date = DateDUtil.strToDate(format, dateStr);
|
||||
|
||||
long time = date.getTime()+ plus*60*1000;
|
||||
|
||||
|
||||
return DateDUtil.DateToStr(format,new Date(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到当前时间,格式如:yyyy-MM-dd HH:mm:ss:SS
|
||||
* @return
|
||||
*/
|
||||
public static String getCurrentTime(){
|
||||
|
||||
String nowTime = DateDUtil.DateToStr(DateDUtil.yyyy_MM_dd_HH_mm_ss_SS, new Date());
|
||||
return nowTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到当前时间,格式如:yyyy-MM-dd HH:mm:ss
|
||||
* @return
|
||||
*/
|
||||
public static String getTheCurrentTime(){
|
||||
|
||||
String nowTime = DateDUtil.DateToStr(DateDUtil.yyyy_MM_dd_HH_mm_ss, new Date());
|
||||
return nowTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到当前日期,格式如:yyyyMMdd
|
||||
* @return
|
||||
*/
|
||||
public static String getCurrentDate(){
|
||||
|
||||
String nowDate = DateDUtil.DateToStr(DateDUtil.yyyyMMdd, new Date());
|
||||
return nowDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到当前日期,格式如:yyyyMMdd
|
||||
* @return
|
||||
*/
|
||||
public static String getCurrentDate(String format){
|
||||
|
||||
String nowDate = DateDUtil.DateToStr(format, new Date());
|
||||
return nowDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取2个字符日期的分钟数差
|
||||
* @param p_startDate
|
||||
* @param p_endDate
|
||||
* @return 相差的分钟
|
||||
*/
|
||||
public static long getMinutesOfTowDiffDate(String p_startDate, String p_endDate ){
|
||||
|
||||
Date l_startDate = DateDUtil.strToDate(DateDUtil.yyyy_MM_dd_HH_mm_ss_SS, p_startDate);
|
||||
Date l_endDate = DateDUtil.strToDate(DateDUtil.yyyy_MM_dd_HH_mm_ss_SS, p_endDate);
|
||||
long l_startTime = l_startDate.getTime();
|
||||
long l_endTime = l_endDate.getTime();
|
||||
long betweenMinutes = (long) ( ( l_endTime - l_startTime ) / ( 1000 * 60) );
|
||||
return betweenMinutes;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取2个字符日期的分钟数差
|
||||
* @param p_startDate
|
||||
* @param p_endDate
|
||||
* @return 相差的分钟
|
||||
*/
|
||||
public static long getMinutesOfTowDiffDateMin(String format,String p_startDate, String p_endDate ){
|
||||
|
||||
Date l_startDate = DateDUtil.strToDate(format, p_startDate);
|
||||
Date l_endDate = DateDUtil.strToDate(format, p_endDate);
|
||||
long l_startTime = l_startDate.getTime();
|
||||
long l_endTime = l_endDate.getTime();
|
||||
long betweenMinutes = (long) ( ( l_endTime - l_startTime ) / ( 1000 * 60) );
|
||||
return betweenMinutes;
|
||||
}
|
||||
public static long getMonthIntervalOfTowDiffDate(String p_startMonth, String p_endMonth){
|
||||
|
||||
Date l_startDate = DateDUtil.strToDate(DateDUtil.yyyy_MM, p_startMonth);
|
||||
Date l_endDate = DateDUtil.strToDate(DateDUtil.yyyy_MM, p_endMonth);
|
||||
|
||||
|
||||
Calendar calender = Calendar.getInstance();
|
||||
calender.setTime(l_startDate);
|
||||
|
||||
long l_startMonth = calender.get(Calendar.MONTH)+1;
|
||||
long l_startYear = calender.get(Calendar.YEAR);
|
||||
|
||||
calender.setTime(l_endDate);
|
||||
|
||||
long l_endMonth =calender.get(Calendar.MONTH)+1;
|
||||
long l_endYear = calender.get(Calendar.YEAR);
|
||||
|
||||
long betweenYear = l_endYear - l_startYear;
|
||||
long betweenMonth = (long) ( l_endMonth - l_startMonth ) ;
|
||||
|
||||
return betweenYear * 12 + betweenMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串日期转为cron表达式
|
||||
*/
|
||||
public static String getCron(String execute_time) throws Exception{
|
||||
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(yyyy_MM_dd_HH_mm_ss);
|
||||
Date date = simpleDateFormat.parse(execute_time);
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("ss mm HH dd MM ? yyyy");
|
||||
return dateFormat.format(date);
|
||||
}
|
||||
/**
|
||||
* 获取当前年月日日期
|
||||
*/
|
||||
|
||||
public static String getCDate(){
|
||||
Calendar now = Calendar.getInstance();
|
||||
String year=now.get(Calendar.YEAR)+"";
|
||||
String month=(now.get(Calendar.MONTH) + 1) + "";
|
||||
String day=now.get(Calendar.DAY_OF_MONTH)+"";
|
||||
if ((now.get(Calendar.MONTH) + 1) < 10) month = "0" + month;
|
||||
if (now.get(Calendar.DAY_OF_MONTH) < 10) day= "0" + day;
|
||||
String nowDate = year+"年"+month+"月"+day+"日";
|
||||
return nowDate;
|
||||
}
|
||||
|
||||
public static List<String> findWeekDays(String week) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar c = Calendar.getInstance();
|
||||
// 今天是一周中的第几天
|
||||
int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
|
||||
|
||||
if (c.getFirstDayOfWeek() == Calendar.SUNDAY) {
|
||||
c.add(Calendar.DAY_OF_MONTH, 1);
|
||||
}
|
||||
|
||||
if("lastWeek".equals(week)){
|
||||
dayOfWeek = -dayOfWeek-7;
|
||||
}else if("thisWeek".equals(week)){
|
||||
dayOfWeek = -dayOfWeek;
|
||||
}else if("nextWeek".equals(week)){
|
||||
dayOfWeek = -dayOfWeek+7;
|
||||
}
|
||||
// 计算一周开始的日期
|
||||
c.add(Calendar.DAY_OF_MONTH, dayOfWeek);
|
||||
|
||||
for (int i = 1; i <= 7; i++) {
|
||||
c.add(Calendar.DAY_OF_MONTH, 1);
|
||||
list.add(sdf.format(c.getTime()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
||||
77
src/main/java/com/saye/hrs/config/LoginFilter.java
Normal file
77
src/main/java/com/saye/hrs/config/LoginFilter.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package com.saye.hrs.config;
|
||||
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestClientException;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
import java.awt.Image;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
|
||||
@Component
|
||||
public class LoginFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
|
||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||
String url = request.getRequestURI();
|
||||
System.out.println("this is MyFilter,url :"+url);
|
||||
if(url.indexOf("/showFile/")==0) { //获取图片流
|
||||
RestTemplate rt = new RestTemplate();
|
||||
ResponseEntity<Resource> entity = null;
|
||||
try {
|
||||
entity = rt.getForEntity(new URI("http://110.153.1.138:8081"+url), Resource.class);
|
||||
} catch (RestClientException | URISyntaxException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
InputStream in = entity.getBody().getInputStream();
|
||||
|
||||
ServletOutputStream out = null;
|
||||
try {
|
||||
//获取图片存放路径
|
||||
//response.setContentType("multipart/form-data");
|
||||
out = response.getOutputStream();
|
||||
//读取文件流
|
||||
int len = 0;
|
||||
byte[] buffer = new byte[1024 * 10];
|
||||
while ((len = in.read(buffer)) != -1){
|
||||
out.write(buffer,0,len);
|
||||
}
|
||||
out.flush();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
out.close();
|
||||
in.close();
|
||||
}
|
||||
|
||||
}else {
|
||||
filterChain.doFilter(request, response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
}
|
||||
68
src/main/java/com/saye/hrs/config/VirtualPathConfig.java
Normal file
68
src/main/java/com/saye/hrs/config/VirtualPathConfig.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package com.saye.hrs.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.StringHttpMessageConverter;
|
||||
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description: 配置
|
||||
* @author dqzhang
|
||||
* @created 2019年11月19日 下午3:26:06
|
||||
*/
|
||||
@Configuration
|
||||
public class VirtualPathConfig extends WebMvcConfigurationSupport{
|
||||
|
||||
@Override
|
||||
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
// TODO Auto-generated method stub
|
||||
// registry.addResourceHandler("/images/**").addResourceLocations("file:d:/saye/");
|
||||
registry.addResourceHandler("/showFile/**").addResourceLocations("file:/d:/saye/");
|
||||
registry.addResourceHandler("/storage/**").addResourceLocations("file:/home/fy-docPic/");
|
||||
registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
|
||||
registry.addResourceHandler("swagger-ui.html").addResourceLocations(
|
||||
"classpath:/META-INF/resources/");
|
||||
registry.addResourceHandler("/webjars/**").addResourceLocations(
|
||||
"classpath:/META-INF/resources/webjars/");
|
||||
super.addResourceHandlers(registry);
|
||||
}
|
||||
@Override
|
||||
protected void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins("*")
|
||||
.allowedMethods("GET", "HEAD", "POST","PUT", "DELETE", "OPTIONS")
|
||||
.allowedHeaders("*")
|
||||
.exposedHeaders("access-control-allow-headers",
|
||||
"access-control-allow-methods",
|
||||
"access-control-allow-origin",
|
||||
"access-control-max-age",
|
||||
"X-Frame-Options")
|
||||
.allowCredentials(false).maxAge(3600);
|
||||
super.addCorsMappings(registry);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public HttpMessageConverter<String> responseBodyConverter() {
|
||||
return new StringHttpMessageConverter(Charset.forName("UTF-8"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
converters.add(responseBodyConverter());
|
||||
// 这里必须加上加载默认转换器,不然bug玩死人,并且该bug目前在网络上似乎没有解决方案
|
||||
// 百度,谷歌,各大论坛等。你可以试试去掉。
|
||||
addDefaultHttpMessageConverters(converters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
|
||||
configurer.favorPathExtension(false);
|
||||
}
|
||||
}
|
||||
492
src/main/java/com/saye/hrs/controller/MiddleController.java
Normal file
492
src/main/java/com/saye/hrs/controller/MiddleController.java
Normal file
@@ -0,0 +1,492 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* @author dqzhang
|
||||
* @since 2021-09-15 09:43:02
|
||||
*/
|
||||
@RestController
|
||||
public class MiddleController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(MiddleController.class);
|
||||
private static RestTemplate restTemplate = new RestTemplate();
|
||||
private static String IP_PORT = "http://110.153.1.138:8081/";
|
||||
|
||||
/* -----------------------------------------------------医院信息---------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @description 查询医院滚动图片通知
|
||||
* @author dqzhang
|
||||
* @created 2021年11月9日 下午4:01:11
|
||||
*/
|
||||
@RequestMapping("/findHospitalNotice")
|
||||
public String findHospitalNotice(String hos_notice_id) {
|
||||
|
||||
String url = IP_PORT + "findHospitalNotice?hos_notice_id=" + hos_notice_id;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @description 查询医院介绍
|
||||
* @author dqzhang
|
||||
* @created 2021年11月9日 下午4:01:38
|
||||
*/
|
||||
@RequestMapping("/findHospitalAbout")
|
||||
public Object findHospitalAbout() {
|
||||
|
||||
String url = IP_PORT + "findHospitalAbout";
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @description 查询医院导航
|
||||
* @author dqzhang
|
||||
* @created 2021年11月9日 下午4:01:38
|
||||
*/
|
||||
@RequestMapping("/findHospital")
|
||||
public Object findHospital() {
|
||||
|
||||
String url = IP_PORT + "findHospital";
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @description 查询就医指南
|
||||
* @author dqzhang
|
||||
* @created 2021年11月9日 下午4:01:38
|
||||
*/
|
||||
@RequestMapping("/findMedicalGuide")
|
||||
public Object findMedicalGuide() {
|
||||
|
||||
String url = IP_PORT + "findMedicalGuide";
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @description 查询就医指南明细
|
||||
* @author dqzhang
|
||||
* @created 2021年11月9日 下午4:01:38
|
||||
*/
|
||||
@RequestMapping("/findMedicalGuideById")
|
||||
public Object findMedicalGuideById(String medical_guide_id) {
|
||||
|
||||
String url = IP_PORT + "findMedicalGuideById?medical_guide_id=" + medical_guide_id;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @description 查询健康百科
|
||||
* @author dqzhang
|
||||
* @created 2021年11月9日 下午4:01:38
|
||||
*/
|
||||
@RequestMapping("/findHospitalArticle")
|
||||
public Object findHospitalArticle(String hos_article_id) {
|
||||
|
||||
String url = IP_PORT + "findHospitalArticle?hos_article_id=" + hos_article_id;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @description 查询预约须知
|
||||
* @author dqzhang
|
||||
* @created 2021年11月9日 下午4:01:38
|
||||
*/
|
||||
@RequestMapping("/findOrderNotice")
|
||||
public Object findOrderNotice() {
|
||||
|
||||
String url = IP_PORT + "findOrderNotice";
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @description 获取消息通知
|
||||
* @author dqzhang
|
||||
* @created 2021年11月20日 下午8:23:43
|
||||
*/
|
||||
@RequestMapping("/findMessageNotice")
|
||||
public Object findMessageNotice(String openid) {
|
||||
|
||||
String url = IP_PORT + "findMessageNotice?openid=" + openid;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @description 获取消息通知
|
||||
* @author dqzhang
|
||||
* @created 2021年11月20日 下午8:23:43
|
||||
*/
|
||||
@RequestMapping("/findAllMessageNotice")
|
||||
public Object findAllMessageNotice(String openid) {
|
||||
|
||||
String url = IP_PORT + "findAllMessageNotice?openid=" + openid;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @description 获取消息通知
|
||||
* @author dqzhang
|
||||
* @created 2021年11月20日 下午8:23:43
|
||||
*/
|
||||
@RequestMapping("/setMessageNoticeRead")
|
||||
public Object setMessageNoticeRead(String id) {
|
||||
|
||||
String url = IP_PORT + "setMessageNoticeRead?id=" + id;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 问题反馈
|
||||
*/
|
||||
@RequestMapping("/problemFeedback")
|
||||
public Object problemFeedback(String type, String content, String phone, String email) throws Exception {
|
||||
|
||||
String url = IP_PORT + "problemFeedback?type=" + type + "&content=" + content + "&phone=" + phone + "&email=" + email;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------微信用户及患者信息------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @param code
|
||||
* @return
|
||||
* @description 获取微信openid
|
||||
* @author dqzhang
|
||||
* @created 2021年11月24日 上午10:00:55
|
||||
*/
|
||||
@RequestMapping("/getOpenid")
|
||||
public String getOpenid(String code) {
|
||||
|
||||
String url = IP_PORT + "getOpenid?code=" + code;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param openid
|
||||
* @return
|
||||
* @description 根据openid获取患者信息
|
||||
* @author dqzhang
|
||||
* @created 2021年11月11日 下午1:46:21
|
||||
*/
|
||||
@RequestMapping("/getPatientByOpenid")
|
||||
public String getPatientByOpenid(String openid) {
|
||||
|
||||
String url = IP_PORT + "getPatientByOpenid?openid=" + openid;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 微信用户和患者绑定
|
||||
*/
|
||||
@RequestMapping("/patientBindWXUser")
|
||||
public Object patientBindWXUser(String cardno, String hzxm, String cardtype, String openid, String relate) throws Exception {
|
||||
|
||||
String url = IP_PORT + "patientBindWXUser?cardno=" + cardno + "&hzxm=" + hzxm + "&cardtype=" + cardtype + "&openid=" + openid + "&relate=" + relate;
|
||||
;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 微信用户和患者解除绑定
|
||||
*/
|
||||
@RequestMapping("/patientUnbindWXUser")
|
||||
public Object patientUnbindWXUser(String medical_card, String openid) throws Exception {
|
||||
|
||||
String url = IP_PORT + "patientUnbindWXUser?medical_card=" + medical_card + "&openid=" + openid;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 修改患者关系
|
||||
*/
|
||||
@RequestMapping("/updatePatient")
|
||||
public Object updatePatient(String medical_card, String openid, String relate, String type) throws Exception {
|
||||
|
||||
String url = IP_PORT + "updatePatient?medical_card=" + medical_card + "&openid=" + openid + "&relate=" + relate + "&type=" + type;
|
||||
;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------银联商务支付信息-------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @description 获取银联商务支付信息
|
||||
* @author dqzhang
|
||||
* @created 2021年11月19日 下午5:31:26
|
||||
*/
|
||||
@RequestMapping("/getPayRequest")
|
||||
public Object getPayRequest(String openid, String totalAmount, String patid, String cardno, String cardtype) {
|
||||
|
||||
String url = IP_PORT + "getPayRequest?openid=" + openid + "&totalAmount=" + totalAmount + "&patid=" + patid + "&cardno=" + cardno + "&cardtype=" + cardtype;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @description 支付成功写入his接口
|
||||
* @author dqzhang
|
||||
* @created 2021年11月19日 下午5:31:26
|
||||
*/
|
||||
@RequestMapping("/addHisRecharge")
|
||||
public Object addhisRecharge(String merOrderId) {
|
||||
|
||||
String url = IP_PORT + "addHisRecharge?merOrderId=" + merOrderId;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者信息
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/his/getPatient")
|
||||
public String getPatient(String cardno, String cardtype, String hzxm) throws Exception {
|
||||
|
||||
String url = IP_PORT + "his/getPatient?cardno=" + cardno + "&cardtype=" + cardtype + "&hzxm=" + hzxm;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取科室信息
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/his/getOffice")
|
||||
public String getOffice(String ksrq, String jsrq, String lb) throws Exception {
|
||||
|
||||
String url = IP_PORT + "his/getOffice?ksrq=" + ksrq + "&jsrq=" + jsrq + "&lb=" + lb;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某些天科室排班信息
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/his/getOfficeSchedule")
|
||||
public String getOfficeSchedule(String ksrq, String jsrq, String lb, String kmdm) throws Exception {
|
||||
|
||||
String url = IP_PORT + "his/getOfficeSchedule?ksrq=" + ksrq + "&jsrq=" + jsrq + "&lb=" + lb + "&kmdm=" + kmdm;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预约登记
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/his/order")
|
||||
public String order(String patid, String pbmxid, String yyhx, String sjdjl, String ksmc, String ksdm, String jssj, String zxrq, String cardNo, String patientName) throws Exception {
|
||||
|
||||
String url = IP_PORT + "his/order?patid=" + patid + "&pbmxid=" + pbmxid + "&yyhx=" + yyhx + "&sjdjl=" + sjdjl + "&ksmc=" + ksmc + "&ksdm=" + ksdm + "&jssj=" + jssj + "&zxrq=" + zxrq + "&cardNo=" + cardNo + "&patientName=" + patientName;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消预约
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/his/cancelOrder")
|
||||
public String cancelOrder(String yylsh) throws Exception {
|
||||
|
||||
String url = IP_PORT + "his/cancelOrder?yylsh=" + yylsh;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某人预约登记信息
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/his/getOrder")
|
||||
public String getOrder(String patid) throws Exception {
|
||||
|
||||
String url = IP_PORT + "his/getOrder?patid=" + patid;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取某人检查报告
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/his/getInspectReport")
|
||||
public String getInspectReport(String cardno, String ksrq, String jsrq, String repno, String lb, String brlx, String bglx) throws Exception {
|
||||
|
||||
String url = IP_PORT + "his/getInspectReport?cardno=" + cardno + "&ksrq=" + ksrq + "&jsrq=" + jsrq + "&repno=" + repno + "&lb=" + lb + "&brlx=" + brlx + "&bglx=" + bglx;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某人充值记录
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/his/getRecharge")
|
||||
public String getRecharge(String cardno, String cardtype, String kssj, String jssj) throws Exception {
|
||||
|
||||
String url = IP_PORT + "his/getRecharge?cardno=" + cardno + "&cardtype=" + cardtype + "&kssj=" + kssj + "&jssj=" + jssj;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取某人缴费主信息
|
||||
*/
|
||||
@RequestMapping("/his/getPayList")
|
||||
public String getPayList(String patid, String ksrq, String jsrq) throws Exception {
|
||||
|
||||
String url = IP_PORT + "his/getPayList?patid=" + patid + "&ksrq=" + ksrq + "&jsrq=" + jsrq;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 获取缴费明细信息
|
||||
*/
|
||||
@RequestMapping("/his/getPayDetailList")
|
||||
public String getPayDetailList(String cxlb, String sjh) throws Exception {
|
||||
|
||||
String url = IP_PORT + "his/getPayDetailList?cxlb=" + cxlb + "&sjh=" + sjh;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 建档(患者基本信息登记)
|
||||
*/
|
||||
@RequestMapping("/his/addUser")
|
||||
public String addUser(String hzxm, String sfzh, String lxdh) throws Exception {
|
||||
|
||||
String url = IP_PORT + "his/addUser?hzxm=" + hzxm + "&sfzh=" + sfzh + "&lxdh=" + lxdh;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 查询历史就诊
|
||||
*/
|
||||
@RequestMapping("/hisViewSearch/getHistoricalVisits")
|
||||
public String getHistoricalVisits(String patientName, String idCard) throws Exception {
|
||||
|
||||
String url = IP_PORT + "hisViewSearch/getHistoricalVisits?patientName=" + patientName + "&idCard=" + idCard;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 导诊获取症状
|
||||
*/
|
||||
@RequestMapping("/IntelligentGuidance/getSymptom")
|
||||
public String getSymptom(String bodyAreaType) throws Exception {
|
||||
|
||||
String url = IP_PORT + "IntelligentGuidance/getSymptom?bodyAreaType=" + bodyAreaType;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 导诊获取问题
|
||||
*/
|
||||
@RequestMapping("/IntelligentGuidance/getQuestions")
|
||||
public String getQuestions(String childId) throws Exception {
|
||||
String url = IP_PORT + "IntelligentGuidance/getQuestions?childId=" + childId;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 导诊获取身体部位
|
||||
*/
|
||||
@RequestMapping("/IntelligentGuidance/getAllBodyArea")
|
||||
public String getAllBodyArea(String sex, String adultOrChild) throws Exception {
|
||||
String url = IP_PORT + "IntelligentGuidance/getAllBodyArea?sex=" + sex + "&adultOrChild=" + adultOrChild;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 排队叫号接口
|
||||
*/
|
||||
@RequestMapping("/callNumbers/getCallNumberByIdentity")
|
||||
public String getCallNumberByIdentity(String identity, String sfzh) throws Exception {
|
||||
String url = IP_PORT + "callNumbers/getCallNumberByIdentity?identity=" + identity + "&sfzh=" + sfzh;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置消息全部已读
|
||||
*/
|
||||
@RequestMapping("/setMessageNoticeAllRead")
|
||||
public String setMessageNoticeAllRead(String openid) throws Exception {
|
||||
String url = IP_PORT + "setMessageNoticeAllRead?openid=" + openid;
|
||||
return restTemplate.getForObject(url, String.class);
|
||||
}
|
||||
|
||||
@RequestMapping("/generatePayMessage")
|
||||
public Object findWxybPayResult(String type, String operateTime, String openId, String amount) {
|
||||
return restTemplate.getForObject(IP_PORT + "generatePayMessage?type=" + type + "&operateTime=" + operateTime + "&openId=" + openId + "&amount=" + amount, String.class);
|
||||
}
|
||||
|
||||
@RequestMapping("/hisViewSearch/getHisDeptList")
|
||||
public Object getHisDeptList() {
|
||||
return restTemplate.getForObject(IP_PORT + "hisViewSearch/getHisDeptList", String.class);
|
||||
}
|
||||
|
||||
@RequestMapping("/hisViewSearch/getHisDept")
|
||||
public Object getHisDept(String deptId) {
|
||||
return restTemplate.getForObject(IP_PORT + "/hisViewSearch/getHisDept?deptId=" + deptId, String.class);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/hisViewSearch/getHisDeptAdd")
|
||||
public Object getHisDept() {
|
||||
return restTemplate.getForObject(IP_PORT + "/hisViewSearch/getHisDeptAdd", String.class);
|
||||
}
|
||||
|
||||
@RequestMapping("/booking/getDoctorList")
|
||||
public Object getDoctorList(String selectDate, String selectKsdm) {
|
||||
return restTemplate.getForObject(IP_PORT + "/booking/getDoctorList?selectDate=" + selectDate + "&selectKsdm=" + selectKsdm, String.class);
|
||||
}
|
||||
|
||||
@RequestMapping("/booking/getDoctorScheduling")
|
||||
public Object getHisDept(String selectDate, String selectKmdm) {
|
||||
return restTemplate.getForObject(IP_PORT + "/booking/getDoctorScheduling?selectDate=" + selectDate + "&selectKmdm=" + selectKmdm, String.class);
|
||||
}
|
||||
|
||||
@RequestMapping("/his/getOneInHosMoney")
|
||||
public Object getOneInHosMoney(String selectDate, String patient) {
|
||||
return restTemplate.getForObject(IP_PORT + "/his/getOneInHosMoney?selectDate=" + selectDate + "&patient=" + patient, String.class);
|
||||
}
|
||||
|
||||
@RequestMapping("/his/getZyPatient")
|
||||
public Object getZyPatient(String cardno, String cardtype, String hzxm) {
|
||||
return restTemplate.getForObject(IP_PORT + "/his/getZyPatient?cardno=" + cardno + "&cardtype=" + cardtype + "&hzxm=" + hzxm, String.class);
|
||||
}
|
||||
|
||||
@RequestMapping("/countAutho/getAuther")
|
||||
public Object getAutho() {
|
||||
return restTemplate.getForObject(IP_PORT + "/countAutho/getAuther", String.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
121
src/main/java/com/saye/hrs/controller/ZFController.java
Normal file
121
src/main/java/com/saye/hrs/controller/ZFController.java
Normal file
@@ -0,0 +1,121 @@
|
||||
package com.saye.hrs.controller;
|
||||
|
||||
import com.saye.hrs.commons.IPUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
|
||||
/***
|
||||
* @title zfController
|
||||
* @description TODO 转发接口
|
||||
* @author thuang
|
||||
* @create 2023/8/14 15:51
|
||||
**/
|
||||
|
||||
@RestController
|
||||
public class ZFController {
|
||||
|
||||
//测试地址
|
||||
@Value("${IP_PORT}")
|
||||
private String IP_PORT;
|
||||
|
||||
//正式地址 这里这样写是应为测试的时候用到了部分正式获取数据,部分测试处理数据。
|
||||
// private static String IP_PORT = "http://110.153.1.138:8081/";
|
||||
|
||||
private static RestTemplate restTemplate = new RestTemplate();
|
||||
|
||||
@GetMapping("/FindPatientFeeSettled")
|
||||
public Object FindPatientFeeSettled(HttpServletRequest request,String patid,String ksrq,String jsrq){
|
||||
return restTemplate.getForEntity(IP_PORT+"/FindPatientFeeSettled"+"?patid="+patid+"&ksrq="+ksrq+"&jsrq="+jsrq,Object.class);
|
||||
}
|
||||
|
||||
@GetMapping("/FindPatientFeeInfo")
|
||||
public Object FindPatientFeeInfo(HttpServletRequest request,String patid){
|
||||
return restTemplate.getForEntity(IP_PORT+"/FindPatientFeeInfo"+"?patid="+patid,Object.class);
|
||||
}
|
||||
|
||||
@PostMapping("/PreSettlement")
|
||||
public Object PreSettlement(HttpServletRequest request, @RequestBody HashMap<Object,Object> map) throws Exception {
|
||||
return restTemplate.postForEntity(IP_PORT+"/PreSettlement",map,Object.class);
|
||||
}
|
||||
|
||||
@PostMapping("/Settlement")
|
||||
public Object Settlement(@RequestBody HashMap<Object,Object> map) throws Exception {
|
||||
return restTemplate.postForEntity(IP_PORT+"/Settlement",map,Object.class);
|
||||
}
|
||||
|
||||
@PostMapping("/CancelPreSettlement")
|
||||
public Object CancelPreSettlement(@RequestBody HashMap<Object,Object> map) throws Exception {
|
||||
return restTemplate.postForEntity(IP_PORT+"/CancelPreSettlement",map,Object.class);
|
||||
}
|
||||
|
||||
@PostMapping("/getPath")
|
||||
public Object getPath(@RequestBody HashMap<Object,Object> map) throws Exception {
|
||||
return restTemplate.postForEntity(IP_PORT+"/getPath",map,Object.class);
|
||||
}
|
||||
|
||||
@PostMapping("/getAuthNo")
|
||||
public Object getAuthNo(@RequestBody HashMap<Object,Object> map) throws Exception {
|
||||
return restTemplate.postForEntity(IP_PORT+"/getAuthNo",map,Object.class);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/api/wxpay/wxAppletPay")
|
||||
public Object wxAppletPay(@RequestBody HashMap<Object,Object> map){
|
||||
map.put("ip", IPUtil.getIp());
|
||||
return restTemplate.postForEntity(IP_PORT+"/api/wxpay/wxAppletPay",map,Object.class);
|
||||
}
|
||||
|
||||
@PostMapping("/api/wxpay/notify")
|
||||
public Object wxPayNotify(@RequestBody String xmlStr,HttpServletResponse response){
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
HttpEntity<String> entity = new HttpEntity<>(xmlStr, headers);
|
||||
return restTemplate.postForEntity(IP_PORT + "/api/wxpay/notify", entity, String.class);
|
||||
}
|
||||
|
||||
@PostMapping("/api/wxpay/findWxPayResult")
|
||||
public Object findWxPayResult(@RequestBody HashMap<Object,Object> map){
|
||||
return restTemplate.postForEntity(IP_PORT+"/api/wxpay/findWxPayResult",map,Object.class);
|
||||
}
|
||||
|
||||
@PostMapping("/api/wxybpay/ybAppletPay")
|
||||
public Object ybAppletPay(@RequestBody HashMap<Object,Object> map){
|
||||
map.put("ip", IPUtil.getIp());
|
||||
return restTemplate.postForEntity(IP_PORT+"/api/wxybpay/ybAppletPay",map,Object.class);
|
||||
}
|
||||
|
||||
@PostMapping("/api/wxybpay/notify")
|
||||
public Object wxybPayNotify(@RequestBody String xmlStr,HttpServletResponse response){
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
HttpEntity<String> entity = new HttpEntity<>(xmlStr, headers);
|
||||
|
||||
return restTemplate.postForEntity(IP_PORT + "/api/wxybpay/notify", entity, String.class);
|
||||
}
|
||||
|
||||
@PostMapping("/api/wxybpay/findWxybPayResult")
|
||||
public Object findWxybPayResult(@RequestBody HashMap<Object,Object> map){
|
||||
return restTemplate.postForEntity(IP_PORT+"/api/wxybpay/findWxybPayResult",map,Object.class);
|
||||
}
|
||||
|
||||
@GetMapping("/getUnPayInfo")
|
||||
public Object getUnPayInfo(HttpServletRequest request,String patid){
|
||||
return restTemplate.getForEntity(IP_PORT+"/getUnPayInfo"+"?patid="+patid,Object.class);
|
||||
}
|
||||
}
|
||||
39
src/main/resources/META-INF/MANIFEST.MF
Normal file
39
src/main/resources/META-INF/MANIFEST.MF
Normal file
@@ -0,0 +1,39 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: com.saye.hrs.HrsApplication
|
||||
Class-Path: jackson-databind-2.12.4.jar classmate-1.5.1.jar encoder-1.2.
|
||||
2.jar jackson-module-parameter-names-2.12.4.jar jackson-annotations-2.1
|
||||
2.4.jar jackson-datatype-jsr310-2.12.4.jar logback-classic-1.2.5.jar xm
|
||||
l-apis-1.4.01.jar spring-boot-starter-json-2.5.4.jar spring-web-5.3.9.j
|
||||
ar spring-aop-5.3.9.jar spring-boot-starter-web-2.5.4.jar spring-expres
|
||||
sion-5.3.9.jar nekohtml-1.9.21.jar commons-collections-3.2.2.jar dom4j-
|
||||
1.6.1.jar jackson-core-2.12.4.jar shiro-config-ogdl-1.6.0.jar spring-tx
|
||||
-5.3.9.jar jakarta.annotation-api-1.3.5.jar spring-beans-5.3.9.jar logb
|
||||
ack-core-1.2.5.jar spring-context-5.3.9.jar json-20160810.jar commons-i
|
||||
o-2.2.jar commons-beanutils-1.9.4.jar thymeleaf-extras-java8time-3.0.4.
|
||||
RELEASE.jar shiro-crypto-cipher-1.6.0.jar attoparser-2.0.5.RELEASE.jar
|
||||
springfox-core-2.6.1.jar shiro-crypto-hash-1.6.0.jar lombok-1.18.20.jar
|
||||
poi-3.14.jar jul-to-slf4j-1.7.32.jar mapstruct-1.0.0.Final.jar spring-
|
||||
boot-starter-thymeleaf-2.5.4.jar shiro-core-1.6.0.jar slf4j-api-1.7.32.
|
||||
jar springfox-swagger-ui-2.6.1.jar jsqlparser-0.9.5.jar commons-codec-1
|
||||
.9.jar pagehelper-5.0.0.jar spring-boot-starter-logging-2.5.4.jar snake
|
||||
yaml-1.28.jar shiro-config-core-1.6.0.jar springfox-swagger-common-2.6.
|
||||
1.jar shiro-spring-1.6.0.jar spring-boot-2.5.4.jar mybatis-spring-boot-
|
||||
starter-2.2.0.jar mybatis-spring-boot-autoconfigure-2.2.0.jar javax.ser
|
||||
vlet-api-4.0.1.jar spring-plugin-metadata-1.2.0.RELEASE.jar fastjson-1.
|
||||
2.73.jar spring-jcl-5.3.9.jar swagger-models-1.5.10.jar spring-core-5.3
|
||||
.9.jar jsoup-1.13.1.jar stax-api-1.0.1.jar springfox-spi-2.6.1.jar swag
|
||||
ger-annotations-1.5.10.jar curvesapi-1.03.jar xmlbeans-2.6.0.jar spring
|
||||
-boot-starter-jdbc-2.5.4.jar spring-webmvc-5.3.9.jar thymeleaf-3.0.12.R
|
||||
ELEASE.jar poi-ooxml-3.14.jar jackson-datatype-jdk8-2.12.4.jar spring-p
|
||||
lugin-core-1.2.0.RELEASE.jar pagehelper-spring-boot-starter-1.2.3.jar x
|
||||
ercesImpl-2.10.0.jar shiro-event-1.6.0.jar mysql-connector-java-8.0.26.
|
||||
jar shiro-web-1.6.0.jar thymeleaf-spring5-3.0.12.RELEASE.jar spring-boo
|
||||
t-devtools-2.5.4.jar log4j-api-2.14.1.jar mybatis-3.5.7.jar springfox-s
|
||||
pring-web-2.6.1.jar unbescape-1.1.6.RELEASE.jar spring-jdbc-5.3.9.jar g
|
||||
uava-18.0.jar jaxen-1.1.6.jar log4j-to-slf4j-2.14.1.jar ueditor-1.4.3.3
|
||||
.jar commons-fileupload-1.3.2.jar HikariCP-4.0.3.jar spring-boot-starte
|
||||
r-2.5.4.jar springfox-swagger2-2.6.1.jar shiro-lang-1.6.0.jar springfox
|
||||
-schema-2.6.1.jar pagehelper-spring-boot-autoconfigure-1.2.3.jar spring
|
||||
-boot-autoconfigure-2.5.4.jar mybatis-spring-2.0.6.jar shiro-cache-1.6.
|
||||
0.jar poi-ooxml-schemas-3.14.jar shiro-crypto-core-1.6.0.jar
|
||||
|
||||
21
src/main/resources/application-dev.yml
Normal file
21
src/main/resources/application-dev.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
#
|
||||
server:
|
||||
port: 8085
|
||||
|
||||
#日志
|
||||
logging:
|
||||
level:
|
||||
com.saye: debug
|
||||
pattern:
|
||||
console: "%d{yyyy/MM/dd-HH:mm:ss} [%thread] %-5level %logger- %msg%n"
|
||||
file:
|
||||
path: /home/tomcat8/hrsmiddle.log
|
||||
|
||||
IP_PORT: http://192.168.0.197:8083/
|
||||
|
||||
|
||||
|
||||
file:
|
||||
staticAccessPath: /storage/**
|
||||
# uploadFolder: /home/fy-docPic/
|
||||
uploadFolder: D:\test
|
||||
19
src/main/resources/application-prod.yml
Normal file
19
src/main/resources/application-prod.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
server:
|
||||
port: 8085
|
||||
|
||||
#日志
|
||||
logging:
|
||||
level:
|
||||
com.saye: debug
|
||||
pattern:
|
||||
console: "%d{yyyy/MM/dd-HH:mm:ss} [%thread] %-5level %logger- %msg%n"
|
||||
file:
|
||||
path: /home/tomcat8/hrsmiddle.log
|
||||
|
||||
IP_PORT: http://110.153.1.138:8081/
|
||||
|
||||
#file:
|
||||
# staticAccessPath: /storage/**
|
||||
# # uploadFolder: /home/fy-docPic/
|
||||
# uploadFolder: D:\\test\\
|
||||
3
src/main/resources/application.yml
Normal file
3
src/main/resources/application.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: prod
|
||||
Reference in New Issue
Block a user