解决日期筛选异常问题

This commit is contained in:
XinWei 2024-07-17 16:46:47 +08:00
parent 4cea2e37d4
commit 22cc5532e5
5 changed files with 14 additions and 16 deletions

View File

@ -28,8 +28,8 @@ public interface JobLogApi {
@RequestParam(value = "pageSize") Integer pageSize, @RequestParam(value = "pageSize") Integer pageSize,
@RequestParam(value = "jobId") Integer jobId, @RequestParam(value = "jobId") Integer jobId,
@RequestParam(required = false, value = "handlerName") String handlerName, @RequestParam(required = false, value = "handlerName") String handlerName,
@RequestParam(required = false, value = "beginTime") Date beginTime, @RequestParam(required = false, value = "beginTime") String beginTime,
@RequestParam(required = false, value = "endTime") Date endTime, @RequestParam(required = false, value = "endTime") String endTime,
@RequestParam(required = false, value = "status") Integer status); @RequestParam(required = false, value = "status") Integer status);
@GetMapping(PREFIX + "/get") @GetMapping(PREFIX + "/get")

View File

@ -19,11 +19,9 @@ public class JobLogPageReqDTO extends PageParam {
@Schema(description = "处理器的名字") @Schema(description = "处理器的名字")
private String handlerName; private String handlerName;
@Schema(description = "开始执行时间") @Schema(description = "开始执行时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private String beginTime;
private Date beginTime;
@Schema(description = "结束执行时间") @Schema(description = "结束执行时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private String endTime;
private Date endTime;
@Schema(description = "任务状态") @Schema(description = "任务状态")
private Integer status; private Integer status;
} }

View File

@ -28,10 +28,10 @@ public class JobLogRespDTO {
private Integer executeIndex; private Integer executeIndex;
@Schema(description = "开始执行时间") @Schema(description = "开始执行时间")
@ExcelProperty("开始执行时间") @ExcelProperty("开始执行时间")
private Date beginTime; private String beginTime;
@Schema(description = "结束执行时间") @Schema(description = "结束执行时间")
@ExcelProperty("结束执行时间") @ExcelProperty("结束执行时间")
private Date endTime; private String endTime;
@Schema(description = "执行时长") @Schema(description = "执行时长")
@ExcelProperty("执行时长") @ExcelProperty("执行时长")
private Integer duration; private Integer duration;

View File

@ -53,8 +53,8 @@ public class JobLogApiImpl implements JobLogApi {
Integer pageSize, Integer pageSize,
Integer jobId, Integer jobId,
String handlerName, String handlerName,
Date beginTime, String beginTime,
Date endTime, String endTime,
Integer status) { Integer status) {
// 设置默认组为3 // 设置默认组为3
int jobGroup = 3; int jobGroup = 3;
@ -79,8 +79,8 @@ public class JobLogApiImpl implements JobLogApi {
if (load.getTriggerCode() == 200) { if (load.getTriggerCode() == 200) {
jobLogRespDTO.setDuration((int) (load.getHandleTime().getTime() - load.getTriggerTime().getTime())); jobLogRespDTO.setDuration((int) (load.getHandleTime().getTime() - load.getTriggerTime().getTime()));
} }
jobLogRespDTO.setBeginTime(load.getTriggerTime()); jobLogRespDTO.setBeginTime(load.getTriggerTime() == null ? null : DateUtil.formatDateTime(load.getTriggerTime()));
jobLogRespDTO.setEndTime(load.getHandleTime()); jobLogRespDTO.setEndTime(load.getHandleTime() == null ? null : DateUtil.formatDateTime(load.getHandleTime()));
jobLogRespDTO.setHandlerName(load.getExecutorHandler()); jobLogRespDTO.setHandlerName(load.getExecutorHandler());
jobLogRespDTO.setHandlerParam(load.getExecutorParam()); jobLogRespDTO.setHandlerParam(load.getExecutorParam());
jobLogRespDTO.setStatus(load.getHandleCode() == 200 ? 1 : 2); jobLogRespDTO.setStatus(load.getHandleCode() == 200 ? 1 : 2);

View File

@ -28,8 +28,8 @@ public interface XxlJobLogDao {
@Param("pagesize") int pagesize, @Param("pagesize") int pagesize,
@Param("jobGroup") int jobGroup, @Param("jobGroup") int jobGroup,
@Param("jobId") int jobId, @Param("jobId") int jobId,
@Param("triggerTimeStart") Date triggerTimeStart, @Param("triggerTimeStart") String triggerTimeStart,
@Param("triggerTimeEnd") Date triggerTimeEnd, @Param("triggerTimeEnd") String triggerTimeEnd,
@Param("logStatus") Integer logStatus, @Param("logStatus") Integer logStatus,
@Param("handlerName") String handlerName); @Param("handlerName") String handlerName);
public int pageListCount(@Param("offset") int offset, public int pageListCount(@Param("offset") int offset,
@ -72,8 +72,8 @@ public interface XxlJobLogDao {
@Param("pagesize") int pagesize, @Param("pagesize") int pagesize,
@Param("jobGroup") int jobGroup, @Param("jobGroup") int jobGroup,
@Param("jobId") int jobId, @Param("jobId") int jobId,
@Param("triggerTimeStart") Date triggerTimeStart, @Param("triggerTimeStart") String triggerTimeStart,
@Param("triggerTimeEnd") Date triggerTimeEnd, @Param("triggerTimeEnd") String triggerTimeEnd,
@Param("logStatus") Integer logStatus, @Param("logStatus") Integer logStatus,
@Param("handlerName") String handlerName); @Param("handlerName") String handlerName);
} }