JiangChongBo 2 jaren geleden
bovenliggende
commit
994837bbf8

+ 4 - 3
src/main/java/com/caimei/controller/admin/auth/DownloadApi.java

@@ -91,9 +91,10 @@ public class DownloadApi {
     }
     @GetMapping("/Clubuser/excel")
     public ResponseJson downloadClubuserlistInfo(String clubUserIds, HttpServletResponse response){
-        if (StringUtils.isEmpty(clubUserIds)) {
-            return ResponseJson.error("用户id不能为空");
-        }
+//        if (StringUtils.isEmpty(clubUserIds)) {
+//            return ResponseJson.error("用户id不能为空");
+//        }
+        //clubUserIds为空则导出全部数据
         return downloadService.downloadClubuserlistInfo(clubUserIds,response);
     }
 }

+ 22 - 1
src/main/java/com/caimei/service/auth/impl/AuthClubServiceImpl.java

@@ -63,6 +63,13 @@ public class AuthClubServiceImpl implements AuthClubService {
             //查询全部
             PageHelper.startPage(pageNum, pageSize);
             List<ClubUserVo> clubUserList = clubMapper.getAllCertifiedClubUserList(authUserId, mobile, name, status);
+            clubUserList.forEach(clubUserVo -> {
+                if(null!=clubUserVo.getAuthId()){
+                    clubUserVo.setAuthenticationStatus("1");
+                }else {
+                    clubUserVo.setAuthenticationStatus("0");
+                }
+            });
             PageInfo<ClubUserVo> pageData = new PageInfo<>(clubUserList);
             return ResponseJson.success(pageData);
         }
@@ -70,12 +77,26 @@ public class AuthClubServiceImpl implements AuthClubService {
             //查询未认证的机构
             PageHelper.startPage(pageNum, pageSize);
             List<ClubUserVo> clubUserList = clubMapper.getNotCertifiedClubUserList(authUserId, mobile, name, status,authenticationStatus);
+            clubUserList.forEach(clubUserVo -> {
+                if(null!=clubUserVo.getAuthId()){
+                    clubUserVo.setAuthenticationStatus("1");
+                }else {
+                    clubUserVo.setAuthenticationStatus("0");
+                }
+            });
             PageInfo<ClubUserVo> pageData = new PageInfo<>(clubUserList);
             return ResponseJson.success(pageData);
         }else{
-            //查询已处理的机构
+            //查询已认证的机构
             PageHelper.startPage(pageNum, pageSize);
             List<ClubUserVo> clubUserList = clubMapper.getClubUserList(authUserId, mobile, name, status);
+            clubUserList.forEach(clubUserVo -> {
+                if(null!=clubUserVo.getAuthId()){
+                    clubUserVo.setAuthenticationStatus("1");
+                }else {
+                    clubUserVo.setAuthenticationStatus("0");
+                }
+            });
             PageInfo<ClubUserVo> pageData = new PageInfo<>(clubUserList);
             return ResponseJson.success(pageData);
         }

+ 16 - 0
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -147,6 +147,22 @@ public class AuthServiceImpl implements AuthService {
         listType = null == listType ? 1 : listType;
         PageHelper.startPage(pageNum, pageSize);
         List<AuthVo> authList = authMapper.getAuthListAll(listType, authUserId, authParty, mobile, status, starFlag, auditStatus, lowerAuditStatus, shopAuditStatus, sendStatus, name, snCode);
+        //如果是手机号则进行脱敏处理
+        //手机号脱敏处理(脱敏规则: 保留前三后四, 比如15638296218置换为156****6218)
+        if(null!=authList&&authList.size()>0){
+            authList.forEach(authVo -> {
+                //判断是否是手机号
+                String phoneNumber=authVo.getCreateBy();
+                boolean matches = phoneNumber.matches("^[1][3,4,5,7,8,9][0-9]{9}$");
+                if(matches){
+                    //脱敏处理
+                    if(StringUtils.isNotEmpty(phoneNumber)){
+                        phoneNumber = phoneNumber.replaceAll("(\\w{3})\\w*(\\w{4})", "$1****$2");
+                        authVo.setCreateBy(phoneNumber);
+                    }
+                }
+            });
+        }
         PageInfo<AuthVo> pageData = new PageInfo<>(authList);
         return ResponseJson.success(pageData);
     }

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

@@ -307,7 +307,7 @@ public class ShopServiceImpl implements ShopService {
         }
         String verifyCode = "prod".equals(active) ? CodeUtil.generateCodeInt(6) : "666666";;
         String content = "您的短信验证码为:" + verifyCode + ",该验证码 5 分钟内有效,请勿泄漏于他人。";
-        Boolean sendSms = SmsUtils.sendSms(null, mobile, content);
+        Boolean sendSms = SmsUtils.sendSms(1, mobile, content);
         if (!sendSms) {
             log.info("短信验证码发送失败,手机号:" + mobile);
             return ResponseJson.error("发送失败,请确认手机号无误");

+ 3 - 1
src/main/resources/mapper/AuthMapper.xml

@@ -924,6 +924,8 @@
                cu.status
         from cm_brand_club_user cu
         LEFT JOIN cm_brand_auth a ON cu.authId = a.id
-        where find_in_set(cu.id,#{clubUserIds})
+        <if test="clubUserIds != null and clubUserIds!=''">
+            where find_in_set(cu.id,#{clubUserIds})
+        </if>
     </select>
 </mapper>