package cn.flightfeather.supervision.timingtask
|
|
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 TaskLedgerRemind(
|
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号早上10点提醒当月10号之前提交台账
|
*/
|
override fun execute(localtime: LocalDateTime) {
|
if (localtime.dayOfMonth == 5) {
|
doTask(localtime)
|
}
|
}
|
}
|