Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
notes2.0
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zjm
notes2.0
Commits
10d26492
提交
10d26492
authored
4月 10, 2020
作者:
gongwenjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge branch 'master' of git.yfzx.zjtys.com.cn:zjm/notes2.0
# Conflicts: # notes-attendance/src/main/java/com/zjty/tynotes/attendance/controller/AttendanceController.java
上级
3b1d11fd
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
305 行增加
和
53 行删除
+305
-53
DingTestController.java
...jty/tynotes/attendance/controller/DingTestController.java
+28
-2
ApprovalInformationDao.java
...m/zjty/tynotes/attendance/dao/ApprovalInformationDao.java
+4
-4
AttendanceDetails.java
...com/zjty/tynotes/attendance/entity/AttendanceDetails.java
+22
-7
ApprovalInformationServiceImpl.java
...tendance/service/impl/ApprovalInformationServiceImpl.java
+1
-1
CardTask.java
.../main/java/com/zjty/tynotes/attendance/task/CardTask.java
+0
-0
UserWorkData.java
...a/com/zjty/tynotes/job/status/entity/vo/UserWorkData.java
+31
-0
InternalService.java
.../com/zjty/tynotes/job/status/service/InternalService.java
+13
-0
InternalServiceImpl.java
.../tynotes/job/status/service/impl/InternalServiceImpl.java
+12
-0
DayDao.java
notes-pas/src/main/java/com/zjty/tynotes/pas/dao/DayDao.java
+7
-1
RoleDao.java
...s-pas/src/main/java/com/zjty/tynotes/pas/dao/RoleDao.java
+9
-0
UserRoleDao.java
...s/src/main/java/com/zjty/tynotes/pas/dao/UserRoleDao.java
+1
-0
Day.java
notes-pas/src/main/java/com/zjty/tynotes/pas/entity/Day.java
+2
-0
PageRequest.java
...main/java/com/zjty/tynotes/pas/entity/vo/PageRequest.java
+15
-0
ConfigServiceImpl.java
.../com/zjty/tynotes/pas/service/impl/ConfigServiceImpl.java
+61
-29
UserServiceImpl.java
...va/com/zjty/tynotes/pas/service/impl/UserServiceImpl.java
+44
-3
UnionApplication.java
...rc/main/java/com/zjty/tynotes/union/UnionApplication.java
+3
-3
UserVo.java
...ava/com/zjty/tynotes/weekly/subject/entity/vo/UserVo.java
+10
-0
UserManageServiceImpl.java
...es/weekly/subject/service/impl/UserManageServiceImpl.java
+42
-3
没有找到文件。
notes-attendance/src/main/java/com/zjty/tynotes/attendance/controller/DingTestController.java
浏览文件 @
10d26492
...
@@ -2,7 +2,11 @@ package com.zjty.tynotes.attendance.controller;
...
@@ -2,7 +2,11 @@ package com.zjty.tynotes.attendance.controller;
import
com.dingtalk.api.DefaultDingTalkClient
;
import
com.dingtalk.api.DefaultDingTalkClient
;
import
com.dingtalk.api.DingTalkClient
;
import
com.dingtalk.api.DingTalkClient
;
import
com.dingtalk.api.request.OapiAttendanceListRecordRequest
;
import
com.dingtalk.api.request.OapiAttendanceListRequest
;
import
com.dingtalk.api.request.OapiUserGetRequest
;
import
com.dingtalk.api.request.OapiUserGetRequest
;
import
com.dingtalk.api.response.OapiAttendanceListRecordResponse
;
import
com.dingtalk.api.response.OapiAttendanceListResponse
;
import
com.dingtalk.api.response.OapiDepartmentListResponse
;
import
com.dingtalk.api.response.OapiDepartmentListResponse
;
import
com.dingtalk.api.response.OapiUserGetResponse
;
import
com.dingtalk.api.response.OapiUserGetResponse
;
import
com.taobao.api.ApiException
;
import
com.taobao.api.ApiException
;
...
@@ -58,8 +62,30 @@ public class DingTestController {
...
@@ -58,8 +62,30 @@ public class DingTestController {
@GetMapping
(
"/card"
)
@GetMapping
(
"/card"
)
public
Object
card
(){
public
Object
card
(){
List
<
CardResult
>
cardDetails
=
cardTask
.
getCardDetails
();
myInit
.
getToken
();
return
cardDetails
;
myInit
.
getDepartmentList
();
myInit
.
getUserList
();
List
<
String
>
userIds
=
myInit
.
userIds
;
DingTalkClient
client
=
new
DefaultDingTalkClient
(
"https://oapi.dingtalk.com/attendance/listRecord"
);
OapiAttendanceListRecordRequest
request
=
new
OapiAttendanceListRecordRequest
();
request
.
setCheckDateFrom
(
"2020-04-04 00:00:00"
);
request
.
setCheckDateTo
(
"2020-04-10 00:00:00"
);
request
.
setUserIds
(
userIds
);
try
{
OapiAttendanceListRecordResponse
execute
=
client
.
execute
(
request
,
myInit
.
token
);
List
<
OapiAttendanceListRecordResponse
.
Recordresult
>
recordresult
=
execute
.
getRecordresult
();
return
recordresult
;
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
}
@GetMapping
(
"/score"
)
public
Object
score
(){
String
month
=
"2020-04"
;
Double
aDouble
=
cardTask
.
calcuteScore
(
month
);
return
aDouble
;
}
}
}
notes-attendance/src/main/java/com/zjty/tynotes/attendance/dao/ApprovalInformationDao.java
浏览文件 @
10d26492
...
@@ -18,11 +18,11 @@ public interface ApprovalInformationDao extends MongoRepository<ApprovalInformat
...
@@ -18,11 +18,11 @@ public interface ApprovalInformationDao extends MongoRepository<ApprovalInformat
List
<
ApprovalInformation
>
findAllByStatusIn
(
List
<
String
>
statusList
);
List
<
ApprovalInformation
>
findAllByStatusIn
(
List
<
String
>
statusList
);
ApprovalInformation
findByUserIdAndStatusAndApprovalType
(
String
userId
,
String
status
,
String
type
);
List
<
ApprovalInformation
>
findAllByUserIdAndLeaveStartTimeLessThanEqualAndLeaveEndTimeGreaterThanEqualAndStatus
(
String
userId
,
Date
startTime
,
Date
endTime
,
String
status
);
ApprovalInformation
findAllByUserIdAndLeaveStartTime
LessThanEqualAndLeaveEndTimeGreaterThanEqualAndApprovalTypeIn
(
String
userId
,
Date
startTime
,
Date
endTime
,
List
<
String
>
type
);
ApprovalInformation
findAllByUserIdAndLeaveStartTime
BeforeAndLeaveEndTimeBetweenAndApprovalTypeAndStatus
(
String
userId
,
Date
startTime
,
Date
startTime1
,
Date
endTime
,
String
type
,
String
status
);
ApprovalInformation
findAllByUserIdAndLeaveStartTimeBeforeAndLeaveEndTimeBetweenAndApprovalTypeIn
(
String
userId
,
Date
startTime
,
Date
startTime1
,
Date
endTime
,
List
<
String
>
type
);
ApprovalInformation
findAllByUserIdAndLeaveStartTimeBetweenAndLeaveEndTimeAfterAndApprovalTypeAndStatus
(
String
userId
,
Date
startTime
,
Date
endTime
,
Date
endTime1
,
String
type
,
String
status
);
ApprovalInformation
findAllByUserIdAndLeaveStartTimeBetweenAndLeaveEndTimeAfterAndApprovalTypeIn
(
String
userId
,
Date
startTime
,
Date
endTime
,
Date
endTime1
,
List
<
String
>
type
);
}
}
notes-attendance/src/main/java/com/zjty/tynotes/attendance/entity/AttendanceDetails.java
浏览文件 @
10d26492
...
@@ -41,9 +41,15 @@ public class AttendanceDetails {
...
@@ -41,9 +41,15 @@ public class AttendanceDetails {
@ApiModelProperty
(
value
=
"是否迟到0为迟到/1为未迟到"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"是否迟到0为迟到/1为未迟到"
,
example
=
"1"
)
Integer
isLateDay
;
Integer
isLateDay
;
@ApiModelProperty
(
value
=
"迟到等级0轻(15分钟以内)/1较轻(1小时以内)/2较严重(4小时以内)/3严重(4小时以上)"
,
example
=
"1"
)
Integer
lateStatus
;
@ApiModelProperty
(
value
=
"是否早退0为早退/1为未早退"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"是否早退0为早退/1为未早退"
,
example
=
"1"
)
Integer
isLeaveEarlyDay
;
Integer
isLeaveEarlyDay
;
@ApiModelProperty
(
value
=
"早退等级0轻/1较轻/2较严重/3严重"
,
example
=
"1"
)
Integer
earlyStatus
;
@ApiModelProperty
(
value
=
"缺卡次数"
,
example
=
"2"
)
@ApiModelProperty
(
value
=
"缺卡次数"
,
example
=
"2"
)
Integer
lessCard
;
Integer
lessCard
;
...
@@ -59,16 +65,22 @@ public class AttendanceDetails {
...
@@ -59,16 +65,22 @@ public class AttendanceDetails {
@ApiModelProperty
(
value
=
"加班时长"
,
example
=
"4"
)
@ApiModelProperty
(
value
=
"加班时长"
,
example
=
"4"
)
Integer
workOverHours
;
Integer
workOverHours
;
// @ApiModelProperty(value = "是否调休0为调休/1为未调休",example = "1")
@ApiModelProperty
(
value
=
"是否调休0为调休/1为未调休"
,
example
=
"1"
)
// Integer isPaidLeaveDay;
Integer
isPaidLeaveDay
;
//
// @ApiModelProperty(value = "调休时长",example = "1")
@ApiModelProperty
(
value
=
"调休时长"
,
example
=
"1"
)
// Float paidLeaveDay;
Float
paidLeaveDay
;
@ApiModelProperty
(
value
=
"是否事假0为事假/1为未事假"
,
example
=
"1"
)
Integer
isThingLeaveDay
;
@ApiModelProperty
(
value
=
"事假天数"
,
example
=
"1"
)
Float
thingLeaveDay
;
@ApiModelProperty
(
value
=
"是否
请假0为请假/1为未请
假"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"是否
病假0为病假/1为未病
假"
,
example
=
"1"
)
Integer
isSickLeaveDay
;
Integer
isSickLeaveDay
;
@ApiModelProperty
(
value
=
"
请
假时长"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"
病
假时长"
,
example
=
"1"
)
Float
sickLeaveDay
;
Float
sickLeaveDay
;
@ApiModelProperty
(
value
=
"是否公出"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"是否公出"
,
example
=
"1"
)
...
@@ -87,9 +99,12 @@ public class AttendanceDetails {
...
@@ -87,9 +99,12 @@ public class AttendanceDetails {
Date
date
;
Date
date
;
public
AttendanceDetails
()
{
public
AttendanceDetails
()
{
thingLeaveDay
=
0
f
;
paidLeaveDay
=
0
f
;
workOverHours
=
0
;
workOverHours
=
0
;
outSideBusinessDay
=
0
f
;
outSideBusinessDay
=
0
f
;
outWorkDay
=
0
f
;
outWorkDay
=
0
f
;
sickLeaveDay
=
0
f
;
sickLeaveDay
=
0
f
;
absenteeismDay
=
0
f
;
}
}
}
}
notes-attendance/src/main/java/com/zjty/tynotes/attendance/service/impl/ApprovalInformationServiceImpl.java
浏览文件 @
10d26492
...
@@ -276,7 +276,7 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic
...
@@ -276,7 +276,7 @@ public class ApprovalInformationServiceImpl implements ApprovalInformationServic
/**
/**
* 计算调休时长,请假时长
* 计算调休时长,请假时长
*/
*/
p
rivate
Long
computeTime
(
Date
startTime
,
Date
endTime
)
throws
Exception
{
p
ublic
Long
computeTime
(
Date
startTime
,
Date
endTime
)
throws
Exception
{
Config
config
=
configDao
.
findAll
().
get
(
0
);
Config
config
=
configDao
.
findAll
().
get
(
0
);
String
workTime
=
config
.
getWorkTime
();
//上班时间
String
workTime
=
config
.
getWorkTime
();
//上班时间
String
afterWorkTime
=
config
.
getAfterWorkTime
();
//下班时间
String
afterWorkTime
=
config
.
getAfterWorkTime
();
//下班时间
...
...
notes-attendance/src/main/java/com/zjty/tynotes/attendance/task/CardTask.java
浏览文件 @
10d26492
差异被折叠。
点击展开。
notes-job/src/main/java/com/zjty/tynotes/job/status/entity/vo/UserWorkData.java
0 → 100644
浏览文件 @
10d26492
package
com
.
zjty
.
tynotes
.
job
.
status
.
entity
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @Author gwj
* @create 2020/4/10 13:41
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"返给人员模块的数据协议类"
,
description
=
"人员的任务信息"
)
public
class
UserWorkData
{
@ApiModelProperty
(
value
=
"人员id"
,
example
=
"qwer1234"
)
private
String
userId
;
@ApiModelProperty
(
value
=
"任务平均分"
,
example
=
"70"
)
private
Double
averageScore
;
@ApiModelProperty
(
value
=
"已完成任务个数"
,
example
=
"3"
)
private
Integer
completedNum
;
@ApiModelProperty
(
value
=
"进行中任务个数"
,
example
=
"2"
)
private
Integer
unCompletedNum
;
}
notes-job/src/main/java/com/zjty/tynotes/job/status/service/InternalService.java
浏览文件 @
10d26492
package
com
.
zjty
.
tynotes
.
job
.
status
.
service
;
package
com
.
zjty
.
tynotes
.
job
.
status
.
service
;
import
com.zjty.tynotes.job.status.entity.Personnel
;
import
com.zjty.tynotes.job.status.entity.Personnel
;
import
com.zjty.tynotes.job.status.entity.vo.UserWorkData
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -20,4 +22,15 @@ public interface InternalService {
...
@@ -20,4 +22,15 @@ public interface InternalService {
* 根据人员id返回任务数量
* 根据人员id返回任务数量
*/
*/
int
personnelWorkCount
(
String
id
);
int
personnelWorkCount
(
String
id
);
/**
* 根据时间区间查找人员任务信息
* @param userId
* @param startTime
* @param endTime
* @return
*/
UserWorkData
personnelWorkMsg
(
String
userId
,
Date
startTime
,
Date
endTime
);
UserWorkData
personnelWorkMsgAll
(
String
userId
);
}
}
notes-job/src/main/java/com/zjty/tynotes/job/status/service/impl/InternalServiceImpl.java
浏览文件 @
10d26492
...
@@ -6,6 +6,7 @@ import com.zjty.tynotes.job.common.exception.WorkAttribution;
...
@@ -6,6 +6,7 @@ import com.zjty.tynotes.job.common.exception.WorkAttribution;
import
com.zjty.tynotes.job.common.exception.WorkAttribution1
;
import
com.zjty.tynotes.job.common.exception.WorkAttribution1
;
import
com.zjty.tynotes.job.status.entity.Personnel
;
import
com.zjty.tynotes.job.status.entity.Personnel
;
import
com.zjty.tynotes.job.status.entity.RedisPersonalWork
;
import
com.zjty.tynotes.job.status.entity.RedisPersonalWork
;
import
com.zjty.tynotes.job.status.entity.vo.UserWorkData
;
import
com.zjty.tynotes.job.status.service.InternalService
;
import
com.zjty.tynotes.job.status.service.InternalService
;
import
com.zjty.tynotes.pas.service.IUserService
;
import
com.zjty.tynotes.pas.service.IUserService
;
import
com.zjty.tynotes.search.subject.service.EsUtil
;
import
com.zjty.tynotes.search.subject.service.EsUtil
;
...
@@ -15,6 +16,7 @@ import org.springframework.data.redis.core.RedisTemplate;
...
@@ -15,6 +16,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
@Service
@Service
public
class
InternalServiceImpl
implements
InternalService
{
public
class
InternalServiceImpl
implements
InternalService
{
...
@@ -62,4 +64,14 @@ public class InternalServiceImpl implements InternalService {
...
@@ -62,4 +64,14 @@ public class InternalServiceImpl implements InternalService {
return
count
;
return
count
;
}
}
@Override
public
UserWorkData
personnelWorkMsg
(
String
userId
,
Date
startTime
,
Date
endTime
)
{
return
null
;
}
@Override
public
UserWorkData
personnelWorkMsgAll
(
String
userId
)
{
return
null
;
}
}
}
notes-pas/src/main/java/com/zjty/tynotes/pas/dao/DayDao.java
浏览文件 @
10d26492
...
@@ -11,9 +11,15 @@ import java.util.List;
...
@@ -11,9 +11,15 @@ import java.util.List;
* @create 2020/3/1 11:14
* @create 2020/3/1 11:14
*/
*/
public
interface
DayDao
extends
MongoRepository
<
Day
,
String
>
{
public
interface
DayDao
extends
MongoRepository
<
Day
,
String
>
{
List
<
Day
>
findAllByStatusAndDateBetween
(
String
status
,
Date
startDate
,
Date
lastDate
);
Day
findByStatusAndDateEquals
(
String
status
,
Date
startDate
);
List
<
Day
>
findAllByStatusAndDateBetween
(
String
status
,
Date
startDate
,
Date
lastDate
);
// List<Day> findAllByStatusAndDateGreaterThanEqual(String status, Date startDate);
// List<Day> findAllByStatusAndDateLessThanEqual(String status, Date lastDate);
// List<Day> findAllByStatusAndDateWithin(String status,Date startDate, Date lastDate);
List
<
Day
>
findAllByDateBetween
(
Date
startDate
,
Date
lastDate
);
List
<
Day
>
findAllByDateBetween
(
Date
startDate
,
Date
lastDate
);
Day
findByDateEquals
(
Date
date
);
Day
findByDate
(
Date
date
);
Day
findByDate
(
Date
date
);
}
}
notes-pas/src/main/java/com/zjty/tynotes/pas/dao/RoleDao.java
浏览文件 @
10d26492
...
@@ -24,4 +24,13 @@ public interface RoleDao extends MongoRepository<Role, String> {
...
@@ -24,4 +24,13 @@ public interface RoleDao extends MongoRepository<Role, String> {
void
deleteByName
(
String
name
);
void
deleteByName
(
String
name
);
Role
findByName
(
String
name
);
Role
findByName
(
String
name
);
/**
* 查询在该角色id内,以及根据角色是否为领导查询角色集合
* @param ids
* @param isLeader
* @return
*/
List
<
Role
>
findAllByIdInAndIsLeader
(
List
<
String
>
ids
,
String
isLeader
);
}
}
notes-pas/src/main/java/com/zjty/tynotes/pas/dao/UserRoleDao.java
浏览文件 @
10d26492
...
@@ -17,4 +17,5 @@ public interface UserRoleDao extends MongoRepository<UserRole,String> {
...
@@ -17,4 +17,5 @@ public interface UserRoleDao extends MongoRepository<UserRole,String> {
void
deleteAllByUserId
(
String
userId
);
void
deleteAllByUserId
(
String
userId
);
List
<
UserRole
>
findAllByRoleIdIn
(
List
<
String
>
roleIds
);
List
<
UserRole
>
findAllByRoleIdIn
(
List
<
String
>
roleIds
);
}
}
notes-pas/src/main/java/com/zjty/tynotes/pas/entity/Day.java
浏览文件 @
10d26492
package
com
.
zjty
.
tynotes
.
pas
.
entity
;
package
com
.
zjty
.
tynotes
.
pas
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
...
@@ -28,6 +29,7 @@ public class Day {
...
@@ -28,6 +29,7 @@ public class Day {
@NotEmpty
(
message
=
"节假日日期"
)
@NotEmpty
(
message
=
"节假日日期"
)
@ApiModelProperty
(
value
=
"节假日日期"
,
example
=
"2020/2/1"
)
@ApiModelProperty
(
value
=
"节假日日期"
,
example
=
"2020/2/1"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
date
;
private
Date
date
;
@ApiModelProperty
(
value
=
"节假日描述,为工作日还是休息日还是团建,默认0为工作日,1为休息日,2为团建"
,
example
=
"0"
)
@ApiModelProperty
(
value
=
"节假日描述,为工作日还是休息日还是团建,默认0为工作日,1为休息日,2为团建"
,
example
=
"0"
)
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/entity/vo/PageRequest.java
浏览文件 @
10d26492
package
com
.
zjty
.
tynotes
.
pas
.
entity
.
vo
;
package
com
.
zjty
.
tynotes
.
pas
.
entity
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
/**
* @Author gwj
* @Author gwj
* @create 2020/3/2 11:02
* @create 2020/3/2 11:02
...
@@ -49,4 +52,16 @@ public class PageRequest {
...
@@ -49,4 +52,16 @@ public class PageRequest {
* 查询条件:任务数量升降序(默认降序0 1升序)
* 查询条件:任务数量升降序(默认降序0 1升序)
*/
*/
private
Integer
sort
;
private
Integer
sort
;
/**
* 起始时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
/**
* 结束时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
}
}
notes-pas/src/main/java/com/zjty/tynotes/pas/service/impl/ConfigServiceImpl.java
浏览文件 @
10d26492
...
@@ -77,46 +77,78 @@ public class ConfigServiceImpl implements ConfigService {
...
@@ -77,46 +77,78 @@ public class ConfigServiceImpl implements ConfigService {
public
List
<
Day
>
findHolidaysByMonth
(
String
date
)
{
public
List
<
Day
>
findHolidaysByMonth
(
String
date
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM"
);
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd 00:00:00"
);
SimpleDateFormat
sdf2
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
try
{
try
{
Date
date1
=
sdf
.
parse
(
date
);
int
year
=
date1
.
getYear
()+
1900
;
int
month
=
date1
.
getMonth
()+
1
;
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
YEAR
,
year
);
Date
parse
=
sdf
.
parse
(
date
);
calendar
.
set
(
Calendar
.
MONTH
,
month
-
1
);
calendar
.
setTime
(
parse
);
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
2
);
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
Date
firstDate
=
calendar
.
getTime
();
Date
startTime
=
calendar
.
getTime
();
calendar
.
set
(
Calendar
.
MONTH
,
month
);
System
.
out
.
println
(
startTime
);
calendar
.
add
(
Calendar
.
MONTH
,
1
);
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
0
);
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
0
);
Date
lastDate
=
calendar
.
getTime
();
Date
endTime
=
calendar
.
getTime
();
List
<
Day
>
days
=
dayDao
.
findAllByDateBetween
(
firstDate
,
lastDate
);
List
<
Day
>
days
=
dayDao
.
findAllByDateBetween
(
startTime
,
endTime
);
List
<
Day
>
days1
=
new
ArrayList
<>();
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
if
(
days
==
null
||
days
.
size
()==
0
){
if
(
days
==
null
||
days
.
size
()==
0
){
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
2
);
System
.
out
.
println
(
calendar
.
getTime
());
List
<
String
>
fullDayList
=
new
ArrayList
<>(
32
);
int
count
=
calendar
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
);
int
count
=
calendar
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
);
for
(
int
j
=
1
;
j
<=
count
;
j
++)
{
for
(
int
j
=
1
;
j
<=
count
;
j
++)
{
fullDayList
.
add
(
sdf1
.
format
(
calendar
.
getTime
()));
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
1
);
}
List
<
Day
>
days1
=
new
ArrayList
<>();
for
(
String
string
:
fullDayList
)
{
Day
day
=
new
Day
();
Day
day
=
new
Day
();
day
.
setStatus
(
"0"
);
day
.
setStatus
(
"0"
);
day
.
setDate
(
sdf1
.
parse
(
string
));
day
.
setDate
(
calendar
.
getTime
(
));
days1
.
add
(
day
);
days1
.
add
(
day
);
calendar
.
add
(
Calendar
.
DATE
,
1
);
}
}
return
dayDao
.
saveAll
(
days1
);
List
<
Day
>
days2
=
dayDao
.
saveAll
(
days1
);
days
=
days2
;
}
else
{
Day
startDay
=
dayDao
.
findByDateEquals
(
startTime
);
System
.
out
.
println
(
startDay
);
Day
endDay
=
dayDao
.
findByDateEquals
(
endTime
);
days
.
add
(
startDay
);
days
.
add
(
endDay
);
}
}
calendar
.
set
(
Calendar
.
MONTH
,
month
-
1
);
// Date date1 = sdf.parse(date);
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
0
);
// int year = date1.getYear()+1900;
firstDate
=
calendar
.
getTime
();
// int month = date1.getMonth()+1;
calendar
.
set
(
Calendar
.
MONTH
,
month
);
// Calendar calendar = Calendar.getInstance();
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
// calendar.set(Calendar.YEAR,year);
lastDate
=
calendar
.
getTime
();
// calendar.set(Calendar.MONTH,month-1);
return
dayDao
.
findAllByDateBetween
(
firstDate
,
lastDate
);
// calendar.set(Calendar.DAY_OF_MONTH,2);
// Date firstDate = calendar.getTime();
// calendar.set(Calendar.MONTH,month);
// calendar.set(Calendar.DAY_OF_MONTH,0);
// Date lastDate = calendar.getTime();
// List<Day> days = dayDao.findAllByDateBetween(firstDate, lastDate);
// if(days==null || days.size()==0){
//
// calendar.set(Calendar.DAY_OF_MONTH,2);
// System.out.println(calendar.getTime());
// List<String> fullDayList = new ArrayList<>(32);
// int count = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
// for (int j = 1; j <= count ; j++) {
// fullDayList.add(sdf1.format(calendar.getTime()));
// calendar.add(Calendar.DAY_OF_MONTH,1);
// }
// List<Day> days1 = new ArrayList<>();
// for (String string : fullDayList) {
// Day day = new Day();
// day.setStatus("0");
// day.setDate(sdf1.parse(string));
// days1.add(day);
// }
// return dayDao.saveAll(days1);
// }
// calendar.set(Calendar.MONTH,month-1);
// calendar.set(Calendar.DAY_OF_MONTH,0);
// firstDate = calendar.getTime();
// calendar.set(Calendar.MONTH,month);
// calendar.set(Calendar.DAY_OF_MONTH,1);
// lastDate = calendar.getTime();
// return dayDao.findAllByDateBetween(firstDate,lastDate);
return
days
;
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
}
}
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/service/impl/UserServiceImpl.java
浏览文件 @
10d26492
...
@@ -329,14 +329,48 @@ public class UserServiceImpl implements IUserService {
...
@@ -329,14 +329,48 @@ public class UserServiceImpl implements IUserService {
List
<
String
>
departmentList
=
findDepartmentList
(
userId
,
authoryName
);
List
<
String
>
departmentList
=
findDepartmentList
(
userId
,
authoryName
);
List
<
User
>
all
=
pasUserDao
.
findAll
();
List
<
User
>
all
=
pasUserDao
.
findAll
();
List
<
User
>
users
=
new
ArrayList
<>();
List
<
User
>
users
=
new
ArrayList
<>();
List
<
UserRole
>
userRoleList
=
userRoleDao
.
findAllByUserId
(
userId
);
List
<
String
>
deIds
=
new
ArrayList
<>();
if
(
userRoleList
!=
null
){
List
<
String
>
roleIds1
=
new
ArrayList
<>();
userRoleList
.
forEach
(
userRole
->
{
roleIds1
.
add
(
userRole
.
getRoleId
());
});
List
<
Role
>
roles
=
roleDao
.
findAllByIdIn
(
roleIds1
);
if
(
roles
!=
null
){
roles
.
forEach
(
role
->
{
if
(
role
.
getIsLeader
().
equals
(
"1"
)){
deIds
.
add
(
role
.
getDepartmentId
());
}
});
}
}
if
(
all
!=
null
){
if
(
all
!=
null
){
for
(
User
user
:
all
)
{
for
(
User
user
:
all
)
{
List
<
String
>
departmentIds
=
user
.
getDepartmentIds
();
List
<
String
>
departmentIds
=
user
.
getDepartmentIds
();
if
(
departmentIds
!=
null
){
if
(
departmentIds
!=
null
){
for
(
String
departId
:
departmentIds
)
{
for
(
String
departId
:
departmentIds
)
{
if
(
departmentList
.
contains
(
departId
)){
if
(
departmentList
.
contains
(
departId
)){
users
.
add
(
user
);
if
(
deIds
.
contains
(
departId
)){
List
<
String
>
roleIdList
=
new
ArrayList
<>();
List
<
UserRole
>
userRoles
=
userRoleDao
.
findAllByUserId
(
userId
);
if
(
userRoles
!=
null
){
userRoles
.
forEach
(
userRole
->
{
roleIdList
.
add
(
userRole
.
getRoleId
());
});
}
List
<
Role
>
roles
=
roleDao
.
findAllByIdIn
(
roleIdList
);
if
(
roles
!=
null
){
roles
.
forEach
(
role
->
{
if
(
role
.
getDepartmentId
().
equals
(
departId
)&&
role
.
getIsLeader
().
equals
(
"1"
)){
users
.
add
(
user
);
}
});
}
}
else
{
users
.
add
(
user
);
}
break
;
break
;
}
}
}
}
...
@@ -776,12 +810,19 @@ public class UserServiceImpl implements IUserService {
...
@@ -776,12 +810,19 @@ public class UserServiceImpl implements IUserService {
String
id
=
authority
.
getId
();
String
id
=
authority
.
getId
();
List
<
RoleAuthority
>
roleAuthorities
=
roleAuthorityDao
.
findAllByAuthorityId
(
id
);
List
<
RoleAuthority
>
roleAuthorities
=
roleAuthorityDao
.
findAllByAuthorityId
(
id
);
if
(
roleAuthorities
!=
null
){
if
(
roleAuthorities
!=
null
){
List
<
String
>
roleIdList
=
new
ArrayList
<>();
List
<
String
>
roleIds
=
new
ArrayList
<>();
List
<
String
>
roleIds
=
new
ArrayList
<>();
List
<
String
>
userIds
=
new
ArrayList
<>();
List
<
String
>
userIds
=
new
ArrayList
<>();
roleAuthorities
.
forEach
(
roleAuthority
->
{
roleAuthorities
.
forEach
(
roleAuthority
->
{
roleIds
.
add
(
roleAuthority
.
getRoleId
());
roleIds
.
add
(
roleAuthority
.
getRoleId
());
});
});
List
<
UserRole
>
userRoles
=
userRoleDao
.
findAllByRoleIdIn
(
roleIds
);
List
<
Role
>
roles
=
roleDao
.
findAllByIdInAndIsLeader
(
roleIds
,
"0"
);
if
(
roles
!=
null
){
roles
.
forEach
(
role
->
{
roleIdList
.
add
(
role
.
getId
());
});
}
List
<
UserRole
>
userRoles
=
userRoleDao
.
findAllByRoleIdIn
(
roleIdList
);
if
(
userRoles
!=
null
){
if
(
userRoles
!=
null
){
userRoles
.
forEach
(
userRole
->
{
userRoles
.
forEach
(
userRole
->
{
...
...
notes-union/src/main/java/com/zjty/tynotes/union/UnionApplication.java
浏览文件 @
10d26492
...
@@ -35,9 +35,9 @@ public class UnionApplication {
...
@@ -35,9 +35,9 @@ public class UnionApplication {
// 开始支持http
// 开始支持http
@Bean
@Bean
public
ServletWebServerFactory
servletContainer
()
{
public
ServletWebServerFactory
servletContainer
()
{
TomcatServletWebServerFactory
tomcat
=
new
TomcatServletWebServerFactory
();
TomcatServletWebServerFactory
tomcat
=
new
TomcatServletWebServerFactory
();
tomcat
.
addAdditionalTomcatConnectors
(
createHTTPConnector
());
tomcat
.
addAdditionalTomcatConnectors
(
createHTTPConnector
());
return
tomcat
;
return
tomcat
;
}
}
private
Connector
createHTTPConnector
()
{
private
Connector
createHTTPConnector
()
{
...
...
notes-weekly/src/main/java/com/zjty/tynotes/weekly/subject/entity/vo/UserVo.java
浏览文件 @
10d26492
...
@@ -86,6 +86,16 @@ public class UserVo {
...
@@ -86,6 +86,16 @@ public class UserVo {
private
Integer
workCount
;
private
Integer
workCount
;
@ApiModelProperty
(
value
=
"已完成任务数量"
,
example
=
"10"
)
private
Integer
completedCount
;
@ApiModelProperty
(
value
=
"进行中任务数量"
,
example
=
"10"
)
private
Integer
workingCount
;
@ApiModelProperty
(
value
=
"平均评分"
,
example
=
"10"
)
private
Double
averageScore
;
// @NotNull(message = "角色Id不可为空")
// @NotNull(message = "角色Id不可为空")
// @ApiModelProperty(value = "角色id",example = "1")
// @ApiModelProperty(value = "角色id",example = "1")
// private Integer roleId;
// private Integer roleId;
...
...
notes-weekly/src/main/java/com/zjty/tynotes/weekly/subject/service/impl/UserManageServiceImpl.java
浏览文件 @
10d26492
...
@@ -3,6 +3,7 @@ package com.zjty.tynotes.weekly.subject.service.impl;
...
@@ -3,6 +3,7 @@ package com.zjty.tynotes.weekly.subject.service.impl;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.repository.WorkRepository
;
import
com.zjty.tynotes.job.basic.repository.WorkRepository
;
import
com.zjty.tynotes.job.status.entity.Personnel
;
import
com.zjty.tynotes.job.status.entity.Personnel
;
import
com.zjty.tynotes.job.status.entity.vo.UserWorkData
;
import
com.zjty.tynotes.job.status.service.InternalService
;
import
com.zjty.tynotes.job.status.service.InternalService
;
import
com.zjty.tynotes.pas.dao.*
;
import
com.zjty.tynotes.pas.dao.*
;
import
com.zjty.tynotes.pas.entity.*
;
import
com.zjty.tynotes.pas.entity.*
;
...
@@ -13,11 +14,13 @@ import com.zjty.tynotes.weekly.subject.entity.vo.Problem;
...
@@ -13,11 +14,13 @@ import com.zjty.tynotes.weekly.subject.entity.vo.Problem;
import
com.zjty.tynotes.weekly.subject.entity.vo.UserVo
;
import
com.zjty.tynotes.weekly.subject.entity.vo.UserVo
;
import
com.zjty.tynotes.weekly.subject.service.UserManageService
;
import
com.zjty.tynotes.weekly.subject.service.UserManageService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.lang.reflect.Array
;
import
java.lang.reflect.Array
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
/**
* @Author gwj
* @Author gwj
...
@@ -42,6 +45,9 @@ public class UserManageServiceImpl implements UserManageService {
...
@@ -42,6 +45,9 @@ public class UserManageServiceImpl implements UserManageService {
@Autowired
@Autowired
private
InternalService
internalService
;
private
InternalService
internalService
;
private
Map
<
String
,
UserWorkData
>
userWorkDataMap
=
new
ConcurrentHashMap
<>();
@Autowired
@Autowired
private
ProblemDao
problemDao
;
private
ProblemDao
problemDao
;
...
@@ -103,7 +109,6 @@ public class UserManageServiceImpl implements UserManageService {
...
@@ -103,7 +109,6 @@ public class UserManageServiceImpl implements UserManageService {
}
}
}
}
}
}
}
}
}
}
...
@@ -145,7 +150,16 @@ public class UserManageServiceImpl implements UserManageService {
...
@@ -145,7 +150,16 @@ public class UserManageServiceImpl implements UserManageService {
}
}
List
<
Role
>
roles
=
roleDao
.
findAllByIdIn
(
roleIds
);
List
<
Role
>
roles
=
roleDao
.
findAllByIdIn
(
roleIds
);
user
.
setRoles
(
roles
);
user
.
setRoles
(
roles
);
userVos
.
add
(
new
UserVo
(
user
));
UserVo
userVo
=
new
UserVo
(
user
);
if
(
pageRequest
.
getStartTime
()==
null
&&
pageRequest
.
getEndTime
()==
null
){
UserWorkData
userWorkData
=
userWorkDataMap
.
get
(
user
.
getId
());
userVo
.
setAverageScore
(
userWorkData
.
getAverageScore
());
userVo
.
setCompletedCount
(
userWorkData
.
getCompletedNum
());
userVo
.
setWorkingCount
(
userWorkData
.
getUnCompletedNum
());
}
else
{
internalService
.
personnelWorkMsg
(
user
.
getId
(),
pageRequest
.
getStartTime
(),
pageRequest
.
getEndTime
());
}
userVos
.
add
(
userVo
);
}
}
pageResponse
.
setRows
(
userVos
);
pageResponse
.
setRows
(
userVos
);
pageResponse
.
setTotalCount
(
userList
.
size
());
pageResponse
.
setTotalCount
(
userList
.
size
());
...
@@ -160,7 +174,14 @@ public class UserManageServiceImpl implements UserManageService {
...
@@ -160,7 +174,14 @@ public class UserManageServiceImpl implements UserManageService {
}
}
List
<
Role
>
roles
=
roleDao
.
findAllByIdIn
(
roleIds
);
List
<
Role
>
roles
=
roleDao
.
findAllByIdIn
(
roleIds
);
user
.
setRoles
(
roles
);
user
.
setRoles
(
roles
);
userVos
.
add
(
new
UserVo
(
user
));
UserVo
userVo
=
new
UserVo
(
user
);
if
(
pageRequest
.
getStartTime
()==
null
&&
pageRequest
.
getEndTime
()==
null
){
UserWorkData
userWorkData
=
userWorkDataMap
.
get
(
user
.
getId
());
userVo
.
setAverageScore
(
userWorkData
.
getAverageScore
());
userVo
.
setCompletedCount
(
userWorkData
.
getCompletedNum
());
userVo
.
setWorkingCount
(
userWorkData
.
getUnCompletedNum
());
}
userVos
.
add
(
userVo
);
}
}
pageResponse
.
setRows
(
userVos
);
pageResponse
.
setRows
(
userVos
);
pageResponse
.
setTotalCount
(
userList
.
size
());
pageResponse
.
setTotalCount
(
userList
.
size
());
...
@@ -316,4 +337,22 @@ public class UserManageServiceImpl implements UserManageService {
...
@@ -316,4 +337,22 @@ public class UserManageServiceImpl implements UserManageService {
}
}
}
}
@Scheduled
(
cron
=
"0/30 * * * * ? "
)
public
void
userWorkDataMap
(){
List
<
User
>
users
=
pasUserDao
.
findAll
();
if
(
users
!=
null
){
users
.
forEach
(
user
->
{
UserWorkData
userWorkData
=
internalService
.
personnelWorkMsgAll
(
user
.
getId
());
if
(
userWorkData
!=
null
){
userWorkDataMap
.
put
(
user
.
getId
(),
userWorkData
);
}
});
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论