Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
notes2.0
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zjm
notes2.0
Commits
41b39e0d
提交
41b39e0d
authored
5月 18, 2020
作者:
gongwenjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
通知
上级
f603f0e9
隐藏空白字符变更
内嵌
并排
正在显示
48 个修改的文件
包含
2013 行增加
和
156 行删除
+2013
-156
.gitignore
notes-address/.gitignore
+31
-0
MavenWrapperDownloader.java
notes-address/.mvn/wrapper/MavenWrapperDownloader.java
+118
-0
maven-wrapper.jar
notes-address/.mvn/wrapper/maven-wrapper.jar
+0
-0
maven-wrapper.properties
notes-address/.mvn/wrapper/maven-wrapper.properties
+2
-0
mvnw
notes-address/mvnw
+310
-0
mvnw.cmd
notes-address/mvnw.cmd
+182
-0
pom.xml
notes-address/pom.xml
+83
-0
NotesAddressApplication.java
...ava/com/zjty/tynotes/address/NotesAddressApplication.java
+23
-0
NoticeController.java
...y/tynotes/address/server/controller/NoticeController.java
+88
-0
NoticeDao.java
...n/java/com/zjty/tynotes/address/server/dao/NoticeDao.java
+19
-0
Notice.java
...n/java/com/zjty/tynotes/address/server/entity/Notice.java
+69
-0
NoticeService.java
...om/zjty/tynotes/address/server/service/NoticeService.java
+79
-0
NoticeServiceImpl.java
...ynotes/address/server/service/impl/NoticeServiceImpl.java
+443
-0
application.properties
notes-address/src/main/resources/application.properties
+1
-0
NotesAddressApplicationTests.java
...om/zjty/tynotes/address/NotesAddressApplicationTests.java
+11
-0
DingTestController.java
...jty/tynotes/attendance/controller/DingTestController.java
+29
-4
CardAlarmDao.java
...in/java/com/zjty/tynotes/attendance/dao/CardAlarmDao.java
+11
-0
CardAlarm.java
...in/java/com/zjty/tynotes/attendance/entity/CardAlarm.java
+31
-0
ApprovalInformationServiceImpl.java
...tendance/service/impl/ApprovalInformationServiceImpl.java
+1
-1
AttendanceDetailsServiceImpl.java
...attendance/service/impl/AttendanceDetailsServiceImpl.java
+70
-8
CardTask.java
.../main/java/com/zjty/tynotes/attendance/task/CardTask.java
+35
-54
MyInit.java
...rc/main/java/com/zjty/tynotes/attendance/task/MyInit.java
+3
-1
pom.xml
notes-job/pom.xml
+11
-0
JobApplication.java
...ob/src/main/java/com/zjty/tynotes/job/JobApplication.java
+2
-1
WorkServiceImpl.java
.../zjty/tynotes/job/basic/service/impl/WorkServiceImpl.java
+40
-4
NotesLogApplication.java
...c/main/java/com/zjty/tynotes/log/NotesLogApplication.java
+5
-5
ExcelController.java
...java/com/zjty/tynotes/pas/controller/ExcelController.java
+89
-13
TestController.java
.../java/com/zjty/tynotes/pas/controller/TestController.java
+32
-8
DepartmentDao.java
...src/main/java/com/zjty/tynotes/pas/dao/DepartmentDao.java
+2
-1
PasUserDao.java
...as/src/main/java/com/zjty/tynotes/pas/dao/PasUserDao.java
+2
-0
RoleDao.java
...s-pas/src/main/java/com/zjty/tynotes/pas/dao/RoleDao.java
+2
-0
Address.java
...as/src/main/java/com/zjty/tynotes/pas/entity/Address.java
+54
-0
Role.java
...s-pas/src/main/java/com/zjty/tynotes/pas/entity/Role.java
+1
-1
User.java
...s-pas/src/main/java/com/zjty/tynotes/pas/entity/User.java
+15
-1
ImportUserExcel.java
.../java/com/zjty/tynotes/pas/entity/vo/ImportUserExcel.java
+0
-31
DepartmentServiceImpl.java
.../zjty/tynotes/pas/service/impl/DepartmentServiceImpl.java
+1
-1
Init.java
notes-pas/src/main/java/com/zjty/tynotes/pas/task/Init.java
+6
-0
MessageTemplateService.java
.../com/zjty/tynotes/sms/service/MessageTemplateService.java
+5
-0
MessageTemplateServiceImpl.java
.../tynotes/sms/service/impl/MessageTemplateServiceImpl.java
+5
-0
pom.xml
notes-union/pom.xml
+5
-0
UnionApplication.java
...rc/main/java/com/zjty/tynotes/union/UnionApplication.java
+2
-1
application.properties
notes-union/src/main/resources/application.properties
+11
-10
WeeklyApplication.java
.../main/java/com/zjty/tynotes/weekly/WeeklyApplication.java
+1
-0
UserManageController.java
...notes/weekly/subject/controller/UserManageController.java
+10
-5
AddressRequest.java
...zjty/tynotes/weekly/subject/entity/vo/AddressRequest.java
+24
-0
UserManageService.java
...jty/tynotes/weekly/subject/service/UserManageService.java
+5
-1
UserManageServiceImpl.java
...es/weekly/subject/service/impl/UserManageServiceImpl.java
+37
-5
pom.xml
pom.xml
+7
-0
没有找到文件。
notes-address/.gitignore
0 → 100644
浏览文件 @
41b39e0d
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
notes-address/.mvn/wrapper/MavenWrapperDownloader.java
0 → 100644
浏览文件 @
41b39e0d
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
java.net.*
;
import
java.io.*
;
import
java.nio.channels.*
;
import
java.util.Properties
;
public
class
MavenWrapperDownloader
{
private
static
final
String
WRAPPER_VERSION
=
"0.5.6"
;
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private
static
final
String
DEFAULT_DOWNLOAD_URL
=
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+
WRAPPER_VERSION
+
"/maven-wrapper-"
+
WRAPPER_VERSION
+
".jar"
;
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private
static
final
String
MAVEN_WRAPPER_PROPERTIES_PATH
=
".mvn/wrapper/maven-wrapper.properties"
;
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private
static
final
String
MAVEN_WRAPPER_JAR_PATH
=
".mvn/wrapper/maven-wrapper.jar"
;
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private
static
final
String
PROPERTY_NAME_WRAPPER_URL
=
"wrapperUrl"
;
public
static
void
main
(
String
args
[])
{
System
.
out
.
println
(
"- Downloader started"
);
File
baseDirectory
=
new
File
(
args
[
0
]);
System
.
out
.
println
(
"- Using base directory: "
+
baseDirectory
.
getAbsolutePath
());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File
mavenWrapperPropertyFile
=
new
File
(
baseDirectory
,
MAVEN_WRAPPER_PROPERTIES_PATH
);
String
url
=
DEFAULT_DOWNLOAD_URL
;
if
(
mavenWrapperPropertyFile
.
exists
())
{
FileInputStream
mavenWrapperPropertyFileInputStream
=
null
;
try
{
mavenWrapperPropertyFileInputStream
=
new
FileInputStream
(
mavenWrapperPropertyFile
);
Properties
mavenWrapperProperties
=
new
Properties
();
mavenWrapperProperties
.
load
(
mavenWrapperPropertyFileInputStream
);
url
=
mavenWrapperProperties
.
getProperty
(
PROPERTY_NAME_WRAPPER_URL
,
url
);
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"- ERROR loading '"
+
MAVEN_WRAPPER_PROPERTIES_PATH
+
"'"
);
}
finally
{
try
{
if
(
mavenWrapperPropertyFileInputStream
!=
null
)
{
mavenWrapperPropertyFileInputStream
.
close
();
}
}
catch
(
IOException
e
)
{
// Ignore ...
}
}
}
System
.
out
.
println
(
"- Downloading from: "
+
url
);
File
outputFile
=
new
File
(
baseDirectory
.
getAbsolutePath
(),
MAVEN_WRAPPER_JAR_PATH
);
if
(!
outputFile
.
getParentFile
().
exists
())
{
if
(!
outputFile
.
getParentFile
().
mkdirs
())
{
System
.
out
.
println
(
"- ERROR creating output directory '"
+
outputFile
.
getParentFile
().
getAbsolutePath
()
+
"'"
);
}
}
System
.
out
.
println
(
"- Downloading to: "
+
outputFile
.
getAbsolutePath
());
try
{
downloadFileFromURL
(
url
,
outputFile
);
System
.
out
.
println
(
"Done"
);
System
.
exit
(
0
);
}
catch
(
Throwable
e
)
{
System
.
out
.
println
(
"- Error downloading"
);
e
.
printStackTrace
();
System
.
exit
(
1
);
}
}
private
static
void
downloadFileFromURL
(
String
urlString
,
File
destination
)
throws
Exception
{
if
(
System
.
getenv
(
"MVNW_USERNAME"
)
!=
null
&&
System
.
getenv
(
"MVNW_PASSWORD"
)
!=
null
)
{
String
username
=
System
.
getenv
(
"MVNW_USERNAME"
);
char
[]
password
=
System
.
getenv
(
"MVNW_PASSWORD"
).
toCharArray
();
Authenticator
.
setDefault
(
new
Authenticator
()
{
@Override
protected
PasswordAuthentication
getPasswordAuthentication
()
{
return
new
PasswordAuthentication
(
username
,
password
);
}
});
}
URL
website
=
new
URL
(
urlString
);
ReadableByteChannel
rbc
;
rbc
=
Channels
.
newChannel
(
website
.
openStream
());
FileOutputStream
fos
=
new
FileOutputStream
(
destination
);
fos
.
getChannel
().
transferFrom
(
rbc
,
0
,
Long
.
MAX_VALUE
);
fos
.
close
();
rbc
.
close
();
}
}
notes-address/.mvn/wrapper/maven-wrapper.jar
0 → 100644
浏览文件 @
41b39e0d
File added
notes-address/.mvn/wrapper/maven-wrapper.properties
0 → 100644
浏览文件 @
41b39e0d
distributionUrl
=
https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl
=
https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
notes-address/mvnw
0 → 100644
浏览文件 @
41b39e0d
#!/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
"
$@
"
notes-address/mvnw.cmd
0 → 100644
浏览文件 @
41b39e0d
@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%
notes-address/pom.xml
0 → 100644
浏览文件 @
41b39e0d
<?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"
>
<parent>
<artifactId>
tynotes
</artifactId>
<groupId>
com.zjty.tynotes
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
notes-address
</artifactId>
<properties>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<dependency>
<groupId>
com.zjty.tynotes
</groupId>
<artifactId>
notes-redis
</artifactId>
</dependency>
<dependency>
<groupId>
com.zjty.tynotes
</groupId>
<artifactId>
notes-misc
</artifactId>
</dependency>
<dependency>
<groupId>
com.zjty.tynotes
</groupId>
<artifactId>
notes-search
</artifactId>
</dependency>
<dependency>
<groupId>
com.zjty.tynotes
</groupId>
<artifactId>
notes-sms
</artifactId>
<exclusions>
<exclusion>
<groupId>
com.zjty.tynotes
</groupId>
<artifactId>
notes-address
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.zjty.tynotes
</groupId>
<artifactId>
notes-pas
</artifactId>
<exclusions>
<exclusion>
<groupId>
com.zjty.tynotes
</groupId>
<artifactId>
notes-address
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
<exclusions>
<exclusion>
<groupId>
org.junit.vintage
</groupId>
<artifactId>
junit-vintage-engine
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
notes-address/src/main/java/com/zjty/tynotes/address/NotesAddressApplication.java
0 → 100644
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
address
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cache.annotation.EnableCaching
;
@SpringBootApplication
(
scanBasePackages
=
{
"com.zjty.tynotes.redis"
,
"com.zjty.tynotes.misc"
,
"com.zjty.tynotes.search"
,
"com.zjty.tynotes.sms"
,
"com.zjty.tynotes.address"
,
"com.zjty.tynotes.pas"
}
)
@EnableCaching
public
class
NotesAddressApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
NotesAddressApplication
.
class
,
args
);
}
}
notes-address/src/main/java/com/zjty/tynotes/address/server/controller/NoticeController.java
0 → 100644
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
address
.
server
.
controller
;
import
com.zjty.tynotes.address.server.entity.Notice
;
import
com.zjty.tynotes.address.server.service.NoticeService
;
import
com.zjty.tynotes.misc.config.AutoDocument
;
import
com.zjty.tynotes.pas.entity.Department
;
import
com.zjty.tynotes.pas.entity.User
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
static
org
.
springframework
.
http
.
ResponseEntity
.
ok
;
/**
* @Author gwj
* @create 2020/5/13 14:30
*/
@Api
(
tags
=
"通知模块"
,
protocols
=
"http"
)
@RestController
@RequestMapping
(
"/notice/manage"
)
@AutoDocument
public
class
NoticeController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
NoticeController
.
class
);
@Autowired
private
NoticeService
noticeService
;
@ApiOperation
(
value
=
"根据人的id查找所有相同部门"
)
@GetMapping
(
"/findUserByLevel/{id}"
)
public
ResponseEntity
findUserByLevel
(
@PathVariable
String
id
)
{
List
<
Department
>
departments
=
noticeService
.
findDepart
(
id
);
if
(
departments
!=
null
){
return
ok
(
departments
);
}
return
ok
(
"根据部门等级查找所有部门"
);
}
@ApiOperation
(
value
=
"回应通知"
)
@PostMapping
(
"/replyNotice"
)
public
ResponseEntity
replyNotice
(
@RequestBody
Notice
notice
)
{
Notice
notice1
=
noticeService
.
replyNotice
(
notice
);
if
(
notice1
!=
null
){
return
ok
(
notice1
);
}
return
ok
(
"回应通知失败"
);
}
@ApiOperation
(
value
=
"获取某部门下的所有人员"
)
@GetMapping
(
"/findUnderUser/{departId}"
)
public
ResponseEntity
findUnderUser
(
@PathVariable
String
departId
)
{
List
<
User
>
userList
=
noticeService
.
findUnderUser
(
departId
);
if
(
userList
!=
null
){
return
ok
(
userList
);
}
return
ok
(
"回应通知失败"
);
}
@ApiOperation
(
value
=
"查询所有我未处理的通知"
)
@GetMapping
(
"/findNotReadNotice/{id}"
)
public
ResponseEntity
findNotReadNotice
(
@PathVariable
String
id
)
{
try
{
List
<
Notice
>
notReadNotice
=
noticeService
.
findNotReadNotice
(
id
);
return
ok
(
notReadNotice
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ok
(
"查询所有我未处理的通知失败"
);
}
@ApiOperation
(
value
=
"查询所有我请求的通知"
)
@GetMapping
(
"/findReadNotice/{id}"
)
public
ResponseEntity
findReadNotice
(
@PathVariable
String
id
)
{
try
{
List
<
Notice
>
notices
=
noticeService
.
findReadNotice
(
id
);
return
ok
(
notices
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ok
(
"查询所有我请求的通知失败"
);
}
}
notes-address/src/main/java/com/zjty/tynotes/address/server/dao/NoticeDao.java
0 → 100644
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
address
.
server
.
dao
;
import
com.zjty.tynotes.address.server.entity.Notice
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
java.util.List
;
/**
* @Author gwj
* @create 2020/5/13 15:36
*/
public
interface
NoticeDao
extends
MongoRepository
<
Notice
,
String
>
{
List
<
Notice
>
findAllByResponseIdAndIsRead
(
String
responseId
,
String
isRead
);
List
<
Notice
>
findAllByApplyIdAndIsRead
(
String
applyId
,
String
isRead
);
List
<
Notice
>
findAllByApplyId
(
String
applyId
);
}
notes-address/src/main/java/com/zjty/tynotes/address/server/entity/Notice.java
0 → 100644
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
address
.
server
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.util.Date
;
import
java.util.List
;
/**
* @Author gwj
* @create 2020/5/13 15:18
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"通知信息"
,
description
=
"通知信息"
)
@Document
(
collection
=
"work_notice"
)
public
class
Notice
{
@Id
@ApiModelProperty
(
value
=
"通知信息id"
,
example
=
"123qdsdd212"
)
private
String
id
;
@ApiModelProperty
(
value
=
"通知绑定的任务id"
,
example
=
"123qdsdd212"
)
private
String
workId
;
@ApiModelProperty
(
value
=
"通知绑定的任务名称"
,
example
=
"123qdsdd212"
)
private
String
workName
;
@ApiModelProperty
(
value
=
"请求人的id"
,
example
=
"123qdsdd212"
)
private
String
applyId
;
@ApiModelProperty
(
value
=
"请求人的名字"
,
example
=
"123qdsdd212"
)
private
String
applyName
;
@ApiModelProperty
(
value
=
"反馈人的id"
,
example
=
"123qdsdd212"
)
private
String
responseId
;
@ApiModelProperty
(
value
=
"反馈人的名字"
,
example
=
"123qdsdd212"
)
private
String
responseName
;
@ApiModelProperty
(
value
=
"通知是否同意0同意1拒绝"
,
example
=
"0"
)
private
String
isAgree
;
@ApiModelProperty
(
value
=
"若拒绝,填写拒绝原因"
,
example
=
"正有其他任务"
)
private
String
reason
;
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"123qdsdd212"
)
private
String
departId
;
@ApiModelProperty
(
value
=
"通知是否已读,0未读1已读"
,
example
=
"0"
)
private
String
isRead
;
@ApiModelProperty
(
value
=
"描述"
,
example
=
"0"
)
private
String
des
;
@ApiModelProperty
(
value
=
"所借人的id"
,
example
=
"0"
)
private
String
borrowUserId
;
@ApiModelProperty
(
value
=
"描述"
,
example
=
"0"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
}
notes-address/src/main/java/com/zjty/tynotes/address/server/service/NoticeService.java
0 → 100644
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
address
.
server
.
service
;
import
com.zjty.tynotes.address.server.entity.Notice
;
import
com.zjty.tynotes.pas.entity.Department
;
import
com.zjty.tynotes.pas.entity.User
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Author gwj
* @create 2020/5/13 14:40
*/
public
interface
NoticeService
{
/**
* 查询同级别人员
* @param level
* @return
*/
List
<
User
>
findUser
(
String
level
);
/**
* 提交通知
* @return
*/
List
<
Notice
>
submitNotice
(
String
publishId
,
Map
<
String
,
List
<
String
>>
map
,
String
workId
,
String
workName
);
/**
* 回应通知
* @param notice
* @return
*/
Notice
replyNotice
(
Notice
notice
);
/**
* 获取某部门下的所有用户(包括同级)
* @return
*/
List
<
User
>
findUnderUser
(
String
departId
);
/**
* 查询所有未读通知
*/
List
<
Notice
>
findNotReadNotice
(
String
id
);
/**
* 查询所有通知
* @param id
* @return
*/
List
<
Notice
>
findReadNotice
(
String
id
);
/**
* 查看发布者下的所有人员id集合
*/
List
<
String
>
findUserIdList
(
String
userId
);
/**
* 查找发布者的部门等级
* @param publisher
* @return
*/
String
findDepartLevel
(
String
publisher
);
/**
* 查询同级别部门
* @param level
* @return
*/
List
<
Department
>
findDepart
(
String
level
);
/**
* 查找所借人的id集合
* @param users
* @param otherIds
* @return
*/
Map
<
String
,
List
<
String
>>
findLeadUser
(
List
<
User
>
users
,
List
<
String
>
otherIds
,
String
level
);
}
notes-address/src/main/java/com/zjty/tynotes/address/server/service/impl/NoticeServiceImpl.java
0 → 100644
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
address
.
server
.
service
.
impl
;
import
com.zjty.tynotes.address.server.dao.NoticeDao
;
import
com.zjty.tynotes.address.server.entity.Notice
;
import
com.zjty.tynotes.address.server.service.NoticeService
;
import
com.zjty.tynotes.pas.dao.*
;
import
com.zjty.tynotes.pas.entity.*
;
import
com.zjty.tynotes.sms.service.MessageTemplateService
;
import
com.zjty.tynotes.sms.utils.JacksonUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.validation.constraints.NotEmpty
;
import
java.util.*
;
/**
* @Author gwj
* @create 2020/5/13 14:40
*/
@Service
public
class
NoticeServiceImpl
implements
NoticeService
{
@Autowired
private
PasUserDao
pasUserDao
;
@Autowired
private
DepartmentDao
departmentDao
;
@Autowired
private
RoleDao
roleDao
;
@Autowired
private
UserRoleDao
userRoleDao
;
@Autowired
private
RoleAuthorityDao
roleAuthorityDao
;
@Autowired
private
AuthorityDao
authorityDao
;
@Autowired
private
NoticeDao
noticeDao
;
@Autowired
private
MessageTemplateService
messageTemplateService
;
/**
* 查询同级别人员
* @param level
* @return
*/
@Override
public
List
<
User
>
findUser
(
String
level
)
{
List
<
Department
>
departments
=
departmentDao
.
findAllByLevel
(
level
);
List
<
String
>
departIds
=
new
ArrayList
<>();
List
<
String
>
roleIds
=
new
ArrayList
<>();
List
<
String
>
userIds
=
new
ArrayList
<>();
if
(
departments
!=
null
){
departments
.
forEach
(
department
->
{
departIds
.
add
(
department
.
getId
());
});
}
List
<
Role
>
roles
=
roleDao
.
findAllByDepartmentIdInAndIsLeader
(
departIds
,
"0"
);
if
(
roles
!=
null
){
roles
.
forEach
(
role
->
{
roleIds
.
add
(
role
.
getId
());
});
}
List
<
UserRole
>
userRoles
=
userRoleDao
.
findAllByRoleIdIn
(
roleIds
);
if
(
userRoles
!=
null
){
userRoles
.
forEach
(
userRole
->
{
if
(!
userIds
.
contains
(
userRole
.
getUserId
())){
userIds
.
add
(
userRole
.
getUserId
());
}
});
}
List
<
User
>
users
=
pasUserDao
.
findAllByIdIn
(
userIds
);
for
(
User
user:
users
)
{
System
.
out
.
println
(
"leader:"
+
user
.
getUsername
());
}
return
users
;
}
@Override
public
List
<
Department
>
findDepart
(
String
id
)
{
String
departLevel
=
findDepartLevel
(
id
);
List
<
Department
>
departments
=
departmentDao
.
findAllByLevel
(
departLevel
);
return
departments
;
}
/**
* 查找需要通知人的id集合
* @param users 相同等级的用户
* @param otherIds 需要借的人的id集合
* @return
*/
@Override
public
Map
<
String
,
List
<
String
>>
findLeadUser
(
List
<
User
>
users
,
List
<
String
>
otherIds
,
String
level
)
{
Map
<
String
,
List
<
String
>>
map
=
new
HashMap
<>();
if
(
otherIds
!=
null
){
otherIds
.
forEach
(
s
->
{
if
(
users
!=
null
){
for
(
User
user
:
users
)
{
String
id
=
user
.
getId
();
List
<
String
>
userIdList
=
findUserIdList
(
id
,
level
);
if
(
userIdList
.
contains
(
s
)){
System
.
out
.
println
(
userIdList
);
if
(
map
.
containsKey
(
user
.
getId
())){
List
<
String
>
strings
=
map
.
get
(
user
.
getId
());
if
(
strings
!=
null
){
strings
.
add
(
s
);
map
.
put
(
user
.
getId
(),
strings
);
break
;
}
}
else
{
List
<
String
>
idList
=
new
ArrayList
<>();
idList
.
add
(
s
);
map
.
put
(
user
.
getId
(),
idList
);
break
;
}
}
}
}
});
}
return
map
;
}
/**
* 提交通知
* @return
*/
@Override
public
List
<
Notice
>
submitNotice
(
String
publishId
,
Map
<
String
,
List
<
String
>>
map
,
String
workId
,
String
workName
)
{
List
<
Notice
>
notices
=
new
ArrayList
<>();
if
(
map
!=
null
){
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry
:
map
.
entrySet
())
{
String
applyName
=
null
;
String
responseName
=
null
;
Optional
<
User
>
op
=
pasUserDao
.
findById
(
publishId
);
Optional
<
User
>
optional
=
pasUserDao
.
findById
(
entry
.
getKey
());
if
(
optional
.
isPresent
()){
responseName
=
optional
.
get
().
getUsername
();
}
if
(
op
.
isPresent
()){
applyName
=
op
.
get
().
getUsername
();
}
List
<
String
>
value
=
entry
.
getValue
();
if
(
value
!=
null
){
for
(
String
s
:
value
)
{
Notice
notice
=
new
Notice
();
notice
.
setUpdateTime
(
new
Date
());
notice
.
setWorkId
(
workId
);
notice
.
setWorkName
(
workName
);
notice
.
setApplyId
(
publishId
);
notice
.
setApplyName
(
applyName
);
notice
.
setResponseId
(
entry
.
getKey
());
notice
.
setResponseName
(
responseName
);
notice
.
setDes
(
"因为"
+
workName
+
"向"
+
responseName
+
"借人员一用"
);
notice
.
setBorrowUserId
(
s
);
notice
.
setIsRead
(
"0"
);
notices
.
add
(
notice
);
}
}
}
}
List
<
Notice
>
noticeList
=
noticeDao
.
saveAll
(
notices
);
return
noticeList
;
}
/**
* 回应通知
* @param notice
* @return
*/
@Override
public
Notice
replyNotice
(
Notice
notice
)
{
notice
.
setUpdateTime
(
new
Date
());
notice
.
setIsRead
(
"1"
);
return
noticeDao
.
save
(
notice
);
}
/**
* 获取某部门下的所有用户(包括同级)
* @return
*/
@Override
public
List
<
User
>
findUnderUser
(
String
departId
)
{
List
<
User
>
userList
=
new
ArrayList
<>();
List
<
String
>
departIds
=
new
ArrayList
<>();
departIds
=
getDepartIds
(
departIds
,
departId
);
if
(
departIds
!=
null
){
departIds
.
forEach
(
s
->
{
List
<
User
>
users
=
pasUserDao
.
findAllByDepartmentIdsContains
(
s
);
if
(
users
!=
null
){
users
.
forEach
(
user
->
{
if
(!
userList
.
contains
(
user
)){
userList
.
add
(
user
);
}
});
}
});
}
return
userList
;
}
/**
* 查询所有未读通知
*/
@Override
public
List
<
Notice
>
findNotReadNotice
(
String
id
)
{
List
<
Notice
>
notices
=
noticeDao
.
findAllByResponseIdAndIsRead
(
id
,
"0"
);
return
notices
;
// messageTemplateService.noticePushed(id, JacksonUtil.toJSon(notices));
}
/**
* 查询所有我请求的通知
* @param id
* @return
*/
@Override
public
List
<
Notice
>
findReadNotice
(
String
id
)
{
return
noticeDao
.
findAllByApplyId
(
id
);
}
/**
* 递归获得某个部门下的所有部门id集合
* @param ids
* @param departId
* @return
*/
public
List
<
String
>
getDepartIds
(
List
<
String
>
ids
,
String
departId
){
ids
.
add
(
departId
);
List
<
Department
>
departments
=
departmentDao
.
findAllByParentId
(
departId
);
if
(
departments
!=
null
){
departments
.
forEach
(
department
->
{
getDepartIds
(
ids
,
department
.
getId
());
});
}
return
ids
;
}
/**
* 查看发布者下的所有人员id集合
*/
@Override
public
List
<
String
>
findUserIdList
(
String
userId
){
List
<
String
>
userIds
=
new
ArrayList
<>();
List
<
User
>
userList
=
new
ArrayList
<>();
Optional
<
User
>
optional
=
pasUserDao
.
findById
(
userId
);
List
<
String
>
departmentIds
=
new
ArrayList
<>();
List
<
String
>
departIds
=
new
ArrayList
<>();
//所有部门id集合
if
(
optional
.
isPresent
()){
User
user
=
optional
.
get
();
List
<
String
>
roleIds
=
new
ArrayList
<>();
List
<
UserRole
>
userRoles
=
userRoleDao
.
findAllByUserId
(
user
.
getId
());
if
(
userRoles
!=
null
){
userRoles
.
forEach
(
userRole
->
{
roleIds
.
add
(
userRole
.
getRoleId
());
});
}
List
<
Role
>
roles
=
roleDao
.
findAllByIdIn
(
roleIds
);
if
(
roles
!=
null
){
roles
.
forEach
(
role
->
{
if
(
role
.
getIsLeader
().
equals
(
"0"
)){
departmentIds
.
add
(
role
.
getDepartmentId
());
}
});
}
}
if
(
departmentIds
!=
null
){
departmentIds
.
forEach
(
s
->
{
List
<
String
>
deIds
=
new
ArrayList
<>();
deIds
=
getDepartIds
(
deIds
,
s
);
if
(
deIds
!=
null
){
deIds
.
forEach
(
s1
->
{
if
(!
departIds
.
contains
(
s1
)){
departIds
.
add
(
s1
);
}
});
}
});
}
if
(
departIds
!=
null
){
departIds
.
forEach
(
s
->
{
List
<
User
>
users
=
pasUserDao
.
findAllByDepartmentIdsContains
(
s
);
if
(
users
!=
null
){
users
.
forEach
(
user
->
{
if
(!
userList
.
contains
(
user
)){
userList
.
add
(
user
);
}
});
}
});
}
if
(
userList
!=
null
){
userList
.
forEach
(
user
->
{
userIds
.
add
(
user
.
getId
());
});
}
return
userIds
;
}
/**
* 查看发布者下的所有人员id集合
*/
public
List
<
String
>
findUserIdList
(
String
userId
,
String
level
){
List
<
String
>
userIds
=
new
ArrayList
<>();
List
<
User
>
userList
=
new
ArrayList
<>();
Optional
<
User
>
optional
=
pasUserDao
.
findById
(
userId
);
List
<
String
>
departmentIds
=
new
ArrayList
<>();
List
<
String
>
departIds
=
new
ArrayList
<>();
//所有部门id集合
if
(
optional
.
isPresent
()){
User
user
=
optional
.
get
();
List
<
String
>
roleIds
=
new
ArrayList
<>();
List
<
UserRole
>
userRoles
=
userRoleDao
.
findAllByUserId
(
user
.
getId
());
if
(
userRoles
!=
null
){
userRoles
.
forEach
(
userRole
->
{
roleIds
.
add
(
userRole
.
getRoleId
());
});
}
List
<
Role
>
roles
=
roleDao
.
findAllByIdIn
(
roleIds
);
if
(
roles
!=
null
){
roles
.
forEach
(
role
->
{
if
(
role
.
getIsLeader
().
equals
(
"0"
)){
String
departmentId
=
role
.
getDepartmentId
();
Optional
<
Department
>
op
=
departmentDao
.
findById
(
departmentId
);
if
(
op
.
isPresent
()){
Department
department
=
op
.
get
();
if
(
department
.
getLevel
().
equals
(
level
)){
departmentIds
.
add
(
role
.
getDepartmentId
());
}
}
}
});
}
}
if
(
departmentIds
!=
null
){
departmentIds
.
forEach
(
s
->
{
List
<
String
>
deIds
=
new
ArrayList
<>();
deIds
=
getDepartIds
(
deIds
,
s
);
if
(
deIds
!=
null
){
deIds
.
forEach
(
s1
->
{
if
(!
departIds
.
contains
(
s1
)){
departIds
.
add
(
s1
);
}
});
}
});
}
if
(
departIds
!=
null
){
departIds
.
forEach
(
s
->
{
List
<
User
>
users
=
pasUserDao
.
findAllByDepartmentIdsContains
(
s
);
if
(
users
!=
null
){
users
.
forEach
(
user
->
{
if
(!
userList
.
contains
(
user
)){
userList
.
add
(
user
);
}
});
}
});
}
if
(
userList
!=
null
){
userList
.
forEach
(
user
->
{
userIds
.
add
(
user
.
getId
());
});
}
return
userIds
;
}
/**
* 查找发布者的部门等级
* @param publisher
* @return
*/
@Override
public
String
findDepartLevel
(
String
publisher
)
{
Integer
level
=
null
;
Optional
<
User
>
optional
=
pasUserDao
.
findById
(
publisher
);
List
<
String
>
departmentIds
=
new
ArrayList
<>();
if
(
optional
.
isPresent
()){
User
user
=
optional
.
get
();
List
<
String
>
roleIds
=
new
ArrayList
<>();
List
<
UserRole
>
userRoles
=
userRoleDao
.
findAllByUserId
(
user
.
getId
());
if
(
userRoles
!=
null
){
userRoles
.
forEach
(
userRole
->
{
roleIds
.
add
(
userRole
.
getRoleId
());
});
}
List
<
Role
>
roles
=
roleDao
.
findAllByIdIn
(
roleIds
);
if
(
roles
!=
null
){
roles
.
forEach
(
role
->
{
if
(
role
.
getIsLeader
().
equals
(
"0"
)){
List
<
String
>
authorities
=
new
ArrayList
<>();
List
<
RoleAuthority
>
roleAuthorities
=
roleAuthorityDao
.
findAllByRoleId
(
role
.
getId
());
if
(
roleAuthorities
!=
null
){
roleAuthorities
.
forEach
(
roleAuthority
->
{
authorities
.
add
(
roleAuthority
.
getAuthorityId
());
});
}
if
(
authorities
!=
null
){
List
<
Authority
>
authorityList
=
authorityDao
.
findAllByIdIn
(
authorities
);
if
(
authorityList
!=
null
){
authorityList
.
forEach
(
authority
->
{
if
(
authority
.
getName
().
equals
(
"发布任务"
)){
departmentIds
.
add
(
role
.
getDepartmentId
());
}
});
}
}
}
});
}
}
if
(
departmentIds
!=
null
){
List
<
Department
>
departments
=
departmentDao
.
findAllByIdIn
(
departmentIds
);
if
(
departments
!=
null
){
for
(
Department
department
:
departments
)
{
if
(
level
==
null
){
level
=
Integer
.
parseInt
(
department
.
getLevel
());
}
else
{
int
i
=
Integer
.
parseInt
(
department
.
getLevel
());
if
(
i
<
level
){
level
=
i
;
}
}
}
}
}
return
level
+
""
;
}
}
notes-address/src/main/resources/application.properties
0 → 100644
浏览文件 @
41b39e0d
notes-address/src/test/java/com/zjty/tynotes/address/NotesAddressApplicationTests.java
0 → 100644
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
address
;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
class
NotesAddressApplicationTests
{
void
contextLoads
()
{
}
}
notes-attendance/src/main/java/com/zjty/tynotes/attendance/controller/DingTestController.java
浏览文件 @
41b39e0d
...
...
@@ -67,12 +67,12 @@ public class DingTestController {
myInit
.
getToken
();
myInit
.
getDepartmentList
();
myInit
.
getUserList
();
List
<
String
>
userIds
=
myInit
.
userIds
;
List
<
String
>
userIds
=
new
ArrayList
<>()
;
userIds
.
add
(
"096031193739801599"
);
DingTalkClient
client
=
new
DefaultDingTalkClient
(
"https://oapi.dingtalk.com/attendance/listRecord"
);
OapiAttendanceListRecordRequest
request
=
new
OapiAttendanceListRecordRequest
();
request
.
setCheckDateFrom
(
"2020-0
4-04
00:00:00"
);
request
.
setCheckDateTo
(
"2020-0
4-10
00:00:00"
);
request
.
setCheckDateFrom
(
"2020-0
5-11
00:00:00"
);
request
.
setCheckDateTo
(
"2020-0
5-14
00:00:00"
);
request
.
setUserIds
(
userIds
);
try
{
OapiAttendanceListRecordResponse
execute
=
client
.
execute
(
request
,
myInit
.
token
);
...
...
@@ -84,6 +84,31 @@ public class DingTestController {
return
null
;
}
@GetMapping
(
"/card2"
)
public
Object
card2
(){
myInit
.
getToken
();
myInit
.
getDepartmentList
();
myInit
.
getUserList
();
List
<
String
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
"096031193739801599"
);
DingTalkClient
client
=
new
DefaultDingTalkClient
(
"https://oapi.dingtalk.com/attendance/list"
);
OapiAttendanceListRequest
request
=
new
OapiAttendanceListRequest
();
request
.
setWorkDateFrom
(
"2020-05-11 00:00:00"
);
request
.
setWorkDateTo
(
"2020-05-14 00:00:00"
);
request
.
setUserIdList
(
userIds
);
request
.
setOffset
(
0L
);
request
.
setLimit
(
50L
);
try
{
OapiAttendanceListResponse
response
=
client
.
execute
(
request
,
myInit
.
token
);
List
<
OapiAttendanceListResponse
.
Recordresult
>
recordresult
=
response
.
getRecordresult
();
System
.
out
.
println
(
recordresult
);
return
recordresult
;
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
@GetMapping
(
"/score"
)
public
Object
score
(){
String
month
=
"2020-04"
;
...
...
notes-attendance/src/main/java/com/zjty/tynotes/attendance/dao/CardAlarmDao.java
0 → 100644
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
attendance
.
dao
;
import
com.zjty.tynotes.attendance.entity.CardAlarm
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
/**
* @Author gwj
* @create 2020/5/13 13:39
*/
public
interface
CardAlarmDao
extends
MongoRepository
<
CardAlarm
,
String
>
{
}
notes-attendance/src/main/java/com/zjty/tynotes/attendance/entity/CardAlarm.java
0 → 100644
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
attendance
.
entity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
/**
* @Author gwj
* @create 2020/5/13 11:20
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"打卡报警"
,
description
=
"打卡报警信息"
)
@Document
(
collection
=
"card_alarm"
)
public
class
CardAlarm
{
@Id
@ApiModelProperty
(
value
=
"打卡报警信息的id"
,
example
=
"123qdsdd212"
)
private
String
id
;
@ApiModelProperty
(
value
=
"用户id"
,
example
=
""
)
private
String
userId
;
@ApiModelProperty
(
value
=
"报警描述"
,
example
=
"使用虚拟定位打卡"
)
private
String
des
;
}
notes-attendance/src/main/java/com/zjty/tynotes/attendance/service/impl/ApprovalInformationServiceImpl.java
浏览文件 @
41b39e0d
...
...
@@ -531,7 +531,7 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic
*/
@Override
public
List
<
Department
>
findSelectDepartment
()
{
List
<
Department
>
departments
=
departmentDao
.
findByLevel
(
"2"
);
List
<
Department
>
departments
=
departmentDao
.
find
All
ByLevel
(
"2"
);
return
departments
;
}
...
...
notes-attendance/src/main/java/com/zjty/tynotes/attendance/service/impl/AttendanceDetailsServiceImpl.java
浏览文件 @
41b39e0d
...
...
@@ -129,7 +129,6 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
userAttenVo
.
computerRealAttendanceDay
();
}
System
.
out
.
println
(
attendanceDetailsList
.
size
());
return
userAttenVo
;
}
catch
(
ParseException
e
)
{
logger
.
error
(
"时间转换格式错误"
);
...
...
@@ -138,20 +137,66 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
return
userAttenVo
;
}
/**
* 查询部门下人员的考勤情况
* @param request
* @return
*/
@Override
public
List
<
UserAttenVo
>
findDepartment
(
AttenRequest
request
)
{
List
<
UserAttenVo
>
userAttenVos
=
new
ArrayList
<>();
String
id
=
request
.
getId
();
//
部门
id
String
id
=
request
.
getId
();
//
人的
id
List
<
User
>
users
=
pasUserDao
.
findAll
();
List
<
User
>
userList
=
new
ArrayList
<>();
List
<
String
>
departIds
=
new
ArrayList
<>();
List
<
String
>
departmentIds
=
new
ArrayList
<>();
Optional
<
User
>
byId
=
pasUserDao
.
findById
(
id
);
if
(
byId
.
isPresent
()){
User
user
=
byId
.
get
();
List
<
UserRole
>
userRoles
=
userRoleDao
.
findAllByUserId
(
user
.
getId
());
if
(
userRoles
!=
null
){
List
<
String
>
roleIds
=
new
ArrayList
<>();
userRoles
.
forEach
(
userRole
->
{
roleIds
.
add
(
userRole
.
getRoleId
());
});
List
<
Role
>
roles
=
roleDao
.
findAllByIdIn
(
roleIds
);
if
(
roles
!=
null
){
roles
.
forEach
(
role
->
{
if
(
role
.
getIsLeader
().
equals
(
"0"
)){
departmentIds
.
add
(
role
.
getDepartmentId
());
}
});
}
}
}
if
(
departmentIds
!=
null
){
List
<
String
>
deIds
=
new
ArrayList
<>();
for
(
String
s
:
departmentIds
)
{
deIds
=
getDepartIds
(
deIds
,
s
);
if
(
deIds
!=
null
){
for
(
String
s1
:
deIds
)
{
if
(!
departIds
.
contains
(
s1
)){
departIds
.
add
(
s1
);
}
}
}
}
}
if
(
users
!=
null
){
users
.
forEach
(
user
->
{
List
<
String
>
departmentIds
=
user
.
getDepartmentIds
();
if
(
departmentIds
!=
null
){
departmentIds
.
contains
(
id
);
userList
.
add
(
user
);
for
(
User
user
:
users
)
{
if
(
departIds
!=
null
){
List
<
String
>
departmentIds1
=
user
.
getDepartmentIds
();
if
(
departmentIds1
!=
null
){
for
(
String
s
:
departmentIds1
)
{
if
(
departIds
.
contains
(
s
)){
userList
.
add
(
user
);
break
;
}
}
}
}
}
);
}
}
List
<
AttenRequest
>
attenRequests
=
new
ArrayList
<>();
userList
.
forEach
(
user
->
{
...
...
@@ -281,4 +326,21 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
}
}
/**
* 递归获得某个部门下的所有部门id集合
* @param ids
* @param departId
* @return
*/
public
List
<
String
>
getDepartIds
(
List
<
String
>
ids
,
String
departId
){
ids
.
add
(
departId
);
List
<
Department
>
departments
=
departmentDao
.
findAllByParentId
(
departId
);
if
(
departments
!=
null
){
departments
.
forEach
(
department
->
{
getDepartIds
(
ids
,
department
.
getId
());
});
}
return
ids
;
}
}
notes-attendance/src/main/java/com/zjty/tynotes/attendance/task/CardTask.java
浏览文件 @
41b39e0d
...
...
@@ -2,7 +2,9 @@ package com.zjty.tynotes.attendance.task;
import
com.dingtalk.api.DefaultDingTalkClient
;
import
com.dingtalk.api.DingTalkClient
;
import
com.dingtalk.api.request.OapiAttendanceListRecordRequest
;
import
com.dingtalk.api.request.OapiAttendanceListRequest
;
import
com.dingtalk.api.response.OapiAttendanceListRecordResponse
;
import
com.dingtalk.api.response.OapiAttendanceListResponse
;
import
com.taobao.api.ApiException
;
import
com.zjty.tynotes.attendance.dao.*
;
...
...
@@ -61,6 +63,8 @@ public class CardTask {
private
UserLateNumDao
userLateNumDao
;
@Autowired
private
WorkoverApproDao
workoverApproDao
;
@Autowired
private
CardAlarmDao
cardAlarmDao
;
/**
* 定时任务,定时获取打卡信息.计算前天的个人考勤信息情况
...
...
@@ -88,19 +92,9 @@ public class CardTask {
String
startTime
=
sdf
.
format
(
time
);
String
endTime
=
sdf3
.
format
(
time
);
// String time1 = null;
// String time2 = null;
// try {
// long l1 = sdf2.parse(startTime).getTime() - 8*60*60*1000;
// time1 = sdf2.format(new Date(l1));
// long l2 = sdf2.parse(endTime).getTime() - 8*60*60*1000;
// time2 = sdf2.format(new Date(l2));
// } catch (ParseException e) {
// e.printStackTrace();
// }
//获取上下班打卡记录
DingTalkClient
client
=
new
DefaultDingTalkClient
(
"https://oapi.dingtalk.com/attendance/list"
);
OapiAttendanceListRequest
request
=
new
OapiAttendanceListRequest
();
List
<
DingUser
>
dingUsers
=
dingUserDao
.
findAll
();
List
<
String
>
dingUserIds
=
new
ArrayList
<>();
if
(
dingUsers
!=
null
){
...
...
@@ -108,26 +102,48 @@ public class CardTask {
dingUserIds
.
add
(
dingUser
.
getDingUserId
());
});
}
request
.
setWorkDateFrom
(
startTime
);
request
.
setWorkDateTo
(
endTime
);
request
.
setUserIdList
(
dingUserIds
);
request
.
setOffset
(
0L
);
request
.
setLimit
(
50L
);
//获取打卡详情
DingTalkClient
client1
=
new
DefaultDingTalkClient
(
"https://oapi.dingtalk.com/attendance/listRecord"
);
OapiAttendanceListRecordRequest
request1
=
new
OapiAttendanceListRecordRequest
();
request1
.
setCheckDateFrom
(
startTime
);
request1
.
setCheckDateTo
(
endTime
);
request1
.
setUserIds
(
dingUserIds
);
try
{
init
.
getToken
();
OapiAttendanceListResponse
response
=
client
.
execute
(
request
,
init
.
token
);
OapiAttendanceListRecordResponse
execute
=
client1
.
execute
(
request1
,
init
.
token
);
if
(
response
!=
null
){
List
<
OapiAttendanceListRecordResponse
.
Recordresult
>
recordresults
=
new
ArrayList
<>();
if
(
execute
!=
null
){
recordresults
=
execute
.
getRecordresult
();
//打卡详情
}
List
<
OapiAttendanceListResponse
.
Recordresult
>
recordresult
=
response
.
getRecordresult
();
if
(
recordresult
!=
null
){
recordresult
.
forEach
(
recordresult1
->
{
for
(
OapiAttendanceListResponse
.
Recordresult
recordresult1
:
recordresult
)
{
String
userId
=
recordresult1
.
getUserId
();
DingUser
dingUser
=
dingUserDao
.
findByDingUserId
(
userId
);
CardResult
cardResult
=
new
CardResult
(
recordresult1
);
cardResult
.
setUserId
(
dingUser
.
getUserId
());
cardResults
.
add
(
cardResult
);
});
if
(
recordresults
!=
null
){
for
(
OapiAttendanceListRecordResponse
.
Recordresult
recordresult2
:
recordresults
)
{
if
(
recordresult2
.
getUserId
()!=
null
&&
recordresult2
.
getUserId
().
equals
(
userId
)){
if
(
recordresult2
.
getInvalidRecordMsg
()!=
null
&&(!
recordresult2
.
getInvalidRecordMsg
().
equals
(
""
))){
CardAlarm
cardAlarm
=
new
CardAlarm
(
null
,
dingUser
.
getUserId
(),
"使用虚拟定位打卡"
);
cardAlarmDao
.
save
(
cardAlarm
);
break
;
}
}
}
CardResult
cardResult
=
new
CardResult
(
recordresult1
);
cardResult
.
setUserId
(
dingUser
.
getUserId
());
cardResults
.
add
(
cardResult
);
}
}
}
List
<
CardResult
>
cardResults1
=
cardResultDao
.
saveAll
(
cardResults
);
computerPersonAttenDanceDay
(
startTime
,
endTime
,
userList
,
cardResults1
);
...
...
@@ -561,7 +577,7 @@ public class CardTask {
/**
* 定时任务,定时进行运算
*/
@Scheduled
(
cron
=
"0/30 * * * * ? "
)
//
@Scheduled(cron = "0/30 * * * * ? ")
public
void
calculate
()
throws
Exception
{
int
attendanceDay
=
0
;
//应出勤天数
int
averageWorkHours
=
0
;
//平均工时
...
...
@@ -591,41 +607,6 @@ public class CardTask {
});
}
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// Calendar calendar = Calendar.getInstance();
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//// Date date = new Date();
// String date = "2020-03-29 11:11:11";
// String format = sdf.format(new Date());
// //计算这个月的应出勤天数
// Date parse = sdf.parse(date);
// calendar.setTime(parse);
// calendar.set(Calendar.DAY_OF_MONTH,1);
// Date time = calendar.getTime();
// System.out.println(time);
// calendar.add(Calendar.MONTH,1);
// calendar.set(Calendar.DAY_OF_MONTH,0);
// Date time1 = calendar.getTime();
// System.out.println("time1:"+time1);
// Float aFloat = CardTask.fullScore();
// System.out.println(aFloat);
String
month
=
"2020-04"
;
Calendar
calendar
=
Calendar
.
getInstance
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM"
);
SimpleDateFormat
sdf2
=
new
SimpleDateFormat
(
"yyyy-MM-dd 00:00:00"
);
String
format
=
"2020-04-05 00:00:00"
;
try
{
Date
parse
=
sdf2
.
parse
(
format
);
calendar
.
setTime
(
parse
);
calendar
.
add
(
Calendar
.
DATE
,-
1
);
Date
date
=
sdf
.
parse
(
month
);
System
.
out
.
println
(
calendar
.
getTime
());
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
/**
* 计算个人当月总考勤分
* @return
...
...
notes-attendance/src/main/java/com/zjty/tynotes/attendance/task/MyInit.java
浏览文件 @
41b39e0d
...
...
@@ -161,11 +161,13 @@ public class MyInit implements CommandLineRunner {
}
}
OapiUserGetResponse
user
=
client
.
execute
(
request
,
token
);
if
(
user
.
getName
().
equals
(
"黄夏豪"
)){
System
.
out
.
println
(
"黄夏豪:"
+
user
.
getUserid
());
}
if
(
user
!=
null
){
if
(!
dingsuerIds
.
contains
(
user
.
getUserid
())){
for
(
User
user1
:
users
)
{
if
(
user
.
getName
().
equals
(
user1
.
getUsername
())){
logger
.
error
(
user
.
getUserid
());
dingUserList
.
add
(
new
DingUser
(
null
,
user1
.
getId
(),
user
.
getUserid
()));
}
}
...
...
notes-job/pom.xml
浏览文件 @
41b39e0d
...
...
@@ -78,6 +78,17 @@
</exclusions>
</dependency>
<dependency>
<groupId>
com.zjty.tynotes
</groupId>
<artifactId>
notes-address
</artifactId>
<exclusions>
<exclusion>
<groupId>
com.zjty.tynotes
</groupId>
<artifactId>
notes-job
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
notes-job/src/main/java/com/zjty/tynotes/job/JobApplication.java
浏览文件 @
41b39e0d
...
...
@@ -18,7 +18,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
"com.zjty.tynotes.search"
,
"com.zjty.tynotes.redis"
,
"com.zjty.tynotes.sms"
,
"com.zjty.tynotes.log"
,
"com.zjty.tynotes.log"
,
"com.zjty.tynotes.address"
})
@EnableCaching
@EnableScheduling
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/impl/WorkServiceImpl.java
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
job
.
basic
.
service
.
impl
;
import
com.google.common.collect.Lists
;
import
com.zjty.tynotes.address.server.service.NoticeService
;
import
com.zjty.tynotes.job.basic.entity.database.ScoreCoefficient
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.entity.database.WorkTime
;
...
...
@@ -25,12 +26,11 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.validation.constraints.NotNull
;
import
java.text.DecimalFormat
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
static
java
.
util
.
Objects
.
isNull
;
import
static
java
.
util
.
Objects
.
nonNull
;
...
...
@@ -62,6 +62,9 @@ public class WorkServiceImpl implements WorkService {
@Autowired
WorkTimeService
workTimeService
;
@Autowired
private
NoticeService
noticeService
;
@Autowired
public
WorkServiceImpl
(
WorkRepository
workRepository
)
{
this
.
workRepository
=
workRepository
;
...
...
@@ -82,6 +85,39 @@ public class WorkServiceImpl implements WorkService {
work
.
setGeneralManagers
(
jobLeads
.
getGeneralManagers
());
String
saveId
=
workRepository
.
save
(
work
).
getId
();
log
.
info
(
String
.
format
(
"[job] 新增了id为 %s 的数据."
,
saveId
));
CompletableFuture
.
runAsync
(()->{
if
(
work
.
getSuperiorId
()==
null
){
List
<
String
>
otherIds
=
new
ArrayList
<>();
List
<
String
>
crewList
=
work
.
getCrewList
();
//获取组员id集合
@NotNull
String
publisher
=
work
.
getPublisher
();
List
<
String
>
userIdList
=
noticeService
.
findUserIdList
(
publisher
);
//查找发布者下的人员id集合
if
(
crewList
!=
null
){
crewList
.
forEach
(
s
->
{
if
(!
userIdList
.
contains
(
s
)){
otherIds
.
add
(
s
);
System
.
out
.
println
(
"需要请求人的id"
+
s
);
}
});
}
//查找发布者的部门等级
String
level
=
noticeService
.
findDepartLevel
(
publisher
);
List
<
User
>
users
=
noticeService
.
findUser
(
level
);
//查找与发布者相同等级的人
if
(
users
!=
null
){
Map
<
String
,
List
<
String
>>
map
=
noticeService
.
findLeadUser
(
users
,
otherIds
,
level
);
//查找所借人的id集合
if
(
map
!=
null
){
Optional
<
Work
>
optional
=
workRepository
.
findById
(
saveId
);
if
(
optional
.
isPresent
()){
Work
work1
=
optional
.
get
();
noticeService
.
submitNotice
(
work1
.
getPublisher
(),
map
,
work1
.
getId
(),
work1
.
getTitle
());
}
}
}
}
});
return
saveId
;
}
else
{
String
msg
=
"[job] %s: 新增数据不可附带id."
;
...
...
notes-log/src/main/java/com/zjty/tynotes/log/NotesLogApplication.java
浏览文件 @
41b39e0d
...
...
@@ -6,12 +6,12 @@ import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan
(
basePackages
=
{
"com.zjty.tynotes.misc"
,
//
"com.zjty.tynotes.misc",
"com.zjty.tynotes.pas"
,
"com.zjty.tynotes.log"
,
"com.zjty.tynotes.search"
,
"com.zjty.tynotes.redis"
,
"com.zjty.tynotes.sms"
"com.zjty.tynotes.log"
//
"com.zjty.tynotes.search",
//
"com.zjty.tynotes.redis",
//
"com.zjty.tynotes.sms"
// "com.zjty.tynotes.weekly"
// ,"com.zjty.tynotes.attendance"
})
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/controller/ExcelController.java
浏览文件 @
41b39e0d
...
...
@@ -7,14 +7,19 @@ import cn.afterturn.easypoi.excel.entity.ImportParams;
import
cn.afterturn.easypoi.excel.entity.enmus.ExcelType
;
import
com.zjty.tynotes.misc.config.AutoDocument
;
import
com.zjty.tynotes.misc.utils.ExcelUtil
;
import
com.zjty.tynotes.pas.dao.PasUserDao
;
import
com.zjty.tynotes.pas.entity.Address
;
import
com.zjty.tynotes.pas.entity.Department
;
import
com.zjty.tynotes.pas.entity.User
;
import
com.zjty.tynotes.pas.entity.vo.ImportUserExcel
;
import
com.zjty.tynotes.pas.service.IUserService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.RequestEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
...
@@ -23,12 +28,15 @@ import org.springframework.web.multipart.MultipartFile;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
org
.
springframework
.
http
.
ResponseEntity
.
ok
;
/**
* @Author gwj
* @create 2020/4/24 9:36
...
...
@@ -41,17 +49,45 @@ import java.util.stream.Collectors;
public
class
ExcelController
{
@Autowired
private
IUserService
iUserService
;
@Autowired
private
PasUserDao
pasUserDao
;
@Autowired
private
BCryptPasswordEncoder
bCryptPasswordEncoder
;
private
String
addressUrl
=
"C:\\Users\\gwj\\Desktop\\工作簿\\address.xls"
;
@ApiOperation
(
value
=
"上传excel通讯录"
)
@PostMapping
(
"/import"
)
public
List
<
ImportUserExcel
>
upload
(
@RequestParam
(
"file"
)
MultipartFile
multipartFil
e
)
throws
Exception
{
public
List
<
Address
>
upload
(
@RequestParam
(
"file"
)
MultipartFile
multipartFile
,
HttpServletRequest
request
,
HttpServletResponse
respons
e
)
throws
Exception
{
ImportParams
params
=
new
ImportParams
();
params
.
setHeadRows
(
2
);
params
.
setNeedVerfiy
(
true
);
// params.setTitleRows(0);
List
<
ImportUserExcel
>
result
=
ExcelImportUtil
.
importExcel
(
multipartFile
.
getInputStream
(),
ImportUserExcel
.
class
,
params
);
System
.
out
.
println
(
result
);
params
.
setHeadRows
(
1
);
// params.setNeedVerfiy(true);
params
.
setTitleRows
(
1
);
List
<
Address
>
result
=
ExcelImportUtil
.
importExcel
(
multipartFile
.
getInputStream
(),
Address
.
class
,
params
);
List
<
User
>
users
=
new
ArrayList
<>();
if
(
result
!=
null
){
result
.
forEach
(
address
->
{
User
user
=
pasUserDao
.
findByUsername
(
address
.
getName
());
if
(
user
==
null
){
User
user1
=
new
User
(
address
);
user1
.
setPassword
(
bCryptPasswordEncoder
.
encode
(
"qwer1234"
));
boolean
flag
=
true
;
if
(
users
!=
null
){
for
(
User
user2
:
users
)
{
if
(
user2
.
getUsername
().
equals
(
address
.
getName
())){
flag
=
false
;
}
}
}
if
(
flag
){
users
.
add
(
user1
);
}
}
});
}
pasUserDao
.
saveAll
(
users
);
return
result
;
}
...
...
@@ -63,19 +99,18 @@ public class ExcelController {
//构建创建导出excel表格所需要的Workbook对象的map
//源数据
List
<
User
>
users
=
iUserService
.
findAll
();
List
<
ImportUserExcel
>
importUserExcel
s
=
new
ArrayList
<>();
List
<
Address
>
addresse
s
=
new
ArrayList
<>();
if
(
users
!=
null
){
users
.
forEach
(
user
->
{
importUserExcels
.
add
(
new
ImportUserExcel
(
user
));
addresses
.
add
(
new
Address
(
user
));
});
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
8
);
String
FpName
=
"用户通讯录"
;
map
.
put
(
"subFpName"
,
FpName
);
map
.
put
(
"title"
,
new
ExportParams
(
FpName
,
FpName
));
map
.
put
(
"entity"
,
ImportUserExcel
.
class
);
map
.
put
(
"data"
,
importUserExcel
s
);
map
.
put
(
"entity"
,
Address
.
class
);
map
.
put
(
"data"
,
addresse
s
);
excelList
.
add
(
map
);
Workbook
workbook
=
ExcelExportUtil
.
exportExcel
(
excelList
,
ExcelType
.
HSSF
);
...
...
@@ -83,4 +118,45 @@ public class ExcelController {
ExcelUtil
.
downloadExcel
(
request
,
response
,
workbook
,
FpName
);
}
@ApiOperation
(
value
=
"下载通讯录模板"
)
@PostMapping
(
"/download"
)
public
ResponseEntity
download
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
String
filename
=
"address.xls"
;
File
file
=
new
File
(
addressUrl
);
System
.
out
.
println
(
addressUrl
);
System
.
out
.
println
(
"存在??"
);
if
(
file
.
exists
()){
//判断文件父目录是否存在
System
.
out
.
println
(
"存在???"
);
response
.
setContentType
(
"application/vnd.ms-excel;charset=UTF-8"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;fileName="
+
java
.
net
.
URLEncoder
.
encode
(
filename
,
"UTF-8"
));
byte
[]
buffer
=
new
byte
[
1024
];
FileInputStream
fis
=
null
;
//文件输入流
BufferedInputStream
bis
=
null
;
OutputStream
os
=
null
;
//输出流
try
{
os
=
response
.
getOutputStream
();
fis
=
new
FileInputStream
(
file
);
bis
=
new
BufferedInputStream
(
fis
);
int
i
=
bis
.
read
(
buffer
);
while
(
i
!=
-
1
){
os
.
write
(
buffer
);
i
=
bis
.
read
(
buffer
);
}
return
ok
(
"下载成功"
);
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
System
.
out
.
println
(
"----------file download---"
+
filename
);
try
{
bis
.
close
();
fis
.
close
();
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
return
ok
(
"下载失败"
);
}
}
notes-pas/src/main/java/com/zjty/tynotes/pas/controller/TestController.java
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
pas
.
controller
;
import
com.zjty.tynotes.misc.config.AutoDocument
;
import
com.zjty.tynotes.pas.dao.AuthorityDao
;
import
com.zjty.tynotes.pas.dao.DayDao
;
import
com.zjty.tynotes.pas.dao.RoleAuthorityDao
;
import
com.zjty.tynotes.pas.dao.RoleDao
;
import
com.zjty.tynotes.pas.entity.Authority
;
import
com.zjty.tynotes.pas.entity.Day
;
import
com.zjty.tynotes.pas.entity.Role
;
import
com.zjty.tynotes.pas.entity.RoleAuthority
;
import
com.zjty.tynotes.pas.dao.*
;
import
com.zjty.tynotes.pas.entity.*
;
import
com.zjty.tynotes.pas.entity.vo.JobLeads
;
import
com.zjty.tynotes.pas.service.IUserService
;
import
com.zjty.tynotes.pas.service.impl.UserServiceImpl
;
...
...
@@ -38,6 +32,8 @@ public class TestController {
private
RoleAuthorityDao
roleAuthorityDao
;
@Autowired
private
UserServiceImpl
userService
;
@Autowired
private
PasUserDao
pasUserDao
;
// @GetMapping("/test")
// public void calculate() throws Exception{
...
...
@@ -88,5 +84,33 @@ public class TestController {
return
jobLeads
;
}
@GetMapping
(
"/test2/delete"
)
public
void
delete
()
throws
Exception
{
List
<
User
>
all
=
pasUserDao
.
findAll
();
if
(
all
!=
null
){
all
.
forEach
(
user
->
{
if
(
user
.
getUsername
()==
null
){
pasUserDao
.
deleteById
(
user
.
getId
());
}
});
}
}
@GetMapping
(
"/test2/showName"
)
public
void
showName
()
throws
Exception
{
List
<
User
>
all
=
pasUserDao
.
findAll
();
List
<
String
>
names
=
new
ArrayList
<>();
if
(
all
!=
null
){
all
.
forEach
(
user
->
{
if
(
names
.
contains
(
user
.
getUsername
())){
System
.
out
.
println
(
user
.
getUsername
());
}
else
{
names
.
add
(
user
.
getUsername
());
}
});
}
}
}
notes-pas/src/main/java/com/zjty/tynotes/pas/dao/DepartmentDao.java
浏览文件 @
41b39e0d
...
...
@@ -10,7 +10,8 @@ import java.util.List;
* @create 2020/2/29 9:42
*/
public
interface
DepartmentDao
extends
MongoRepository
<
Department
,
String
>
{
List
<
Department
>
findByLevel
(
String
level
);
List
<
Department
>
findAllByLevel
(
String
level
);
List
<
Department
>
findAllByParentId
(
String
parentId
);
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/dao/PasUserDao.java
浏览文件 @
41b39e0d
...
...
@@ -81,4 +81,6 @@ public interface PasUserDao extends MongoRepository<User, String> {
*/
List
<
User
>
findAllByStatus
(
String
status
);
List
<
User
>
findAllByDepartmentIdsContains
(
String
departId
);
}
notes-pas/src/main/java/com/zjty/tynotes/pas/dao/RoleDao.java
浏览文件 @
41b39e0d
...
...
@@ -33,4 +33,6 @@ public interface RoleDao extends MongoRepository<Role, String> {
*/
List
<
Role
>
findAllByIdInAndIsLeader
(
List
<
String
>
ids
,
String
isLeader
);
List
<
Role
>
findAllByDepartmentIdInAndIsLeader
(
List
<
String
>
ids
,
String
isLeader
);
}
notes-pas/src/main/java/com/zjty/tynotes/pas/entity/Address.java
0 → 100644
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
pas
.
entity
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
/**
* @Author gwj
* @create 2020/5/13 8:46
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"通讯录"
,
description
=
"通讯录说明"
)
public
class
Address
{
@Excel
(
name
=
"姓名"
)
@ApiModelProperty
(
value
=
"姓名"
,
example
=
"gwj"
)
private
String
name
;
@Excel
(
name
=
"职务"
)
@ApiModelProperty
(
value
=
"职务"
,
example
=
"后端程序员"
)
private
String
duty
;
@Excel
(
name
=
"手机"
)
@ApiModelProperty
(
value
=
"手机号"
,
example
=
"13211111111"
)
private
String
telphone
;
@Excel
(
name
=
"邮箱"
)
@ApiModelProperty
(
value
=
"邮箱"
,
example
=
"1@1.com"
)
private
String
email
;
@Excel
(
name
=
"手机虚拟号"
)
@ApiModelProperty
(
value
=
"短号"
,
example
=
"666666"
)
private
String
shortphone
;
@Excel
(
name
=
"工号"
)
@ApiModelProperty
(
value
=
"工号"
,
example
=
"1111111111111"
)
private
String
workerNum
;
public
Address
(
User
user
)
{
this
.
workerNum
=
user
.
getWorkerNum
();
this
.
name
=
user
.
getUsername
();
this
.
duty
=
user
.
getJobs
();
this
.
telphone
=
user
.
getPhone1
();
// this.shortphone = user.getPhone2();
this
.
email
=
user
.
getEmail
();
}
}
notes-pas/src/main/java/com/zjty/tynotes/pas/entity/Role.java
浏览文件 @
41b39e0d
...
...
@@ -39,7 +39,7 @@ public class Role {
@ApiModelProperty
(
value
=
"部门id"
,
example
=
"1"
)
private
String
departmentId
;
@ApiModelProperty
(
value
=
"是否领导"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"是否领导
,0代表是该部门领导,1代表为该部门普通员工
"
,
example
=
"1"
)
private
String
isLeader
;
//0代表是该部门领导,1代表为该部门普通员工
@ApiModelProperty
(
value
=
"正副经理0为正,1为副"
,
example
=
"1"
)
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/entity/User.java
浏览文件 @
41b39e0d
...
...
@@ -39,9 +39,13 @@ public class User implements UserDetails, Serializable {
private
String
id
;
@NotEmpty
(
message
=
"身份证号码不可为空"
)
@ApiModelProperty
(
value
=
"身份证"
,
example
=
"48489498131566546"
)
@ApiModelProperty
(
value
=
"身份证"
,
example
=
"48489498131566546"
)
private
String
idCard
;
@NotEmpty
(
message
=
"工号不可为空"
)
@ApiModelProperty
(
value
=
"工号"
,
example
=
"11111111111111111"
)
private
String
workerNum
;
@NotEmpty
(
message
=
"地址不可为空"
)
@ApiModelProperty
(
value
=
"地址"
,
example
=
"xx路xx楼xx号"
)
private
String
address
;
...
...
@@ -160,4 +164,14 @@ public class User implements UserDetails, Serializable {
return
this
;
}
public
User
(
Address
address
)
{
this
.
workerNum
=
address
.
getWorkerNum
();
this
.
username
=
address
.
getName
();
this
.
phone1
=
address
.
getTelphone
();
this
.
jobs
=
address
.
getDuty
();
this
.
phone2
=
address
.
getTelphone
();
// this.phone2 = address.getShortphone();
this
.
email
=
address
.
getEmail
();
}
}
notes-pas/src/main/java/com/zjty/tynotes/pas/entity/vo/ImportUserExcel.java
deleted
100644 → 0
浏览文件 @
f603f0e9
package
com
.
zjty
.
tynotes
.
pas
.
entity
.
vo
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.zjty.tynotes.pas.entity.User
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @Author gwj
* @create 2020/4/24 9:33
* @des 导入excel模板的实体类
*/
@Data
@AllArgsConstructor
public
class
ImportUserExcel
{
@Excel
(
name
=
"姓名*"
)
private
String
name
;
@Excel
(
name
=
"性别*"
,
replace
=
{
"男_0"
,
"女_1"
})
private
Integer
gender
;
@Excel
(
name
=
"手机号*"
)
private
String
phone
;
public
ImportUserExcel
(
User
user
)
{
this
.
name
=
user
.
getUsername
();
this
.
phone
=
user
.
getPhone1
();
}
}
notes-pas/src/main/java/com/zjty/tynotes/pas/service/impl/DepartmentServiceImpl.java
浏览文件 @
41b39e0d
...
...
@@ -67,7 +67,7 @@ public class DepartmentServiceImpl implements IDepartmentService {
@Override
@Transactional
public
List
<
Department
>
findList
()
{
List
<
Department
>
departments
=
departmentDao
.
findByLevel
(
"1"
);
List
<
Department
>
departments
=
departmentDao
.
find
All
ByLevel
(
"1"
);
Department
department
=
null
;
if
(
departments
==
null
||
departments
.
size
()==
0
){
Department
department1
=
new
Department
(
null
,
"泰源"
,
"1"
,
"泰源"
,
null
,
null
,
null
);
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/task/Init.java
浏览文件 @
41b39e0d
...
...
@@ -69,6 +69,12 @@ public class Init implements CommandLineRunner {
if
(!
authorityName
.
contains
(
"查看人员"
))
{
authorities1
.
add
(
new
Authority
(
null
,
"查看人员"
,
"能够查看人员"
));
}
if
(!
authorityName
.
contains
(
"审批管理"
))
{
authorities1
.
add
(
new
Authority
(
null
,
"审批管理"
,
"能够查看请假审批、加班审批"
));
}
if
(!
authorityName
.
contains
(
"部门统计"
))
{
authorities1
.
add
(
new
Authority
(
null
,
"部门统计"
,
"能够查看部门任务"
));
}
if
(
authorities1
!=
null
)
{
authorityDao
.
saveAll
(
authorities1
);
}
...
...
notes-sms/src/main/java/com/zjty/tynotes/sms/service/MessageTemplateService.java
浏览文件 @
41b39e0d
...
...
@@ -10,4 +10,9 @@ public interface MessageTemplateService {
* 对相关人员推送通知
*/
void
beingPushed
(
String
receive
,
String
destination
,
String
payload
);
/**
* 借用人员通知信息
*/
void
noticePushed
(
String
receive
,
String
payload
);
}
notes-sms/src/main/java/com/zjty/tynotes/sms/service/impl/MessageTemplateServiceImpl.java
浏览文件 @
41b39e0d
...
...
@@ -27,6 +27,11 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
this
.
sendToUser
(
receive
,
destination
,
payload
);
}
@Override
public
void
noticePushed
(
String
receive
,
String
payload
)
{
this
.
sendToUser
(
receive
,
"/topic/notice"
,
payload
);
}
/**
* 给指定用户发送消息,并处理接收者不在线的情况
*
...
...
notes-union/pom.xml
浏览文件 @
41b39e0d
...
...
@@ -106,6 +106,11 @@
<artifactId>
notes-log
</artifactId>
</dependency>
<dependency>
<groupId>
com.zjty.tynotes
</groupId>
<artifactId>
notes-address
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
...
...
notes-union/src/main/java/com/zjty/tynotes/union/UnionApplication.java
浏览文件 @
41b39e0d
...
...
@@ -27,7 +27,8 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
"com.zjty.tynotes.weekly"
,
"com.zjty.tynotes.misc"
,
"com.zjty.tynotes.union"
,
"com.zjty.tynotes.log"
"com.zjty.tynotes.log"
,
"com.zjty.tynotes.address"
// , "com.zjty.tynotes.attendance"
})
@EnableCaching
...
...
notes-union/src/main/resources/application.properties
浏览文件 @
41b39e0d
...
...
@@ -3,24 +3,25 @@ spring.application.name=workbook
## https端口号.
server.port
=
8289
# 证书的路径.
#
server.ssl.key-store=classpath:2586377_workbook.zjtys.com.cn.pfx
#
#
证书密码,请修改为您自己证书的密码.
#
server.ssl.key-store-password=bMEPW9BG
#
#
秘钥库类型
#
server.ssl.keyStoreType=PKCS12
#
#
证书别名
#
server.ssl.keyAlias= alias
server.ssl.key-store
=
classpath:2586377_workbook.zjtys.com.cn.pfx
# 证书密码,请修改为您自己证书的密码.
server.ssl.key-store-password
=
bMEPW9BG
# 秘钥库类型
server.ssl.keyStoreType
=
PKCS12
# 证书别名
server.ssl.keyAlias
=
alias
#mongodb configuration
spring.data.mongodb.uri
=
mongodb://
192.168.1.246
:27017/notes5
spring.data.mongodb.uri
=
mongodb://
localhost
:27017/notes5
# servlet configuration
spring.servlet.multipart.max-file-size
=
100MB
spring.servlet.multipart.max-request-size
=
1000MB
spring.redis.host
=
192.168.1.246
spring.redis.host
=
localhost
spring.redis.port
=
6379
spring.redis.timeout
=
5000ms
# es configuraiton
es.ip
=
192.168.1.246
es.ip
=
localhost
logging.file
=
./log/note.log
notes-weekly/src/main/java/com/zjty/tynotes/weekly/WeeklyApplication.java
浏览文件 @
41b39e0d
...
...
@@ -16,4 +16,5 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
})
@EnableSwagger2
public
class
WeeklyApplication
{
}
notes-weekly/src/main/java/com/zjty/tynotes/weekly/subject/controller/UserManageController.java
浏览文件 @
41b39e0d
...
...
@@ -4,9 +4,11 @@ import com.zjty.tynotes.log.entity.Log;
import
com.zjty.tynotes.log.server.LogService
;
import
com.zjty.tynotes.misc.config.AutoDocument
;
import
com.zjty.tynotes.pas.base.advise.Content
;
import
com.zjty.tynotes.pas.entity.Address
;
import
com.zjty.tynotes.pas.entity.User
;
import
com.zjty.tynotes.pas.entity.vo.PageRequest
;
import
com.zjty.tynotes.pas.entity.vo.PageResponse
;
import
com.zjty.tynotes.weekly.subject.entity.vo.AddressRequest
;
import
com.zjty.tynotes.weekly.subject.entity.vo.Problem
;
import
com.zjty.tynotes.weekly.subject.entity.vo.SimpleUserVo
;
import
com.zjty.tynotes.weekly.subject.entity.vo.UserVo
;
...
...
@@ -23,7 +25,10 @@ import org.springframework.security.core.Authentication;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotNull
;
...
...
@@ -141,16 +146,16 @@ public class UserManageController {
}
@ApiOperation
(
value
=
"查询通讯录基本信息"
)
@
Ge
tMapping
(
"/findAddressBook"
)
public
ResponseEntity
findAddressBook
(){
@
Pos
tMapping
(
"/findAddressBook"
)
public
ResponseEntity
findAddressBook
(
@RequestBody
AddressRequest
addressRequest
){
try
{
List
<
SimpleUserVo
>
simpleUserVos
=
userManageService
.
findAddressBook
(
);
return
ok
(
simpleUserVos
);
PageResponse
pageResponse
=
userManageService
.
findAddressBook
(
addressRequest
);
return
ok
(
pageResponse
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
error
(
"查询通讯录信息失败"
);
}
return
ok
(
"查询通讯录信息失败"
);
}
}
notes-weekly/src/main/java/com/zjty/tynotes/weekly/subject/entity/vo/AddressRequest.java
0 → 100644
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
weekly
.
subject
.
entity
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @Author gwj
* @create 2020/5/13 10:18
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
AddressRequest
{
/**
* 每页显示个数
*/
private
int
pageSize
;
/**
* 当前页数
*/
private
int
currentPage
;
}
notes-weekly/src/main/java/com/zjty/tynotes/weekly/subject/service/UserManageService.java
浏览文件 @
41b39e0d
package
com
.
zjty
.
tynotes
.
weekly
.
subject
.
service
;
import
com.zjty.tynotes.pas.entity.Address
;
import
com.zjty.tynotes.pas.entity.Department
;
import
com.zjty.tynotes.pas.entity.User
;
import
com.zjty.tynotes.pas.entity.vo.PageRequest
;
import
com.zjty.tynotes.pas.entity.vo.PageResponse
;
import
com.zjty.tynotes.weekly.subject.entity.vo.AddressRequest
;
import
com.zjty.tynotes.weekly.subject.entity.vo.Problem
;
import
com.zjty.tynotes.weekly.subject.entity.vo.SimpleUserVo
;
import
com.zjty.tynotes.weekly.subject.entity.vo.UserVo
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.text.ParseException
;
import
java.util.List
;
...
...
@@ -83,7 +86,8 @@ public interface UserManageService {
* 查询通讯录信息
* @return
*/
List
<
SimpleUserVo
>
findAddressBook
();
PageResponse
findAddressBook
(
AddressRequest
addressRequest
);
// /**
// * 根据任务状态查询人员任务列表
...
...
notes-weekly/src/main/java/com/zjty/tynotes/weekly/subject/service/impl/UserManageServiceImpl.java
浏览文件 @
41b39e0d
...
...
@@ -10,6 +10,7 @@ import com.zjty.tynotes.pas.entity.*;
import
com.zjty.tynotes.pas.entity.vo.PageRequest
;
import
com.zjty.tynotes.pas.entity.vo.PageResponse
;
import
com.zjty.tynotes.weekly.subject.dao.ProblemDao
;
import
com.zjty.tynotes.weekly.subject.entity.vo.AddressRequest
;
import
com.zjty.tynotes.weekly.subject.entity.vo.Problem
;
import
com.zjty.tynotes.weekly.subject.entity.vo.SimpleUserVo
;
import
com.zjty.tynotes.weekly.subject.entity.vo.UserVo
;
...
...
@@ -18,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.lang.reflect.Array
;
import
java.math.BigDecimal
;
...
...
@@ -351,19 +353,49 @@ public class UserManageServiceImpl implements UserManageService {
* @return
*/
@Override
public
List
<
SimpleUserVo
>
findAddressBook
()
{
public
PageResponse
findAddressBook
(
AddressRequest
addressRequest
)
{
PageResponse
pageResponse
=
new
PageResponse
();
List
<
User
>
users
=
pasUserDao
.
findAll
();
List
<
SimpleUserVo
>
userList
=
new
ArrayList
<>();
List
<
Address
>
userList
=
new
ArrayList
<>();
List
<
Address
>
addressList
=
new
ArrayList
<>();
if
(
users
!=
null
){
users
.
forEach
(
user
->
{
if
(
user
.
getUsername
()!=
"root"
&&
user
.
getUsername
()!=
"HR"
){
userList
.
add
(
new
SimpleUserVo
(
user
));
if
(
(!
user
.
getUsername
().
equals
(
"root"
))
&&
(!
user
.
getUsername
().
equals
(
"HR"
))
){
userList
.
add
(
new
Address
(
user
));
}
});
}
return
userList
;
if
(
addressRequest
.
getCurrentPage
()<
1
){
addressRequest
.
setCurrentPage
(
1
);
}
int
totalPage
=
1
;
int
totalCount
=
0
;
if
(
userList
.
size
()==
0
){
totalPage
=
1
;
}
else
if
(
userList
.
size
()%
addressRequest
.
getPageSize
()==
0
){
totalPage
=
userList
.
size
()/(
addressRequest
.
getPageSize
());
}
else
{
totalPage
=
userList
.
size
()/(
addressRequest
.
getPageSize
())+
1
;
}
int
currentPage
=
addressRequest
.
getCurrentPage
();
int
pageSize
=
addressRequest
.
getPageSize
();
if
(
userList
.
size
()>(
currentPage
*
pageSize
)){
addressList
=
userList
.
subList
((
currentPage
-
1
)*
pageSize
,
currentPage
*
pageSize
);
}
else
if
(
userList
.
size
()<(
currentPage
-
1
)*
pageSize
){
addressList
=
new
ArrayList
<>();
}
else
{
addressList
=
userList
.
subList
((
currentPage
-
1
)*
pageSize
,
userList
.
size
());
}
totalCount
=
userList
.
size
();
pageResponse
.
setCurrentPage
(
addressRequest
.
getCurrentPage
());
pageResponse
.
setPageSize
(
addressRequest
.
getPageSize
());
pageResponse
.
setTotalCount
(
totalCount
);
pageResponse
.
setTotalPage
(
totalPage
);
pageResponse
.
setRows
(
addressList
);
return
pageResponse
;
}
/**
* 暂时没有用到
* @param des
...
...
pom.xml
浏览文件 @
41b39e0d
...
...
@@ -39,6 +39,7 @@
<module>
notes-weekly
</module>
<module>
notes-attendance
</module>
<module>
notes-log
</module>
<module>
notes-address
</module>
</modules>
<dependencyManagement>
...
...
@@ -104,6 +105,12 @@
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.zjty.tynotes
</groupId>
<artifactId>
notes-address
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
</dependencyManagement>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论