Browse Source

日期修改回显问题

master
赵鹏 1 month ago
parent
commit
47c4bbf9ca
  1. 15
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoRespVO.java
  2. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoSaveReqVO.java
  3. 4
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java

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

@ -5,6 +5,11 @@ import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.Enter
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO;
import cn.iocoder.yudao.module.system.dal.dataobject.tasktag.TaskTagDO;
import com.baomidou.mybatisplus.annotation.TableField;
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.ser.LocalDateSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@ -59,11 +64,17 @@ public class TaskInfoRespVO {
@Schema(description = "任务计划开始时间")
@ExcelProperty("任务计划开始时间")
private LocalDateTime startDate;
@JsonSerialize(using = LocalDateSerializer.class) // 序列化(响应)
@JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化(请求)
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate startDate;
@Schema(description = "任务计划结束时间")
@ExcelProperty("任务计划结束时间")
private LocalDateTime endDate;
@JsonSerialize(using = LocalDateSerializer.class) // 序列化(响应)
@JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化(请求)
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate endDate;
@Schema(description = "任务创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("任务创建时间")

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

@ -55,10 +55,16 @@ public class TaskInfoSaveReqVO {
private String status;
@Schema(description = "任务计划开始时间")
private LocalDateTime startDate;
@JsonSerialize(using = LocalDateSerializer.class) // 序列化(响应)
@JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化(请求)
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate startDate;
@Schema(description = "任务计划结束时间")
private LocalDateTime endDate;
@JsonSerialize(using = LocalDateSerializer.class) // 序列化(响应)
@JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化(请求)
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate endDate;
@Schema(description = "父任务id", example = "30399")
private Long parentId;

4
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java

@ -42,9 +42,9 @@ public class TaskSendStartMessageJob implements JobHandler {
reqDTO.setUserId(x.getUserId());
Map<String, String> message = new HashMap<>();
message.put("thing2", beforeTaskInfo.getTitle());
message.put("time3", DateUtil.format(beforeTaskInfo.getStartDate(), DateUtils.FORMAT_YEAR_MONTH_DAY));
message.put("time3", DateUtil.format(beforeTaskInfo.getStartDate().atStartOfDay(), DateUtils.FORMAT_YEAR_MONTH_DAY));
message.put("thing4", beforeTaskInfo.getDescription());
message.put("time5", DateUtil.format(beforeTaskInfo.getEndDate(), DateUtils.FORMAT_YEAR_MONTH_DAY));
message.put("time5", DateUtil.format(beforeTaskInfo.getEndDate().atStartOfDay(), DateUtils.FORMAT_YEAR_MONTH_DAY));
reqDTO.setMessages(message);
socialClientApi.sendWxaSubscribeMessage(reqDTO);
}

Loading…
Cancel
Save