Commit da5e7b08 authored by 黎博's avatar 黎博

update

parent fa72ee63
......@@ -16,6 +16,8 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
......@@ -200,6 +202,42 @@ public class Vcc {
log.info("授信结果查询:" + result);
}
/**
* 查询授信单号
*/
public static String getRiskNo(String namespace, String uuid) throws SQLException {
DBUtils dbUtils = new DBUtils(namespace, "vcc_talos", "qa", "qatest");
String sql = "select risk_no from risk_record where uuid='" + uuid + "';";
Map<String, String> map = dbUtils.queryForMap(sql);
return map.get("risk_no");
}
/**
* vcc风控授信回调
*/
public static void vccWindControlCreditCallback(String namespace, String uuid, String riskNo) {
String url = "https://talos-" + namespace + ".liangkebang.net/ex/vcc/risk/auth_amount_completion";
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 15);
long openingDeadLine = calendar.getTimeInMillis();
Map<String, Object> params = new HashMap<>();
params.put("amount", 10000);
params.put("auditResult", true);
params.put("bizChannel", 1);
params.put("bizNo", riskNo);
params.put("code", 0);
params.put("deadLine", "1640966399000");
params.put("openingDeadLine", openingDeadLine); // 开户失败有效期
params.put("success", true);
params.put("uuid", uuid);
params.put("sceneId", 0);
params.put("allowInstalment", 1); // 1-允许分期,0-不允许分期
Map<String, Object> headers = new HashMap<>();
headers.put("Content-Type", "application/x-www-form-urlencoded");
JSONObject result = HttpClientUtils.doPost(url, params, headers);
log.info("vcc风控授信回调结果:" + result);
}
/**
* 人脸识别回调
*/
......@@ -304,4 +342,8 @@ public class Vcc {
}
return true;
}
public static void main(String[] args) throws SQLException {
vccWindControlCreditCallback("vc2", "1", "");
}
}
......@@ -24,14 +24,17 @@ import java.util.*;
import com.alibaba.fastjson.JSONObject;
/**
* Http请求工具类
* @author libo
*/
@Slf4j
public class HttpClientUtils {
private static CloseableHttpClient client = HttpClients.createDefault();
private static final CloseableHttpClient client = HttpClients.createDefault();
/**
* 不带参数的GET请求
*
* @param url 请求的url
* @return json
*/
......@@ -69,7 +72,6 @@ public class HttpClientUtils {
/**
* 带参数的GET请求
*
* @param url 请求url
* @param params 请求参数
* @param headers 请求头
......
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