Browse Source

任务时间问题

master
赵鹏 2 months ago
parent
commit
22a8584fae
  1. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/TaskInfoController.java
  2. 20
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoSaveReqVO.java

2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/TaskInfoController.java

@ -84,7 +84,7 @@ public class TaskInfoController {
return success(taskInfoService.createTaskInfo(createReqVO)); return success(taskInfoService.createTaskInfo(createReqVO));
} }
@PostMapping("/update") @PutMapping("/update")
@Operation(summary = "更新任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。") @Operation(summary = "更新任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。")
@PreAuthorize("@ss.hasPermission('system:task-info:update')") @PreAuthorize("@ss.hasPermission('system:task-info:update')")
public CommonResult<Boolean> updateTaskInfo(@Valid @RequestBody TaskInfoSaveReqVO updateReqVO) { public CommonResult<Boolean> updateTaskInfo(@Valid @RequestBody TaskInfoSaveReqVO updateReqVO) {

20
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoSaveReqVO.java

@ -1,12 +1,20 @@
package cn.iocoder.yudao.module.system.controller.admin.taskinfo.vo; package cn.iocoder.yudao.module.system.controller.admin.taskinfo.vo;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO; import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
@ -47,12 +55,16 @@ public class TaskInfoSaveReqVO {
private String status; private String status;
@Schema(description = "任务计划开始时间") @Schema(description = "任务计划开始时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @JsonSerialize(using = LocalDateSerializer.class) // 序列化(响应)
private LocalDateTime startDate; @JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化(请求)
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate startDate;
@Schema(description = "任务计划结束时间") @Schema(description = "任务计划结束时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @JsonSerialize(using = LocalDateSerializer.class) // 序列化(响应)
private LocalDateTime endDate; @JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化(请求)
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate endDate;
@Schema(description = "父任务id", example = "30399") @Schema(description = "父任务id", example = "30399")
private Long parentId; private Long parentId;

Loading…
Cancel
Save