Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
ufo-platform
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
qinchao
6 years ago
Commit
bb6fee09f0493b05980f57455e338db5fc9b4b60
1 parent
8cd27a92
新功能:人工打款
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
579 additions
and
0 deletions
dal/src/main/java/com/yoho/order/dal/TradeBillsMapper.java
dal/src/main/java/com/yoho/order/model/TradeBills.java
dal/src/main/java/com/yoho/order/model/TradeBillsReq.java
dal/src/main/resources/META-INF/mybatis/TradeBillsMapper.xml
order/src/main/java/com/yoho/ufo/order/constant/TradeStatusEnum.java
order/src/main/java/com/yoho/ufo/order/controller/TradeBillsController.java
order/src/main/java/com/yoho/ufo/order/service/ITradeBillsService.java
order/src/main/java/com/yoho/ufo/order/service/impl/TradeBillsServiceImpl.java
web/src/main/resources/databases.yml
web/src/main/webapp/META-INF/autoconf/databases.yml
web/src/main/webapp/html/billsManage/list.html
dal/src/main/java/com/yoho/order/dal/TradeBillsMapper.java
0 → 100644
View file @
bb6fee0
package
com
.
yoho
.
order
.
dal
;
import
com.yoho.order.model.TradeBillsReq
;
import
com.yoho.order.model.TradeBills
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* Created by craig.qin on 2018/9/12.
*/
public
interface
TradeBillsMapper
{
int
selectCountByCondition
(
@Param
(
"billsTradeReq"
)
TradeBillsReq
req
);
List
<
TradeBills
>
selectByConditionWithPage
(
@Param
(
"billsTradeReq"
)
TradeBillsReq
req
);
}
...
...
dal/src/main/java/com/yoho/order/model/TradeBills.java
0 → 100644
View file @
bb6fee0
package
com
.
yoho
.
order
.
model
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* 交易流水表
*/
@Data
public
class
TradeBills
{
private
Integer
id
;
private
Integer
uid
;
private
Long
orderCode
;
//1:买家uid; 2:卖家uid
private
Integer
userType
;
//1:支付宝; 2:微信
private
Integer
payType
;
//1:保证金;2:货款;3:补偿款
private
Integer
tradeType
;
//1:用户收入; 2:用户支出
private
Integer
incomeOutcome
;
private
BigDecimal
amount
;
//yoho收入
private
BigDecimal
systemAmount
;
//0:订单未完结;1:订单完结
private
Integer
tradeStatus
;
private
Integer
createTime
;
//手工打款相关字段
//操作员id
private
Integer
dealUid
;
//打款状态:1 表示成功, 现在只有成功的才记录
private
Integer
dealStatus
;
//打款时间
private
Integer
dealTime
;
//打款关联id
private
Integer
dealRelateId
;
@Override
public
String
toString
()
{
return
"TradeBills{"
+
"id="
+
id
+
", uid="
+
uid
+
", orderCode="
+
orderCode
+
", userType="
+
userType
+
", payType="
+
payType
+
", tradeType="
+
tradeType
+
", incomeOutcome="
+
incomeOutcome
+
", amount="
+
amount
+
", systemAmount="
+
systemAmount
+
", tradeStatus="
+
tradeStatus
+
", createTime="
+
createTime
+
", dealUid="
+
dealUid
+
", dealStatus="
+
dealStatus
+
", dealTime="
+
dealTime
+
", dealRelateId="
+
dealRelateId
+
'}'
;
}
}
...
...
dal/src/main/java/com/yoho/order/model/TradeBillsReq.java
0 → 100644
View file @
bb6fee0
package
com
.
yoho
.
order
.
model
;
import
com.yoho.ufo.service.model.PageRequestBO
;
import
java.util.List
;
/**
* Created by craig.qin.
*/
public
class
TradeBillsReq
extends
PageRequestBO
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1620427808531296022L
;
private
Integer
id
;
private
Long
orderCode
;
private
Integer
uid
;
private
String
mobile
;
///// status 并不是表里面的字段,是查询条件:全部、交易正常的订单、交易异常的订单
private
Integer
status
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Long
getOrderCode
()
{
return
orderCode
;
}
public
void
setOrderCode
(
Long
orderCode
)
{
this
.
orderCode
=
orderCode
;
}
public
Integer
getUid
()
{
return
uid
;
}
public
void
setUid
(
Integer
uid
)
{
this
.
uid
=
uid
;
}
public
String
getMobile
()
{
return
mobile
;
}
public
void
setMobile
(
String
mobile
)
{
this
.
mobile
=
mobile
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
@Override
public
String
toString
()
{
return
"TradeBillsReq{"
+
"id="
+
id
+
", orderCode="
+
orderCode
+
", uid="
+
uid
+
", mobile='"
+
mobile
+
'\''
+
", status="
+
status
+
'}'
;
}
}
...
...
dal/src/main/resources/META-INF/mybatis/TradeBillsMapper.xml
0 → 100644
View file @
bb6fee0
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yoho.order.dal.TradeBillsMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yoho.order.model.TradeBills"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"uid"
jdbcType=
"INTEGER"
property=
"uid"
/>
<result
column=
"order_code"
jdbcType=
"BIGINT"
property=
"orderCode"
/>
<result
column=
"user_type"
jdbcType=
"TINYINT"
property=
"userType"
/>
<result
column=
"pay_type"
jdbcType=
"TINYINT"
property=
"payType"
/>
<result
column=
"trade_type"
jdbcType=
"INTEGER"
property=
"tradeType"
/>
<result
column=
"income_outcome"
jdbcType=
"TINYINT"
property=
"incomeOutcome"
/>
<result
column=
"amount"
jdbcType=
"DECIMAL"
property=
"amount"
/>
<result
column=
"system_amount"
jdbcType=
"DECIMAL"
property=
"systemAmount"
/>
<result
column=
"trade_status"
jdbcType=
"TINYINT"
property=
"tradeStatus"
/>
<result
column=
"create_time"
jdbcType=
"INTEGER"
property=
"createTime"
/>
<result
column=
"deal_uid"
jdbcType=
"INTEGER"
property=
"dealUid"
/>
<result
column=
"deal_status"
jdbcType=
"TINYINT"
property=
"dealStatus"
/>
<result
column=
"deal_time"
jdbcType=
"INTEGER"
property=
"dealTime"
/>
<result
column=
"deal_relate_id"
jdbcType=
"INTEGER"
property=
"dealRelateId"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,uid, order_code, user_type,pay_type,trade_type,
income_outcome,amount,system_amount,trade_status,create_time,
deal_uid,deal_status,deal_time,deal_relate_id
</sql>
<sql
id=
"Query_Condition_Sql"
>
<if
test=
"billsTradeReq.orderCode != null"
>
and order_code = #{billsTradeReq.orderCode}
</if>
<if
test=
"billsTradeReq.uid != null"
>
and uid = #{billsTradeReq.uid}
</if>
<if
test=
"billsTradeReq.status != null "
>
<choose>
<when
test=
"billsTradeReq.status == 100 "
>
and trade_status = 100
</when>
<otherwise>
and trade_status != 100 and deal_status != 1
</otherwise>
</choose>
</if>
</sql>
<select
id=
"selectCountByCondition"
resultType=
"java.lang.Integer"
parameterType=
"com.yoho.order.model.BuyerOrderReq"
>
select count(id)
from trade_bills where 1=1
<include
refid=
"Query_Condition_Sql"
/>
</select>
<select
id=
"selectByConditionWithPage"
resultMap=
"BaseResultMap"
parameterType=
"com.yoho.order.model.TradeBillsReq"
>
select
<include
refid=
"Base_Column_List"
/>
from trade_bills where 1=1
<include
refid=
"Query_Condition_Sql"
/>
limit #{billsTradeReq.start},#{billsTradeReq.size}
</select>
</mapper>
\ No newline at end of file
...
...
order/src/main/java/com/yoho/ufo/order/constant/TradeStatusEnum.java
0 → 100644
View file @
bb6fee0
package
com
.
yoho
.
ufo
.
order
.
constant
;
/**
* 交易流水表
* 100:成功;200:失败,201:没有支付宝账号;202:金额不合法;299:转账失败
*/
public
enum
TradeStatusEnum
{
success
(
100
,
"成功"
),
fail_201_no_alipayAccount
(
201
,
"没有支付宝账号"
),
fail_202_invalid_money
(
202
,
"金额不合法"
),
fail_299_transfer_failure
(
299
,
"转账失败"
);
private
Integer
code
;
private
String
desc
;
TradeStatusEnum
(
Integer
code
,
String
desc
){
this
.
code
=
code
;
this
.
desc
=
desc
;
}
public
static
String
getDescByCode
(
Integer
code
){
if
(
code
==
null
){
return
""
;
}
for
(
TradeStatusEnum
item:
TradeStatusEnum
.
values
()){
if
(
code
.
intValue
()
==
item
.
code
.
intValue
()){
return
item
.
desc
;
}
}
return
""
;
}
}
...
...
order/src/main/java/com/yoho/ufo/order/controller/TradeBillsController.java
0 → 100644
View file @
bb6fee0
package
com
.
yoho
.
ufo
.
order
.
controller
;
import
com.yoho.order.model.TradeBillsReq
;
import
com.yoho.ufo.order.service.ITradeBillsService
;
import
com.yoho.ufo.service.model.ApiResponse
;
import
com.yoho.ufo.service.model.PageResponseBO
;
import
com.yohobuy.ufo.model.order.resp.*
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
value
=
"/tradeBills"
)
public
class
TradeBillsController
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
TradeBillsController
.
class
);
@Autowired
private
ITradeBillsService
billsTradeService
;
@RequestMapping
(
value
=
"/queryTradeBillsList"
)
public
ApiResponse
queryTradeBillsList
(
TradeBillsReq
req
)
{
LOGGER
.
info
(
"queryBillsTradeList in. req is {}"
,
req
);
PageResponseBO
<
TradeBillsResp
>
result
=
billsTradeService
.
queryTradeBillsList
(
req
);
return
new
ApiResponse
.
ApiResponseBuilder
().
code
(
200
).
message
(
"查询成功"
).
data
(
result
).
build
();
}
}
...
...
order/src/main/java/com/yoho/ufo/order/service/ITradeBillsService.java
0 → 100644
View file @
bb6fee0
package
com
.
yoho
.
ufo
.
order
.
service
;
import
com.yoho.order.model.TradeBillsReq
;
import
com.yoho.ufo.service.model.PageResponseBO
;
import
com.yohobuy.ufo.model.order.resp.TradeBillsResp
;
public
interface
ITradeBillsService
{
PageResponseBO
<
TradeBillsResp
>
queryTradeBillsList
(
TradeBillsReq
req
);
}
...
...
order/src/main/java/com/yoho/ufo/order/service/impl/TradeBillsServiceImpl.java
0 → 100644
View file @
bb6fee0
package
com
.
yoho
.
ufo
.
order
.
service
.
impl
;
import
com.yoho.core.common.utils.DateUtil
;
import
com.yoho.core.rest.client.ServiceCaller
;
import
com.yoho.order.dal.TradeBillsMapper
;
import
com.yoho.order.model.*
;
import
com.yoho.ufo.order.constant.TradeStatusEnum
;
import
com.yoho.ufo.order.service.ITradeBillsService
;
import
com.yoho.ufo.service.model.PageResponseBO
;
import
com.yohobuy.ufo.model.order.resp.*
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.elasticsearch.common.collect.Lists
;
import
org.elasticsearch.common.collect.Maps
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @author craig.qin
*/
@Service
public
class
TradeBillsServiceImpl
implements
ITradeBillsService
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
TradeBillsServiceImpl
.
class
);
@Autowired
private
ServiceCaller
serviceCaller
;
@Value
(
"${ip.port.uic.server}"
)
private
String
uicServerIpAndPort
;
private
static
final
String
UIC_GETPROFILE_URL
=
"/uic/profile/getProfile"
;
private
static
final
String
UIC_GETUSERPROFILE_URL
=
"/uic/profile/getUserProfile"
;
@Autowired
private
TradeBillsMapper
tradeBillsMapper
;
public
PageResponseBO
<
TradeBillsResp
>
queryTradeBillsList
(
TradeBillsReq
req
)
{
if
(!
checkAndBuildParam
(
req
))
{
return
null
;
}
int
total
=
tradeBillsMapper
.
selectCountByCondition
(
req
);
if
(
total
==
0
)
{
return
null
;
}
List
<
TradeBills
>
tradeBillsList
=
tradeBillsMapper
.
selectByConditionWithPage
(
req
);
if
(
CollectionUtils
.
isEmpty
(
tradeBillsList
))
{
return
null
;
}
List
<
TradeBillsResp
>
respList
=
convertToResp
(
tradeBillsList
);
PageResponseBO
<
TradeBillsResp
>
result
=
new
PageResponseBO
<>();
result
.
setList
(
respList
);
result
.
setPage
(
req
.
getPage
());
result
.
setSize
(
req
.
getSize
());
result
.
setTotal
(
total
);
return
result
;
}
private
boolean
checkAndBuildParam
(
TradeBillsReq
req
){
/*if(req.getUid()==null&&req.getOrderCode()==null&&StringUtils.isBlank(req.getMobile())){
return false;
}*/
return
true
;
}
private
List
<
TradeBillsResp
>
convertToResp
(
List
<
TradeBills
>
tradeBillsList
){
List
<
TradeBillsResp
>
respList
=
Lists
.
newArrayList
();
for
(
TradeBills
item
:
tradeBillsList
)
{
TradeBillsResp
resp
=
new
TradeBillsResp
();
resp
.
setId
(
item
.
getId
());
resp
.
setUid
(
item
.
getUid
());
resp
.
setOrderCode
(
item
.
getOrderCode
());
resp
.
setAmount
(
item
.
getAmount
());
resp
.
setIncomeOutcome
(
item
.
getIncomeOutcome
());
resp
.
setCreateTimeStr
(
null
==
item
.
getCreateTime
()
?
""
:
DateUtil
.
long2DateStr
(
item
.
getCreateTime
().
longValue
()*
1000
,
"yyyy-MM-dd HH:mm:ss"
));
resp
.
setOperatorUid
(
item
.
getDealUid
());
resp
.
setOperatorName
(
item
.
getDealUid
()==
0
?
"系统"
:
"XXX"
);
resp
.
setTradeStatus
(
item
.
getTradeStatus
());
//打款失败原因
if
(
100
!=
item
.
getTradeStatus
()){
String
failReason
=
TradeStatusEnum
.
getDescByCode
(
item
.
getTradeStatus
());
resp
.
setTradeStatusDesc
(
StringUtils
.
isBlank
(
failReason
)?
String
.
valueOf
(
item
.
getTradeStatus
()):
failReason
);
}
respList
.
add
(
resp
);
}
return
respList
;
}
}
...
...
web/src/main/resources/databases.yml
View file @
bb6fee0
...
...
@@ -31,6 +31,7 @@ datasources:
-
com.yoho.order.dal.ExpressRecordMapper
-
com.yoho.order.dal.AreaMapper
-
com.yoho.order.dal.OrderOperateRecordMapper
-
com.yoho.order.dal.TradeBillsMapper
readOnlyInSlave
:
true
...
...
web/src/main/webapp/META-INF/autoconf/databases.yml
View file @
bb6fee0
...
...
@@ -31,5 +31,6 @@ datasources:
-
com.yoho.order.dal.ExpressRecordMapper
-
com.yoho.order.dal.AreaMapper
-
com.yoho.order.dal.OrderOperateRecordMapper
-
com.yoho.order.dal.TradeBillsMapper
readOnlyInSlave
:
${readOnlyInSlave}
...
...
web/src/main/webapp/html/billsManage/list.html
0 → 100644
View file @
bb6fee0
<!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:180px;"
>
<script>
document
.
write
(
addHead
(
'打款管理'
,
'列表管理'
));
</script>
<div
style=
"padding:20px;"
>
<label>
订单编号:
</label>
<input
id=
"orderCode"
type=
"text"
class=
"easyui-textbox"
style=
"width:150px"
>
<label>
UID:
</label>
<input
id=
"uid"
type=
"text"
class=
"easyui-textbox"
style=
"width:150px"
/>
<label>
手机号:
</label>
<input
id=
"mobile"
type=
"text"
class=
"easyui-textbox"
style=
"width:150px"
/>
<label>
订单状态:
</label>
<select
id=
"status"
class=
"easyui-combobox"
style=
"width:100px;"
>
<option
value=
""
>
全部状态
</option>
<option
value=
"100"
>
打款成功
</option>
<option
value=
"999"
>
打款失败
</option>
</select>
<a
id=
"searchBtn"
class=
"btn-info"
>
查询
</a>
<!--<a id="allBtn" class="btn-success">全部</a>-->
</div>
</div>
<div
id=
"tradeBillsList"
region=
"center"
>
<table
id=
"tradeBillsListTable"
></table>
</div>
<script>
$
(
function
()
{
$
(
"#status"
).
combobox
({
panelHeight
:
'auto'
,
multiple
:
false
,
});
$
(
"#searchBtn"
).
linkbutton
({
iconCls
:
"icon-search"
,
onClick
:
function
()
{
/*if(!$("#orderCode").val()
&& !$("#uid").val()
&& !$("#mobile").val()){
$.messager.alert("提示","请录入查询条件<br/>[订单编号、UID、手机号]至少选择一个!");
$("#orderCode").focus();
return;
}*/
$
(
"#tradeBillsListTable"
).
datagrid
(
"load"
,
{
status
:
$
(
"#status"
).
myCombobox
(
"getValue"
),
orderCode
:
$
(
"#orderCode"
).
val
(),
uid
:
$
(
"#uid"
).
val
(),
mobile
:
$
(
"#mobile"
).
val
()
});
}
});
//全部按钮
/* $("#allBtn").linkbutton({
iconCls: "icon-import",
onClick: function () {
$("#orderCode").textbox('setValue','');
$("#status").combobox('setValue','');
//$("#uid").textbox('setValue','');
$("#mobile").textbox('setValue','');
$("#orderListTable").datagrid("load", {
});
}
});*/
getTradeBillsList
();
});
function
getTradeBillsList
(){
$
(
"#tradeBillsListTable"
).
myDatagrid
({
fit
:
true
,
fitColumns
:
true
,
striped
:
true
,
url
:
contextPath
+
"/tradeBills/queryTradeBillsList"
,
method
:
'POST'
,
queryParams
:
{},
loadFilter
:
function
(
data
)
{
var
temp
=
defaultLoadFilter
(
data
);
temp
=
null
==
temp
?[]:
temp
;
temp
.
rows
=
temp
.
list
;
return
temp
;
},
columns
:
[[{
title
:
"订单编号"
,
field
:
"orderCode"
,
width
:
30
,
align
:
"center"
},{
title
:
"打款金额"
,
field
:
"amount"
,
width
:
30
,
align
:
"center"
},{
title
:
"用户uid"
,
field
:
"uid"
,
width
:
30
,
align
:
"center"
},{
title
:
"用户手机号"
,
field
:
"mobile"
,
width
:
30
,
align
:
"center"
}
,{
title
:
"打款时间"
,
field
:
"createTimeStr"
,
width
:
20
,
align
:
"center"
},{
title
:
"操作员"
,
field
:
"operatorName"
,
width
:
20
,
align
:
"center"
},{
title
:
"订单状态"
,
field
:
"tradeStatus"
,
width
:
20
,
align
:
"center"
,
formatter
:
function
(
value
,
rowData
,
rowIndex
)
{
if
(
value
==
100
)
{
return
"打款成功"
;
}
else
{
return
"<span style='color: red'>打款失败</span>"
;
}
}
},
{
title
:
"原因"
,
field
:
"tradeStatusDesc"
,
width
:
20
,
align
:
"center"
},
{
title
:
"操作"
,
field
:
"asdf"
,
width
:
40
,
align
:
"center"
,
formatter
:
function
(
value
,
rowData
,
rowIndex
)
{
if
(
rowData
.
tradeStatus
!=
100
)
{
return
"<a role='refundsConfirm' dataId='"
+
rowData
.
id
+
"' style='margin-left:10px;background-color: #5cb85c !important;'>打款</a>"
;
}
}
}]],
cache
:
false
,
pagination
:
true
,
//pageSize: 20,
idField
:
"id"
,
singleSelect
:
true
,
onLoadSuccess
:
function
(
data
)
{
$
(
this
).
datagrid
(
"getPanel"
).
find
(
"a[role='refundsConfirm']"
).
linkbutton
({
onClick
:
function
()
{
var
id
=
$
(
this
).
attr
(
"dataId"
);
alert
(
"开发中。。"
);
}
});
}
});
}
</script>
</body>
</html>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment