feat: 添加Omada初始化任务
This commit is contained in:
@@ -24,7 +24,7 @@ import org.wfc.common.log.enums.BusinessType;
|
||||
import org.wfc.common.security.utils.SecurityUtils;
|
||||
import org.wfc.job.domain.SysJob;
|
||||
import org.wfc.job.service.ISysJobService;
|
||||
import org.wfc.job.task.CdrInfoTask;
|
||||
import org.wfc.job.task.OmadaTask;
|
||||
import org.wfc.job.util.CronUtils;
|
||||
import org.wfc.job.util.ScheduleUtils;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class SysJobController extends BaseController
|
||||
private ISysJobService jobService;
|
||||
|
||||
@Autowired
|
||||
private CdrInfoTask cdrInfoTask;
|
||||
private OmadaTask omadaTask;
|
||||
|
||||
/**
|
||||
* 查询定时任务列表
|
||||
@@ -175,8 +175,8 @@ public class SysJobController extends BaseController
|
||||
public AjaxResult run(@RequestBody SysJob job) throws SchedulerException
|
||||
{
|
||||
SysJob sysJob = jobService.selectJobById(job.getJobId());
|
||||
if (sysJob != null && sysJob.getInvokeTarget().contains("cdrInfoTask")) {
|
||||
R<Boolean> omadaResult = cdrInfoTask.testOmadaApi();
|
||||
if (sysJob != null && sysJob.getInvokeTarget().contains("omadaTask")) {
|
||||
R<Boolean> omadaResult = omadaTask.testOmadaApi();
|
||||
if (omadaResult.getCode() != 200) {
|
||||
return error(omadaResult.getMsg());
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ import org.wfc.system.api.RemoteUserService;
|
||||
import org.wfc.user.api.RemoteUUserService;
|
||||
|
||||
/**
|
||||
* @description: 话单信息任务
|
||||
* @description: omada任务
|
||||
* @author: cyc
|
||||
* @since: 2024-12-10
|
||||
* @since: 2025-01-16
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("cdrInfoTask")
|
||||
public class CdrInfoTask {
|
||||
@Component("omadaTask")
|
||||
public class OmadaTask {
|
||||
|
||||
@Autowired
|
||||
private RemoteUUserService remoteUUserService;
|
||||
@@ -22,7 +22,7 @@ public class CdrInfoTask {
|
||||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
public void addCdrInfo() {
|
||||
public void syncJob() {
|
||||
long startTime = System.currentTimeMillis();
|
||||
remoteUserService.deviceJob();
|
||||
remoteUUserService.addCdrInfoByOmadaApi();
|
||||
@@ -33,4 +33,8 @@ public class CdrInfoTask {
|
||||
public R<Boolean> testOmadaApi() {
|
||||
return remoteUserService.deviceJob();
|
||||
}
|
||||
|
||||
public R<Boolean> initJob() {
|
||||
return remoteUserService.settingJob();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user