ソースを参照

Merge branch 'master' of http://git.minpay.cc/SupplyChain/system

tudc 3 年 前
コミット
f8c555a550

+ 119 - 43
tianhu-system/src/main/java/com/tianhu/system/domain/SysNotice.java

@@ -1,63 +1,103 @@
 package com.tianhu.system.domain;
 
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.Size;
-
 import com.tianhu.common.core.annotation.Excel;
+import com.tianhu.common.core.web.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
-import com.tianhu.common.core.web.domain.BaseEntity;
-
 /**
- * 通知公告表 sys_notice
- * 
- * @author tianhu
+ * 通知公告对象 sys_notice
+ *
+ * @author huyi
+ * @date 2021-08-25
  */
 public class SysNotice extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
     /** 公告ID */
-    private Long noticeId;
+    private String noticeId;
+
+    /** 企业id */
+    @Excel(name = "企业id")
+    private String companyId;
+
+    /** 关联表主键 */
+    @Excel(name = "关联表主键")
+    private String tableId;
 
     /** 公告标题 */
+    @Excel(name = "公告标题")
     private String noticeTitle;
 
     /** 公告类型(1通知 2公告) */
+    @Excel(name = "公告类型", readConverterExp = "1=通知,2=公告")
     private String noticeType;
 
-    /** 公告内容 */
-    private String noticeContent;
+    /** 00:待办,01:消息提醒 */
+    @Excel(name = "00:待办,01:消息提醒")
+    private String type;
 
     /** 公告状态(0正常 1关闭) */
+    @Excel(name = "公告状态", readConverterExp = "0=正常,1=关闭")
     private String status;
 
-    /** 企业id */
-    private String companyId;
+    /** 是否短信提醒(0:不提醒, 1:提醒) */
+    @Excel(name = "是否短信提醒(0:不提醒, 1:提醒)")
+    private String messageSend;
+
+    /** 待办类型:(00:待审批, 01:链属, 02:融信失效) */
+    @Excel(name = "待办类型:(00:待审批, 01:链属, 02:融信失效)")
+    private String workType;
+
+    /** 短信模板ID */
+    @Excel(name = "短信模板ID")
+    private String messageId;
 
-    public Long getNoticeId()
+    /** 短信发送状态(0:未发送 1:已发送) */
+    @Excel(name = "短信发送状态", readConverterExp = "0=:未发送,1=:已发送")
+    private String messageStatus;
+
+    /** 短信模板 */
+    @Excel(name = "短信模板")
+    private String messageCode;
+
+    public void setNoticeId(String noticeId)
+    {
+        this.noticeId = noticeId;
+    }
+
+    public String getNoticeId()
     {
         return noticeId;
     }
+    public void setCompanyId(String companyId)
+    {
+        this.companyId = companyId;
+    }
 
-    public void setNoticeId(Long noticeId)
+    public String getCompanyId()
     {
-        this.noticeId = noticeId;
+        return companyId;
+    }
+    public void setTableId(String tableId)
+    {
+        this.tableId = tableId;
     }
 
+    public String getTableId()
+    {
+        return tableId;
+    }
     public void setNoticeTitle(String noticeTitle)
     {
         this.noticeTitle = noticeTitle;
     }
 
-    @NotBlank(message = "公告标题不能为空")
-    @Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
     public String getNoticeTitle()
     {
         return noticeTitle;
     }
-
     public void setNoticeType(String noticeType)
     {
         this.noticeType = noticeType;
@@ -67,17 +107,15 @@ public class SysNotice extends BaseEntity
     {
         return noticeType;
     }
-
-    public void setNoticeContent(String noticeContent)
+    public void setType(String type)
     {
-        this.noticeContent = noticeContent;
+        this.type = type;
     }
 
-    public String getNoticeContent()
+    public String getType()
     {
-        return noticeContent;
+        return type;
     }
-
     public void setStatus(String status)
     {
         this.status = status;
@@ -87,30 +125,68 @@ public class SysNotice extends BaseEntity
     {
         return status;
     }
+    public void setMessageSend(String messageSend)
+    {
+        this.messageSend = messageSend;
+    }
 
-    public void setCompanyId(String companyId)
+    public String getMessageSend()
     {
-        this.companyId = companyId;
+        return messageSend;
+    }
+    public void setWorkType(String workType)
+    {
+        this.workType = workType;
     }
 
-    public String getCompanyId()
+    public String getWorkType()
     {
-        return companyId;
+        return workType;
+    }
+    public void setMessageId(String messageId)
+    {
+        this.messageId = messageId;
+    }
+
+    public String getMessageId()
+    {
+        return messageId;
+    }
+    public void setMessageStatus(String messageStatus)
+    {
+        this.messageStatus = messageStatus;
+    }
+
+    public String getMessageStatus()
+    {
+        return messageStatus;
     }
+    public void setMessageCode(String messageCode)
+    {
+        this.messageCode = messageCode;
+    }
+
+    public String getMessageCode()
+    {
+        return messageCode;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("noticeId", getNoticeId())
-            .append("companyId", getCompanyId())
-            .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();
-    }
-}
+                .append("noticeId", getNoticeId())
+                .append("companyId", getCompanyId())
+                .append("tableId", getTableId())
+                .append("noticeTitle", getNoticeTitle())
+                .append("noticeType", getNoticeType())
+                .append("type", getType())
+                .append("status", getStatus())
+                .append("messageSend", getMessageSend())
+                .append("workType", getWorkType())
+                .append("messageId", getMessageId())
+                .append("messageStatus", getMessageStatus())
+                .append("messageCode", getMessageCode())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 3 - 3
tianhu-system/src/main/java/com/tianhu/system/mapper/SysNoticeMapper.java

@@ -17,7 +17,7 @@ public interface SysNoticeMapper
      * @param noticeId 公告ID
      * @return 公告信息
      */
-    public SysNotice selectNoticeById(Long noticeId);
+    public SysNotice selectNoticeById(String noticeId);
 
     /**
      * 查询公告列表
@@ -49,7 +49,7 @@ public interface SysNoticeMapper
      * @param noticeId 公告ID
      * @return 结果
      */
-    public int deleteNoticeById(Long noticeId);
+    public int deleteNoticeById(String noticeId);
 
     /**
      * 批量删除公告信息
@@ -57,5 +57,5 @@ public interface SysNoticeMapper
      * @param noticeIds 需要删除的公告ID
      * @return 结果
      */
-    public int deleteNoticeByIds(Long[] noticeIds);
+    public int deleteNoticeByIds(String[] noticeIds);
 }

+ 3 - 3
tianhu-system/src/main/java/com/tianhu/system/service/ISysNoticeService.java

@@ -17,7 +17,7 @@ public interface ISysNoticeService
      * @param noticeId 公告ID
      * @return 公告信息
      */
-    public SysNotice selectNoticeById(Long noticeId);
+    public SysNotice selectNoticeById(String noticeId);
 
     /**
      * 查询公告列表
@@ -49,7 +49,7 @@ public interface ISysNoticeService
      * @param noticeId 公告ID
      * @return 结果
      */
-    public int deleteNoticeById(Long noticeId);
+    public int deleteNoticeById(String noticeId);
     
     /**
      * 批量删除公告信息
@@ -57,5 +57,5 @@ public interface ISysNoticeService
      * @param noticeIds 需要删除的公告ID
      * @return 结果
      */
-    public int deleteNoticeByIds(Long[] noticeIds);
+    public int deleteNoticeByIds(String[] noticeIds);
 }

+ 3 - 3
tianhu-system/src/main/java/com/tianhu/system/service/impl/SysNoticeServiceImpl.java

@@ -27,7 +27,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
      * @return 公告信息
      */
     @Override
-    public SysNotice selectNoticeById(Long noticeId)
+    public SysNotice selectNoticeById(String noticeId)
     {
         return noticeMapper.selectNoticeById(noticeId);
     }
@@ -75,7 +75,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
      * @return 结果
      */
     @Override
-    public int deleteNoticeById(Long noticeId)
+    public int deleteNoticeById(String noticeId)
     {
         return noticeMapper.deleteNoticeById(noticeId);
     }
@@ -87,7 +87,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
      * @return 结果
      */
     @Override
-    public int deleteNoticeByIds(Long[] noticeIds)
+    public int deleteNoticeByIds(String[] noticeIds)
     {
         return noticeMapper.deleteNoticeByIds(noticeIds);
     }

+ 88 - 75
tianhu-system/src/main/resources/mapper/system/SysNoticeMapper.xml

@@ -1,100 +1,113 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.tianhu.system.mapper.SysNoticeMapper">
-    
+
     <resultMap type="SysNotice" id="SysNoticeResult">
-        <result property="noticeId"       column="notice_id"       />
+        <result property="noticeId"    column="notice_id"    />
+        <result property="companyId"    column="company_id"    />
+        <result property="tableId"    column="table_id"    />
         <result property="noticeTitle"    column="notice_title"    />
-        <result property="noticeType"     column="notice_type"     />
-        <result property="noticeContent"  column="notice_content"  />
-        <result property="status"         column="status"          />
-        <result property="createBy"       column="create_by"       />
-        <result property="createTime"     column="create_time"     />
-        <result property="updateBy"       column="update_by"       />
-        <result property="updateTime"     column="update_time"     />
-        <result property="remark"         column="remark"          />
-        <result property="companyId"      column="company_id"      />
+        <result property="noticeType"    column="notice_type"    />
+        <result property="type"    column="type"    />
+        <result property="status"    column="status"    />
+        <result property="messageSend"    column="message_send"    />
+        <result property="workType"    column="work_type"    />
+        <result property="messageId"    column="message_id"    />
+        <result property="messageStatus"    column="message_status"    />
+        <result property="messageCode"    column="message_code"    />
+        <result property="remark"    column="remark"    />
     </resultMap>
-    
-    <sql id="selectNoticeVo">
-        select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark,company_id
-		from sys_notice
+
+    <sql id="selectSysNoticeVo">
+        select notice_id, company_id, table_id, notice_title, notice_type, type, status, message_send, work_type, message_id, message_status, message_code, remark from sys_notice
     </sql>
-    
-    <select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
-        <include refid="selectNoticeVo"/>
-        where notice_id = #{noticeId}
-    </select>
-    
+
     <select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
-        <include refid="selectNoticeVo"/>
+        <include refid="selectSysNoticeVo"/>
         <where>
-            <if test="companyId != null  and companyId != ''">
-                AND company_id = #{companyId}
-             </if>
-            <if test="status != null  and status != ''">
-                AND status = #{status}
-            </if>
-			<if test="noticeTitle != null and noticeTitle != ''">
-				AND notice_title like concat('%', #{noticeTitle}, '%')
-			</if>
-			<if test="noticeType != null and noticeType != ''">
-				AND notice_type = #{noticeType}
-			</if>
-			<if test="createBy != null and createBy != ''">
-				AND create_by like concat('%', #{createBy}, '%')
-			</if>
-		</where>
-        ORDER BY create_time DESC
+            <if test="companyId != null  and companyId != ''"> and company_id = #{companyId}</if>
+            <if test="tableId != null  and tableId != ''"> and table_id = #{tableId}</if>
+            <if test="noticeTitle != null  and noticeTitle != ''"> and notice_title = #{noticeTitle}</if>
+            <if test="noticeType != null  and noticeType != ''"> and notice_type = #{noticeType}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="messageSend != null  and messageSend != ''"> and message_send = #{messageSend}</if>
+            <if test="workType != null  and workType != ''"> and work_type = #{workType}</if>
+            <if test="messageId != null  and messageId != ''"> and message_id = #{messageId}</if>
+            <if test="messageStatus != null  and messageStatus != ''"> and message_status = #{messageStatus}</if>
+            <if test="messageCode != null  and messageCode != ''"> and message_code = #{messageCode}</if>
+        </where>
+    </select>
+
+    <select id="selectNoticeById" parameterType="String" resultMap="SysNoticeResult">
+        <include refid="selectSysNoticeVo"/>
+        where notice_id = #{noticeId}
     </select>
-    
+
     <insert id="insertNotice" parameterType="SysNotice">
-        insert into sys_notice (
-			<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
+        insert into sys_notice
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="noticeId != null">notice_id,</if>
             <if test="companyId != null">company_id,</if>
-			<if test="noticeType != null and noticeType != '' ">notice_type, </if>
-			<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
-			<if test="status != null and status != '' ">status, </if>
-			<if test="remark != null and remark != ''">remark,</if>
- 			<if test="createBy != null and createBy != ''">create_by,</if>
- 			create_time
- 		)values(
-			<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
+            <if test="tableId != null">table_id,</if>
+            <if test="noticeTitle != null and noticeTitle != ''">notice_title,</if>
+            <if test="noticeType != null and noticeType != ''">notice_type,</if>
+            <if test="type != null">type,</if>
+            <if test="status != null">status,</if>
+            <if test="messageSend != null">message_send,</if>
+            <if test="workType != null">work_type,</if>
+            <if test="messageId != null">message_id,</if>
+            <if test="messageStatus != null">message_status,</if>
+            <if test="messageCode != null">message_code,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="noticeId != null">#{noticeId},</if>
             <if test="companyId != null">#{companyId},</if>
-			<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
-			<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
-			<if test="status != null and status != ''">#{status}, </if>
-			<if test="remark != null and remark != ''">#{remark},</if>
- 			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
-		)
+            <if test="tableId != null">#{tableId},</if>
+            <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
+            <if test="noticeType != null and noticeType != ''">#{noticeType},</if>
+            <if test="type != null">#{type},</if>
+            <if test="status != null">#{status},</if>
+            <if test="messageSend != null">#{messageSend},</if>
+            <if test="workType != null">#{workType},</if>
+            <if test="messageId != null">#{messageId},</if>
+            <if test="messageStatus != null">#{messageStatus},</if>
+            <if test="messageCode != null">#{messageCode},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
     </insert>
-	 
+
     <update id="updateNotice" parameterType="SysNotice">
-        update sys_notice 
-        <set>
+        update sys_notice
+        <trim prefix="SET" suffixOverrides=",">
             <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
-            <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
-            <if test="noticeContent != null">notice_content = #{noticeContent}, </if>
-            <if test="status != null and status != ''">status = #{status}, </if>
-            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
-        </set>
+            <if test="tableId != null">table_id = #{tableId},</if>
+            <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle},</if>
+            <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="messageSend != null">message_send = #{messageSend},</if>
+            <if test="workType != null">work_type = #{workType},</if>
+            <if test="messageId != null">message_id = #{messageId},</if>
+            <if test="messageStatus != null">message_status = #{messageStatus},</if>
+            <if test="messageCode != null">message_code = #{messageCode},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
         where notice_id = #{noticeId}
     </update>
-	
-    <delete id="deleteNoticeById" parameterType="Long">
+
+    <delete id="deleteNoticeById" parameterType="String">
         delete from sys_notice where notice_id = #{noticeId}
     </delete>
-    
-    <delete id="deleteNoticeByIds" parameterType="Long">
-        delete from sys_notice where notice_id in 
+
+    <delete id="deleteNoticeByIds" parameterType="String">
+        delete from sys_notice where notice_id in
         <foreach item="noticeId" collection="array" open="(" separator="," close=")">
             #{noticeId}
         </foreach>
     </delete>
-    
+
 </mapper>