Commit 519cadb6 by 王昆

gsb

parent d3519b27
......@@ -10,6 +10,9 @@ class YZContractApi {
this.econtractSve = system.getObject("service.econtractSve");
this.esettleSve = system.getObject("service.esettleSve");
this.etemplatebusiSve = system.getObject("service.etemplatebusiSve");
this.appId = "1201869719607517185";
this.key = "bee7870e008ab144bf518b70ef91f8ac";
}
......@@ -43,25 +46,25 @@ class YZContractApi {
}
if (!param.idNo) {
return this.returnjson(-1, "请提供代理人身份证号")
} else {
if (!await this.idcardClient.checkIDCard(param.idNo)) {
return this.returnjson(-1, "代理人身份证格式不正确");
}
let card = await this.idcardClient.cardInfo(param.idNo);
let age = card.age || 0;
if (!age) {
return this.returnjson(-1, "代理人身份证号格式错误, 只支持18位身份证号码");
}
if (!await this.idcardClient.checkIDCard(param.idNo)) {
return this.returnjson(-1, "代理人身份证格式不正确");
}
let card = await this.idcardClient.cardInfo(param.idNo);
let age = card.age || 0;
if (!age) {
return this.returnjson(-1, "代理人身份证号格式错误, 只支持18位身份证号码");
}
if (card.sex == 'male') {
if (age < 18 || age > 60) {
return this.returnjson(-1, "签约失败,男性代理人限制18-60岁之间")
}
if (card.sex == 'male') {
if (age < 18 || age > 60) {
return this.returnjson(-1, "签约失败,男性代理人限制18-60岁之间")
}
} else {
if (age < 18 || age > 55) {
return this.returnjson(-1, "签约失败,女性代理人限制18-55岁之间")
}
} else {
if (age < 18 || age > 55) {
return this.returnjson(-1, "签约失败,女性代理人限制18-55岁之间")
}
}
if (!param.nonceStr) {
return this.returnjson(-1, "请提供随机码")
}
......@@ -118,16 +121,17 @@ class YZContractApi {
}
if (!param.idNo) {
return this.returnjson(-1, "请提供该用户身份证号")
} else {
if (!await this.idcardClient.checkIDCard(param.idNo)) {
return this.returnjson(-1, "身份证格式不正确");
}
}
let busiIds = await this.etemplatebusiSve.busiIdsByTemplateId(param.ecid);
let num = await this.esettleSve.isValidAge(busiIds);
if(num) {
let card = await this.idcardClient.cardInfo(param.idNo);
let age = card.age || 0;
if (!age) {
if(!age) {
return this.returnjson(-1, "身份证号格式错误, 只支持18位身份证号码");
}
if (card.sex == 'male') {
if(card.sex == 'male') {
if (age < 18 || age > 60) {
return this.returnjson(-1, "签约失败,男限制18-60岁之间")
}
......@@ -137,6 +141,7 @@ class YZContractApi {
}
}
}
if (!param.nonceStr) {
return this.returnjson(-1, "请提供随机码");
}
......
......@@ -602,11 +602,11 @@ class EntcontractService extends ServiceBase {
agentA: params.idName,//甲方联系人
agentMobileA: params.mobile,//甲方 联系电话
nameB: eaccount.userName, //乙方 必填
nameB: entcompany.name, //乙方 必填
addressB: entcompany.addr, //乙方 地址
representB: entcompany.legal,//乙方 法定代表人
agentB: entcompany.contactName,//乙方 联系人
agentMobileB: eaccount.mobile,//乙方 联系电话
agentMobileB: entcompany.contactMobile,//乙方 联系电话
bankNameB: entcompany.bankAccount,//账户名称
bank: entcompany.bankName,//开户行
......
......@@ -9,6 +9,7 @@
"author": "jy",
"license": "ISC",
"dependencies": {
"MD5": "^1.3.0",
"after": "^0.8.2",
"ali-oss": "^4.12.2",
"axios": "^0.19.2",
......
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