Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
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
姚本章
dm_project
Commits
72556a16
Commit
72556a16
authored
Dec 08, 2020
by
machengbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
充值 提交审核
parent
a0c7214e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
221 additions
and
5 deletions
+221
-5
update.sql
database/mcb/update.sql
+2
-1
FinanceCustomerBalanceController.java
.../controller/finance/FinanceCustomerBalanceController.java
+22
-0
BalanceAuditRequest.java
...duls/controller/finance/platForm/BalanceAuditRequest.java
+55
-0
FinanceCustomerBalance.java
...a/com/jz/manage/moduls/entity/FinanceCustomerBalance.java
+27
-0
FinanceTradeFlow.java
...in/java/com/jz/manage/moduls/entity/FinanceTradeFlow.java
+3
-0
FinanceCustomerBalanceDao.java
...om/jz/manage/moduls/mapper/FinanceCustomerBalanceDao.java
+1
-1
FinanceCustomerBalanceService.java
.../manage/moduls/service/FinanceCustomerBalanceService.java
+4
-0
FinanceCustomerBalanceServiceImpl.java
...oduls/service/impl/FinanceCustomerBalanceServiceImpl.java
+105
-1
FinanceTradeFlowDao.xml
...src/main/resources/mapper/finance/FinanceTradeFlowDao.xml
+2
-2
No files found.
database/mcb/update.sql
View file @
72556a16
alter
table
t_finance_customer_assets
add
remark
text
COMMENT
'备注'
;
alter
table
t_platform_log
add
caller_type
char
(
2
)
NOT
NULL
COMMENT
'调用类型:01商城用户,02平台用户'
;
alter
table
t_finance_trade_flow
add
assets_id
Bigint
(
20
)
default
NULL
COMMENT
'企业资产id'
;
alter
table
t_finance_customer_balance
add
balance_time
datetime
default
NULL
COMMENT
'充值时间'
;
\ No newline at end of file
alter
table
t_finance_customer_balance
add
balance_time
datetime
default
NULL
COMMENT
'充值时间'
;
alter
table
t_finance_trade_flow
add
balance_money
decimal
(
20
,
5
)
NOT
NULL
DEFAULT
'0'
COMMENT
'结余'
;
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/finance/FinanceCustomerBalanceController.java
View file @
72556a16
...
...
@@ -4,6 +4,7 @@ import com.jz.common.bean.PageInfoResponse;
import
com.jz.common.constant.Constants
;
import
com.jz.common.utils.Result
;
import
com.jz.manage.moduls.controller.BaseController
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceAuditRequest
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceInfoDto
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceListDto
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceListRequest
;
...
...
@@ -79,4 +80,25 @@ public class FinanceCustomerBalanceController extends BaseController {
result
.
setData
(
dto
);
return
result
;
}
/**
* 充值管理--充值审核
*
* @return
* @author Bellamy
* @since 2020-12-08
*/
@PostMapping
(
value
=
"/balanceInfoAudit"
)
@ApiOperation
(
value
=
"充值管理--充值审核"
,
notes
=
"充值审核"
)
public
Result
<
Object
>
getBalanceInfoAudit
(
@RequestBody
BalanceAuditRequest
balanceAuditRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
Result
<
Object
>
result
=
new
Result
<>();
if
(
StringUtils
.
isEmpty
(
balanceAuditRequest
.
getCustomerBalanceId
()))
{
return
Result
.
error
(
"参数不能为空!"
);
}
if
(
StringUtils
.
isEmpty
(
balanceAuditRequest
.
getAuditStatus
()))
{
return
Result
.
error
(
"参数不能为空!"
);
}
Result
<
Object
>
dto
=
financeCustomerBalanceService
.
uptBalanceInfoAuditByid
(
balanceAuditRequest
);
return
dto
;
}
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/finance/platForm/BalanceAuditRequest.java
0 → 100644
View file @
72556a16
package
com
.
jz
.
manage
.
moduls
.
controller
.
finance
.
platForm
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* 平台利润中心--充值管理--充值审核参数对象
*
* @author Bellamy
* @since 2020-12-08 10:41:43
*/
@ApiModel
(
value
=
"充值管理--充值审核参数对象"
,
description
=
"充值审核参数对象"
)
public
class
BalanceAuditRequest
{
/**
* 审核意见
*/
@ApiModelProperty
(
value
=
"审核意见"
)
private
String
rejectReason
;
/**
* 充值id
*/
@ApiModelProperty
(
value
=
"充值id"
)
private
String
customerBalanceId
;
/**
* 审核状态:01待审核,02审核通过,03未通过
*/
@ApiModelProperty
(
value
=
"审核状态"
)
private
String
auditStatus
;
public
String
getRejectReason
()
{
return
rejectReason
;
}
public
void
setRejectReason
(
String
rejectReason
)
{
this
.
rejectReason
=
rejectReason
;
}
public
String
getAuditStatus
()
{
return
auditStatus
;
}
public
void
setAuditStatus
(
String
auditStatus
)
{
this
.
auditStatus
=
auditStatus
;
}
public
String
getCustomerBalanceId
()
{
return
customerBalanceId
;
}
public
void
setCustomerBalanceId
(
String
customerBalanceId
)
{
this
.
customerBalanceId
=
customerBalanceId
;
}
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/entity/FinanceCustomerBalance.java
View file @
72556a16
package
com
.
jz
.
manage
.
moduls
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
...
...
@@ -20,6 +22,7 @@ public class FinanceCustomerBalance implements Serializable {
/**
* 充值id
*/
@TableId
(
value
=
"customer_balance_id"
,
type
=
IdType
.
AUTO
)
private
Long
customerBalanceId
;
/**
* 企业客户资产id
...
...
@@ -54,6 +57,15 @@ public class FinanceCustomerBalance implements Serializable {
*/
private
String
rejectReason
;
/**
* 更新时间
*/
private
Date
uptTime
;
/**
* 更新人
*/
private
String
uptPerson
;
public
Long
getCustomerBalanceId
()
{
return
customerBalanceId
;
...
...
@@ -127,4 +139,19 @@ public class FinanceCustomerBalance implements Serializable {
this
.
rejectReason
=
rejectReason
;
}
public
Date
getUptTime
()
{
return
uptTime
;
}
public
void
setUptTime
(
Date
uptTime
)
{
this
.
uptTime
=
uptTime
;
}
public
String
getUptPerson
()
{
return
uptPerson
;
}
public
void
setUptPerson
(
String
uptPerson
)
{
this
.
uptPerson
=
uptPerson
;
}
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/entity/FinanceTradeFlow.java
View file @
72556a16
package
com
.
jz
.
manage
.
moduls
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
...
...
@@ -61,10 +62,12 @@ public class FinanceTradeFlow implements Serializable {
/**
* 资产id
*/
@TableField
(
value
=
"assets_id"
)
private
Long
assetsId
;
/**
* 资产结余
*/
@TableField
(
value
=
"balance_money"
)
private
BigDecimal
balanceMoney
;
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/mapper/FinanceCustomerBalanceDao.java
View file @
72556a16
package
com
.
jz
.
manage
.
moduls
.
mapper
;
import
com.jz.common.base.BaseMapper
;
import
com.jz.common.entity.FinanceCustomerBalance
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceInfoDto
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceListDto
;
import
com.jz.manage.moduls.entity.FinanceCustomerBalance
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/FinanceCustomerBalanceService.java
View file @
72556a16
package
com
.
jz
.
manage
.
moduls
.
service
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.utils.Result
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceAuditRequest
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceInfoDto
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceListDto
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceListRequest
;
...
...
@@ -19,4 +21,6 @@ public interface FinanceCustomerBalanceService {
PageInfoResponse
<
BalanceListDto
>
findListBalance
(
BalanceListRequest
balanceListRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
BalanceInfoDto
queryBalanceByid
(
String
customerBalanceId
)
throws
Exception
;
Result
<
Object
>
uptBalanceInfoAuditByid
(
BalanceAuditRequest
balanceAuditRequest
)
throws
Exception
;
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/impl/FinanceCustomerBalanceServiceImpl.java
View file @
72556a16
package
com
.
jz
.
manage
.
moduls
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.constant.Constants
;
import
com.jz.common.enums.AuditStatusEnum
;
import
com.jz.common.enums.TradeFlowEnum
;
import
com.jz.common.utils.Result
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceAuditRequest
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceInfoDto
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceListDto
;
import
com.jz.manage.moduls.controller.finance.platForm.BalanceListRequest
;
import
com.jz.manage.moduls.entity.FinanceCustomerAssets
;
import
com.jz.manage.moduls.entity.FinanceCustomerBalance
;
import
com.jz.manage.moduls.entity.FinanceTradeFlow
;
import
com.jz.manage.moduls.mapper.FinanceCustomerAssetsDao
;
import
com.jz.manage.moduls.mapper.FinanceCustomerBalanceDao
;
import
com.jz.manage.moduls.mapper.FinanceTradeFlowDao
;
import
com.jz.manage.moduls.service.FinanceCustomerBalanceService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletRequest
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -25,14 +40,22 @@ import java.util.Map;
* @since 2020-12-01 10:41:39
*/
@Service
(
"financeCustomerBalanceService"
)
@Transactional
public
class
FinanceCustomerBalanceServiceImpl
implements
FinanceCustomerBalanceService
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FinanceCustomerBalanceServiceImpl
.
class
);
@Autowired
private
FinanceCustomerBalanceDao
financeCustomerBalanceDao
;
@Autowired
private
FinanceCustomerAssetsDao
financeCustomerAssetsDao
;
@Autowired
private
FinanceTradeFlowDao
financeTradeFlowDao
;
@Override
public
PageInfoResponse
<
BalanceListDto
>
findListBalance
(
BalanceListRequest
balanceListRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
public
PageInfoResponse
<
BalanceListDto
>
findListBalance
(
BalanceListRequest
balanceListRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
PageInfoResponse
<
BalanceListDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
Map
param
=
new
HashMap
();
...
...
@@ -72,4 +95,85 @@ public class FinanceCustomerBalanceServiceImpl implements FinanceCustomerBalance
public
BalanceInfoDto
queryBalanceByid
(
String
customerBalanceId
)
throws
Exception
{
return
financeCustomerBalanceDao
.
queryBalanceByid
(
customerBalanceId
);
}
@Override
public
Result
<
Object
>
uptBalanceInfoAuditByid
(
BalanceAuditRequest
balanceAuditRequest
)
throws
Exception
{
//1.修改充值记录状态
FinanceCustomerBalance
balance
=
new
FinanceCustomerBalance
();
balance
.
setAuditStatus
(
balanceAuditRequest
.
getAuditStatus
());
balance
.
setRejectReason
(
balanceAuditRequest
.
getRejectReason
());
balance
.
setCustomerBalanceId
(
Long
.
valueOf
(
balanceAuditRequest
.
getCustomerBalanceId
()));
//balance.setUptPerson();
balance
.
setUptTime
(
new
Date
());
int
len
=
financeCustomerBalanceDao
.
updateById
(
balance
);
if
(
len
>
0
)
{
logger
.
info
(
"###########################修改充值审核状态成功####################################"
);
//2.查询出充值金额 和 账户id
QueryWrapper
wrapper
=
new
QueryWrapper
();
wrapper
.
eq
(
"customer_balance_id"
,
balanceAuditRequest
.
getCustomerBalanceId
());
wrapper
.
eq
(
"del_flag"
,
"N"
);
FinanceCustomerBalance
financeCustomerBalance
=
financeCustomerBalanceDao
.
selectOne
(
wrapper
);
Long
assetsId
=
financeCustomerBalance
.
getAssetsId
();
//企业用户资产id
String
balanceMoney
=
financeCustomerBalance
.
getBalanceMoney
().
toString
();
//充值金额
BigDecimal
balanceMoneyObj
=
new
BigDecimal
(
balanceMoney
);
//3.查询资产金额
QueryWrapper
assetsWrapper
=
new
QueryWrapper
();
assetsWrapper
.
eq
(
"assets_id"
,
assetsId
);
wrapper
.
eq
(
"del_flag"
,
"N"
);
FinanceCustomerAssets
financeCustomerAssets
=
financeCustomerAssetsDao
.
selectOne
(
assetsWrapper
);
String
frozenMoney
=
financeCustomerAssets
.
getFrozenMoney
().
toString
();
// 冻结金额
BigDecimal
frozenMoneyObj
=
new
BigDecimal
(
frozenMoney
);
frozenMoneyObj
=
frozenMoneyObj
.
subtract
(
balanceMoneyObj
);
if
(
AuditStatusEnum
.
YSH
.
getValue
().
equals
(
balanceAuditRequest
.
getAuditStatus
()))
{
//审核成功 给总金额和可用余额加上充值金额 ,冻结减去
String
useMoney
=
financeCustomerAssets
.
getUseMoney
().
toString
();
// 可用金额
BigDecimal
useMoneyObj
=
new
BigDecimal
(
useMoney
);
useMoneyObj
=
useMoneyObj
.
add
(
balanceMoneyObj
);
String
totalMoney
=
financeCustomerAssets
.
getTotalMoney
().
toString
();
//总金额
BigDecimal
totalMoneyObj
=
new
BigDecimal
(
totalMoney
);
totalMoneyObj
=
totalMoneyObj
.
add
(
balanceMoneyObj
);
//4.更新 企业资产
FinanceCustomerAssets
saveAssets
=
new
FinanceCustomerAssets
();
saveAssets
.
setAssetsId
(
assetsId
);
saveAssets
.
setUseMoney
(
useMoneyObj
);
saveAssets
.
setTotalMoney
(
totalMoneyObj
);
saveAssets
.
setFrozenMoney
(
frozenMoneyObj
);
saveAssets
.
setUptTime
(
new
Date
());
//saveAssets.setUptPerson();
financeCustomerAssetsDao
.
updateById
(
saveAssets
);
logger
.
info
(
"###########################充值审核通过---更新企业资产成功####################################"
);
//添加流水记录
FinanceTradeFlow
financeTradeFlow
=
new
FinanceTradeFlow
();
financeTradeFlow
.
setCreTime
(
new
Date
());
financeTradeFlow
.
setTradeMoney
(
balanceMoneyObj
);
financeTradeFlow
.
setAssetsId
(
assetsId
);
financeTradeFlow
.
setTradeType
(
TradeFlowEnum
.
CZ
.
getValue
());
financeTradeFlow
.
setTradeFlowNumber
(
"123132"
);
financeTradeFlow
.
setBalanceMoney
(
useMoneyObj
);
financeTradeFlow
.
setDelFlag
(
"N"
);
//financeTradeFlow.setCashOutId();
//financeTradeFlow.setCrePerson();
financeTradeFlowDao
.
insert
(
financeTradeFlow
);
logger
.
info
(
"#####################商城提现流水记录添加成功#####################"
);
}
if
(
AuditStatusEnum
.
WTG
.
getValue
().
equals
(
balanceAuditRequest
.
getAuditStatus
()))
{
//4.审核未通过 更新 企业资产
FinanceCustomerAssets
saveAssets
=
new
FinanceCustomerAssets
();
saveAssets
.
setAssetsId
(
assetsId
);
saveAssets
.
setFrozenMoney
(
frozenMoneyObj
);
saveAssets
.
setUptTime
(
new
Date
());
//saveAssets.setUptPerson();
financeCustomerAssetsDao
.
updateById
(
saveAssets
);
logger
.
info
(
"###########################充值审核未通过--更新企业资产成功####################################"
);
}
return
Result
.
ok
();
}
else
{
return
Result
.
error
(
"提交失败!"
);
}
}
}
\ No newline at end of file
jz-dm-manage/src/main/resources/mapper/finance/FinanceTradeFlowDao.xml
View file @
72556a16
...
...
@@ -72,10 +72,10 @@
</select>
<!--新增所有列-->
<insert
id=
"insert"
keyProperty=
"tradeFlowId"
useGeneratedKeys=
"true"
>
<
!--<
insert id="insert" keyProperty="tradeFlowId" useGeneratedKeys="true">
insert into t_finance_trade_flow(order_id, cash_out_id, customer_balance_id, trade_flow_number, trade_money, trade_type, cre_time, cre_person, del_flag)
values (#{orderId}, #{cashOutId}, #{customerBalanceId}, #{tradeFlowNumber}, #{tradeMoney}, #{tradeType}, #{creTime}, #{crePerson}, #{delFlag})
</insert>
</insert>
-->
<insert
id=
"insertBatch"
keyProperty=
"tradeFlowId"
useGeneratedKeys=
"true"
>
insert into t_finance_trade_flow(order_id, cash_out_id, customer_balance_id, trade_flow_number,
...
...
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