Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
1863731c
提交
1863731c
authored
2月 26, 2024
作者:
huyufan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/v10.7_borrowing_and_repayment_20240118' into test
上级
94a63a23
1ee95737
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
161 行增加
和
16 行删除
+161
-16
OwnerLoanAccountRunningWaterRecordDaoImpl.java
.../impl/loan/OwnerLoanAccountRunningWaterRecordDaoImpl.java
+8
-0
SettlementDriverDaoImpl.java
.../performance/dao/impl/settle/SettlementDriverDaoImpl.java
+9
-0
SettlementDriverDetailDaoImpl.java
...rmance/dao/impl/settle/SettlementDriverDetailDaoImpl.java
+10
-0
OwnerLoanAccountRunningWaterRecordDao.java
...mance/dao/loan/OwnerLoanAccountRunningWaterRecordDao.java
+2
-0
SettlementDriverDao.java
...a/com/clx/performance/dao/settle/SettlementDriverDao.java
+4
-0
SettlementDriverDetailDao.java
...clx/performance/dao/settle/SettlementDriverDetailDao.java
+2
-0
SettlementOwnerDetailDao.java
.../clx/performance/dao/settle/SettlementOwnerDetailDao.java
+1
-0
EventListenerComponent.java
...ava/com/clx/performance/event/EventListenerComponent.java
+37
-0
OwnerLoanFlagEvent.java
...in/java/com/clx/performance/event/OwnerLoanFlagEvent.java
+30
-0
OwnerLoanAccountMapper.java
...m/clx/performance/mapper/loan/OwnerLoanAccountMapper.java
+2
-2
OwnerLoanRecordServiceImpl.java
...ormance/service/impl/loan/OwnerLoanRecordServiceImpl.java
+16
-5
OwnerRepaymentServiceImpl.java
...formance/service/impl/loan/OwnerRepaymentServiceImpl.java
+40
-9
没有找到文件。
performance-web/src/main/java/com/clx/performance/dao/impl/loan/OwnerLoanAccountRunningWaterRecordDaoImpl.java
浏览文件 @
1863731c
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.clx.performance.dao.loan.OwnerLoanAccountRunningWaterRecordDao
;
import
com.clx.performance.enums.loan.OwnerLoanAccountRunningWaterRecordEnum
;
import
com.clx.performance.mapper.loan.OwnerLoanAccountRunningWaterRecordMapper
;
import
com.clx.performance.model.loan.OwnerLoanAccountRunningWaterRecord
;
import
com.clx.performance.param.pc.loan.carrier.PageOwnerLoanAccountWaterRecordOfOwnerParam
;
...
...
@@ -92,4 +93,11 @@ public class OwnerLoanAccountRunningWaterRecordDaoImpl extends BaseDaoImpl<Owner
.
orderByAsc
(
OwnerLoanAccountRunningWaterRecord:
:
getId
)
);
}
@Override
public
List
<
OwnerLoanAccountRunningWaterRecord
>
selectLoanRunningWatterRecord
(
Long
loanNo
)
{
return
baseMapper
.
selectList
(
lQrWrapper
().
eq
(
OwnerLoanAccountRunningWaterRecord:
:
getLoanNo
,
loanNo
)
.
eq
(
OwnerLoanAccountRunningWaterRecord:
:
getRunningWaterType
,
OwnerLoanAccountRunningWaterRecordEnum
.
RunWaterType
.
APPROVE_FROZEN
.
getCode
())
);
}
}
performance-web/src/main/java/com/clx/performance/dao/impl/settle/SettlementDriverDaoImpl.java
浏览文件 @
1863731c
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.clx.performance.dao.settle.SettlementDriverDao
;
import
com.clx.performance.enums.loan.OwnerLoanRecordEnum
;
import
com.clx.performance.mapper.settle.SettlementDriverMapper
;
import
com.clx.performance.model.settle.SettlementDriver
;
import
com.clx.performance.param.pc.driver.PageCarrierSettlementDriverParam
;
...
...
@@ -13,6 +14,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.stereotype.Repository
;
import
java.util.Objects
;
import
java.util.Set
;
/**
* @Author: aiqinguo
...
...
@@ -57,4 +59,11 @@ public class SettlementDriverDaoImpl extends BaseDaoImpl<SettlementDriverMapper,
)
.
map
(
super
::
getOne
);
}
@Override
public
void
updateLoanFlagByChildNoList
(
Set
<
String
>
childNoList
)
{
update
(
lUdWrapper
().
in
(
SettlementDriver:
:
getChildNo
,
childNoList
)
.
set
(
SettlementDriver:
:
getLoanFlag
,
OwnerLoanRecordEnum
.
LoanFlag
.
RE_PAY
.
getCode
())
);
}
}
performance-web/src/main/java/com/clx/performance/dao/impl/settle/SettlementDriverDetailDaoImpl.java
浏览文件 @
1863731c
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.clx.performance.dao.settle.SettlementDriverDetailDao
;
import
com.clx.performance.enums.loan.OwnerLoanRecordEnum
;
import
com.clx.performance.mapper.settle.SettlementDriverDetailMapper
;
import
com.clx.performance.model.settle.SettlementDriverDetail
;
import
com.clx.performance.param.pc.driver.PageCarrierSettlementDriverDetailParam
;
...
...
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Repository;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Set
;
/**
* @Author: aiqinguo
...
...
@@ -81,4 +83,12 @@ public class SettlementDriverDetailDaoImpl extends BaseDaoImpl<SettlementDriverD
return
baseMapper
.
findByDriverSettlementIds
(
ids
);
}
@Override
public
void
updateLoanFlagByChildNoList
(
Set
<
String
>
childNoList
)
{
update
(
lUdWrapper
()
.
in
(
SettlementDriverDetail:
:
getChildNo
,
childNoList
)
.
set
(
SettlementDriverDetail:
:
getLoanFlag
,
OwnerLoanRecordEnum
.
LoanFlag
.
RE_PAY
.
getCode
())
);
}
}
performance-web/src/main/java/com/clx/performance/dao/loan/OwnerLoanAccountRunningWaterRecordDao.java
浏览文件 @
1863731c
...
...
@@ -26,4 +26,6 @@ public interface OwnerLoanAccountRunningWaterRecordDao extends BaseDao<OwnerLoan
OwnerLoanAccountRunningWaterRecord
getOneByChildNoAndStatus
(
String
childNo
,
Integer
type
);
List
<
OwnerLoanAccountRunningWaterRecord
>
getListByOrderNoAndRunningWaterType
(
String
childNo
,
Integer
runningWaterType
);
List
<
OwnerLoanAccountRunningWaterRecord
>
selectLoanRunningWatterRecord
(
Long
loanNo
);
}
performance-web/src/main/java/com/clx/performance/dao/settle/SettlementDriverDao.java
浏览文件 @
1863731c
...
...
@@ -7,6 +7,8 @@ import com.clx.performance.param.pc.driver.PageCarrierSettlementDriverParam;
import
com.msl.common.base.Optional
;
import
com.msl.common.dao.BaseDao
;
import
java.util.Set
;
/**
* @Author: aiqinguo
* @Description: 车主结算单
...
...
@@ -18,4 +20,6 @@ public interface SettlementDriverDao extends BaseDao<SettlementDriverMapper, Set
Optional
<
SettlementDriver
>
getByChildNo
(
String
childNo
);
void
updateLoanFlagByChildNoList
(
Set
<
String
>
childNoList
);
}
performance-web/src/main/java/com/clx/performance/dao/settle/SettlementDriverDetailDao.java
浏览文件 @
1863731c
...
...
@@ -9,6 +9,7 @@ import com.msl.common.dao.BaseDao;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.Set
;
/**
* @Author: aiqinguo
...
...
@@ -31,4 +32,5 @@ public interface SettlementDriverDetailDao extends BaseDao<SettlementDriverDetai
List
<
SettlementDriverDetail
>
findByDriverSettlementIds
(
List
<
Integer
>
ids
);
void
updateLoanFlagByChildNoList
(
Set
<
String
>
childNoList
);
}
performance-web/src/main/java/com/clx/performance/dao/settle/SettlementOwnerDetailDao.java
浏览文件 @
1863731c
...
...
@@ -10,6 +10,7 @@ import com.msl.common.dao.BaseDao;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Set
;
/**
...
...
performance-web/src/main/java/com/clx/performance/event/EventListenerComponent.java
浏览文件 @
1863731c
package
com
.
clx
.
performance
.
event
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.exceptions.ExceptionUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.clx.performance.component.OrderChildLoanComponent
;
import
com.clx.performance.dao.loan.OrderChildLoanRetryRecordDao
;
import
com.clx.performance.dao.loan.OwnerLoanAccountRunningWaterRecordDao
;
import
com.clx.performance.dao.loan.OwnerRepaymentDao
;
import
com.clx.performance.dao.settle.SettlementDriverDao
;
import
com.clx.performance.dao.settle.SettlementDriverDetailDao
;
import
com.clx.performance.dao.settle.SettlementOwnerDetailDao
;
import
com.clx.performance.dto.OwnerLoanMqDTO
;
...
...
@@ -12,6 +15,7 @@ import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
import
com.clx.performance.enums.loan.OwnerRePaymentEnum
;
import
com.clx.performance.model.OrderChild
;
import
com.clx.performance.model.loan.OrderChildLoanRetryRecord
;
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
;
...
...
@@ -23,6 +27,11 @@ import org.springframework.context.event.EventListener;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
@Component
@Slf4j
@AllArgsConstructor
...
...
@@ -42,6 +51,10 @@ public class EventListenerComponent {
private
final
ApplicationEventPublisher
applicationEventPublisher
;
private
final
SettlementDriverDao
settlementDriverDao
;
private
final
OwnerLoanAccountRunningWaterRecordDao
ownerLoanAccountRunningWaterRecordDao
;
@EventListener
(
classes
=
{
SettlementUpdateEvent
.
class
})
public
void
listen
(
SettlementUpdateEvent
event
)
{
...
...
@@ -94,4 +107,28 @@ public class EventListenerComponent {
// 发送mq 通过开票标识
settlementMqService
.
invoiceTypeSync
(
settlementDriverDetail
.
getChildNo
(),
settlementDriverDetail
.
getInvoiceType
());
}
@EventListener
(
classes
=
{
OwnerLoanFlagEvent
.
class
})
public
void
listen
(
OwnerLoanFlagEvent
event
)
{
log
.
info
(
"OwnerLoanFlagEvent事件执行"
);
Long
loanNo
=
event
.
getLoanNo
();
List
<
OwnerLoanAccountRunningWaterRecord
>
records
=
ownerLoanAccountRunningWaterRecordDao
.
selectLoanRunningWatterRecord
(
loanNo
);
if
(
CollectionUtil
.
isEmpty
(
records
))
{
return
;
}
Map
<
String
,
List
<
OwnerLoanAccountRunningWaterRecord
>>
listMap
=
records
.
stream
().
collect
(
Collectors
.
groupingBy
(
OwnerLoanAccountRunningWaterRecord:
:
getChildNo
));
for
(
Map
.
Entry
<
String
,
List
<
OwnerLoanAccountRunningWaterRecord
>>
entry
:
listMap
.
entrySet
())
{
if
(
entry
.
getValue
().
size
()
>
1
)
{
log
.
info
(
"当前运单{}存在多条流水,不更新还款标志"
,
entry
.
getKey
());
listMap
.
remove
(
entry
.
getKey
());
}
}
log
.
info
(
"当前需要更新的运单数量:{}"
,
listMap
.
size
());
settlementDriverDetailDao
.
updateLoanFlagByChildNoList
(
listMap
.
keySet
());
settlementDriverDao
.
updateLoanFlagByChildNoList
(
listMap
.
keySet
());
}
}
performance-web/src/main/java/com/clx/performance/event/OwnerLoanFlagEvent.java
0 → 100644
浏览文件 @
1863731c
package
com
.
clx
.
performance
.
event
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.context.ApplicationEvent
;
@Getter
@Setter
public
class
OwnerLoanFlagEvent
extends
ApplicationEvent
{
private
Long
loanNo
;
/**
* Create a new {@code ApplicationEvent}.
*
* @param source the object on which the event initially occurred or with
* which the event is associated (never {@code null})
*/
public
OwnerLoanFlagEvent
(
Object
source
)
{
super
(
source
);
}
public
OwnerLoanFlagEvent
(
Object
source
,
Long
loanNo
)
{
super
(
source
);
this
.
loanNo
=
loanNo
;
}
}
performance-web/src/main/java/com/clx/performance/mapper/loan/OwnerLoanAccountMapper.java
浏览文件 @
1863731c
...
...
@@ -21,7 +21,7 @@ public interface OwnerLoanAccountMapper extends BaseMapper<OwnerLoanAccount> {
@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}"
+
",virtually_frozen_balance = virtually_frozen_balance + #{account.virtuallyFrozenBalance}
,funding_arrears = funding_arrears + #{account.fundingArrears},virtually_arrears = virtually_arrears + #{account.virtuallyArrears}
"
+
",modified_time=#{now}"
+
"where id = #{account.id} and modified_time = #{account.modifiedTime}"
)
...
...
@@ -30,7 +30,7 @@ public interface OwnerLoanAccountMapper extends BaseMapper<OwnerLoanAccount> {
@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}"
+
",virtually_frozen_balance = virtually_frozen_balance + #{account.virtuallyFrozenBalance}
,funding_arrears = funding_arrears - #{account.fundingArrears},virtually_arrears = virtually_arrears - #{account.virtuallyArrears}
"
+
",modified_time=#{now}"
+
"where id = #{account.id} and modified_time = #{account.modifiedTime}"
)
...
...
performance-web/src/main/java/com/clx/performance/service/impl/loan/OwnerLoanRecordServiceImpl.java
浏览文件 @
1863731c
...
...
@@ -223,6 +223,9 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
entity
.
setVirtuallyFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyUsableBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setModifiedTime
(
ownerLoanAccount
.
getModifiedTime
());
entity
.
setFundingArrears
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyArrears
(
ownerLoanRecord
.
getLoanBalance
());
Integer
flag
=
ownerLoanAccountDao
.
updateAccountCAS
(
entity
,
LocalDateTime
.
now
(),
true
);
if
(
flag
==
1
)
{
//生成借款流水
...
...
@@ -605,13 +608,17 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
ownerLoanRecord
.
getOwnerUserNo
()).
get
();
OwnerLoanAccount
entity
=
new
OwnerLoanAccount
();
entity
.
setId
(
ownerLoanAccount
.
getId
());
entity
.
setFundingAccountBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingUsableBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyAccountBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setVirtuallyAccountBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyUsableBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setVirtuallyUsableBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingAccountBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setFundingFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingUsableBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setFundingArrears
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setVirtuallyArrears
(
BigDecimal
.
ZERO
);
entity
.
setModifiedTime
(
ownerLoanAccount
.
getModifiedTime
());
Integer
flag
=
ownerLoanAccountDao
.
updateAccountCAS
(
entity
,
LocalDateTime
.
now
(),
true
);
if
(
flag
==
1
)
{
//生成借款流水
...
...
@@ -747,6 +754,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
update
.
setFundingAccountBalance
(
BigDecimal
.
ZERO
);
update
.
setFundingFrozenBalance
(
BigDecimal
.
ZERO
);
update
.
setFundingUsableBalance
(
BigDecimal
.
ZERO
);
update
.
setFundingArrears
(
BigDecimal
.
ZERO
);
update
.
setVirtuallyArrears
(
BigDecimal
.
ZERO
);
}
else
{
log
.
info
(
"进行资金信息赋值"
);
update
.
setId
(
account
.
getId
());
...
...
@@ -758,6 +767,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
update
.
setVirtuallyFrozenBalance
(
BigDecimal
.
ZERO
);
update
.
setVirtuallyUsableBalance
(
BigDecimal
.
ZERO
);
update
.
setVirtuallyAccountBalance
(
BigDecimal
.
ZERO
);
update
.
setFundingArrears
(
BigDecimal
.
ZERO
);
update
.
setVirtuallyArrears
(
BigDecimal
.
ZERO
);
}
}
...
...
performance-web/src/main/java/com/clx/performance/service/impl/loan/OwnerRepaymentServiceImpl.java
浏览文件 @
1863731c
...
...
@@ -15,20 +15,16 @@ import com.clx.performance.config.ClxMessageConfig;
import
com.clx.performance.config.loan.ClxPayeeConfig
;
import
com.clx.performance.config.loan.PaymentFromConfig
;
import
com.clx.performance.config.nbbank.NbBankConfig
;
import
com.clx.performance.dao.loan.BankTradeDao
;
import
com.clx.performance.dao.loan.OwnerLoanRecordDao
;
import
com.clx.performance.dao.loan.OwnerPaymentDao
;
import
com.clx.performance.dao.loan.OwnerRepaymentDao
;
import
com.clx.performance.dao.loan.*
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.loan.OwnerLoanRecordEnum
;
import
com.clx.performance.enums.loan.OwnerPaymentEnum
;
import
com.clx.performance.enums.loan.OwnerRePaymentEnum
;
import
com.clx.performance.enums.nbbank.NbBankStatusEnum
;
import
com.clx.performance.event.OwnerLoanFlagEvent
;
import
com.clx.performance.event.OwnerRepaymentUpdateEvent
;
import
com.clx.performance.extranal.user.impl.OwnerInfoServiceImpl
;
import
com.clx.performance.model.loan.BankTrade
;
import
com.clx.performance.model.loan.OwnerLoanRecord
;
import
com.clx.performance.model.loan.OwnerPayment
;
import
com.clx.performance.model.loan.OwnerRepayment
;
import
com.clx.performance.model.loan.*
;
import
com.clx.performance.param.pc.loan.carrier.PageCarrierOwnerRepaymentParam
;
import
com.clx.performance.param.pc.loan.carrier.PageOwnerRepaymentOfOwner
;
import
com.clx.performance.param.pc.loan.owner.ExportPaymentApplicationFormParam
;
...
...
@@ -54,9 +50,11 @@ import com.msl.user.data.UserSessionData;
import
com.msl.user.utils.TokenUtil
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.*
;
...
...
@@ -84,6 +82,8 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
private
final
IdGenerateSnowFlake
idGenerateSnowFlake
;
private
final
OwnerPaymentDao
ownerPaymentDao
;
private
final
OwnerLoanRecordDao
ownerLoanRecordDao
;
private
final
ApplicationEventPublisher
applicationEventPublisher
;
private
final
OwnerLoanAccountDao
ownerLoanAccountDao
;
@Override
public
IPage
<
OwnerRepaymentVO
>
pageOwnerRepayment
(
PageCarrierOwnerRepaymentParam
param
)
{
...
...
@@ -271,12 +271,40 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
// 查询还款信息
OwnerRepayment
ownerRepayment
=
ownerRepaymentDao
.
getOneByField
(
OwnerRepayment:
:
getRepaymentNo
,
bankTrade
.
getRelationNo
()).
get
();
ownerRepayment
.
setStatus
(
OwnerRePaymentEnum
.
Status
.
PAY_SUCCESS
.
getCode
());
// 更新
借
款信息
// 更新
还
款信息
ownerRepaymentDao
.
updateStatusById
(
ownerRepayment
);
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
getOneByField
(
OwnerLoanRecord:
:
getLoanNo
,
ownerRepayment
.
getLoanNo
()).
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
while
(
true
)
{
OwnerLoanAccount
ownerLoanAccount
=
ownerLoanAccountDao
.
getOneByField
(
OwnerLoanAccount:
:
getOwnerUserNo
,
ownerLoanRecord
.
getOwnerUserNo
()).
get
();
OwnerLoanAccount
entity
=
new
OwnerLoanAccount
();
if
(
OwnerLoanRecordEnum
.
LoanType
.
FUND
.
getCode
().
equals
(
ownerLoanRecord
.
getLoanType
()))
{
entity
.
setFundingArrears
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setVirtuallyArrears
(
BigDecimal
.
ZERO
);
}
else
{
entity
.
setFundingArrears
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyArrears
(
ownerLoanRecord
.
getLoanBalance
());
}
entity
.
setFundingFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingUsableBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingAccountBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyUsableBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyAccountBalance
(
BigDecimal
.
ZERO
);
entity
.
setId
(
ownerLoanAccount
.
getId
());
entity
.
setModifiedTime
(
ownerLoanAccount
.
getModifiedTime
());
Integer
flag
=
ownerLoanAccountDao
.
updateAccountCAS
(
entity
,
LocalDateTime
.
now
(),
false
);
if
(
flag
>
0
)
{
break
;
}
}
//生成付款记录
OwnerPayment
ownerPayment
=
new
OwnerPayment
();
ownerPayment
.
setOwnerUserNo
(
ownerRepayment
.
getOwnerUserNo
());
...
...
@@ -297,6 +325,9 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
ownerPayment
.
setPayChannel
(
OwnerLoanRecordEnum
.
PayChannel
.
ASSET
.
getCode
());
ownerPayment
.
setCreateBy
(
"系统"
);
ownerPaymentDao
.
saveEntity
(
ownerPayment
);
applicationEventPublisher
.
publishEvent
(
new
OwnerLoanFlagEvent
(
this
,
ownerRepayment
.
getLoanNo
()));
}
@Override
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论