瀏覽代碼

1、总后台会员管理新增直播归属转移
2、销售端新增单独的会员展示信息页面

yys 5 天之前
父節點
當前提交
63928c1adf

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

@@ -16,7 +16,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 企业员工信息Controller
@@ -174,4 +176,41 @@ public class CompanyUserController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 批量绑定/转移用户直播归属销售
+     */
+    @Log(title = "转移直播归属销售", businessType = BusinessType.UPDATE)
+    @PostMapping("/batchBindCompanyUserId")
+    public R batchBindCompanyUserId(@RequestBody Map<String, Object> data)
+    {
+        List<?> rawUserIds = (List<?>) data.get("fsUserIds");
+        Long bindCompanyUserId = null;
+        if (data.get("companyUserId") != null) {
+            if (data.get("companyUserId") instanceof Integer) {
+                bindCompanyUserId = ((Integer) data.get("companyUserId")).longValue();
+            } else if (data.get("companyUserId") instanceof Long) {
+                bindCompanyUserId = (Long) data.get("companyUserId");
+            } else if (data.get("companyUserId") instanceof Number) {
+                bindCompanyUserId = ((Number) data.get("companyUserId")).longValue();
+            }
+        }
+        if (rawUserIds == null || rawUserIds.isEmpty()) {
+            return R.error("用户ID列表不能为空");
+        }
+        List<Long> userIds = new ArrayList<>();
+        for (Object id : rawUserIds) {
+            if (id instanceof Number) {
+                userIds.add(((Number) id).longValue());
+            }
+        }
+        if (userIds.isEmpty()) {
+            return R.error("用户ID列表不能为空");
+        }
+        int result = companyUserService.batchUpdateBindCompanyUserId(userIds, bindCompanyUserId);
+        if (result > 0) {
+            return R.ok("绑定成功");
+        }
+        return R.error("绑定失败");
+    }
+
 }

+ 10 - 4
fs-service/src/main/java/com/fs/his/mapper/FsUserMapper.java

@@ -86,7 +86,7 @@ public interface FsUserMapper
      */
     public int deleteFsUserByUserIds(Long[] userIds);
     @Select({"<script> " +
-                "select f1.*,f2.nick_name tui_name,f2.phone tui_phone,CONCAT(cu.nick_name,'-',cu.user_name) as bindCompanyUserNickName FROM fs_user f1 LEFT JOIN fs_user f2 ON f1.tui_user_id =f2.user_id LEFT JOIN company_user cu ON cu.user_id = f1.bind_company_user_id "+
+                "select f1.*,f2.nick_name tui_name,f2.phone tui_phone,CONCAT_WS('-', cu.nick_name, cu.user_id) as bind_company_user_nick_name FROM fs_user f1 LEFT JOIN fs_user f2 ON f1.tui_user_id =f2.user_id LEFT JOIN company_user cu ON cu.user_id = f1.bind_company_user_id "+
             " where f1.is_del=0 "+
             "  <if test=\"nickName != null  and nickName != ''\"> and f1.nick_name like concat( #{nickName}, '%')</if>\n" +
             "            <if test=\"avatar != null  and avatar != ''\"> and f1.avatar = #{avatar}</if>\n" +
@@ -95,6 +95,7 @@ public interface FsUserMapper
             "            <if test=\"isBuy != null \"> and f1.is_buy = #{isBuy}</if>\n" +
             "            <if test=\"userId != null \"> and f1.user_id = #{userId}</if>\n" +
             "            <if test=\"bindCompanyUserId != null \"> and f1.bind_company_user_id=#{bindCompanyUserId}</if>\n" +
+            "            <if test=\"hasBindCompanyUser != null and hasBindCompanyUser == 1\"> and f1.bind_company_user_id is not null</if>\n" +
             "            <if test=\"tuiUserId != null  and tuiUserId != ''\"> and f1.tui_user_id = #{tuiUserId}</if>\n" +
             "            <if test=\"tuiTime != null \"> and f1.tui_time = #{tuiTime}</if>\n" +
             "            <if test=\"userCode != null  and userCode != ''\"> and f1.user_code = #{userCode}</if>\n" +
@@ -105,8 +106,12 @@ public interface FsUserMapper
             "            <if test=\"eTime != null \">  and DATE(f1.create_time) &lt;= DATE(#{eTime})</if>\n" +
             "order by f1.user_id desc"+
             "</script>"})
-    @Results({
-            @Result(property = "nickName", column = "nick_name")
+    @Results(id = "FsUserVOResult", value = {
+            @Result(property = "nickName", column = "nick_name"),
+            @Result(property = "tuiName", column = "tui_name"),
+            @Result(property = "tuiPhone", column = "tui_phone"),
+            @Result(property = "bindCompanyUserNickName", column = "bind_company_user_nick_name"),
+            @Result(property = "bindCompanyUserId", column = "bind_company_user_id")
     })
     List<FsUserVO> selectFsUserListVO(FsUserParam fsUser);
 
@@ -155,11 +160,12 @@ public interface FsUserMapper
     @Select("select * from fs_user where phone=#{phone} limit 1")
     FsUser selectFsUserByPhoneLimitOne(String phone);
     @Select({"<script> " +
-            "select distinct f1.*,f2.nick_name tui_name,f2.phone tui_phone,CONCAT(cu.nick_name,'-',cu.user_name) as bindCompanyUserNickName FROM company_user_user cuu LEFT JOIN fs_user f1 ON cuu.user_id =f1.user_id left JOIN fs_user f2 ON f1.tui_user_id =f2.user_id LEFT JOIN company_user cu ON cu.user_id = f1.bind_company_user_id"+
+            "select distinct f1.*,f2.nick_name tui_name,f2.phone tui_phone,CONCAT_WS('-', cu.nick_name, cu.user_id) as bind_company_user_nick_name FROM company_user_user cuu LEFT JOIN fs_user f1 ON cuu.user_id =f1.user_id left JOIN fs_user f2 ON f1.tui_user_id =f2.user_id LEFT JOIN company_user cu ON cu.user_id = f1.bind_company_user_id"+
             " where f1.is_del=0 "+
             "            <if test=\"companyUserId != null \"> and cuu.company_user_id=#{companyUserId}</if>\n" +
             "            <if test=\"companyId != null \"> and cuu.company_id=#{companyId}</if>\n" +
             "            <if test=\"bindCompanyUserId != null \"> and f1.bind_company_user_id=#{bindCompanyUserId}</if>\n" +
+            "            <if test=\"hasBindCompanyUser != null and hasBindCompanyUser == 1\"> and f1.bind_company_user_id is not null</if>\n" +
             "            <if test=\"nickName != null  and nickName != ''\"> and f1.nick_name like concat( #{nickName}, '%')</if>\n" +
             "            <if test=\"avatar != null  and avatar != ''\"> and f1.avatar = #{avatar}</if>\n" +
             "            <if test=\"phone != null  and phone != ''\"> and f1.phone like concat('%', #{phone}, '%')</if>\n" +

+ 3 - 0
fs-service/src/main/java/com/fs/his/param/FsUserParam.java

@@ -76,6 +76,9 @@ public class FsUserParam {
     /** 直播归属销售ID */
     private Long bindCompanyUserId;
 
+    /** 是否有直播归属销售:1-仅查询已绑定的用户 */
+    private Integer hasBindCompanyUser;
+
     private Integer isBuy;
 
     private String loginDevice;//当前登录设备

+ 6 - 0
fs-service/src/main/java/com/fs/his/vo/FsUserVO.java

@@ -21,6 +21,12 @@ public class FsUserVO extends FsUser implements Serializable
     @ApiModelProperty(value = "直播归属销售名称")
     private String bindCompanyUserNickName;
 
+    @ApiModelProperty(value = "上级昵称")
+    private String tuiName;
+
+    @ApiModelProperty(value = "上级手机号码")
+    private String tuiPhone;
+
     @ApiModelProperty(value = "所属公司")
     @Excel(name = "所属公司", sort = 9)
     private String companyName;