Commit cd24818e by 孙亚楠

d

parent a058ec31
......@@ -31,6 +31,7 @@ class BpoSDPJApi {
this.esettleSve = system.getObject("service.esettleSve");
this.tdevApi = require("./tdevApi");
this.redisLock = system.getObject("util.redisLock");
this.bankthreelogSve = system.getObject("service.bankthreelogSve");
this.resultMap = {
0:"操作成功",
1:"操作失败",
......@@ -125,6 +126,11 @@ class BpoSDPJApi {
let custormUrl = `http://bpohhr.gongsibao.com?no=${_no}&outTradeNo=${_cCashInfo.outTradeNo}&mchtId=${_cCashInfo.mchtId}`;
//6.生成二维码
let url =await this.qrClient.generateQR(custormUrl);
_cCashInfo.qrcode=url;
_cCashInfo.qrcode_status=1;
_cCashInfo.save();
return this.getCodeResult(0,{"qrcode": url || ""});
} catch (e) {
let result = {
......@@ -185,6 +191,17 @@ class BpoSDPJApi {
return this.getCodeResult(1002001,null);
}
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)) {
return this.returnjson(-1, "身份证格式不正确");
}
......@@ -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);
......@@ -278,7 +303,7 @@ class BpoSDPJApi {
let key = `${cashInfo.mcthId}_${cashInfo.outTradeNo}`;
let id = uuidv1();
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);
return result;
} catch (e) {
......@@ -384,6 +409,7 @@ class BpoSDPJApi {
"msg": msg,
"data": data
}
return res;
}
}
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