Commit 8b72319a by 王昆

gsb

parent 7551fd23
......@@ -1293,9 +1293,46 @@ class EcontractService extends ServiceBase {
* @param {ecid, appId, userId, idName, mobile, idNo, bankno, nonceStr, sign} params
*/
async autoSign(params) {
var ecid = params.ecid;
let ecid = params.ecid;
// 验证身份证是否签约过
let todays = moment().format("YYYY-MM-DD") + " 00:00:00";
let contractId = await this.dao.findSignedContractId({idno: params.personsSign, ecid: ecid, today : todays}) || 0;
if (contractId) {
return this.returnjson(0, "用户已经签约", {
contractId: contractId
});
}
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 unionId = params.appId + "_" + params.userId + params.userCode + params.branchCode;
// ecid etemplate
var etemplate = await this.etemplateSve.findById(ecid);
......@@ -1339,51 +1376,6 @@ class EcontractService extends ServiceBase {
eaccount = await this.usereaccountDao.create(eaccount);
}
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, "银行三要素验证失败");
}
}
// c_econtract
// var econtract = await this.dao.findOne({
// eflowstatus: '2',
// usereaccount_id: eaccount.id,
// etemplate_id: ecid,
// });
let todays = moment().format("YYYY-MM-DD") + " 00:00:00";
let contractId = await this.dao.findSignedContractId({idno: eaccount.personsSign, ecid: ecid, today : todays}) || 0;
if (contractId) {
return this.returnjson(0, "用户已经签约", {
contractId: contractId
});
}
// let begin = moment().subtract(30, "days").format("YYYY-MM-DD HH:mm:ss");
// if (times > 5) {
// let timesMsg = `该用户[${eaccount.personsSign}]签约次数过多,30天内已经签约${times}次`;
// console.log(timesMsg);
// return this.returnjson(-1, timesMsg);
// }
// e签宝流程
if (isNeedCreate) {
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