Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Z
zlmy-cloud
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zlmy
zlmy-cloud
Commits
cdcc2439
Commit
cdcc2439
authored
Jul 22, 2025
by
Rensq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员资质过期消息推送
parent
de31eaf1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
1 deletion
+98
-1
AuthInterceptor.java
...n/java/com/testor/common/interceptor/AuthInterceptor.java
+1
-1
Remind.java
.../src/main/java/com/testor/module/aptitude/job/Remind.java
+90
-0
RuTaskServiceImpl.java
.../com/testor/module/wf/service/impl/RuTaskServiceImpl.java
+7
-0
No files found.
zlmy-modules/zlmy-boot/src/main/java/com/testor/common/interceptor/AuthInterceptor.java
View file @
cdcc2439
...
...
@@ -36,7 +36,7 @@ public class AuthInterceptor implements HandlerInterceptor {
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
obj
)
{
HttpServletResponse
httpResponse
=
response
;
String
token
=
RequestUtil
.
getToken
(
request
);
log
.
info
(
"接口路径:"
+
request
.
getRequestURI
()
+
";token="
+
token
);
//
log.info("接口路径:" + request.getRequestURI() + ";token=" + token);
if
(
StringHelper
.
isNotBlank
(
token
))
{
try
{
JwtInfos
jwtInfos
=
JwtHelper
.
parseJwtAuth0
(
token
,
"Token Issuer"
);
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/aptitude/job/Remind.java
0 → 100644
View file @
cdcc2439
package
com
.
testor
.
module
.
aptitude
.
job
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.testor.module.aptitude.model.domain.TPersonAptitude
;
import
com.testor.module.aptitude.service.TPersonAptitudeService
;
import
com.testor.module.messageNotice.model.vo.MsgTemplateVO
;
import
com.testor.module.messageNotice.service.TMsgNoticeService
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
@ConditionalOnProperty
(
prefix
=
"service"
,
name
=
"taskEnabled"
,
havingValue
=
"true"
)
public
class
Remind
{
@Autowired
private
TPersonAptitudeService
tPersonAptitudeService
;
@Autowired
private
TMsgNoticeService
tMsgNoticeService
;
@XxlJob
(
"checkAndSendReminders"
)
public
void
checkAndSendReminders
()
{
LocalDate
today
=
LocalDate
.
now
();
// 提前两个月提醒(60天后到期)
checkAndSendReminder
(
today
.
plusDays
(
60
),
"资质将在2个月后到期, 及时更新证件信息,以免影响正常使用,谢谢"
);
// 提前一个月提醒(30天后到期)
checkAndSendReminder
(
today
.
plusDays
(
30
),
"资质将在1个月后到期,及时更新证件信息,以免影响正常使用,谢谢"
);
// 提前一周提醒(7天后到期)
checkAndSendReminder
(
today
.
plusDays
(
7
),
"资质将在1周后到期,及时更新证件信息,以免影响正常使用,谢谢"
);
// 过期提醒
checkExpired
(
today
);
}
private
void
checkAndSendReminder
(
LocalDate
expiryDate
,
String
message
)
{
String
format
=
expiryDate
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
// 使用MyBatis-Plus的LambdaQueryWrapper构建查询
List
<
TPersonAptitude
>
aptitudes
=
tPersonAptitudeService
.
list
(
new
LambdaQueryWrapper
<
TPersonAptitude
>()
.
eq
(
TPersonAptitude:
:
getAptitudeValid
,
format
)
);
aptitudes
.
forEach
(
aptitude
->
{
sendNotification
(
aptitude
,
message
);
});
}
private
void
checkExpired
(
LocalDate
today
)
{
List
<
TPersonAptitude
>
aptitudes
=
tPersonAptitudeService
.
list
(
new
LambdaQueryWrapper
<
TPersonAptitude
>()
.
eq
(
TPersonAptitude:
:
getAptitudeValid
,
today
.
atStartOfDay
())
);
aptitudes
.
forEach
(
aptitude
->
{
sendNotification
(
aptitude
,
"已过期,及时更新证件信息,以免影响正常使用,谢谢"
);
});
}
private
void
sendNotification
(
TPersonAptitude
aptitude
,
String
message
)
{
String
fullMessage
=
String
.
format
(
"%s的%s资质: %s"
,
aptitude
.
getPersonName
(),
aptitude
.
getAptitudeName
(),
message
);
MsgTemplateVO
msgTemplateVO
=
new
MsgTemplateVO
();
msgTemplateVO
.
setTemplateContent
(
fullMessage
);
msgTemplateVO
.
setTemplateType
(
"notice"
);
msgTemplateVO
.
setTemplateTypeName
(
"通知"
);
tMsgNoticeService
.
generateMsgNotice
(
"aptitude"
,
aptitude
.
getId
(),
getUserId
(
aptitude
.
getOrgId
()),
msgTemplateVO
);
}
private
List
<
String
>
getUserId
(
String
orgId
)
{
return
new
ArrayList
<>();
}
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/wf/service/impl/RuTaskServiceImpl.java
View file @
cdcc2439
...
...
@@ -181,6 +181,13 @@ public class RuTaskServiceImpl implements RuTaskService {
return
processDefListResponse
;
}).
collect
(
Collectors
.
toList
());
if
(
"2"
.
equals
(
param
.
getTabType
())){
ProcessDefListResponse
defListResponse
=
new
ProcessDefListResponse
();
defListResponse
.
setKey
(
"aptitude"
);
defListResponse
.
setName
(
"证件过期提醒"
);
resultList
.
add
(
defListResponse
);
}
// 构建返回的响应对象
BaseResponseList
<
ProcessDefListResponse
>
responseList
=
new
BaseResponseList
<>();
responseList
.
setData
(
resultList
);
...
...
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