Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
a37ddd81
提交
a37ddd81
authored
2月 23, 2024
作者:
huyufan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
货主还款监听器开发
上级
cddd686f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
34 行增加
和
7 行删除
+34
-7
OwnerRepaymentPayNotifyListener.java
...performance/listener/OwnerRepaymentPayNotifyListener.java
+5
-7
OwnerRepaymentServiceImpl.java
...formance/service/impl/loan/OwnerRepaymentServiceImpl.java
+25
-0
OwnerRepaymentService.java
...m/clx/performance/service/loan/OwnerRepaymentService.java
+4
-0
没有找到文件。
performance-web/src/main/java/com/clx/performance/listener/OwnerRepaymentPayNotifyListener.java
浏览文件 @
a37ddd81
...
@@ -4,8 +4,7 @@ import cn.hutool.json.JSONUtil;
...
@@ -4,8 +4,7 @@ import cn.hutool.json.JSONUtil;
import
com.clx.performance.constant.RabbitKeyConstants
;
import
com.clx.performance.constant.RabbitKeyConstants
;
import
com.clx.performance.enums.nbbank.NbBankStatusEnum
;
import
com.clx.performance.enums.nbbank.NbBankStatusEnum
;
import
com.clx.performance.param.OwnerBankNotifyMqParam
;
import
com.clx.performance.param.OwnerBankNotifyMqParam
;
import
com.clx.performance.service.loan.OwnerLoanAccountService
;
import
com.clx.performance.service.loan.OwnerRepaymentService
;
import
com.clx.performance.service.loan.OwnerLoanRecordService
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
...
@@ -21,23 +20,22 @@ import java.util.Objects;
...
@@ -21,23 +20,22 @@ import java.util.Objects;
@AllArgsConstructor
@AllArgsConstructor
public
class
OwnerRepaymentPayNotifyListener
{
public
class
OwnerRepaymentPayNotifyListener
{
private
final
Owner
LoanRecordService
ownerLoanRecord
Service
;
private
final
Owner
RepaymentService
ownerRepayment
Service
;
private
final
OwnerLoanAccountService
ownerLoanAccountService
;
@RabbitListener
(
queues
=
RabbitKeyConstants
.
OWNER_
LOAN_PAY
_QUEUE
)
@RabbitListener
(
queues
=
RabbitKeyConstants
.
OWNER_
REPAYMENT
_QUEUE
)
public
void
onMessage
(
String
message
)
{
public
void
onMessage
(
String
message
)
{
log
.
info
(
"处理货主还款支付监听器执行,数据为{}"
,
message
);
log
.
info
(
"处理货主还款支付监听器执行,数据为{}"
,
message
);
OwnerBankNotifyMqParam
param
=
JSONUtil
.
toBean
(
message
,
OwnerBankNotifyMqParam
.
class
);
OwnerBankNotifyMqParam
param
=
JSONUtil
.
toBean
(
message
,
OwnerBankNotifyMqParam
.
class
);
if
(
Objects
.
equals
(
param
.
getPayStatus
(),
NbBankStatusEnum
.
Status
.
SUCCESS
.
getCode
()))
{
if
(
Objects
.
equals
(
param
.
getPayStatus
(),
NbBankStatusEnum
.
Status
.
SUCCESS
.
getCode
()))
{
// 支付成功
// 支付成功
owner
LoanRecord
Service
.
paySuccess
(
param
.
getMerSeqNo
());
owner
Repayment
Service
.
paySuccess
(
param
.
getMerSeqNo
());
}
}
else
if
(
Objects
.
equals
(
param
.
getPayStatus
(),
NbBankStatusEnum
.
Status
.
FAIL
.
getCode
()))
{
else
if
(
Objects
.
equals
(
param
.
getPayStatus
(),
NbBankStatusEnum
.
Status
.
FAIL
.
getCode
()))
{
// 支付失败
// 支付失败
owner
LoanRecord
Service
.
payFail
(
param
.
getMerSeqNo
());
owner
Repayment
Service
.
payFail
(
param
.
getMerSeqNo
());
}
}
}
}
}
}
performance-web/src/main/java/com/clx/performance/service/impl/loan/OwnerRepaymentServiceImpl.java
浏览文件 @
a37ddd81
...
@@ -253,4 +253,29 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
...
@@ -253,4 +253,29 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
ownerRepaymentDao
.
updateStatusById
(
ownerRepayment
);
ownerRepaymentDao
.
updateStatusById
(
ownerRepayment
);
}
}
@Override
public
void
paySuccess
(
String
merSeqNo
)
{
// 查询交易流水
BankTrade
bankTrade
=
bankTradeDao
.
getOneByField
(
BankTrade:
:
getMerchantRunningWaterNo
,
merSeqNo
)
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
// 查询还款信息
OwnerRepayment
ownerRepayment
=
ownerRepaymentDao
.
getOneByField
(
OwnerRepayment:
:
getRepaymentNo
,
bankTrade
.
getRelationNo
()).
get
();
ownerRepayment
.
setStatus
(
OwnerRePaymentEnum
.
Status
.
PAY_SUCCESS
.
getCode
());
// 更新借款信息
ownerRepaymentDao
.
updateStatusById
(
ownerRepayment
);
}
@Override
public
void
payFail
(
String
merSeqNo
)
{
// 查询交易流水
BankTrade
bankTrade
=
bankTradeDao
.
getOneByField
(
BankTrade:
:
getMerchantRunningWaterNo
,
merSeqNo
)
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
// 查询还款信息
OwnerRepayment
ownerRepayment
=
ownerRepaymentDao
.
getOneByField
(
OwnerRepayment:
:
getRepaymentNo
,
bankTrade
.
getRelationNo
()).
get
();
ownerRepayment
.
setStatus
(
OwnerRePaymentEnum
.
Status
.
PAY_FAIL
.
getCode
());
// 更新借款信息
ownerRepaymentDao
.
updateStatusById
(
ownerRepayment
);
}
}
}
performance-web/src/main/java/com/clx/performance/service/loan/OwnerRepaymentService.java
浏览文件 @
a37ddd81
...
@@ -36,4 +36,8 @@ public interface OwnerRepaymentService {
...
@@ -36,4 +36,8 @@ public interface OwnerRepaymentService {
void
ownerLoanRecordCancelPay
(
String
repaymentNo
);
void
ownerLoanRecordCancelPay
(
String
repaymentNo
);
void
ownerRepaymentRetryPay
(
String
repaymentNo
);
void
ownerRepaymentRetryPay
(
String
repaymentNo
);
void
paySuccess
(
String
merSeqNo
);
void
payFail
(
String
merSeqNo
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论