Răsfoiți Sursa

消息推送

24282 1 an în urmă
părinte
comite
fa8aaa91f9

+ 9 - 0
hx-socket/src/main/java/com/fjhx/socket/entity/push/dto/PushInfoSelectDto.java

@@ -26,5 +26,14 @@ public class PushInfoSelectDto extends BaseSelectDto {
      */
     private Integer pushRead;
 
+    /**
+     * 推送类型 1公告 2消息
+     */
+    private Integer type;
+
+    /**
+     * 是否流程
+     */
+    private Integer whetherFlow;
 
 }

+ 10 - 1
hx-socket/src/main/java/com/fjhx/socket/service/push/impl/PushInfoServiceImpl.java

@@ -1,9 +1,9 @@
 package com.fjhx.socket.service.push.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fjhx.socket.entity.push.dto.PushInfoDto;
 import com.fjhx.socket.entity.push.dto.PushInfoSelectDto;
 import com.fjhx.socket.entity.push.po.PushInfo;
 import com.fjhx.socket.entity.push.vo.PushInfoVo;
@@ -37,6 +37,15 @@ public class PushInfoServiceImpl extends ServiceImpl<PushInfoMapper, PushInfo> i
         wrapper.orderByDesc("pi", PushInfo::getId);
         wrapper.eq("pi", PushInfo::getPushRead, dto.getPushRead());
         wrapper.eq("pi", PushInfo::getPushUserId, SecurityUtils.getUserId());
+        wrapper.eq("pi", PushInfo::getType, dto.getType());
+        wrapper.func(ObjectUtil.isNotEmpty(dto.getWhetherFlow()), q -> {
+            if (StatusConstant.YES.equals(dto.getWhetherFlow())) {
+                q.eq("pi", PushInfo::getBusinessType, 0);
+            } else {
+                q.ne("pi", PushInfo::getBusinessType, 0);
+            }
+        });
+
         Page<PushInfoVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         return page;
     }

+ 13 - 15
hx-socket/src/main/resources/mapper/push/PushInfoMapper.xml

@@ -2,21 +2,19 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fjhx.socket.mapper.push.PushInfoMapper">
     <select id="getPage" resultType="com.fjhx.socket.entity.push.vo.PushInfoVo">
-        select
-            pi.id,
-            pi.type,
-            pi.announcement_id,
-            pi.title,
-            pi.business_type,
-            pi.business_data,
-            pi.push_user_id,
-            pi.push_read,
-            pi.push_start_time,
-            pi.push_end_time,
-            pi.create_user,
-            pi.create_time,
-            pi.update_user,
-            pi.update_time
+        select pi.id,
+               pi.type,
+               pi.announcement_id,
+               pi.title,
+               pi.business_type,
+               pi.business_data,
+               pi.push_user_id,
+               pi.push_read,
+               pi.failure_time,
+               pi.create_user,
+               pi.create_time,
+               pi.update_user,
+               pi.update_time
         from push_info pi
             ${ew.customSqlSegment}
     </select>