Authored by qinchao

绑定的支付宝信息 html

... ... @@ -9,6 +9,7 @@ import com.yoho.ufo.service.model.ApiResponse;
import com.yoho.ufo.service.model.PageResponseBO;
import com.yohobuy.ufo.model.order.req.ManualDealRequest;
import com.yohobuy.ufo.model.order.resp.TradeBillsResp;
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -16,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
@RestController
@RequestMapping(value = "/tradeBills")
public class TradeBillsController {
... ... @@ -36,6 +39,29 @@ public class TradeBillsController {
}
/**
* 根据uid
* 获取绑定的支付宝
*/
@RequestMapping(value = "/queryAuthorizeInfoList")
public ApiResponse queryAuthorizeInfoList(TradeBillsReq req ) {
Integer uid = req.getUid();
LOGGER.info("queryAuthorizeInfoList in. uid is {}", uid);
PageResponseBO<AuthorizeResultRespVO> result = null;
result = null;
if(uid!=null&&uid>0){
AuthorizeResultRespVO info = billsTradeService.queryAuthorizeInfoByUid(uid);
if(info!=null&&info.getUid()>0){
result = new PageResponseBO();
result.setPage(req.getPage());
result.setSize(req.getSize());
result.setTotal(1);
result.setList(Arrays.asList(info));
}
}
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
}
/**
* 人工退款
* @param req
* @return
... ...
... ... @@ -6,11 +6,14 @@ import com.yoho.order.model.TradeBillsReq;
import com.yoho.ufo.order.response.StoredSellerRespVo;
import com.yoho.ufo.service.model.PageResponseBO;
import com.yohobuy.ufo.model.order.resp.TradeBillsResp;
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
public interface ITradeBillsService {
PageResponseBO<TradeBillsResp> queryTradeBillsList(TradeBillsReq req);
AuthorizeResultRespVO queryAuthorizeInfoByUid(Integer uid);
/**
*
* @param req
... ...
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,26 @@ 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.setAlipayAccount(data.containsKey("alipayAccount")?StringUtils.defaultString(data.getString("alipayAccount")):"");
result.setAlipayMaskAccount(data.containsKey("alipayMaskAccount")?StringUtils.defaultString(data.getString("alipayMaskAccount")):"");
result.setAlipayId(data.containsKey("alipayId")?StringUtils.defaultString(data.getString("alipayId")):"");
result.setCreateTimeStr(data.containsKey("createTime")?DateUtil.long2DateStr(data.getLong("createTime")*1000, "yyyy-MM-dd HH:mm:ss"):"-");
}
}
return result;
}
private List<TradeBillsResp> convertToResp(List<TradeBills> tradeBillsList){
List<TradeBillsResp> respList = Lists.newArrayList();
... ... @@ -279,12 +301,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"))){
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js"></script>
</head>
<body class="easyui-layout">
<input type="hidden" id="buyerOrderCode">
<input type="skup" id="skup">
<div region="north" style="height:230px;">
<script>
document.write(addHead('打款管理', '支付宝绑定信息'));
</script>
<div style="padding:20px;">
<label>UID:</label>
<input id="uid" type="text" class="easyui-textbox" style="width:150px"/>
<a id="searchBtn" class="btn-info">查询</a>
</div>
</div>
<div region="center">
<table id="authorizeInfoListTable"></table>
</div>
<script>
$(function() {
$("#searchBtn").linkbutton({
iconCls : "icon-search",
onClick : function() {
loadAuthorizeInfoData();
}
});
getAuthorizeInfoList(null);
});
function loadAuthorizeInfoData() {
var uid = $("#uid").val();
if(!uid){
$.messager.alert("提示", "请输入查询条件uid", "warning");
return;
}
$("#authorizeInfoListTable").datagrid("load", {
uid : $("#uid").val()
});
}
function getAuthorizeInfoList(param){
$("#authorizeInfoListTable").myDatagrid({
fit: true,
fitColumns: true,
striped: true,
url: contextPath + "/tradeBills/queryAuthorizeInfoList",
method: 'POST',
queryParams: param,
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp=null==temp?[]:temp;
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "用户uid",
field: "uid",
width: 30,
align: "center"
},{
title: "支付宝账号",
field: "alipayMaskAccount",
width: 30,
align: "center"
} ,{
title: "支付宝payid",
field: "alipayId",
width: 20,
align: "center"
},{
title: "创建时间",
field: "createTimeStr",
width: 20,
align: "center"
}, {
title: "操作",
field: "asdf",
width: 40,
align: "center",
formatter: function (value, rowData, rowIndex) {
if (rowData.tradeStatus != 100) {
var btn= "解绑";
return btn;
}
}
}]],
cache: false,
pagination: true,
idField: "id",
singleSelect: true,
onLoadSuccess: function (data) {
//$(this).datagrid("getPanel").find("a[role='refundsConfirm']").linkbutton({});
}
});
}
</script>
</body>
</html>
\ No newline at end of file
... ...