fix:暂时取消定时任务,手动查询需要更新的阿里数据进行写死时间的过滤
parent
a758dca19b
commit
8c4dd7ee60
@ -0,0 +1,50 @@
|
||||
package com.glxp.udidl.admin.thread;
|
||||
|
||||
import com.glxp.udidl.admin.dao.info.ScheduledMapper;
|
||||
import com.glxp.udidl.admin.entity.auth.AuthAliUser;
|
||||
import com.glxp.udidl.admin.entity.info.ScheduledEntity;
|
||||
import com.glxp.udidl.admin.req.info.ScheduledRequest;
|
||||
import com.glxp.udidl.admin.service.auth.AuthAliUserService;
|
||||
import com.glxp.udidl.admin.service.chsapi.ChsYbHcxxService;
|
||||
import com.glxp.udidl.admin.service.collect.ThirdAliDrugService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.SchedulingConfigurer;
|
||||
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
||||
import org.springframework.scheduling.support.CronTrigger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Component
|
||||
@EnableScheduling
|
||||
public class ThirdAliDrugClearResCodeCountTask implements SchedulingConfigurer {
|
||||
|
||||
|
||||
@Resource
|
||||
private AuthAliUserService authAliUserService;
|
||||
|
||||
|
||||
final Logger logger = LoggerFactory.getLogger(ThirdAliDrugClearResCodeCountTask.class);
|
||||
|
||||
@Override
|
||||
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
|
||||
scheduledTaskRegistrar.addTriggerTask(() -> process(),
|
||||
triggerContext -> {
|
||||
String cron = "0 0 * * * ?";//每天0点
|
||||
if (cron.isEmpty()) {
|
||||
logger.error("cron is null");
|
||||
}
|
||||
return new CronTrigger(cron).nextExecutionTime(triggerContext);
|
||||
});
|
||||
}
|
||||
|
||||
private void process() {
|
||||
System.out.println("开始执行更新阿里健康数据访问重置");
|
||||
AuthAliUser one = authAliUserService.getOne();
|
||||
one.setDrugResCodeCount(0);
|
||||
authAliUserService.updateById(one);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue