Commit cd24818e by 孙亚楠

d

parent a058ec31
...@@ -31,6 +31,7 @@ class BpoSDPJApi { ...@@ -31,6 +31,7 @@ class BpoSDPJApi {
this.esettleSve = system.getObject("service.esettleSve"); this.esettleSve = system.getObject("service.esettleSve");
this.tdevApi = require("./tdevApi"); this.tdevApi = require("./tdevApi");
this.redisLock = system.getObject("util.redisLock"); this.redisLock = system.getObject("util.redisLock");
this.bankthreelogSve = system.getObject("service.bankthreelogSve");
this.resultMap = { this.resultMap = {
0:"操作成功", 0:"操作成功",
1:"操作失败", 1:"操作失败",
...@@ -125,6 +126,11 @@ class BpoSDPJApi { ...@@ -125,6 +126,11 @@ class BpoSDPJApi {
let custormUrl = `http://bpohhr.gongsibao.com?no=${_no}&outTradeNo=${_cCashInfo.outTradeNo}&mchtId=${_cCashInfo.mchtId}`; let custormUrl = `http://bpohhr.gongsibao.com?no=${_no}&outTradeNo=${_cCashInfo.outTradeNo}&mchtId=${_cCashInfo.mchtId}`;
//6.生成二维码 //6.生成二维码
let url =await this.qrClient.generateQR(custormUrl); let url =await this.qrClient.generateQR(custormUrl);
_cCashInfo.qrcode=url;
_cCashInfo.qrcode_status=1;
_cCashInfo.save();
return this.getCodeResult(0,{"qrcode": url || ""}); return this.getCodeResult(0,{"qrcode": url || ""});
} catch (e) { } catch (e) {
let result = { let result = {
...@@ -185,6 +191,17 @@ class BpoSDPJApi { ...@@ -185,6 +191,17 @@ class BpoSDPJApi {
return this.getCodeResult(1002001,null); return this.getCodeResult(1002001,null);
} }
try{ try{
let ccashinfo = await this.dao.findOne({
where:{
id:obj.id,
mchtId:obj.mchId,
outTradeNo:obj.outTradeNo
}
});
if(!ccashinfo){
this.getErrResult("信息不存在");
}
if (!await this.idcardClient.checkIDCard(obj.id_no)) { if (!await this.idcardClient.checkIDCard(obj.id_no)) {
return this.returnjson(-1, "身份证格式不正确"); return this.returnjson(-1, "身份证格式不正确");
} }
...@@ -207,7 +224,15 @@ class BpoSDPJApi { ...@@ -207,7 +224,15 @@ class BpoSDPJApi {
} }
} }
let doAuthRes = await this.tdevApi.doAuth({idName:this.trim(obj.id_name),idNo:this.trim(obj.id_no)},{ app_id:obj.app_id}); /**
* TODO:需要线上测试
*/
let doAuthRes =await this.doAuth({id_name:this.trim(obj.id_name),id_no:this.trim(obj.id_no), app_id:obj.app_id});
console.log("调用二要素 (兰伯望) 接口返回:"+JSON.stringify(doAuthRes));
if(true){
await this.doSign3(ccashinfo);
}
//异步推送信息 //异步推送信息
pushAsync(obj); pushAsync(obj);
...@@ -221,7 +246,7 @@ class BpoSDPJApi { ...@@ -221,7 +246,7 @@ class BpoSDPJApi {
console.log(e.stack); console.log(e.stack);
return result; return result;
} }
} }
/** /**
...@@ -278,7 +303,7 @@ class BpoSDPJApi { ...@@ -278,7 +303,7 @@ class BpoSDPJApi {
let key = `${cashInfo.mcthId}_${cashInfo.outTradeNo}`; let key = `${cashInfo.mcthId}_${cashInfo.outTradeNo}`;
let id = uuidv1(); let id = uuidv1();
await this.redisLock.lock(key, id, 20); await this.redisLock.lock(key, id, 20);
let result = await this.econtractSve.autoSignBankTwo(param); let result = await this.econtractSve.autoSignBankTwo(params);
await this.redisLock.unLock(key, id); await this.redisLock.unLock(key, id);
return result; return result;
} catch (e) { } catch (e) {
...@@ -384,6 +409,7 @@ class BpoSDPJApi { ...@@ -384,6 +409,7 @@ class BpoSDPJApi {
"msg": msg, "msg": msg,
"data": data "data": data
} }
return res;
} }
} }
module.exports = BpoSDPJApi; module.exports = BpoSDPJApi;
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