Procházet zdrojové kódy

直播的优惠卷 -改为 发 课程优惠卷

三七 před 3 dny
rodič
revize
fa61cc3e7b

+ 15 - 1
fs-admin/src/main/java/com/fs/his/controller/FsCourseCouponUserController.java

@@ -1,6 +1,8 @@
 package com.fs.his.controller;
 
 import java.util.List;
+
+import com.fs.his.vo.FsCourseCouponUserVO;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -22,7 +24,7 @@ import com.fs.common.core.page.TableDataInfo;
 
 /**
  * 用户看课优惠券Controller
- * 
+ *
  * @author fs
  * @date 2026-05-13
  */
@@ -45,6 +47,18 @@ public class FsCourseCouponUserController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 查询用户看课优惠券列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:courseCouponUser:list')")
+    @GetMapping("/listVO")
+    public TableDataInfo listVO(FsCourseCouponUser fsCourseCouponUser)
+    {
+        startPage();
+        List<FsCourseCouponUserVO> list = fsCourseCouponUserService.selectFsCourseCouponUserListVO(fsCourseCouponUser);
+        return getDataTable(list);
+    }
+
     /**
      * 导出用户看课优惠券列表
      */

+ 27 - 7
fs-service/src/main/java/com/fs/his/mapper/FsCourseCouponUserMapper.java

@@ -5,19 +5,20 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.his.domain.FsCourseCouponUser;
 import com.fs.his.vo.CourseCouponUserListUVO;
 import com.fs.his.vo.FsCourseCouponUserRecordVO;
+import com.fs.his.vo.FsCourseCouponUserVO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 /**
  * 用户看课优惠券Mapper接口
- * 
+ *
  * @author fs
  * @date 2026-05-13
  */
 public interface FsCourseCouponUserMapper extends BaseMapper<FsCourseCouponUser>{
     /**
      * 查询用户看课优惠券
-     * 
+     *
      * @param id 用户看课优惠券主键
      * @return 用户看课优惠券
      */
@@ -25,15 +26,34 @@ public interface FsCourseCouponUserMapper extends BaseMapper<FsCourseCouponUser>
 
     /**
      * 查询用户看课优惠券列表
-     * 
+     *
      * @param fsCourseCouponUser 用户看课优惠券
      * @return 用户看课优惠券集合
      */
     List<FsCourseCouponUser> selectFsCourseCouponUserList(FsCourseCouponUser fsCourseCouponUser);
 
+    @Select("<script>" +
+            "select cu.id,cu.coupon_id,cu.user_id,cu.limit_time,cu.start_time," +
+            "cu.create_time,cu.update_time,cu.status,fu.nick_name,cc.title as couponTitle " +
+            "from fs_course_coupon_user cu " +
+            "LEFT JOIN fs_course_coupon cc on cu.coupon_id = cc.id " +
+            "LEFT JOIN fs_user fu on cu.user_id = fu.user_id " +
+            "<where>" +
+            "    <if test='data != null'>" +
+            "    <if test='data.couponId != null'> and cu.coupon_id = #{data.couponId}</if>" +
+            "    <if test='data.userId != null'> and cu.user_id = #{data.userId}</if>" +
+            "    <if test='data.status != null'> and cu.status = #{data.status}</if>" +
+            "    <if test='data.sendType != null'> and cu.send_type = #{data.sendType}</if>" +
+            "    <if test='data.liveId != null'> and cu.live_id = #{data.liveId}</if>" +
+            "  </if>" +
+            "</where>" +
+            "order by cu.create_time desc" +
+            "</script>")
+    List<FsCourseCouponUserVO> selectFsCourseCouponUserListVO(@Param("data") FsCourseCouponUser fsCourseCouponUser);
+
     /**
      * 新增用户看课优惠券
-     * 
+     *
      * @param fsCourseCouponUser 用户看课优惠券
      * @return 结果
      */
@@ -41,7 +61,7 @@ public interface FsCourseCouponUserMapper extends BaseMapper<FsCourseCouponUser>
 
     /**
      * 修改用户看课优惠券
-     * 
+     *
      * @param fsCourseCouponUser 用户看课优惠券
      * @return 结果
      */
@@ -49,7 +69,7 @@ public interface FsCourseCouponUserMapper extends BaseMapper<FsCourseCouponUser>
 
     /**
      * 删除用户看课优惠券
-     * 
+     *
      * @param id 用户看课优惠券主键
      * @return 结果
      */
@@ -57,7 +77,7 @@ public interface FsCourseCouponUserMapper extends BaseMapper<FsCourseCouponUser>
 
     /**
      * 批量删除用户看课优惠券
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */

+ 7 - 1
fs-service/src/main/java/com/fs/his/mapper/FsUserCouponMapper.java

@@ -67,7 +67,13 @@ public interface FsUserCouponMapper
     public int deleteFsUserCouponByIds(Long[] ids);
 
     @Select({"<script> " +
-            " select uc.*,u.nick_name,u.phone,c.title,c.price,c.coupon_type,su.nick_name sendUserName,com.company_name,comu.user_name  company_user_name FROM fs_user_coupon uc LEFT JOIN fs_user u ON uc.user_id=u.user_id LEFT JOIN fs_coupon c on c.coupon_id=uc.coupon_id LEFT JOIN sys_user su ON su.user_id =uc.send_user_id LEFT JOIN company com ON com.company_id=uc.company_id LEFT JOIN company_user comu on comu.user_id=uc.company_user_id "+
+            " select uc.*,u.nick_name,u.phone,c.title,c.price,c.coupon_type,su.nick_name sendUserName,com.company_name,comu.user_name  company_user_name" +
+            " FROM fs_user_coupon uc  " +
+            "LEFT JOIN fs_user u ON uc.user_id=u.user_id " +
+            "LEFT JOIN fs_coupon c on c.coupon_id=uc.coupon_id " +
+            "LEFT JOIN sys_user su ON su.user_id =uc.send_user_id " +
+            "LEFT JOIN company com ON com.company_id=uc.company_id " +
+            "LEFT JOIN company_user comu on comu.user_id=uc.company_user_id "+
             " <where>  \n" +
             "            <if test=\"couponId != null \"> and uc.coupon_id = #{couponId}</if>\n" +
             "            <if test=\"userId != null \"> and uc.user_id = #{userId}</if>\n" +

+ 9 - 7
fs-service/src/main/java/com/fs/his/service/IFsCourseCouponUserService.java

@@ -6,17 +6,18 @@ import com.fs.common.core.domain.R;
 import com.fs.his.domain.FsCourseCouponUser;
 import com.fs.his.vo.CourseCouponUserListUVO;
 import com.fs.his.vo.FsCourseCouponUserRecordVO;
+import com.fs.his.vo.FsCourseCouponUserVO;
 
 /**
  * 用户看课优惠券Service接口
- * 
+ *
  * @author fs
  * @date 2026-05-13
  */
 public interface IFsCourseCouponUserService extends IService<FsCourseCouponUser>{
     /**
      * 查询用户看课优惠券
-     * 
+     *
      * @param id 用户看课优惠券主键
      * @return 用户看课优惠券
      */
@@ -24,15 +25,16 @@ public interface IFsCourseCouponUserService extends IService<FsCourseCouponUser>
 
     /**
      * 查询用户看课优惠券列表
-     * 
+     *
      * @param fsCourseCouponUser 用户看课优惠券
      * @return 用户看课优惠券集合
      */
     List<FsCourseCouponUser> selectFsCourseCouponUserList(FsCourseCouponUser fsCourseCouponUser);
+    List<FsCourseCouponUserVO> selectFsCourseCouponUserListVO(FsCourseCouponUser fsCourseCouponUser);
 
     /**
      * 新增用户看课优惠券
-     * 
+     *
      * @param fsCourseCouponUser 用户看课优惠券
      * @return 结果
      */
@@ -40,7 +42,7 @@ public interface IFsCourseCouponUserService extends IService<FsCourseCouponUser>
 
     /**
      * 修改用户看课优惠券
-     * 
+     *
      * @param fsCourseCouponUser 用户看课优惠券
      * @return 结果
      */
@@ -48,7 +50,7 @@ public interface IFsCourseCouponUserService extends IService<FsCourseCouponUser>
 
     /**
      * 批量删除用户看课优惠券
-     * 
+     *
      * @param ids 需要删除的用户看课优惠券主键集合
      * @return 结果
      */
@@ -56,7 +58,7 @@ public interface IFsCourseCouponUserService extends IService<FsCourseCouponUser>
 
     /**
      * 删除用户看课优惠券信息
-     * 
+     *
      * @param id 用户看课优惠券主键
      * @return 结果
      */

+ 13 - 7
fs-service/src/main/java/com/fs/his/service/impl/FsCourseCouponUserServiceImpl.java

@@ -10,6 +10,7 @@ import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.his.vo.CourseCouponUserListUVO;
 import com.fs.his.vo.FsCourseCouponUserRecordVO;
+import com.fs.his.vo.FsCourseCouponUserVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.his.mapper.FsCourseCouponUserMapper;
@@ -18,7 +19,7 @@ import com.fs.his.service.IFsCourseCouponUserService;
 
 /**
  * 用户看课优惠券Service业务层处理
- * 
+ *
  * @author fs
  * @date 2026-05-13
  */
@@ -27,7 +28,7 @@ public class FsCourseCouponUserServiceImpl extends ServiceImpl<FsCourseCouponUse
 
     /**
      * 查询用户看课优惠券
-     * 
+     *
      * @param id 用户看课优惠券主键
      * @return 用户看课优惠券
      */
@@ -39,7 +40,7 @@ public class FsCourseCouponUserServiceImpl extends ServiceImpl<FsCourseCouponUse
 
     /**
      * 查询用户看课优惠券列表
-     * 
+     *
      * @param fsCourseCouponUser 用户看课优惠券
      * @return 用户看课优惠券
      */
@@ -49,9 +50,14 @@ public class FsCourseCouponUserServiceImpl extends ServiceImpl<FsCourseCouponUse
         return baseMapper.selectFsCourseCouponUserList(fsCourseCouponUser);
     }
 
+    @Override
+    public List<FsCourseCouponUserVO> selectFsCourseCouponUserListVO(FsCourseCouponUser fsCourseCouponUser) {
+        return baseMapper.selectFsCourseCouponUserListVO(fsCourseCouponUser);
+    }
+
     /**
      * 新增用户看课优惠券
-     * 
+     *
      * @param fsCourseCouponUser 用户看课优惠券
      * @return 结果
      */
@@ -64,7 +70,7 @@ public class FsCourseCouponUserServiceImpl extends ServiceImpl<FsCourseCouponUse
 
     /**
      * 修改用户看课优惠券
-     * 
+     *
      * @param fsCourseCouponUser 用户看课优惠券
      * @return 结果
      */
@@ -77,7 +83,7 @@ public class FsCourseCouponUserServiceImpl extends ServiceImpl<FsCourseCouponUse
 
     /**
      * 批量删除用户看课优惠券
-     * 
+     *
      * @param ids 需要删除的用户看课优惠券主键
      * @return 结果
      */
@@ -89,7 +95,7 @@ public class FsCourseCouponUserServiceImpl extends ServiceImpl<FsCourseCouponUse
 
     /**
      * 删除用户看课优惠券信息
-     * 
+     *
      * @param id 用户看课优惠券主键
      * @return 结果
      */

+ 73 - 0
fs-service/src/main/java/com/fs/his/vo/FsCourseCouponUserVO.java

@@ -0,0 +1,73 @@
+package com.fs.his.vo;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 用户看课优惠券对象 fs_course_coupon_user
+ *
+ * @author fs
+ * @date 2026-05-13
+ */
+@Data
+public class FsCourseCouponUserVO {
+
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 优惠券id */
+    @Excel(name = "优惠券id")
+    private Long couponId;
+    private String couponTitle;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    private String nickName;
+
+
+    /** 有效期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date limitTime;
+
+    /** 开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /** 核销状态 0-未核销 1-已核销 */
+    @Excel(name = "核销状态 0-未核销 1-已核销")
+    private Integer status;
+
+    /**
+     * 看课记录ID
+     */
+    private Long logId;
+
+    @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;
+
+
+    /** 类型  1课程发的 2直播发的 */
+    @Excel(name = "类型  1课程发的 2直播发的")
+    private Integer sendType;
+
+
+    /** 直播间id */
+    @Excel(name = "直播间id")
+    private Long liveId;
+}

+ 1 - 1
fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java

@@ -1342,7 +1342,7 @@ public class LiveDataServiceImpl implements ILiveDataService {
         Live live = liveMapper.selectLiveByLiveId(liveId);
         LiveWatchConfig config = JSON.parseObject(live.getConfigJson(), LiveWatchConfig.class);
 
-        if (config.getEnabled() && 3 == config.getParticipateCondition()) {
+        if (config!=null && config.getEnabled() && 3 == config.getParticipateCondition()) {
 
             Long completionRate = config.getCompletionRate();
 

+ 1 - 0
fs-service/src/main/resources/mapper/his/FsCourseCouponUserMapper.xml

@@ -41,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </select>
 
+
     <insert id="insertFsCourseCouponUser" parameterType="FsCourseCouponUser" useGeneratedKeys="true" keyProperty="id">
         insert into fs_course_coupon_user
         <trim prefix="(" suffix=")" suffixOverrides=",">