Commit 5e07bf8e by 王昆

gsb

parent 68541249
......@@ -98,6 +98,8 @@ class BpoSDPJApi {
* @returns {Promise<{msg: string, code: number}>}
*/
async cashQRCode(obj, req) {
let t1 = new Date().getTime();
console.log(`cashQRCode-----${obj.outTradeNo}-----begin--${t1}`);
// 检验所有参数是否完整 如果出现非法参数直接返回
if (!obj.appId) {
return this.getBaseResult(1002001, "appId不存在");
......@@ -129,6 +131,8 @@ class BpoSDPJApi {
etemplate_id: obj.ecid,
mchtId: obj.mchtId,
});
let t2 = new Date().getTime();
console.log(`cashQRCode-----${obj.outTradeNo}-----ecompanybusiSve.findOne---${t2 - t1}`);
if (!api) {
return this.getBaseResult(1001003, "配置信息错误,请联系薪必果人员进行配置");
}
......@@ -146,6 +150,9 @@ class BpoSDPJApi {
notifyUrl: obj.notifyUrl,
};
let sign = system.getSign(param, api.key, this.EXCEPT_KEYS);
let t3 = new Date().getTime();
console.log(`cashQRCode-----${obj.outTradeNo}-----system.getSign---${t3 - t2}`);
if (sign != obj.sign) {
return this.getBaseResult(1001001, "签名失败");
}
......@@ -157,7 +164,8 @@ class BpoSDPJApi {
mchtId: obj.mchtId,
outTradeNo: obj.outTradeNo,
}) || {};
let t4 = new Date().getTime();
console.log(`cashQRCode-----${obj.outTradeNo}-----ccashinfoSve.findOne--${t4 - t3}`);
console.log(`bpoSDPJApi.js -> cashQRCode -> mchtId & ecid 进行联合查询 :参数=` + JSON.stringify(obj) + " _cCashInfo = " + JSON.stringify(_cCashInfo));
//如果二维码有效直接返回
if (_cCashInfo.qrcode_status == 1 && _cCashInfo.qrcode) {
......@@ -177,6 +185,8 @@ class BpoSDPJApi {
// 保存签约数据
_cCashInfo = await this.ccashinfoSve.create(_cCashInfo);
}
let t5 = new Date().getTime();
console.log(`cashQRCode-----${obj.outTradeNo}-----ccashinfoSve.create---${t5 - t4}`);
// 拼接h5 http连接 http//xxx?mchtId=xxx&ecid=xxx&no=id
let _no = await this.setNo(_cCashInfo.id.toString());
......@@ -189,6 +199,8 @@ class BpoSDPJApi {
_cCashInfo.qrcode_status = 1;
_cCashInfo.sign_url = custormUrl;
_cCashInfo.save();
let t6 = new Date().getTime();
console.log(`cashQRCode-----${obj.outTradeNo}-----qrClient.generateQR---${t6 - t5}`);
return this.getCodeResult(0, {"qrcode": url || ""});
} catch (e) {
let result = {
......
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