Commit c4ed4688 by 孙亚楠

d

parent 63e5bcfd
......@@ -184,8 +184,8 @@ class BpoSDPJApi {
return this.getCodeResult(0,{
id_name:_cCashInfo.id_name,
id_no:_cCashInfo.id_no,
app_id: _cCashInfo.app_id,
id:_cCashInfo.id
// app_id: _cCashInfo.app_id,
no:this.setNo(_cCashInfo.id)
})
}catch (e) {
console.log(e);
......@@ -203,17 +203,12 @@ class BpoSDPJApi {
* @returns {Promise<void>}
*/
async authentication(obj, req){
if(!obj || !obj.id_name || !obj.id_no || !obj.mchtId || !obj.app_id|| !obj.id){
if(!obj || !obj.id_name || !obj.id_no || !obj.no){
return this.getCodeResult(1002001,null);
}
try{
let ccashinfo = await this.dao.findOne({
where:{
id:obj.id,
mchtId:obj.mchId,
outTradeNo:obj.outTradeNo
}
let ccashinfo = await this.ccashinfoSve.getBean({
id: this.getNo(obj.no)
});
if(!ccashinfo){
this.getErrResult("信息不存在");
......@@ -239,7 +234,6 @@ class BpoSDPJApi {
}
}
}
/**
* TODO:需要线上测试
*/
......@@ -247,12 +241,12 @@ class BpoSDPJApi {
if (doAuthRes.status !== 0) {
return this.getBaseResult(1, doAuthRes.msg || "姓名或身份证错误");
}
ccashinfo.id_name = this.trim(obj.id_name);
ccashinfo.id_no = this.trim(obj.id_no);
await ccashinfo.save();
console.log("调用二要素 (兰伯望) 接口返回:"+JSON.stringify(doAuthRes));
this.doSign3(ccashinfo);
//异步推送信息
pushAsync(obj);
return this.getBaseResult( 0, msg = "认证成功", data = {no:this.setNo(ccashinfo.id),amt:system.f2y(ccashinfo.amt),mchtId:ccashinfo.mchtId});
}catch (e) {
console.log(e);
let result = {
......@@ -262,35 +256,33 @@ class BpoSDPJApi {
console.log(e.stack);
return result;
}
}
/**
* fn:异步同送信息
* @param params
*/
pushAsync(params){
/**
* fn:签约
*/
let res = this.tdevApi.doSign3(params);
/**
* fn:更新验证信息 人名 身份证号
*/
this.ccashinfoSve.update(params);
}
/**
* fn:打开红包
* @param obj
*/
openRedEnvelopes(obj){
async openRedEnvelopes(obj){
if(!obj.no){
return this.getBaseResult(1, 'ID不能为空');
}
try {
let ccashinfo = await this.ccashinfoSve.getBean({
id: this.getNo(obj.no)
});
if(!ccashinfo){
this.getErrResult("信息不存在");
}
return await this.cashOut(ccashinfo);
}catch (e) {
console.log(e);
let result = {
code: 500,
msg: "接口异常"
};
console.log(e.stack);
return 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