Skip to content

Commit 513d8d9

Browse files
committed
fix: 修复查询任务日志报错的问题
1 parent 39aebf4 commit 513d8d9

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

continew-admin-plugins/continew-admin-job/src/main/java/top/continew/admin/job/api/JobBatchApi.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package top.continew.admin.job.api;
1818

19-
import com.aizuda.snailjob.common.core.model.Result;
2019
import com.aizuda.snailjob.common.core.model.Result;
2120
import org.springframework.http.MediaType;
2221
import org.springframework.http.ResponseEntity;
@@ -27,10 +26,9 @@
2726
import org.springframework.web.service.annotation.PostExchange;
2827
import top.continew.admin.job.model.JobInstanceLogPageResult;
2928
import top.continew.admin.job.model.JobPageResult;
30-
import top.continew.admin.job.model.resp.JobLogResp;
3129
import top.continew.admin.job.model.resp.JobInstanceResp;
30+
import top.continew.admin.job.model.resp.JobLogResp;
3231

33-
import java.time.LocalDateTime;
3432
import java.util.List;
3533

3634
/**
@@ -60,7 +58,7 @@ ResponseEntity<JobPageResult<List<JobLogResp>>> page(@RequestParam(value = "jobI
6058
@RequestParam(value = "jobName", required = false) String jobName,
6159
@RequestParam(value = "groupName", required = false) String groupName,
6260
@RequestParam(value = "taskBatchStatus", required = false) Integer taskBatchStatus,
63-
@RequestParam(value = "datetimeRange", required = false) LocalDateTime[] datetimeRange,
61+
@RequestParam(value = "datetimeRange", required = false) String[] datetimeRange,
6462
@RequestParam(value = "page") Integer page,
6563
@RequestParam(value = "size") Integer size);
6664

continew-admin-plugins/continew-admin-job/src/main/java/top/continew/admin/job/service/impl/JobLogServiceImpl.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package top.continew.admin.job.service.impl;
1818

19+
import cn.hutool.core.date.DatePattern;
20+
import cn.hutool.core.date.DateUtil;
1921
import lombok.RequiredArgsConstructor;
2022
import org.springframework.stereotype.Service;
2123
import top.continew.admin.job.api.JobBatchApi;
@@ -29,6 +31,7 @@
2931
import top.continew.admin.job.service.JobLogService;
3032
import top.continew.starter.extension.crud.model.resp.PageResp;
3133

34+
import java.time.LocalDateTime;
3235
import java.util.List;
3336
import java.util.Objects;
3437

@@ -48,9 +51,12 @@ public class JobLogServiceImpl implements JobLogService {
4851

4952
@Override
5053
public PageResp<JobLogResp> page(JobLogQuery query) {
54+
LocalDateTime[] datetimeRange = query.getDatetimeRange();
5155
return jobClient.requestPage(() -> jobBatchApi.page(query.getJobId(), query.getJobName(), query
52-
.getGroupName(), query.getTaskBatchStatus() != null ? query.getTaskBatchStatus().getValue() : null, query
53-
.getDatetimeRange(), query.getPage(), query.getSize()));
56+
.getGroupName(), query.getTaskBatchStatus() != null
57+
? query.getTaskBatchStatus().getValue()
58+
: null, new String[] {DateUtil.format(datetimeRange[0], DatePattern.UTC_SIMPLE_PATTERN), DateUtil
59+
.format(datetimeRange[1], DatePattern.UTC_SIMPLE_PATTERN)}, query.getPage(), query.getSize()));
5460
}
5561

5662
@Override

0 commit comments

Comments
 (0)