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}个问题未整改,点击去整改>>")
|
}
|
}
|
}
|