Commit 5f0f84d4 by 赵庆

gsb

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