Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
d80ffb4d
Commit
d80ffb4d
authored
Oct 16, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提现app
parent
79a67856
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
96 additions
and
16 deletions
+96
-16
WalletCathListDTO.java
.../github/wxiaoqi/security/admin/dto/WalletCathListDTO.java
+3
-1
MyWalletCath.java
...om/github/wxiaoqi/security/admin/entity/MyWalletCath.java
+3
-0
ApplyCathVo.java
...ava/com/github/wxiaoqi/security/admin/vo/ApplyCathVo.java
+3
-0
PayAccountVo.java
...va/com/github/wxiaoqi/security/admin/vo/PayAccountVo.java
+3
-1
WalletCathAdminVo.java
...m/github/wxiaoqi/security/admin/vo/WalletCathAdminVo.java
+1
-0
WalletCathVo.java
...va/com/github/wxiaoqi/security/admin/vo/WalletCathVo.java
+5
-0
MyWalletBiz.java
...va/com/github/wxiaoqi/security/admin/biz/MyWalletBiz.java
+62
-5
MyWalletCathBiz.java
...om/github/wxiaoqi/security/admin/biz/MyWalletCathBiz.java
+14
-8
MyWalletCathMapper.xml
...ce-admin/src/main/resources/mapper/MyWalletCathMapper.xml
+2
-1
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/WalletCathListDTO.java
View file @
d80ffb4d
...
...
@@ -51,6 +51,8 @@ public class WalletCathListDTO {
@ApiModelProperty
(
"提现单号"
)
private
String
orderNo
;
@ApiModelProperty
(
value
=
"
用户账号
"
)
@ApiModelProperty
(
value
=
""
)
private
String
accountNumber
;
private
String
accountName
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/MyWalletCath.java
View file @
d80ffb4d
...
...
@@ -123,4 +123,7 @@ public class MyWalletCath implements Serializable {
@Column
(
name
=
"order_no"
)
@ApiModelProperty
(
value
=
"第三方订单号:如微信,支付宝,银行卡等"
)
private
String
orderNo
;
@Column
(
name
=
"account_name"
)
private
String
accountName
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/ApplyCathVo.java
View file @
d80ffb4d
...
...
@@ -43,4 +43,7 @@ public class ApplyCathVo {
@ApiModelProperty
(
value
=
"支付类型"
)
private
Integer
cathType
;
@ApiModelProperty
(
value
=
"账号名称"
)
private
String
accountName
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/PayAccountVo.java
View file @
d80ffb4d
...
...
@@ -21,9 +21,11 @@ public class PayAccountVo {
@ApiModelProperty
(
value
=
"微信用户名 | 支付宝帐号"
)
private
String
accountDesc
;
@ApiModelProperty
(
"微信用
户名 | 支付宝账号
"
)
@ApiModelProperty
(
"微信用
openid | 支付宝账号userid
"
)
private
String
account
;
@ApiModelProperty
(
value
=
"帐户类型 0:微信 1:支付宝 2:银行卡"
)
private
Integer
accountType
;
private
String
nickName
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/WalletCathAdminVo.java
View file @
d80ffb4d
...
...
@@ -53,4 +53,5 @@ public class WalletCathAdminVo {
@ApiModelProperty
(
value
=
"用户账号描述"
)
private
String
accountNumberDesc
;
private
String
accountName
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/WalletCathVo.java
View file @
d80ffb4d
...
...
@@ -63,4 +63,9 @@ public class WalletCathVo {
@ApiModelProperty
(
value
=
"审核日期"
)
private
Long
finishTime
;
@ApiModelProperty
(
value
=
"用户账号描述"
)
private
String
accountNumberDesc
;
private
String
accountName
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletBiz.java
View file @
d80ffb4d
...
...
@@ -45,6 +45,7 @@ import tk.mybatis.mapper.entity.Example;
import
javax.servlet.http.HttpServletRequest
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.time.Instant
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
...
...
@@ -93,6 +94,9 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
private
DateTimeFormatter
dateTimeFormatter
;
private
static
final
Integer
WITHDRAW_ONLINE_WAY
=
1
;
private
static
final
Integer
WITHDRAW_OFFLINE_WAY
=
2
;
private
BCryptPasswordEncoder
encoder
=
new
BCryptPasswordEncoder
(
12
);
...
...
@@ -301,6 +305,12 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
if
(
sumDto
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
MyWalletCath
walletCath
=
new
MyWalletCath
();
walletCath
.
setCrtTime
(
Instant
.
now
().
toEpochMilli
());
WithDrawRuleVo
withDrawRule
=
configFeign
.
getWithDrawRule
();
Integer
withdrawWay
=
withDrawRule
.
getWithdrawWay
();
BigDecimal
commission
=
amount
.
multiply
(
sumDto
.
getProceduReates
()).
divide
(
new
BigDecimal
(
"100"
)).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
balnece
=
sumDto
.
getBalance
();
//到账金额
...
...
@@ -309,9 +319,35 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
realAmount
=
balnece
.
subtract
(
commission
);
}
log
.
info
(
"-----提现申请-----proceduReates==="
+
sumDto
.
getProceduReates
()
+
"----commission===="
+
commission
+
"---realAmount==="
+
realAmount
);
//添加账号
// alipayBiz.addAlipay(userId,accountNumber);
MyWalletCath
walletCath
=
new
MyWalletCath
();
//线上自动提现
if
(
WITHDRAW_ONLINE_WAY
.
equals
(
withdrawWay
)){
String
pay_no
;
String
cono
=
OrderUtil
.
GetOrderNumber
(
""
);
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
String
host
=
StringUtils
.
defaultIfBlank
(
request
.
getHeader
(
"userHost"
),
ClientUtil
.
getClientIp
(
request
));
FundPayVo
fundPayVo
=
FundPayVo
.
builder
()
.
amount
(
applyCathVo
.
getCathType
()
==
0
?
String
.
valueOf
(
realAmount
.
multiply
(
new
BigDecimal
(
100
)).
doubleValue
())
:
String
.
format
(
"%.2f"
,
realAmount
.
doubleValue
()))
.
outBizNo
(
cono
)
.
payeeAccount
(
applyCathVo
.
getAccountNumber
())
.
payerShowName
(
"欣新房车网络科技(广东)股份有限公司"
)
.
remark
(
"提现转账"
)
.
type
(
applyCathVo
.
getCathType
())
.
creatIp
(
host
)
.
build
();
try
{
//商户订单号
pay_no
=
thirdFeign
.
transferAccount
(
fundPayVo
);
walletCath
.
setStauts
(
1
);
walletCath
.
setCono
(
pay_no
);
walletCath
.
setFinishTime
(
Instant
.
now
().
toEpochMilli
());
}
catch
(
BaseException
baex
){
throw
new
BaseException
(
baex
.
getMessage
(),
400
);
}
catch
(
Exception
ex
){
throw
new
BaseException
((
applyCathVo
.
getCathType
()
==
0
?
"微信提现"
:
applyCathVo
.
getCathType
()
==
1
?
"支付宝提现"
:
"银行提现"
)+
"转账失败"
,
ex
);
}
}
//提现单号
String
orderNo
=
snowflake
.
nextIdStr
();
orderNo
=
String
.
format
(
"%s%s"
,
dateTimeFormatter
.
format
(
LocalDate
.
now
()),
orderNo
);
...
...
@@ -319,6 +355,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
walletCath
.
setUserId
(
userId
);
walletCath
.
setBalance
(
balnece
);
walletCath
.
setCathType
(
cathType
);
walletCath
.
setAccountName
(
applyCathVo
.
getAccountName
());
walletCath
.
setAccountNumber
(
accountNumber
);
walletCath
.
setAmount
(
amount
);
walletCath
.
setCommission
(
commission
);
...
...
@@ -335,6 +372,24 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
myWallet
.
setWithdrawals
(
withdrawals
);
myWallet
.
setVersion
(
sumDto
.
getVersion
());
mapper
.
updMyWater
(
myWallet
);
//线上提现
if
(
WITHDRAW_ONLINE_WAY
.
equals
(
applyCathVo
.
getCathType
())){
MyWalletDetail
detail
=
new
MyWalletDetail
();
detail
.
setUserId
(
userId
);
detail
.
setItype
(
1
);
//设置提现单号
detail
.
setWithDrawOrderNo
(
orderNo
);
detail
.
setCono
(
walletCath
.
getId
().
intValue
());
detail
.
setBalance
(
balnece
.
add
(
withdrawals
));
detail
.
setAmount
(
realAmount
);
detail
.
setSource
(
10
);
myWalletDetailBiz
.
insertSelective
(
detail
);
detail
.
setId
(
null
);
detail
.
setSource
(
13
);
detail
.
setBalance
(
balnece
.
add
(
commission
));
detail
.
setAmount
(
commission
);
myWalletDetailBiz
.
insertSelective
(
detail
);
}
return
ObjectRestResponse
.
succ
(
walletCath
.
getId
());
}
...
...
@@ -362,7 +417,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
BigDecimal
realAmount
=
cath
.
getRealAmount
();
BigDecimal
commission
=
cath
.
getCommission
();
if
(
status
==
1
)
{
String
cono
=
StringUtil
.
isEmpty
(
cath
.
getCono
())
?
OrderUtil
.
GetOrderNumber
(
"
TX
"
):
cath
.
getCono
();
String
cono
=
StringUtil
.
isEmpty
(
cath
.
getCono
())
?
OrderUtil
.
GetOrderNumber
(
""
):
cath
.
getCono
();
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
String
host
=
StringUtils
.
defaultIfBlank
(
request
.
getHeader
(
"userHost"
),
ClientUtil
.
getClientIp
(
request
));
FundPayVo
fundPayVo
=
FundPayVo
.
builder
()
...
...
@@ -444,6 +499,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
PayAccountVo
alipayAccount
=
PayAccountVo
.
builder
()
.
account
(
appUserAlipay
.
getTxAlipay
())
.
accountType
(
1
)
.
nickName
(
appUserAlipay
.
getNickname
())
.
accountDesc
(
String
.
format
(
"%s%s%s"
,
"支付宝余额("
,
appUserAlipay
.
getTxAlipay
(),
")"
))
.
build
();
payAccountVos
.
add
(
alipayAccount
);
...
...
@@ -453,7 +509,8 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
if
(!
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
appUserLogin
.
getOpenid
()))
{
PayAccountVo
wxAccount
=
PayAccountVo
.
builder
()
.
account
(
appUserLogin
.
getOpenid
())
.
accountType
(
0
)
.
accountType
(
2
)
.
nickName
(
appUserDetail
.
getWxNickname
())
.
accountDesc
(
String
.
format
(
"%s%s%s"
,
"微信零钱("
,
appUserDetail
.
getNickname
(),
")"
))
.
build
();
payAccountVos
.
add
(
wxAccount
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletCathBiz.java
View file @
d80ffb4d
...
...
@@ -63,6 +63,14 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
walletCathVo
=
new
WalletCathVo
();
BeanUtils
.
copyProperties
(
walletCath
,
walletCathVo
);
totalWithdraw
=
totalWithdraw
.
add
(
walletCathVo
.
getAmount
());
//微信
if
(
walletCath
.
getCathType
()==
0
){
walletCathVo
.
setAccountNumberDesc
(
String
.
format
(
"%s%s%s"
,
"提现到微信("
,
walletCath
.
getAccountName
(),
")"
));
}
//支付宝
if
(
walletCath
.
getCathType
()==
1
){
walletCathVo
.
setAccountNumberDesc
(
String
.
format
(
"%s%s%s"
,
"提现到支付宝("
,
walletCath
.
getAccountName
(),
")"
));
}
walletCatchPageVos
.
add
(
walletCathVo
);
}
walletCathPageVo
.
setPageNum
(
walletCathPage
.
getPageNum
());
...
...
@@ -105,14 +113,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
BeanUtils
.
copyProperties
(
walletCathListDTO
,
walletCathAdminVo
);
walletCathAdminVo
.
setUsername
(
StringUtils
.
isEmpty
(
walletCathListDTO
.
getRealname
())
?
walletCathListDTO
.
getNickname
()
:
walletCathListDTO
.
getRealname
());
walletCathAdminVo
.
setPhone
(
walletCathListDTO
.
getUsername
());
//微信
if
(
walletCathListDTO
.
getCathType
()==
0
){
walletCathAdminVo
.
setAccountNumberDesc
(
String
.
format
(
"%s%s%s"
,
"提现到微信("
,
walletCathListDTO
.
getAccountNumber
(),
")"
));
}
//支付宝
if
(
walletCathListDTO
.
getCathType
()==
1
){
walletCathAdminVo
.
setAccountNumberDesc
(
String
.
format
(
"%s%s%s"
,
"提现到支付宝("
,
walletCathListDTO
.
getAccountNumber
(),
")"
));
}
walletCathAdminVos
.
add
(
walletCathAdminVo
);
}
walletCathAdminVos
.
sort
(
Comparator
.
comparing
(
WalletCathAdminVo:
:
getCrtTime
).
reversed
());
...
...
@@ -141,4 +142,9 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
criteria
.
andIn
(
"userId"
,
userIds
);
mapper
.
deleteByExample
(
example
);
}
@Override
public
void
insertSelective
(
MyWalletCath
entity
)
{
mapper
.
insertSelective
(
entity
);
}
}
ace-modules/ace-admin/src/main/resources/mapper/MyWalletCathMapper.xml
View file @
d80ffb4d
...
...
@@ -16,7 +16,8 @@
wc.finish_time AS `finishTime`,
wc.cono,
wc.order_no AS `orderNo`,
wc.account_number AS `accountNumber`
wc.account_number AS `accountNumber`,
wc.account_name AS `accountName`
FROM
(SELECT * FROM `my_wallet_cath`
<if
test=
"state != null"
>
WHERE `stauts`=#{state}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment