Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
f49d4154
提交
f49d4154
authored
2月 21, 2024
作者:
huyufan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
取消支付
上级
c7b67839
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
114 行增加
和
17 行删除
+114
-17
OwnerLoanPayNotifyMqParam.java
...n/java/com/clx/performance/OwnerLoanPayNotifyMqParam.java
+18
-0
PerformanceResultEnum.java
...java/com/clx/performance/enums/PerformanceResultEnum.java
+1
-0
CarrierOwnerLoanRecordController.java
...ler/pc/loan/carrier/CarrierOwnerLoanRecordController.java
+7
-0
OwnerLoanPayNotifyListener.java
.../clx/performance/listener/OwnerLoanPayNotifyListener.java
+39
-0
OwnerLoanRecordServiceImpl.java
...ormance/service/impl/loan/OwnerLoanRecordServiceImpl.java
+46
-16
NbBankServiceImpl.java
...nce/service/impl/thirdparty/nbbank/NbBankServiceImpl.java
+1
-1
OwnerLoanRecordService.java
.../clx/performance/service/loan/OwnerLoanRecordService.java
+2
-0
没有找到文件。
performance-api/src/main/java/com/clx/performance/OwnerLoanPayNotifyMqParam.java
0 → 100644
浏览文件 @
f49d4154
package
com
.
clx
.
performance
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
@Data
public
class
OwnerLoanPayNotifyMqParam
{
@NotNull
(
message
=
"借款单号不能为空"
)
@ApiModelProperty
(
"借款单号"
)
private
String
loanNo
;
@ApiModelProperty
(
"支付状态"
)
private
Integer
payStatus
;
}
performance-api/src/main/java/com/clx/performance/enums/PerformanceResultEnum.java
浏览文件 @
f49d4154
...
...
@@ -128,6 +128,7 @@ public enum PerformanceResultEnum implements ResultEnum {
OWNER_LOAN_RECORD_PAY_STATUS_ERROR
(
1850
,
"状态已变更无法支付"
),
OWNER_LOAN_RECORD_CANCEL_STATUS_ERROR
(
1851
,
"状态已变更无法取消"
),
;
private
final
int
code
;
...
...
performance-web/src/main/java/com/clx/performance/controller/pc/loan/carrier/CarrierOwnerLoanRecordController.java
浏览文件 @
f49d4154
...
...
@@ -55,6 +55,13 @@ public class CarrierOwnerLoanRecordController {
return
Result
.
ok
();
}
@ApiOperation
(
value
=
"取消支付"
,
notes
=
"<br>By:胡宇帆"
)
@GetMapping
(
"/ownerLoanRecordCancelPay"
)
public
Result
<
Object
>
ownerLoanRecordCancelPay
(
@RequestParam
(
value
=
"loanNo"
)
@NotBlank
String
loanNo
)
{
ownerLoanRecordService
.
ownerLoanRecordCancelPay
(
loanNo
);
return
Result
.
ok
();
}
@ApiOperation
(
value
=
"分页搜索货主借款列表"
,
notes
=
"<br>By:艾庆国"
)
@PostMapping
(
"/pageOwnerLoanRecordOfOwner"
)
@UnitCovert
(
param
=
false
)
...
...
performance-web/src/main/java/com/clx/performance/listener/OwnerLoanPayNotifyListener.java
0 → 100644
浏览文件 @
f49d4154
package
com
.
clx
.
performance
.
listener
;
import
cn.hutool.json.JSONUtil
;
import
com.clx.performance.OwnerLoanPayNotifyMqParam
;
import
com.clx.performance.constant.RabbitKeyConstants
;
import
com.clx.performance.enums.nbbank.NbBankStatusEnum
;
import
com.clx.performance.service.loan.OwnerLoanRecordService
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.stereotype.Component
;
import
java.util.Objects
;
/**
* 处理货主借款支付监听器
*/
@Slf4j
@Component
@AllArgsConstructor
public
class
OwnerLoanPayNotifyListener
{
private
final
OwnerLoanRecordService
ownerLoanRecordService
;
@RabbitListener
(
queues
=
RabbitKeyConstants
.
ORDER_CANCEL_QUEUE
)
public
void
onMessage
(
String
message
)
{
log
.
info
(
"处理货主借款支付监听器执行,数据为{}"
,
message
);
OwnerLoanPayNotifyMqParam
param
=
JSONUtil
.
toBean
(
message
,
OwnerLoanPayNotifyMqParam
.
class
);
if
(
Objects
.
equals
(
param
.
getPayStatus
(),
NbBankStatusEnum
.
Status
.
SUCCESS
.
getCode
()))
{
// 支付成功
ownerLoanRecordService
.
paySuccess
(
param
.
getLoanNo
());
}
else
if
(
Objects
.
equals
(
param
.
getPayStatus
(),
NbBankStatusEnum
.
Status
.
FAIL
.
getCode
()))
{
// 支付失败
ownerLoanRecordService
.
payFail
(
param
.
getLoanNo
());
}
}
}
performance-web/src/main/java/com/clx/performance/service/impl/loan/OwnerLoanRecordServiceImpl.java
浏览文件 @
f49d4154
...
...
@@ -24,6 +24,7 @@ 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
;
import
com.clx.performance.enums.nbbank.NbBankStatusEnum
;
import
com.clx.performance.model.OwnerBindCardRecord
;
import
com.clx.performance.model.loan.*
;
import
com.clx.performance.param.pc.loan.carrier.*
;
...
...
@@ -37,6 +38,7 @@ import com.clx.performance.vo.pc.loan.owner.BorrowerSelectVO;
import
com.clx.performance.vo.pc.loan.owner.OwnerLoanRecordDetail
;
import
com.clx.performance.vo.pc.loan.carrier.CarrierTransferPaymentDetailVO
;
import
com.clx.performance.vo.pc.nbbank.NbBankOrderPayResultVO
;
import
com.clx.performance.vo.pc.nbbank.NbBankOrderResultVO
;
import
com.clx.user.feign.OwnerFeign
;
import
com.clx.user.vo.feign.OwnerInfoFeignVO
;
import
com.msl.common.base.Optional
;
...
...
@@ -164,8 +166,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
ownerLoanRecord
.
setLendingPartyAccount
(
borrower
.
getBankCardNo
());
bankTrade
.
setTradeType
(
BankTradeEnum
.
TradeType
.
ORDER_DIRECT_PAY
.
getCode
());
}
else
{
}
else
{
// 转账支付
NbBankOrderPayResultVO
orderPayResultVO
=
bankService
.
orderTransferPay
(
ownerLoanRecord
.
getLoanBalance
().
intValue
());
ownerLoanRecord
.
setRunningWaterOpenNo
(
orderPayResultVO
.
getTransSeqNo
());
...
...
@@ -265,13 +266,15 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
ownerRepayment
.
setCreateBy
(
ownerLoanRecord
.
getOwnerUserName
());
ownerRepayment
.
setRepaymentBalance
(
ownerLoanRecord
.
getLoanBalance
());
ownerRepayment
.
setRepaymentNo
(
idGenerateSnowFlake
.
nextId
(
2L
));
ownerRepayment
.
setPayment
(
ownerLoanRecord
.
getBorrower
());
ownerRepayment
.
setPaymentAccount
(
ownerLoanRecord
.
getBorrowerAccount
());
OwnerInfoFeignVO
ownerInfoFeignVO
=
ownerFeign
.
getOwnerInfo
(
ownerLoanRecord
.
getOwnerUserNo
()).
getData
();
log
.
info
(
"生成还款记录,查询到用户信息:{}"
,
JSONUtil
.
parse
(
ownerInfoFeignVO
));
ownerRepayment
.
setPayment
(
ownerInfoFeignVO
.
getCompanyName
());
ownerRepayment
.
setPaymentAccount
(
ownerInfoFeignVO
.
getOwnerBankAccount
());
ownerRepayment
.
setPayee
(
ownerRepayment
.
getPayee
());
ownerRepayment
.
setPayeeAccount
(
ownerLoanRecord
.
getPayeeAccount
());
ownerRepayment
.
setPayChannel
(
OwnerRePaymentEnum
.
Channel
.
ORDER
.
getCode
());
ownerRepayment
.
setRunningWaterOpenNo
(
ownerLoanRecord
.
getRunningWaterOpenNo
());
ownerRepayment
.
setMerchantRunningWaterNo
(
ownerLoanRecord
.
getMerchantRunningWaterNo
());
ownerRepayment
.
setPayChannel
(
ownerLoanRecord
.
getPayChannel
());
ownerRepayment
.
setBeOverdue
(
OwnerRePaymentEnum
.
BeOverdue
.
NO
.
getCode
());
ownerRepayment
.
setCreateBy
(
"系统"
);
ownerRepayment
.
setStatus
(
OwnerRePaymentEnum
.
Status
.
PAY_WAIT
.
getCode
());
...
...
@@ -317,12 +320,12 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
PerformanceResultEnum
.
DATA_NOT_FIND
);
CarrierCashierInfoVO
vo
=
ownerLoanRecordStruct
.
convertCashierInfo
(
ownerLoanRecord
);
Borrower
borrower
=
borrowerDao
.
getEntityByKey
(
ownerLoanRecord
.
getBorrowerId
()).
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
if
(
Objects
.
equals
(
borrower
.
getDeleteStatus
(),
DeleteStatusEnum
.
NO
.
getCode
()))
{
if
(
Objects
.
equals
(
borrower
.
getDeleteStatus
(),
DeleteStatusEnum
.
NO
.
getCode
()))
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
}
vo
.
setOrderPayWay
(
false
);
String
bankName
=
borrower
.
getBankName
();
if
(
nbBankConfig
.
getOrderSupportBank
().
contains
(
bankName
))
{
if
(
nbBankConfig
.
getOrderSupportBank
().
contains
(
bankName
))
{
vo
.
setOrderPayWay
(
true
);
}
vo
.
setBankName
(
bankName
);
...
...
@@ -430,7 +433,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
getOneByField
(
OwnerLoanRecord:
:
getLoanNo
,
param
.
getLoanNo
())
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
if
(!
Objects
.
equals
(
ownerLoanRecord
.
getStatus
(),
OwnerLoanRecordEnum
.
Status
.
PAY_FAIL
.
getCode
())){
if
(!
Objects
.
equals
(
ownerLoanRecord
.
getStatus
(),
OwnerLoanRecordEnum
.
Status
.
PAY_FAIL
.
getCode
()))
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
OWNER_LOAN_RECORD_PAY_STATUS_ERROR
);
}
...
...
@@ -455,8 +458,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
ownerLoanRecord
.
setLendingPartyAccount
(
borrower
.
getBankCardNo
());
bankTrade
.
setTradeType
(
BankTradeEnum
.
TradeType
.
ORDER_DIRECT_PAY
.
getCode
());
}
else
{
}
else
{
//资金 TODO 调宁波银企直连的产品,从诚联信账户中给鑫祥和执行转账
// 转账支付
NbBankOrderPayResultVO
orderPayResultVO
=
bankService
.
orderTransferPay
(
ownerLoanRecord
.
getLoanBalance
().
intValue
());
...
...
@@ -494,10 +496,10 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
payFail
(
String
loanNo
){
public
void
payFail
(
String
loanNo
)
{
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
getOneByField
(
OwnerLoanRecord:
:
getLoanNo
,
loanNo
)
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
if
(
Objects
.
equals
(
ownerLoanRecord
.
getStatus
(),
OwnerLoanRecordEnum
.
Status
.
PAYING
.
getCode
())){
if
(
Objects
.
equals
(
ownerLoanRecord
.
getStatus
(),
OwnerLoanRecordEnum
.
Status
.
PAYING
.
getCode
()))
{
log
.
info
(
"借款单非支付中状态, loanNo:{}"
,
loanNo
);
return
;
}
...
...
@@ -510,11 +512,11 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
paySuccess
(
String
loanNo
){
public
void
paySuccess
(
String
loanNo
)
{
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
getOneByField
(
OwnerLoanRecord:
:
getLoanNo
,
loanNo
)
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
if
(
Objects
.
equals
(
ownerLoanRecord
.
getStatus
(),
OwnerLoanRecordEnum
.
Status
.
PAYING
.
getCode
())){
if
(
Objects
.
equals
(
ownerLoanRecord
.
getStatus
(),
OwnerLoanRecordEnum
.
Status
.
PAYING
.
getCode
()))
{
log
.
info
(
"借款单非支付中状态, loanNo:{}"
,
loanNo
);
return
;
}
...
...
@@ -555,6 +557,34 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
}
@Override
public
void
ownerLoanRecordCancelPay
(
String
loanNo
)
{
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
getOneByField
(
OwnerLoanRecord:
:
getLoanNo
,
loanNo
)
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
if
(!
ownerLoanRecord
.
getStatus
().
equals
(
OwnerLoanRecordEnum
.
Status
.
APPROVE_WAIT
.
getCode
())
&&
!
ownerLoanRecord
.
getStatus
().
equals
(
OwnerLoanRecordEnum
.
Status
.
PAYING
.
getCode
())
)
{
log
.
info
(
"借款记录状态异常,不能取消"
);
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
OWNER_LOAN_RECORD_CANCEL_STATUS_ERROR
);
}
NbBankOrderResultVO
result
=
bankService
.
getResult
(
loanNo
);
Integer
status
=
result
.
getStatus
();
if
(!
NbBankStatusEnum
.
Status
.
INIT
.
getCode
().
equals
(
status
)
&&
!
NbBankStatusEnum
.
Status
.
FAIL
.
getCode
().
equals
(
status
)
&&
!
NbBankStatusEnum
.
Status
.
NOT_FOUND
.
getCode
().
equals
(
status
)
)
{
log
.
info
(
"宁波银行响应当前业务,不能取消{}"
,
JSONUtil
.
parse
(
result
));
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
OWNER_LOAN_RECORD_CANCEL_STATUS_ERROR
);
}
log
.
info
(
"借款记录取消,更新状态为待审批"
);
ownerLoanRecord
.
setStatus
(
OwnerLoanRecordEnum
.
Status
.
APPROVE_WAIT
.
getCode
());
ownerLoanRecordDao
.
updateStatusById
(
ownerLoanRecord
);
}
public
void
generateFrozenOwnerLoanRunningWater
(
OwnerLoanRecord
ownerLoanRecord
,
String
childNo
,
BigDecimal
orderChildPrice
)
{
log
.
info
(
"13.生成借款冻结流水"
);
OwnerLoanAccount
update
=
new
OwnerLoanAccount
();
...
...
performance-web/src/main/java/com/clx/performance/service/impl/thirdparty/nbbank/NbBankServiceImpl.java
浏览文件 @
f49d4154
...
...
@@ -228,7 +228,7 @@ public class NbBankServiceImpl implements NbBankService {
// 更新状态
bankTradeDao
.
updateStatus
(
bankTrade
);
//TODO 增加如果后置逻辑失败业务处理
// 货主借款支付回调
if
(
Objects
.
equals
(
bankTrade
.
getOrderType
(),
BankTradeEnum
.
OrderType
.
OWNER_LOAN_RECORD
.
getCode
())){
...
...
performance-web/src/main/java/com/clx/performance/service/loan/OwnerLoanRecordService.java
浏览文件 @
f49d4154
...
...
@@ -47,4 +47,6 @@ public interface OwnerLoanRecordService {
void
paySuccess
(
String
loanNo
);
void
ownerLoanRecordRetryPay
(
String
loanNo
);
void
ownerLoanRecordCancelPay
(
String
loanNo
);
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论