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
LUOXC
5 years ago
Commit
3a13a6fe6e5e97fa192806267bfc48c7a6334e43
1 parent
68ba5a74
fixbug
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
26 deletions
order/src/main/java/com/yoho/ufo/order/constant/TradeStatusEnum.java
order/src/main/java/com/yoho/ufo/order/service/impl/TradeBillsServiceImpl.java
web/src/main/webapp/html/billsManage/list.html
order/src/main/java/com/yoho/ufo/order/constant/TradeStatusEnum.java
View file @
3a13a6f
package
com
.
yoho
.
ufo
.
order
.
constant
;
import
java.util.Optional
;
import
java.util.stream.Stream
;
/**
* 交易流水表
* 100:成功;200:失败,201:没有支付宝账号;202:金额不合法;299:转账失败
*/
public
enum
TradeStatusEnum
{
TRANSFERING
(
90
,
"转账中"
),
SUCCESS
(
100
,
"成功"
),
FAIL_200_FAIL
(
200
,
"打款失败"
),
FAIL_201_NO_ALIPAY_ACCOUNT
(
201
,
"没有支付宝账号"
),
FAIL_202_INVALID_MONEY
(
202
,
"金额不合法"
),
HK_AMOUNT_WAIT_PAYMENT
(
203
,
"海外卖家待付款"
),
YOHO_STORE_AMOUNT_WAIT_PAYMENT
(
204
,
"YOHO!STORE卖家待付款"
),
HK_AMOUNT_PAYING
(
213
,
"海外卖家付款中"
),
FAIL_299_TRANSFER_FAILURE
(
299
,
"转账失败"
);
private
Integer
code
;
private
String
desc
;
TradeStatusEnum
(
Integer
code
,
String
desc
){
NEW
(
0
,
""
),
/**
* 待用户申请打款
*/
WAIT_APPLY_CASH
(
10
,
""
),
/**
* 转账中,用户已经申请打款
*/
APPLY_CASH
(
11
,
""
),
/**
* 转转中,等待付款结果
*/
TRANSFER_WAITING
(
90
,
""
),
/**
* 转账或退款已完成
*/
SUCCESS
(
100
,
"成功"
),
FAIL_200_REFUND_FAIL
(
200
,
"退款失败"
,
true
),
FAIL_201_NO_ALIPAY_ACCOUNT
(
201
,
"没有支付宝账号"
,
true
),
FAIL_202_INVALID_MONEY
(
202
,
"金额不合法"
,
true
),
FAIL_203_HK_AMOUNT_WAIT_PAYMENT
(
203
,
"海外卖家待付款"
,
true
),
FAIL_204_YOHO_STORE_AMOUNT_WAIT_PAYMENT
(
204
,
"YOHO!STORE卖家待付款"
,
true
),
FAIL_213_HK_AMOUNT_PAYING
(
213
,
"海外卖家付款中"
,
true
),
FAIL_299_TRANSFER_FAIL
(
299
,
"转账失败"
,
true
);
private
final
Integer
code
;
private
final
String
desc
;
private
final
boolean
fail
;
TradeStatusEnum
(
Integer
code
,
String
desc
)
{
this
(
code
,
desc
,
false
);
}
TradeStatusEnum
(
Integer
code
,
String
desc
,
boolean
fail
)
{
this
.
code
=
code
;
this
.
desc
=
desc
;
this
.
fail
=
fail
;
}
public
static
String
getDescByCode
(
Integer
code
){
if
(
code
==
null
){
return
""
;
}
for
(
TradeStatusEnum
item:
TradeStatusEnum
.
values
()){
if
(
code
.
intValue
()
==
item
.
code
.
intValue
()){
return
item
.
desc
;
}
public
Integer
getCode
()
{
return
code
;
}
public
String
getDesc
()
{
return
desc
;
}
public
boolean
isFail
()
{
return
fail
;
}
public
static
Optional
<
TradeStatusEnum
>
codeOf
(
Integer
code
)
{
if
(
code
==
null
)
{
Optional
.
empty
();
}
return
""
;
return
Stream
.
of
(
TradeStatusEnum
.
values
())
.
filter
(
item
->
code
.
intValue
()
==
item
.
code
.
intValue
())
.
findAny
();
}
}
...
...
order/src/main/java/com/yoho/ufo/order/service/impl/TradeBillsServiceImpl.java
View file @
3a13a6f
...
...
@@ -359,8 +359,10 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
AlipayBatchTransferErrorEnum
error
=
AlipayBatchTransferErrorEnum
.
getByCode
(
payErrorCode
);
failReason
=
Objects
.
nonNull
(
error
)
?
error
.
getDesc
()
:
payErrorCode
;
}
else
{
failReason
=
TradeStatusEnum
.
getDescByCode
(
item
.
getTradeStatus
());
failReason
=
StringUtils
.
isBlank
(
failReason
)
?
String
.
valueOf
(
item
.
getTradeStatus
())
:
failReason
;
failReason
=
TradeStatusEnum
.
codeOf
(
item
.
getTradeStatus
())
.
filter
(
e
->
e
.
isFail
())
.
map
(
TradeStatusEnum:
:
getDesc
)
.
orElse
(
StringUtils
.
EMPTY
);
}
resp
.
setTradeStatusDesc
(
failReason
);
}
...
...
web/src/main/webapp/html/billsManage/list.html
View file @
3a13a6f
...
...
@@ -291,7 +291,8 @@ function getTradeBillsList(){
width
:
40
,
align
:
"center"
,
formatter
:
function
(
value
,
rowData
,
rowIndex
)
{
if
(
rowData
.
tradeStatus
!=
100
)
{
// 已收款 和 等待打款结果 不可以打款
if
(
rowData
.
tradeStatus
!=
100
&&
rowData
.
tradeStatus
!=
90
)
{
var
btn
=
"<a role='confirmDialog' onclick='openConfirmDialog(\"%s\",\"%s\",\"%s\",\"%s\",\"%s\")' style='margin-left:10px;background-color: #5cb85c !important;'>打款</a>"
;
btn
=
btn
.
replace
(
"%s"
,
rowData
.
id
);
btn
=
btn
.
replace
(
"%s"
,
rowData
.
uid
);
...
...
Please
register
or
login
to post a comment