feiyu02
2025-09-19 7cbe1610b87da19ed8a146a09b1117f92d9d3d98
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
package cn.flightfeather.supervision.push
 
import cn.flightfeather.supervision.domain.ds1.mapper.ProblemlistMapper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import java.util.*
 
/**
 * 问题整改未完成提醒推送任务
 */
@Component
class PChangePushTask : PushTask() {
 
    @Autowired
    lateinit var problemlistMapper: ProblemlistMapper
 
    override fun push(pushService: PushService) {
        val problemMap = mutableMapOf<String, String>()
        val deadLine = ""
        problemlistMapper.getUnChangedProblem(deadLine).forEach {
            if (it.userId == null) return@forEach
            val cal = Calendar.getInstance().apply { time = it.date }
            val month = cal.get(Calendar.MONTH) + 1
            pushService.pushByAccount(listOf(it.userId!!))
            pushService.push("整改到期提醒", "您在${month}月份还有${it.proCount}个问题未整改,点击去整改>>")
        }
    }
}