From 22cc5532e567943e23debb87afe74e3bed52c680 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Wed, 17 Jul 2024 16:46:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=A5=E6=9C=9F=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/xxl/job/admin/api/log/JobLogApi.java | 4 ++-- .../com/xxl/job/admin/api/log/dto/JobLogPageReqDTO.java | 6 ++---- .../java/com/xxl/job/admin/api/log/dto/JobLogRespDTO.java | 4 ++-- .../java/com/xxl/job/admin/api/log/JobLogApiImpl.java | 8 ++++---- .../src/main/java/com/xxl/job/admin/dao/XxlJobLogDao.java | 8 ++++---- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/ludu-job-admin/ludu-job-admin-api/src/main/java/com/xxl/job/admin/api/log/JobLogApi.java b/ludu-job-admin/ludu-job-admin-api/src/main/java/com/xxl/job/admin/api/log/JobLogApi.java index 1d8a55164..414ee341c 100644 --- a/ludu-job-admin/ludu-job-admin-api/src/main/java/com/xxl/job/admin/api/log/JobLogApi.java +++ b/ludu-job-admin/ludu-job-admin-api/src/main/java/com/xxl/job/admin/api/log/JobLogApi.java @@ -28,8 +28,8 @@ public interface JobLogApi { @RequestParam(value = "pageSize") Integer pageSize, @RequestParam(value = "jobId") Integer jobId, @RequestParam(required = false, value = "handlerName") String handlerName, - @RequestParam(required = false, value = "beginTime") Date beginTime, - @RequestParam(required = false, value = "endTime") Date endTime, + @RequestParam(required = false, value = "beginTime") String beginTime, + @RequestParam(required = false, value = "endTime") String endTime, @RequestParam(required = false, value = "status") Integer status); @GetMapping(PREFIX + "/get") diff --git a/ludu-job-admin/ludu-job-admin-api/src/main/java/com/xxl/job/admin/api/log/dto/JobLogPageReqDTO.java b/ludu-job-admin/ludu-job-admin-api/src/main/java/com/xxl/job/admin/api/log/dto/JobLogPageReqDTO.java index 09eaf54b3..041202059 100644 --- a/ludu-job-admin/ludu-job-admin-api/src/main/java/com/xxl/job/admin/api/log/dto/JobLogPageReqDTO.java +++ b/ludu-job-admin/ludu-job-admin-api/src/main/java/com/xxl/job/admin/api/log/dto/JobLogPageReqDTO.java @@ -19,11 +19,9 @@ public class JobLogPageReqDTO extends PageParam { @Schema(description = "处理器的名字") private String handlerName; @Schema(description = "开始执行时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date beginTime; + private String beginTime; @Schema(description = "结束执行时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date endTime; + private String endTime; @Schema(description = "任务状态") private Integer status; } diff --git a/ludu-job-admin/ludu-job-admin-api/src/main/java/com/xxl/job/admin/api/log/dto/JobLogRespDTO.java b/ludu-job-admin/ludu-job-admin-api/src/main/java/com/xxl/job/admin/api/log/dto/JobLogRespDTO.java index 0149d9e8d..b9cdb03d2 100644 --- a/ludu-job-admin/ludu-job-admin-api/src/main/java/com/xxl/job/admin/api/log/dto/JobLogRespDTO.java +++ b/ludu-job-admin/ludu-job-admin-api/src/main/java/com/xxl/job/admin/api/log/dto/JobLogRespDTO.java @@ -28,10 +28,10 @@ public class JobLogRespDTO { private Integer executeIndex; @Schema(description = "开始执行时间") @ExcelProperty("开始执行时间") - private Date beginTime; + private String beginTime; @Schema(description = "结束执行时间") @ExcelProperty("结束执行时间") - private Date endTime; + private String endTime; @Schema(description = "执行时长") @ExcelProperty("执行时长") private Integer duration; diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/api/log/JobLogApiImpl.java b/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/api/log/JobLogApiImpl.java index fc165a2d2..95418d7fb 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/api/log/JobLogApiImpl.java +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/api/log/JobLogApiImpl.java @@ -53,8 +53,8 @@ public class JobLogApiImpl implements JobLogApi { Integer pageSize, Integer jobId, String handlerName, - Date beginTime, - Date endTime, + String beginTime, + String endTime, Integer status) { // 设置默认组为3 int jobGroup = 3; @@ -79,8 +79,8 @@ public class JobLogApiImpl implements JobLogApi { if (load.getTriggerCode() == 200) { jobLogRespDTO.setDuration((int) (load.getHandleTime().getTime() - load.getTriggerTime().getTime())); } - jobLogRespDTO.setBeginTime(load.getTriggerTime()); - jobLogRespDTO.setEndTime(load.getHandleTime()); + jobLogRespDTO.setBeginTime(load.getTriggerTime() == null ? null : DateUtil.formatDateTime(load.getTriggerTime())); + jobLogRespDTO.setEndTime(load.getHandleTime() == null ? null : DateUtil.formatDateTime(load.getHandleTime())); jobLogRespDTO.setHandlerName(load.getExecutorHandler()); jobLogRespDTO.setHandlerParam(load.getExecutorParam()); jobLogRespDTO.setStatus(load.getHandleCode() == 200 ? 1 : 2); diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/dao/XxlJobLogDao.java b/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/dao/XxlJobLogDao.java index 7a5f288a5..1f5479805 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/dao/XxlJobLogDao.java +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/java/com/xxl/job/admin/dao/XxlJobLogDao.java @@ -28,8 +28,8 @@ public interface XxlJobLogDao { @Param("pagesize") int pagesize, @Param("jobGroup") int jobGroup, @Param("jobId") int jobId, - @Param("triggerTimeStart") Date triggerTimeStart, - @Param("triggerTimeEnd") Date triggerTimeEnd, + @Param("triggerTimeStart") String triggerTimeStart, + @Param("triggerTimeEnd") String triggerTimeEnd, @Param("logStatus") Integer logStatus, @Param("handlerName") String handlerName); public int pageListCount(@Param("offset") int offset, @@ -72,8 +72,8 @@ public interface XxlJobLogDao { @Param("pagesize") int pagesize, @Param("jobGroup") int jobGroup, @Param("jobId") int jobId, - @Param("triggerTimeStart") Date triggerTimeStart, - @Param("triggerTimeEnd") Date triggerTimeEnd, + @Param("triggerTimeStart") String triggerTimeStart, + @Param("triggerTimeEnd") String triggerTimeEnd, @Param("logStatus") Integer logStatus, @Param("handlerName") String handlerName); }