Commit 4325b1ce by 王昆

gsb

parent d26cf60c
......@@ -160,7 +160,7 @@ class BpoSDPJApi {
console.log(`bpoSDPJApi.js -> cashQRCode -> mchtId & ecid 进行联合查询 :参数=` + JSON.stringify(obj) + " _cCashInfo = " + JSON.stringify(_cCashInfo));
//如果二维码有效直接返回
if (_cCashInfo.qrcode_status && _cCashInfo.qrcode) {
if (_cCashInfo.qrcode_status == 1 && _cCashInfo.qrcode) {
return this.getCodeResult(0, {"qrcode": _cCashInfo.qrcode});
}
......@@ -186,7 +186,7 @@ class BpoSDPJApi {
// 生成二维码
let url = await this.qrClient.generateQR(custormUrl);
_cCashInfo.qrcode = url;
_cCashInfo.qrcode_status = url ? 1 : 2;
_cCashInfo.qrcode_status = 1;
_cCashInfo.sign_url = custormUrl;
_cCashInfo.save();
return this.getCodeResult(0, {"qrcode": url || ""});
......@@ -311,6 +311,7 @@ class BpoSDPJApi {
*/
async removeQRCode(obj, req) {
try {
console.log("----removeqrcode----", obj.outTradeNo, new Date());
let params = {
appId: obj.appId,
mchtId: obj.mchtId,
......@@ -387,7 +388,7 @@ class BpoSDPJApi {
};
// 是否交易
if (cashInfo.trade_status) {
if (cashInfo.trade_status || cashInfo.qrcode_status == 2) {
// 1 认证页面 2 二维码已失效 3 红包领取页面 4 红包领取结果页面(心跳查询) 5 红包已被领取
resData.redirect_code = 2;
return this.getCodeResult(0, resData);
......@@ -516,7 +517,7 @@ class BpoSDPJApi {
if (!ccashinfo) {
return this.getErrResult("信息不存在");
}
if (ccashinfo.qrcode_status != 1) {
if (ccashinfo.qrcode_status == 2) {
// 1 认证页面 2 二维码已失效 3 红包领取页面 4 红包领取结果页面(心跳查询) 5 红包已被领取
return this.getCodeResult(0, {redirect_code: 2});
}
......@@ -600,7 +601,7 @@ class BpoSDPJApi {
// }
async cashOut(cashInfo, api, cashUser) {
if (cashInfo.qrcode_status != 1) {
if (cashInfo.qrcode_status == 2) {
// 1 认证页面 2 二维码已失效 3 红包领取页面 4 红包领取结果页面(心跳查询) 5 红包已被领取
return this.getCodeResult(0, {redirect_code: 2});
}
......@@ -910,14 +911,14 @@ class BpoSDPJApi {
cashInfo.trade_status = "00";
cashInfo.trade_desc = "交易成功";
await cashInfo.save();
this.notifyCash(cashInfo.id);
this.syncOneCashAmt(cashInfo.id);
await this.notifyCash(cashInfo.id);
await this.syncOneCashAmt(cashInfo.id);
return {code: "0000"};
} else if (respTradeStatus == "02" || respTradeStatus == "03") {
cashInfo.trade_status = "02";
cashInfo.trade_desc = obj.respDesc || "交易失败";
await cashInfo.save();
this.notifyCash(cashInfo.id);
await this.notifyCash(cashInfo.id);
} else {
}
this.syncOneCashAmt(cashInfo.id);
......
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