Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tcm-system
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
TCM
tcm-system
Commits
7f85b6b8
Commit
7f85b6b8
authored
Jul 05, 2024
by
tangfang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改余额为0的处理,
添加银行卡空指针问题
parent
afd647cf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
27 deletions
+30
-27
FinanceController.java
.../pangding/web/authority/controller/FinanceController.java
+4
-3
CompanyExtendDaoImpl.java
.../web/authority/dao/company/impl/CompanyExtendDaoImpl.java
+1
-1
CompanyConsumer.java
...n/java/com/pangding/web/authority/mq/CompanyConsumer.java
+1
-14
FinanceService.java
...va/com/pangding/web/authority/service/FinanceService.java
+1
-1
FinanceServiceImpl.java
...ngding/web/authority/service/impl/FinanceServiceImpl.java
+10
-8
SystemWarnServiceImpl.java
...ngding/web/system/service/impl/SystemWarnServiceImpl.java
+13
-0
No files found.
src/main/java/com/pangding/web/authority/controller/FinanceController.java
View file @
7f85b6b8
...
...
@@ -141,14 +141,15 @@ public class FinanceController {
*/
@RequestMapping
(
value
=
"/divideSettlment"
)
@ApiOperation
(
value
=
"转账"
,
notes
=
"返回转账结果"
)
public
ResponseResult
<
CapitalFlowReqVo
>
divideSettlment
(
@RequestBody
CapitalFlowReqVo
req
)
{
public
ResponseResult
<
String
>
divideSettlment
(
@RequestBody
CapitalFlowReqVo
req
)
{
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"companyId"
,
req
.
getCompanyId
())
.
notBlankCheck
(
"companyName"
,
req
.
getCompanyName
())
.
notBlankCheck
(
"bankId"
,
req
.
getBankId
())
.
notBlankCheck
(
"orderMoney"
,
req
.
getOrderMoney
())
.
notBlankCheck
(
"category"
,
req
.
getCategory
())
.
notBlankCheck
(
"actualMoney"
,
req
.
getActualMoney
())
.
checkException
();
return
financeService
.
applyWithdrawal
(
req
);
return
ResponseResult
.
result
(
financeService
.
divideSettlement
(
req
)
);
}
@RequestMapping
(
value
=
"findCompanyMoneyList"
)
...
...
src/main/java/com/pangding/web/authority/dao/company/impl/CompanyExtendDaoImpl.java
View file @
7f85b6b8
...
...
@@ -23,7 +23,7 @@ public class CompanyExtendDaoImpl extends BaseDaoImpl implements CompanyExtendDa
protected
void
init
()
{
register
(
CompanyExtendVo
.
class
);
table
.
add
(
UPDATE_COMPANY_MONEY
,
"UPDATE pd_company_extend SET withdraw_total_cash = withdraw_total_cash + @newWithdrawTotalCash{FIELD} "
+
table
.
add
(
UPDATE_COMPANY_MONEY
,
"UPDATE pd_company_extend SET withdraw_total_cash = withdraw_total_cash + @newWithdrawTotalCash
{FIELD} "
+
"WHERE id = @companyId "
)
.
addPara
(
"frozenMoney"
,
"{FIELD}"
,
",frozen_money = frozen_money + @frozenMoney"
)
.
addPara
(
"lateFee"
,
"{FIELD}"
,
",late_fee = late_fee + @lateFee"
);
...
...
src/main/java/com/pangding/web/authority/mq/CompanyConsumer.java
View file @
7f85b6b8
...
...
@@ -95,19 +95,6 @@ public class CompanyConsumer {
}
}
// @RabbitListener(queues = {MqConstant.SAVE_CAPITAL_FLOW})
// public void saveCapitalFlow(String content, Message message, Channel channel) {
// try {
// CapitalFlowReqVo capitalFlowReqVo = JsonHelper.deserialize(content, CapitalFlowReqVo.class);
// financeService.saveCapitalFlow(capitalFlowReqVo);
// } catch (Exception e) {
// Log.error(CompanyConsumer.class, e);
// mqService.message(new MessageVo(MqConstant.SAVE_CAPITAL_FLOW, MqConstant.SAVE_CAPITAL_FLOW,
// content, 2000));
// } finally {
// mqService.basicAck(message, channel);
// }
// }
@RabbitListener
(
queues
=
{
MqConstant
.
SAVE_CAPITAL_FLOW
})
public
void
saveCapitalFlow
(
String
content
,
Message
message
,
Channel
channel
)
{
...
...
@@ -282,7 +269,7 @@ public class CompanyConsumer {
}
}
@RabbitListener
(
queues
=
{
MqConstant
.
SYSTEM_WARN_SAVE
})
@RabbitListener
(
queues
=
{
MqConstant
.
SYSTEM_WARN_SAVE
}
,
concurrency
=
"3"
)
public
void
systemWarnSave
(
String
content
,
Message
message
,
Channel
channel
)
{
mqService
.
basicHandle
(
message
,
channel
,
MqConstant
.
SYSTEM_WARN_SAVE
,
content
,
300
,
(
contentTemp
)
->
{
SystemWarnReqVo
systemWarnReqVo
=
JsonHelper
.
deserialize
(
content
,
SystemWarnReqVo
.
class
);
...
...
src/main/java/com/pangding/web/authority/service/FinanceService.java
View file @
7f85b6b8
...
...
@@ -49,7 +49,7 @@ public interface FinanceService {
void
updateCompanyMoney
(
UpdateCompanyMoneyReqVo
updateCompanyMoneyReqVo
);
void
divideSettlement
(
CapitalFlowReqVo
req
);
String
divideSettlement
(
CapitalFlowReqVo
req
);
double
getServiceCharge
(
CompanyResVo
companyResVo
);
...
...
src/main/java/com/pangding/web/authority/service/impl/FinanceServiceImpl.java
View file @
7f85b6b8
...
...
@@ -63,7 +63,7 @@ public class FinanceServiceImpl implements FinanceService {
@Autowired
private
CompanyConsumer
companyConsumer
;
@Autowired
private
MqService
mqService
;
private
MqService
mqService
;
@Override
...
...
@@ -286,6 +286,7 @@ public class FinanceServiceImpl implements FinanceService {
/**
* 获取提现手续费
*
* @param companyResVo
* @return
*/
...
...
@@ -417,11 +418,11 @@ public class FinanceServiceImpl implements FinanceService {
capitalFlowVo
.
setFinalMoney
(
newMoney
);
saveCompanyMoney
(
capitalFlowVo
,
companyResVo
,
oldMoney
);
}
}
else
{
}
else
{
// 修改公司金额 提现失败 余额冲正
UpdateCompanyMoneyReqVo
updateCompanyMoneyReqVo
=
new
UpdateCompanyMoneyReqVo
();
updateCompanyMoneyReqVo
.
setCompanyId
(
req
.
getCompanyId
());
updateCompanyMoneyReqVo
.
setNewWithdrawTotalCash
(
capitalFlowVo
.
getOrderMoney
()
);
updateCompanyMoneyReqVo
.
setNewWithdrawTotalCash
(
0
d
);
updateCompanyMoneyReqVo
.
setFrozenMoney
(-
capitalFlowVo
.
getOrderMoney
());
// updateCompanyMoneyReqVo.setLateFee(capitalFlowVo.getOrderFee());
companyExtendDao
.
updateCompanyMoney
(
updateCompanyMoneyReqVo
);
...
...
@@ -438,11 +439,12 @@ public class FinanceServiceImpl implements FinanceService {
*
* @param req
*/
public
void
divideSettlement
(
CapitalFlowReqVo
req
)
{
public
String
divideSettlement
(
CapitalFlowReqVo
req
)
{
CashWithdrawalReqVo
cashWithdrawalReqVo
=
new
CashWithdrawalReqVo
();
ObjectHelper
.
writeWithFromClass
(
cashWithdrawalReqVo
,
req
);
capitalFlowDao
.
create
(
req
);
companyConsumer
.
divideSettlement
(
cashWithdrawalReqVo
);
return
"处理成功"
;
}
/**
...
...
@@ -488,16 +490,15 @@ public class FinanceServiceImpl implements FinanceService {
req
.
setTempId
(
StringHelper
.
getMD5Id
(
req
.
getOrderId
(),
req
.
getOrderMonetDetailId
()));
mqService
.
log
(
new
MessageLogReqVo
(
ReportMqConstant
.
REPORT_PRODUCT_DETAIL_SAVE
,
req
.
getTempId
()));
double
money
=
req
.
getActualMoney
();
System
.
out
.
println
(
"处理余额:"
+
req
.
getOrderId
()
+
","
+
req
.
getOrderMonetDetailId
()
+
",money:"
+
money
);
if
(
CompanyConstant
.
CATEGORY_REFUND
==
req
.
getCategory
())
{
// 退款
if
(
money
==
0
)
{
if
(
money
==
0
)
{
money
=
0
;
}
else
{
}
else
{
money
=
-
money
;
}
}
if
(
StringHelper
.
isEmpty
(
money
))
{
if
(
StringHelper
.
isEmpty
(
money
))
{
throw
new
CodeException
(
"金额不能为空"
);
}
//修改公司余额
...
...
@@ -511,6 +512,7 @@ public class FinanceServiceImpl implements FinanceService {
if
(
StringHelper
.
isEmpty
(
companyVo
))
{
throw
new
CodeException
(
"未找到公司信息"
);
}
// double realMoney = CalcHelper.sub(companyVo.getWithdrawTotalCash(), companyVo.getFrozenMoney());
double
oldMoney
=
companyVo
.
getWithdrawTotalCash
()
-
money
;
// 添加资金流水
String
id
=
StringHelper
.
getMD5Id
(
req
.
getOrderId
(),
req
.
getOrderMonetDetailId
(),
req
.
getCompanyId
());
...
...
src/main/java/com/pangding/web/system/service/impl/SystemWarnServiceImpl.java
View file @
7f85b6b8
...
...
@@ -10,6 +10,7 @@ import com.pangding.web.vo.system.res.SystemWarnResVo;
import
com.yanzuoguang.util.base.ObjectHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
org.springframework.core.codec.CodecException
;
import
org.springframework.stereotype.Service
;
@Service
...
...
@@ -53,4 +54,16 @@ public class SystemWarnServiceImpl implements SystemWarnService {
}
}
public
void
updateWarn
(
SystemWarnReqVo
req
){
SystemWarnResVo
systemWarnResVo
=
systemWarnDao
.
load
(
req
.
getSystemWarningId
(),
SystemWarnResVo
.
class
);
if
(
StringHelper
.
isEmpty
(
systemWarnResVo
)){
// throw new CodecException("00", "未找到数据");
}
// systemWarnResVo.setRemark(req.getRemark());
systemWarnResVo
.
setWarnStatus
(
req
.
getWarnStatus
());
systemWarnDao
.
update
(
systemWarnResVo
);
}
}
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