|
|
|
@ -815,6 +815,11 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
return new Result().error("解析微信开放平台ID失败"); |
|
|
|
} |
|
|
|
userDto.setWxUnionId(wxMaUserInfo.getUnionId()); |
|
|
|
//检验志愿者去哪儿 和 居民端 用户重复问题
|
|
|
|
String userId = this.checkRepeatUser(wxMaUserInfo); |
|
|
|
if(StringUtils.isNotBlank(userId)){ |
|
|
|
userDto.setId(userId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 党员提交,验证身份证号
|
|
|
|
@ -898,6 +903,28 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
//获取用户认证网格ID - 积分使用 - end
|
|
|
|
return new Result().ok(authorizationDto); |
|
|
|
} |
|
|
|
/** |
|
|
|
* @Description 检验用户重复问题,并返回合并后的userId |
|
|
|
* @Author songyunpeng |
|
|
|
* @Date 2021/4/9 |
|
|
|
* @Param [wxMaUserInfo] |
|
|
|
* @return void |
|
|
|
**/ |
|
|
|
private String checkRepeatUser(WxMaUserInfo wxMaUserInfo) { |
|
|
|
String unionId = wxMaUserInfo.getUnionId(); |
|
|
|
String openId = wxMaUserInfo.getOpenId(); |
|
|
|
if(StringUtils.isBlank(unionId) || StringUtils.isBlank(openId)){ |
|
|
|
return ""; |
|
|
|
} |
|
|
|
CheckRepeatUserFormDTO checkRepeatUserFormDTO = new CheckRepeatUserFormDTO(); |
|
|
|
checkRepeatUserFormDTO.setOpenId(openId); |
|
|
|
checkRepeatUserFormDTO.setUnionId(unionId); |
|
|
|
Result<String> userIdResult = userFeignClient.checkRepeatUser(checkRepeatUserFormDTO); |
|
|
|
if(userIdResult.success()){ |
|
|
|
userIdResult.getData(); |
|
|
|
} |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<EpdcCompleteUserInfoDTO> prepareCompleteUserInfo(TokenDto tokenDto) { |
|
|
|
@ -1378,6 +1405,11 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
} |
|
|
|
userDto.setWxUnionId(wxMaUserInfo.getUnionId()); |
|
|
|
userDto.setFaceImg(wxMaUserInfo.getAvatarUrl()); |
|
|
|
//检验志愿者去哪儿 和 居民端 用户重复问题
|
|
|
|
String unionUserId = this.checkRepeatUser(wxMaUserInfo); |
|
|
|
if(StringUtils.isNotBlank(unionUserId)){ |
|
|
|
userDto.setId(unionUserId); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
EpdcCompleteAppUserDTO completeAppUserDto = ConvertUtils.sourceToTarget(userDto, EpdcCompleteAppUserDTO.class); |
|
|
|
@ -1419,7 +1451,12 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
@Override |
|
|
|
public Result<String> getUserWxPhone(EpdcAppUserMaInfoFormDTO formDto) { |
|
|
|
try { |
|
|
|
WxMaService wxMaService = wxMaServiceUtils.normalWxMaService(); |
|
|
|
WxMaService wxMaService; |
|
|
|
if(StringUtils.isNotBlank(formDto.getType()) && "volunteer".equals(formDto.getType())){ |
|
|
|
wxMaService = wxMaServiceUtils.volunteerWxMaService(); |
|
|
|
} else { |
|
|
|
wxMaService = wxMaServiceUtils.normalWxMaService(); |
|
|
|
} |
|
|
|
WxMaJscode2SessionResult wxMaJscode2SessionResult = wxMaService.jsCode2SessionInfo(formDto.getWxCode()); |
|
|
|
WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(wxMaJscode2SessionResult.getSessionKey(), formDto.getEncryptedData(), formDto.getIv()); |
|
|
|
if (null != phoneNoInfo) { |
|
|
|
|