Explorar el Código

调整业务受理,业主信息、绑定业主、房屋收费身份证以及手机号脱敏权限控制

xiaogang hace 5 años
padre
commit
cde48cd5fc

+ 3 - 0
java110-core/src/main/java/com/java110/core/context/DataFlowContext.java

@@ -25,6 +25,9 @@ public interface DataFlowContext {
     //AppId
      String getAppId();
 
+     //userId
+     String getUserId();
+
      JSONObject getReqJson();
     /**
      * 返回报文

+ 35 - 8
service-api/src/main/java/com/java110/api/listener/fee/ListRoomsWhereFeeSetListener.java

@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.java110.api.listener.AbstractServiceApiListener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
+import com.java110.dto.basePrivilege.BasePrivilegeDto;
+import com.java110.intf.community.IMenuInnerServiceSMO;
 import com.java110.intf.user.IOwnerInnerServiceSMO;
 import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
 import com.java110.intf.community.IRoomInnerServiceSMO;
@@ -23,6 +25,7 @@ import org.springframework.http.ResponseEntity;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 
 /**
@@ -31,7 +34,6 @@ import java.util.List;
 @Java110Listener("listRoomsWhereFeeSetListener")
 public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
 
-
     @Autowired
     private IRoomInnerServiceSMO roomInnerServiceSMOImpl;
 
@@ -41,6 +43,9 @@ public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
     @Autowired
     private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMOImpl;
 
+    @Autowired
+    private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
+
     @Override
     public String getServiceCode() {
         return ServiceCodeFeeConfigConstant.LIST_ROOMS_WHERE_FEE_SET;
@@ -81,8 +86,8 @@ public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
         apiRoomVo.setTotal(total);
         if (total > 0) {
             List<RoomDto> roomDtoList = roomInnerServiceSMOImpl.queryRooms(roomDto);
-
-            refreshRoomOwners(reqJson.getString("communityId"), roomDtoList);
+            String userId = context.getUserId();
+            refreshRoomOwners(userId, reqJson.getString("communityId"), roomDtoList);
 
             apiRoomVo.setRooms(BeanConvertUtil.covertBeanList(roomDtoList, ApiRoomDataVo.class));
         }
@@ -153,8 +158,7 @@ public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
      *
      * @param roomDtos
      */
-    private void refreshRoomOwners(String communityId, List<RoomDto> roomDtos) {
-
+    private void refreshRoomOwners(String userId, String communityId, List<RoomDto> roomDtos) {
         List<String> roomIds = new ArrayList<>();
         for (RoomDto roomDto : roomDtos) {
             roomIds.add(roomDto.getRoomId());
@@ -162,15 +166,25 @@ public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
         OwnerDto ownerDto = new OwnerDto();
         ownerDto.setCommunityId(communityId);
         ownerDto.setRoomIds(roomIds.toArray(new String[roomIds.size()]));
+        List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
         List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnersByRoom(ownerDto);
-
         for (RoomDto roomDto : roomDtos) {
             for (OwnerDto tmpOwnerDto : ownerDtos) {
                 if (roomDto.getRoomId().equals(tmpOwnerDto.getRoomId())) {
                     roomDto.setOwnerId(tmpOwnerDto.getOwnerId());
                     roomDto.setOwnerName(tmpOwnerDto.getName());
-                    roomDto.setIdCard(tmpOwnerDto.getIdCard());
-                    roomDto.setLink(tmpOwnerDto.getLink());
+                    //对业主身份证号隐藏处理
+                    String idCard = tmpOwnerDto.getIdCard();
+                    if (mark.size() == 0 && idCard != null && !idCard.equals("")) {
+                        idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16);
+                    }
+                    //对业主手机号隐藏处理
+                    String link = tmpOwnerDto.getLink();
+                    if (mark.size() == 0 && link != null && !link.equals("")) {
+                        link = link.substring(0, 3) + "****" + link.substring(7);
+                    }
+                    roomDto.setIdCard(idCard);
+                    roomDto.setLink(link);
                 }
             }
         }
@@ -199,4 +213,17 @@ public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
     public void setOwnerRoomRelInnerServiceSMOImpl(IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMOImpl) {
         this.ownerRoomRelInnerServiceSMOImpl = ownerRoomRelInnerServiceSMOImpl;
     }
+
+    /**
+     * 脱敏处理
+     *
+     * @return
+     */
+    public List<Map> getPrivilegeOwnerList(String resource, String userId) {
+        BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto();
+        basePrivilegeDto.setResource(resource);
+        basePrivilegeDto.setUserId(userId);
+        List<Map> privileges = menuInnerServiceSMOImpl.checkUserHasResource(basePrivilegeDto);
+        return privileges;
+    }
 }

+ 40 - 3
service-api/src/main/java/com/java110/api/listener/owner/ListAuditAppUserBindingOwnersListener.java

@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.java110.api.listener.AbstractServiceApiListener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
+import com.java110.dto.basePrivilege.BasePrivilegeDto;
+import com.java110.intf.community.IMenuInnerServiceSMO;
 import com.java110.intf.user.IOwnerAppUserInnerServiceSMO;
 import com.java110.dto.owner.OwnerAppUserDto;
 import com.java110.core.event.service.api.ServiceDataFlowEvent;
@@ -19,6 +21,7 @@ import org.springframework.http.ResponseEntity;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 
 /**
@@ -30,6 +33,9 @@ public class ListAuditAppUserBindingOwnersListener extends AbstractServiceApiLis
     @Autowired
     private IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMOImpl;
 
+    @Autowired
+    private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
+
     @Override
     public String getServiceCode() {
         return ServiceCodeConstant.LIST_AUDIT_APPUSERBINDINGOWNERS;
@@ -56,24 +62,42 @@ public class ListAuditAppUserBindingOwnersListener extends AbstractServiceApiLis
 
     @Override
     protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
+        //获取当前用户id
+        String userId = context.getUserId();
         OwnerAppUserDto ownerAppUserDto = BeanConvertUtil.covertBean(reqJson, OwnerAppUserDto.class);
 
         int count = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsersCount(ownerAppUserDto);
 
         List<ApiAuditAppUserBindingOwnerDataVo> auditAppUserBindingOwners = null;
-
+        List<ApiAuditAppUserBindingOwnerDataVo> ownerDtos = new ArrayList<>();
         if (count > 0) {
             auditAppUserBindingOwners = BeanConvertUtil.covertBeanList(ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto), ApiAuditAppUserBindingOwnerDataVo.class);
+            List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
+            for (ApiAuditAppUserBindingOwnerDataVo owner : auditAppUserBindingOwners) {
+                //对业主身份证号隐藏处理
+                String idCard = owner.getIdCard();
+                if (mark.size() == 0 && idCard != null && !idCard.equals("")) {
+                    idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16);
+                    owner.setIdCard(idCard);
+                }
+                //对业主手机号隐藏处理
+                String link = owner.getLink();
+                if (mark.size() == 0 && link != null && !link.equals("")) {
+                    link = link.substring(0, 3) + "****" + link.substring(7);
+                    owner.setLink(link);
+                }
+                ownerDtos.add(owner);
+            }
         } else {
             auditAppUserBindingOwners = new ArrayList<>();
+            ownerDtos.addAll(auditAppUserBindingOwners);
         }
 
         ApiAuditAppUserBindingOwnerVo apiAuditAppUserBindingOwnerVo = new ApiAuditAppUserBindingOwnerVo();
 
         apiAuditAppUserBindingOwnerVo.setTotal(count);
         apiAuditAppUserBindingOwnerVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
-        apiAuditAppUserBindingOwnerVo.setAuditAppUserBindingOwners(auditAppUserBindingOwners);
+        apiAuditAppUserBindingOwnerVo.setAuditAppUserBindingOwners(ownerDtos);
 
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiAuditAppUserBindingOwnerVo), HttpStatus.OK);
 
@@ -88,4 +112,17 @@ public class ListAuditAppUserBindingOwnersListener extends AbstractServiceApiLis
     public void setOwnerAppUserInnerServiceSMOImpl(IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMOImpl) {
         this.ownerAppUserInnerServiceSMOImpl = ownerAppUserInnerServiceSMOImpl;
     }
+
+    /**
+     * 脱敏处理
+     *
+     * @return
+     */
+    public List<Map> getPrivilegeOwnerList(String resource, String userId) {
+        BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto();
+        basePrivilegeDto.setResource(resource);
+        basePrivilegeDto.setUserId(userId);
+        List<Map> privileges = menuInnerServiceSMOImpl.checkUserHasResource(basePrivilegeDto);
+        return privileges;
+    }
 }

+ 60 - 4
service-api/src/main/java/com/java110/api/listener/owner/QueryOwnersListener.java

@@ -3,6 +3,8 @@ package com.java110.api.listener.owner;
 
 import com.alibaba.fastjson.JSONObject;
 import com.java110.api.listener.AbstractServiceApiDataFlowListener;
+import com.java110.dto.basePrivilege.BasePrivilegeDto;
+import com.java110.intf.community.IMenuInnerServiceSMO;
 import com.java110.utils.constant.ServiceCodeConstant;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
@@ -18,7 +20,9 @@ import org.springframework.http.HttpMethod;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @ClassName OwnerDto
@@ -34,6 +38,9 @@ public class QueryOwnersListener extends AbstractServiceApiDataFlowListener {
     @Autowired
     private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl;
 
+    @Autowired
+    private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
+
     @Override
     public String getServiceCode() {
         return ServiceCodeConstant.SERVICE_CODE_QUERY_OWNER;
@@ -55,7 +62,8 @@ public class QueryOwnersListener extends AbstractServiceApiDataFlowListener {
         //获取请求数据
         JSONObject reqJson = dataFlowContext.getReqJson();
         validateOwnerData(reqJson);
-
+        //获取当前用户id
+        String userId = dataFlowContext.getUserId();
 
         if (reqJson.containsKey("name")) {
             queryByCondition(reqJson, dataFlowContext);
@@ -69,9 +77,26 @@ public class QueryOwnersListener extends AbstractServiceApiDataFlowListener {
         //查询总记录数
         int total = ownerInnerServiceSMOImpl.queryOwnersCount(BeanConvertUtil.covertBean(reqJson, OwnerDto.class));
         apiOwnerVo.setTotal(total);
+        List<OwnerDto> ownerDtos = new ArrayList<>();
         if (total > 0) {
             List<OwnerDto> ownerDtoList = ownerInnerServiceSMOImpl.queryOwners(BeanConvertUtil.covertBean(reqJson, OwnerDto.class));
-            apiOwnerVo.setOwners(BeanConvertUtil.covertBeanList(ownerDtoList, ApiOwnerDataVo.class));
+            List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
+            for (OwnerDto ownerDto : ownerDtoList) {
+                //对业主身份证号隐藏处理
+                String idCard = ownerDto.getIdCard();
+                if (mark.size() == 0 && idCard != null && !idCard.equals("")) {
+                    idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16);
+                    ownerDto.setIdCard(idCard);
+                }
+                //对业主手机号隐藏处理
+                String link = ownerDto.getLink();
+                if (mark.size() == 0 && link != null && !link.equals("")) {
+                    link = link.substring(0, 3) + "****" + link.substring(7);
+                    ownerDto.setLink(link);
+                }
+                ownerDtos.add(ownerDto);
+            }
+            apiOwnerVo.setOwners(BeanConvertUtil.covertBeanList(ownerDtos, ApiOwnerDataVo.class));
         }
 
         apiOwnerVo.setRecords((int) Math.ceil((double) total / (double) row));
@@ -88,14 +113,32 @@ public class QueryOwnersListener extends AbstractServiceApiDataFlowListener {
      * @param dataFlowContext 上下文
      */
     private void queryByCondition(JSONObject reqJson, DataFlowContext dataFlowContext) {
-
+        //获取当前用户id
+        String userId = dataFlowContext.getUserId();
         int row = reqJson.getInteger("row");
         ApiOwnerVo apiOwnerVo = new ApiOwnerVo();
         int total = ownerInnerServiceSMOImpl.queryOwnerCountByCondition(BeanConvertUtil.covertBean(reqJson, OwnerDto.class));
         apiOwnerVo.setTotal(total);
+        List<OwnerDto> ownerDtos = new ArrayList<>();
         if (total > 0) {
             List<OwnerDto> ownerDtoList = ownerInnerServiceSMOImpl.queryOwnersByCondition(BeanConvertUtil.covertBean(reqJson, OwnerDto.class));
-            apiOwnerVo.setOwners(BeanConvertUtil.covertBeanList(ownerDtoList, ApiOwnerDataVo.class));
+            List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
+            for (OwnerDto ownerDto : ownerDtoList) {
+                //对业主身份证号隐藏处理
+                String idCard = ownerDto.getIdCard();
+                if (mark.size() == 0 && idCard != null && !idCard.equals("")) {
+                    idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16);
+                    ownerDto.setIdCard(idCard);
+                }
+                //对业主手机号隐藏处理
+                String link = ownerDto.getLink();
+                if (mark.size() == 0 && link != null && !link.equals("")) {
+                    link = link.substring(0, 3) + "****" + link.substring(7);
+                    ownerDto.setLink(link);
+                }
+                ownerDtos.add(ownerDto);
+            }
+            apiOwnerVo.setOwners(BeanConvertUtil.covertBeanList(ownerDtos, ApiOwnerDataVo.class));
         }
 
         apiOwnerVo.setRecords((int) Math.ceil((double) total / (double) row));
@@ -132,4 +175,17 @@ public class QueryOwnersListener extends AbstractServiceApiDataFlowListener {
     public void setOwnerInnerServiceSMOImpl(IOwnerInnerServiceSMO ownerInnerServiceSMOImpl) {
         this.ownerInnerServiceSMOImpl = ownerInnerServiceSMOImpl;
     }
+
+    /**
+     * 脱敏处理
+     *
+     * @return
+     */
+    public List<Map> getPrivilegeOwnerList(String resource, String userId) {
+        BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto();
+        basePrivilegeDto.setResource(resource);
+        basePrivilegeDto.setUserId(userId);
+        List<Map> privileges = menuInnerServiceSMOImpl.checkUserHasResource(basePrivilegeDto);
+        return privileges;
+    }
 }

+ 3 - 2
service-user/src/main/java/com/java110/user/api/OwnerApi.java

@@ -74,7 +74,8 @@ public class OwnerApi {
     @RequestMapping(value = "/comprehensiveQuery", method = RequestMethod.GET)
     public ResponseEntity<String> comprehensiveQuery(@RequestParam(value = "communityId") String communityId,
                                                      @RequestParam(value = "searchValue") String searchValue,
-                                                     @RequestParam(value = "searchType") String searchType) {
-        return comprehensiveQueryImpl.query(communityId, searchValue, searchType);
+                                                     @RequestParam(value = "searchType") String searchType,
+                                                     @RequestHeader(value = "user-id") String userId) {
+        return comprehensiveQueryImpl.query(communityId, searchValue, searchType,userId);
     }
 }

+ 1 - 1
service-user/src/main/java/com/java110/user/bmo/owner/IComprehensiveQuery.java

@@ -9,5 +9,5 @@ public interface IComprehensiveQuery {
      *
      * @return
      */
-    ResponseEntity<String> query(String communityId, String searchValue, String searchType);
+    ResponseEntity<String> query(String communityId, String searchValue, String searchType, String userId);
 }

+ 178 - 37
service-user/src/main/java/com/java110/user/bmo/owner/impl/ComprehensiveQueryImpl.java

@@ -1,11 +1,13 @@
 package com.java110.user.bmo.owner.impl;
 
 import com.java110.dto.RoomDto;
+import com.java110.dto.basePrivilege.BasePrivilegeDto;
 import com.java110.dto.owner.OwnerCarDto;
 import com.java110.dto.owner.OwnerDto;
 import com.java110.dto.owner.OwnerRoomRelDto;
 import com.java110.intf.common.IFileInnerServiceSMO;
 import com.java110.intf.common.IFileRelInnerServiceSMO;
+import com.java110.intf.community.IMenuInnerServiceSMO;
 import com.java110.intf.community.IRoomInnerServiceSMO;
 import com.java110.intf.user.IOwnerCarInnerServiceSMO;
 import com.java110.intf.user.IOwnerInnerServiceSMO;
@@ -19,6 +21,7 @@ import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 @Service
 public class ComprehensiveQueryImpl implements IComprehensiveQuery {
@@ -50,33 +53,36 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
     @Autowired
     private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl;
 
+    @Autowired
+    private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
+
     @Override
-    public ResponseEntity<String> query(String communityId, String searchValue, String searchType) {
+    public ResponseEntity<String> query(String communityId, String searchValue, String searchType, String userId) {
         OwnerDto ownerDto = null;
         switch (searchType) {
             case SEARCH_TYPE_ROOM:
-                ownerDto = queryByRoom(communityId, searchValue);
+                ownerDto = queryByRoom(communityId, searchValue, userId);
                 break;
             case SEARCH_TYPE_OWNER_NAME:
-                ownerDto = queryByOwnerName(communityId, searchValue);
+                ownerDto = queryByOwnerName(communityId, searchValue, userId);
                 break;
             case SEARCH_TYPE_OWNER_TEL:
-                ownerDto = queryByOwnerTel(communityId, searchValue);
+                ownerDto = queryByOwnerTel(communityId, searchValue, userId);
                 break;
             case SEARCH_TYPE_OWNER_IDCARD:
-                ownerDto = queryByOwnerIdCard(communityId, searchValue);
+                ownerDto = queryByOwnerIdCard(communityId, searchValue, userId);
                 break;
             case SEARCH_TYPE_OWNER_CAR:
-                ownerDto = queryByOwnerCar(communityId, searchValue);
+                ownerDto = queryByOwnerCar(communityId, searchValue, userId);
                 break;
             case SEARCH_TYPE_OWNER_MEMBER_NAME:
-                ownerDto = queryByOwnerMemberName(communityId, searchValue);
+                ownerDto = queryByOwnerMemberName(communityId, searchValue, userId);
                 break;
             case SEARCH_TYPE_OWNER_MEMBER_TEL:
-                ownerDto = queryByOwnerMemberTel(communityId, searchValue);
+                ownerDto = queryByOwnerMemberTel(communityId, searchValue, userId);
                 break;
             case SEARCH_TYPE_OWNER_MEMBER_IDCARD:
-                ownerDto = queryByOwnerMemberIdCard(communityId, searchValue);
+                ownerDto = queryByOwnerMemberIdCard(communityId, searchValue, userId);
                 break;
         }
         return ResultVo.createResponseEntity(1, 1, ownerDto);
@@ -89,16 +95,29 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
      * @param searchValue
      * @return
      */
-    private OwnerDto queryByOwnerMemberIdCard(String communityId, String searchValue) {
-
+    private OwnerDto queryByOwnerMemberIdCard(String communityId, String searchValue, String userId) {
         OwnerDto ownerDto = new OwnerDto();
         ownerDto.setCommunityId(communityId);
         ownerDto.setIdCard(searchValue);
         ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER, OwnerDto.OWNER_TYPE_CD_RENTING});
         List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto);
         Assert.listOnlyOne(ownerDtos, "未找到成员信息或者查询到多条,请换其他条件查询");
-
-        return queryByOwnerId(communityId, ownerDtos.get(0).getOwnerId());
+        OwnerDto owner = queryByOwnerId(communityId, ownerDtos.get(0).getOwnerId());
+        //查询是否有脱敏权限
+        List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
+        //对业主身份证号隐藏处理
+        String idCard = owner.getIdCard();
+        if (mark.size() == 0 && idCard != null && idCard != null) {
+            idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16);
+            owner.setIdCard(idCard);
+        }
+        //对业主手机号隐藏处理
+        String link = owner.getLink();
+        if (mark.size() == 0 && link != null && !link.equals("")) {
+            link = link.substring(0, 3) + "****" + link.substring(7);
+            owner.setLink(link);
+        }
+        return owner;
     }
 
     /**
@@ -108,16 +127,29 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
      * @param searchValue
      * @return
      */
-    private OwnerDto queryByOwnerMemberTel(String communityId, String searchValue) {
-
+    private OwnerDto queryByOwnerMemberTel(String communityId, String searchValue, String userId) {
         OwnerDto ownerDto = new OwnerDto();
         ownerDto.setCommunityId(communityId);
         ownerDto.setLink(searchValue);
         ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER, OwnerDto.OWNER_TYPE_CD_RENTING});
         List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto);
         Assert.listOnlyOne(ownerDtos, "未找到成员信息或者查询到多条,请换其他条件查询");
-
-        return queryByOwnerId(communityId, ownerDtos.get(0).getOwnerId());
+        OwnerDto owner = queryByOwnerId(communityId, ownerDtos.get(0).getOwnerId());
+        //查询是否有脱敏权限
+        List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
+        //对业主身份证号隐藏处理
+        String idCard = owner.getIdCard();
+        if (mark.size() == 0 && idCard != null && idCard != null) {
+            idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16);
+            owner.setIdCard(idCard);
+        }
+        //对业主手机号隐藏处理
+        String link = owner.getLink();
+        if (mark.size() == 0 && link != null && !link.equals("")) {
+            link = link.substring(0, 3) + "****" + link.substring(7);
+            owner.setLink(link);
+        }
+        return owner;
     }
 
     /**
@@ -127,7 +159,7 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
      * @param searchValue
      * @return
      */
-    private OwnerDto queryByOwnerMemberName(String communityId, String searchValue) {
+    private OwnerDto queryByOwnerMemberName(String communityId, String searchValue, String userId) {
 
         OwnerDto ownerDto = new OwnerDto();
         ownerDto.setCommunityId(communityId);
@@ -135,8 +167,22 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
         ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER, OwnerDto.OWNER_TYPE_CD_RENTING});
         List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto);
         Assert.listOnlyOne(ownerDtos, "未找到成员信息或者查询到多条,请换其他条件查询");
-
-        return queryByOwnerId(communityId, ownerDtos.get(0).getOwnerId());
+        OwnerDto owner = queryByOwnerId(communityId, ownerDtos.get(0).getOwnerId());
+        //查询是否有脱敏权限
+        List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
+        //对业主身份证号隐藏处理
+        String idCard = owner.getIdCard();
+        if (mark.size() == 0 && idCard != null && idCard != null) {
+            idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16);
+            owner.setIdCard(idCard);
+        }
+        //对业主手机号隐藏处理
+        String link = owner.getLink();
+        if (mark.size() == 0 && link != null && !link.equals("")) {
+            link = link.substring(0, 3) + "****" + link.substring(7);
+            owner.setLink(link);
+        }
+        return owner;
     }
 
     /**
@@ -146,7 +192,7 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
      * @param searchValue
      * @return
      */
-    private OwnerDto queryByOwnerCar(String communityId, String searchValue) {
+    private OwnerDto queryByOwnerCar(String communityId, String searchValue, String userId) {
         OwnerCarDto ownerCarDto = new OwnerCarDto();
         ownerCarDto.setCommunityId(communityId);
         ownerCarDto.setCarNum(searchValue);
@@ -156,7 +202,22 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
             throw new IllegalArgumentException("未查到车辆信息");
         }
 
-        return queryByOwnerId(communityId, ownerCarDtos.get(0).getOwnerId());
+        OwnerDto owner = queryByOwnerId(communityId, ownerCarDtos.get(0).getOwnerId());
+        //查询是否有脱敏权限
+        List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
+        //对业主身份证号隐藏处理
+        String idCard = owner.getIdCard();
+        if (mark.size() == 0 && idCard != null && idCard != null) {
+            idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16);
+            owner.setIdCard(idCard);
+        }
+        //对业主手机号隐藏处理
+        String link = owner.getLink();
+        if (mark.size() == 0 && link != null && !link.equals("")) {
+            link = link.substring(0, 3) + "****" + link.substring(7);
+            owner.setLink(link);
+        }
+        return owner;
     }
 
 
@@ -204,16 +265,34 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
      * @param searchValue
      * @return
      */
-    private OwnerDto queryByOwnerIdCard(String communityId, String searchValue) {
+    private OwnerDto queryByOwnerIdCard(String communityId, String searchValue, String userId) {
         OwnerDto ownerDto = new OwnerDto();
         ownerDto.setCommunityId(communityId);
         ownerDto.setIdCard(searchValue);
         ownerDto.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_OWNER);
         List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto);
         Assert.listOnlyOne(ownerDtos, "未找到业主信息或者查询到多条,请换其他条件查询");
-        OwnerDto resOwnerDto = ownerDtos.get(0);
+        //查询是否有脱敏权限
+        List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
+        List<OwnerDto> ownerDtoList = new ArrayList<>();
+        for (OwnerDto owner : ownerDtos) {
+            //对业主身份证号隐藏处理
+            String idCard = owner.getIdCard();
+            if (mark.size() == 0 && idCard != null && !idCard.equals("")) {
+                idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16);
+            }
+            //对业主手机号隐藏处理
+            String link = owner.getLink();
+            if (mark.size() == 0 && link != null && !link.equals("")) {
+                link = link.substring(0, 3) + "****" + link.substring(7);
+            }
+            owner.setIdCard(idCard);
+            owner.setLink(link);
+            ownerDtoList.add(owner);
+        }
+        OwnerDto resOwnerDto = ownerDtoList.get(0);
         OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
-        ownerRoomRelDto.setOwnerId(ownerDtos.get(0).getOwnerId());
+        ownerRoomRelDto.setOwnerId(ownerDtoList.get(0).getOwnerId());
         List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
 
         //没有房屋
@@ -241,16 +320,34 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
      * @param searchValue
      * @return
      */
-    private OwnerDto queryByOwnerTel(String communityId, String searchValue) {
+    private OwnerDto queryByOwnerTel(String communityId, String searchValue, String userId) {
         OwnerDto ownerDto = new OwnerDto();
         ownerDto.setCommunityId(communityId);
         ownerDto.setLink(searchValue);
         ownerDto.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_OWNER);
         List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto);
         Assert.listOnlyOne(ownerDtos, "未找到业主信息或者查询到多条,请换其他条件查询");
-        OwnerDto resOwnerDto = ownerDtos.get(0);
+        //查询是否有脱敏权限
+        List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
+        List<OwnerDto> ownerDtoList = new ArrayList<>();
+        for (OwnerDto owner : ownerDtos) {
+            //对业主身份证号隐藏处理
+            String idCard = owner.getIdCard();
+            if (mark.size() == 0 && idCard != null && !idCard.equals("")) {
+                idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16);
+            }
+            //对业主手机号隐藏处理
+            String link = owner.getLink();
+            if (mark.size() == 0 && link != null && !link.equals("")) {
+                link = link.substring(0, 3) + "****" + link.substring(7);
+            }
+            owner.setIdCard(idCard);
+            owner.setLink(link);
+            ownerDtoList.add(owner);
+        }
+        OwnerDto resOwnerDto = ownerDtoList.get(0);
         OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
-        ownerRoomRelDto.setOwnerId(ownerDtos.get(0).getOwnerId());
+        ownerRoomRelDto.setOwnerId(ownerDtoList.get(0).getOwnerId());
         List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
 
         //没有房屋
@@ -278,17 +375,34 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
      * @param searchValue
      * @return
      */
-    private OwnerDto queryByOwnerName(String communityId, String searchValue) {
-
+    private OwnerDto queryByOwnerName(String communityId, String searchValue, String userId) {
         OwnerDto ownerDto = new OwnerDto();
         ownerDto.setCommunityId(communityId);
         ownerDto.setName(searchValue);
         ownerDto.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_OWNER);
         List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto);
         Assert.listOnlyOne(ownerDtos, "未找到业主信息或者查询到多条,请换其他条件查询");
-        OwnerDto resOwnerDto = ownerDtos.get(0);
+        //查询是否有脱敏权限
+        List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
+        List<OwnerDto> ownerDtoList = new ArrayList<>();
+        for (OwnerDto owner : ownerDtos) {
+            //对业主身份证号隐藏处理
+            String idCard = owner.getIdCard();
+            if (mark.size() == 0 && idCard != null && !idCard.equals("")) {
+                idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16);
+            }
+            //对业主手机号隐藏处理
+            String link = owner.getLink();
+            if (mark.size() == 0 && link != null && !link.equals("")) {
+                link = link.substring(0, 3) + "****" + link.substring(7);
+            }
+            owner.setIdCard(idCard);
+            owner.setLink(link);
+            ownerDtoList.add(owner);
+        }
+        OwnerDto resOwnerDto = ownerDtoList.get(0);
         OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
-        ownerRoomRelDto.setOwnerId(ownerDtos.get(0).getOwnerId());
+        ownerRoomRelDto.setOwnerId(ownerDtoList.get(0).getOwnerId());
         List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
 
         //没有房屋
@@ -316,7 +430,7 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
      * @param searchValue
      * @return
      */
-    private OwnerDto queryByRoom(String communityId, String searchValue) {
+    private OwnerDto queryByRoom(String communityId, String searchValue, String userId) {
 
         if (!searchValue.contains("-")) {
             throw new IllegalArgumentException("查询内容格式错误,请输入 楼栋-单元-房屋 如 1-1-1");
@@ -335,7 +449,6 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
         roomDto.setCommunityId(communityId);
 
         List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
-
         Assert.listOnlyOne(roomDtos, "未找到房屋信息");
 
         OwnerDto ownerDto = new OwnerDto();
@@ -343,15 +456,43 @@ public class ComprehensiveQueryImpl implements IComprehensiveQuery {
         ownerDto.setRoomId(roomDtos.get(0).getRoomId());
         ownerDto.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_OWNER);
         List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto);
-
         Assert.listOnlyOne(ownerDtos, "未找到业主信息");
+        //查询是否有脱敏权限
+        List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
+        List<OwnerDto> ownerDtoList = new ArrayList<>();
+        for (OwnerDto owner : ownerDtos) {
+            //对业主身份证号隐藏处理
+            String idCard = owner.getIdCard();
+            if (mark.size() == 0 && idCard != null && !idCard.equals("")) {
+                idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16);
+            }
+            //对业主手机号隐藏处理
+            String link = owner.getLink();
+            if (mark.size() == 0 && link != null && !link.equals("")) {
+                link = link.substring(0, 3) + "****" + link.substring(7);
+            }
+            owner.setIdCard(idCard);
+            owner.setLink(link);
+            ownerDtoList.add(owner);
+        }
 
-        OwnerDto resOwnerDto = ownerDtos.get(0);
+        OwnerDto resOwnerDto = ownerDtoList.get(0);
 
         resOwnerDto.setRooms(roomDtos);
 
         return resOwnerDto;
     }
 
-
+    /**
+     * 脱敏处理
+     *
+     * @return
+     */
+    public List<Map> getPrivilegeOwnerList(String resource, String userId) {
+        BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto();
+        basePrivilegeDto.setResource(resource);
+        basePrivilegeDto.setUserId(userId);
+        List<Map> privileges = menuInnerServiceSMOImpl.checkUserHasResource(basePrivilegeDto);
+        return privileges;
+    }
 }