Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
ef4430aa
提交
ef4430aa
authored
2月 28, 2024
作者:
liuhaiquan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/v10.7_borrowing_and_repayment_20240118'…
Merge remote-tracking branch 'origin/v10.7_borrowing_and_repayment_20240118' into v10.7_borrowing_and_repayment_20240118
上级
18b97d56
04a81113
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
187 行增加
和
125 行删除
+187
-125
OrderChildLoanComponent.java
...om/clx/performance/component/OrderChildLoanComponent.java
+45
-9
RabbitBeanConfig.java
...ain/java/com/clx/performance/config/RabbitBeanConfig.java
+17
-0
RabbitKeyConstants.java
...java/com/clx/performance/constant/RabbitKeyConstants.java
+2
-2
OwnerLoanAccountRunningWaterRecordDaoImpl.java
.../impl/loan/OwnerLoanAccountRunningWaterRecordDaoImpl.java
+2
-2
OwnerLoanRecordDaoImpl.java
...clx/performance/dao/impl/loan/OwnerLoanRecordDaoImpl.java
+5
-0
OwnerLoanRecordDao.java
...java/com/clx/performance/dao/loan/OwnerLoanRecordDao.java
+1
-0
EventListenerComponent.java
...ava/com/clx/performance/event/EventListenerComponent.java
+20
-28
OwnerLoanThawEvent.java
...in/java/com/clx/performance/event/OwnerLoanThawEvent.java
+0
-1
OwnerLoanAccountThawListener.java
...lx/performance/listener/OwnerLoanAccountThawListener.java
+75
-0
OwnerLoanListener.java
.../java/com/clx/performance/listener/OwnerLoanListener.java
+0
-77
OwnerLoanRecordServiceImpl.java
...ormance/service/impl/loan/OwnerLoanRecordServiceImpl.java
+12
-5
OwnerRepaymentServiceImpl.java
...formance/service/impl/loan/OwnerRepaymentServiceImpl.java
+8
-1
没有找到文件。
performance-web/src/main/java/com/clx/performance/component/OrderChildLoanComponent.java
浏览文件 @
ef4430aa
...
...
@@ -33,6 +33,7 @@ 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.service.loan.OwnerLoanRecordService
;
import
com.clx.performance.service.settle.NetworkDriverRunningWaterRecordService
;
import
com.clx.user.vo.feign.OwnerInfoFeignVO
;
import
com.msl.common.exception.ServiceSystemException
;
import
lombok.AllArgsConstructor
;
...
...
@@ -79,6 +80,8 @@ public class OrderChildLoanComponent {
private
final
SettlementDriverDetailDao
settlementDriverDetailDao
;
private
final
NetworkDriverRunningWaterRecordService
networkDriverRunningWaterRecordService
;
/**
...
...
@@ -256,16 +259,48 @@ public class OrderChildLoanComponent {
}
else
if
(
alterationBalance
.
compareTo
(
settlementOwnerDetail
.
getSettlementFreight
())
>
0
)
{
//大于,则生成核销后,释放冻结的借款
log
.
info
(
"4.3 大于,则生成核销后,释放冻结的借款"
);
// 需求解冻的金额
BigDecimal
thawBigdecimal
=
(
settlementOwnerDetail
.
getSettlementFreight
().
subtract
(
alterationBalance
)).
negate
();
BigDecimal
alterationBalanceTemp
=
alterationBalance
;
List
<
OwnerLoanAccountRunningWaterRecord
>
frozenList
=
new
LinkedList
<>();
List
<
OwnerLoanAccountRunningWaterRecord
>
thawList
=
new
LinkedList
<>();
for
(
int
i
=
0
;
i
<
runningWaterRecordList
.
size
();
i
++)
{
OwnerLoanAccountRunningWaterRecord
record
=
runningWaterRecordList
.
get
(
i
);
BigDecimal
balance
=
record
.
getAlterationBalance
();
if
(
alterationBalanceTemp
.
compareTo
(
balance
)
>=
0
)
{
frozenList
.
add
(
record
);
alterationBalanceTemp
=
alterationBalanceTemp
.
subtract
(
balance
);
log
.
info
(
"当前金额大于等于冻结金额,frozenList添加当前流水{},剩余alterationBalanceTemp{}"
,
record
.
getRunningWaterNo
(),
alterationBalanceTemp
.
toString
());
}
else
{
if
(
alterationBalanceTemp
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
thawList
.
add
(
record
);
log
.
info
(
"当前alterationBalanceTemp已经为0,thawList直接加入当前流水{}"
,
record
.
getRunningWaterNo
());
}
else
{
record
.
setAlterationBalance
(
balance
.
subtract
(
alterationBalanceTemp
));
thawList
.
add
(
record
);
log
.
info
(
"当前alterationBalanceTemp小于冻结金额,需要拆分,thawList存放流水记录为{}"
,
JSONUtil
.
parse
(
record
));
record
.
setAlterationBalance
(
alterationBalanceTemp
);
alterationBalanceTemp
=
BigDecimal
.
ZERO
;
frozenList
.
add
(
record
);
log
.
info
(
"当前alterationBalanceTemp小于冻结金额,需要拆分,frozenList存放流水记录为{}"
,
JSONUtil
.
parse
(
record
));
}
}
}
BigDecimal
thawBigdecimal
=
settlementOwnerDetail
.
getSettlementFreight
().
subtract
(
alterationBalance
);
OwnerLoanAccountRunningWaterRecord
entity
=
runningWaterRecordList
.
get
(
runningWaterRecordList
.
size
()
-
1
);
Long
loanNo
=
entity
.
getLoanNo
();
Integer
loanType
=
entity
.
getLoanType
();
entity
.
setAlterationBalance
(
entity
.
getAlterationBalance
().
subtract
(
thawBigdecimal
.
negate
()));
//核销扣除
childWriteOffOwnerLoanAccount
(
runningWaterRecordList
);
//多余的金额需要生成解冻流水
thawOwnerLoanAccount
(
loanNo
,
loanType
,
entity
.
getOwnerUserNo
(),
entity
.
getOwnerUserName
(),
entity
.
getMobile
(),
entity
.
getChildNo
(),
thawBigdecimal
.
negate
());
childWriteOffOwnerLoanAccount
(
frozenList
);
if
(
CollectionUtil
.
isNotEmpty
(
thawList
))
{
OwnerLoanAccountRunningWaterRecord
entity
=
runningWaterRecordList
.
get
(
0
);
Long
loanNo
=
entity
.
getLoanNo
();
Integer
loanType
=
entity
.
getLoanType
();
//多余的金额需要生成解冻流水
thawOwnerLoanAccount
(
loanNo
,
loanType
,
entity
.
getOwnerUserNo
(),
entity
.
getOwnerUserName
(),
entity
.
getMobile
(),
entity
.
getChildNo
(),
thawBigdecimal
);
}
}
else
{
log
.
info
(
"4.4 冻结的借款不够了"
);
...
...
@@ -294,7 +329,8 @@ public class OrderChildLoanComponent {
// 抵扣金额
settlementOwnerDetail
.
setLoanFreight
(
settlementOwnerDetail
.
getSettlementFreight
());
settlementOwnerDetail
.
setSettlementFreight
(
BigDecimal
.
ZERO
);
//生成提现记录
networkDriverRunningWaterRecordService
.
generateNetworkCaseOutRecord
(
settlementDriverDetail
);
}
//归还借款单的剩余金额+解冻流水
...
...
performance-web/src/main/java/com/clx/performance/config/RabbitBeanConfig.java
浏览文件 @
ef4430aa
...
...
@@ -205,4 +205,21 @@ public class RabbitBeanConfig {
}
/**
* 货主借款冻结释放队列
* @return
*/
@Bean
public
Queue
ownerLoanThawQueue
()
{
return
new
Queue
(
RabbitKeyConstants
.
OWNER_LOAN_THAW_QUEUE
,
true
,
false
,
false
);
}
/**
* 货主还款bind
* @return
*/
@Bean
public
Binding
ownerLoanThawBind
()
{
return
BindingBuilder
.
bind
(
ownerLoanThawQueue
()).
to
(
ownerLoanExchange
()).
with
(
RabbitKeyConstants
.
OWNER_LOAN_THAW_ROUTE_KEY
);
}
}
performance-web/src/main/java/com/clx/performance/constant/RabbitKeyConstants.java
浏览文件 @
ef4430aa
...
...
@@ -90,9 +90,9 @@ public class RabbitKeyConstants {
public
static
final
String
OWNER_LOAN_PAY_QUEUE
=
"clx-performance.loan.pay.queue"
;
public
static
final
String
OWNER_LOAN_
ROUTE_KEY
=
"clx-performance.loan
.route.key"
;
public
static
final
String
OWNER_LOAN_
THAW_ROUTE_KEY
=
"clx-performance.loan.thaw
.route.key"
;
public
static
final
String
OWNER_LOAN_
QUEUE
=
"clx-performance.loan
.queue"
;
public
static
final
String
OWNER_LOAN_
THAW_QUEUE
=
"clx-performance.loan.thaw
.queue"
;
public
static
final
String
OWNER_REPAYMENT_QUEUE
=
"clx-performance.owner.repayment.queue"
;
public
static
final
String
OWNER_REPAYMENT_ROUTE_KEY
=
"clx-performance.owner.repayment.route.key"
;
...
...
performance-web/src/main/java/com/clx/performance/dao/impl/loan/OwnerLoanAccountRunningWaterRecordDaoImpl.java
浏览文件 @
ef4430aa
...
...
@@ -98,8 +98,8 @@ public class OwnerLoanAccountRunningWaterRecordDaoImpl extends BaseDaoImpl<Owner
public
List
<
OwnerLoanAccountRunningWaterRecord
>
getListByChildNoAndRunningWaterType
(
String
childNo
)
{
return
baseMapper
.
selectList
(
lQrWrapper
().
eq
(
OwnerLoanAccountRunningWaterRecord:
:
getChildNo
,
childNo
)
.
in
(
OwnerLoanAccountRunningWaterRecord:
:
getRunningWaterType
,
OwnerLoanAccountRunningWaterRecordEnum
.
RunWaterType
.
APPROVE_FROZEN
,
OwnerLoanAccountRunningWaterRecordEnum
.
RunWaterType
.
APPROVE_THAW
OwnerLoanAccountRunningWaterRecordEnum
.
RunWaterType
.
APPROVE_FROZEN
.
getCode
()
,
OwnerLoanAccountRunningWaterRecordEnum
.
RunWaterType
.
APPROVE_THAW
.
getCode
()
)
.
orderByAsc
(
OwnerLoanAccountRunningWaterRecord:
:
getId
)
);
...
...
performance-web/src/main/java/com/clx/performance/dao/impl/loan/OwnerLoanRecordDaoImpl.java
浏览文件 @
ef4430aa
...
...
@@ -107,5 +107,10 @@ public class OwnerLoanRecordDaoImpl extends BaseDaoImpl<OwnerLoanRecordMapper, O
);
}
@Override
public
OwnerLoanRecord
selectOneByLoanNo
(
Long
loanNo
)
{
return
baseMapper
.
selectOne
(
lQrWrapper
().
eq
(
OwnerLoanRecord:
:
getLoanNo
,
loanNo
));
}
}
performance-web/src/main/java/com/clx/performance/dao/loan/OwnerLoanRecordDao.java
浏览文件 @
ef4430aa
...
...
@@ -30,4 +30,5 @@ public interface OwnerLoanRecordDao extends BaseDao<OwnerLoanRecordMapper, Owner
boolean
updateStatusById
(
OwnerLoanRecord
item
);
OwnerLoanRecord
selectOneByLoanNo
(
Long
loanNo
);
}
performance-web/src/main/java/com/clx/performance/event/EventListenerComponent.java
浏览文件 @
ef4430aa
...
...
@@ -4,6 +4,7 @@ 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.constant.RabbitKeyConstants
;
import
com.clx.performance.dao.loan.OrderChildLoanRetryRecordDao
;
import
com.clx.performance.dao.loan.OwnerLoanAccountRunningWaterRecordDao
;
import
com.clx.performance.dao.loan.OwnerRepaymentDao
;
...
...
@@ -11,6 +12,7 @@ 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
;
import
com.clx.performance.enums.loan.BankTradeEnum
;
import
com.clx.performance.enums.loan.OwnerLoanAccountRunningWaterRecordEnum
;
import
com.clx.performance.enums.loan.OwnerLoanRecordEnum
;
import
com.clx.performance.enums.loan.OwnerRePaymentEnum
;
...
...
@@ -24,14 +26,21 @@ import com.clx.performance.model.settle.SettlementOwnerDetail;
import
com.clx.performance.service.settle.SettlementMqService
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.core.MessageBuilder
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.context.event.EventListener
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.transaction.event.TransactionPhase
;
import
org.springframework.transaction.event.TransactionalEventListener
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
...
...
@@ -58,13 +67,14 @@ public class EventListenerComponent {
private
final
OwnerLoanAccountRunningWaterRecordDao
ownerLoanAccountRunningWaterRecordDao
;
private
final
RabbitTemplate
rabbitTemplate
;
@EventListener
(
classes
=
{
SettlementUpdateEvent
.
class
})
public
void
listen
(
SettlementUpdateEvent
event
)
{
log
.
info
(
"SettlementUpdateEvent事件执行"
);
SettlementOwnerDetail
settlementOwnerDetail
=
event
.
getSettlementOwnerDetail
();
SettlementDriverDetail
settlementDriverDetail
=
event
.
getSettlementDriverDetail
();
log
.
info
(
"当前货主结算信息{},车主结算信息:{}"
,
JSONUtil
.
parse
(
settlementOwnerDetail
),
JSONUtil
.
parse
(
settlementDriverDetail
));
settlementOwnerDetailDao
.
updateInvoiceType
(
settlementOwnerDetail
);
settlementDriverDetailDao
.
updateInvoiceTypeAndPrepayFreightFlag
(
settlementDriverDetail
);
Integer
ownerId
=
settlementOwnerDetail
.
getId
();
...
...
@@ -76,6 +86,7 @@ public class EventListenerComponent {
entity
.
setSettlementOwnerId
(
ownerId
);
entity
.
setSettlementDriverId
(
driverId
);
entity
.
setOwnerUserNo
(
settlementOwnerDetail
.
getOwnerUserNo
());
log
.
info
(
"当前货主结算信息{},车主结算信息:{}"
,
JSONUtil
.
parse
(
settlementOwnerDetail
),
JSONUtil
.
parse
(
settlementDriverDetail
));
// 保存重试记录
orderChildLoanRetryRecordDao
.
saveEntity
(
entity
);
}
...
...
@@ -91,7 +102,8 @@ public class EventListenerComponent {
ownerRepaymentDao
.
updateEntityByKey
(
update
);
}
@EventListener
(
classes
=
{
OwnerLoanEvent
.
class
})
@Async
@TransactionalEventListener
(
classes
=
{
OwnerLoanEvent
.
class
},
phase
=
TransactionPhase
.
AFTER_COMMIT
,
fallbackExecution
=
true
)
public
void
listen
(
OwnerLoanEvent
event
)
{
log
.
info
(
"OwnerLoanEvent事件执行"
);
OwnerLoanMqDTO
param
=
event
.
getParam
();
...
...
@@ -168,37 +180,17 @@ public class EventListenerComponent {
}
@EventListener
(
classes
=
{
OwnerLoanThawEvent
.
class
})
@Async
@TransactionalEventListener
(
classes
=
{
OwnerLoanThawEvent
.
class
},
phase
=
TransactionPhase
.
BEFORE_COMMIT
,
fallbackExecution
=
true
)
public
void
listen
(
OwnerLoanThawEvent
event
)
{
log
.
info
(
"OwnerLoanThawEvent事件执行"
);
log
.
info
(
"需要解冻借款的的运单号:{}"
,
event
.
getChildNo
());
Message
message
=
MessageBuilder
.
withBody
(
event
.
getChildNo
().
getBytes
()).
build
();
List
<
OwnerLoanAccountRunningWaterRecord
>
runningWaterRecordList
=
ownerLoanAccountRunningWaterRecordDao
.
getListByChildNoAndRunningWaterType
(
event
.
getChildNo
());
if
(
CollectionUtil
.
isEmpty
(
runningWaterRecordList
))
{
return
;
}
Map
<
Integer
,
List
<
OwnerLoanAccountRunningWaterRecord
>>
listMap
=
runningWaterRecordList
.
stream
().
collect
(
Collectors
.
groupingBy
(
OwnerLoanAccountRunningWaterRecord:
:
getRunningWaterType
));
List
<
OwnerLoanAccountRunningWaterRecord
>
thawRecord
=
listMap
.
get
(
OwnerLoanAccountRunningWaterRecordEnum
.
RunWaterType
.
APPROVE_THAW
.
getCode
());
if
(
CollectionUtil
.
isNotEmpty
(
thawRecord
))
{
log
.
info
(
"3.1 有借款解冻记录,说明是是重复记录,直接返回"
);
return
;
}
else
{
runningWaterRecordList
=
listMap
.
get
(
OwnerLoanAccountRunningWaterRecordEnum
.
RunWaterType
.
APPROVE_FROZEN
.
getCode
());
}
Long
ownerUserNo
=
runningWaterRecordList
.
get
(
0
).
getOwnerUserNo
();
log
.
info
(
"当前解冻货主:{},流水记录长度{},流水记录{}"
,
ownerUserNo
,
runningWaterRecordList
.
size
(),
JSONUtil
.
parse
(
runningWaterRecordList
));
for
(
OwnerLoanAccountRunningWaterRecord
record
:
runningWaterRecordList
)
{
Long
loanNo
=
record
.
getLoanNo
();
Integer
loanType
=
record
.
getLoanType
();
String
ownerUserName
=
record
.
getOwnerUserName
();
String
childNo
=
record
.
getChildNo
();
BigDecimal
balance
=
record
.
getAlterationBalance
();
//解冻借款
orderChildLoanComponent
.
thawOwnerLoanAccount
(
loanNo
,
loanType
,
ownerUserNo
,
record
.
getMobile
(),
ownerUserName
,
childNo
,
balance
);
}
rabbitTemplate
.
send
(
RabbitKeyConstants
.
OWNER_LOAN_EXCHANGE
,
RabbitKeyConstants
.
OWNER_LOAN_THAW_ROUTE_KEY
,
message
);
}
}
performance-web/src/main/java/com/clx/performance/event/OwnerLoanThawEvent.java
浏览文件 @
ef4430aa
package
com
.
clx
.
performance
.
event
;
import
com.clx.performance.model.OrderChild
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.context.ApplicationEvent
;
...
...
performance-web/src/main/java/com/clx/performance/listener/OwnerLoanAccountThawListener.java
0 → 100644
浏览文件 @
ef4430aa
package
com
.
clx
.
performance
.
listener
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.clx.performance.component.OrderChildLoanComponent
;
import
com.clx.performance.constant.RabbitKeyConstants
;
import
com.clx.performance.dao.loan.OwnerLoanAccountRunningWaterRecordDao
;
import
com.clx.performance.dao.settle.SettlementDriverDetailDao
;
import
com.clx.performance.dao.settle.SettlementOwnerDetailDao
;
import
com.clx.performance.dto.OwnerLoanMqDTO
;
import
com.clx.performance.enums.loan.OwnerLoanAccountRunningWaterRecordEnum
;
import
com.clx.performance.enums.loan.OwnerLoanRecordEnum
;
import
com.clx.performance.event.SettlementUpdateEvent
;
import
com.clx.performance.model.OrderChild
;
import
com.clx.performance.model.loan.OwnerLoanAccountRunningWaterRecord
;
import
com.clx.performance.model.settle.SettlementDriverDetail
;
import
com.clx.performance.model.settle.SettlementOwnerDetail
;
import
com.clx.performance.service.settle.SettlementMqService
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.transaction.TransactionDefinition
;
import
org.springframework.transaction.TransactionStatus
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 处理货主借款冻结释放监听器
*/
@Slf4j
@Component
@AllArgsConstructor
public
class
OwnerLoanAccountThawListener
{
private
final
OrderChildLoanComponent
orderChildLoanComponent
;
private
final
OwnerLoanAccountRunningWaterRecordDao
ownerLoanAccountRunningWaterRecordDao
;
@RabbitListener
(
queues
=
RabbitKeyConstants
.
OWNER_LOAN_THAW_QUEUE
)
public
void
onMessage
(
String
message
)
{
log
.
info
(
"货主借款冻结释放监听器{}"
,
message
);
List
<
OwnerLoanAccountRunningWaterRecord
>
runningWaterRecordList
=
ownerLoanAccountRunningWaterRecordDao
.
getListByChildNoAndRunningWaterType
(
message
);
if
(
CollectionUtil
.
isEmpty
(
runningWaterRecordList
))
{
return
;
}
Map
<
Integer
,
List
<
OwnerLoanAccountRunningWaterRecord
>>
listMap
=
runningWaterRecordList
.
stream
().
collect
(
Collectors
.
groupingBy
(
OwnerLoanAccountRunningWaterRecord:
:
getRunningWaterType
));
List
<
OwnerLoanAccountRunningWaterRecord
>
thawRecord
=
listMap
.
get
(
OwnerLoanAccountRunningWaterRecordEnum
.
RunWaterType
.
APPROVE_THAW
.
getCode
());
if
(
CollectionUtil
.
isNotEmpty
(
thawRecord
))
{
log
.
info
(
"3.1 有借款解冻记录,说明是是重复记录,直接返回"
);
return
;
}
else
{
runningWaterRecordList
=
listMap
.
get
(
OwnerLoanAccountRunningWaterRecordEnum
.
RunWaterType
.
APPROVE_FROZEN
.
getCode
());
}
Long
ownerUserNo
=
runningWaterRecordList
.
get
(
0
).
getOwnerUserNo
();
log
.
info
(
"当前解冻货主:{},流水记录长度{},流水记录{}"
,
ownerUserNo
,
runningWaterRecordList
.
size
(),
JSONUtil
.
parse
(
runningWaterRecordList
));
for
(
OwnerLoanAccountRunningWaterRecord
record
:
runningWaterRecordList
)
{
Long
loanNo
=
record
.
getLoanNo
();
Integer
loanType
=
record
.
getLoanType
();
String
ownerUserName
=
record
.
getOwnerUserName
();
String
childNo
=
record
.
getChildNo
();
BigDecimal
balance
=
record
.
getAlterationBalance
();
//解冻借款
orderChildLoanComponent
.
thawOwnerLoanAccount
(
loanNo
,
loanType
,
ownerUserNo
,
record
.
getMobile
(),
ownerUserName
,
childNo
,
balance
);
}
}
}
performance-web/src/main/java/com/clx/performance/listener/OwnerLoanListener.java
deleted
100644 → 0
浏览文件 @
18b97d56
//package com.clx.performance.listener;
//
//import cn.hutool.json.JSONUtil;
//import com.clx.performance.component.OrderChildLoanComponent;
//import com.clx.performance.constant.RabbitKeyConstants;
//import com.clx.performance.dao.settle.SettlementDriverDetailDao;
//import com.clx.performance.dao.settle.SettlementOwnerDetailDao;
//import com.clx.performance.dto.OwnerLoanMqDTO;
//import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
//import com.clx.performance.event.SettlementUpdateEvent;
//import com.clx.performance.model.OrderChild;
//import com.clx.performance.model.settle.SettlementDriverDetail;
//import com.clx.performance.model.settle.SettlementOwnerDetail;
//import com.clx.performance.service.settle.SettlementMqService;
//import lombok.AllArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.context.ApplicationEventPublisher;
//import org.springframework.stereotype.Component;
//import org.springframework.transaction.PlatformTransactionManager;
//import org.springframework.transaction.TransactionDefinition;
//import org.springframework.transaction.TransactionStatus;
//
///**
// * 处理货主借款监听器
// */
//@Slf4j
//@Component
//@AllArgsConstructor
//public class OwnerLoanListener {
//
// private final OrderChildLoanComponent orderChildLoanComponent;
//
// private final SettlementMqService settlementMqService;
//
// private final ApplicationEventPublisher applicationEventPublisher;
//
// private final SettlementOwnerDetailDao settlementOwnerDetailDao;
//
// private final SettlementDriverDetailDao settlementDriverDetailDao;
//
// private final PlatformTransactionManager platformTransactionManager;
//
// private final TransactionDefinition transactionDefinition;
//
// @RabbitListener(queues = RabbitKeyConstants.OWNER_LOAN_QUEUE)
// public void onMessage(String message) {
// TransactionStatus transactionStatus = platformTransactionManager.getTransaction(transactionDefinition);
//
// log.info("处理货主借款监听器执行,数据为{}", message);
// OwnerLoanMqDTO param = JSONUtil.toBean(message, OwnerLoanMqDTO.class);
// SettlementOwnerDetail settlementOwnerDetail = param.getSettlementOwnerDetail();
// SettlementDriverDetail settlementDriverDetail = param.getSettlementDriverDetail();
// OrderChild orderChild = param.getOrderChild();
//
// try {
// //生成借款标识
// orderChildLoanComponent.childLoanConfirmAfterProcess(settlementDriverDetail, settlementOwnerDetail, orderChild);
// } catch (Exception e) {
// //未借款
// settlementDriverDetail.setLoanFlag(OwnerLoanRecordEnum.LoanFlag.NO_LOAN.getCode());
// applicationEventPublisher.publishEvent(new SettlementUpdateEvent(this, settlementDriverDetail, settlementOwnerDetail));
// log.error("处理货主借款监听器执行异常,数据为{}", message, e);
// platformTransactionManager.commit(transactionStatus);
//
// return;
// }
// log.info("处理货主借款监听器执行成功");
// settlementOwnerDetailDao.updateInvoiceType(settlementOwnerDetail);
// settlementDriverDetailDao.updateInvoiceTypeAndPrepayFreightFlag(settlementDriverDetail);
//
// // 发送mq 通过开票标识
// settlementMqService.invoiceTypeSync(settlementDriverDetail.getChildNo(), settlementDriverDetail.getInvoiceType());
// platformTransactionManager.commit(transactionStatus);
//
// }
//}
performance-web/src/main/java/com/clx/performance/service/impl/loan/OwnerLoanRecordServiceImpl.java
浏览文件 @
ef4430aa
...
...
@@ -185,7 +185,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
ownerLoanRecordApprove
(
CarrierOwnerLoanRecordApproveParam
param
)
{
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
getOneByField
(
OwnerLoanRecord:
:
getLoanNo
,
param
.
getLoanNo
()).
get
(
);
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
selectOneByLoanNo
(
param
.
getLoanNo
()
);
if
(!
ownerLoanRecord
.
getStatus
().
equals
(
OwnerLoanRecordEnum
.
Status
.
APPROVE_WAIT
.
getCode
()))
{
log
.
info
(
"当前借款单单号:{},状态:{}"
,
ownerLoanRecord
.
getLoanNo
(),
ownerLoanRecord
.
getStatus
());
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
...
...
@@ -500,8 +500,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
updateList
.
add
(
ownerLoanRecord
.
setLoanResidueBalance
(
BigDecimal
.
ZERO
));
orderChildPriceTemp
=
orderChildPriceTemp
.
subtract
(
loanResidueBalance
);
}
log
.
info
(
"当前虚拟币orderChildPriceTemp:{}"
,
orderChildPriceTemp
);
}
log
.
info
(
"当前虚拟币orderChildPriceTemp:{}"
,
orderChildPriceTemp
);
}
List
<
OwnerLoanRecord
>
fundList
=
listMap
.
get
(
OwnerLoanRecordEnum
.
LoanType
.
FUND
.
getCode
());
...
...
@@ -521,8 +521,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
updateList
.
add
(
ownerLoanRecord
.
setLoanResidueBalance
(
BigDecimal
.
ZERO
));
orderChildPriceTemp
=
orderChildPriceTemp
.
subtract
(
loanResidueBalance
);
}
log
.
info
(
"当前资金orderChildPriceTemp:{}"
,
orderChildPriceTemp
);
}
log
.
info
(
"当前资金orderChildPriceTemp:{}"
,
orderChildPriceTemp
);
}
...
...
@@ -732,8 +732,14 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
log
.
info
(
"宁波银行响应当前业务,不能取消{}"
,
JSONUtil
.
parse
(
result
));
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
OWNER_LOAN_RECORD_CANCEL_STATUS_ERROR
);
}
log
.
info
(
"借款记录取消,更新状态为待审批"
);
ownerLoanRecord
.
setStatus
(
OwnerLoanRecordEnum
.
Status
.
APPROVE_WAIT
.
getCode
());
if
(
OwnerLoanRecordEnum
.
LoanType
.
FUND
.
getCode
().
equals
(
ownerLoanRecord
.
getLoanType
()))
{
log
.
info
(
"借款记录取消,更新状态为待审批"
);
ownerLoanRecord
.
setStatus
(
OwnerLoanRecordEnum
.
Status
.
PAY_WAIT
.
getCode
());
}
else
{
ownerLoanRecord
.
setStatus
(
OwnerLoanRecordEnum
.
Status
.
APPROVE_WAIT
.
getCode
());
}
ownerLoanRecordDao
.
updateStatusById
(
ownerLoanRecord
);
if
(
OwnerLoanRecordEnum
.
PayChannel
.
ORDER_DIRECT_PAY
.
getCode
().
equals
(
ownerLoanRecord
.
getPayChannel
()))
{
...
...
@@ -765,6 +771,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
waterRecord
.
setLoanType
(
ownerLoanRecord
.
getLoanType
());
waterRecord
.
setRunningWaterNo
(
idGenerateSnowFlake
.
nextId
(
1L
));
waterRecord
.
setChildNo
(
childNo
);
waterRecord
.
setCreateTime
(
LocalDateTime
.
now
());
waterRecord
.
setRunningWaterType
(
OwnerLoanAccountRunningWaterRecordEnum
.
RunWaterType
.
APPROVE_FROZEN
.
getCode
());
waterRecord
.
setAlterationBalance
(
orderChildPrice
);
OwnerLoanAccount
account
=
ownerLoanAccountDao
.
getOneByField
(
OwnerLoanAccount:
:
getOwnerUserNo
,
...
...
performance-web/src/main/java/com/clx/performance/service/impl/loan/OwnerRepaymentServiceImpl.java
浏览文件 @
ef4430aa
...
...
@@ -39,6 +39,7 @@ import com.clx.performance.vo.pc.loan.owner.OwnerTransferPaymentDetailVO;
import
com.clx.performance.vo.pc.nbbank.NbBankOrderResultVO
;
import
com.clx.user.vo.feign.OwnerInfoFeignVO
;
import
com.clx.user.vo.pc.owner.OwnerBindCardVO
;
import
com.msl.common.base.Optional
;
import
com.msl.common.exception.ServiceSystemException
;
import
com.msl.common.result.Result
;
import
com.msl.common.utils.DateUtils
;
...
...
@@ -270,7 +271,13 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
BankTrade
bankTrade
=
bankTradeDao
.
getOneByField
(
BankTrade:
:
getMerchantRunningWaterNo
,
merSeqNo
)
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
// 查询还款信息
OwnerRepayment
ownerRepayment
=
ownerRepaymentDao
.
getOneByField
(
OwnerRepayment:
:
getRepaymentNo
,
bankTrade
.
getRelationNo
()).
get
();
Optional
<
OwnerRepayment
>
optional
=
ownerRepaymentDao
.
getOneByField
(
OwnerRepayment:
:
getRepaymentNo
,
bankTrade
.
getRelationNo
());
if
(!
optional
.
isPresent
()){
log
.
error
(
"还款信息不存在,通过流水号查询的bankTrade的relationNo未在还款中查询到,流水号{}"
,
merSeqNo
);
return
;
}
OwnerRepayment
ownerRepayment
=
optional
.
get
();
ownerRepayment
.
setStatus
(
OwnerRePaymentEnum
.
Status
.
PAY_SUCCESS
.
getCode
());
// 更新还款信息
ownerRepaymentDao
.
updateStatusById
(
ownerRepayment
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论