diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java index a23b38f95d..e1e2753ba4 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java @@ -8,10 +8,7 @@ import com.epmet.dto.form.CreatedTimeByUserIdFormDTO; import com.epmet.dto.form.StaffRoleFormDTO; import com.epmet.dto.form.UserResiInfoFormDTO; import com.epmet.dto.form.UserResiInfoListFormDTO; -import com.epmet.dto.result.CertifiedResultDTO; -import com.epmet.dto.result.CreatedTimeByUserIdResultDTO; -import com.epmet.dto.result.GovStaffRoleResultDTO; -import com.epmet.dto.result.UserResiInfoResultDTO; +import com.epmet.dto.result.*; import com.epmet.modules.feign.fallback.EpmetUserFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -89,4 +86,7 @@ public interface EpmetUserFeignClient { */ @PostMapping("/epmetuser/staffrole/staffsinrole") Result> getStaffsInRole(@RequestBody StaffRoleFormDTO staffRoleFormDTO); + + @PostMapping("/epmetuser/userrole/sgetresidentrole") + Result getUserResidentRole(@RequestBody UserResiInfoFormDTO formDTO); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index eae2c74317..1b52c7e1cc 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -565,8 +565,11 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO(); userResiInfoFormDTO.setCustomerId(partyMemberInfoDTO.getCustomerId()); userResiInfoFormDTO.setUserId(partyMemberInfoDTO.getUserId()); - Result userResiInfoResult = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO); - if (userResiInfoResult.success() && null == userResiInfoResult.getData()) { + Result residentRoleResult = epmetUserFeignClient.getUserResidentRole(userResiInfoFormDTO); + if (!residentRoleResult.success()) { + throw new RenException(residentRoleResult.getCode(), residentRoleResult.getMsg()); + } + if (residentRoleResult.success() && null == residentRoleResult.getData()) { UserResiInfoDTO userResiInfoDTO = ConvertUtils.sourceToTarget(partyMemberInfoDTO, UserResiInfoDTO.class); userResiInfoDTO.setRegMobile(partyMemberInfoDTO.getMobile()); userResiInfoDTO.setResiVisitId(partyMemberInfoDTO.getPartymemberVisitId()); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java index 8178a62abe..c09bb905f2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.UserRoleDTO; +import com.epmet.dto.form.UserResiInfoFormDTO; import com.epmet.dto.form.UserRoleFormDTO; import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.excel.UserRoleExcel; @@ -143,4 +144,9 @@ public class UserRoleController { public Result selectIsPartyMemberByUserId(@RequestParam("userId") String userId){ return new Result().ok(userRoleService.selectIsPartyMemberByUserId(userId)); } + + @PostMapping("getresidentrole") + public Result getUserResidentRole(@RequestBody UserResiInfoFormDTO formDTO) { + return new Result().ok(userRoleService.getUserResidentRole(formDTO.getCustomerId(), formDTO.getUserId())); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java index ccd35bd999..dea59dfff7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java @@ -89,4 +89,14 @@ public interface UserRoleDao extends BaseDao { * @date 2021/4/19 下午4:29 */ Integer selectIsPartyMemberByUserId(@Param("userId")String userId); + + /** + * 获取居民权限 + * @author zhaoqifeng + * @date 2021/4/22 10:44 + * @param customerId + * @param userId + * @return java.util.List + */ + UserRoleResultDTO selectResidentRole(@Param("customerId") String customerId, @Param("userId") String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserRoleService.java index c33b13d019..ae47c9291a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserRoleService.java @@ -130,4 +130,14 @@ public interface UserRoleService extends BaseService { * @date 2021/4/19 下午4:34 */ Boolean selectIsPartyMemberByUserId(String userId); + + /** + * 获取用户居民权限 + * @author zhaoqifeng + * @date 2021/4/22 10:48 + * @param customerId + * @param userId + * @return com.epmet.dto.result.UserRoleResultDTO + */ + UserRoleResultDTO getUserResidentRole(String customerId, String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java index 7efb353bcb..0647fad64a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java @@ -154,4 +154,18 @@ public class UserRoleServiceImpl extends BaseServiceImpl +