Commit f818e6ae authored by 黎博's avatar 黎博

修改风控审核接口参数获取逻辑

parent abf698b2
...@@ -58,16 +58,20 @@ public class RuleEngineInterceptor implements HandlerInterceptor { ...@@ -58,16 +58,20 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
QueryWrapper<Mock> queryWrapper = new QueryWrapper<>(); QueryWrapper<Mock> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("url", uri); queryWrapper.eq("url", uri);
Mock mock = mockMapper.selectOne(queryWrapper); Mock mock = mockMapper.selectOne(queryWrapper);
String mockData = null;
if (mock.getFlag() == 0) {
mockData = mock.getFail();
}
if (mock.getFlag() == 1) {
mockData = mock.getSuccess();
}
if (uri.equals("/rule_engine/middle_office/audit")) { if (uri.equals("/rule_engine/middle_office/audit")) {
Map<String, Object> responseMap = handleRiskAudit(requestMap); Map<String, Object> auditMap = JSON.parseObject(mockData, Map.class);
Map<String, Object> responseMap = handleRiskAudit(requestMap, auditMap);
InterceptorUtils.constructResponse(response, JSON.toJSONString(responseMap), "application/json; charset=utf-8"); InterceptorUtils.constructResponse(response, JSON.toJSONString(responseMap), "application/json; charset=utf-8");
return false; return false;
} }
if (mock.getFlag() == 0) { InterceptorUtils.constructResponse(response, mockData, "application/json; charset=utf-8");
InterceptorUtils.constructResponse(response, mock.getFail(), "application/json; charset=utf-8");
} else if (mock.getFlag() == 1) {
InterceptorUtils.constructResponse(response, mock.getSuccess(), "application/json; charset=utf-8");
}
return true; return true;
} }
...@@ -76,7 +80,7 @@ public class RuleEngineInterceptor implements HandlerInterceptor { ...@@ -76,7 +80,7 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
* @param requestMap HttpServletRequest请求参数Map * @param requestMap HttpServletRequest请求参数Map
* @return * @return
*/ */
public Map<String, Object> handleRiskAudit(Map<String, Object> requestMap) { public Map<String, Object> handleRiskAudit(Map<String, Object> requestMap, Map<String, Object> auditData) {
Map<String, Object> bodyMap = new HashMap<>(); Map<String, Object> bodyMap = new HashMap<>();
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
String bizType = requestMap.get("bizType").toString(); String bizType = requestMap.get("bizType").toString();
...@@ -121,7 +125,7 @@ public class RuleEngineInterceptor implements HandlerInterceptor { ...@@ -121,7 +125,7 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
// vcc // vcc
String callbackUrl = requestMap.get("callbackUrl").toString(); String callbackUrl = requestMap.get("callbackUrl").toString();
if (callbackUrl.contains("talos")) { if (callbackUrl.contains("talos")) {
vccRiskAuthAmountCompletion(callbackUrl, bizChannel, uuid, bizNo, vccAuditMount, vccAuditResult); vccRiskAuthAmountCompletion(callbackUrl, bizChannel, uuid, bizNo, (Integer) auditData.get("vccAuditAmount"), (Boolean) auditData.get("vccAuditResult"));
} }
// 一单一审现金贷 // 一单一审现金贷
if (bizType.equals("0")) { if (bizType.equals("0")) {
...@@ -144,8 +148,8 @@ public class RuleEngineInterceptor implements HandlerInterceptor { ...@@ -144,8 +148,8 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
} }
// vcc支付限额审核, sceneId=12 // vcc支付限额审核, sceneId=12
if (bizType.equals("8") && sceneId.equals("12")) { if (bizType.equals("8") && sceneId.equals("12")) {
bodyMap.put("auditResult", true); // true-允许使用额度支付, false-不允许使用额度支付 bodyMap.put("auditResult", auditData.get("vccQuotaPayAuditResult")); // true-允许使用额度支付, false-不允许使用额度支付
bodyMap.put("quotaPaymentAmount", vccQuotaPaymentAmount); // quotaPaymentAmount bodyMap.put("quotaPaymentAmount", auditData.get("vccQuotaPaymentAmount").toString()); // quotaPaymentAmount
} }
// 提前结清审核,如果渠道不在apollo配置里,则审核拒绝 // 提前结清审核,如果渠道不在apollo配置里,则审核拒绝
if (sceneId.equals("14")) { if (sceneId.equals("14")) {
......
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