Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
a04b4482
Commit
a04b4482
authored
Jan 09, 2024
by
姬鋆屾
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.scsmile.cn/zxf/attendance-performance-platform
parents
742e2e18
97ae2ca4
Changes
14
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1532 additions
and
35 deletions
+1532
-35
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/AttendanceSummaryTaskImpl.java
...om/mortals/xhx/daemon/task/AttendanceSummaryTaskImpl.java
+1
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/model/vo/ErrorSummaryVo.java
...ortals/xhx/module/attendance/model/vo/ErrorSummaryVo.java
+10
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/model/vo/LeaveSummaryVo.java
...ortals/xhx/module/attendance/model/vo/LeaveSummaryVo.java
+8
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/model/vo/VacationBalanceSummaryVo.java
.../module/attendance/model/vo/VacationBalanceSummaryVo.java
+9
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/impl/AttendanceStatServiceImpl.java
...le/attendance/service/impl/AttendanceStatServiceImpl.java
+87
-17
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/model/StaffEntity.java
.../java/com/mortals/xhx/module/staff/model/StaffEntity.java
+38
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/model/StaffQuery.java
...n/java/com/mortals/xhx/module/staff/model/StaffQuery.java
+898
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/model/vo/StaffCheckAuthorizePdu.java
...als/xhx/module/staff/model/vo/StaffCheckAuthorizePdu.java
+10
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/StaffService.java
...va/com/mortals/xhx/module/staff/service/StaffService.java
+9
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
...rtals/xhx/module/staff/service/impl/StaffServiceImpl.java
+72
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/web/StaffController.java
...ava/com/mortals/xhx/module/staff/web/StaffController.java
+31
-0
attendance-performance-manager/src/main/resources/sqlmap/module/attendance/AttendanceSummaryMapper.xml
...rces/sqlmap/module/attendance/AttendanceSummaryMapper.xml
+19
-13
attendance-performance-manager/src/main/resources/sqlmap/module/staff/StaffMapper.xml
...er/src/main/resources/sqlmap/module/staff/StaffMapper.xml
+327
-5
db/add.sql
db/add.sql
+13
-0
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/AttendanceSummaryTaskImpl.java
View file @
a04b4482
...
...
@@ -42,6 +42,7 @@ public class AttendanceSummaryTaskImpl implements ITaskExcuteService {
query
.
setSummaryTimeEnd
(
DateUtils
.
getStrDate
(
now
.
getTime
()));
now
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
19
);
query
.
setSummaryTimeStart
(
DateUtils
.
getStrDate
(
now
.
getTime
()));
log
.
info
(
"考勤汇总时间:"
+
DateUtils
.
getDateTime
(
now
.
getTime
(),
"yyyy-MM-dd HH:mm:ss"
));
//重新汇总最近20天的考勤数据
cacheService
.
lpush
(
KEY_ATTENDANCE_STAT_CACHE
,
query
);
}
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/model/vo/ErrorSummaryVo.java
View file @
a04b4482
...
...
@@ -2,6 +2,8 @@ package com.mortals.xhx.module.attendance.model.vo;
import
lombok.Data
;
import
java.util.Date
;
/**
* 考勤异常汇总
*/
...
...
@@ -40,4 +42,12 @@ public class ErrorSummaryVo {
* 考勤汇总-早退(次)
*/
private
Integer
overtimeTimes
;
/**
* 员工状态(1.正式,2.试用,3.离职)
*/
private
Integer
status
;
/**
* 离职时间
*/
private
Date
leaveDate
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/model/vo/LeaveSummaryVo.java
View file @
a04b4482
...
...
@@ -46,4 +46,12 @@ public class LeaveSummaryVo {
* 结束时间
*/
private
Date
endTime
;
/**
* 员工状态(1.正式,2.试用,3.离职)
*/
private
Integer
status
;
/**
* 离职时间
*/
private
Date
leaveDate
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/model/vo/VacationBalanceSummaryVo.java
View file @
a04b4482
...
...
@@ -3,6 +3,7 @@ package com.mortals.xhx.module.attendance.model.vo;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 假期余额汇总
...
...
@@ -129,4 +130,12 @@ public class VacationBalanceSummaryVo {
* 探亲假(天)
*/
private
BigDecimal
homeLeave
;
/**
* 员工状态(1.正式,2.试用,3.离职)
*/
private
Integer
status
;
/**
* 离职时间
*/
private
Date
leaveDate
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/impl/AttendanceStatServiceImpl.java
View file @
a04b4482
This diff is collapsed.
Click to expand it.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/model/StaffEntity.java
View file @
a04b4482
...
...
@@ -140,6 +140,32 @@ public class StaffEntity extends StaffVo {
* 最后登录时间
*/
private
Date
lastLoginTime
;
/**
* 考勤授权(0.不启用,1.启用)
*/
private
Integer
attendCheck
;
/**
* 评价授权(0.不启用,1.启用)
*/
private
Integer
complainCheck
;
/**
* 投诉授权(0.不启用,1.启用)
*/
private
Integer
reviewCheck
;
/**
* 办件授权(0.不启用,1.启用)
*/
private
Integer
goworkCheck
;
/**
* 效能授权(0.不启用,1.启用)
*/
private
Integer
effectCheck
;
/**
* 其他授权(0.不启用,1.启用)
*/
private
Integer
otherCheck
;
@Override
public
int
hashCode
()
{
return
this
.
getId
().
hashCode
();
...
...
@@ -211,5 +237,17 @@ public class StaffEntity extends StaffVo {
this
.
loginPwd
=
""
;
this
.
lastLoginTime
=
null
;
this
.
attendCheck
=
0
;
this
.
complainCheck
=
0
;
this
.
reviewCheck
=
0
;
this
.
goworkCheck
=
0
;
this
.
effectCheck
=
0
;
this
.
otherCheck
=
0
;
}
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/model/StaffQuery.java
View file @
a04b4482
This diff is collapsed.
Click to expand it.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/model/vo/StaffCheckAuthorizePdu.java
0 → 100644
View file @
a04b4482
package
com.mortals.xhx.module.staff.model.vo
;
import
lombok.Data
;
@Data
public
class
StaffCheckAuthorizePdu
{
private
Long
staffId
;
/** 核查类型枚举CheckTypeEnum(1.考勤绩效,2.评价绩效,3.办件绩效,4.效能绩效,5.其它绩效,6.投诉绩效) */
private
Integer
type
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/StaffService.java
View file @
a04b4482
package
com.mortals.xhx.module.staff.service
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDCacheService
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.vo.StaffCheckAuthorizePdu
;
import
com.mortals.xhx.module.staff.model.vo.StaffInfoVo
;
import
java.util.List
;
...
...
@@ -30,4 +32,11 @@ public interface StaffService extends ICRUDCacheService<StaffEntity,Long> {
*/
Rest
<
Void
>
syncPersons
(
Context
context
);
/**
* 绩效考核授权
* @param pdu
* @return
*/
int
checkAuthorize
(
StaffCheckAuthorizePdu
pdu
,
Context
context
)
throws
AppException
;
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
View file @
a04b4482
...
...
@@ -34,6 +34,7 @@ import com.mortals.xhx.module.staff.model.StaffEntity;
import
com.mortals.xhx.module.staff.model.StaffLeaveEntity
;
import
com.mortals.xhx.module.staff.model.StaffLeaveQuery
;
import
com.mortals.xhx.module.staff.model.StaffQuery
;
import
com.mortals.xhx.module.staff.model.vo.StaffCheckAuthorizePdu
;
import
com.mortals.xhx.module.staff.model.vo.StaffInfoVo
;
import
com.mortals.xhx.module.staff.service.StaffLeaveService
;
import
com.mortals.xhx.module.staff.service.StaffService
;
...
...
@@ -207,6 +208,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
if
(!
ObjectUtils
.
isEmpty
(
key
))
{
StaffEntity
staff
=
item
.
getValue
();
staff
.
setStatus
(
StaffSatusEnum
.
离职
.
getValue
());
staff
.
setLeaveDate
(
new
Date
());
staff
.
setUpdateTime
(
new
Date
());
staff
.
setUpdateUserId
(
1L
);
this
.
update
(
staff
);
...
...
@@ -365,6 +367,76 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
return
params
;
}
@Override
public
int
checkAuthorize
(
StaffCheckAuthorizePdu
pdu
,
Context
context
)
throws
AppException
{
StaffEntity
temp
=
this
.
get
(
pdu
.
getStaffId
());
if
(
temp
==
null
){
throw
new
AppException
(
"人员信息ID不正确"
);
}
CheckTypeEnum
checkTypeEnum
=
CheckTypeEnum
.
getByValue
(
pdu
.
getType
());
if
(
checkTypeEnum
==
null
){
throw
new
AppException
(
"考核类型不正确"
);
}
StaffEntity
update
=
new
StaffEntity
();
update
.
setId
(
pdu
.
getStaffId
());
//1.考勤绩效,2.评价绩效,3.办件绩效,4.效能绩效,5.其它绩效,6.投诉绩效
switch
(
checkTypeEnum
){
case
考勤绩效:
if
(
temp
.
getAttendCheck
()==
1
){
update
.
setAttendCheck
(
0
);
}
else
{
update
.
setAttendCheck
(
1
);
}
break
;
case
评价绩效:
if
(
temp
.
getComplainCheck
()==
1
){
update
.
setComplainCheck
(
0
);
}
else
{
update
.
setComplainCheck
(
1
);
}
break
;
case
办件绩效:
if
(
temp
.
getGoworkCheck
()==
1
){
update
.
setGoworkCheck
(
0
);
}
else
{
update
.
setGoworkCheck
(
1
);
}
break
;
case
效能绩效:
if
(
temp
.
getEffectCheck
()==
1
){
update
.
setEffectCheck
(
0
);
}
else
{
update
.
setEffectCheck
(
1
);
}
break
;
case
其它绩效:
if
(
temp
.
getOtherCheck
()==
1
){
update
.
setOtherCheck
(
0
);
}
else
{
update
.
setOtherCheck
(
1
);
}
break
;
case
投诉绩效:
if
(
temp
.
getReviewCheck
()==
1
){
update
.
setReviewCheck
(
0
);
}
else
{
update
.
setReviewCheck
(
1
);
}
break
;
default
:
if
(
temp
.
getOtherCheck
()==
1
){
update
.
setOtherCheck
(
0
);
}
else
{
update
.
setOtherCheck
(
1
);
}
}
update
.
setUpdateTime
(
new
Date
());
if
(
context
.
getUser
()!=
null
)
{
update
.
setUpdateUserId
(
context
.
getUser
().
getId
());
}
return
dao
.
update
(
update
);
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"1"
+
StrUtil
.
padPre
(
"125"
,
7
,
"0"
));
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/web/StaffController.java
View file @
a04b4482
...
...
@@ -28,12 +28,14 @@ import com.mortals.xhx.module.job.model.JobQuery;
import
com.mortals.xhx.module.job.service.JobService
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.vo.HolidayListVo
;
import
com.mortals.xhx.module.staff.model.vo.StaffCheckAuthorizePdu
;
import
com.mortals.xhx.module.staff.model.vo.StaffInfoVo
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
...
...
@@ -221,5 +223,34 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ
public
String
delete
(
Long
[]
id
)
{
return
super
.
delete
(
id
);
}
@PostMapping
(
value
=
"check/authorize"
)
public
String
checkAuthorize
(
StaffCheckAuthorizePdu
pdu
)
{
Map
<
String
,
Object
>
model
=
new
HashMap
();
if
(
pdu
.
getStaffId
()
==
null
)
{
return
this
.
createFailJsonResp
(
"请选择待授权"
+
this
.
getModuleDesc
()
+
"信息"
);
}
else
{
JSONObject
ret
=
new
JSONObject
();
String
busiDesc
=
"授权"
+
this
.
getModuleDesc
();
Context
context
=
this
.
getContext
();
try
{
this
.
service
.
checkAuthorize
(
pdu
,
context
);
if
(!
ObjectUtils
.
isEmpty
(
context
)
&&
!
ObjectUtils
.
isEmpty
(
context
.
getUser
()))
{
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
}
catch
(
Exception
var8
)
{
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var8
);
Object
msg
=
model
.
get
(
"message_info"
);
return
this
.
createFailJsonResp
(
msg
==
null
?
"系统异常"
:
msg
.
toString
());
}
this
.
init
(
model
,
context
);
ret
.
put
(
"data"
,
model
);
ret
.
put
(
"code"
,
1
);
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
return
ret
.
toJSONString
();
}
}
}
attendance-performance-manager/src/main/resources/sqlmap/module/attendance/AttendanceSummaryMapper.xml
View file @
a04b4482
...
...
@@ -12,6 +12,8 @@
s.workNum,
s.deptId,
s.deptName,
s.`status`,
s.leaveDate,
DATE_FORMAT(STR_TO_DATE(#{summaryTime},'%Y-%m-%d'),'%Y') as `year`,
DATE_FORMAT(STR_TO_DATE(#{summaryTime},'%Y-%m-%d'),'%m') as `month`,
DATE_FORMAT(STR_TO_DATE(#{summaryTime},'%Y-%m-%d'),'%d') as `day`,
...
...
@@ -46,24 +48,26 @@
<!-- 汇总当前日期请假情况 -->
<select
id=
"getLeaveSummary"
parameterType=
"com.mortals.xhx.module.attendance.model.vo.AttendanceSummaryQuery"
resultType=
"com.mortals.xhx.module.attendance.model.vo.LeaveSummaryVo"
>
SELECT
leavePersonId AS staffId,
leavePerson AS staffName,
leaveType,
IFNULL(sum(duration),0) as duration,
r.leavePersonId AS staffId,
r.leavePerson AS staffName,
ANY_VALUE(s.`status`) as `status`,
ANY_VALUE(s.leaveDate) as leaveDate,
r.leaveType,
IFNULL(sum(r.duration),0) as duration,
ANY_VALUE(DATE_FORMAT(STR_TO_DATE(#{summaryTime},'%Y-%m-%d'),'%Y')) as `year`,
ANY_VALUE(DATE_FORMAT(STR_TO_DATE(#{summaryTime},'%Y-%m-%d'),'%m')) as `month`,
ANY_VALUE(DATE_FORMAT(STR_TO_DATE(#{summaryTime},'%Y-%m-%d'),'%d')) as `day`,
ANY_VALUE(startTime) as startTime,
ANY_VALUE(endTime) as endTime
ANY_VALUE(
r.
startTime) as startTime,
ANY_VALUE(
r.
endTime) as endTime
FROM
mortals_xhx_attendance_leave_record
mortals_xhx_attendance_leave_record
r INNER JOIN mortals_xhx_staff s ON r.leavePersonId = s.id
WHERE
auditResult = 1
AND processStatus = 2
AND STR_TO_DATE(date_format(startTime,'%Y-%m-%d'),'%Y-%m-%d')
<![CDATA[ <= ]]>
STR_TO_DATE(#{summaryTime},'%Y-%m-%d')
AND STR_TO_DATE(date_format(endTime,'%Y-%m-%d'),'%Y-%m-%d')
<![CDATA[ >= ]]>
STR_TO_DATE(#{summaryTime},'%Y-%m-%d')
r.
auditResult = 1
AND
r.
processStatus = 2
AND STR_TO_DATE(date_format(
r.
startTime,'%Y-%m-%d'),'%Y-%m-%d')
<![CDATA[ <= ]]>
STR_TO_DATE(#{summaryTime},'%Y-%m-%d')
AND STR_TO_DATE(date_format(
r.
endTime,'%Y-%m-%d'),'%Y-%m-%d')
<![CDATA[ >= ]]>
STR_TO_DATE(#{summaryTime},'%Y-%m-%d')
<if
test=
"staffId != null and staffId!=''"
>
AND leavePersonId = #{staffId}
</if>
GROUP BY
leavePersonId,leavePerson,
leaveType
GROUP BY
r.leavePersonId,r.leavePerson,r.
leaveType
</select>
...
...
@@ -72,6 +76,8 @@
select
e.staffId,
e.staffName,
ANY_VALUE(s.`status`) as `status`,
ANY_VALUE(s.leaveDate) as leaveDate,
ANY_VALUE(DATE_FORMAT(errorDateTime,'%Y')) as `year`,
ANY_VALUE(DATE_FORMAT(errorDateTime,'%m')) as `month`,
ANY_VALUE(DATE_FORMAT(errorDateTime,'%d')) as `day`,
...
...
@@ -80,7 +86,7 @@
sum(case processResult when 1 then 1 ELSE 0 end) as overtimeTimes,
sum(case processResult when 2 then 1 ELSE 0 end) as lateTimes
from
mortals_xhx_attendance_record_error e
mortals_xhx_attendance_record_error e
INNER JOIN mortals_xhx_staff s ON e.staffId = s.id
where
processResult != 4
and e.errorDateTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{summaryTime},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
...
...
attendance-performance-manager/src/main/resources/sqlmap/module/staff/StaffMapper.xml
View file @
a04b4482
This diff is collapsed.
Click to expand it.
db/add.sql
View file @
a04b4482
...
...
@@ -884,3 +884,16 @@ CREATE TABLE `mortals_sys_holiday`
-- 2023-12-05 员工绩效分数初始化任务
-- --------------
INSERT
INTO
`mortals_xhx_task`
(
`name`
,
`taskKey`
,
`status`
,
`excuteService`
,
`excuteParam`
,
`excuteHost`
,
`excuteStrategy`
,
`excuteDate`
,
`excuteTime`
,
`remark`
,
`lastExcuteHost`
,
`lastExcuteTime`
,
`interimExcuteStatus`
,
`createTime`
,
`createUserId`
,
`createUserName`
)
VALUES
(
'员工绩效分数初始化任务'
,
'StaffPerformInitDataTask'
,
'0'
,
'StaffPerformInitDataTask'
,
NULL
,
NULL
,
'1'
,
'0'
,
'00:10'
,
NULL
,
NULL
,
NULL
,
'0'
,
NOW
(),
'1'
,
'系统管理员'
);
-- ----------
-- 2024-01-08 更新人员信息离职时间,人员信息表增加考核授权
-- ----------
update
mortals_xhx_staff
s
INNER
JOIN
mortals_xhx_staff_leave
l
ON
s
.
id
=
l
.
staffId
SET
s
.
leaveDate
=
l
.
leaveDate
;
ALTER
TABLE
`mortals_xhx_staff`
ADD
COLUMN
`attendCheck`
TINYINT
(
2
)
DEFAULT
'0'
COMMENT
'考勤授权(0.不启用,1.启用)'
,
ADD
COLUMN
`complainCheck`
TINYINT
(
2
)
DEFAULT
'0'
COMMENT
'评价授权(0.不启用,1.启用)'
,
ADD
COLUMN
`reviewCheck`
TINYINT
(
2
)
DEFAULT
'0'
COMMENT
'投诉授权(0.不启用,1.启用)'
,
ADD
COLUMN
`goworkCheck`
TINYINT
(
2
)
DEFAULT
'0'
COMMENT
'办件授权(0.不启用,1.启用)'
,
ADD
COLUMN
`effectCheck`
TINYINT
(
2
)
DEFAULT
'0'
COMMENT
'效能授权(0.不启用,1.启用)'
,
ADD
COLUMN
`otherCheck`
TINYINT
(
2
)
DEFAULT
'0'
COMMENT
'其他授权(0.不启用,1.启用)'
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment