Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
shop-Mall
Project
Project
Details
Activity
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
licc
shop-Mall
Commits
d35e8b88
Commit
d35e8b88
authored
Mar 29, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提现审核
parent
f1a4e9e7
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
96 additions
and
0 deletions
+96
-0
WithdrawAuditVo.java
.../src/main/java/cn/wisenergy/model/vo/WithdrawAuditVo.java
+22
-0
BankManger.java
...rc/main/java/cn/wisenergy/service/Manager/BankManger.java
+25
-0
BankService.java
...e/src/main/java/cn/wisenergy/service/app/BankService.java
+9
-0
BankServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/BankServiceImpl.java
+31
-0
BankController.java
...cn/wisenergy/web/admin/controller/app/BankController.java
+9
-0
No files found.
wisenergy-model/src/main/java/cn/wisenergy/model/vo/WithdrawAuditVo.java
0 → 100644
View file @
d35e8b88
package
cn
.
wisenergy
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author 86187
* @ Description: 提现审核Vo
* @ Author : 86187
* @ Date : 2021/3/29 9:56
*/
@ApiModel
(
"WithdrawAuditVo"
)
@Data
public
class
WithdrawAuditVo
{
/**
* 提现记录主键id
*/
@ApiModelProperty
(
value
=
"提现记录主键id"
,
name
=
"id"
)
private
Integer
id
;
}
wisenergy-service/src/main/java/cn/wisenergy/service/Manager/BankManger.java
View file @
d35e8b88
...
...
@@ -50,4 +50,29 @@ public class BankManger {
}
return
true
;
}
/**
* 更新账户信息和提现记录状态
*
* @param accountInfo 账户信息
* @param record 交易流水信息
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
updateAccountAndRecord
(
AccountInfo
accountInfo
,
TradeRecord
record
)
{
//更新账户信息
if
(
null
!=
accountInfo
)
{
int
count
=
accountMapper
.
edit
(
accountInfo
);
if
(
count
==
0
)
{
return
false
;
}
}
//新增交易流水记录
if
(
null
!=
record
)
{
int
count
=
recordMapper
.
add
(
record
);
return
count
!=
0
;
}
return
true
;
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/BankService.java
View file @
d35e8b88
...
...
@@ -4,6 +4,7 @@ import cn.wisenergy.common.utils.R;
import
cn.wisenergy.model.app.BankInfo
;
import
cn.wisenergy.model.dto.WithdrawBankDto
;
import
cn.wisenergy.model.vo.TaxRateVo
;
import
cn.wisenergy.model.vo.WithdrawAuditVo
;
import
java.util.List
;
...
...
@@ -67,4 +68,12 @@ public interface BankService {
*/
R
<
TaxRateVo
>
getTaxRate
(
Double
money
);
/**
* 提现审核
*
* @param auditVo 提现记录id
* @return true or false
*/
R
<
Boolean
>
withdrawAudit
(
WithdrawAuditVo
auditVo
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/BankServiceImpl.java
View file @
d35e8b88
...
...
@@ -8,6 +8,7 @@ import cn.wisenergy.model.enums.FrozenStatus;
import
cn.wisenergy.model.enums.TradeRecordEnum
;
import
cn.wisenergy.model.enums.TradeStatusEnum
;
import
cn.wisenergy.model.vo.TaxRateVo
;
import
cn.wisenergy.model.vo.WithdrawAuditVo
;
import
cn.wisenergy.service.Manager.BankManger
;
import
cn.wisenergy.service.app.BankService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
...
@@ -54,6 +55,9 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
@Autowired
private
BankManger
bankManger
;
@Autowired
private
TradeRecordMapper
tradeRecordMapper
;
private
static
final
String
TAX_RATE_KEY
=
"TAX_RATE_CODE"
;
...
...
@@ -258,4 +262,31 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
taxRateVo
.
setTaxDesc
(
"提现时系统自动扣除2%个人所得税,剩余税费由平台替缴。"
);
return
R
.
ok
(
taxRateVo
);
}
@Override
public
R
<
Boolean
>
withdrawAudit
(
WithdrawAuditVo
auditVo
)
{
log
.
info
(
"shop-mall[]BankServiceImpl[]withdrawAudit[]input.param.auditVo:"
+
auditVo
);
if
(
null
==
auditVo
||
null
==
auditVo
.
getId
())
{
return
R
.
error
(
"入参为空!"
);
}
//1、根据提现记录id,获取提现信息
TradeRecord
tradeRecord
=
tradeRecordMapper
.
selectById
(
auditVo
.
getId
());
if
(
null
==
tradeRecord
)
{
return
R
.
error
(
"提现记录不正确,请联系管理员!"
);
}
//2、获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
tradeRecord
.
getUserId
());
if
(
null
==
accountInfo
)
{
return
R
.
error
(
"提现账户信息不存在!"
);
}
//更新提现状态为 提现成功,更新账户冻结金额
boolean
bool
=
bankManger
.
updateAccountAndRecord
(
accountInfo
,
tradeRecord
);
if
(!
bool
)
{
return
R
.
ok
(
1
,
false
);
}
return
R
.
ok
(
0
,
true
);
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/BankController.java
View file @
d35e8b88
...
...
@@ -4,6 +4,7 @@ import cn.wisenergy.common.utils.R;
import
cn.wisenergy.model.app.BankInfo
;
import
cn.wisenergy.model.dto.WithdrawBankDto
;
import
cn.wisenergy.model.vo.TaxRateVo
;
import
cn.wisenergy.model.vo.WithdrawAuditVo
;
import
cn.wisenergy.service.app.BankService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -98,4 +99,12 @@ public class BankController {
log
.
info
(
"shop-mall[]BankController[]getTaxRate[]input.method"
);
return
bankService
.
getTaxRate
(
money
);
}
@ApiOperation
(
value
=
"审核提现"
,
notes
=
"审核提现"
,
httpMethod
=
"POST"
)
@ApiImplicitParam
(
name
=
"auditVo"
,
value
=
"参数"
,
dataType
=
"WithdrawAuditVo"
)
@PostMapping
(
"/audit"
)
public
R
<
Boolean
>
audit
(
@RequestBody
WithdrawAuditVo
auditVo
)
{
log
.
info
(
"shop-mall[]BankController[]getTaxRate[]input.method"
);
return
bankService
.
withdrawAudit
(
auditVo
);
}
}
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