|
|
package com.yoho.ufo.order.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.cache.Cache;
|
|
|
import com.google.common.cache.CacheBuilder;
|
...
|
...
|
@@ -20,6 +21,7 @@ import com.yoho.ufo.util.KeyWordHiddenUtil; |
|
|
import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum;
|
|
|
import com.yohobuy.ufo.model.order.resp.TradeBillsResp;
|
|
|
import com.yohobuy.ufo.model.user.req.AuthorizeInfoReq;
|
|
|
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.elasticsearch.common.collect.Lists;
|
...
|
...
|
@@ -224,6 +226,28 @@ public class TradeBillsServiceImpl implements ITradeBillsService { |
|
|
return result;
|
|
|
}
|
|
|
|
|
|
public AuthorizeResultRespVO queryAuthorizeInfoByUid(Integer uid){
|
|
|
if(uid==null||uid<=0){
|
|
|
return null;
|
|
|
}
|
|
|
AuthorizeResultRespVO result = null;
|
|
|
JSONObject jsonObject = asyncCallQueryAliAccountJsonObject(uid);
|
|
|
if(jsonObject!=null&&200==jsonObject.getIntValue("code")){
|
|
|
JSONObject data=jsonObject.getJSONObject("data");
|
|
|
if(data!=null){
|
|
|
result = new AuthorizeResultRespVO();
|
|
|
result.setUid(data.getInteger("uid"));
|
|
|
result.setAlipayId(data.containsKey("alipayUid")?StringUtils.defaultString(data.getString("alipayUid")):"");
|
|
|
result.setCreateTimeStr(data.containsKey("createTime")?DateUtil.long2DateStr(data.getLong("createTime")*1000, "yyyy-MM-dd HH:mm:ss"):"-");
|
|
|
if(StringUtils.isBlank(result.getAlipayId())){
|
|
|
result.setAlipayAccount(data.containsKey("alipayAccount")?StringUtils.defaultString(data.getString("alipayAccount")):"");
|
|
|
result.setAlipayMaskAccount(KeyWordHiddenUtil.hiddenKeyWord(result.getAlipayAccount(),3,3));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
private List<TradeBillsResp> convertToResp(List<TradeBills> tradeBillsList){
|
|
|
List<TradeBillsResp> respList = Lists.newArrayList();
|
...
|
...
|
@@ -279,12 +303,18 @@ public class TradeBillsServiceImpl implements ITradeBillsService { |
|
|
}
|
|
|
}
|
|
|
|
|
|
private String asyncCallQueryAliAccount(Integer uid) {
|
|
|
|
|
|
private JSONObject asyncCallQueryAliAccountJsonObject(Integer uid) {
|
|
|
AuthorizeInfoReq req=new AuthorizeInfoReq();
|
|
|
req.setUid(uid);
|
|
|
JSONObject jsonObject = serviceCaller.asyncCall("userRealNameAuthorize.getAliPayAccount", req, JSONObject.class).get(1);
|
|
|
LOGGER.info("call ufo-RealNameAuthorize4PlatformController userRealNameAuthorize.getAliPayAccount interface is {}, result is {}", jsonObject.toJSONString());
|
|
|
if(200==jsonObject.getIntValue("code")){
|
|
|
LOGGER.info("call ufo-RealNameAuthorize4PlatformController userRealNameAuthorize.getAliPayAccount interface is {}, result is {}", JSON.toJSONString(jsonObject));
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
private String asyncCallQueryAliAccount(Integer uid) {
|
|
|
JSONObject jsonObject = asyncCallQueryAliAccountJsonObject(uid);
|
|
|
if(jsonObject!=null&&200==jsonObject.getIntValue("code")){
|
|
|
JSONObject data=jsonObject.getJSONObject("data");
|
|
|
if(data!=null){
|
|
|
if(data.get("alipayUid")!=null&&StringUtils.isNotBlank(data.getString("alipayUid"))){
|
...
|
...
|
|