Authored by caoyan

Merge branch 'test6.9.5' of http://git.yoho.cn/ufo/ufo-platform into test6.9.5

... ... @@ -23,5 +23,5 @@ public interface SaleCategoryMapper {
List<SaleCategory> selectAll();
List<SaleCategory> selectByPidAndOrderBy(@Param("pid") Integer pid, @Param("orderBy") Integer orderBy);
}
... ...
... ... @@ -65,6 +65,10 @@
select <include refid="Base_Column_List" />
from sale_category where id = #{id}
</select>
<select id="selectByPidAndOrderBy" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from sale_category where parent_id = #{pid} and order_by=#{orderBy}
</select>
<select id="selectByNameAndParentId" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
... ...
... ... @@ -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,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"))){
... ...
... ... @@ -84,6 +84,9 @@ public class SaleCategoryServiceImpl implements ISaleCategoryService {
// 一级层级
saleCategory.setLevel(PRODUCT_SORT_LEVEL_1);
saleCategory.setParentId(TOP_PARENT_ID);
if (!saleCategoryMapper.selectByPidAndOrderBy(TOP_PARENT_ID, saleCategory.getOrderBy()).isEmpty()) {
throw new CommonException(201, "排序已存在:" + saleCategory.getOrderBy());
}
if(StringUtils.equals(saleCategoryResponseBo.getLinkType(), "on")) {
saleCategory.setLinkType("series");
} else {
... ... @@ -95,6 +98,9 @@ public class SaleCategoryServiceImpl implements ISaleCategoryService {
if(saleCategoryParent==null){
throw new CommonException(201, "父类销售类目找不到!");
}
if (!saleCategoryMapper.selectByPidAndOrderBy(saleCategory.getParentId(), saleCategory.getOrderBy()).isEmpty()) {
throw new CommonException(201, "排序已存在:" + saleCategory.getOrderBy());
}
saleCategory.setLevel(saleCategoryParent.getLevel()+1);
}
saleCategory.setStatus(1);//新创建的默认为“关闭”
... ... @@ -113,6 +119,12 @@ public class SaleCategoryServiceImpl implements ISaleCategoryService {
if(db_saleCategory==null){
throw new CommonException(201, "找不到销售类目!");
}
List<SaleCategory> exists = saleCategoryMapper.selectByPidAndOrderBy(db_saleCategory.getParentId(), saleCategory.getOrderBy());
if (exists.size() > 1 || (exists.size() == 1 && !exists.get(0).getId().equals(saleCategory.getId()))) {
throw new CommonException(201, "排序已存在:" + saleCategory.getOrderBy());
}
db_saleCategory.setCategoryName(saleCategory.getCategoryName());
db_saleCategory.setOrderBy(saleCategory.getOrderBy());
db_saleCategory.setImageUrl(saleCategory.getImageUrl());
... ...
<!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
... ...