Commit 5f0f84d4 by 赵庆

gsb

parents 83396dbe 982c4865
......@@ -514,6 +514,12 @@ class EcontractApi {
var userMobile = obj.userMobile || "";
var nonceStr = obj.nonceStr || "";
let exists = await this.bankthreelogSve.findOne({
userName: userName,
userIdNo: userIdNo,
userBankNo: userBankNo,
userMobile: userMobile,
});
var sign = obj.sign || "";
var btl = await this.bankthreelogSve.create({
appId: appId,
......@@ -560,6 +566,15 @@ class EcontractApi {
mobile: userMobile,
};
if (exists) {
btl.result = true;
btl.save();
return {
code: 0,
msg: "success"
};
}
var tt = await this.utilesignbaoSve.bankfour(bankParams, "econtractapi.bankthree") || {};
// {"code":-110,"message":"手机号格式错误","data":{}}
//1成功,-110提示验证信息有误,-120亲,提供的信息不正确,请验证后再试!
......@@ -1249,6 +1264,7 @@ class EcontractApi {
var signList = [];
var unSignList = [];
var accountMap = {};
var accountMap2 = {};
// 4 查签约用户
if (templateIds.idsO.length > 0) {
var idsOCOunt = await this.usereaccountSve.getSignAccounts(templateIds.idsO, idNoList, idNameList);
......@@ -1259,32 +1275,29 @@ class EcontractApi {
if (templateIds.idsT.length > 0) {
var idsTCount = await this.usereaccountSve.getSignAccounts_dk(templateIds.idsT, idNoList, idNameList);
for (var idT of idsTCount) {
accountMap[idT.userName + "_" + idT.personsSign] = 1;
accountMap2[idT.userName + "_" + idT.personsSign] = 1;
}
}
// 5 比对用户是否签约
for (var u of userList) {
if (accountMap[u.idName + "_" + u.idNo]) {
if (accountMap[u.idName + "_" + u.idNo] || accountMap2[u.idName + "_" + u.idNo]) {
signList.push(u);
} else {
unSignList.push(u);
}
}
var hash = {};
signList = signList.reduce(function(item, next) {
hash[next.idNo] ? '' : hash[next.idNo] = true && item.push(next);
return item
}, []);
unSignList = unSignList.reduce(function(item, next) {
hash[next.idNo] ? '' : hash[next.idNo] = true && item.push(next);
return item
}, []);
// var hash = {};
// signList = signList.reduce(function(item, next) {
// hash[next.idNo] ? '' : hash[next.idNo] = true && item.push(next);
// return item
// }, []);
//
// unSignList = unSignList.reduce(function(item, next) {
// hash[next.idNo] ? '' : hash[next.idNo] = true && item.push(next);
// return item
// }, []);
return {
code: 0,
msg: "",
......
......@@ -20,6 +20,9 @@ class EcontractService extends ServiceBase {
this.emessageDao = system.getObject("db.emessageDao");
this.ecompanybusiDao = system.getObject("db.ecompanybusiDao");
this.userDao = system.getObject("db.userDao");
this.bankthreelogDao = system.getObject("db.bankthreelogDao");
this.esealSve = system.getObject("service.esealSve");
this.ejobapplySve = system.getObject("service.ejobapplySve");
......@@ -1289,20 +1292,29 @@ class EcontractService extends ServiceBase {
// e签宝流程
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, "银行三要素验证失败");
let banklog = await this.bankthreelogDao.findOne({
userName: eaccount.userName,
userIdNo: eaccount.personsSign,
userBankNo: eaccount.bankno,
result: 1,
});
if (!banklog) {
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);
......
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