Commit 5339af9b authored by 王向伟's avatar 王向伟

去掉没必要的变量,解决编译错误

parent 43afadf3
package ${eventhandlerPackage};
import cn.quantgroup.cashloanflow.entity.cashloanflow.LoanMapping;
import cn.quantgroup.cashloanflow.entity.cashloanflow.LoanOrderMapping;
import cn.quantgroup.cashloanflow.entity.cashloanflow.RepayFlowNoMapping;
......@@ -9,13 +8,10 @@ import cn.quantgroup.cashloanflow.entity.cashloanflow.UserMapping;
import cn.quantgroup.cashloanflow.model.callback.KANoticeType;
import cn.quantgroup.cashloanflow.model.standard.response.credit.QueryCreditStatusResponseModel;
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.service.cashloanflow.ILoanOrderMappingService;
import cn.quantgroup.cashloanflow.service.cashloanflow.IUserMappingService;
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.asynctask.executor.config.BizAppId;
import cn.quantgroup.loanflow.asynctask.model.AsyncTask;
......@@ -30,7 +26,6 @@ import cn.quantgroup.loanflow.order.model.ChannelOrder;
import cn.quantgroup.loanflow.repay.model.RepaymentPlanItem;
import cn.quantgroup.loanflow.repay.model.representation.OrderRepaymentRepresentation;
import cn.quantgroup.mo.risk.service.MoRiskRepresentationService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
......@@ -51,93 +46,98 @@ import java.util.*;
@Service
@Slf4j
public class ${prefix}EventHandler extends AbstractEventHandler implements IEventHandler {
@Autowired
private ILoanOrderMappingService orderMappingService;
@Autowired
private IUserMappingService userMappingService;
@Autowired
private MoRiskRepresentationService moRiskRepresentationService;
@Autowired
private LoanMappingService loanMappingService;
@Autowired
private IRepayFlowNoMappingRepository repayFlowNoMappingRepository;
@Autowired
private ILoanOrderMappingService orderMappingService;
@Autowired
private IUserMappingService userMappingService;
@Resource(name = "standardApplicationMoService")
private StandardApplicationService standardApplicationService;
@Autowired
private LoanMappingService loanMappingService;
@Autowired
private IRepayFlowNoMappingRepository repayFlowNoMappingRepository;
@Resource(name = "standardApplicationMoService")
private StandardApplicationService standardApplicationService;
@Override
public void creditSuccessPublish(CreditSuccessEvent creditSuccEvent) {
String logPrefix = "[notify][handler][creditSuccEvent]";
log.info("{},不处理进件同步成功事件,消息内容:{}", logPrefix, creditSuccEvent);
}
@Override
public void auditRejectPublish(AuditRejectEvent auditRejectEvent) {
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();
@Override
public void creditSuccessPublish(CreditSuccessEvent creditSuccEvent) {
String logPrefix = "[notify][handler][creditSuccEvent]";
log.info("{},不处理进件同步成功事件,消息内容:{}", logPrefix, creditSuccEvent);
}
String callbackUrl = getOrderCallbackUrl(channelId, noticeType);
if (StringUtils.isEmpty(callbackUrl)) {
log.error("{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}", logPrefix, channelId, applyNo, noticeType.name());
throw new CommonBizException("回调地址无配置");
}
@Override
public void auditRejectPublish(AuditRejectEvent auditRejectEvent) {
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();
LoanOrderMapping orderMapping = getOrderMapping(channelOrderNo, channelId);
Long userId = orderMapping.getQgUserId();
UserMapping userMapping = getUserMapping(userId, channelId);
String channelUserId = userMapping.getChannelUserId();
UserMapping userMapping = getUserMapping(userId, channelId);
String channelUserId = userMapping.getChannelUserId();
Map<String, String> callbackParam = new HashMap<>();
QueueNotice queueNotice = new QueueNotice(noticeType, extraDto);
publishTask(callbackParam, callbackUrl, queueNotice);
}
@Override
public void auditPassPublish(AuditPassEvent auditPassEvent) {
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();
Map
<String, String> callbackParam = new HashMap<>();
QueueNotice queueNotice = new QueueNotice(noticeType, extraDto);
publishTask(callbackParam, callbackUrl, queueNotice);
}
String callbackUrl = getOrderCallbackUrl(channelId, noticeType);
if (StringUtils.isEmpty(callbackUrl)) {
log.error("{},回调地址无配置,channelId:{},applyNo:{},noticeType:{}", logPrefix, channelId, applyNo, noticeType.name());
throw new CommonBizException("回调地址无配置");
}
@Override
public void auditPassPublish(AuditPassEvent auditPassEvent) {
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);
Long userId = orderMapping.getQgUserId();
LoanOrderMapping orderMapping = getOrderMapping(channelOrderNo, channelId);
Long userId = orderMapping.getQgUserId();
UserMapping userMapping = getUserMapping(userId, channelId);
String channelUserId = userMapping.getChannelUserId();
UserMapping userMapping = getUserMapping(userId, channelId);
String channelUserId = userMapping.getChannelUserId();
ChannelOrder channelOrderQueryCreditStatus = ChannelOrder.builder()
.channelOrderNo(channelOrderNo)
.channelId(channelId)
.build();
ServiceResult<QueryCreditStatusResponseModel> creditStatus = standardApplicationService.queryCreditStatus(channelOrderQueryCreditStatus);
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())) {
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
<String
, String> callbackParam = new HashMap<>();
QueueNotice queueNotice = new QueueNotice(noticeType, extraDto);
publishTask(callbackParam, callbackUrl, queueNotice);
......@@ -181,7 +181,9 @@ public class ${prefix}EventHandler extends AbstractEventHandler implements IEven
String channelLoanNo = loanMapping.getChannelLoanNo();
Map<String, String> callbackParam = new HashMap<>();
Map
<String
, String> callbackParam = new HashMap<>();
QueueNotice queueNotice = new QueueNotice(noticeType, extraDto);
publishTask(callbackParam, callbackUrl, queueNotice);
......@@ -221,7 +223,9 @@ public class ${prefix}EventHandler extends AbstractEventHandler implements IEven
String channelLoanNo = loanMapping.getChannelLoanNo();
Map<String, String> callbackParam = new HashMap<>();
Map
<String
, String> callbackParam = new HashMap<>();
QueueNotice queueNotice = new QueueNotice(noticeType, extraDto);
publishTask(callbackParam, callbackUrl, queueNotice);
......@@ -250,7 +254,9 @@ public class ${prefix}EventHandler extends AbstractEventHandler implements IEven
UserMapping userMapping = getUserMapping(userId, channelId);
String channelUserId = userMapping.getChannelUserId();
Map<String, String> callbackParam = new HashMap<>();
Map
<String
, String> callbackParam = new HashMap<>();
QueueNotice queueNotice = new QueueNotice(noticeType, extraDto);
publishTask(callbackParam, callbackUrl, queueNotice);
......@@ -281,7 +287,9 @@ public class ${prefix}EventHandler extends AbstractEventHandler implements IEven
UserMapping userMapping = getUserMapping(userId, channelId);
String channelUserId = userMapping.getChannelUserId();
Map<String, String> callbackParam = new HashMap<>();
Map
<String
, String> callbackParam = new HashMap<>();
QueueNotice queueNotice = new QueueNotice(noticeType, extraDto);
publishTask(callbackParam, callbackUrl, queueNotice);
......@@ -329,16 +337,20 @@ public class ${prefix}EventHandler extends AbstractEventHandler implements IEven
repaymentAmount = new BigDecimal(repayFlowNoMapping.getRepayAmount());
}
// 查询还款计划
ServiceResult<OrderRepaymentRepresentation> serviceResult = standardApplicationService.repaymentPlanQueryByCycleQuota(loanId);
ServiceResult
<OrderRepaymentRepresentation> serviceResult = standardApplicationService.repaymentPlanQueryByCycleQuota(loanId);
log.info("{} 查询还款计划结果 serviceResult={},orderNo={}", logPrefix, serviceResult, channelOrderNo);
if (Objects.isNull(serviceResult) || !serviceResult.isSuccess() || Objects.isNull(serviceResult.getData())) {
log.error("{},还款成功推送,查询还款计划返回错误或无数据,orderNo={},applyNo={}", logPrefix, channelOrderNo, applyNo);
throw new CommonBizException("还款成功,查询还款计划返回错误或无数据");
}
List<RepaymentPlanItem> repaymentPlans = serviceResult.getData().getRepaymentPlans();
List
<RepaymentPlanItem> repaymentPlans = serviceResult.getData().getRepaymentPlans();
Map<String, String> callbackParam = new HashMap<>();
Map
<String
, String> callbackParam = new HashMap<>();
QueueNotice queueNotice = new QueueNotice(noticeType, extraDto);
publishTask(callbackParam, callbackUrl, queueNotice);
super.processRepay(repaySuccessEvent.getQueueNotice());
......@@ -358,7 +370,8 @@ public class ${prefix}EventHandler extends AbstractEventHandler implements IEven
String callbackUrl = getOrderCallbackUrl(channelId, noticeType);
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("回调地址无配置");
}
......@@ -371,13 +384,16 @@ public class ${prefix}EventHandler extends AbstractEventHandler implements IEven
// 根据核心系统还款流水号查询渠道的还款流水号
String channelRepayFlowNo = null;
BigDecimal repaymentAmount = null;
RepayFlowNoMapping repayFlowNoMapping = repayFlowNoMappingRepository.findByXyqbRepayFlowNoOne(businessFlowNo);
RepayFlowNoMapping repayFlowNoMapping =
repayFlowNoMappingRepository.findByXyqbRepayFlowNoOne(businessFlowNo);
if (Objects.nonNull(repayFlowNoMapping)) {
channelRepayFlowNo = repayFlowNoMapping.getChannelRepayFlowNo();
repaymentAmount = new BigDecimal(repayFlowNoMapping.getRepayAmount());
}
Map<String, String> callbackParam = new HashMap<>();
Map
<String
, String> callbackParam = new HashMap<>();
QueueNotice queueNotice = new QueueNotice(noticeType, extraDto);
publishTask(callbackParam, callbackUrl, queueNotice);
super.processRepay(repayFailEvent.getQueueNotice());
......@@ -417,7 +433,8 @@ public class ${prefix}EventHandler extends AbstractEventHandler implements IEven
* @return
*/
private LoanOrderMapping getOrderMapping(String channelOrderNo, Long channelId) {
LoanOrderMapping orderMapping = orderMappingService.findByChannelOrderNoAndRegisteredFromLastOne(channelOrderNo, channelId);
LoanOrderMapping orderMapping =
orderMappingService.findByChannelOrderNoAndRegisteredFromLastOne(channelOrderNo, channelId);
if (Objects.isNull(orderMapping)) {
log.error("${prefix}渠道回调通知,查询授信订单为空, channelOrderNo={}, channelId={}", channelOrderNo, channelId);
throw new CommonBizException("查询授信订单为空");
......@@ -449,7 +466,9 @@ public class ${prefix}EventHandler extends AbstractEventHandler implements IEven
* @param url
* @param queueNotice
*/
private void publishTask(Map<String, String> paraMap, String url, QueueNotice queueNotice) {
private void publishTask(Map
<String
, String> paraMap, String url, QueueNotice queueNotice) {
log.info("[publishTask],发送消息内容:{},url地址:{},ka消息体:{}", paraMap, url, queueNotice);
HttpTaskBody taskBody = this.buildTaskBody(paraMap, url, queueNotice);
log.info("[publishTask],taskBody:{}", taskBody);
......@@ -467,12 +486,16 @@ public class ${prefix}EventHandler extends AbstractEventHandler implements IEven
* @param queueNotice
* @return
*/
private HttpTaskBody buildTaskBody(Map<String, String> paraMap, String url, QueueNotice queueNotice) {
private HttpTaskBody buildTaskBody(Map
<String
, String> paraMap, String url, QueueNotice queueNotice) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("", "");
String assetRule = jsonObject.toJSONString();
Map<String, String> header = new HashMap<>(2);
Map
<String
, String> header = new HashMap<>(2);
header.put("Content-Type", "");
HttpTaskBody taskBody = new HttpTaskBody();
taskBody.setHeaders(header);
......@@ -484,4 +507,4 @@ public class ${prefix}EventHandler extends AbstractEventHandler implements IEven
}
}
}
......@@ -38,4 +38,6 @@ public class ${prefix}QueryLoanResult {
}
}
public ${prefix}QueryLoanResult(){}
}
\ No newline at end of file
......@@ -491,7 +491,7 @@ public class ${prefix}ServiceImpl implements ${prefix}Service{
*/
@Override
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);
Long channelId = request.getChannelId();
ServiceResult<MoBankCardInfoOutput> bankInfoResult = moOrderRepresentationService.queryBankCardInfoByBindCardId(request.getBindId());
......@@ -527,6 +527,4 @@ public class ${prefix}ServiceImpl implements ${prefix}Service{
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment