|
|
|
@ -766,39 +766,27 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
@Override |
|
|
|
public Result<EpdcAppAuthorizationDTO> completeUserInfo(TokenDto tokenDto, EpdcCompleteUserInfoFormDTO infoDto) { |
|
|
|
|
|
|
|
// 验证手机号
|
|
|
|
this.checkSmsCode(infoDto.getMobile(), infoDto.getSmsCode()); |
|
|
|
|
|
|
|
UserDTO userDto = ConvertUtils.sourceToTarget(infoDto, UserDTO.class); |
|
|
|
// 姓名身份证号去除特殊字符
|
|
|
|
userDto.setRealName(ModuleUtils.replaceIllegalCharacter(infoDto.getRealName())); |
|
|
|
userDto.setIdentityNo(ModuleUtils.replaceIllegalCharacter(infoDto.getIdentityNo())); |
|
|
|
|
|
|
|
userDto.setDeptId(Long.valueOf(infoDto.getGridId())); |
|
|
|
userDto.setDeptId(infoDto.getGridId()); |
|
|
|
userDto.setId(tokenDto.getUserId()); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(infoDto.getWxCode())) { |
|
|
|
String sessionKey = this.getUserSessionKey(infoDto.getWxCode()); |
|
|
|
WxMaUserInfo wxMaUserInfo = wxMaServiceUtils.normalWxMaService().getUserService().getUserInfo(sessionKey, infoDto.getEncryptedData(), infoDto.getIv()); |
|
|
|
if (StringUtils.isBlank(wxMaUserInfo.getUnionId())) { |
|
|
|
return new Result().error("解析微信开放平台ID失败"); |
|
|
|
} |
|
|
|
userDto.setWxUnionId(wxMaUserInfo.getUnionId()); |
|
|
|
} |
|
|
|
|
|
|
|
// 党员提交,验证身份证号
|
|
|
|
String identityNo = ModuleUtils.replaceIllegalCharacter(infoDto.getIdentityNo()); |
|
|
|
if (YesOrNoEnum.YES.value().equals(userDto.getPartyFlag())) { |
|
|
|
String identityNo = userDto.getIdentityNo(); |
|
|
|
if (StringUtils.isBlank(identityNo)) { |
|
|
|
return new Result().error("身份证号不能为空"); |
|
|
|
} else { |
|
|
|
String verification = IdentityNoUtils.IdentityNoVerification(identityNo); |
|
|
|
if (StringUtils.isNotBlank(verification)) { |
|
|
|
return new Result().error(verification); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
userDto.setIdentityNo(null); |
|
|
|
String verification = IdentityNoUtils.IdentityNoVerification(identityNo); |
|
|
|
if (StringUtils.isNotBlank(verification)) { |
|
|
|
return new Result().error(verification); |
|
|
|
} |
|
|
|
userDto.setIdentityNo(identityNo); |
|
|
|
} |
|
|
|
// 验证手机号
|
|
|
|
this.checkSmsCode(userDto.getMobile(), infoDto.getSmsCode()); |
|
|
|
|
|
|
|
// 验证用户提交的信息
|
|
|
|
Result<String> verifyResult = userFeignClient.verifyUserCompleteData(userDto); |
|
|
|
if (!verifyResult.success()) { |
|
|
|
@ -806,6 +794,15 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
} |
|
|
|
String userState = verifyResult.getData(); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(infoDto.getWxCode())) { |
|
|
|
String sessionKey = this.getUserSessionKey(infoDto.getWxCode()); |
|
|
|
WxMaUserInfo wxMaUserInfo = wxMaServiceUtils.normalWxMaService().getUserService().getUserInfo(sessionKey, infoDto.getEncryptedData(), infoDto.getIv()); |
|
|
|
if (StringUtils.isBlank(wxMaUserInfo.getUnionId())) { |
|
|
|
return new Result().error("解析微信开放平台ID失败"); |
|
|
|
} |
|
|
|
userDto.setWxUnionId(wxMaUserInfo.getUnionId()); |
|
|
|
} |
|
|
|
|
|
|
|
UserGridRelationDTO userGrid = this.packageUserGridRelationInfo(infoDto.getGridId()); |
|
|
|
EpdcCompleteAppUserDTO completeAppUserDto = ConvertUtils.sourceToTarget(userDto, EpdcCompleteAppUserDTO.class); |
|
|
|
completeAppUserDto = this.packageUserCompleteInfo(completeAppUserDto, userState); |
|
|
|
@ -844,7 +841,6 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
formDto.setState(GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); |
|
|
|
|
|
|
|
groupFeignClient.updateUserPartyMember(formDto); |
|
|
|
// groupTask.updateUserPartyMember(formDto);
|
|
|
|
} |
|
|
|
|
|
|
|
return new Result().ok(authorizationDto); |
|
|
|
|