解决日期筛选异常问题

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 = "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")

View File

@ -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;
}

View File

@ -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;

View File

@ -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);

View File

@ -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);
}