Commit f4b9d914 by zhaoxiqing

gsb

parent e7ed0bd2
......@@ -10,6 +10,7 @@ class AuthService extends ServiceBase {
this.enginesignSve = system.getObject("service.engine.enginesignSve");
this.tradelogDao = system.getObject("db.common.tradelogDao");
}
async createAccount(params) {
try {
params.apiName = "sign@";
......@@ -39,6 +40,7 @@ class AuthService extends ServiceBase {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async createTemplate(params) {
try {
params.apiName = "sign@";
......@@ -49,6 +51,38 @@ class AuthService extends ServiceBase {
}
}
async createEntSeal(params) {
try {
params.apiName = "sign@";
params.isFee = false;
// 验证参数
let accountId = this.trim(params.accountId);
let sealAlias = this.trim(params.sealAlias);
if (!accountId) {
return system.getResultFail(1000000, "账户ID不能为空");
}
if (!sealAlias) {
return system.getResultFail(1000000, "印章名称不能为空");
}
return this.operatorSign(params, async (p) => {
// 调用创建账户API
let validRes = await this.enginesignSve.organize({
accountId: accountId,
channel: p.orderProduct.channel,
color: 1,
sealAlias: sealAlias,
templateType: 1,
text: sealAlias,
});
return validRes;
});
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async handSign(params) {
try {
params.apiName = "sign@hand";
......@@ -59,10 +93,74 @@ class AuthService extends ServiceBase {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async autosign(params) {
/**
*
* {
"action_process": "test",
"action_type": "autoSign",
"action_body": {
"appId":"12167897412000190",
"nonceStr":"12312312312312",
"sign":"EE63140753238BB2E4D79ABCDFB07732",
"accountId": "c4a5a57bad9b4d4ab5dbbe2362d86f77",
"channel": 1,
"contractName": "测试",
"entSealId": 63,
"noticeUrl": "",
"perSealId": "",
"redirectUrl": "",
"sealType": null,
"signPlatform": null,
"simpleFormFields": {
"nameA":"甲方",
"nameB":"个人",
"unit":"测试测试测试",
"signDateA":"2020-07-04",
"signDateB":"2020-07-04"
},
"templateId": "10512"
}
}
*/
async autoSign(params) {
params.apiName = "sign@auto";
params.isFee = true;
// 验证参数
let accountId = this.trim(params.accountId);
let entSealId = this.trim(params.entSealId);
let contractName = this.trim(params.contractName);
let templateId = this.trim(params.templateId);
let simpleFormFields = params.simpleFormFields;
if (!accountId) {
return system.getResultFail(1000000, "账户ID不能为空");
}
if (!entSealId) {
return system.getResultFail(1000000, "印章ID不能为空");
}
if (!contractName) {
return system.getResultFail(1000000, "合同名称不能为空");
}
if (!templateId) {
return system.getResultFail(1000000, "模板ID不能为空");
}
if (!simpleFormFields) {
return system.getResultFail(1000000, "文本域不能为空");
}
return this.operatorSign(params, async (p) => {
// 调用创建账户API
let validRes = await this.enginesignSve.autoSign({
accountId: accountId,
entSealId: entSealId,
contractName: contractName,
templateId: templateId,
simpleFormFields: simpleFormFields,
channel: p.orderProduct.channel,
});
return system.getResultSuccess(validRes.contract);
});
try {
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
......
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