Commit 998ba082 authored by 黎博's avatar 黎博

fix bug

parent 6311108a
......@@ -3,7 +3,6 @@ package cn.qg.qaplatform.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
import javax.websocket.server.ServerEndpointConfig;
@Configuration
public class WebSocketConfig {
......
......@@ -4,8 +4,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.websocket.*;
......@@ -61,7 +59,6 @@ public class WebSocketServer {
public void onMessage(String message, Session session) {
log.info("用户消息:" + userId + ",报文:" + message);
//可以群发消息
//消息保存到数据库、redis
if (StringUtils.isNotBlank(message)) {
try {
//解析发送的报文
......
......@@ -10,8 +10,6 @@ import cn.qg.qaplatform.service.QueryBasicLoanStatusDataService;
import cn.qg.qaplatform.utils.EnumUtils;
import cn.qg.qaplatform.utils.RandomDataUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......
......@@ -104,7 +104,7 @@ public class MainProcess {
if (symbol != null) {
WebSocketServer.sendInfo("授信session同步:" + result, symbol);
}
log.info("授信session同步:" + result);
log.info("授信session同步结果:" + result);
if (!result.get("code").equals("0000")) {
log.info("授信session同步失败");
}
......@@ -200,7 +200,7 @@ public class MainProcess {
params.put("card_type", 0);
JSONObject result = HttpClientUtils.doPost(url, params, headers);
if (symbol != null) {
WebSocketServer.sendInfo("上传身份证正面", symbol);
WebSocketServer.sendInfo("上传身份证正面...", symbol);
}
log.info("上传身份证正面照:" + result);
}
......@@ -217,7 +217,7 @@ public class MainProcess {
params.put("card_type", 1);
JSONObject result = HttpClientUtils.doPost(url, params, headers);
if (symbol != null) {
WebSocketServer.sendInfo("上传身份证反面", symbol);
WebSocketServer.sendInfo("上传身份证反面...", symbol);
}
log.info("上传身份证反面:" + result);
}
......@@ -234,7 +234,7 @@ public class MainProcess {
params.put("id_card_no", "455129197108031107");
JSONObject result = HttpClientUtils.doPost(url, params, headers);
if (symbol != null) {
WebSocketServer.sendInfo("提交拍照认证:" + result, symbol);
WebSocketServer.sendInfo("提交拍照认证返回结果:" + result, symbol);
}
System.out.println("提交拍照认证:" + result);
}
......@@ -253,7 +253,7 @@ public class MainProcess {
dbUtils.insert(sql3);
dbUtils.insert(sql4);
if (symbol != null) {
WebSocketServer.sendInfo("授信:", symbol);
WebSocketServer.sendInfo("授信sql:", symbol);
WebSocketServer.sendInfo(sql1, symbol);
WebSocketServer.sendInfo(sql2, symbol);
WebSocketServer.sendInfo(sql3, symbol);
......@@ -555,11 +555,11 @@ public class MainProcess {
String url = "http://opapi-" + namespace + ".liangkebang.net" + "/user/login?auth=dXNlcj1xYSZwYXNzd29yZD1xYXRlc3Q=";
JSONObject result = HttpClientUtils.doGetReturnJson(url);
log.info("登录OP:" + result);
if (symbol != null) {
WebSocketServer.sendInfo("登录OP:" + result, symbol);
}
Map data = (Map) result.get("data");
String opToken = data.get("token").toString();
if (symbol != null) {
WebSocketServer.sendInfo("登录OP,获取token:", symbol);
}
return opToken;
}
......@@ -707,6 +707,9 @@ public class MainProcess {
headers.put("x-auth-token", fundOpToken);
JSONObject result = HttpClientUtils.doPost(url, params, headers);
log.info("打开推送放款:" + result);
if (symbol != null) {
WebSocketServer.sendInfo("打开推送放款:" + result, symbol);
}
if (result.get("code").equals("0000")) {
return true;
}
......
......@@ -272,7 +272,7 @@ public class GenUserDataServiceImpl implements GenUserDataService {
log.info(searchResult.toString());
if (fundId.equals(searchResult)) {
log.info("资方分配成功!");
WebSocketServer.sendInfo("资方分配成功!", symbol);
WebSocketServer.sendInfo("查询到的资方为:" + searchResult +",资方分配成功.", symbol);
break;
} else {
log.info("资方仍未分配成功!");
......@@ -297,7 +297,7 @@ public class GenUserDataServiceImpl implements GenUserDataService {
log.info(searchResult.toString());
if (fundId.equals(searchResult)) {
log.info("资方分配成功!");
WebSocketServer.sendInfo("资方分配成功!", symbol);
WebSocketServer.sendInfo("查询到的资方为:" + searchResult +",资方分配成功.", symbol);
break;
} else {
log.info("资方仍未分配成功!");
......@@ -313,7 +313,11 @@ public class GenUserDataServiceImpl implements GenUserDataService {
WebSocketServer.sendInfo("提现成功,10秒后放款!", symbol);
Thread.sleep(10000);
boolean makeLoanResult = makeLoan(applyLoanInfo, true);
if (makeLoanResult) {
WebSocketServer.sendInfo("放款成功!", symbol);
} else {
WebSocketServer.sendInfo("放款失败!", symbol);
}
return makeLoanResult;
}
......@@ -347,7 +351,9 @@ public class GenUserDataServiceImpl implements GenUserDataService {
WebSocketServer.sendInfo("提现成功,10秒后放款!", symbol);
Thread.sleep(10000);
boolean makeLoanResult = makeLoan(applyLoanInfo, false);
if (makeLoanResult) {
WebSocketServer.sendInfo("放款失败!", symbol);
}
return makeLoanResult;
}
......@@ -361,15 +367,15 @@ public class GenUserDataServiceImpl implements GenUserDataService {
GenLoanUser genLoanUser = new GenLoanUser();
genLoanUser = queryBasicLoanStatusDataService.getUserInfoByPhoneNo(namespace, phoneNo);
genLoanUser.setFundId(queryBasicLoanStatusDataService.getAssignFundIdByUserId(namespace, genLoanUser.getUserId()));
// 资方审核中
// 授信审核中
if (redisResult.equals("0")) {
genLoanUser.setStatus(0);
genLoanUser.setDesc("资方审核中...");
genLoanUser.setDesc("授信审核中");
}
// 资方审核失败
// 授信审核失败
if (redisResult.equals("1")) {
genLoanUser.setStatus(1);
genLoanUser.setDesc("资方审核失败");
genLoanUser.setDesc("授信审核失败");
}
// 提现成功
if (redisResult.equals("2")) {
......
......@@ -17,7 +17,7 @@ import java.util.List;
import java.util.Map;
public class xyqb {
public static String namespace = "vcc";
public static String namespace = "pre";
public static Integer channelId = 1;
public static Integer fundId = 480;
public static String phone = "18300000378";
......@@ -606,6 +606,7 @@ public class xyqb {
Map<String, Object> headers = new HashMap<>();
headers.put("x-auth-token", fundOpToken);
JSONObject result = HttpClientUtils.doPost(url, params, headers);
System.out.println("推送放款URL:" + url);
System.out.println("推送放款Enable:" + result);
}
......@@ -640,6 +641,7 @@ public class xyqb {
public static void main(String[] args) throws Exception {
// 分配资金方
loginFundOP();
unblockLoan();
boolean result = assignFundOrNot();
if (!result) {
setFundPlan();
......@@ -647,46 +649,45 @@ public class xyqb {
}
// 授信
// login();
// checkUserId();
// syncSessionToXyqb();
// creditSessionSync();
// realNameVerified();
// authBasicInfo();
// enterAuthOcr();
// uploadFrontOfIdCard();
// uploadBackOfIdCard();
// submitPhotoAuth();
// credit();
// submitAudit();
// queryUserAuditRecord();
// creditAuthNotify();
// Thread.sleep(180000);
login();
checkUserId();
syncSessionToXyqb();
creditSessionSync();
realNameVerified();
authBasicInfo();
enterAuthOcr();
uploadFrontOfIdCard();
uploadBackOfIdCard();
submitPhotoAuth();
credit();
submitAudit();
queryUserAuditRecord();
creditAuthNotify();
Thread.sleep(180000);
// 绑卡提现
// login();
// checkUserId();
// syncSessionToXyqb();
// loginWithDrawPage();
// getUserAccountId();
// bindCard();
// cardAuthSms();
// cardAuthSmsConfirm();
// getBindCardList();
// createLoan();
// externalQuotaOrderAuditNotify();
// modifyContactStatus();
//
// Thread.sleep(10000);
login();
checkUserId();
syncSessionToXyqb();
loginWithDrawPage();
getUserAccountId();
bindCard();
cardAuthSms();
cardAuthSmsConfirm();
getBindCardList();
createLoan();
externalQuotaOrderAuditNotify();
modifyContactStatus();
Thread.sleep(10000);
// 放款
// loginOP();
// checkWaitingFundingCorpOperatePeople();
// modifyWaitingFundingCreatedAt();
// Thread.sleep(10000);
// fundsPlanLoanApply();
// Thread.sleep(10000);
// payNotify();
loginOP();
checkWaitingFundingCorpOperatePeople();
modifyWaitingFundingCreatedAt();
Thread.sleep(10000);
fundsPlanLoanApply();
Thread.sleep(10000);
payNotify();
}
}
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