Bladeren bron

总后台达人新增所属公司查询条件,达人修改页面增加所属销售公司项

chenguo 1 week geleden
bovenliggende
commit
d3e78e23e6

+ 12 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserTalentController.java

@@ -5,6 +5,8 @@ import java.util.List;
 
 import com.fs.common.core.domain.R;
 import com.fs.common.utils.DateUtils;
+import com.fs.company.service.ICompanyService;
+import com.fs.company.vo.CompanyVO;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -37,6 +39,9 @@ public class FsUserTalentController extends BaseController
     @Autowired
     private IFsUserTalentService fsUserTalentService;
 
+    @Autowired
+    private ICompanyService companyService;
+
     /**
      * 查询达人列表
      */
@@ -124,4 +129,11 @@ public class FsUserTalentController extends BaseController
         List<FsUserTalent> list = fsUserTalentService.selectFsUserTalentList(fsUserTalent);
         return R.ok().put("data",list);
     }
+
+    @GetMapping("/listCompanyByKeyword/{keyword}")
+    public R listCompanyByKeyword(@PathVariable String keyword)
+    {
+        List<CompanyVO> companies = companyService.selectCompanyByKeyword(keyword);
+        return R.ok().put("data",companies);
+    }
 }

+ 2 - 0
fs-service/src/main/java/com/fs/company/mapper/CompanyMapper.java

@@ -184,4 +184,6 @@ public interface CompanyMapper
      * 通过企业id批量查询
      * **/
     List<Company> selectCompanyByIds(@Param("ids") List<Long> ids);
+
+    List<CompanyVO> selectCompanyByKeyword(String keyword);
 }

+ 5 - 0
fs-service/src/main/java/com/fs/company/service/ICompanyService.java

@@ -122,6 +122,11 @@ public interface ICompanyService
      * @return
      */
     String selectCompanyByIds(String companyIds);
+    /**
+     * 根据公司名称查询
+     * @param keyword
+     * */
+    List<CompanyVO> selectCompanyByKeyword(String keyword);
 
     List<DeptDataVO> getDeptData(Long companyId);
     List<DeptDataVO> getDeptData(Long companyId,Long currentCompanyUserId,Long currentDeptId);

+ 5 - 0
fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java

@@ -563,6 +563,11 @@ public class CompanyServiceImpl implements ICompanyService
 
     }
 
+    @Override
+    public List<CompanyVO> selectCompanyByKeyword(String keyword) {
+        return companyMapper.selectCompanyByKeyword(keyword);
+    }
+
     @Override
     public List<DeptDataVO> getDeptData(Long companyId) {
         List<DeptDataVO> result = new ArrayList<>();

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

@@ -111,4 +111,11 @@ public class FsUserTalent extends BaseEntity
     @Excel(name = "已提现佣金")
     private BigDecimal extractMoney;
 
+    /** 所属销售公司*/
+    @Excel(name = "所属销售公司")
+    private Long companyId;
+
+    /** 所属销售公司查询Str */
+    private String companyIdStr;
+
 }

+ 11 - 0
fs-service/src/main/resources/mapper/company/CompanyMapper.xml

@@ -198,5 +198,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </foreach>
             <!-- 批量查询企业ID: ${ids} -->
     </select>
+    <!--selectCompanyByKeyword -->
+    <select id="selectCompanyByKeyword" resultMap="CompanyResult">
+        SELECT
+        company_id,
+        company_name
+        FROM
+        company
+        WHERE
+        status=1
+        AND company_name like concat('%',#{keyword},'%')
+    </select>
 
 </mapper>

+ 8 - 1
fs-service/src/main/resources/mapper/course/FsUserTalentMapper.xml

@@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectFsUserTalentVo">
-        select talent_id, user_id, create_time, update_time, nick_name, avatar, phone, title, sex, tags, address, level, fans, likes, is_del, tiktok_link, kwai_link, is_audit, audit_time, certificate_code, certificate_images, balance, total_money, freeze_money, extract_money from fs_user_talent
+        select talent_id, user_id, create_time, update_time, nick_name, avatar, phone, title, sex, tags, address, level, fans, likes, is_del, tiktok_link, kwai_link, is_audit, audit_time, certificate_code, certificate_images, balance, total_money, freeze_money, extract_money,company_id from fs_user_talent
     </sql>
 
     <select id="selectFsUserTalentList" parameterType="FsUserTalent" resultMap="FsUserTalentResult">
@@ -62,6 +62,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalMoney != null "> and total_money = #{totalMoney}</if>
             <if test="freezeMoney != null "> and freeze_money = #{freezeMoney}</if>
             <if test="extractMoney != null "> and extract_money = #{extractMoney}</if>
+            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="companyIdStr != null and companyIdStr != ''">
+                and company_id in (#{companyIdStr})
+            </if>
         </where>
     </select>
 
@@ -97,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalMoney != null">total_money,</if>
             <if test="freezeMoney != null">freeze_money,</if>
             <if test="extractMoney != null">extract_money,</if>
+            <if test="companyId != null">company_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
@@ -123,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalMoney != null">#{totalMoney},</if>
             <if test="freezeMoney != null">#{freezeMoney},</if>
             <if test="extractMoney != null">#{extractMoney},</if>
+            <if test="companyId != null">#{companyId},</if>
         </trim>
     </insert>
 
@@ -153,6 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalMoney != null">total_money = #{totalMoney},</if>
             <if test="freezeMoney != null">freeze_money = #{freezeMoney},</if>
             <if test="extractMoney != null">extract_money = #{extractMoney},</if>
+            <if test="companyId != null">company_id = #{companyId},</if>
         </trim>
         where talent_id = #{talentId}
     </update>