Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
910bd4c2
提交
910bd4c2
authored
2月 26, 2024
作者:
huyufan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
借款异常手动回滚事务
上级
cedf7005
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
1 行删除
+17
-1
OrderChildLoanComponent.java
...om/clx/performance/component/OrderChildLoanComponent.java
+6
-1
OwnerLoanListener.java
.../java/com/clx/performance/listener/OwnerLoanListener.java
+11
-0
没有找到文件。
performance-web/src/main/java/com/clx/performance/component/OrderChildLoanComponent.java
浏览文件 @
910bd4c2
...
@@ -41,6 +41,9 @@ import org.redisson.api.RLock;
...
@@ -41,6 +41,9 @@ import org.redisson.api.RLock;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.transaction.TransactionDefinition
;
import
org.springframework.transaction.TransactionStatus
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -75,6 +78,8 @@ public class OrderChildLoanComponent {
...
@@ -75,6 +78,8 @@ public class OrderChildLoanComponent {
private
final
ApplicationEventPublisher
applicationEventPublisher
;
private
final
ApplicationEventPublisher
applicationEventPublisher
;
/**
/**
* 接单校验判断
* 接单校验判断
*
*
...
@@ -177,8 +182,8 @@ public class OrderChildLoanComponent {
...
@@ -177,8 +182,8 @@ public class OrderChildLoanComponent {
* @param settlementDriverDetail
* @param settlementDriverDetail
* @param settlementOwnerDetail
* @param settlementOwnerDetail
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
childLoanConfirmAfterProcess
(
SettlementDriverDetail
settlementDriverDetail
,
SettlementOwnerDetail
settlementOwnerDetail
,
OrderChild
orderChild
)
{
public
void
childLoanConfirmAfterProcess
(
SettlementDriverDetail
settlementDriverDetail
,
SettlementOwnerDetail
settlementOwnerDetail
,
OrderChild
orderChild
)
{
log
.
info
(
"1.运单确认收货后借款相关处理执行"
);
log
.
info
(
"1.运单确认收货后借款相关处理执行"
);
//临时结算金额,借款抵扣后需要重新赋值结算金额为0,如果不需要借款相关逻辑,正常设置结算金额
//临时结算金额,借款抵扣后需要重新赋值结算金额为0,如果不需要借款相关逻辑,正常设置结算金额
settlementOwnerDetail
.
setSettlementFreight
(
settlementFreightCalc
(
orderChild
.
getSettlementWay
(),
settlementOwnerDetail
));
settlementOwnerDetail
.
setSettlementFreight
(
settlementFreightCalc
(
orderChild
.
getSettlementWay
(),
settlementOwnerDetail
));
...
...
performance-web/src/main/java/com/clx/performance/listener/OwnerLoanListener.java
浏览文件 @
910bd4c2
...
@@ -17,6 +17,9 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -17,6 +17,9 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.transaction.TransactionDefinition
;
import
org.springframework.transaction.TransactionStatus
;
/**
/**
* 处理货主借款监听器
* 处理货主借款监听器
...
@@ -36,9 +39,14 @@ public class OwnerLoanListener {
...
@@ -36,9 +39,14 @@ public class OwnerLoanListener {
private
final
SettlementDriverDetailDao
settlementDriverDetailDao
;
private
final
SettlementDriverDetailDao
settlementDriverDetailDao
;
private
final
PlatformTransactionManager
platformTransactionManager
;
private
final
TransactionDefinition
transactionDefinition
;
@RabbitListener
(
queues
=
RabbitKeyConstants
.
OWNER_LOAN_QUEUE
)
@RabbitListener
(
queues
=
RabbitKeyConstants
.
OWNER_LOAN_QUEUE
)
public
void
onMessage
(
String
message
)
{
public
void
onMessage
(
String
message
)
{
TransactionStatus
transactionStatus
=
platformTransactionManager
.
getTransaction
(
transactionDefinition
);
log
.
info
(
"处理货主借款监听器执行,数据为{}"
,
message
);
log
.
info
(
"处理货主借款监听器执行,数据为{}"
,
message
);
OwnerLoanMqDTO
param
=
JSONUtil
.
toBean
(
message
,
OwnerLoanMqDTO
.
class
);
OwnerLoanMqDTO
param
=
JSONUtil
.
toBean
(
message
,
OwnerLoanMqDTO
.
class
);
SettlementOwnerDetail
settlementOwnerDetail
=
param
.
getSettlementOwnerDetail
();
SettlementOwnerDetail
settlementOwnerDetail
=
param
.
getSettlementOwnerDetail
();
...
@@ -53,6 +61,7 @@ public class OwnerLoanListener {
...
@@ -53,6 +61,7 @@ public class OwnerLoanListener {
settlementDriverDetail
.
setLoanFlag
(
OwnerLoanRecordEnum
.
LoanFlag
.
NO_LOAN
.
getCode
());
settlementDriverDetail
.
setLoanFlag
(
OwnerLoanRecordEnum
.
LoanFlag
.
NO_LOAN
.
getCode
());
applicationEventPublisher
.
publishEvent
(
new
SettlementUpdateEvent
(
this
,
settlementDriverDetail
,
settlementOwnerDetail
));
applicationEventPublisher
.
publishEvent
(
new
SettlementUpdateEvent
(
this
,
settlementDriverDetail
,
settlementOwnerDetail
));
log
.
error
(
"处理货主借款监听器执行异常,数据为{}"
,
message
,
e
);
log
.
error
(
"处理货主借款监听器执行异常,数据为{}"
,
message
,
e
);
platformTransactionManager
.
commit
(
transactionStatus
);
return
;
return
;
}
}
...
@@ -62,5 +71,7 @@ public class OwnerLoanListener {
...
@@ -62,5 +71,7 @@ public class OwnerLoanListener {
// 发送mq 通过开票标识
// 发送mq 通过开票标识
settlementMqService
.
invoiceTypeSync
(
settlementDriverDetail
.
getChildNo
(),
settlementDriverDetail
.
getInvoiceType
());
settlementMqService
.
invoiceTypeSync
(
settlementDriverDetail
.
getChildNo
(),
settlementDriverDetail
.
getInvoiceType
());
platformTransactionManager
.
commit
(
transactionStatus
);
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论