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)
|
}
|
}
|
}
|
}
|