Commit e8cfb407 authored by liwenbin's avatar liwenbin

授信流程优化需求

parent 959e022c
......@@ -34,7 +34,8 @@ public enum QGExceptionType {
NO_DISTRIBUTE_NODE(2026, "未找到分发节点, uuid : %s, assetNo %s, records : %s"),
NOTIFY_FUND_SERVER_ERROR(2041, "通知资金系统失败, uuid : %s, bizNo : %s, assetNo : %s"),
NOT_FOUND_FUND_SERVER_RESULT_BIZNO(2042, "未找到资金结果通知订单, bizNo : %s, status : %s");
NOT_FOUND_FUND_SERVER_RESULT_BIZNO(2042, "未找到资金结果通知订单, bizNo : %s, status : %s"),
NOTIFY_BUSINESS_FLOW_ERROR(2042, "通知业务流系统订单终态失败, bizNo : %s, status : %s");
......
......@@ -211,7 +211,9 @@ public class AssetDistributeServiceImpl implements IAssetDistributeService{
Stopwatch stopwatch = Stopwatch.createStarted();
// 1、更改分配记录状态
assetDistributeRecordService.updateAssetDistributeStatus(bizNo, fundingResult == FundingResult.FUAD_ASSIGN_SUCC ? StatusConstants.SUCCESS : StatusConstants.FAIL);
// 2、重新进行分发, 目前还没有,等接了助贷资金路由以后再增加
// 2、通知业务流系统
notifyService.notifyBusinessFlow(bizNo, fundingResult == FundingResult.FUAD_ASSIGN_SUCC ? StatusConstants.SUCCESS : StatusConstants.FAIL);
// 3、重新进行分发, 目前还没有,等接了助贷资金路由以后再增加
log.info("资产分发接收资金结果处理结束, bizNo : {}, fundingResult : {}, 耗时 : {}", bizNo, fundingResult.getCode(), stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
} catch (QGException qe) {
log.error("资产分发接收资金结果处理出现错误 : {}, bizNo : {}, fundingResult : {}", qe.qgExceptionType.code + "->" + qe.detail, bizNo, fundingResult.getCode()) ;
......
......@@ -14,4 +14,9 @@ public interface INotifyService {
* @param assetForm
*/
public void notifyFundServer(AssetForm assetForm);
/**
* 通知业务流系统
*/
public void notifyBusinessFlow(String bizNo, Integer status);
}
package com.quantgroup.asset.distribution.service.notify.impl;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.quantgroup.asset.distribution.exception.QGException;
import com.quantgroup.asset.distribution.exception.QGExceptionType;
import com.quantgroup.asset.distribution.model.form.AssetForm;
import com.quantgroup.asset.distribution.service.alarm.IAlarmService;
import com.quantgroup.asset.distribution.service.distribute.IDistributeFailLogService;
import com.quantgroup.asset.distribution.service.httpclient.IHttpService;
import com.quantgroup.asset.distribution.service.notify.INotifyService;
......@@ -25,9 +25,13 @@ public class NotifyServiceImpl implements INotifyService{
@Value("${isDebug}")
private Boolean isDebug;
@Value("${business.flow.url}")
private String businessFlowURL;
@Autowired
private IHttpService httpService;
@Autowired
private IAlarmService alarmService;
@Override
public void notifyFundServer(AssetForm assetForm) {
......@@ -43,4 +47,25 @@ public class NotifyServiceImpl implements INotifyService{
throw new QGException(QGExceptionType.NOTIFY_FUND_SERVER_ERROR, assetForm.getUuid(), assetForm.getBizNo(), assetForm.getAssetNo());
}
}
@Override
public void notifyBusinessFlow(String bizNo, Integer status) {
try {
if (isDebug) { return; }
log.info("通知业务流系统订单终态开始, bizNo : {}, status : {}", bizNo, status);
String response = httpService.post(businessFlowURL + "/ex/inner/accept_info", new HashMap<String, String>(){{
put("applyNo", bizNo);
put("status", status + "");
put("type", "5");
}});
log.info("通知业务流系统订单终态结束, bizNo : {}, status : {}, response : {}", bizNo, status, response);
JSONObject data = null;
if (StringUtils.isEmpty(response) || (data = JSON.parseObject(response)).getInteger("code") != 0) {
throw new QGException(QGExceptionType.NOTIFY_BUSINESS_FLOW_ERROR, bizNo, status);
}
} catch (Exception e) {
log.error("资产分发订单终态通知业务流系统异常, bizNo : {}, status : {}", bizNo, status);
alarmService.dingtalkAlarm("Warn", "通知业务流系统订单终态异常", "bizNo : " + bizNo + " , " + "status : " + status);
}
}
}
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