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

fix bug

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