Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
ka-code-generator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
ka-code-generator
Commits
5339af9b
Commit
5339af9b
authored
Jun 18, 2020
by
王向伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉没必要的变量,解决编译错误
parent
43afadf3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
387 additions
and
364 deletions
+387
-364
EventHandler.ftl
...es/templates/code-generator/eventhandler/EventHandler.ftl
+384
-361
QueryLoanResult.ftl
...ources/templates/code-generator/model/QueryLoanResult.ftl
+2
-0
ServiceImpl.ftl
...esources/templates/code-generator/service/ServiceImpl.ftl
+1
-3
No files found.
src/main/resources/templates/code-generator/eventhandler/EventHandler.ftl
View file @
5339af9b
package
${
eventhandlerPackage
};
package
${
eventhandlerPackage
};
import
cn
.
quantgroup
.
cashloanflow
.
entity
.
cashloanflow
.
LoanMapping
;
import
cn
.
quantgroup
.
cashloanflow
.
entity
.
cashloanflow
.
LoanMapping
;
import
cn
.
quantgroup
.
cashloanflow
.
entity
.
cashloanflow
.
LoanOrderMapping
;
import
cn
.
quantgroup
.
cashloanflow
.
entity
.
cashloanflow
.
LoanOrderMapping
;
import
cn
.
quantgroup
.
cashloanflow
.
entity
.
cashloanflow
.
RepayFlowNoMapping
;
import
cn
.
quantgroup
.
cashloanflow
.
entity
.
cashloanflow
.
RepayFlowNoMapping
;
...
@@ -9,13 +8,10 @@ import cn.quantgroup.cashloanflow.entity.cashloanflow.UserMapping;
...
@@ -9,13 +8,10 @@ import cn.quantgroup.cashloanflow.entity.cashloanflow.UserMapping;
import
cn
.
quantgroup
.
cashloanflow
.
model
.
callback
.
KANoticeType
;
import
cn
.
quantgroup
.
cashloanflow
.
model
.
callback
.
KANoticeType
;
import
cn
.
quantgroup
.
cashloanflow
.
model
.
standard
.
response
.
credit
.
QueryCreditStatusResponseModel
;
import
cn
.
quantgroup
.
cashloanflow
.
model
.
standard
.
response
.
credit
.
QueryCreditStatusResponseModel
;
import
cn
.
quantgroup
.
cashloanflow
.
model
.
xyqbmq
.
QuotaNoticeExtraDto
;
import
cn
.
quantgroup
.
cashloanflow
.
model
.
xyqbmq
.
QuotaNoticeExtraDto
;
import
cn
.
quantgroup
.
cashloanflow
.
model
.
xyqbmq
.
QuotaRefuseNoticeExtraData
;
import
cn
.
quantgroup
.
cashloanflow
.
repository
.
cashloanflow
.
IRepayFlowNoMappingRepository
;
import
cn
.
quantgroup
.
cashloanflow
.
repository
.
cashloanflow
.
IRepayFlowNoMappingRepository
;
import
cn
.
quantgroup
.
cashloanflow
.
service
.
cashloanflow
.
ILoanOrderMappingService
;
import
cn
.
quantgroup
.
cashloanflow
.
service
.
cashloanflow
.
ILoanOrderMappingService
;
import
cn
.
quantgroup
.
cashloanflow
.
service
.
cashloanflow
.
IUserMappingService
;
import
cn
.
quantgroup
.
cashloanflow
.
service
.
cashloanflow
.
IUserMappingService
;
import
cn
.
quantgroup
.
cashloanflow
.
service
.
cashloanflow
.
LoanMappingService
;
import
cn
.
quantgroup
.
cashloanflow
.
service
.
cashloanflow
.
LoanMappingService
;
import
cn
.
quantgroup
.
cashloanflow
.
util
.
DateUtil
;
import
cn
.
quantgroup
.
clf
.
util
.
JSONTools
;
import
cn
.
quantgroup
.
loanflow
.
application
.
StandardApplicationService
;
import
cn
.
quantgroup
.
loanflow
.
application
.
StandardApplicationService
;
import
cn
.
quantgroup
.
loanflow
.
asynctask
.
executor
.
config
.
BizAppId
;
import
cn
.
quantgroup
.
loanflow
.
asynctask
.
executor
.
config
.
BizAppId
;
import
cn
.
quantgroup
.
loanflow
.
asynctask
.
model
.
AsyncTask
;
import
cn
.
quantgroup
.
loanflow
.
asynctask
.
model
.
AsyncTask
;
...
@@ -30,7 +26,6 @@ import cn.quantgroup.loanflow.order.model.ChannelOrder;
...
@@ -30,7 +26,6 @@ import cn.quantgroup.loanflow.order.model.ChannelOrder;
import
cn
.
quantgroup
.
loanflow
.
repay
.
model
.
RepaymentPlanItem
;
import
cn
.
quantgroup
.
loanflow
.
repay
.
model
.
RepaymentPlanItem
;
import
cn
.
quantgroup
.
loanflow
.
repay
.
model
.
representation
.
OrderRepaymentRepresentation
;
import
cn
.
quantgroup
.
loanflow
.
repay
.
model
.
representation
.
OrderRepaymentRepresentation
;
import
cn
.
quantgroup
.
mo
.
risk
.
service
.
MoRiskRepresentationService
;
import
cn
.
quantgroup
.
mo
.
risk
.
service
.
MoRiskRepresentationService
;
import
com
.
alibaba
.
fastjson
.
JSON
;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
import
lombok
.
extern
.
slf4j
.
Slf4j
;
import
lombok
.
extern
.
slf4j
.
Slf4j
;
import
org
.
apache
.
commons
.
lang3
.
StringUtils
;
import
org
.
apache
.
commons
.
lang3
.
StringUtils
;
...
@@ -51,437 +46,465 @@ import java.util.*;
...
@@ -51,437 +46,465 @@ import java.util.*;
@
Service
@
Service
@
Slf4j
@
Slf4j
public
class
${
prefix
}
EventHandler
extends
AbstractEventHandler
implements
IEventHandler
{
public
class
${
prefix
}
EventHandler
extends
AbstractEventHandler
implements
IEventHandler
{
@
Autowired
@
Autowired
private
ILoanOrderMappingService
orderMappingService
;
private
ILoanOrderMappingService
orderMappingService
;
@
Autowired
@
Autowired
private
IUserMappingService
userMappingService
;
private
IUserMappingService
userMappingService
;
@
Autowired
private
MoRiskRepresentationService
moRiskRepresentationService
;
@
Autowired
private
LoanMappingService
loanMappingService
;
@
Autowired
private
IRepayFlowNoMappingRepository
repayFlowNoMappingRepository
;
@
Resource
(
name
=
"standardApplicationMoService"
)
private
StandardApplicationService
standardApplicationService
;
@
Override
@
Autowired
public
void
creditSuccessPublish
(
CreditSuccessEvent
creditSuccEvent
)
{
private
LoanMappingService
loanMappingService
;
String
logPrefix
=
"[notify][handler][creditSuccEvent]"
;
@
Autowired
log
.
info
(
"{},不处理进件同步成功事件,消息内容:{}"
,
logPrefix
,
creditSuccEvent
);
private
IRepayFlowNoMappingRepository
repayFlowNoMappingRepository
;
}
@
Override
@
Resource
(
name
=
"standardApplicationMoService"
)
public
void
auditRejectPublish
(
AuditRejectEvent
auditRejectEvent
)
{
private
StandardApplicationService
standardApplicationService
;
String
logPrefix
=
"[${prefix}EventHandler][auditRejectPublish]"
;
log
.
info
(
"{},${prefix},审核拒绝事件,消息内容:{}"
,
logPrefix
,
auditRejectEvent
);
QuotaNoticeExtraDto
extraDto
=
auditRejectEvent
.
getQueueNotice
();
Long
channelId
=
auditRejectEvent
.
getChannelId
();
KANoticeType
noticeType
=
auditRejectEvent
.
getNoticeType
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
channelOrderNo
=
auditRejectEvent
.
getChannelOrderNo
();
Long
nextApplyTime
=
auditRejectEvent
.
getNextApplyTime
();
String
reason
=
auditRejectEvent
.
getReason
();
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
throw
new
CommonBizException
(
"回调地址无配置"
);
}
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
Long
userId
=
orderMapping
.
getQgUserId
();
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
@
Override
String
channelUserId
=
userMapping
.
getChannelUserId
();
public
void
creditSuccessPublish
(
CreditSuccessEvent
creditSuccEvent
)
{
String
logPrefix
=
"[notify][handler][creditSuccEvent]"
;
log
.
info
(
"{},不处理进件同步成功事件,消息内容:{}"
,
logPrefix
,
creditSuccEvent
);
}
Map
<
String
,
String
>
callbackParam
=
new
HashMap
<>();
@
Override
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
public
void
auditRejectPublish
(
AuditRejectEvent
auditRejectEvent
)
{
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
String
logPrefix
=
"[${prefix}EventHandler][auditRejectPublish]"
;
}
log
.
info
(
"{},${prefix},审核拒绝事件,消息内容:{}"
,
logPrefix
,
auditRejectEvent
);
QuotaNoticeExtraDto
extraDto
=
auditRejectEvent
.
getQueueNotice
();
Long
channelId
=
auditRejectEvent
.
getChannelId
();
KANoticeType
noticeType
=
auditRejectEvent
.
getNoticeType
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
channelOrderNo
=
auditRejectEvent
.
getChannelOrderNo
();
Long
nextApplyTime
=
auditRejectEvent
.
getNextApplyTime
();
String
reason
=
auditRejectEvent
.
getReason
();
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
throw
new
CommonBizException
(
"回调地址无配置"
);
}
@
Override
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
public
void
auditPassPublish
(
AuditPassEvent
auditPassEvent
)
{
Long
userId
=
orderMapping
.
getQgUserId
();
String
logPrefix
=
"[${prefix}EventHandler][auditPassPublish]"
;
log
.
info
(
"{},审核通过事件,消息内容:{}"
,
logPrefix
,
auditPassEvent
);
QuotaNoticeExtraDto
extraDto
=
auditPassEvent
.
getQueueNotice
();
Long
channelId
=
auditPassEvent
.
getChannelId
();
KANoticeType
noticeType
=
auditPassEvent
.
getNoticeType
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
channelOrderNo
=
auditPassEvent
.
getChannelOrderNo
();
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
throw
new
CommonBizException
(
"回调地址无配置"
);
}
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
Long
userId
=
orderMapping
.
getQg
UserId
();
String
channelUserId
=
userMapping
.
getChannel
UserId
();
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
Map
String
channelUserId
=
userMapping
.
getChannelUserId
();
<
String
,
String
>
callbackParam
=
new
HashMap
<>();
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
}
ChannelOrder
channelOrderQueryCreditStatus
=
ChannelOrder
.
builder
()
@
Override
.
channelOrderNo
(
channelOrderNo
)
public
void
auditPassPublish
(
AuditPassEvent
auditPassEvent
)
{
.
channelId
(
channelId
)
String
logPrefix
=
"[${prefix}EventHandler][auditPassPublish]"
;
.
build
();
log
.
info
(
"{},审核通过事件,消息内容:{}"
,
logPrefix
,
auditPassEvent
);
ServiceResult
<
QueryCreditStatusResponseModel
>
creditStatus
=
standardApplicationService
.
queryCreditStatus
(
channelOrderQueryCreditStatus
);
QuotaNoticeExtraDto
extraDto
=
auditPassEvent
.
getQueueNotice
();
Long
channelId
=
auditPassEvent
.
getChannelId
();
KANoticeType
noticeType
=
auditPassEvent
.
getNoticeType
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
channelOrderNo
=
auditPassEvent
.
getChannelOrderNo
();
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
throw
new
CommonBizException
(
"回调地址无配置"
);
}
log
.
info
(
"{} 授信结果查询返回信息 creditStatus={},orderNo={}"
,
logPrefix
,
creditStatus
,
channelOrderNo
);
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
QueryCreditStatusResponseModel
creditInfo
;
Long
userId
=
orderMapping
.
getQgUserId
();
if
(
Objects
.
isNull
(
creditStatus
)
||
!creditStatus.isSuccess() || Objects.isNull(creditInfo = creditStatus.getData())) {
log
.
error
(
"{},审批通过推送,查询授信结果失败或无数据,orderNo={},applyNo={}"
,
logPrefix
,
channelOrderNo
,
applyNo
);
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
throw
new
CommonBizException
(
"审批推送,查询授信结果失败或无数据"
);
String
channelUserId
=
userMapping
.
getChannelUserId
();
}
ChannelOrder
channelOrderQueryCreditStatus
=
ChannelOrder
.
builder
()
.
channelOrderNo
(
channelOrderNo
)
.
channelId
(
channelId
)
.
build
();
ServiceResult
<
QueryCreditStatusResponseModel
>
creditStatus
=
standardApplicationService
.
queryCreditStatus
(
channelOrderQueryCreditStatus
);
log
.
info
(
"{} 授信结果查询返回信息 creditStatus={},orderNo={}"
,
logPrefix
,
creditStatus
,
channelOrderNo
);
QueryCreditStatusResponseModel
creditInfo
;
if
(
Objects
.
isNull
(
creditStatus
)
||
!creditStatus.isSuccess() || Objects.isNull(creditInfo =
creditStatus
.
getData
()))
{
log
.
error
(
"{},审批通过推送,查询授信结果失败或无数据,orderNo={},applyNo={}"
,
logPrefix
,
channelOrderNo
,
applyNo
);
throw
new
CommonBizException
(
"审批推送,查询授信结果失败或无数据"
);
}
Map
<
String
,
String
>
callbackParam
=
new
HashMap
<>();
Map
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
<
String
,
String
>
callbackParam
=
new
HashMap
<>();
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
}
}
@
Override
@
Override
public
void
withdrawPublish
(
WithdrawEvent
withdrawEvent
)
{
public
void
withdrawPublish
(
WithdrawEvent
withdrawEvent
)
{
String
logPrefix
=
"[${prefix}EventHandler][withdrawPublish]"
;
String
logPrefix
=
"[${prefix}EventHandler][withdrawPublish]"
;
log
.
info
(
"{},不处理申请提现成功事件,消息内容:{}"
,
logPrefix
,
withdrawEvent
);
log
.
info
(
"{},不处理申请提现成功事件,消息内容:{}"
,
logPrefix
,
withdrawEvent
);
}
}
@
Override
@
Override
public
void
fundSuccessPublish
(
FundSuccessEvent
fundSuccessEvent
)
{
public
void
fundSuccessPublish
(
FundSuccessEvent
fundSuccessEvent
)
{
String
logPrefix
=
"[${prefix}EventHandler][fundSuccessPublish]"
;
String
logPrefix
=
"[${prefix}EventHandler][fundSuccessPublish]"
;
log
.
info
(
"{},放款成功事件,消息内容:{}"
,
logPrefix
,
fundSuccessEvent
);
log
.
info
(
"{},放款成功事件,消息内容:{}"
,
logPrefix
,
fundSuccessEvent
);
QuotaNoticeExtraDto
extraDto
=
fundSuccessEvent
.
getQueueNotice
();
QuotaNoticeExtraDto
extraDto
=
fundSuccessEvent
.
getQueueNotice
();
Long
channelId
=
fundSuccessEvent
.
getChannelId
();
Long
channelId
=
fundSuccessEvent
.
getChannelId
();
Long
loanId
=
fundSuccessEvent
.
getLoanId
();
Long
loanId
=
fundSuccessEvent
.
getLoanId
();
KANoticeType
noticeType
=
fundSuccessEvent
.
getNoticeType
();
KANoticeType
noticeType
=
fundSuccessEvent
.
getNoticeType
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
channelOrderNo
=
fundSuccessEvent
.
getChannelOrderNo
();
String
channelOrderNo
=
fundSuccessEvent
.
getChannelOrderNo
();
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
throw
new
CommonBizException
(
"回调地址无配置"
);
throw
new
CommonBizException
(
"回调地址无配置"
);
}
}
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
Long
userId
=
orderMapping
.
getQgUserId
();
Long
userId
=
orderMapping
.
getQgUserId
();
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
String
channelUserId
=
userMapping
.
getChannelUserId
();
String
channelUserId
=
userMapping
.
getChannelUserId
();
LoanMapping
loanMapping
=
loanMappingService
.
findByLoanIdAndChannelId
(
loanId
,
channelId
);
LoanMapping
loanMapping
=
loanMappingService
.
findByLoanIdAndChannelId
(
loanId
,
channelId
);
if
(
Objects
.
isNull
(
loanMapping
))
{
if
(
Objects
.
isNull
(
loanMapping
))
{
log
.
error
(
"{}通过loanId查询LoanMapping为空, loanId={}, channelId={}"
,
logPrefix
,
loanId
,
channelId
);
log
.
error
(
"{}通过loanId查询LoanMapping为空, loanId={}, channelId={}"
,
logPrefix
,
loanId
,
channelId
);
throw
new
CommonBizException
(
"通过loanId查询LoanMapping为空"
);
throw
new
CommonBizException
(
"通过loanId查询LoanMapping为空"
);
}
}
String
channelLoanNo
=
loanMapping
.
getChannelLoanNo
();
String
channelLoanNo
=
loanMapping
.
getChannelLoanNo
();
Map
<
String
,
String
>
callbackParam
=
new
HashMap
<>();
Map
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
<
String
,
String
>
callbackParam
=
new
HashMap
<>();
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
}
}
@
Override
@
Override
public
void
fundFailPublish
(
FundFailEvent
fundFailEvent
)
{
public
void
fundFailPublish
(
FundFailEvent
fundFailEvent
)
{
String
logPrefix
=
"[${prefix}EventHandler][fundFailPublish]"
;
String
logPrefix
=
"[${prefix}EventHandler][fundFailPublish]"
;
log
.
info
(
"{},放款失败事件,消息内容:{}"
,
logPrefix
,
fundFailEvent
);
log
.
info
(
"{},放款失败事件,消息内容:{}"
,
logPrefix
,
fundFailEvent
);
QuotaNoticeExtraDto
extraDto
=
fundFailEvent
.
getQueueNotice
();
QuotaNoticeExtraDto
extraDto
=
fundFailEvent
.
getQueueNotice
();
Long
channelId
=
fundFailEvent
.
getChannelId
();
Long
channelId
=
fundFailEvent
.
getChannelId
();
Long
loanId
=
fundFailEvent
.
getLoanId
();
Long
loanId
=
fundFailEvent
.
getLoanId
();
KANoticeType
noticeType
=
fundFailEvent
.
getNoticeType
();
KANoticeType
noticeType
=
fundFailEvent
.
getNoticeType
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
channelOrderNo
=
fundFailEvent
.
getChannelOrderNo
();
String
channelOrderNo
=
fundFailEvent
.
getChannelOrderNo
();
Long
changeTime
=
fundFailEvent
.
getChangeTime
();
Long
changeTime
=
fundFailEvent
.
getChangeTime
();
String
reason
=
fundFailEvent
.
getReason
();
String
reason
=
fundFailEvent
.
getReason
();
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
throw
new
CommonBizException
(
"回调地址无配置"
);
throw
new
CommonBizException
(
"回调地址无配置"
);
}
}
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
Long
userId
=
orderMapping
.
getQgUserId
();
Long
userId
=
orderMapping
.
getQgUserId
();
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
String
channelUserId
=
userMapping
.
getChannelUserId
();
String
channelUserId
=
userMapping
.
getChannelUserId
();
LoanMapping
loanMapping
=
loanMappingService
.
findByLoanIdAndChannelId
(
loanId
,
channelId
);
LoanMapping
loanMapping
=
loanMappingService
.
findByLoanIdAndChannelId
(
loanId
,
channelId
);
if
(
Objects
.
isNull
(
loanMapping
))
{
if
(
Objects
.
isNull
(
loanMapping
))
{
log
.
error
(
"{}通过loanId查询LoanMapping为空, loanId={}, channelId={}"
,
logPrefix
,
loanId
,
channelId
);
log
.
error
(
"{}通过loanId查询LoanMapping为空, loanId={}, channelId={}"
,
logPrefix
,
loanId
,
channelId
);
throw
new
CommonBizException
(
"通过loanId查询LoanMapping为空"
);
throw
new
CommonBizException
(
"通过loanId查询LoanMapping为空"
);
}
}
String
channelLoanNo
=
loanMapping
.
getChannelLoanNo
();
String
channelLoanNo
=
loanMapping
.
getChannelLoanNo
();
Map
<
String
,
String
>
callbackParam
=
new
HashMap
<>();
Map
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
<
String
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
,
String
>
callbackParam
=
new
HashMap
<>();
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
}
}
@
Override
@
Override
public
void
cancelLoanPublish
(
CancelLoanEvent
cancelLoanEvent
)
{
public
void
cancelLoanPublish
(
CancelLoanEvent
cancelLoanEvent
)
{
String
logPrefix
=
"[${prefix}EventHandler][cancelLoanPublish]"
;
String
logPrefix
=
"[${prefix}EventHandler][cancelLoanPublish]"
;
log
.
info
(
"{},贷前关单事件,消息内容:{}"
,
logPrefix
,
cancelLoanEvent
);
log
.
info
(
"{},贷前关单事件,消息内容:{}"
,
logPrefix
,
cancelLoanEvent
);
QuotaNoticeExtraDto
extraDto
=
cancelLoanEvent
.
getQueueNotice
();
QuotaNoticeExtraDto
extraDto
=
cancelLoanEvent
.
getQueueNotice
();
Long
channelId
=
cancelLoanEvent
.
getChannelId
();
Long
channelId
=
cancelLoanEvent
.
getChannelId
();
String
channelOrderNo
=
cancelLoanEvent
.
getChannelOrderNo
();
String
channelOrderNo
=
cancelLoanEvent
.
getChannelOrderNo
();
Long
closeTime
=
cancelLoanEvent
.
getChangeTime
();
Long
closeTime
=
cancelLoanEvent
.
getChangeTime
();
KANoticeType
noticeType
=
cancelLoanEvent
.
getNoticeType
();
KANoticeType
noticeType
=
cancelLoanEvent
.
getNoticeType
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
throw
new
CommonBizException
(
"回调地址无配置"
);
throw
new
CommonBizException
(
"回调地址无配置"
);
}
}
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
Long
userId
=
orderMapping
.
getQgUserId
();
Long
userId
=
orderMapping
.
getQgUserId
();
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
String
channelUserId
=
userMapping
.
getChannelUserId
();
String
channelUserId
=
userMapping
.
getChannelUserId
();
Map
<
String
,
String
>
callbackParam
=
new
HashMap
<>();
Map
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
<
String
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
,
String
>
callbackParam
=
new
HashMap
<>();
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
}
}
@
Override
@
Override
public
void
settleUpPublish
(
SettleUpEvent
settleUpEvent
)
{
public
void
settleUpPublish
(
SettleUpEvent
settleUpEvent
)
{
String
logPrefix
=
"[${prefix}EventHandler][settleUpPublish]"
;
String
logPrefix
=
"[${prefix}EventHandler][settleUpPublish]"
;
log
.
info
(
"{},结清事件,消息内容:{}"
,
logPrefix
,
settleUpEvent
);
log
.
info
(
"{},结清事件,消息内容:{}"
,
logPrefix
,
settleUpEvent
);
QuotaNoticeExtraDto
extraDto
=
settleUpEvent
.
getQueueNotice
();
QuotaNoticeExtraDto
extraDto
=
settleUpEvent
.
getQueueNotice
();
Long
channelId
=
settleUpEvent
.
getChannelId
();
Long
channelId
=
settleUpEvent
.
getChannelId
();
String
channelOrderNo
=
settleUpEvent
.
getChannelOrderNo
();
String
channelOrderNo
=
settleUpEvent
.
getChannelOrderNo
();
Long
changeTime
=
settleUpEvent
.
getChangeTime
();
Long
changeTime
=
settleUpEvent
.
getChangeTime
();
KANoticeType
noticeType
=
settleUpEvent
.
getNoticeType
();
KANoticeType
noticeType
=
settleUpEvent
.
getNoticeType
();
Long
loanId
=
settleUpEvent
.
getLoanId
();
Long
loanId
=
settleUpEvent
.
getLoanId
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
log
.
error
(
"{},回调地址无配置,channelId:{},loanId:{},noticeType:{}"
,
logPrefix
,
channelId
,
loanId
,
noticeType
.
name
());
log
.
error
(
"{},回调地址无配置,channelId:{},loanId:{},noticeType:{}"
,
logPrefix
,
channelId
,
loanId
,
noticeType
.
name
());
throw
new
CommonBizException
(
"回调地址无配置"
);
throw
new
CommonBizException
(
"回调地址无配置"
);
}
}
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
Long
userId
=
orderMapping
.
getQgUserId
();
Long
userId
=
orderMapping
.
getQgUserId
();
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
String
channelUserId
=
userMapping
.
getChannelUserId
();
String
channelUserId
=
userMapping
.
getChannelUserId
();
Map
<
String
,
String
>
callbackParam
=
new
HashMap
<>();
Map
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
<
String
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
,
String
>
callbackParam
=
new
HashMap
<>();
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
processSettleUp
(
settleUpEvent
);
processSettleUp
(
settleUpEvent
);
}
}
@
Override
@
Override
public
void
repaySuccessPublish
(
RepaySuccessEvent
repaySuccessEvent
)
{
public
void
repaySuccessPublish
(
RepaySuccessEvent
repaySuccessEvent
)
{
String
logPrefix
=
"[${prefix}EventHandler][repaySuccessPublish]"
;
String
logPrefix
=
"[${prefix}EventHandler][repaySuccessPublish]"
;
log
.
info
(
"{},还款成功事件,消息内容:{}"
,
logPrefix
,
repaySuccessEvent
);
log
.
info
(
"{},还款成功事件,消息内容:{}"
,
logPrefix
,
repaySuccessEvent
);
QuotaNoticeExtraDto
extraDto
=
repaySuccessEvent
.
getQueueNotice
();
QuotaNoticeExtraDto
extraDto
=
repaySuccessEvent
.
getQueueNotice
();
Long
channelId
=
repaySuccessEvent
.
getChannelId
();
Long
channelId
=
repaySuccessEvent
.
getChannelId
();
Long
loanId
=
repaySuccessEvent
.
getLoanId
();
Long
loanId
=
repaySuccessEvent
.
getLoanId
();
KANoticeType
noticeType
=
repaySuccessEvent
.
getNoticeType
();
KANoticeType
noticeType
=
repaySuccessEvent
.
getNoticeType
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
channelOrderNo
=
repaySuccessEvent
.
getChannelOrderNo
();
String
channelOrderNo
=
repaySuccessEvent
.
getChannelOrderNo
();
String
businessFlowNo
=
repaySuccessEvent
.
getBusinessFlowNo
();
String
businessFlowNo
=
repaySuccessEvent
.
getBusinessFlowNo
();
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
throw
new
CommonBizException
(
"回调地址无配置"
);
throw
new
CommonBizException
(
"回调地址无配置"
);
}
}
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
Long
userId
=
orderMapping
.
getQgUserId
();
Long
userId
=
orderMapping
.
getQgUserId
();
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
String
channelUserId
=
userMapping
.
getChannelUserId
();
String
channelUserId
=
userMapping
.
getChannelUserId
();
//
查询借据信息
//
查询借据信息
LoanMapping
loanMapping
=
loanMappingService
.
findByLoanIdAndChannelId
(
loanId
,
channelId
);
LoanMapping
loanMapping
=
loanMappingService
.
findByLoanIdAndChannelId
(
loanId
,
channelId
);
if
(
Objects
.
isNull
(
loanMapping
))
{
if
(
Objects
.
isNull
(
loanMapping
))
{
log
.
error
(
"{}通过loanId查询LoanMapping为空, loanId={}, channelId={}"
,
logPrefix
,
loanId
,
channelId
);
log
.
error
(
"{}通过loanId查询LoanMapping为空, loanId={}, channelId={}"
,
logPrefix
,
loanId
,
channelId
);
throw
new
CommonBizException
(
"通过loanId查询LoanMapping为空"
);
throw
new
CommonBizException
(
"通过loanId查询LoanMapping为空"
);
}
}
String
channelLoanNo
=
loanMapping
.
getChannelLoanNo
();
String
channelLoanNo
=
loanMapping
.
getChannelLoanNo
();
//
查询渠道的还款流水号
//
查询渠道的还款流水号
String
channelRepaymentNo
=
null
;
String
channelRepaymentNo
=
null
;
BigDecimal
repaymentAmount
=
null
;
BigDecimal
repaymentAmount
=
null
;
RepayFlowNoMapping
repayFlowNoMapping
=
repayFlowNoMappingRepository
.
findByXyqbRepayFlowNoOne
(
businessFlowNo
);
RepayFlowNoMapping
repayFlowNoMapping
=
repayFlowNoMappingRepository
.
findByXyqbRepayFlowNoOne
(
businessFlowNo
);
if
(
Objects
.
nonNull
(
repayFlowNoMapping
))
{
if
(
Objects
.
nonNull
(
repayFlowNoMapping
))
{
channelRepaymentNo
=
repayFlowNoMapping
.
getChannelRepayFlowNo
();
channelRepaymentNo
=
repayFlowNoMapping
.
getChannelRepayFlowNo
();
repaymentAmount
=
new
BigDecimal
(
repayFlowNoMapping
.
getRepayAmount
());
repaymentAmount
=
new
BigDecimal
(
repayFlowNoMapping
.
getRepayAmount
());
}
}
//
查询还款计划
//
查询还款计划
ServiceResult
<
OrderRepaymentRepresentation
>
serviceResult
=
standardApplicationService
.
repaymentPlanQueryByCycleQuota
(
loanId
);
ServiceResult
<
OrderRepaymentRepresentation
>
serviceResult
=
standardApplicationService
.
repaymentPlanQueryByCycleQuota
(
loanId
);
log
.
info
(
"{} 查询还款计划结果 serviceResult={},orderNo={}"
,
logPrefix
,
serviceResult
,
channelOrderNo
);
log
.
info
(
"{} 查询还款计划结果 serviceResult={},orderNo={}"
,
logPrefix
,
serviceResult
,
channelOrderNo
);
if
(
Objects
.
isNull
(
serviceResult
)
||
!serviceResult.isSuccess() || Objects.isNull(serviceResult.getData())) {
if
(
Objects
.
isNull
(
serviceResult
)
||
!serviceResult.isSuccess() || Objects.isNull(serviceResult.getData())) {
log
.
error
(
"{},还款成功推送,查询还款计划返回错误或无数据,orderNo={},applyNo={}"
,
logPrefix
,
channelOrderNo
,
applyNo
);
log
.
error
(
"{},还款成功推送,查询还款计划返回错误或无数据,orderNo={},applyNo={}"
,
logPrefix
,
channelOrderNo
,
applyNo
);
throw
new
CommonBizException
(
"还款成功,查询还款计划返回错误或无数据"
);
throw
new
CommonBizException
(
"还款成功,查询还款计划返回错误或无数据"
);
}
}
List
<
RepaymentPlanItem
>
repaymentPlans
=
serviceResult
.
getData
().
getRepaymentPlans
();
List
<
RepaymentPlanItem
>
repaymentPlans
=
serviceResult
.
getData
().
getRepaymentPlans
();
Map
<
String
,
String
>
callbackParam
=
new
HashMap
<>();
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
Map
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
<
String
super
.
processRepay
(
repaySuccessEvent
.
getQueueNotice
());
,
String
>
callbackParam
=
new
HashMap
<>();
}
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
@
Override
super
.
processRepay
(
repaySuccessEvent
.
getQueueNotice
());
public
void
repayFailPublish
(
RepayFailEvent
repayFailEvent
)
{
}
String
logPrefix
=
"[${prefix}EventHandler][repayFailPublish]"
;
log
.
info
(
"{},还款失败事件,消息内容:{}"
,
logPrefix
,
repayFailEvent
);
@
Override
QuotaNoticeExtraDto
extraDto
=
repayFailEvent
.
getQueueNotice
();
public
void
repayFailPublish
(
RepayFailEvent
repayFailEvent
)
{
String
businessFlowNo
=
repayFailEvent
.
getBusinessFlowNo
();
String
logPrefix
=
"[${prefix}EventHandler][repayFailPublish]"
;
String
failMsg
=
repayFailEvent
.
getFailMsg
();
log
.
info
(
"{},还款失败事件,消息内容:{}"
,
logPrefix
,
repayFailEvent
);
String
channelOrderNo
=
repayFailEvent
.
getChannelOrderNo
();
QuotaNoticeExtraDto
extraDto
=
repayFailEvent
.
getQueueNotice
();
Long
channelId
=
repayFailEvent
.
getChannelId
();
String
businessFlowNo
=
repayFailEvent
.
getBusinessFlowNo
();
KANoticeType
noticeType
=
repayFailEvent
.
getNoticeType
();
String
failMsg
=
repayFailEvent
.
getFailMsg
();
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
String
channelOrderNo
=
repayFailEvent
.
getChannelOrderNo
();
Long
channelId
=
repayFailEvent
.
getChannelId
();
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
KANoticeType
noticeType
=
repayFailEvent
.
getNoticeType
();
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
String
applyNo
=
extraDto
.
getData
().
getApplyNo
();
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
String
callbackUrl
=
getOrderCallbackUrl
(
channelId
,
noticeType
);
if
(
StringUtils
.
isEmpty
(
callbackUrl
))
{
log
.
error
(
"{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}"
,
logPrefix
,
channelId
,
applyNo
,
noticeType
.
name
());
throw
new
CommonBizException
(
"回调地址无配置"
);
throw
new
CommonBizException
(
"回调地址无配置"
);
}
}
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
LoanOrderMapping
orderMapping
=
getOrderMapping
(
channelOrderNo
,
channelId
);
Long
userId
=
orderMapping
.
getQgUserId
();
Long
userId
=
orderMapping
.
getQgUserId
();
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
UserMapping
userMapping
=
getUserMapping
(
userId
,
channelId
);
String
channelUserId
=
userMapping
.
getChannelUserId
();
String
channelUserId
=
userMapping
.
getChannelUserId
();
//
根据核心系统还款流水号查询渠道的还款流水号
//
根据核心系统还款流水号查询渠道的还款流水号
String
channelRepayFlowNo
=
null
;
String
channelRepayFlowNo
=
null
;
BigDecimal
repaymentAmount
=
null
;
BigDecimal
repaymentAmount
=
null
;
RepayFlowNoMapping
repayFlowNoMapping
=
repayFlowNoMappingRepository
.
findByXyqbRepayFlowNoOne
(
businessFlowNo
);
RepayFlowNoMapping
repayFlowNoMapping
=
if
(
Objects
.
nonNull
(
repayFlowNoMapping
))
{
repayFlowNoMappingRepository
.
findByXyqbRepayFlowNoOne
(
businessFlowNo
);
if
(
Objects
.
nonNull
(
repayFlowNoMapping
))
{
channelRepayFlowNo
=
repayFlowNoMapping
.
getChannelRepayFlowNo
();
channelRepayFlowNo
=
repayFlowNoMapping
.
getChannelRepayFlowNo
();
repaymentAmount
=
new
BigDecimal
(
repayFlowNoMapping
.
getRepayAmount
());
repaymentAmount
=
new
BigDecimal
(
repayFlowNoMapping
.
getRepayAmount
());
}
}
Map
<
String
,
String
>
callbackParam
=
new
HashMap
<>();
Map
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
<
String
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
,
String
>
callbackParam
=
new
HashMap
<>();
super
.
processRepay
(
repayFailEvent
.
getQueueNotice
());
QueueNotice
queueNotice
=
new
QueueNotice
(
noticeType
,
extraDto
);
}
publishTask
(
callbackParam
,
callbackUrl
,
queueNotice
);
super
.
processRepay
(
repayFailEvent
.
getQueueNotice
());
}
@
Override
public
void
cancelAfterLoanPublish
(
CancelAfterLoanEvent
cancelAfterLoanEvent
)
{
String
logPrefix
=
"[${prefix}EventHandler][cancelAfterLoanPublish]"
;
@
Override
log
.
info
(
"{},不处理贷后关单事件,消息内容:{}"
,
logPrefix
,
cancelAfterLoanEvent
);
public
void
cancelAfterLoanPublish
(
CancelAfterLoanEvent
cancelAfterLoanEvent
)
{
String
logPrefix
=
"[${prefix}EventHandler][cancelAfterLoanPublish]"
;
}
log
.
info
(
"{},不处理贷后关单事件,消息内容:{}"
,
logPrefix
,
cancelAfterLoanEvent
);
@
Override
}
public
void
dropCourseSuccessPublish
(
DropCourseSuccessEvent
dropCourseSuccEvent
)
{
String
logPrefix
=
"[${prefix}EventHandler][dropCourseSuccessPublish]"
;
@
Override
log
.
info
(
"{},不处理退课事件,消息内容:{}"
,
logPrefix
,
dropCourseSuccEvent
);
public
void
dropCourseSuccessPublish
(
DropCourseSuccessEvent
dropCourseSuccEvent
)
{
}
String
logPrefix
=
"[${prefix}EventHandler][dropCourseSuccessPublish]"
;
log
.
info
(
"{},不处理退课事件,消息内容:{}"
,
logPrefix
,
dropCourseSuccEvent
);
@
Override
}
public
void
addBankCardPublish
(
AddBankCardEvent
addBankCardEvent
)
{
String
logPrefix
=
"[${prefix}EventHandler][addBankCardEvent]"
;
@
Override
log
.
info
(
"{},不处理添加卡事件,消息内容:{}"
,
logPrefix
,
addBankCardEvent
);
public
void
addBankCardPublish
(
AddBankCardEvent
addBankCardEvent
)
{
}
String
logPrefix
=
"[${prefix}EventHandler][addBankCardEvent]"
;
log
.
info
(
"{},不处理添加卡事件,消息内容:{}"
,
logPrefix
,
addBankCardEvent
);
@
Override
}
public
void
bindCardPublish
(
BindCardEvent
bindCardEvent
)
{
String
logPrefix
=
"[${prefix}EventHandler][bindCardEvent]"
;
@
Override
log
.
info
(
"{},不处理绑卡事件,消息内容:{}"
,
logPrefix
,
bindCardEvent
);
public
void
bindCardPublish
(
BindCardEvent
bindCardEvent
)
{
}
String
logPrefix
=
"[${prefix}EventHandler][bindCardEvent]"
;
log
.
info
(
"{},不处理绑卡事件,消息内容:{}"
,
logPrefix
,
bindCardEvent
);
/**
}
*
根据
channelOrderNo
,
channelId
查询出渠道授信订单
*
/**
*
@
param
channelOrderNo
*
根据
channelOrderNo
,
channelId
查询出渠道授信订单
*
@
param
channelId
*
*
@
return
*
@
param
channelOrderNo
*/
*
@
param
channelId
private
LoanOrderMapping
getOrderMapping
(
String
channelOrderNo
,
Long
channelId
)
{
*
@
return
LoanOrderMapping
orderMapping
=
orderMappingService
.
findByChannelOrderNoAndRegisteredFromLastOne
(
channelOrderNo
,
channelId
);
*/
if
(
Objects
.
isNull
(
orderMapping
))
{
private
LoanOrderMapping
getOrderMapping
(
String
channelOrderNo
,
Long
channelId
)
{
LoanOrderMapping
orderMapping
=
orderMappingService
.
findByChannelOrderNoAndRegisteredFromLastOne
(
channelOrderNo
,
channelId
);
if
(
Objects
.
isNull
(
orderMapping
))
{
log
.
error
(
"${prefix}渠道回调通知,查询授信订单为空, channelOrderNo={}, channelId={}"
,
channelOrderNo
,
channelId
);
log
.
error
(
"${prefix}渠道回调通知,查询授信订单为空, channelOrderNo={}, channelId={}"
,
channelOrderNo
,
channelId
);
throw
new
CommonBizException
(
"查询授信订单为空"
);
throw
new
CommonBizException
(
"查询授信订单为空"
);
}
}
return
orderMapping
;
return
orderMapping
;
}
}
/**
/**
*
根据
userId
,
channelId
查询
UserMapping
*
根据
userId
,
channelId
查询
UserMapping
*
*
*
@
param
userId
*
@
param
userId
*
@
param
channelId
*
@
param
channelId
*
@
return
*
@
return
*/
*/
private
UserMapping
getUserMapping
(
Long
userId
,
Long
channelId
)
{
private
UserMapping
getUserMapping
(
Long
userId
,
Long
channelId
)
{
UserMapping
userMapping
=
userMappingService
.
findByQgUserIdAndRegisteredFrom
(
userId
,
channelId
);
UserMapping
userMapping
=
userMappingService
.
findByQgUserIdAndRegisteredFrom
(
userId
,
channelId
);
if
(
Objects
.
isNull
(
userMapping
))
{
if
(
Objects
.
isNull
(
userMapping
))
{
log
.
error
(
"${prefix}渠道回调通知,通过qgUserId查询渠道用户id为空, qgUserId={}, channelId={}"
,
userId
,
channelId
);
log
.
error
(
"${prefix}渠道回调通知,通过qgUserId查询渠道用户id为空, qgUserId={}, channelId={}"
,
userId
,
channelId
);
throw
new
CommonBizException
(
"通过qgUserId查询渠道用户id为空"
);
throw
new
CommonBizException
(
"通过qgUserId查询渠道用户id为空"
);
}
}
return
userMapping
;
return
userMapping
;
}
}
/**
/**
*
发布任务
*
发布任务
*
*
*
@
param
paraMap
*
@
param
paraMap
*
@
param
url
*
@
param
url
*
@
param
queueNotice
*
@
param
queueNotice
*/
*/
private
void
publishTask
(
Map
<
String
,
String
>
paraMap
,
String
url
,
QueueNotice
queueNotice
)
{
private
void
publishTask
(
Map
log
.
info
(
"[publishTask],发送消息内容:{},url地址:{},ka消息体:{}"
,
paraMap
,
url
,
queueNotice
);
<
String
HttpTaskBody
taskBody
=
this
.
buildTaskBody
(
paraMap
,
url
,
queueNotice
);
,
String
>
paraMap
,
String
url
,
QueueNotice
queueNotice
)
{
log
.
info
(
"[publishTask],taskBody:{}"
,
taskBody
);
log
.
info
(
"[publishTask],发送消息内容:{},url地址:{},ka消息体:{}"
,
paraMap
,
url
,
queueNotice
);
AsyncTask
asyncTask
=
super
.
buildPublishTask
(
BizAppId
.
CHANNEL_NOTIFY
,
queueNotice
);
HttpTaskBody
taskBody
=
this
.
buildTaskBody
(
paraMap
,
url
,
queueNotice
);
log
.
info
(
"[publishTask],asyncTask:{}"
,
asyncTask
);
log
.
info
(
"[publishTask],taskBody:{}"
,
taskBody
);
asyncTask
.
setTaskBody
(
taskBody
);
AsyncTask
asyncTask
=
super
.
buildPublishTask
(
BizAppId
.
CHANNEL_NOTIFY
,
queueNotice
);
super
.
publishAsyncTask
(
asyncTask
,
queueNotice
);
log
.
info
(
"[publishTask],asyncTask:{}"
,
asyncTask
);
}
asyncTask
.
setTaskBody
(
taskBody
);
super
.
publishAsyncTask
(
asyncTask
,
queueNotice
);
/**
}
*
构建推送
TaskBody
*
/**
*
@
param
paraMap
*
构建推送
TaskBody
*
@
param
url
*
*
@
param
queueNotice
*
@
param
paraMap
*
@
return
*
@
param
url
*/
*
@
param
queueNotice
private
HttpTaskBody
buildTaskBody
(
Map
<
String
,
String
>
paraMap
,
String
url
,
QueueNotice
queueNotice
)
{
*
@
return
JSONObject
jsonObject
=
new
JSONObject
();
*/
jsonObject
.
put
(
""
,
""
);
private
HttpTaskBody
buildTaskBody
(
Map
String
assetRule
=
jsonObject
.
toJSONString
();
<
String
,
String
>
paraMap
,
String
url
,
QueueNotice
queueNotice
)
{
Map
<
String
,
String
>
header
=
new
HashMap
<>(
2
);
JSONObject
jsonObject
=
new
JSONObject
();
header
.
put
(
"Content-Type"
,
""
);
jsonObject
.
put
(
""
,
""
);
HttpTaskBody
taskBody
=
new
HttpTaskBody
();
String
assetRule
=
jsonObject
.
toJSONString
();
taskBody
.
setHeaders
(
header
);
taskBody
.
setUrl
(
url
);
Map
taskBody
.
setParams
(
paraMap
);
<
String
taskBody
.
setAssertRule
(
assetRule
);
,
String
>
header
=
new
HashMap
<>(
2
);
taskBody
.
setQueueNotice
(
queueNotice
);
header
.
put
(
"Content-Type"
,
""
);
return
taskBody
;
HttpTaskBody
taskBody
=
new
HttpTaskBody
();
}
taskBody
.
setHeaders
(
header
);
taskBody
.
setUrl
(
url
);
taskBody
.
setParams
(
paraMap
);
}
taskBody
.
setAssertRule
(
assetRule
);
taskBody
.
setQueueNotice
(
queueNotice
);
return
taskBody
;
}
}
src/main/resources/templates/code-generator/model/QueryLoanResult.ftl
View file @
5339af9b
...
@@ -38,4 +38,6 @@ public class ${prefix}QueryLoanResult {
...
@@ -38,4 +38,6 @@ public class ${prefix}QueryLoanResult {
}
}
}
}
public
${
prefix
}
QueryLoanResult
(){}
}
}
\ No newline at end of file
src/main/resources/templates/code-generator/service/ServiceImpl.ftl
View file @
5339af9b
...
@@ -491,7 +491,7 @@ public class ${prefix}ServiceImpl implements ${prefix}Service{
...
@@ -491,7 +491,7 @@ public class ${prefix}ServiceImpl implements ${prefix}Service{
*/
*/
@
Override
@
Override
public
ServiceResult
<${
prefix
}
RepayByPlanResult
>
repayByPlan
(${
prefix
}
RepayByPlanRequest
request
){
public
ServiceResult
<${
prefix
}
RepayByPlanResult
>
repayByPlan
(${
prefix
}
RepayByPlanRequest
request
){
String
logPre
=
LOG_PRE
+
"[repayByPlan][{prefix}发起主动还款]"
;
String
logPre
=
LOG_PRE
+
"[repayByPlan][
$
{prefix}发起主动还款]"
;
log
.
info
(
"{} request={}"
,
logPre
,
request
);
log
.
info
(
"{} request={}"
,
logPre
,
request
);
Long
channelId
=
request
.
getChannelId
();
Long
channelId
=
request
.
getChannelId
();
ServiceResult
<
MoBankCardInfoOutput
>
bankInfoResult
=
moOrderRepresentationService
.
queryBankCardInfoByBindCardId
(
request
.
getBindId
());
ServiceResult
<
MoBankCardInfoOutput
>
bankInfoResult
=
moOrderRepresentationService
.
queryBankCardInfoByBindCardId
(
request
.
getBindId
());
...
@@ -527,6 +527,4 @@ public class ${prefix}ServiceImpl implements ${prefix}Service{
...
@@ -527,6 +527,4 @@ public class ${prefix}ServiceImpl implements ${prefix}Service{
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment