Bladeren bron

用户理疗阅读

wjj 1 dag geleden
bovenliggende
commit
f09350ab52

+ 3 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCourseRedPacketLogServiceImpl.java

@@ -158,6 +158,7 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
                 record.setCollectType("1");
                 record.setUpdateTime(new Date());
                 record.setBatchId(batchId);
+                record.setCollectTime(new Date());
                 bindPhoneRedPacketRecordMapper.updateBindPhoneRedPacketRecord(record);
                 return R.ok();
             }
@@ -168,6 +169,7 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
                 record.setCollectType(1);
                 record.setUpdateTime(new Date());
                 record.setBatchId(batchId);
+                record.setCollectTime(new Date());
                 signRedPacketRecordMapper.updateSignRedPacketRecord(record);
                 return R.ok();
             }
@@ -177,6 +179,7 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
                 redPacketRecord.setCollectType(1);
                 redPacketRecord.setUpdateTime(new Date());
                 redPacketRecord.setBatchId(batchId);
+                redPacketRecord.setCollectTime(new Date());
                 projectRedPacketRecordMapper.updateFsProjectRedPacketRecord(redPacketRecord);
                 return R.ok();
             }

+ 43 - 0
fs-service/src/main/java/com/fs/his/domain/FsProjectRedDetail.java

@@ -0,0 +1,43 @@
+package com.fs.his.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 理疗浏览记录对象 fs_project_red_detail
+ *
+ * @author fs
+ * @date 2026-04-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FsProjectRedDetail extends BaseEntity{
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 销售id */
+    @Excel(name = "销售id")
+    private Long companyUserId;
+
+    /** 理疗id */
+    @Excel(name = "理疗id")
+    private Long projectId;
+
+    /** 浏览时长 */
+    @Excel(name = "浏览时长")
+    private Long readDuration;
+
+    /** 渠道来源 */
+    @Excel(name = "渠道来源")
+    private String source;
+
+
+}

+ 68 - 0
fs-service/src/main/java/com/fs/his/mapper/FsProjectRedDetailMapper.java

@@ -0,0 +1,68 @@
+package com.fs.his.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.his.domain.FsProjectRedDetail;
+import com.fs.his.param.ProjectRedParam;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+/**
+ * 理疗浏览记录Mapper接口
+ * 
+ * @author fs
+ * @date 2026-04-24
+ */
+public interface FsProjectRedDetailMapper extends BaseMapper<FsProjectRedDetail>{
+    /**
+     * 查询理疗浏览记录
+     * 
+     * @param id 理疗浏览记录主键
+     * @return 理疗浏览记录
+     */
+    FsProjectRedDetail selectFsProjectRedDetailById(Long id);
+
+    /**
+     * 查询理疗浏览记录列表
+     * 
+     * @param fsProjectRedDetail 理疗浏览记录
+     * @return 理疗浏览记录集合
+     */
+    List<FsProjectRedDetail> selectFsProjectRedDetailList(FsProjectRedDetail fsProjectRedDetail);
+
+    /**
+     * 新增理疗浏览记录
+     * 
+     * @param fsProjectRedDetail 理疗浏览记录
+     * @return 结果
+     */
+    int insertFsProjectRedDetail(FsProjectRedDetail fsProjectRedDetail);
+
+    /**
+     * 修改理疗浏览记录
+     * 
+     * @param fsProjectRedDetail 理疗浏览记录
+     * @return 结果
+     */
+    int updateFsProjectRedDetail(FsProjectRedDetail fsProjectRedDetail);
+
+    /**
+     * 删除理疗浏览记录
+     * 
+     * @param id 理疗浏览记录主键
+     * @return 结果
+     */
+    int deleteFsProjectRedDetailById(Long id);
+
+    /**
+     * 批量删除理疗浏览记录
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteFsProjectRedDetailByIds(Long[] ids);
+
+
+    @Select("select *  FROM fs_project_red_detail WHERE user_id = #{param.userId} AND project_id = #{param.projectId} AND company_user_id = #{param.companyUserId}")
+    FsProjectRedDetail selectFsProjectRedDetailDataByCompanyUserIdAndProjectId(@Param("param")ProjectRedParam param);
+}

+ 18 - 0
fs-service/src/main/java/com/fs/his/param/ProjectRedParam.java

@@ -0,0 +1,18 @@
+package com.fs.his.param;
+
+import lombok.Data;
+
+@Data
+public class ProjectRedParam {
+
+    private Long userId;
+
+    //浏览时长
+    private Long readDuration;
+
+    //理疗项目id
+    private Long projectId;
+
+    //销售id
+    private Long companyUserId;
+}

+ 69 - 0
fs-service/src/main/java/com/fs/his/service/IFsProjectRedDetailService.java

@@ -0,0 +1,69 @@
+package com.fs.his.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.common.core.domain.R;
+import com.fs.his.domain.FsProjectRedDetail;
+import com.fs.his.param.ProjectRedParam;
+
+/**
+ * 理疗浏览记录Service接口
+ * 
+ * @author fs
+ * @date 2026-04-24
+ */
+public interface IFsProjectRedDetailService extends IService<FsProjectRedDetail>{
+    /**
+     * 查询理疗浏览记录
+     * 
+     * @param id 理疗浏览记录主键
+     * @return 理疗浏览记录
+     */
+    FsProjectRedDetail selectFsProjectRedDetailById(Long id);
+
+    /**
+     * 查询理疗浏览记录列表
+     * 
+     * @param fsProjectRedDetail 理疗浏览记录
+     * @return 理疗浏览记录集合
+     */
+    List<FsProjectRedDetail> selectFsProjectRedDetailList(FsProjectRedDetail fsProjectRedDetail);
+
+    /**
+     * 新增理疗浏览记录
+     * 
+     * @param fsProjectRedDetail 理疗浏览记录
+     * @return 结果
+     */
+    int insertFsProjectRedDetail(FsProjectRedDetail fsProjectRedDetail);
+
+    /**
+     * 修改理疗浏览记录
+     * 
+     * @param fsProjectRedDetail 理疗浏览记录
+     * @return 结果
+     */
+    int updateFsProjectRedDetail(FsProjectRedDetail fsProjectRedDetail);
+
+    /**
+     * 批量删除理疗浏览记录
+     * 
+     * @param ids 需要删除的理疗浏览记录主键集合
+     * @return 结果
+     */
+    int deleteFsProjectRedDetailByIds(Long[] ids);
+
+    /**
+     * 删除理疗浏览记录信息
+     * 
+     * @param id 理疗浏览记录主键
+     * @return 结果
+     */
+    int deleteFsProjectRedDetailById(Long id);
+
+    /**
+     * 用户浏览理疗
+     * @param param 浏览参数
+     */
+    R userRedProject(ProjectRedParam param);
+}

+ 132 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsProjectRedDetailServiceImpl.java

@@ -0,0 +1,132 @@
+package com.fs.his.service.impl;
+
+import java.util.Date;
+import java.util.List;
+
+import com.fs.common.core.domain.R;
+import com.fs.common.utils.DateUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.his.param.ProjectRedParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.fs.his.mapper.FsProjectRedDetailMapper;
+import com.fs.his.domain.FsProjectRedDetail;
+import com.fs.his.service.IFsProjectRedDetailService;
+
+/**
+ * 理疗浏览记录Service业务层处理
+ * 
+ * @author fs
+ * @date 2026-04-24
+ */
+@Service
+public class FsProjectRedDetailServiceImpl extends ServiceImpl<FsProjectRedDetailMapper, FsProjectRedDetail> implements IFsProjectRedDetailService {
+
+
+    @Autowired
+    private FsProjectRedDetailMapper fsProjectRedDetailMapper;
+    /**
+     * 查询理疗浏览记录
+     * 
+     * @param id 理疗浏览记录主键
+     * @return 理疗浏览记录
+     */
+    @Override
+    public FsProjectRedDetail selectFsProjectRedDetailById(Long id)
+    {
+        return baseMapper.selectFsProjectRedDetailById(id);
+    }
+
+    /**
+     * 查询理疗浏览记录列表
+     * 
+     * @param fsProjectRedDetail 理疗浏览记录
+     * @return 理疗浏览记录
+     */
+    @Override
+    public List<FsProjectRedDetail> selectFsProjectRedDetailList(FsProjectRedDetail fsProjectRedDetail)
+    {
+        return baseMapper.selectFsProjectRedDetailList(fsProjectRedDetail);
+    }
+
+    /**
+     * 新增理疗浏览记录
+     * 
+     * @param fsProjectRedDetail 理疗浏览记录
+     * @return 结果
+     */
+    @Override
+    public int insertFsProjectRedDetail(FsProjectRedDetail fsProjectRedDetail)
+    {
+        fsProjectRedDetail.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertFsProjectRedDetail(fsProjectRedDetail);
+    }
+
+    /**
+     * 修改理疗浏览记录
+     * 
+     * @param fsProjectRedDetail 理疗浏览记录
+     * @return 结果
+     */
+    @Override
+    public int updateFsProjectRedDetail(FsProjectRedDetail fsProjectRedDetail)
+    {
+        fsProjectRedDetail.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateFsProjectRedDetail(fsProjectRedDetail);
+    }
+
+    /**
+     * 批量删除理疗浏览记录
+     * 
+     * @param ids 需要删除的理疗浏览记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsProjectRedDetailByIds(Long[] ids)
+    {
+        return baseMapper.deleteFsProjectRedDetailByIds(ids);
+    }
+
+    /**
+     * 删除理疗浏览记录信息
+     * 
+     * @param id 理疗浏览记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsProjectRedDetailById(Long id)
+    {
+        return baseMapper.deleteFsProjectRedDetailById(id);
+    }
+
+    @Override
+    public R userRedProject(ProjectRedParam param) {
+        if (param.getProjectId() == null && param.getUserId() == null && param.getCompanyUserId() == null) {
+            return R.error("参数错误");
+        }
+        FsProjectRedDetail detail = fsProjectRedDetailMapper.selectFsProjectRedDetailDataByCompanyUserIdAndProjectId(param);
+        if (detail == null) {
+            detail = new FsProjectRedDetail();
+            detail.setProjectId(param.getProjectId());
+            detail.setUserId(param.getUserId());
+            detail.setCompanyUserId(param.getCompanyUserId());
+            detail.setCreateTime(new Date());
+            detail.setSource("小程序");
+            detail.setReadDuration(param.getReadDuration());
+            int i = fsProjectRedDetailMapper.insert(detail);
+            if (i > 0) {
+                return R.ok();
+            }
+        } else {
+            FsProjectRedDetail map = new FsProjectRedDetail();
+            map.setId(detail.getId());
+            map.setReadDuration(detail.getReadDuration() + param.getReadDuration());
+            map.setUpdateTime(new Date());
+            int i = fsProjectRedDetailMapper.updateFsProjectRedDetail(map);
+            if (i > 0) {
+                return R.ok();
+            }
+        }
+        return R.error();
+    }
+}

+ 84 - 0
fs-service/src/main/resources/mapper/his/FsProjectRedDetailMapper.xml

@@ -0,0 +1,84 @@
+<?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.his.mapper.FsProjectRedDetailMapper">
+    
+    <resultMap type="FsProjectRedDetail" id="FsProjectRedDetailResult">
+        <result property="id"    column="id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="companyUserId"    column="company_user_id"    />
+        <result property="projectId"    column="project_id"    />
+        <result property="readDuration"    column="read_duration"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="source"    column="source"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectFsProjectRedDetailVo">
+        select id, user_id, company_user_id, project_id, read_duration, create_time, source, update_time from fs_project_red_detail
+    </sql>
+
+    <select id="selectFsProjectRedDetailList" parameterType="FsProjectRedDetail" resultMap="FsProjectRedDetailResult">
+        <include refid="selectFsProjectRedDetailVo"/>
+        <where>  
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
+            <if test="projectId != null "> and project_id = #{projectId}</if>
+            <if test="readDuration != null "> and read_duration = #{readDuration}</if>
+            <if test="source != null  and source != ''"> and source = #{source}</if>
+        </where>
+    </select>
+    
+    <select id="selectFsProjectRedDetailById" parameterType="Long" resultMap="FsProjectRedDetailResult">
+        <include refid="selectFsProjectRedDetailVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertFsProjectRedDetail" parameterType="FsProjectRedDetail" useGeneratedKeys="true" keyProperty="id">
+        insert into fs_project_red_detail
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="companyUserId != null">company_user_id,</if>
+            <if test="projectId != null">project_id,</if>
+            <if test="readDuration != null">read_duration,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="source != null">source,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
+            <if test="projectId != null">#{projectId},</if>
+            <if test="readDuration != null">#{readDuration},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="source != null">#{source},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFsProjectRedDetail" parameterType="FsProjectRedDetail">
+        update fs_project_red_detail
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
+            <if test="projectId != null">project_id = #{projectId},</if>
+            <if test="readDuration != null">read_duration = #{readDuration},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="source != null">source = #{source},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteFsProjectRedDetailById" parameterType="Long">
+        delete from fs_project_red_detail where id = #{id}
+    </delete>
+
+    <delete id="deleteFsProjectRedDetailByIds" parameterType="String">
+        delete from fs_project_red_detail where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 33 - 0
fs-user-app/src/main/java/com/fs/app/controller/ProjectRedDetailController.java

@@ -0,0 +1,33 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.common.core.domain.R;
+import com.fs.his.param.APPSignArticleReadDetailParam;
+import com.fs.his.param.ProjectRedParam;
+import com.fs.his.service.IFsProjectRedDetailService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+@Api("理疗项目阅读详情接口")
+@RestController
+@RequestMapping(value="/app/projectRedDetail")
+public class ProjectRedDetailController extends  AppBaseController {
+
+    @Autowired
+    private IFsProjectRedDetailService projectRedDetailService;
+
+    @Login
+    @ApiOperation("用户理疗浏览")
+    @PostMapping("/userReadProject")
+    public R userReadArticle(@RequestBody ProjectRedParam param, HttpServletRequest request) {
+        param.setUserId(Long.parseLong(getUserId()));
+        return projectRedDetailService.userRedProject(param);
+    }
+}