Browse Source

95:红德堂APP调试

同步代码
Long 2 days ago
parent
commit
870d578c3a

+ 18 - 1
fs-service/src/main/java/com/fs/course/mapper/FsCourseSopAppLinkMapper.java

@@ -6,6 +6,7 @@ import com.fs.course.domain.FsCourseSopAppLink;
 import com.fs.course.vo.FsSopMyCourseLinkVO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 
 import java.util.List;
 
@@ -68,6 +69,7 @@ public interface FsCourseSopAppLinkMapper extends BaseMapper<FsCourseSopAppLink>
 
     @Select("SELECT\n" +
             "al.id," +
+            "al.link," +
             "\tal.create_time," +
             "\tal.update_time,\n" +
             "\tal.qw_user_name,\n" +
@@ -81,6 +83,21 @@ public interface FsCourseSopAppLinkMapper extends BaseMapper<FsCourseSopAppLink>
             "\tLEFT JOIN qw_external_contact ec ON al.qw_external_id = ec.id \n" +
             "WHERE\n" +
             "\tec.fs_user_id = #{userId} \n" +
-            "\tAND al.update_time >= NOW() ")
+            "\tAND al.update_time >= NOW() " +
+            "ORDER BY al.is_read asc,al.create_time desc ")
     List<FsSopMyCourseLinkVO> getSopCourseStudyList(@Param("userId") Long userId);
+
+    @Select("SELECT\n" +
+            "\tcount(1) as isNotRead\n" +
+            "FROM\n" +
+            "\tfs_course_sop_app_link al\n" +
+            "\tLEFT JOIN qw_external_contact ec ON al.qw_external_id = ec.id \n" +
+            "WHERE\n" +
+            "\tec.fs_user_id = #{userId} \n" +
+            "\tAND al.is_read = 0 \n" +
+            "\tAND al.update_time >= NOW() ")
+    Integer selectSopCountIsNotRead(@Param("userId") Long userId);
+
+    @Update("update fs_course_sop_app_link set is_read = 1 where link = #{id}")
+    int updateFsCourseSopAppLinkByLink(@Param("id") String id);
 }

+ 4 - 0
fs-service/src/main/java/com/fs/course/service/IFsCourseSopAppLinkService.java

@@ -64,4 +64,8 @@ public interface IFsCourseSopAppLinkService extends IService<FsCourseSopAppLink>
 
 
     List<FsSopMyCourseLinkVO>  getSopCourseStudyList(Long userId);
+
+    Integer selectSopCountIsNotRead(Long userId);
+
+    int updateFsCourseSopAppLinkByLink(String id);
 }

+ 10 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCourseSopAppLinkServiceImpl.java

@@ -97,4 +97,14 @@ public class FsCourseSopAppLinkServiceImpl extends ServiceImpl<FsCourseSopAppLin
     public List<FsSopMyCourseLinkVO> getSopCourseStudyList(Long userId) {
         return baseMapper.getSopCourseStudyList(userId);
     }
+
+    @Override
+    public Integer selectSopCountIsNotRead(Long userId) {
+        return baseMapper.selectSopCountIsNotRead(userId);
+    }
+
+    @Override
+    public int updateFsCourseSopAppLinkByLink(String id) {
+        return baseMapper.updateFsCourseSopAppLinkByLink(id);
+    }
 }

+ 2 - 0
fs-service/src/main/java/com/fs/course/vo/FsSopMyCourseLinkVO.java

@@ -13,6 +13,8 @@ public class FsSopMyCourseLinkVO {
     /** 主键Id */
     private Long id;
 
+    private String link;
+
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private String createTime;
 

+ 83 - 0
fs-service/src/main/java/com/fs/gtPush/domain/UniPushLog.java

@@ -0,0 +1,83 @@
+package com.fs.gtPush.domain;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * uni推送消息记录对象 uni_push_log
+ *
+ * @author fs
+ * @date 2025-03-12
+ */
+@Data
+@Getter
+@Setter
+@EqualsAndHashCode(callSuper = false)
+public class UniPushLog {
+
+    /** id */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /** 推送id */
+    @Excel(name = "推送id")
+    private String jpushId;
+
+    /** 推送类型:0 订单通知 1健康管理 2营销 */
+    @Excel(name = "推送类型:0 订单通知(0.1药品 0.2服务包) 1健康管理 2营销")
+    private Float type;
+
+    /** 详细类型:
+     type:1 0:未支付 1:支付成功 2:发货 3:派送 4:签收 */
+    @Excel(name = "详细类型:")
+    private Integer desType;
+
+    /** 关联用户id */
+    @Excel(name = "关联用户id")
+    private Long userId;
+
+
+    /** 关联事件id */
+    @Excel(name = "关联事件id")
+    private Long businessId;
+
+
+
+    /** 推送内容 */
+    @Excel(name = "推送内容")
+    private String pushMsg;
+
+    /** 推送结果 1:成功 0:失败 */
+    @Excel(name = "推送结果 1:成功 0:失败")
+    private Integer pushRes;
+
+    /** 返回结果详情 */
+    @Excel(name = "返回结果详情")
+    private String returnMsg;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    /** app是否已读 0:否 1:是 */
+    private Integer isRead;
+
+
+
+}

+ 72 - 0
fs-service/src/main/java/com/fs/gtPush/mapper/PushLogMapper.java

@@ -0,0 +1,72 @@
+package com.fs.gtPush.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.gtPush.domain.UniPushLog;
+import com.fs.gtPush.param.UniPushLogParam;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * uni推送消息记录Mapper接口
+ *
+ * @author fs
+ * @date 2025-03-12
+ */
+public interface PushLogMapper extends BaseMapper<UniPushLog>{
+    /**
+     * 查询uni推送消息记录
+     *
+     * @param id uni推送消息记录主键
+     * @return uni推送消息记录
+     */
+    UniPushLog selectPushLogById(String id);
+
+    /**
+     * 查询uni推送消息记录列表
+     *
+     * @param UniPushLog uni推送消息记录
+     * @return uni推送消息记录集合
+     */
+    List<UniPushLog> selectPushLogList(UniPushLogParam UniPushLog);
+
+    /**
+     * 新增uni推送消息记录
+     *
+     * @param UniPushLog uni推送消息记录
+     * @return 结果
+     */
+    int insertPushLog(UniPushLog UniPushLog);
+
+    /**
+     * 修改uni推送消息记录
+     *
+     * @param UniPushLog uni推送消息记录
+     * @return 结果
+     */
+    int updatePushLog(UniPushLog UniPushLog);
+
+    /**
+     * 删除uni推送消息记录
+     *
+     * @param id uni推送消息记录主键
+     * @return 结果
+     */
+    int deletePushLogById(String id);
+
+    /**
+     * 批量删除uni推送消息记录
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deletePushLogByIds(String[] ids);
+
+    UniPushLog getLast(@Param("userId") Long userId);
+
+    Integer getNumByIsRead(@Param("userId") Long userId);
+
+    Integer setIsRead(@Param("logIds")List<Long> logIds,@Param("userId") Long userId);
+
+    void insertLogBatch(@Param("uniPushLogs") List<UniPushLog> uniPushLogs);
+}

+ 80 - 0
fs-service/src/main/java/com/fs/gtPush/param/UniPushLogParam.java

@@ -0,0 +1,80 @@
+package com.fs.gtPush.param;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.watch.param.BaseQueryParam;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * uni推送消息记录对象 uni_push_log
+ *
+ * @author fs
+ * @date 2025-03-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class UniPushLogParam extends BaseQueryParam {
+
+    /** id */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /** 推送id */
+    @Excel(name = "推送id")
+    private String jpushId;
+
+    /** 推送类型:0 订单通知 1健康管理 2营销 */
+    @Excel(name = "推送类型:0 订单通知(0.1药品 0.2服务包) 1健康管理 2营销")
+    private Float type;
+
+    /** 详细类型:
+     type:1 0:未支付 1:支付成功 2:发货 3:派送 4:签收 */
+    @Excel(name = "详细类型:")
+    private Integer desType;
+
+    /** 关联用户id */
+    @Excel(name = "关联用户id")
+    private Long userId;
+
+
+    /** 关联事件id */
+    @Excel(name = "关联事件id")
+    private Long businessId;
+
+
+
+    /** 推送内容 */
+    @Excel(name = "推送内容")
+    private String pushMsg;
+
+    /** 推送结果 1:成功 0:失败 */
+    @Excel(name = "推送结果 1:成功 0:失败")
+    private Integer pushRes;
+
+    /** 返回结果详情 */
+    @Excel(name = "返回结果详情")
+    private String returnMsg;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    /** app是否已读 0:否 1:是 */
+    private Integer isRead;
+
+
+
+}

+ 80 - 0
fs-service/src/main/java/com/fs/gtPush/service/UniPushLogService.java

@@ -0,0 +1,80 @@
+package com.fs.gtPush.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.gtPush.domain.UniPushLog;
+import com.fs.gtPush.param.UniPushLogParam;
+import com.fs.gtPush.vo.UniPushLogAppVo;
+import com.fs.gtPush.vo.UniPushLogLastAndReadStatusVo;
+
+import java.util.List;
+
+/**
+ * uni推送消息记录Service接口
+ *
+ * @author fs
+ * @date 2025-03-12
+ */
+public interface UniPushLogService extends IService<UniPushLog>{
+    /**
+     * 查询uni推送消息记录
+     *
+     * @param id uni推送消息记录主键
+     * @return uni推送消息记录
+     */
+    UniPushLog selectUniPushLogById(String id);
+
+    /**
+     * 查询uni推送消息记录列表
+     *
+     * @param uniPushLog uni推送消息记录
+     * @return uni推送消息记录集合
+     */
+    List<UniPushLog> selectUniPushLogList(UniPushLogParam uniPushLog);
+
+    /**
+     * 新增uni推送消息记录
+     *
+     * @param uniPushLog uni推送消息记录
+     * @return 结果
+     */
+    int insertUniPushLog(UniPushLog uniPushLog);
+
+    /**
+     * 修改uni推送消息记录
+     *
+     * @param uniPushLog uni推送消息记录
+     * @return 结果
+     */
+    int updateUniPushLog(UniPushLog uniPushLog);
+
+    /**
+     * 批量删除uni推送消息记录
+     *
+     * @param ids 需要删除的uni推送消息记录主键集合
+     * @return 结果
+     */
+    int deleteUniPushLogByIds(String[] ids);
+
+    /**
+     * 删除uni推送消息记录信息
+     *
+     * @param id uni推送消息记录主键
+     * @return 结果
+     */
+    int deleteUniPushLogById(String id);
+
+    /**
+     * 查询uni推送消息记录最新记录,且是否含有未读消息
+     * @param userId
+     * @return
+     */
+    UniPushLogLastAndReadStatusVo getLastAndReadStatus(Long userId);
+
+    Integer setIsRead(List<Long> logIds,Long userId);
+
+    List<UniPushLogAppVo> selectUniPushLogListApp(UniPushLogParam uniPushLog);
+
+    void insertLogBatch(List<UniPushLog> uniPushLogs);
+
+
+}

+ 178 - 0
fs-service/src/main/java/com/fs/gtPush/service/impl/UniPushLogServiceImpl.java

@@ -0,0 +1,178 @@
+package com.fs.gtPush.service.impl;
+
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.bean.BeanUtils;
+import com.fs.gtPush.domain.PushReqBean;
+import com.fs.gtPush.domain.UniPushLog;
+import com.fs.gtPush.mapper.PushLogMapper;
+import com.fs.gtPush.param.UniPushLogParam;
+import com.fs.gtPush.service.UniPushLogService;
+import com.fs.gtPush.vo.UniPushLogAppVo;
+import com.fs.gtPush.vo.UniPushLogLastAndReadStatusVo;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * uni推送消息记录Service业务层处理
+ *
+ * @author fs
+ * @date 2025-03-12
+ */
+@Service
+@Slf4j
+public class UniPushLogServiceImpl extends ServiceImpl<PushLogMapper, UniPushLog> implements UniPushLogService {
+    @Autowired
+    private PushLogMapper pushLogMapper;
+    /**
+     * 查询uni推送消息记录
+     *
+     * @param id uni推送消息记录主键
+     * @return uni推送消息记录
+     */
+    @Override
+    public UniPushLog selectUniPushLogById(String id) {
+        return baseMapper.selectPushLogById(id);
+    }
+
+    /**
+     * 查询uni推送消息记录列表
+     *
+     * @param UniPushLog uni推送消息记录
+     * @return uni推送消息记录
+     */
+    @Override
+    public List<UniPushLog> selectUniPushLogList(UniPushLogParam UniPushLog) {
+        return baseMapper.selectPushLogList(UniPushLog);
+    }
+
+    /**
+     * 新增uni推送消息记录
+     *
+     * @param UniPushLog uni推送消息记录
+     * @return 结果
+     */
+    @Override
+    public int insertUniPushLog(UniPushLog UniPushLog) {
+        UniPushLog.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertPushLog(UniPushLog);
+    }
+
+    /**
+     * 修改uni推送消息记录
+     *
+     * @param UniPushLog uni推送消息记录
+     * @return 结果
+     */
+    @Override
+    public int updateUniPushLog(UniPushLog UniPushLog) {
+        UniPushLog.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updatePushLog(UniPushLog);
+    }
+
+    /**
+     * 批量删除uni推送消息记录
+     *
+     * @param ids 需要删除的uni推送消息记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteUniPushLogByIds(String[] ids) {
+        return baseMapper.deletePushLogByIds(ids);
+    }
+
+    /**
+     * 删除uni推送消息记录信息
+     *
+     * @param id uni推送消息记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteUniPushLogById(String id) {
+        return baseMapper.deletePushLogById(id);
+    }
+
+    /**
+     * 查询uni推送消息记录最新记录,且是否含有未读消息
+     *
+     * @param userId
+     * @return vo
+     */
+    @Override
+    public UniPushLogLastAndReadStatusVo getLastAndReadStatus(Long userId) {
+        UniPushLogLastAndReadStatusVo vo = new UniPushLogLastAndReadStatusVo();
+        if (userId == null) {
+            vo.setUnReadNum(0);
+        } else {
+            UniPushLog log = baseMapper.getLast(userId);
+            if (log != null) {
+                BeanUtils.copyProperties(log, vo);
+                analysisParam(log, vo);
+                //查询未读条数
+                Integer num = baseMapper.getNumByIsRead(userId);
+                vo.setUnReadNum(num);
+            }
+        }
+        return vo;
+    }
+
+    private static void analysisParam(UniPushLog pushLog, UniPushLogAppVo vo) {
+        //解析内容
+        String pushMsg = pushLog.getPushMsg();
+        if (StringUtils.isNotBlank(pushMsg)) {
+            try {
+                PushReqBean pushParam = JSONUtil.toBean(pushMsg, PushReqBean.class);
+                vo.setTitle(pushParam.getTitle());
+                vo.setContent(pushParam.getContent());
+                Map<String, Object> payload = pushParam.getPayload();
+                if (payload != null && !payload.isEmpty()) {
+                    if (payload.get("url") != null) {
+                        vo.setUrl(payload.get("url").toString());
+                    }
+                    if (payload.get("imgUrl") != null) {
+                        String[] imgUrls = payload.get("imgUrl").toString().split(",");
+                        vo.setImgUrl(imgUrls[0]);
+                    }
+                }
+            } catch (Exception e) {
+                log.info("解析推送参数错误,id为{}", pushLog.getId());
+            }
+        }
+    }
+
+    /**
+     * 设置已读
+     *
+     * @param logIds
+     * @return num
+     */
+    @Override
+    public Integer setIsRead(List<Long> logIds, Long userId) {
+        return baseMapper.setIsRead(logIds, userId);
+    }
+
+    @Override
+    public List<UniPushLogAppVo> selectUniPushLogListApp(UniPushLogParam uniPushLog) {
+        List<UniPushLog> uniPushLogs = selectUniPushLogList(uniPushLog);
+        ArrayList<UniPushLogAppVo> res = new ArrayList<>();
+        for (UniPushLog log : uniPushLogs) {
+            UniPushLogAppVo vo = new UniPushLogAppVo();
+            BeanUtils.copyProperties(log, vo);
+            analysisParam(log, vo);
+            res.add(vo);
+        }
+        return res;
+    }
+
+    @Override
+    public void insertLogBatch(List<UniPushLog> uniPushLogs) {
+        pushLogMapper.insertLogBatch(uniPushLogs);
+    }
+}

+ 47 - 0
fs-service/src/main/java/com/fs/gtPush/vo/UniPushLogAppVo.java

@@ -0,0 +1,47 @@
+package com.fs.gtPush.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class UniPushLogAppVo {
+    /** id */
+    private Long id;
+
+    /** 推送id */
+    private String jpushId;
+
+    /** 推送类型:0 订单通知(0.1药品 0.2服务包) 1健康管理  */
+    private Float type;
+
+    /** 详细类型:
+     type:1 0:未支付 1:支付成功 2:发货 3:派送 4:签收 */
+    private Integer desType;
+
+    /** 关联用户id */
+    private Long userId;
+
+
+    /** 关联事件id */
+    private Long businessId;
+
+
+
+    /** 推送内容 */
+//    private String pushMsg;
+    private String title; //标题
+    private String content; //内容
+    private String url; //跳转链接
+    private String imgUrl; //图片
+
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+
+    /** app是否已读 0:否 1:是 */
+    private Integer isRead;
+
+}

+ 8 - 0
fs-service/src/main/java/com/fs/gtPush/vo/UniPushLogLastAndReadStatusVo.java

@@ -0,0 +1,8 @@
+package com.fs.gtPush.vo;
+
+import lombok.Data;
+
+@Data
+public class UniPushLogLastAndReadStatusVo extends UniPushLogAppVo {
+    private Integer unReadNum;
+}

+ 133 - 0
fs-service/src/main/resources/mapper/his/PushLogMapper.xml

@@ -0,0 +1,133 @@
+<?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">
+<mapper namespace="com.fs.gtPush.mapper.PushLogMapper">
+
+    <resultMap type="UniPushLog" id="PushLogResult">
+        <result property="id"    column="id"    />
+        <result property="jpushId"    column="jpush_id"    />
+        <result property="type"    column="type"    />
+        <result property="desType"    column="des_type"    />
+        <result property="userId"    column="user_id"    />
+        <result property="businessId"    column="business_id"    />
+        <result property="pushMsg"    column="push_msg"    />
+        <result property="pushRes"    column="push_res"    />
+        <result property="returnMsg"    column="return_msg"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="isRead"    column="is_read"    />
+    </resultMap>
+
+    <sql id="selectPushLogVo">
+        select id, jpush_id,`type`,des_type,user_id,business_id, push_msg, push_res, return_msg, create_time,
+               update_time,is_read from uni_push_log
+    </sql>
+
+    <select id="selectPushLogList" parameterType="com.fs.gtPush.param.UniPushLogParam" resultMap="PushLogResult">
+        <include refid="selectPushLogVo"/>
+        <where>
+            <if test="jpushId != null  and jpushId != ''"> and jpush_id = #{jpushId}</if>
+            <if test="type != null"> and CAST(`type` AS CHAR) = #{type}</if>
+            <if test="desType != null"> and des_type = #{desType}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="businessId != null"> and business_id = #{businessId}</if>
+            <if test="pushMsg != null  and pushMsg != ''"> and push_msg = #{pushMsg}</if>
+            <if test="pushRes != null and pushRes !='' "> and push_res = #{pushRes}</if>
+            <if test="returnMsg != null  and returnMsg != ''"> and return_msg = #{returnMsg}</if>
+            <if test="isRead != null"> and is_read = #{isRead}</if>
+        </where>
+        order by create_time desc
+    </select>
+
+    <select id="selectPushLogById" parameterType="String" resultMap="PushLogResult">
+        <include refid="selectPushLogVo"/>
+        where id = #{id}
+    </select>
+    <select id="getLast" resultType="com.fs.gtPush.domain.UniPushLog">
+        <include refid="selectPushLogVo"/>
+        where user_id = #{userId} and push_res = 1
+        order by create_time desc limit 1
+    </select>
+    <select id="getNumByIsRead" resultType="java.lang.Integer">
+        SELECT count(1) FROM uni_push_log WHERE user_id = #{userId} and is_read = 0 and push_res = 1
+    </select>
+
+    <insert id="insertPushLog" parameterType="UniPushLog" useGeneratedKeys="true" keyProperty="id">
+        insert into uni_push_log
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="jpushId != null">jpush_id,</if>
+            <if test="type != null">`type`,</if>
+            <if test="desType != null">`des_type`,</if>
+            <if test="userId != null "> user_id,</if>
+            <if test="businessId != null">business_id,</if>
+            <if test="pushMsg != null">push_msg,</if>
+            <if test="pushRes != null and pushRes !=''">push_res,</if>
+            <if test="returnMsg != null">return_msg,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="isRead != null">is_read,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="jpushId != null">#{jpushId},</if>
+            <if test="type != null">#{type},</if>
+            <if test="desType != null">#{desType},</if>
+            <if test="userId != null ">#{userId},</if>
+            <if test="businessId != null">#{businessId},</if>
+            <if test="pushMsg != null">#{pushMsg},</if>
+            <if test="pushRes != null and pushRes !=''">#{pushRes},</if>
+            <if test="returnMsg != null">#{returnMsg},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="isRead != null">#{isRead},</if>
+         </trim>
+    </insert>
+    <insert id="insertLogBatch">
+        INSERT INTO uni_push_log (jpush_id, push_msg, `type`, des_type, user_id, business_id, create_time,push_res,return_msg)
+        VALUES
+        <foreach collection="uniPushLogs" item="log" separator=",">
+        (#{log.jpushId}, #{log.pushMsg}, #{log.type}, #{log.desType}, #{log.userId}, #{log.businessId}, #{log.createTime},#{log.pushRes},#{log.returnMsg})
+        </foreach>
+    </insert>
+
+    <update id="updatePushLog" parameterType="UniPushLog">
+        update uni_push_log
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="jpushId != null">jpush_id = #{jpushId},</if>
+            <if test="type != null">`type` = #{type},</if>
+            <if test="desType != null">`des_type` = #{desType},</if>
+            <if test="userId != null ">user_id = #{userId},</if>
+            <if test="businessId != null"> business_id = #{businessId},</if>
+            <if test="pushMsg != null">push_msg = #{pushMsg},</if>
+            <if test="pushRes != null and pushRes !=''">push_res = #{pushRes},</if>
+            <if test="returnMsg != null">return_msg = #{returnMsg},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="isRead != null">is_read = #{isRead},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="setIsRead">
+        update uni_push_log set
+        is_read = 1
+        where user_id = #{userId}
+            <if test="logIds != null and logIds.size > 0">
+                and id in
+                <foreach collection="logIds" item="logId" open="(" close=")" separator=",">
+                    #{logId}
+                </foreach>
+            </if>
+    </update>
+
+    <delete id="deletePushLogById" parameterType="String">
+        delete from uni_push_log where id = #{id}
+    </delete>
+
+    <delete id="deletePushLogByIds" parameterType="String">
+        delete from uni_push_log where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 35 - 0
fs-user-app/src/main/java/com/fs/app/controller/CourseController.java

@@ -92,6 +92,8 @@ public class CourseController extends  AppBaseController{
 
     @Autowired
     private IQwSopService qwSopService;
+    @Autowired
+    private IFsCourseSopAppLinkService courseSopAppLinkService;
 
 
     @Cacheable(value="getCourseCate" )
@@ -188,6 +190,39 @@ public class CourseController extends  AppBaseController{
         return R.ok().put("data",listPageInfo);
     }
 
+    @Login
+    @ApiOperation("获取我的sop课程")
+    @GetMapping("/getSopCourseStudyList")
+    public R getSopCourseStudyList(FsCourseSopLinkParam param){
+
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+
+        long userId = Long.parseLong(getUserId());
+
+        List<FsSopMyCourseLinkVO> list = courseSopAppLinkService.getSopCourseStudyList(userId);
+
+        //获取 客户有多少未读消息
+        Integer isNotRead = courseSopAppLinkService.selectSopCountIsNotRead(userId);
+
+        PageInfo<FsSopMyCourseLinkVO> listPageInfo=new PageInfo<>(list);
+        return R.ok().put("data",listPageInfo).put("isNotRead",isNotRead);
+    }
+
+    @Login
+    @ApiOperation("修改我的sop课程已读未读状态")
+    @GetMapping("/updateSopAppLink/{id}")
+    public R updateSopAppLink(@PathVariable("id") String id){
+
+        try {
+            courseSopAppLinkService.updateFsCourseSopAppLinkByLink(id);
+
+            return R.ok();
+        }catch (Exception e){
+            return R.error();
+        }
+
+    }
+
     @ApiOperation("获取课程详情")
     @GetMapping("/getCourseById")
     public R getCourseById(@RequestParam("courseId")Long courseId)

+ 78 - 0
fs-user-app/src/main/java/com/fs/app/controller/UniPushLogController.java

@@ -0,0 +1,78 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.gtPush.param.UniPushLogParam;
+import com.fs.gtPush.service.UniPushLogService;
+import com.fs.gtPush.vo.UniPushLogAppVo;
+import com.fs.gtPush.vo.UniPushLogLastAndReadStatusVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * uni推送消息记录Controller
+ *
+ * @author fs
+ * @date 2025-03-12
+ */
+@RestController
+@RequestMapping("/app/uniPushLog")
+public class UniPushLogController extends  AppBaseController
+{
+    @Autowired
+    private UniPushLogService uniPushLogService;
+
+    /**
+     * 查询uni推送消息记录最新记录,及未读条数
+     */
+    @Login
+    @GetMapping("/getLastAndReadStatus")
+    public AjaxResult getLastAndReadStatus()
+    {
+        String userId = getUserId();
+        UniPushLogLastAndReadStatusVo vo = uniPushLogService.getLastAndReadStatus(Long.parseLong(userId));
+        return AjaxResult.success(vo);
+    }
+
+    /**
+     * 查询uni推送消息记录列表
+     */
+    @Login
+    @GetMapping("/list")
+    public TableDataInfo list(UniPushLogParam uniPushLog)
+    {
+        startPage();
+        uniPushLog.setUserId(Long.parseLong(getUserId()));
+        uniPushLog.setPushRes(1); //推送成功的
+        List<UniPushLogAppVo> list = uniPushLogService.selectUniPushLogListApp(uniPushLog);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取uni推送消息记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('gtPush:uniPushlog:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return AjaxResult.success(uniPushLogService.selectUniPushLogById(id));
+    }
+
+    /**
+     * 一键已读
+     */
+    @Login
+    @PostMapping(value = "/setIsRead")
+    public AjaxResult setIsRead(@RequestBody List<Long> logIds)
+    {
+        return AjaxResult.success(uniPushLogService.setIsRead(logIds,Long.valueOf(getUserId())));
+    }
+
+
+
+}