【fix】公告部分bug修复

This commit is contained in:
nixj 2024-05-29 14:16:07 +08:00
parent 05d16296c9
commit c253f1363e
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package com.chint.application.dtos.system;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.time.LocalDateTime;
@ -10,7 +11,9 @@ public class SystemAnnouncementVO {
private String title; // 公告的标题
private String content; // 公告的详细内容
private String postedBy; // 发布公告的用户或管理员的用户名
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime postDate; // 公告发布的日期和时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime expiryDate; // 公告的过期日期
private String status; // 公告的状态
private Integer priority; // 公告的优先级用于排序

View File

@ -6,6 +6,7 @@ import com.chint.application.dtos.system.SystemAnnouncementVO;
import com.chint.domain.aggregates.user.User;
import com.chint.infrastructure.util.BaseContext;
import com.chint.infrastructure.util.DateTimeUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.MappedCollection;
@ -29,7 +30,9 @@ public class SystemAnnouncement implements Serializable {
private String title; // 公告的标题
private String content; // 公告的详细内容
private String postedBy; // 发布公告的用户或管理员的用户名
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime postDate; // 公告发布的日期和时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime expiryDate; // 公告的过期日期
private String status; // 公告的状态
private Integer priority; // 公告的优先级用于排序
@ -80,7 +83,7 @@ public class SystemAnnouncement implements Serializable {
systemAnnouncement.setExpiryDate(expiryTime);
}
systemAnnouncement.setStatus("1");
systemAnnouncement.setPriority(0);
systemAnnouncement.setPriority(dto.getPriority());
User currentUser = BaseContext.getCurrentUser();
if (currentUser != null) {