|
@@ -3,6 +3,7 @@ package com.simuwang.manage.task;
|
|
|
import ch.qos.logback.core.util.StringUtil;
|
|
|
import cn.hutool.crypto.asymmetric.KeyType;
|
|
|
import cn.hutool.crypto.asymmetric.RSA;
|
|
|
+import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.simuwang.base.common.enums.EmailCron;
|
|
|
import com.simuwang.base.common.util.DateUtils;
|
|
@@ -31,15 +32,18 @@ import java.util.Date;
|
|
|
* Date: 2024/9/17 10:48
|
|
|
* Description: ${DESCRIPTION}
|
|
|
*/
|
|
|
+@Component
|
|
|
public class ParseSchedulerTask extends QuartzJobBean {
|
|
|
|
|
|
- @Autowired
|
|
|
+
|
|
|
private EmailParseApiService emailParseApiService;
|
|
|
- @Autowired
|
|
|
+
|
|
|
private EmailConfigService emailConfigService;
|
|
|
private static final Logger log = LoggerFactory.getLogger(ParseSchedulerTask.class);
|
|
|
@Override
|
|
|
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
|
|
|
+ emailParseApiService = SpringUtil.getBean(EmailParseApiService.class);
|
|
|
+ emailConfigService = SpringUtil.getBean(EmailConfigService.class);
|
|
|
log.info("ParseSchedulerTask {}", context.getJobDetail().getKey());JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
|
|
|
log.info("ParseSchedulerTask jobDataMap {}", JSON.toJSONString(jobDataMap));
|
|
|
String account = jobDataMap.get("account").toString();
|
|
@@ -60,7 +64,7 @@ public class ParseSchedulerTask extends QuartzJobBean {
|
|
|
if(EmailCron.getEmailCronByCron(mailboxInfoDO.getCron()) == EmailCron.EVERY_HOUR){
|
|
|
endDate = DateUtils.getNowDate();
|
|
|
startDate = DateUtils.addHours(DateUtils.getNowDate(),-1);
|
|
|
- }else if (EmailCron.getEmailCronByCron(mailboxInfoDO.getCron()) == EmailCron.ONE_AM){
|
|
|
+ }else{
|
|
|
endDate = DateUtils.getNowDate();
|
|
|
startDate = DateUtils.addHours(DateUtils.getNowDate(),-24);
|
|
|
}
|