Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
notes2.0
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zjm
notes2.0
Commits
ec23ea46
提交
ec23ea46
authored
4月 07, 2020
作者:
gongwenjie
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'gwj' 到 'master'
Gwj 查看合并请求
!82
上级
b431b000
4b5edcb1
流水线
#123
已失败 于阶段
变更
13
流水线
1
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
144 行增加
和
72 行删除
+144
-72
ApprovalInformationDao.java
...m/zjty/tynotes/attendance/dao/ApprovalInformationDao.java
+3
-1
ApprovalInformation.java
...m/zjty/tynotes/attendance/entity/ApprovalInformation.java
+2
-2
AttendanceDetails.java
...com/zjty/tynotes/attendance/entity/AttendanceDetails.java
+7
-1
CardTask.java
.../main/java/com/zjty/tynotes/attendance/task/CardTask.java
+62
-12
UserController.java
.../java/com/zjty/tynotes/pas/controller/UserController.java
+8
-0
AuthorityDao.java
.../src/main/java/com/zjty/tynotes/pas/dao/AuthorityDao.java
+3
-0
PasUserDao.java
...as/src/main/java/com/zjty/tynotes/pas/dao/PasUserDao.java
+6
-2
RoleAuthorityDao.java
.../main/java/com/zjty/tynotes/pas/dao/RoleAuthorityDao.java
+2
-0
User.java
...s-pas/src/main/java/com/zjty/tynotes/pas/entity/User.java
+1
-1
PageRequest.java
...main/java/com/zjty/tynotes/pas/entity/vo/PageRequest.java
+5
-0
IUserService.java
.../main/java/com/zjty/tynotes/pas/service/IUserService.java
+7
-0
UserServiceImpl.java
...va/com/zjty/tynotes/pas/service/impl/UserServiceImpl.java
+31
-0
UserManageServiceImpl.java
...es/weekly/subject/service/impl/UserManageServiceImpl.java
+7
-53
没有找到文件。
notes-attendance/src/main/java/com/zjty/tynotes/attendance/dao/ApprovalInformationDao.java
浏览文件 @
ec23ea46
...
...
@@ -18,7 +18,9 @@ public interface ApprovalInformationDao extends MongoRepository<ApprovalInformat
List
<
ApprovalInformation
>
findAllByStatusIn
(
List
<
String
>
statusList
);
ApprovalInformation
findAllByUserIdAndLeaveStartTimeBeforeAndLeaveEndTimeAfterAndApprovalTypeIn
(
String
userId
,
Date
startTime
,
Date
endTime
,
List
<
String
>
type
);
ApprovalInformation
findAllByUserIdAndLeaveStartTimeLessThanEqualAndLeaveEndTimeGreaterThanEqualAndApprovalTypeIn
(
String
userId
,
Date
startTime
,
Date
endTime
,
List
<
String
>
type
);
ApprovalInformation
findAllByUserIdAndLeaveStartTimeBeforeAndLeaveEndTimeBetweenAndApprovalTypeIn
(
String
userId
,
Date
startTime
,
Date
startTime1
,
Date
endTime
,
List
<
String
>
type
);
...
...
notes-attendance/src/main/java/com/zjty/tynotes/attendance/entity/ApprovalInformation.java
浏览文件 @
ec23ea46
...
...
@@ -57,11 +57,11 @@ public class ApprovalInformation {
private
String
approvalLevel
;
@ApiModelProperty
(
value
=
"请假开始时间"
,
example
=
"2020-03-20 09:00:00"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
leaveStartTime
;
@ApiModelProperty
(
value
=
"请假结束时间"
,
example
=
"2020-03-21 09:00:00"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
leaveEndTime
;
@ApiModelProperty
(
value
=
"一级审批是否通过"
,
example
=
"0/1"
)
...
...
notes-attendance/src/main/java/com/zjty/tynotes/attendance/entity/AttendanceDetails.java
浏览文件 @
ec23ea46
...
...
@@ -16,7 +16,6 @@ import java.util.Date;
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"个人考勤信息"
,
description
=
"个人考勤信息"
)
@Document
(
collection
=
"ding_attendance"
)
public
class
AttendanceDetails
{
...
...
@@ -86,4 +85,11 @@ public class AttendanceDetails {
@ApiModelProperty
(
value
=
"时间"
,
example
=
"2020-03-22 09:00:00"
)
Date
date
;
public
AttendanceDetails
()
{
workOverHours
=
0
;
outSideBusinessDay
=
0
f
;
outWorkDay
=
0
f
;
sickLeaveDay
=
0
f
;
}
}
notes-attendance/src/main/java/com/zjty/tynotes/attendance/task/CardTask.java
浏览文件 @
ec23ea46
...
...
@@ -183,17 +183,18 @@ public class CardTask {
String
format1
=
sdf2
.
format
(
parse
);
Date
date1
=
sdf4
.
parse
(
format1
);
ApprovalInformation
approvalInformation
=
approvalInformationDao
.
findAllByUserIdAndLeaveStartTimeBeforeAndLeaveEndTimeAfterAndApprovalTypeIn
(
user
.
getId
(),
date
,
date1
,
type1
);
compute
(
approvalInformation
,
attendanceDetails
,
user
.
getId
(),
date
,
date1
,
type1
);
ApprovalInformation
approvalInformation1
=
approvalInformationDao
.
findAllByUserIdAndLeaveStartTimeBeforeAndLeaveEndTimeAfterAndApprovalTypeIn
(
user
.
getId
(),
date
,
date1
,
type2
);
compute
(
approvalInformation1
,
attendanceDetails
,
user
.
getId
(),
date
,
date1
,
type2
);
ApprovalInformation
approvalInformation2
=
approvalInformationDao
.
findAllByUserIdAndLeaveStartTimeBeforeAndLeaveEndTimeAfterAndApprovalTypeIn
(
user
.
getId
(),
date
,
date1
,
type3
);
compute
(
approvalInformation2
,
attendanceDetails
,
user
.
getId
(),
date
,
date1
,
type3
);
System
.
out
.
println
(
date
);
System
.
out
.
println
(
date1
);
List
<
ApprovalInformation
>
all
=
approvalInformationDao
.
findAll
();
System
.
out
.
println
(
"startTime"
+
all
.
get
(
0
).
getLeaveStartTime
()+
"\n"
+
"endTime"
+
all
.
get
(
0
).
getLeaveEndTime
());
ApprovalInformation
approvalInformation
=
approvalInformationDao
.
findAllByUserIdAndLeaveStartTimeLessThanEqualAndLeaveEndTimeGreaterThanEqualAndApprovalTypeIn
(
user
.
getId
(),
date
,
date1
,
type1
);
List
<
ApprovalInformation
>
compute
=
compute
(
approvalInformation
,
attendanceDetails
,
user
.
getId
(),
date
,
date1
,
type1
);
ApprovalInformation
approvalInformation1
=
approvalInformationDao
.
findAllByUserIdAndLeaveStartTimeLessThanEqualAndLeaveEndTimeGreaterThanEqualAndApprovalTypeIn
(
user
.
getId
(),
date
,
date1
,
type2
);
List
<
ApprovalInformation
>
compute1
=
compute
(
approvalInformation1
,
attendanceDetails
,
user
.
getId
(),
date
,
date1
,
type2
);
ApprovalInformation
approvalInformation2
=
approvalInformationDao
.
findAllByUserIdAndLeaveStartTimeLessThanEqualAndLeaveEndTimeGreaterThanEqualAndApprovalTypeIn
(
user
.
getId
(),
date
,
date1
,
type3
);
List
<
ApprovalInformation
>
compute2
=
compute
(
approvalInformation2
,
attendanceDetails
,
user
.
getId
(),
date
,
date1
,
type3
);
attendanceDetails
.
setUserId
(
user
.
getId
());
System
.
out
.
println
(
approvalInformation
);
System
.
out
.
println
(
approvalInformation1
);
System
.
out
.
println
(
approvalInformation2
);
if
(
cardResults1
!=
null
){
List
<
CardResult
>
cardResults
=
new
ArrayList
<>();
cardResults1
.
forEach
(
cardResult
->
{
...
...
@@ -211,13 +212,15 @@ public class CardTask {
attendanceDetails
.
setLessCard
(
0
);
}
else
if
(
cardResults
.
size
()==
1
){
attendanceDetails
.
setLessCard
(
1
);
if
(
approvalInformation
==
null
&&
approvalInformation1
==
null
&&
approvalInformation2
==
null
){
if
(
approvalInformation
==
null
&&
approvalInformation1
==
null
&&
approvalInformation2
==
null
&&
compute
==
null
&&
compute1
==
null
&&
compute2
==
null
){
attendanceDetails
.
setIsAbsenteeismDay
(
0
);
attendanceDetails
.
setAbsenteeismDay
(
0.5f
);
}
}
else
{
attendanceDetails
.
setLessCard
(
2
);
if
(
approvalInformation
==
null
&&
approvalInformation1
==
null
&&
approvalInformation2
==
null
){
if
(
approvalInformation
==
null
&&
approvalInformation1
==
null
&&
approvalInformation2
==
null
&&
compute
==
null
&&
compute1
==
null
&&
compute2
==
null
){
attendanceDetails
.
setIsAbsenteeismDay
(
0
);
attendanceDetails
.
setAbsenteeismDay
(
1
f
);
}
...
...
@@ -256,7 +259,9 @@ public class CardTask {
* @param date2
* @param types
*/
private
void
compute
(
ApprovalInformation
approvalInformation
,
AttendanceDetails
attendanceDetails
,
String
userId
,
Date
date1
,
Date
date2
,
List
<
String
>
types
){
private
List
<
ApprovalInformation
>
compute
(
ApprovalInformation
approvalInformation
,
AttendanceDetails
attendanceDetails
,
String
userId
,
Date
date1
,
Date
date2
,
List
<
String
>
types
){
List
<
ApprovalInformation
>
approvalInformationList
=
new
ArrayList
<>();
if
(
types
.
contains
(
"公出"
)){
if
(
approvalInformation
!=
null
){
attendanceDetails
.
setIsOutSideBusinessDay
(
0
);
attendanceDetails
.
setOutSideBusinessDay
(
1
f
);
...
...
@@ -266,14 +271,59 @@ public class CardTask {
if
(
approvalInformation1
!=
null
){
attendanceDetails
.
setIsOutSideBusinessDay
(
0
);
attendanceDetails
.
setOutSideBusinessDay
(
0.5f
);
approvalInformationList
.
add
(
approvalInformation1
);
}
if
(
approvalInformation2
!=
null
){
attendanceDetails
.
setIsOutSideBusinessDay
(
0
);
if
(
attendanceDetails
.
getOutSideBusinessDay
()!=
null
){
attendanceDetails
.
setOutSideBusinessDay
(
attendanceDetails
.
getOutSideBusinessDay
()+
0.5f
);
}
approvalInformationList
.
add
(
approvalInformation2
);
}
}
}
else
if
(
types
.
contains
(
"出差"
)){
if
(
approvalInformation
!=
null
){
attendanceDetails
.
setIsOutWorkDay
(
0
);
attendanceDetails
.
setOutWorkDay
(
1
f
);
}
else
{
ApprovalInformation
approvalInformation1
=
approvalInformationDao
.
findAllByUserIdAndLeaveStartTimeBeforeAndLeaveEndTimeBetweenAndApprovalTypeIn
(
userId
,
date1
,
date1
,
date2
,
types
);
ApprovalInformation
approvalInformation2
=
approvalInformationDao
.
findAllByUserIdAndLeaveStartTimeBetweenAndLeaveEndTimeAfterAndApprovalTypeIn
(
userId
,
date1
,
date2
,
date2
,
types
);
if
(
approvalInformation1
!=
null
){
attendanceDetails
.
setIsOutWorkDay
(
0
);
attendanceDetails
.
setOutWorkDay
(
0.5f
);
approvalInformationList
.
add
(
approvalInformation1
);
}
if
(
approvalInformation2
!=
null
){
attendanceDetails
.
setIsOutWorkDay
(
0
);
if
(
attendanceDetails
.
getOutWorkDay
()!=
null
){
attendanceDetails
.
setOutWorkDay
(
attendanceDetails
.
getOutSideBusinessDay
()+
0.5f
);
}
approvalInformationList
.
add
(
approvalInformation2
);
}
}
}
else
if
(
types
.
contains
(
"事假"
)
||
types
.
contains
(
"病假"
)
||
types
.
contains
(
"调休"
)){
if
(
approvalInformation
!=
null
){
attendanceDetails
.
setIsSickLeaveDay
(
0
);
attendanceDetails
.
setSickLeaveDay
(
1
f
);
}
else
{
ApprovalInformation
approvalInformation1
=
approvalInformationDao
.
findAllByUserIdAndLeaveStartTimeBeforeAndLeaveEndTimeBetweenAndApprovalTypeIn
(
userId
,
date1
,
date1
,
date2
,
types
);
ApprovalInformation
approvalInformation2
=
approvalInformationDao
.
findAllByUserIdAndLeaveStartTimeBetweenAndLeaveEndTimeAfterAndApprovalTypeIn
(
userId
,
date1
,
date2
,
date2
,
types
);
if
(
approvalInformation1
!=
null
){
attendanceDetails
.
setIsSickLeaveDay
(
0
);
attendanceDetails
.
setSickLeaveDay
(
0.5f
);
approvalInformationList
.
add
(
approvalInformation1
);
}
if
(
approvalInformation2
!=
null
){
attendanceDetails
.
setIsSickLeaveDay
(
0
);
if
(
attendanceDetails
.
getSickLeaveDay
()!=
null
){
attendanceDetails
.
setSickLeaveDay
(
attendanceDetails
.
getSickLeaveDay
()+
0.5f
);
}
approvalInformationList
.
add
(
approvalInformation2
);
}
}
}
return
approvalInformationList
;
}
/**
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/controller/UserController.java
浏览文件 @
ec23ea46
...
...
@@ -115,6 +115,14 @@ public class UserController {
return
ok
(
iUserService
.
findUserList
(
id
,
authoryName
));
}
@ApiOperation
(
value
=
"查询具有发布权限的人,也就是可选的审核者"
,
response
=
User
.
class
)
@GetMapping
(
"/findPublishUsers"
)
public
ResponseEntity
findPublishUsers
()
{
String
authoryName
=
"发布任务"
;
List
<
User
>
userList
=
iUserService
.
findPublishUsers
(
authoryName
);
return
ok
(
userList
);
}
@ApiOperation
(
value
=
"密码加密"
,
response
=
User
.
class
)
@GetMapping
(
"/encryPas"
)
public
ResponseEntity
encryPas
()
{
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/dao/AuthorityDao.java
浏览文件 @
ec23ea46
...
...
@@ -28,4 +28,7 @@ public interface AuthorityDao extends MongoRepository<Authority, String> {
void
deleteAllByNameIn
(
List
<
String
>
name
);
List
<
Authority
>
findAllByNameIn
(
List
<
String
>
name
);
Authority
findByName
(
String
authorityName
);
}
notes-pas/src/main/java/com/zjty/tynotes/pas/dao/PasUserDao.java
浏览文件 @
ec23ea46
...
...
@@ -74,7 +74,11 @@ public interface PasUserDao extends MongoRepository<User, String> {
*/
List
<
User
>
findAllByUsername
(
String
name
);
/**
* 根据用户状态查询用户
* @param status
* @return
*/
List
<
User
>
findAllByStatus
(
String
status
);
}
notes-pas/src/main/java/com/zjty/tynotes/pas/dao/RoleAuthorityDao.java
浏览文件 @
ec23ea46
...
...
@@ -18,4 +18,6 @@ public interface RoleAuthorityDao extends MongoRepository<RoleAuthority,String>
List
<
RoleAuthority
>
findAllByRoleIdIn
(
List
<
String
>
roleIds
);
List
<
RoleAuthority
>
findAllByRoleId
(
String
roleId
);
List
<
RoleAuthority
>
findAllByAuthorityId
(
String
authorityId
);
}
notes-pas/src/main/java/com/zjty/tynotes/pas/entity/User.java
浏览文件 @
ec23ea46
...
...
@@ -81,7 +81,7 @@ public class User implements UserDetails, Serializable {
@ApiModelProperty
(
value
=
"密码"
,
example
=
"password"
)
private
String
password
;
@ApiModelProperty
(
value
=
"人员状态"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"人员状态
0空闲1正常2忙碌
"
,
example
=
"1"
)
private
String
status
;
@ApiModelProperty
(
value
=
"任务数量"
,
example
=
"2"
)
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/entity/vo/PageRequest.java
浏览文件 @
ec23ea46
...
...
@@ -40,6 +40,11 @@ public class PageRequest {
*/
private
String
deId
;
/**
* 查询条件:人员状态
*/
private
String
status
;
/**
* 查询条件:任务数量升降序(默认降序0 1升序)
*/
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/service/IUserService.java
浏览文件 @
ec23ea46
...
...
@@ -170,4 +170,11 @@ public interface IUserService {
* @return
*/
JobLeads
findJobLeads
(
String
executorId
);
/**
* 查询所有具有发布任务权限的人
* @param authoryName
* @return
*/
List
<
User
>
findPublishUsers
(
String
authoryName
);
}
notes-pas/src/main/java/com/zjty/tynotes/pas/service/impl/UserServiceImpl.java
浏览文件 @
ec23ea46
...
...
@@ -769,6 +769,37 @@ public class UserServiceImpl implements IUserService {
return
jobLeads
;
}
@Override
public
List
<
User
>
findPublishUsers
(
String
authoryName
)
{
List
<
User
>
userList
=
new
ArrayList
<>();
Authority
authority
=
authorityDao
.
findByName
(
authoryName
);
String
id
=
authority
.
getId
();
List
<
RoleAuthority
>
roleAuthorities
=
roleAuthorityDao
.
findAllByAuthorityId
(
id
);
if
(
roleAuthorities
!=
null
){
List
<
String
>
roleIds
=
new
ArrayList
<>();
List
<
String
>
userIds
=
new
ArrayList
<>();
roleAuthorities
.
forEach
(
roleAuthority
->
{
roleIds
.
add
(
roleAuthority
.
getRoleId
());
});
List
<
UserRole
>
userRoles
=
userRoleDao
.
findAllByRoleIdIn
(
roleIds
);
if
(
userRoles
!=
null
){
userRoles
.
forEach
(
userRole
->
{
String
userId
=
userRole
.
getUserId
();
if
(!
userIds
.
contains
(
userId
)){
userIds
.
add
(
userId
);
}
});
}
userIds
.
forEach
(
userId
->
{
User
user
=
findUserById
(
userId
);
userList
.
add
(
user
);
});
}
return
userList
;
}
}
notes-weekly/src/main/java/com/zjty/tynotes/weekly/subject/service/impl/UserManageServiceImpl.java
浏览文件 @
ec23ea46
...
...
@@ -85,7 +85,13 @@ public class UserManageServiceImpl implements UserManageService {
List
<
UserVo
>
userVos
=
new
ArrayList
<>();
PageResponse
<
UserVo
>
pageResponse
=
new
PageResponse
();
String
deId
=
pageRequest
.
getDeId
();
List
<
User
>
users
=
pasUserDao
.
findAll
();
List
<
User
>
users
=
null
;
if
(
pageRequest
.
getStatus
()!=
null
){
String
status
=
pageRequest
.
getStatus
();
users
=
pasUserDao
.
findAllByStatus
(
status
);
}
else
{
users
=
pasUserDao
.
findAll
();
}
List
<
User
>
userList
=
new
ArrayList
<>();
if
(
users
!=
null
){
for
(
User
user
:
users
)
{
...
...
@@ -161,58 +167,6 @@ public class UserManageServiceImpl implements UserManageService {
return
pageResponse
;
}
// List<User> users = new ArrayList<>();
// PageResponse<UserVo> pageResponse = new PageResponse<>();
// pageResponse.setCurrentPage(pageRequest.getCurrentPage());
// pageResponse.setPageSize(pageRequest.getPageSize());
// if(pageRequest.getDeId()!=null){
// users = pasUserDao.findAllByDepartmentId(pageRequest.getId());
// }else{
// List<Department> departmentList = findDepartmentList(pageRequest.getId());
// List<String> departmentIds = new ArrayList<>();
// for (Department department : departmentList) {
// departmentIds.add(department.getId());
// }
// users = pasUserDao.findAllByDepartmentIdIn(departmentIds);
// }
// List<String> userIds = new ArrayList<>();
// for (User user : users) {
// userIds.add(user.getId());
// }
// List<Personnel> personnels = internalService.personnels(userIds);
// List<UserVo> userVos = new ArrayList<>();
// for (User user : users) {
// for (Personnel personnel : personnels) {
// if(user.getId().equals(personnel.getId())){
// UserVo userVo = new UserVo(user);
// userVo.setWorkCount(personnel.getCount());
// userVos.add(userVo);
// }
// }
// }
//
// if(pageRequest.getSort()!=null && pageRequest.getSort()==1) {
// Collections.sort(userVos, new Comparator<UserVo>() {
// @Override
// public int compare(UserVo o1, UserVo o2) {
// return o1.getWorkCount()-o2.getWorkCount();
// }
// });
// }else{
// Collections.sort(userVos, new Comparator<UserVo>() {
// @Override
// public int compare(UserVo o1, UserVo o2) {
// return o2.getWorkCount()-o1.getWorkCount();
// }
// });
// }
// int startNum=(pageResponse.getCurrentPage()-1)*10+1;
// int endNum = startNum+pageResponse.getPageSize();
// List<UserVo> userVos1 = userVos.subList(startNum - 1, endNum - 1);
// pageResponse.setRows(userVos1);
// pageResponse.setTotalPage((userVos.size()/pageResponse.getPageSize())+1);
// pageResponse.setTotalCount(userVos.size());
// return null;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论