|
|
|
@ -7,6 +7,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 每月固定时间定时任务
|
|
|
|
@ -23,11 +24,15 @@ public class NoticeTiming {
|
|
|
|
|
/**
|
|
|
|
|
* 每个月固定发一次政务通知
|
|
|
|
|
*/
|
|
|
|
|
// @Scheduled(cron = "1 0 0 * * *")
|
|
|
|
|
// private void configureTasks() {
|
|
|
|
|
// Notice notice = new Notice();
|
|
|
|
|
// notice.setType(1);
|
|
|
|
|
//
|
|
|
|
|
// noticeService.save(notice);
|
|
|
|
|
// }
|
|
|
|
|
@Scheduled(cron = "0 0 0 1 * ?")
|
|
|
|
|
private void configureTasks() {
|
|
|
|
|
Notice notice = new Notice();
|
|
|
|
|
notice.setType(1);
|
|
|
|
|
notice.setContent(LocalDate.now().getYear() +
|
|
|
|
|
"年"+
|
|
|
|
|
LocalDate.now().getMonth().getValue()+
|
|
|
|
|
"月"+
|
|
|
|
|
"项目进展未填写");
|
|
|
|
|
noticeService.save(notice);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|