|
|
@ -1197,6 +1197,22 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
return userResult.getData(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 校验用身份证号码 |
|
|
|
* |
|
|
|
* @param identityNo 身份证号码 |
|
|
|
* @param partyFlag 是否党员,非党员身份证号码置空 |
|
|
|
* @return java.lang.String 身份证号码 |
|
|
|
* @author work@yujt.net.cn |
|
|
|
* @date 2020/3/12 19:16 |
|
|
|
*/ |
|
|
|
private String fixAndCheckIdentityNo(String identityNo, String partyFlag) { |
|
|
|
if (YesOrNoEnum.NO.value().equals(partyFlag)) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
return fixAndCheckIdentityNo(identityNo); |
|
|
|
} |
|
|
|
|
|
|
|
private String fixAndCheckIdentityNo(String identityNo) { |
|
|
|
identityNo = ModuleUtils.replaceIllegalCharacter(identityNo); |
|
|
|
if (StringUtils.isBlank(identityNo)) { |
|
|
@ -1370,4 +1386,32 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
} |
|
|
|
return new Result().error("解析用户手机号失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<EpdcAppAuthorizationDTO> completeUserInfo(TokenDto tokenDto, EpdcCompleteUserInfoFormV2DTO infoDto) { |
|
|
|
// 验证身份证号格式,身份证号码字符串校正
|
|
|
|
String identityNo = fixAndCheckIdentityNo(infoDto.getIdentityNo(), infoDto.getPartyFlag()); |
|
|
|
infoDto.setIdentityNo(identityNo); |
|
|
|
|
|
|
|
Result<UserDTO> completeResult = completeUserInfoCore(tokenDto, infoDto); |
|
|
|
UserDTO user = completeResult.getData(); |
|
|
|
|
|
|
|
// 更新用户缓存信息
|
|
|
|
Result<CachingUserInfoDTO> cachingUserResult = userFeignClient.needCachingUserInfoByUserId(tokenDto.getUserId()); |
|
|
|
CachingUserInfoDTO cachingUserInfoDTO = cachingUserResult.getData(); |
|
|
|
EpdcAppAuthorizationDTO authorizationDto = cachingUserInfoForAuthorization(cachingUserInfoDTO, user.getGrid(), user.getState()); |
|
|
|
|
|
|
|
// 党员认证失败
|
|
|
|
if (100006001 == completeResult.getCode()) { |
|
|
|
authorizationDto.setResultCode(YesOrNoEnum.YES.value()); |
|
|
|
authorizationDto.setResultMsg(completeResult.getMsg()); |
|
|
|
return new Result().ok(authorizationDto); |
|
|
|
} |
|
|
|
// 更新社群用户党员标识并加入关联的所有网格党员群
|
|
|
|
boolean partyFlag = UserTagUtils.containIdentity(cachingUserInfoDTO.getUserTagInfos(), UserTagEnum.PARTY_MEMBER); |
|
|
|
if (partyFlag) { |
|
|
|
initPartyGroupInfo(cachingUserInfoDTO); |
|
|
|
} |
|
|
|
return new Result().ok(authorizationDto); |
|
|
|
} |
|
|
|
} |
|
|
|