瀏覽代碼

通知列表

change 3 年之前
父節點
當前提交
421f0792ed

+ 1 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/inform/InformController.java

@@ -50,7 +50,7 @@ public class InformController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<InformVo> list(InformQueryBo bo) {
         startPage();
-        List<InformVo> list = iInformService.queryList(bo);
+        List<InformVo> list = iInformService.listInform(bo);
         return getDataTable(list);
     }
 

+ 20 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformQueryBo.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
 
@@ -57,10 +58,28 @@ public class InformQueryBo extends BaseEntity {
 	/** 1需要已读回执 0否 */
 	@ApiModelProperty("1需要已读回执 0否")
 	private Integer receiptStatus;
+
+	/** 1.发送成功    :指定用户成功收到发送的信息
+
+	 2.发送失败    :指定用户一个也没有收到发送的信息
+
+	 3.部分发送成功:指定用户部分收到发送的信息,部分没有收到信息
+
+	 4.待发送        :发送该信息已设定定时发送,且还没有到发送时间。此时发送时间时间显示“-” */
+	@ApiModelProperty("1.发送成功 2.发送失败   3.部分发送成功 4.待发送 ")
+	private Integer userStatus;
 	/** 公告 */
 	@ApiModelProperty("公告")
 	private String affiche;
+	/** 开始时间 */
+	@ApiModelProperty("开始时间")
+	private Long startTime;
+	/** 结束时间 */
+	@ApiModelProperty("结束时间")
+	private Long endTime;
+
+
 	/** 1已发布 0未发布 -1删除 */
 	@ApiModelProperty("1已发布 0未发布 -1删除")
-	private Integer status;
+	private List<Integer> status;
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/mapper/InformMapper.java

@@ -1,7 +1,11 @@
 package com.zhongzheng.modules.inform.mapper;
 
+import com.zhongzheng.modules.inform.bo.InformQueryBo;
 import com.zhongzheng.modules.inform.domain.Inform;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.inform.vo.InformVo;
+
+import java.util.List;
 
 /**
  * 【请填写功能名称】Mapper接口
@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface InformMapper extends BaseMapper<Inform> {
 
+    List<InformVo> listInform(InformQueryBo bo);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/IInformService.java

@@ -49,4 +49,6 @@ public interface IInformService extends IService<Inform> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+	List<InformVo> listInform(InformQueryBo bo);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformServiceImpl.java

@@ -135,4 +135,9 @@ public class InformServiceImpl extends ServiceImpl<InformMapper, Inform> impleme
         }
         return this.removeByIds(ids);
     }
+
+    @Override
+    public List<InformVo> listInform(InformQueryBo bo) {
+        return baseMapper.listInform(bo);
+    }
 }

+ 22 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformVo.java

@@ -67,4 +67,26 @@ public class InformVo {
 	@Excel(name = "发布者")
 	@ApiModelProperty("发布者")
 	private String createBy;
+
+	/** 发送人数*/
+	@Excel(name = "发送人数")
+	@ApiModelProperty("发送人数")
+	private Long userNum;
+
+	/** 发送时间*/
+	@Excel(name = "发送时间")
+	@ApiModelProperty("发送时间")
+	private Long sendTime;
+
+	/** 发送状态*/
+	@Excel(name = "发送状态")
+	@ApiModelProperty("发送状态")
+	private Long userStatus;
+
+	/** 已读人数*/
+	@Excel(name = "已读人数")
+	@ApiModelProperty("已读人数")
+	private Long receiptNum;
 }
+
+

+ 56 - 2
zhongzheng-system/src/main/resources/mapper/modules/inform/InformMapper.xml

@@ -18,6 +18,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="affiche" column="affiche"/>
         <result property="status" column="status"/>
     </resultMap>
-
-
+    <resultMap type="com.zhongzheng.modules.inform.vo.InformVo" id="InformVo">
+        <result property="informId" column="inform_id"/>
+        <result property="informType" column="inform_type"/>
+        <result property="informName" column="inform_name"/>
+        <result property="informWay" column="inform_way"/>
+        <result property="classifyId" column="classify_id"/>
+        <result property="issueStatus" column="issue_status"/>
+        <result property="issueTime" column="issue_time"/>
+        <result property="receiptStatus" column="receipt_status"/>
+        <result property="affiche" column="affiche"/>
+        <result property="status" column="status"/>
+        <result property="userNum" column="user_num"/>
+        <result property="sendTime" column="send_time"/>
+        <result property="userStatus" column="user_status"/>
+        <result property="receiptNum" column="receipt_num"/>
+    </resultMap>
+    <select id="listInform" parameterType="com.zhongzheng.modules.inform.bo.InformQueryBo"  resultMap="InformVo">
+        SELECT
+        i.inform_name,
+        i.inform_way,
+        i.create_by,
+        i.inform_type,
+        (SELECT COUNT(iu.id) FROM inform_user iu where i.inform_id=iu.inform_id) as user_num,
+        (SELECT iu.send_time FROM inform_user iu where i.inform_id=iu.inform_id ORDER BY iu.send_time ASC limit 1) as send_time,
+        i.`status`,
+        IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)=0,2,
+        IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)=(SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id),1,
+        IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)&lt;(SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id),3,4))) as user_status,
+        i.receipt_status,
+        (SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1) as receipt_num
+        FROM
+        inform i
+        <if test="status != null and status.size()!=0 ">
+            AND i.status in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="informType != null and informType != ''">
+            and i.inform_type = #{informType}
+        </if>
+        <if test="informName != null and informName != ''">
+            and i.inform_name = #{informName}
+        </if>
+        <if test="classifyId != null and classifyId != ''">
+            and i.classify_id = #{classifyId}
+        </if>
+        <if test="startTime != null and startTime != ''">
+            and (SELECT iu.send_time FROM inform_user iu where i.inform_id=iu.inform_id ORDER BY iu.send_time ASC limit 1) BETWEEN #{startTime} and #{endTime}
+        </if>
+        <if test="userStatus != null and userStatus != ''">
+            and 	IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)=0,2,
+            IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)=(SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id),1,
+            IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)&lt;(SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id),3,4))) = #{userStatus}
+        </if>
+    </select>
 </mapper>