|
|
@ -14,6 +14,8 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.feign.ResultDataResolver; |
|
|
|
import com.epmet.commons.tools.redis.RedisKeys; |
|
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
|
import com.epmet.commons.tools.security.dto.GovTokenDto; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.security.password.PasswordUtils; |
|
|
@ -73,6 +75,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol |
|
|
|
private EpmetMessageOpenFeignClient messageOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private LoginUserUtil loginUserUtil; |
|
|
|
@Autowired |
|
|
|
private RedisUtils redisUtils; |
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
@ -669,6 +673,11 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol |
|
|
|
* @author zxc |
|
|
|
*/ |
|
|
|
public PaCustomerDTO getCustomerInfo(String appId){ |
|
|
|
String redisKey = RedisKeys.getThirdCustomerInfoByAppId(appId); |
|
|
|
PaCustomerDTO customer = (PaCustomerDTO) redisUtils.get(redisKey); |
|
|
|
if (customer != null && StringUtils.isNotBlank(customer.getId())){ |
|
|
|
return customer; |
|
|
|
} |
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
String data = HttpClientManager.getInstance().sendPostByJSON(AuthHttpUrlConstant.CUSTOMER_MSG_URL + appId, JSON.toJSONString(jsonObject)).getData(); |
|
|
|
logger.info("ThirdLoginServiceImpl.getCustomerInfo:httpclient->url:"+AuthHttpUrlConstant.CUSTOMER_MSG_URL+",结果->"+data); |
|
|
@ -684,8 +693,9 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol |
|
|
|
Object PublicCustomerResultDTO = mapToResult.getData(); |
|
|
|
JSONObject json = JSON.parseObject(PublicCustomerResultDTO.toString()); |
|
|
|
Map<String,Object> map = (Map)json.get("customer"); |
|
|
|
PaCustomerDTO customer = ConvertUtils.mapToEntity(map, PaCustomerDTO.class); |
|
|
|
customer = ConvertUtils.mapToEntity(map, PaCustomerDTO.class); |
|
|
|
logger.info("小程序登陆third服务获取客户用户信息PaCustomerDTO->"+customer); |
|
|
|
redisUtils.set(redisKey,customer); |
|
|
|
return customer; |
|
|
|
} |
|
|
|
|
|
|
|