Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
6ab20a44
提交
6ab20a44
authored
2月 19, 2024
作者:
huyufan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
借款相关
上级
028e94b5
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
17 行增加
和
24 行删除
+17
-24
OrderChildLoanComponent.java
...om/clx/performance/component/OrderChildLoanComponent.java
+3
-15
OwnerLoanAccountMapper.java
...m/clx/performance/mapper/loan/OwnerLoanAccountMapper.java
+5
-3
OwnerLoanRecordServiceImpl.java
...ormance/service/impl/loan/OwnerLoanRecordServiceImpl.java
+8
-5
NbBankServiceImpl.java
...nce/service/impl/thirdparty/nbbank/NbBankServiceImpl.java
+1
-1
没有找到文件。
performance-web/src/main/java/com/clx/performance/component/OrderChildLoanComponent.java
浏览文件 @
6ab20a44
...
...
@@ -28,11 +28,7 @@ import com.clx.performance.model.loan.OwnerLoanAccountRunningWaterRecord;
import
com.clx.performance.model.loan.OwnerRepayment
;
import
com.clx.performance.model.settle.SettlementDriverDetail
;
import
com.clx.performance.model.settle.SettlementOwnerDetail
;
import
com.clx.performance.param.app.OrderChildSaveParam
;
import
com.clx.performance.service.OrderChildService
;
import
com.clx.performance.service.loan.OwnerLoanRecordService
;
import
com.clx.performance.utils.spring.ApplicationContextUtils
;
import
com.clx.performance.vo.app.SaveOrderChildVO
;
import
com.clx.user.vo.feign.OwnerInfoFeignVO
;
import
com.msl.common.base.Optional
;
import
com.msl.common.exception.ServiceSystemException
;
...
...
@@ -48,10 +44,6 @@ import java.time.LocalDateTime;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
java.util.function.BiConsumer
;
import
java.util.function.Consumer
;
import
java.util.function.Function
;
import
java.util.function.Supplier
;
@Component
@AllArgsConstructor
...
...
@@ -163,20 +155,16 @@ public class OrderChildLoanComponent {
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
ORDER_CHILD_SAVE_FAIL
,
"货主已欠款"
);
}
//TODO 加锁
//查询审批通过并且未用完的借款
LoanBalanceDTO
param
=
new
LoanBalanceDTO
();
param
.
setOrderChildPrice
(
orderChildPrice
);
param
.
setOwnerUserNo
(
ownerLoanAccount
.
getOwnerUserNo
());
param
.
setChildNo
(
childNo
);
getLoanBalanceLock
(
param
);
}
/**
* 运单确认
人
借款相关处理执行
* 运单确认借款相关处理执行
*
* @param settlementDriverDetail
* @param settlementOwnerDetail
...
...
@@ -210,7 +198,7 @@ public class OrderChildLoanComponent {
param
.
setChildNo
(
childNo
);
param
.
setSettlementDriverDetail
(
settlementDriverDetail
);
param
.
setSettlementOwnerDetail
(
settlementOwnerDetail
);
//
TODO 钱不够需要流程卡死
//
扣钱,获取锁,此处有可能钱不够,抛异常,走网络货运重试
getLoanBalanceLock
(
param
);
runningWaterRecordList
=
ownerLoanAccountRunningWaterRecordDao
.
getListByOrderNoAndRunningWaterType
...
...
@@ -249,7 +237,7 @@ public class OrderChildLoanComponent {
param
.
setChildNo
(
childNo
);
param
.
setSettlementDriverDetail
(
settlementDriverDetail
);
param
.
setSettlementOwnerDetail
(
settlementOwnerDetail
);
//
TODO 钱不够需要流程卡死
//
扣钱,获取锁,此处有可能钱不够,抛异常,走网络货运重试
getLoanBalanceLock
(
param
);
runningWaterRecordList
=
ownerLoanAccountRunningWaterRecordDao
.
getListByOrderNoAndRunningWaterType
...
...
performance-web/src/main/java/com/clx/performance/mapper/loan/OwnerLoanAccountMapper.java
浏览文件 @
6ab20a44
...
...
@@ -18,9 +18,11 @@ import org.apache.ibatis.annotations.Update;
*/
public
interface
OwnerLoanAccountMapper
extends
BaseMapper
<
OwnerLoanAccount
>
{
@Update
(
"update owner_loan_account set funding_amount = funding_amount + #{account.fundingAmount}"
+
",virtually_amount = virtually_amount + #{account.virtuallyAmount}"
+
",modified_time= #{now}"
@Update
(
"update owner_loan_account set funding_account_balance = funding_account_balance + #{account.fundingAccountBalance}"
+
",funding_usable_balance = funding_usable_balance + #{account.fundingUsableBalance},funding_frozen_balance = funding_frozen_balance + #{account.fundingFrozenBalance}"
+
",virtually_account_balance = virtually_account_balance + #{account.virtuallyAccountBalance},virtually_usable_balance = virtually_usable_balance + #{account.virtuallyUsableBalance}"
+
",virtually_frozen_balance = virtually_frozen_balance + #{account.virtuallyFrozenBalance}"
+
",modified_time=#{now}"
+
"where id = #{account.id} and modified_time = #{account.modifiedTime}"
)
Integer
addAccount
(
@Param
(
"account"
)
OwnerLoanAccount
account
,
@Param
(
"now"
)
String
nowStr
);
...
...
performance-web/src/main/java/com/clx/performance/service/impl/loan/OwnerLoanRecordServiceImpl.java
浏览文件 @
6ab20a44
...
...
@@ -152,7 +152,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
ownerLoanRecord
.
setLoanType
(
param
.
getLoanType
());
if
(
OwnerLoanRecordEnum
.
LoanType
.
FUND
.
getCode
().
equals
(
param
.
getLoanType
()))
{
//资金
TODO 调宁波银企直连的产品,从诚联信账户中给鑫祥和执行转账
//资金
BankTrade
bankTrade
=
new
BankTrade
();
if
(
OwnerLoanRecordEnum
.
PayChannel
.
ORDER_DIRECT_PAY
.
getCode
().
equals
(
param
.
getPayChannel
()))
{
// 订单支付
...
...
@@ -192,15 +192,17 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
}
else
{
// 虚拟币 直接增加 更改状态审批通过
ownerLoanRecord
.
setStatus
(
OwnerLoanRecordEnum
.
Status
.
APPROVE_PASS
.
getCode
());
}
while
(
true
)
{
OwnerLoanAccount
ownerLoanAccount
=
ownerLoanAccountDao
.
getOneByField
(
OwnerLoanAccount:
:
getOwnerUserNo
,
ownerLoanRecord
.
getOwnerUserNo
()).
get
();
OwnerLoanAccount
entity
=
new
OwnerLoanAccount
();
entity
.
setId
(
ownerLoanAccount
.
getId
());
/* entity.setVirtuallyAmount(ownerLoanRecord.getLoanBalance());
entity.setFundingAmount(BigDecimal.ZERO);*/
entity
.
setFundingAccountBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingUsableBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyAccountBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setVirtuallyFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyUsableBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setModifiedTime
(
ownerLoanAccount
.
getModifiedTime
());
Integer
flag
=
ownerLoanAccountDao
.
updateAccountCAS
(
entity
,
LocalDateTime
.
now
(),
true
);
if
(
flag
==
1
)
{
...
...
@@ -211,6 +213,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
break
;
}
}
}
}
else
{
//拒绝
...
...
performance-web/src/main/java/com/clx/performance/service/impl/thirdparty/nbbank/NbBankServiceImpl.java
浏览文件 @
6ab20a44
...
...
@@ -78,7 +78,7 @@ public class NbBankServiceImpl implements NbBankService {
@Override
public
NbBankOrderPayResultVO
orderDirectPay
(
Long
loanNo
,
Integer
amount
,
String
payAcctOpenBankId
,
String
payAcctNo
,
String
payAcctNm
)
{
String
merSeqNo
=
idGenerateSnowFlake
.
nextIdToString
(
3L
);
String
merSeqNo
=
String
.
valueOf
(
loanNo
);
String
merDtTm
=
LocalDateTimeUtils
.
formatTime
();
String
closeDtTm
=
LocalDateTimeUtils
.
formatTime
(
LocalDateTimeUtils
.
parseTime
(
merDtTm
).
plusDays
(
30
));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论