Commit 51710279 authored by 黎博's avatar 黎博

新增云信

parent 4011e8e8
......@@ -5,7 +5,8 @@ package cn.qg.qaplatform.common.enums;
*/
public enum FundEnum {
GYXD("广达小贷", 480);
GYXD("广达小贷", 480),
YNXT("云南信托", 1040);
private String name;
private Integer fundId;
......
......@@ -70,4 +70,6 @@ public interface QueryBasicLoanStatusDataMapper {
Integer getAssignFundIdByUserId(String userId);
GenLoanUser getUserInfoByPhoneNo(String phoneNo);
Integer getLoanProgressByUserId(String userId);
}
......@@ -350,6 +350,10 @@ public class MainProcess {
fundInfoObject.put("rateType", 1);
fundInfoObject.put("priority", 1);
fundInfoObject.put("feeType", 1);
// 如果是云南信托,需要该参数
if (fundId == 1040) {
fundInfoObject.put("fundProductId", 1061);
}
fundInfoList.add(fundInfoObject);
firstTerm.put("fundInfo", fundInfoList);
terms.add(firstTerm);
......@@ -509,7 +513,7 @@ public class MainProcess {
/**
* 二次风控
*/
public static boolean externalQuotaOrderAuditNotify(String namespace, String token, String uuid, Integer loanId, Integer bizType) {
public static boolean externalQuotaOrderAuditNotify(String namespace, String token, String uuid, Integer loanId, Integer bizType, boolean auditResult) {
String url = "http://clotho-" + namespace + ".liangkebang.net" + "/external/quota/order_audit/notify";
Map<String, Object> headers = new HashMap<>();
headers.put("Content-Type", "application/x-www-form-urlencoded");
......@@ -521,7 +525,7 @@ public class MainProcess {
params.put("uuid", uuid);
params.put("bizNo", loanId);
params.put("bizType", bizType);
params.put("auditResult", true);
params.put("auditResult", auditResult);
params.put("deadLine", "1548518400");
JSONObject result = HttpClientUtils.doPost(url, params, headers);
log.info("二次风控:" + result);
......@@ -735,11 +739,13 @@ public class MainProcess {
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String today = formatter.format(date);
if (dataList != null) {
for (int i=0; i < dataList.size(); i++) {
if (dataList.get(i).get("planDate").toString().equals(today)) {
flag = true;
}
}
}
log.info("资金方是否已经分配:" + flag);
if (symbol != null) {
WebSocketServer.sendInfo("资金方-" + fundId.toString() + "是否已分配:" + flag, symbol);
......
......@@ -25,7 +25,7 @@ public interface GenUserDataService {
* @param applyLoanInfo 造数据相关信息
* @return 成功或失败
*/
boolean withDraw(ApplyLoanInfo applyLoanInfo) throws Exception;
boolean withDraw(ApplyLoanInfo applyLoanInfo, boolean auditResult) throws Exception;
/**
* 放款
......
......@@ -70,4 +70,9 @@ public interface QueryBasicLoanStatusDataService {
* 根据手机号查询用户信息
*/
GenLoanUser getUserInfoByPhoneNo(String namespace, String phoneNo);
/**
* 根据userId获取用户放款状态
*/
Integer getLoanProgressByUserId(String namespace, String userId);
}
......@@ -176,4 +176,10 @@ public class QueryBasicLoanStatusDataServiceImpl implements QueryBasicLoanStatus
SwitchDataSource.dataSourceSwitch(namespace, "xyqb_user");
return basicLoanStatusDataMapper.getUserInfoByPhoneNo(phoneNo);
}
@Override
public Integer getLoanProgressByUserId(String namespace, String userId) {
SwitchDataSource.dataSourceSwitch(namespace, "xyqb");
return basicLoanStatusDataMapper.getLoanProgressByUserId(userId);
}
}
......@@ -99,4 +99,10 @@
WHERE `phone_no` = #{phoneNo}
</select>
<!-- 根据用户id获取放款进度 -->
<select id="getLoanProgressByUserId" resultType="java.lang.Integer">
SELECT `progress` FROM `loan_application_history`
WHERE `user_id`=#{userId}
</select>
</mapper>
\ No newline at end of file
......@@ -17,10 +17,10 @@ import java.util.List;
import java.util.Map;
public class xyqb {
public static String namespace = "pre";
public static String namespace = "xyqb";
public static Integer channelId = 1;
public static Integer fundId = 480;
public static String phone = "18300000378";
public static Integer fundId = 1040;
public static String phone = "18300120382";
public static String token = "";
public static String uuid = "";
public static Long userId;
......@@ -307,6 +307,7 @@ public class xyqb {
JSONArray financeProducts = createFinanceProducts();
params.put("financeProducts", financeProducts);
JSONObject result = HttpClientUtils.doPost(url, params, headers);
System.out.println("风控授信回调参数:" + params);
System.out.println("风控授信回调:" + result);
}
......@@ -328,6 +329,10 @@ public class xyqb {
fundInfoObject.put("rateType", 1);
fundInfoObject.put("priority", 1);
fundInfoObject.put("feeType", 1);
// 云信判断
if (fundId == 1040) {
fundInfoObject.put("fundProductId", 1061);
}
fundInfoList.add(fundInfoObject);
firstTerm.put("fundInfo", fundInfoList);
terms.add(firstTerm);
......@@ -628,15 +633,28 @@ public class xyqb {
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String today = formatter.format(date);
if (dataList != null) {
for (int i=0; i < dataList.size(); i++) {
if (dataList.get(i).get("planDate").toString().equals(today)) {
flag = true;
}
}
}
System.out.println("资金方是否已经分配:" + flag);
return flag;
}
/**
* 云信插入银行卡
*/
public static void insertBankCardOfYunxing() throws SQLException {
String sql = "INSERT INTO `card_check_record`(`user_id`, `card_no`, `bank_code`, `bank_name`, `branch_no`, `branch_name`, `province`, `city`, `card_type`, `is_active`, `created_at`, `updated_at`) VALUES (" + userId + ", '6222988108217968', 'PINGAN', '平安银行', NULL, NULL, NULL, NULL, 2, 1, '2020-08-13 14:04:27', '2020-08-13 14:04:27');";
System.out.println(sql);
DBUtils dbUtils = new DBUtils(namespace, "payment_center", "qa", "qatest");
Integer result = dbUtils.insert(sql);
System.out.println("云信插入银行卡结果:" + result);
}
public static void main(String[] args) throws Exception {
// 分配资金方
......@@ -651,6 +669,10 @@ public class xyqb {
// 授信
login();
checkUserId();
// 如果是云信,则需要插入银行卡
if (fundId == 1040) {
insertBankCardOfYunxing();
}
syncSessionToXyqb();
creditSessionSync();
realNameVerified();
......
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