Ver Fonte

供应商端后台的用户管理优化

JiangChongBo há 2 anos atrás
pai
commit
5e94f46d23

+ 2 - 2
src/main/java/com/caimei/controller/admin/auth/AuthClubApi.java

@@ -67,7 +67,7 @@ public class AuthClubApi {
             @ApiImplicitParam(name = "pageNum", required = false, value = "第几页"),
             @ApiImplicitParam(name = "pageSize", required = false, value = "一页多少条")
     })
-    public ResponseJson<PageInfo<ClubUserVo>> getClubUserList(@CurrentUser SysUser sysUser, String mobile, String name, Integer status,
+    public ResponseJson<PageInfo<ClubUserVo>> getClubUserList(@CurrentUser SysUser sysUser, String mobile, String name, Integer status,Integer authenticationStatus,
                                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
         if (null == sysUser) {
@@ -79,7 +79,7 @@ public class AuthClubApi {
         if (null == authUserId) {
             return ResponseJson.error("供应商用户id不能为空", null);
         }
-        return authClubService.getClubUserList(authUserId, mobile, name, status, pageNum, pageSize);
+        return authClubService.getClubUserList(authUserId, mobile, name, status, pageNum, pageSize,authenticationStatus);
     }
 
     @ApiOperation("添加/编辑机构用户")

+ 3 - 0
src/main/java/com/caimei/mapper/cmMapper/ClubMapper.java

@@ -18,6 +18,9 @@ public interface ClubMapper {
     List<ClubVo> getClubList(@Param("authUserId") Integer authUserId, @Param("authParty") String authParty);
 
     List<ClubUserVo> getClubUserList(@Param("authUserId") Integer authUserId, @Param("mobile") String mobile, String name, @Param("status") Integer status);
+
+    List<ClubUserVo> getNotCertifiedClubUserList(@Param("authUserId") Integer authUserId, @Param("mobile") String mobile, String name, @Param("status") Integer status,Integer authenticationStatus);
+
     List<ClubUserVo> getmobile(Integer authUserId);
     void insertClubUser(ClubUserPo clubUser);
 

+ 1 - 1
src/main/java/com/caimei/service/auth/AuthClubService.java

@@ -35,7 +35,7 @@ public interface AuthClubService {
      * @param pageSize  一页多少条
      * @return  ClubUserVo
      */
-    ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authUserId, String mobile, String name, Integer status, Integer pageNum, Integer pageSize);
+    ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authUserId, String mobile, String name, Integer status, Integer pageNum, Integer pageSize,Integer authenticationStatus);
 
     /**
      * 微信公众号机构列表

+ 15 - 5
src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java

@@ -57,11 +57,21 @@ public class AuthClubServiceImpl implements AuthClubService {
     }
 
     @Override
-    public ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authUserId, String mobile, String name, Integer status, Integer pageNum, Integer pageSize) {
-        PageHelper.startPage(pageNum, pageSize);
-        List<ClubUserVo> clubUserList = clubMapper.getClubUserList(authUserId, mobile, name, status);
-        PageInfo<ClubUserVo> pageData = new PageInfo<>(clubUserList);
-        return ResponseJson.success(pageData);
+    public ResponseJson<PageInfo<ClubUserVo>> getClubUserList(Integer authUserId, String mobile, String name, Integer status, Integer pageNum, Integer pageSize,Integer authenticationStatus) {
+       //判断筛选条件是否是认证机构
+        if(authenticationStatus==0){
+            //查询未认证的机构
+            PageHelper.startPage(pageNum, pageSize);
+            List<ClubUserVo> clubUserList = clubMapper.getNotCertifiedClubUserList(authUserId, mobile, name, status,authenticationStatus);
+            PageInfo<ClubUserVo> pageData = new PageInfo<>(clubUserList);
+            return ResponseJson.success(pageData);
+        }else{
+            //查询已处理的机构
+            PageHelper.startPage(pageNum, pageSize);
+            List<ClubUserVo> clubUserList = clubMapper.getClubUserList(authUserId, mobile, name, status);
+            PageInfo<ClubUserVo> pageData = new PageInfo<>(clubUserList);
+            return ResponseJson.success(pageData);
+        }
     }
 
     @Override

+ 25 - 1
src/main/resources/mapper/ClubMapper.xml

@@ -62,7 +62,7 @@
         left join cm_brand_auth a on cu.authId = a.id
         where cu.authUserId = #{authUserId}
         and cu.delFlag = 0
-        and (a.id is null || a.delFlag = 0)
+        and  a.delFlag = 0
         <if test="name != null and name != ''">
             and cu.name like concat('%',#{name},'%')
         </if>
@@ -74,6 +74,30 @@
         </if>
         order by cu.addTime desc
     </select>
+    <select id="getNotCertifiedClubUserList" resultType="com.caimei.model.vo.ClubUserVo">
+        select cu.id as clubUserId,
+        cu.authId,
+        cu.name,
+        cu.mobile,
+        cu.addTime,
+        cu.nickName,
+        cu.openId,
+        cu.status
+        from cm_brand_club_user cu
+        where cu.authUserId = #{authUserId}
+        and cu.delFlag = 0
+        <if test="name != null and name != ''">
+            and cu.name like concat('%',#{name},'%')
+        </if>
+        <if test="mobile != null and mobile != ''">
+            and cu.mobile like concat('%',#{mobile},'%')
+        </if>
+        <if test="status != null">
+            and cu.status = #{status}
+        </if>
+            and cu.authId is null
+        order by cu.addTime desc
+    </select>
     <select id="getmobile" resultType="com.caimei.model.vo.ClubUserVo">
         select
         distinct mobile