1. 写自己需要执行的定时方法(定时类任务一般没有返回值)
public void autoSendVirtualEmailDay() {
try {
logger.info("VartualTaskService.autoSendVirtualEmailDay info={}", "开始执行自动发送虚拟号预购邮件,开始时间是:" + FormatHelper.parseString(new Date()));
List<GkshopVirtualTaskDO> list = selectAllIds(null);
final boolean flag = null != list && list.size()>0;
if (flag) {
logger.info("VartualTaskService.autoSendVirtualEmailDay info={}", "本次将预购虚拟号共计:" + list.size() + " 个!");
String contextPath = "";
Boolean aBoolean = sendAllEmail(null, list, contextPath);
if (aBoolean) {
logger.info("VartualTaskService.autoSendVirtualEmailDay info={}", "每天下午三点半定时自动发送小号预购邮件成功,将来共计预购:" + list.size() + "个小号!");
logger.info("VartualTaskService.autoSendVirtualEmailDay info={}", "本次请求执行结束,并成功自动发送虚拟号预购邮件,结束时间是:" + FormatHelper.parseString(new Date()));
return;
} else {