Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
f4b9d914
Commit
f4b9d914
authored
Jul 04, 2020
by
zhaoxiqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
e7ed0bd2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
99 additions
and
1 deletions
+99
-1
esign-api/app/base/service/impl/sign/signSve.js
+99
-1
No files found.
esign-api/app/base/service/impl/sign/signSve.js
View file @
f4b9d914
...
...
@@ -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
}
`
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment