Pārlūkot izejas kodu

销售端创建直播间,必须绑定当前公司下的达人

yuhongqi 1 nedēļu atpakaļ
vecāks
revīzija
b4ce3b1ce6

+ 16 - 0
fs-company/src/main/java/com/fs/company/controller/company/CompanyUserController.java

@@ -22,6 +22,8 @@ import com.fs.company.utils.DomainUtil;
 import com.fs.company.vo.CompanyUserQwListVO;
 import com.fs.company.vo.CompanyUserVO;
 import com.fs.course.config.CourseConfig;
+import com.fs.course.domain.FsUserTalent;
+import com.fs.course.service.IFsUserTalentService;
 import com.fs.framework.security.LoginUser;
 import com.fs.framework.security.SecurityUtils;
 import com.fs.framework.service.TokenService;
@@ -69,6 +71,8 @@ public class CompanyUserController extends BaseController
     private ICompanyUserDelayTimeService companyUserDelayTimeService;
     @Autowired
     private ISysConfigService configService;
+    @Autowired
+    private IFsUserTalentService fsUserTalentService;
     /**
      * 获取用户列表
      */
@@ -131,6 +135,18 @@ public class CompanyUserController extends BaseController
     }
 
 
+    /**
+     * 获取达人详细信息
+     */
+
+    @GetMapping(value = "/selectCompanyTalent/{companyId}")
+    public TableDataInfo selectCompanyTalent(@PathVariable String companyId)
+    {
+        List<FsUserTalent> list = fsUserTalentService.selectCompanyTalent(companyId);
+        return getDataTable(list);
+    }
+
+
 
     /**
      * 根据用户编号获取详细信息

+ 5 - 4
fs-company/src/main/java/com/fs/company/controller/live/LiveQuestionLiveController.java

@@ -6,6 +6,7 @@ import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.framework.security.SecurityUtils;
+import com.fs.live.domain.LiveQuestionLive;
 import com.fs.live.service.ILiveQuestionLiveService;
 import com.fs.live.vo.LiveQuestionLiveVO;
 import lombok.AllArgsConstructor;
@@ -26,9 +27,9 @@ public class LiveQuestionLiveController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('live:liveConfig:list')")
     @GetMapping("/list")
-    public TableDataInfo list(@RequestParam Long liveId) {
+    public TableDataInfo list(@RequestParam LiveQuestionLive param) {
         startPage();
-        List<LiveQuestionLiveVO> list = liveQuestionLiveService.selectLiveQuestionLiveList(liveId);
+        List<LiveQuestionLiveVO> list = liveQuestionLiveService.selectLiveQuestionLiveList(param.getLiveId());
         return getDataTable(list);
     }
 
@@ -37,9 +38,9 @@ public class LiveQuestionLiveController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('live:liveConfig:list')")
     @GetMapping("/optionList")
-    public TableDataInfo optionList(@RequestParam Long liveId, @RequestParam(required = false) String title) {
+    public TableDataInfo optionList(@RequestParam LiveQuestionLive param, @RequestParam(required = false) String title) {
         startPage();
-        List<LiveQuestionLiveVO> list = liveQuestionLiveService.selectLiveQuestionOptionList(liveId, title);
+        List<LiveQuestionLiveVO> list = liveQuestionLiveService.selectLiveQuestionOptionList(param.getLiveId(), title);
         return getDataTable(list);
     }
 

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

@@ -2,6 +2,7 @@ package com.fs.course.mapper;
 
 import java.util.List;
 import com.fs.course.domain.FsUserTalent;
+import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
 
 /**
@@ -66,4 +67,7 @@ public interface FsUserTalentMapper
 
     @Update("update fs_user_talent set fans=fans-1 where talent_id=#{talentId}")
     int minusFans(Long talentId);
+
+    @Select("select nick_name,talent_id from fs_user_talent where company_id=#{companyId}")
+    List<FsUserTalent> selectCompanyTalent(String companyId);
 }

+ 7 - 0
fs-service/src/main/java/com/fs/course/service/IFsUserTalentService.java

@@ -61,4 +61,11 @@ public interface IFsUserTalentService
 
 
     int updateFans(Long talentId, Integer type);
+
+    /**
+     * 查询公司达人
+     * @param companyId 公司id
+     * @return 达人
+     */
+    List<FsUserTalent> selectCompanyTalent(String companyId);
 }

+ 7 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserTalentServiceImpl.java

@@ -101,4 +101,11 @@ public class FsUserTalentServiceImpl implements IFsUserTalentService
             return fsUserTalentMapper.minusFans(talentId);
         }
     }
+
+
+
+    @Override
+    public List<FsUserTalent> selectCompanyTalent(String companyId) {
+        return fsUserTalentMapper.selectCompanyTalent(companyId);
+    }
 }

+ 5 - 0
fs-service/src/main/java/com/fs/live/domain/Live.java

@@ -35,6 +35,11 @@ public class Live extends BaseEntity {
      */
     private Long companyUserId;
 
+    /**
+     * 达人ID
+     */
+    private Long talentId;
+
     /** 直播名称 */
     @Excel(name = "直播名称")
     private String liveName;

+ 10 - 5
fs-service/src/main/resources/mapper/live/LiveMapper.xml

@@ -3,11 +3,12 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fs.live.mapper.LiveMapper">
-    
+
     <resultMap type="Live" id="LiveResult">
         <result property="liveId"    column="live_id"    />
         <result property="companyId"    column="company_id"    />
         <result property="companyUserId"    column="company_user_id"    />
+        <result property="talentId"    column="talent_id"    />
         <result property="liveName"    column="live_name"    />
         <result property="liveDesc"    column="live_desc"    />
         <result property="showType"    column="show_type"    />
@@ -30,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLiveVo">
-        select live_id, company_id, company_user_id, live_name, live_desc, show_type, status, anchor_id, live_type, start_time, finish_time, live_img_url, live_config, is_show, is_del, qw_qr_code, rtmp_url, create_time, create_by, update_by, update_time, remark from live
+        select live_id, company_id, company_user_id,talent_id, live_name, live_desc, show_type, status, anchor_id, live_type, start_time, finish_time, live_img_url, live_config, is_show, is_del, qw_qr_code, rtmp_url, create_time, create_by, update_by, update_time, remark from live
     </sql>
 
     <select id="selectLiveList" parameterType="Live" resultMap="LiveResult">
@@ -38,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="companyId != null "> and company_id = #{companyId}</if>
             <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
+            <if test="talentId != null "> and talent_id = #{talentId}</if>
             <if test="liveName != null  and liveName != ''"> and live_name like concat('%', #{liveName}, '%')</if>
             <if test="liveDesc != null  and liveDesc != ''"> and live_desc = #{liveDesc}</if>
             <if test="showType != null "> and show_type = #{showType}</if>
@@ -54,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="rtmpUrl != null  and rtmpUrl != ''"> and rtmp_url = #{rtmpUrl}</if>
         </where>
     </select>
-    
+
     <select id="selectLiveByLiveId" parameterType="Long" resultMap="LiveResult">
         <include refid="selectLiveVo"/>
         where live_id = #{liveId}
@@ -83,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="companyId != null">company_id,</if>
             <if test="companyUserId != null">company_user_id,</if>
+            <if test="talentId != null">talent_id,</if>
             <if test="liveName != null">live_name,</if>
             <if test="liveDesc != null">live_desc,</if>
             <if test="showType != null">show_type,</if>
@@ -106,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="companyId != null">#{companyId},</if>
             <if test="companyUserId != null">#{companyUserId},</if>
+            <if test="talentId != null">#{talentId},</if>
             <if test="liveName != null">#{liveName},</if>
             <if test="liveDesc != null">#{liveDesc},</if>
             <if test="showType != null">#{showType},</if>
@@ -131,6 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateLive" parameterType="Live">
         update live
         <trim prefix="SET" suffixOverrides=",">
+            <if test="talentId != null">talent_id = #{talentId},</if>
             <if test="liveName != null">live_name = #{liveName},</if>
             <if test="liveDesc != null">live_desc = #{liveDesc},</if>
             <if test="showType != null">show_type = #{showType},</if>
@@ -159,9 +164,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteLiveByLiveIds" parameterType="String">
-        delete from live where live_id in 
+        delete from live where live_id in
         <foreach item="liveId" collection="array" open="(" separator="," close=")">
             #{liveId}
         </foreach>
     </delete>
-</mapper>
+</mapper>