|
|
@ -221,8 +221,6 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService { |
|
|
|
//2.用户不存在时不允许登陆
|
|
|
|
Map<String,Object> map1 = (Map)jsonObject.get("paUserResult"); |
|
|
|
PaUserDTO userDTO = ConvertUtils.mapToEntity(map1, PaUserDTO.class); |
|
|
|
logger.info("map1的值:"+map1); |
|
|
|
logger.info("userDTO的值:"+userDTO); |
|
|
|
if (null == userDTO || StringUtils.isBlank(userDTO.getId())) { |
|
|
|
throw new RenException(EpmetErrorCode.PUBLIC_NOT_EXISTS.getCode()); |
|
|
|
} |
|
|
@ -240,7 +238,6 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService { |
|
|
|
String token = this.generateGovWxmpToken(userDTO.getId()); |
|
|
|
//4-2.判断是否存在信息,给customerId赋值
|
|
|
|
Map<String,Object> map2 = (Map)jsonObject.get("paCustomerResult"); |
|
|
|
logger.info("map2的值:"+map2); |
|
|
|
PaCustomerDTO customerDTO = ConvertUtils.mapToEntity(map2, PaCustomerDTO.class); |
|
|
|
String customerId = ""; |
|
|
|
if (null != customerDTO && !StringUtils.isBlank(customerDTO.getId())) { |
|
|
@ -248,7 +245,6 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService { |
|
|
|
} |
|
|
|
//4-3.token存入redis
|
|
|
|
Map<String,Object> map3 = (Map)jsonObject.get("paUserWechatResult"); |
|
|
|
logger.info("map3的值:"+map3); |
|
|
|
PaUserWechatDTO wechatDTO = ConvertUtils.mapToEntity(map3, PaUserWechatDTO.class); |
|
|
|
String openid = wechatDTO.getWxOpenId(); |
|
|
|
String unionId = (null == wechatDTO.getUnionId() ? "" : wechatDTO.getUnionId()); |
|
|
@ -283,16 +279,13 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService { |
|
|
|
public UserTokenResultDTO register(RegisterFormDTO formDTO) { |
|
|
|
//1.调用epmet-third服务,完成信息注册
|
|
|
|
String data = HttpClientManager.getInstance().sendPostByJSON(AuthHttpUrlConstant.REGISTER_URL, JSON.toJSONString(formDTO)).getData(); |
|
|
|
logger.info("data数据为:"+data); |
|
|
|
JSONObject toResult = JSON.parseObject(data); |
|
|
|
Result result = ConvertUtils.mapToEntity(toResult, Result.class); |
|
|
|
logger.info("转换的result结果为:"+result); |
|
|
|
if (!result.success()) { |
|
|
|
logger.error(String.format("调用epmet_third服务初始化用户信息失败,数据来源[%s],手机号[%s],userId:[%S]", formDTO.getSource(), formDTO.getPhone(), formDTO.getUserId())); |
|
|
|
throw new RenException(result.getCode()); |
|
|
|
} |
|
|
|
Object RegisterResult = result.getData(); |
|
|
|
logger.info("getData()数据为:"+RegisterResult); |
|
|
|
JSONObject jsonObject = JSON.parseObject(RegisterResult.toString()); |
|
|
|
RegisterResultDTO resultDTO = ConvertUtils.mapToEntity(jsonObject, RegisterResultDTO.class); |
|
|
|
|
|
|
|