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
64b6577f
Commit
64b6577f
authored
Dec 07, 2020
by
machengbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提现审核完善
parent
0312e0ad
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
160 additions
and
16 deletions
+160
-16
TradeFlowEnum.java
...mmon/src/main/java/com/jz/common/enums/TradeFlowEnum.java
+73
-0
FinanceTradeFlow.java
...in/java/com/jz/manage/moduls/entity/FinanceTradeFlow.java
+24
-0
FinanceTradeFlowDao.java
...java/com/jz/manage/moduls/mapper/FinanceTradeFlowDao.java
+1
-1
PlatformTradeFlowInfoServiceImpl.java
...moduls/service/impl/PlatformTradeFlowInfoServiceImpl.java
+62
-15
No files found.
jz-dm-common/src/main/java/com/jz/common/enums/TradeFlowEnum.java
0 → 100644
View file @
64b6577f
package
com
.
jz
.
common
.
enums
;
/**
* 交易流水类型
*
* @author Bellamy
* @since 2020-12-07 14:30:23
*/
public
enum
TradeFlowEnum
{
/**
* 提现
*/
TX
(
"TX"
,
"01"
),
/**
* 充值
*/
CZ
(
"CZ"
,
"02"
),
/**
* 付款(订单)
*/
FK
(
"FK"
,
"03"
),
/**
* 收款
*/
SK
(
"SK"
,
"04"
),
/**
* 续费
*/
XF
(
"XF"
,
"05"
),
;
private
String
code
;
private
String
value
;
TradeFlowEnum
(
String
code
,
String
value
)
{
this
.
code
=
code
;
this
.
value
=
value
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
public
static
TradeFlowEnum
get
(
String
code
)
{
if
(
code
==
null
)
{
return
null
;
}
for
(
TradeFlowEnum
status
:
values
())
{
if
(
status
.
getCode
().
equalsIgnoreCase
(
code
))
{
return
status
;
}
}
return
null
;
}
}
jz-dm-manage/src/main/java/com/jz/manage/moduls/entity/FinanceTradeFlow.java
View file @
64b6577f
...
...
@@ -58,6 +58,15 @@ public class FinanceTradeFlow implements Serializable {
*/
private
String
delFlag
;
/**
* 资产id
*/
private
Long
assetsId
;
/**
* 资产结余
*/
private
BigDecimal
balanceMoney
;
public
Long
getTradeFlowId
()
{
return
tradeFlowId
;
...
...
@@ -139,4 +148,19 @@ public class FinanceTradeFlow implements Serializable {
this
.
delFlag
=
delFlag
;
}
public
Long
getAssetsId
()
{
return
assetsId
;
}
public
void
setAssetsId
(
Long
assetsId
)
{
this
.
assetsId
=
assetsId
;
}
public
BigDecimal
getBalanceMoney
()
{
return
balanceMoney
;
}
public
void
setBalanceMoney
(
BigDecimal
balanceMoney
)
{
this
.
balanceMoney
=
balanceMoney
;
}
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/mapper/FinanceTradeFlowDao.java
View file @
64b6577f
package
com
.
jz
.
manage
.
moduls
.
mapper
;
import
com.jz.common.base.BaseMapper
;
import
com.jz.
common
.entity.FinanceTradeFlow
;
import
com.jz.
manage.moduls
.entity.FinanceTradeFlow
;
/**
* 企业客户交易流水(TFinanceTradeFlow)表数据库访问层
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/impl/PlatformTradeFlowInfoServiceImpl.java
View file @
64b6577f
...
...
@@ -6,12 +6,15 @@ import com.jz.common.bean.BasePageBean;
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.*
;
import
com.jz.manage.moduls.entity.FinanceCashOut
;
import
com.jz.manage.moduls.entity.FinanceCustomerAssets
;
import
com.jz.manage.moduls.entity.FinanceTradeFlow
;
import
com.jz.manage.moduls.mapper.FinanceCashOutDao
;
import
com.jz.manage.moduls.mapper.FinanceCustomerAssetsDao
;
import
com.jz.manage.moduls.mapper.FinanceTradeFlowDao
;
import
com.jz.manage.moduls.mapper.PlatformTradeFlowInfoDao
;
import
com.jz.manage.moduls.service.PlatformTradeFlowInfoService
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -49,6 +52,9 @@ public class PlatformTradeFlowInfoServiceImpl implements PlatformTradeFlowInfoSe
@Autowired
private
FinanceCustomerAssetsDao
financeCustomerAssetsDao
;
@Autowired
private
FinanceTradeFlowDao
financeTradeFlowDao
;
@Override
public
PlatFormMoneyAndDepartDto
queryPlatFormMoneyAndDepart
(
Map
map
)
throws
Exception
{
return
platformTradeFlowInfoDao
.
queryPlatFormMoneyAndDepart
(
map
);
...
...
@@ -157,36 +163,48 @@ public class PlatformTradeFlowInfoServiceImpl implements PlatformTradeFlowInfoSe
return
platformTradeFlowInfoDao
.
queryCashOutByid
(
cashOutId
);
}
/**
* 提现管理--提现审核
*
* @return
* @author Bellamy
* @since 2020-12-06
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
<
Object
>
uptCashOutInfoAuditByid
(
CashOutAuditRequest
cashOutAuditRequest
)
throws
Exception
{
FinanceCashOut
cashOut
=
new
FinanceCashOut
();
//提现id
if
(
StringUtils
.
isNotEmpty
(
cashOutAuditRequest
.
getCashOutId
()))
{
cashOut
.
setCashOutId
(
Long
.
valueOf
(
cashOutAuditRequest
.
getCashOutId
()));
}
//审核意见
if
(
StringUtils
.
isNotEmpty
(
cashOutAuditRequest
.
getRejectReason
()))
{
cashOut
.
setRejectReason
(
cashOutAuditRequest
.
getRejectReason
());
}
//审核状态
cashOut
.
setAuditStatus
(
cashOutAuditRequest
.
getAuditStatus
());
cashOut
.
setAuditTime
(
new
Date
());
//cashOut.setAuditPerson();
//更新提现状态
//
1.
更新提现状态
int
len
=
financeCashOutDao
.
updateById
(
cashOut
);
if
(
len
>
0
)
{
logger
.
info
(
"#####################修改提现状态成功#####################"
);
//审核通过,修改个人资产,总金额减去提现金额,从冻结金额减去
if
(
AuditStatusEnum
.
YSH
.
getValue
().
equals
(
cashOutAuditRequest
.
getAuditStatus
()))
{
//查询出提现金额
FinanceCashOut
cashOutObj
=
financeCashOutDao
.
selectById
(
cashOutAuditRequest
.
getCashOutId
());
//查询出提现金额
String
cashOutMoney
=
cashOutObj
.
getCashOutMoney
().
toString
();
BigDecimal
txMoney
=
new
BigDecimal
(
cashOutMoney
);
//提现金额
if
(
StringUtils
.
isNotEmpty
(
cashOutObj
.
getAssetsId
().
toString
()))
{
FinanceCustomerAssets
assetsObj
=
financeCustomerAssetsDao
.
selectById
(
cashOutObj
.
getAssetsId
().
toString
());
String
totalMoney
=
assetsObj
.
getTotalMoney
().
toString
();
BigDecimal
totalMoneyObj
=
new
BigDecimal
(
totalMoney
);
//总金额
totalMoneyObj
=
totalMoneyObj
.
subtract
(
txMoney
);
String
totalMoney
=
assetsObj
.
getTotalMoney
().
toString
();
//总金额
BigDecimal
totalMoneyObj
=
new
BigDecimal
(
totalMoney
);
String
frozenMoney
=
assetsObj
.
getFrozenMoney
().
toString
();
//冻结金额
BigDecimal
frozenMoneyObJ
=
new
BigDecimal
(
frozenMoney
);
//2.审核通过,修改个人资产,总金额减去提现金额,从冻结金额减去
if
(
AuditStatusEnum
.
YSH
.
getValue
().
equals
(
cashOutAuditRequest
.
getAuditStatus
()))
{
totalMoneyObj
=
totalMoneyObj
.
subtract
(
txMoney
);
frozenMoneyObJ
=
frozenMoneyObJ
.
subtract
(
txMoney
);
FinanceCustomerAssets
financeCustomerAssets
=
new
FinanceCustomerAssets
();
...
...
@@ -196,7 +214,36 @@ public class PlatformTradeFlowInfoServiceImpl implements PlatformTradeFlowInfoSe
//financeCustomerAssets.setUptPerson();
financeCustomerAssets
.
setUptTime
(
new
Date
());
financeCustomerAssetsDao
.
updateById
(
financeCustomerAssets
);
logger
.
info
(
"#####################修改资产金额态成功#####################"
);
logger
.
info
(
"#####################提现通过---修改资产金额态成功#####################"
);
//3.商城流水添加一条流水记录
FinanceTradeFlow
financeTradeFlow
=
new
FinanceTradeFlow
();
financeTradeFlow
.
setCreTime
(
new
Date
());
financeTradeFlow
.
setTradeMoney
(
txMoney
);
financeTradeFlow
.
setAssetsId
(
cashOutObj
.
getAssetsId
());
financeTradeFlow
.
setTradeType
(
TradeFlowEnum
.
TX
.
getValue
());
financeTradeFlow
.
setTradeFlowNumber
(
"123132"
);
financeTradeFlow
.
setBalanceMoney
(
assetsObj
.
getUseMoney
());
//financeTradeFlow.setCashOutId();
//financeTradeFlow.setCrePerson();
financeTradeFlowDao
.
insert
(
financeTradeFlow
);
logger
.
info
(
"#####################商城提现流水记录添加成功#####################"
);
}
else
if
(
AuditStatusEnum
.
WTG
.
getValue
().
equals
(
cashOutAuditRequest
.
getAuditStatus
()))
{
//3.审核不通过,修改个人资产,可用金额加上提现金额,从冻结金额减去
String
useMoney
=
assetsObj
.
getUseMoney
().
toString
();
//可用金额
BigDecimal
useMoneyObj
=
new
BigDecimal
(
useMoney
);
useMoneyObj
=
useMoneyObj
.
add
(
txMoney
);
frozenMoneyObJ
=
frozenMoneyObJ
.
subtract
(
txMoney
);
FinanceCustomerAssets
financeCustomerAssets
=
new
FinanceCustomerAssets
();
financeCustomerAssets
.
setAssetsId
(
cashOutObj
.
getAssetsId
());
financeCustomerAssets
.
setUseMoney
(
useMoneyObj
);
financeCustomerAssets
.
setFrozenMoney
(
frozenMoneyObJ
);
//financeCustomerAssets.setUptPerson();
financeCustomerAssets
.
setUptTime
(
new
Date
());
financeCustomerAssetsDao
.
updateById
(
financeCustomerAssets
);
logger
.
info
(
"#####################提现审核拒绝---修改资产金额态成功#####################"
);
}
}
return
Result
.
ok
();
...
...
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