Commit bb4ce51c by 王昆

gsb

parent 94330b16
...@@ -142,27 +142,34 @@ class EcontractService extends ServiceBase { ...@@ -142,27 +142,34 @@ class EcontractService extends ServiceBase {
account.user_id = 0; account.user_id = 0;
account = await this.usereaccountDao.create(account); account = await this.usereaccountDao.create(account);
} }
// isNeedCreate = false;
if (isNeedCreate) { let banklog = await this.bankthreelogDao.findOne({
// 1.三要素验证,验证失败的话 continue, 记录当前用户失败原因 userName: account.userName,
userIdNo: account.personsSign,
userBankNo: account.bankno,
result: 1,
});
if (!banklog) {
var bankthreeParams = { var bankthreeParams = {
name: userName, name: account.userName,
idno: personsSign, idno: account.personsSign,
cardno: bankno cardno: account.bankno
}; };
var threeResult = await this.utilesignbaoSve.bankthree(bankthreeParams, "bankinfoAuth"); var threeResult = await this.utilesignbaoSve.bankthree(bankthreeParams, "bankinfoAuth");
// {"code":-110,"message":"手机号格式错误","data":{}} // {"code":-110,"message":"手机号格式错误","data":{}}
//1成功,-110提示验证信息有误,-120亲,提供的信息不正确,请验证后再试! //1成功,-110提示验证信息有误,-120亲,提供的信息不正确,请验证后再试!
console.log("threeResult-----------------------------", threeResult); console.log("threeResult-----------------------------", threeResult);
if (!threeResult || threeResult.code == -120) { if (!threeResult || threeResult.code == -120) {
errorItems.push(userName + "-银行三要素(姓名、身份证、银行卡号)验证失败"); return this.returnjson(-1, "银行三要素(姓名、身份证、银行卡号)验证失败");
continue;
} }
if (threeResult.code == -110) { if (threeResult.code == -110) {
errorItems.push(userName + "-" + threeResult.message || "银行三要素验证失败"); return this.returnjson(-1, "银行三要素验证失败");
continue; }
} }
// isNeedCreate = false;
if (isNeedCreate) {
var uidStr = await this.getUidStr(8, 36); var uidStr = await this.getUidStr(8, 36);
var thirdId = etemplate.id + "_" + account.id + uidStr; var thirdId = etemplate.id + "_" + account.id + uidStr;
...@@ -1323,21 +1330,6 @@ class EcontractService extends ServiceBase { ...@@ -1323,21 +1330,6 @@ class EcontractService extends ServiceBase {
eaccount = await this.usereaccountDao.create(eaccount); eaccount = await this.usereaccountDao.create(eaccount);
} }
// c_econtract
var econtract = await this.dao.findOne({
eflowstatus: '2',
usereaccount_id: eaccount.id,
etemplate_id: ecid,
});
if (econtract) {
return this.returnjson(0, "用户已经签约", {
contractId: econtract.id
});
}
// e签宝流程
if (isNeedCreate) {
let banklog = await this.bankthreelogDao.findOne({ let banklog = await this.bankthreelogDao.findOne({
userName: eaccount.userName, userName: eaccount.userName,
userIdNo: eaccount.personsSign, userIdNo: eaccount.personsSign,
...@@ -1363,6 +1355,21 @@ class EcontractService extends ServiceBase { ...@@ -1363,6 +1355,21 @@ class EcontractService extends ServiceBase {
} }
} }
// c_econtract
var econtract = await this.dao.findOne({
eflowstatus: '2',
usereaccount_id: eaccount.id,
etemplate_id: ecid,
});
if (econtract) {
return this.returnjson(0, "用户已经签约", {
contractId: econtract.id
});
}
// e签宝流程
if (isNeedCreate) {
var uidStr = await this.getUidStr(8, 36); var uidStr = await this.getUidStr(8, 36);
var thirdId = etemplate.id + "_" + eaccount.id + uidStr; var thirdId = etemplate.id + "_" + eaccount.id + uidStr;
...@@ -1526,31 +1533,9 @@ class EcontractService extends ServiceBase { ...@@ -1526,31 +1533,9 @@ class EcontractService extends ServiceBase {
} }
var econtract; var econtract;
// c_econtract
// econtract = await this.dao.findOne({
// eflowstatus: '2',
// usereaccount_id: eaccount.id,
// etemplate_id: ecid,
// });
// e签宝流程 // e签宝流程
if (isNeedCreate) { if (isNeedCreate) {
// var bankthreeParams = {
// name: eaccount.userName,
// idno: eaccount.personsSign,
// cardno: eaccount.bankno
// };
// var threeResult = await this.utilesignbaoSve.bankthree(bankthreeParams, "bankinfoAuth");
// // {"code":-110,"message":"手机号格式错误","data":{}}
// //1成功,-110提示验证信息有误,-120亲,提供的信息不正确,请验证后再试!
// console.log("threeResult-----------------------------", threeResult);
// if (!threeResult || threeResult.code == -120) {
// return this.returnjson(-1, "银行三要素(姓名、身份证、银行卡号)验证失败");
// }
// if (threeResult.code == -110) {
// return this.returnjson(-1, "银行三要素验证失败");
// }
var uidStr = await this.getUidStr(8, 36); var uidStr = await this.getUidStr(8, 36);
var thirdId = etemplate.id + "_" + eaccount.id + uidStr; var thirdId = etemplate.id + "_" + eaccount.id + uidStr;
...@@ -1886,22 +1871,6 @@ class EcontractService extends ServiceBase { ...@@ -1886,22 +1871,6 @@ class EcontractService extends ServiceBase {
} else { } else {
eaccount = await this.usereaccountDao.create(eaccount); eaccount = await this.usereaccountDao.create(eaccount);
} }
// c_econtract
var econtract = await this.dao.findOne({
eflowstatus: '2',
usereaccount_id: eaccount.id,
etemplate_id: ecid,
});
if (econtract) {
return this.returnjson(0, "用户已经签约", {
contractId: econtract.id
});
}
// e签宝流程
if (isNeedCreate) {
let log = await this.bankthreelogDao.findOne({ let log = await this.bankthreelogDao.findOne({
userName: eaccount.userName, userName: eaccount.userName,
userIdNo: eaccount.personsSign, userIdNo: eaccount.personsSign,
...@@ -1933,6 +1902,23 @@ class EcontractService extends ServiceBase { ...@@ -1933,6 +1902,23 @@ class EcontractService extends ServiceBase {
log.save(); log.save();
} }
// c_econtract
var econtract = await this.dao.findOne({
eflowstatus: '2',
usereaccount_id: eaccount.id,
etemplate_id: ecid,
});
if (econtract) {
return this.returnjson(0, "用户已经签约", {
contractId: econtract.id
});
}
// e签宝流程
if (isNeedCreate) {
var uidStr = await this.getUidStr(8, 36); var uidStr = await this.getUidStr(8, 36);
var thirdId = etemplate.id + "_" + eaccount.id + uidStr; var thirdId = etemplate.id + "_" + eaccount.id + uidStr;
......
...@@ -26,6 +26,8 @@ class EntcontractService extends ServiceBase { ...@@ -26,6 +26,8 @@ class EntcontractService extends ServiceBase {
this.etemplatebusiDao = system.getObject("db.etemplatebusiDao"); this.etemplatebusiDao = system.getObject("db.etemplatebusiDao");
this.bankthreelogDao = system.getObject("db.bankthreelogDao");
this.URL = "http://39.106.185.66:8000/merchant/busi/reg"; this.URL = "http://39.106.185.66:8000/merchant/busi/reg";
this.YZKEY = "4a112ce87c38464d8d454caf23b7b31f"; this.YZKEY = "4a112ce87c38464d8d454caf23b7b31f";
...@@ -95,14 +97,22 @@ class EntcontractService extends ServiceBase { ...@@ -95,14 +97,22 @@ class EntcontractService extends ServiceBase {
return this.returnjson(0, "用户已经签约,请不要重复签约"); return this.returnjson(0, "用户已经签约,请不要重复签约");
} }
// e签宝流程 let banklog = await this.bankthreelogDao.findOne({
if (isNeedCreate) { userName: eaccount.userName,
userIdNo: eaccount.personsSign,
userBankNo: eaccount.bankno,
result: 1,
});
if (!banklog) {
var bankthreeParams = { var bankthreeParams = {
name: eaccount.userName, name: eaccount.userName,
idno: eaccount.personsSign, idno: eaccount.personsSign,
cardno: eaccount.bankno cardno: eaccount.bankno
}; };
var threeResult = await this.utilesignbaoSve.bankthree(bankthreeParams, "bankinfoAuth"); var threeResult = await this.utilesignbaoSve.bankthree(bankthreeParams, "bankinfoAuth");
// {"code":-110,"message":"手机号格式错误","data":{}}
//1成功,-110提示验证信息有误,-120亲,提供的信息不正确,请验证后再试!
console.log("threeResult-----------------------------", threeResult); console.log("threeResult-----------------------------", threeResult);
if (!threeResult || threeResult.code == -120) { if (!threeResult || threeResult.code == -120) {
return this.returnjson(-1, "银行三要素(姓名、身份证、银行卡号)验证失败"); return this.returnjson(-1, "银行三要素(姓名、身份证、银行卡号)验证失败");
...@@ -110,7 +120,10 @@ class EntcontractService extends ServiceBase { ...@@ -110,7 +120,10 @@ class EntcontractService extends ServiceBase {
if (threeResult.code == -110) { if (threeResult.code == -110) {
return this.returnjson(-1, "银行三要素验证失败"); return this.returnjson(-1, "银行三要素验证失败");
} }
}
// e签宝流程
if (isNeedCreate) {
var uidStr = await this.getUidStr(8, 36); var uidStr = await this.getUidStr(8, 36);
var thirdId = enttemplate.id + "_" + eaccount.id + uidStr; var thirdId = enttemplate.id + "_" + eaccount.id + uidStr;
......
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