新增:EP待办同步 增加定时任务
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.sdm.project.schedule.lyric;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.common.ThreadLocalContext;
|
||||
import com.sdm.project.service.ILyricInternalService;
|
||||
import com.xxl.job.core.context.XxlJobHelper;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class LyricTodoListSchedule {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ILyricInternalService lyricInternalService;
|
||||
|
||||
// xxljob平台配置定时任务
|
||||
@XxlJob("lyricTodoListHandler")
|
||||
public void hpcJobStatusHandler() throws Exception {
|
||||
String param = XxlJobHelper.getJobParam();
|
||||
if(StringUtils.isBlank(param)){
|
||||
log.warn("lyricTodoListHandler param null");
|
||||
return;
|
||||
}
|
||||
XxlJobHelper.log("XXL-JOB:拉起lyric代办任务开始,param:{}", param);
|
||||
JSONObject paramJson = JSONObject.parseObject(param);
|
||||
ThreadLocalContext.setTenantId(paramJson.getLong("tenantId"));
|
||||
ThreadLocalContext.setUserId(paramJson.getLong("userId"));
|
||||
long startTime = System.currentTimeMillis();
|
||||
SdmResponse response = lyricInternalService.getTodoList();
|
||||
long endTime = System.currentTimeMillis();
|
||||
log.info("lyricTodoListHandler cost [{}] s", (endTime - startTime)/1000);
|
||||
log.info("lyricTodoListHandler result :{}", JSON.toJSONString(response));
|
||||
XxlJobHelper.log("XXL-JOB:拉起lyric代办任务结束:{}", JSON.toJSONString(response));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user