From bd9dd194dc9e5d08e9cacd391ec7dca3624d8a71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?=
<14103883+leaf-phos@user.noreply.gitee.com>
Date: Wed, 15 Jan 2025 18:01:10 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/ruoyi/system/domain/SysNotice.java | 92 +++++--------------
.../mapper/system/SysNoticeMapper.xml | 24 ++++-
2 files changed, 45 insertions(+), 71 deletions(-)
diff --git a/smart-switch-ruoyi/smart-switch-system/src/main/java/com/ruoyi/system/domain/SysNotice.java b/smart-switch-ruoyi/smart-switch-system/src/main/java/com/ruoyi/system/domain/SysNotice.java
index 8c07a54a..77445385 100644
--- a/smart-switch-ruoyi/smart-switch-system/src/main/java/com/ruoyi/system/domain/SysNotice.java
+++ b/smart-switch-ruoyi/smart-switch-system/src/main/java/com/ruoyi/system/domain/SysNotice.java
@@ -1,17 +1,20 @@
package com.ruoyi.system.domain;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import com.ruoyi.common.xss.Xss;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-import com.ruoyi.common.core.domain.BaseEntity;
-import com.ruoyi.common.xss.Xss;
/**
* 通知公告表 sys_notice
- *
+ *
* @author ruoyi
*/
+@Data
public class SysNotice extends BaseEntity
{
private static final long serialVersionUID = 1L;
@@ -20,6 +23,9 @@ public class SysNotice extends BaseEntity
private Long noticeId;
/** 公告标题 */
+ @Xss(message = "公告标题不能包含脚本字符")
+ @NotBlank(message = "公告标题不能为空")
+ @Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
private String noticeTitle;
/** 公告类型(1通知 2公告) */
@@ -31,72 +37,20 @@ public class SysNotice extends BaseEntity
/** 公告状态(0正常 1关闭) */
private String status;
- public Long getNoticeId()
- {
- return noticeId;
- }
+ @Excel(name = "接收方式", readConverterExp = "1=全体用户,2=指定用户")
+ @ApiModelProperty("接收方式")
+ private String receiveType;
- public void setNoticeId(Long noticeId)
- {
- this.noticeId = noticeId;
- }
+ @Excel(name = "跳转URL")
+ @ApiModelProperty("跳转URL")
+ private String url;
- public void setNoticeTitle(String noticeTitle)
- {
- this.noticeTitle = noticeTitle;
- }
+ @Excel(name = "URL类型", readConverterExp = "1=公告详情,2=小程序内部URL,3=外部URL")
+ @ApiModelProperty("URL类型")
+ private String urlType;
- @Xss(message = "公告标题不能包含脚本字符")
- @NotBlank(message = "公告标题不能为空")
- @Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
- public String getNoticeTitle()
- {
- return noticeTitle;
- }
+ @Excel(name = "发送方式", readConverterExp = "1=小程序内部展示,2=短信,3=公众号")
+ @ApiModelProperty("发送方式")
+ private String sendType;
- public void setNoticeType(String noticeType)
- {
- this.noticeType = noticeType;
- }
-
- public String getNoticeType()
- {
- return noticeType;
- }
-
- public void setNoticeContent(String noticeContent)
- {
- this.noticeContent = noticeContent;
- }
-
- public String getNoticeContent()
- {
- return noticeContent;
- }
-
- public void setStatus(String status)
- {
- this.status = status;
- }
-
- public String getStatus()
- {
- return status;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
- .append("noticeId", getNoticeId())
- .append("noticeTitle", getNoticeTitle())
- .append("noticeType", getNoticeType())
- .append("noticeContent", getNoticeContent())
- .append("status", getStatus())
- .append("createBy", getCreateBy())
- .append("createTime", getCreateTime())
- .append("updateBy", getUpdateBy())
- .append("updateTime", getUpdateTime())
- .append("remark", getRemark())
- .toString();
- }
}
diff --git a/smart-switch-ruoyi/smart-switch-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/smart-switch-ruoyi/smart-switch-system/src/main/resources/mapper/system/SysNoticeMapper.xml
index f909f685..39fba75c 100644
--- a/smart-switch-ruoyi/smart-switch-system/src/main/resources/mapper/system/SysNoticeMapper.xml
+++ b/smart-switch-ruoyi/smart-switch-system/src/main/resources/mapper/system/SysNoticeMapper.xml
@@ -17,7 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
create_time,
update_by,
update_time,
- remark
+ remark,
+ receive_type,
+ url,
+ url_type,
+ send_type
from sys_notice
@@ -41,6 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND `status` = #{status}
+ and receive_type = #{receiveType}
+ and url like concat('%', #{url},'%')
+ and url_type = #{urlType}
+ and send_type = #{sendType}
@@ -52,6 +60,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
status,
remark,
create_by,
+ receive_type,
+ url,
+ url_type,
+ send_type,
create_time
)values(
#{noticeTitle},
@@ -60,6 +72,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{status},
#{remark},
#{createBy},
+ #{receiveType},
+ #{url},
+ #{urlType},
+ #{sendType},
sysdate()
)
@@ -70,8 +86,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
notice_title = #{noticeTitle},
notice_type = #{noticeType},
notice_content = #{noticeContent},
- status = #{status},
+ `status` = #{status},
update_by = #{updateBy},
+ receive_type = #{receiveType},
+ url = #{url},
+ url_type = #{urlType},
+ send_type = #{sendType},
update_time = sysdate()
where notice_id = #{noticeId}