jobid查询接口;

This commit is contained in:
王奎兴
2026-09-05 19:08:42 +08:00
parent 20d11dc9b2
commit 6708353379
2 changed files with 6 additions and 4 deletions
@@ -389,7 +389,7 @@ public class SettlementCustomersApplicationService {
if (!addOk) { if (!addOk) {
throw new RuntimeException("创建夜间定时任务失败"); throw new RuntimeException("创建夜间定时任务失败");
} }
Integer xxlJobId = apiUtil.queryJobIdByDescAndParam(req.getJobDesc(), shipperId); Integer xxlJobId = apiUtil.queryJobIdByDescAndParam(req.getJobDesc(), shipperId,"3");
if (xxlJobId == null) { if (xxlJobId == null) {
throw new RuntimeException("定时任务创建成功,但查询jobId失败"); throw new RuntimeException("定时任务创建成功,但查询jobId失败");
} }
@@ -427,7 +427,7 @@ public class SettlementCustomersApplicationService {
if (!addOk) { if (!addOk) {
throw new RuntimeException("创建夜间定时任务失败"); throw new RuntimeException("创建夜间定时任务失败");
} }
Integer xxlJobId = apiUtil.queryJobIdByDescAndParam(req.getJobDesc(), shipperId); Integer xxlJobId = apiUtil.queryJobIdByDescAndParam(req.getJobDesc(), shipperId,"6");
if (xxlJobId == null) { if (xxlJobId == null) {
throw new RuntimeException("定时任务创建成功,但查询jobId失败"); throw new RuntimeException("定时任务创建成功,但查询jobId失败");
} }
@@ -58,14 +58,16 @@ public class XxlJobOpenApiUtil {
* @param executorParam 任务参数(业务shipperId) * @param executorParam 任务参数(业务shipperId)
* @return jobId,查不到返回null * @return jobId,查不到返回null
*/ */
public Integer queryJobIdByDescAndParam(String jobDesc, String executorParam) { public Integer queryJobIdByDescAndParam(String jobDesc, String executorParam,String jobGroup) {
StringBuilder querySb = new StringBuilder(); StringBuilder querySb = new StringBuilder();
// start length必须 // start length必须
querySb.append("start=0&length=10"); querySb.append("start=0&length=10");
// jobGroup:为空就不拼接这个参数!!不要 jobGroup="" // jobGroup:为空就不拼接这个参数!!不要 jobGroup=""
// 你们业务固定jobGroup=3,直接写死3,不用传空 // 你们业务固定jobGroup=3,直接写死3,不用传空
querySb.append("&jobGroup=3"); if(StrUtil.isNotBlank(jobGroup)){
querySb.append("&jobGroup=").append(jobGroup);
}
// jobDesc // jobDesc
if(StrUtil.isNotBlank(jobDesc)){ if(StrUtil.isNotBlank(jobDesc)){