Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-staff
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f5961ece
authored
Jan 28, 2026
by
林冲
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
判断补日报的权限
1 parent
5938dd5c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
20 deletions
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/StaffSalaryAppealApplyRecordService.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/StaffSalaryAppealApplyRecordService.java
View file @
f5961ec
...
@@ -504,17 +504,13 @@ public class StaffSalaryAppealApplyRecordService {
...
@@ -504,17 +504,13 @@ public class StaffSalaryAppealApplyRecordService {
}
}
private
void
setAppealAvailability
(
StaffSalaryAppealSummaryDTO
dto
,
StaffSalaryAppealSummaryDTO
result
,
String
appealMonth
)
{
private
void
setAppealAvailability
(
StaffSalaryAppealSummaryDTO
dto
,
StaffSalaryAppealSummaryDTO
result
,
String
appealMonth
)
{
if
(
dto
.
getIsSuper
()
!=
null
&&
dto
.
getIsSuper
()
||
Objects
.
equals
(
dto
.
getLoginRole
(),
3
))
{
result
.
setAttendanceAppealable
(
false
);
result
.
setPadAppealable
(
false
);
result
.
setDailyReportable
(
false
);
return
;
}
// 获取上个月月份字符串
// 获取上个月月份字符串
String
lastMonth
=
DateUtils
.
getLastMonthString
(
new
Date
());
String
lastMonth
=
DateUtils
.
getLastMonthString
(
new
Date
());
// 判断appealMonth是否等于上个月
// 判断appealMonth是否等于上个月
boolean
isLastMonth
=
Objects
.
equals
(
appealMonth
,
lastMonth
);
boolean
isLastMonth
=
Objects
.
equals
(
appealMonth
,
lastMonth
);
// 判断是否为驻店人员(loginRole=5)
boolean
isStoreStaff
=
Objects
.
equals
(
dto
.
getLoginRole
(),
5
);
// 获取T3时间配置(考勤申诉周期)
// 获取T3时间配置(考勤申诉周期)
PerformanceTimeCycleDTO
t3Cycle
=
PerformanceTimeCycleDTO
t3Cycle
=
...
@@ -524,10 +520,10 @@ public class StaffSalaryAppealApplyRecordService {
...
@@ -524,10 +520,10 @@ public class StaffSalaryAppealApplyRecordService {
Date
now
=
new
Date
();
Date
now
=
new
Date
();
inT3Period
=
!
now
.
before
(
t3Cycle
.
getStartDate
())
&&
!
now
.
after
(
t3Cycle
.
getEndDate
());
inT3Period
=
!
now
.
before
(
t3Cycle
.
getStartDate
())
&&
!
now
.
after
(
t3Cycle
.
getEndDate
());
}
}
// 考勤申诉:只允许在T3周期内申诉上个月的
// 考勤申诉:只允许
驻店人员
在T3周期内申诉上个月的
result
.
setAttendanceAppealable
(
isLastMonth
&&
inT3Period
);
result
.
setAttendanceAppealable
(
is
StoreStaff
&&
is
LastMonth
&&
inT3Period
);
// 平板申诉:只允许在T3周期内申诉上个月的
// 平板申诉:只允许
驻店人员
在T3周期内申诉上个月的
result
.
setPadAppealable
(
isLastMonth
&&
inT3Period
);
result
.
setPadAppealable
(
is
StoreStaff
&&
is
LastMonth
&&
inT3Period
);
// 获取T1-T5时间配置(补日报周期)
// 获取T1-T5时间配置(补日报周期)
boolean
inT1ToT5Period
=
false
;
boolean
inT1ToT5Period
=
false
;
...
@@ -681,30 +677,24 @@ public class StaffSalaryAppealApplyRecordService {
...
@@ -681,30 +677,24 @@ public class StaffSalaryAppealApplyRecordService {
return
false
;
return
false
;
}
}
// 2. 超级管理员和角色3不允许补填日报
if
(
dto
.
getIsSuper
()
!=
null
&&
dto
.
getIsSuper
()
||
Objects
.
equals
(
dto
.
getLoginRole
(),
3
))
{
log
.
info
(
"超级管理员或角色3不允许补填日报"
);
return
false
;
}
try
{
try
{
//
3
. 解析补填日期,获取所属月份 yyyy-MM
//
2
. 解析补填日期,获取所属月份 yyyy-MM
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
fillDate
=
sdf
.
parse
(
dto
.
getFillDate
());
Date
fillDate
=
sdf
.
parse
(
dto
.
getFillDate
());
SimpleDateFormat
monthFormat
=
new
SimpleDateFormat
(
"yyyy-MM"
);
SimpleDateFormat
monthFormat
=
new
SimpleDateFormat
(
"yyyy-MM"
);
String
fillMonth
=
monthFormat
.
format
(
fillDate
);
String
fillMonth
=
monthFormat
.
format
(
fillDate
);
//
4
. 获取上个月月份字符串
//
3
. 获取上个月月份字符串
String
lastMonth
=
DateUtils
.
getLastMonthString
(
new
Date
());
String
lastMonth
=
DateUtils
.
getLastMonthString
(
new
Date
());
//
5
. 判断fillMonth是否等于上个月
//
4
. 判断fillMonth是否等于上个月
boolean
isLastMonth
=
Objects
.
equals
(
fillMonth
,
lastMonth
);
boolean
isLastMonth
=
Objects
.
equals
(
fillMonth
,
lastMonth
);
if
(!
isLastMonth
)
{
if
(!
isLastMonth
)
{
log
.
info
(
"补填日期{}不是上个月,不允许补填"
,
dto
.
getFillDate
());
log
.
info
(
"补填日期{}不是上个月,不允许补填"
,
dto
.
getFillDate
());
return
false
;
return
false
;
}
}
//
6
. 检查是否在T1到T5的任意一个周期内
//
5
. 检查是否在T1到T5的任意一个周期内
String
[]
tCodes
=
{
String
[]
tCodes
=
{
PerformanceTimeCycleCodeEnum
.
T1
.
getCode
(),
PerformanceTimeCycleCodeEnum
.
T1
.
getCode
(),
PerformanceTimeCycleCodeEnum
.
T2
.
getCode
(),
PerformanceTimeCycleCodeEnum
.
T2
.
getCode
(),
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment