feiyu02
2025-09-30 6904763f0e74d9a9fa4dbc39f635d2aee39416c6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package cn.flightfeather.supervision.bgtask
 
import cn.flightfeather.supervision.common.wx.TemplateManager
import cn.flightfeather.supervision.domain.entity.MsgSubscribeWx
import cn.flightfeather.supervision.domain.mapper.MsgSubscribeWxMapper
import org.springframework.stereotype.Component
import tk.mybatis.mapper.entity.Example
import java.time.LocalDateTime
 
/**
 * 每月自评倒计时提醒
 */
@Component
class TaskScoreRemind(
    private val msgSubscribeWxMapper: MsgSubscribeWxMapper
) : BaseTimingTask() {
 
    override val period: Long
        get() = 1440L
 
    override fun doTask(localtime: LocalDateTime) {
        //1.选择已订阅了该条提醒的微信用户
        val ms = msgSubscribeWxMapper.selectByExample(Example(MsgSubscribeWx::class.java).apply {
            createCriteria().andEqualTo("msTemplateId", TemplateManager.TEMPLATE_1)
                .andGreaterThan("msCount", 0)
        })
        //2.查找微信用户绑定的场景台账上传情况
        //3.根据统计结果决定是否发送提醒推送
    }
 
    /**
     * 自评提醒任务定为每月5号、15号、28号早上10点提醒
     */
    override fun execute(localtime: LocalDateTime) {
        if (localtime.dayOfMonth == 5 || localtime.dayOfMonth == 15 || localtime.dayOfMonth == 28) {
            if (localtime.hour == 10 && localtime.minute == 0 && localtime.second == 0) {
                doTask(localtime)
            }
        }
    }
}