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
cbe24048
Commit
cbe24048
authored
May 07, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
2255a40d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
268 additions
and
4 deletions
+268
-4
bpo-admin/app/base/controller/impl/entcontractCtl.js
+24
-0
bpo-admin/app/base/db/metadata/apps/platform.js
+9
-0
bpo-admin/app/base/db/metadata/bizs/wx76a324c5d201d1a4/entcontractall2.js
+26
-0
bpo-admin/app/base/service/impl/entcontractSve.js
+61
-3
bpo-admin/app/base/service/impl/utilesignbaoSve.js
+147
-0
bpo-admin/app/config/localsettings.js
+1
-1
bpo-admin/app/front/vues/pages/entcontractall2/entcontractall2.html
+0
-0
bpo-admin/app/front/vues/pages/entcontractall2/entcontractall2.js
+0
-0
No files found.
bpo-admin/app/base/controller/impl/entcontractCtl.js
View file @
cbe24048
...
...
@@ -63,6 +63,24 @@ class EntcontractCtl extends CtlBase {
}
}
async
allList2
(
queryobj
,
obj
,
req
)
{
var
params
=
obj
.
search
||
{};
var
ecompanyId
=
params
.
ecompany_id
;
if
(
ecompanyId
)
{
params
.
ecompanyIds
=
[
ecompanyId
];
delete
params
.
ecompany_id
;
}
params
.
eflowstatusList
=
[
'1'
];
this
.
doTimeCondition
(
params
,
[
"signBegin"
,
"signEnd"
]);
try
{
var
page
=
await
this
.
service
.
listByCondition
(
params
);
return
system
.
getResult2
(
page
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getErrResult2
(
"您的网络不稳, 请稍后重试"
);
}
}
async
allExport
(
queryobj
,
req
,
res
)
{
var
params
=
JSON
.
parse
(
queryobj
.
search
);
params
.
currentPage
=
1
;
...
...
@@ -499,6 +517,11 @@ class EntcontractCtl extends CtlBase {
}
}
async
yzReSign
(
q
,
obj
,
req
)
{
let
res
=
await
this
.
service
.
yzMerchantReSign
(
obj
);
return
res
;
}
}
module
.
exports
=
EntcontractCtl
;
\ No newline at end of file
bpo-admin/app/base/db/metadata/apps/platform.js
View file @
cbe24048
...
...
@@ -944,6 +944,14 @@ module.exports = {
"bizConfig"
:
null
,
"path"
:
""
},
{
"code"
:
"zc_entcontractall2"
,
"label"
:
"手动签约"
,
"isMenu"
:
true
,
"bizCode"
:
"entcontractall2"
,
"bizConfig"
:
null
,
"path"
:
""
},
],
},
...
...
@@ -1620,6 +1628,7 @@ module.exports = {
"entcompanyadmin"
:
{
"title"
:
"企业管理"
,
"config"
:
null
,
"path"
:
"/entcompanyadmin"
,
"comname"
:
"entcompanyadmin"
},
"enttemplateadmin"
:
{
"title"
:
"模板管理"
,
"config"
:
null
,
"path"
:
"/enttemplateadmin"
,
"comname"
:
"enttemplateadmin"
},
"entcontractall"
:
{
"title"
:
"签约管理"
,
"config"
:
null
,
"path"
:
"/entcontractall"
,
"comname"
:
"entcontractall"
},
"entcontractall2"
:
{
"title"
:
"签约管理"
,
"config"
:
null
,
"path"
:
"/entcontractall2"
,
"comname"
:
"entcontractall2"
},
// 企业电子签-个人
"entcompanymy"
:
{
"title"
:
"企业管理"
,
"config"
:
null
,
"path"
:
"/entcompanymy"
,
"comname"
:
"entcompanymy"
},
...
...
bpo-admin/app/base/db/metadata/bizs/wx76a324c5d201d1a4/entcontractall2.js
0 → 100644
View file @
cbe24048
module
.
exports
=
{
"bizName"
:
"entcontractall2"
,
"list"
:{
columnMetaData
:[
]
},
"form"
:[
],
"search"
:[
],
"auth"
:{
"add"
:[
],
"edit"
:[
],
"delete"
:[
// {"icon":"el-icon-remove","title":"删除","type":"default","key":"delete","isInRow":true},
],
"common"
:[
],
}
}
bpo-admin/app/base/service/impl/entcontractSve.js
View file @
cbe24048
...
...
@@ -327,9 +327,7 @@ class EntcontractService extends ServiceBase {
[
"id"
,
'desc'
]
];
var
attributes
=
[
`id`
,
`name`
,
`fileurl`
,
`eflowstatus`
,
`eflowstatusname`
,
`completed_at`
,
`end_at`
,
`user_id`
,
`usereaccount_id`
,
`entcompany_id`
,
`enttemplate_id`
];
var
page
=
await
this
.
getPageList
(
currentPage
,
pageSize
,
where
,
orderby
,
attributes
);
var
page
=
await
this
.
getPageList
(
currentPage
,
pageSize
,
where
,
orderby
);
if
(
page
&&
page
.
rows
)
{
for
(
var
row
of
page
.
rows
)
{
this
.
handleDate
(
row
,
[
"completed_at"
,
"end_at"
],
null
);
...
...
@@ -932,6 +930,66 @@ class EntcontractService extends ServiceBase {
this
.
ejobapplySve
.
addMessage
(
id
,
"零工签约"
,
"成功签约"
);
}
async
yzMerchantReSign
(
params
)
{
let
id
=
params
.
id
;
let
econtract
=
this
.
dao
.
findById
(
id
);
if
(
!
econtract
)
{
return
this
.
returnjson
(
-
1
,
"协议不存在"
);
}
if
(
econtract
.
eflowstatus
==
'2'
)
{
return
this
.
returnjson
(
-
1
,
"商户已经签约成功"
);
}
// enttemplate 模板查询
let
enttemplate
=
await
this
.
enttemplateSve
.
findById
(
econtract
.
enttemplate_id
);
// entcompany
let
entcompany
=
await
this
.
entcompanyDao
.
findById
(
econtract
.
entcompany_id
);
// p_user
let
user
=
await
this
.
userDao
.
findById
(
econtract
.
user_id
);
let
eaccount
=
await
this
.
usereaccountDao
.
findById
(
econtract
.
usereaccount_id
);
var
sealId
=
entcompany
.
sealId
;
let
today
=
new
Date
().
Format
(
"yyyy"
)
+
"年"
+
new
Date
().
Format
(
"MM"
)
+
"月"
+
new
Date
().
Format
(
"dd"
)
+
"日"
;
var
signParams
=
{
templateId
:
enttemplate
.
templateid
,
//模板id,由创建模板接口调用返回的templateId 必填
name
:
enttemplate
.
name
,
//合同模板名称 必填
simpleFormFields
:
{
nameA
:
params
.
merchantName
,
//甲方 必填
addressA
:
params
.
merchantAddr
,
//甲方地址
representA
:
params
.
merchantLegal
,
//甲方法定代表人
agentA
:
params
.
idName
,
//甲方联系人
agentMobileA
:
params
.
mobile
,
//甲方 联系电话
nameB
:
entcompany
.
name
,
//乙方 必填
addressB
:
entcompany
.
addr
,
//乙方 地址
representB
:
entcompany
.
legal
,
//乙方 法定代表人
agentB
:
entcompany
.
contactName
,
//乙方 联系人
agentMobileB
:
entcompany
.
contactMobile
,
//乙方 联系电话
// bankNameB: entcompany.bankAccount,//账户名称
// bank: entcompany.bankName,//开户行
// bankNumB: entcompany.bankNo,//账号
signDate
:
today
,
//签约时间
signDateA
:
today
,
//甲方签约日期 必填
signDateB
:
today
//乙方签约日期 必填
}
};
var
ebaoAccountId
=
eaccount
.
eaccountid
;
//签署人账户id-- 必填
var
thirdOrderNo
=
"ent_"
+
entcontract
.
id
;
//第三方流水号,通知回调使用---选填
var
eBaoRedirectBossUrl
=
""
;
var
tt
=
await
this
.
utilesignbaoSve
.
userSignContractNoTemplaterEversalSeal
(
signParams
,
ebaoAccountId
,
thirdOrderNo
,
eBaoRedirectBossUrl
,
"econtractSve"
,
sealId
);
console
.
log
(
tt
,
"-============= result ==========================="
);
if
(
tt
&&
tt
.
code
==
1
)
{
econtract
.
eflowid
=
tt
.
data
.
flowId
;
econtract
.
edocid
=
tt
.
data
.
docId
;
econtract
.
esignUrl
=
tt
.
data
.
signUrl
;
await
econtract
.
save
();
return
system
.
getResult2
(
tt
.
data
,
null
);
}
return
this
.
returnjson
(
-
1
,
tt
.
message
||
"签约失败"
,
tt
.
code
);
}
async
syncContract
(
id
)
{
var
contract
=
null
;
var
account
=
null
;
...
...
bpo-admin/app/base/service/impl/utilesignbaoSve.js
View file @
cbe24048
...
...
@@ -5,6 +5,7 @@ const logCtl = System.getObject("web.oplogCtl");
const
crypto
=
require
(
'crypto'
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
fs
=
require
(
"fs"
);
const
axios
=
require
(
"axios"
);
//工商查询操作
class
UtilESignBaoService
{
constructor
()
{
...
...
@@ -731,6 +732,103 @@ class UtilESignBaoService {
return
result
;
}
/*
seal 位置反转
*/
async
userSignContractNoTemplaterEversalSeal
(
params
,
ebaoAccountId
,
thirdOrderNo
,
eSignBaoRedirectBossUrl
,
opName
,
sealId
)
{
//用户签署合同-------调用此方法
//日志记录
logCtl
.
info
({
optitle
:
"e签宝===>创建用户签署合同信息info"
,
op
:
"app/base/service/impl/utilesignbaoSve/userSignContractNoTemplate"
,
content
:
"参数:ebaoAccountId="
+
ebaoAccountId
+
",thirdOrderNo="
+
thirdOrderNo
+
",eSignBaoRedirectBossUrl="
+
eSignBaoRedirectBossUrl
+
",请求params参数:"
+
JSON
.
stringify
(
params
),
clientIp
:
""
});
/*
1.合同模板创建合同 5.4.2
2.创建合同签署流程 5.5.1
3.发起对接平台自动签署 5.5.2
4.发起个人手动签署 5.5.4
*/
var
result
=
{
code
:
1
,
message
:
"success"
,
data
:
{}
};
if
(
ebaoAccountId
==
null
||
ebaoAccountId
==
""
||
ebaoAccountId
==
"undefined"
)
{
result
.
code
=
-
100
;
result
.
message
=
"ebaoAccountId参数有误"
;
return
result
;
}
var
tThirdOrderNo
=
thirdOrderNo
==
null
||
thirdOrderNo
==
""
||
thirdOrderNo
==
"undefined"
?
""
:
thirdOrderNo
var
self
=
this
;
//1.合同模板创建合同 5.4.2
var
createTemplate
=
await
self
.
createByTemplate
(
params
,
opName
,
result
);
if
(
createTemplate
.
code
!=
1
)
{
return
result
;
}
var
tDocId
=
createTemplate
.
data
.
docId
;
var
addProcessParams
=
{
businessScene
:
params
.
name
,
//业务场景名称-- 必填
initiatorAccountId
:
""
,
//发起方账户id,默认对接平台,--使用默认的,不用填写
signValidity
:
""
,
//签署截止时间戳毫秒值-- 选填
payer
:
""
,
//签署付费方,默认对接平台-- 选填
signPlatform
:
"1"
,
//指定用户签署的平台,空值表示不限平台(1:H5签2:支付宝生活号签3:微信小程序签(后续版本支持))-- 选填
noticeType
:
""
,
//用户接收签署任务通知的方式,空值不通知,1短信,2邮箱,格式"1,2"
redirectUrl
:
eSignBaoRedirectBossUrl
,
//页面签署完成后跳转地址
docId
:
tDocId
,
//合同id
docName
:
""
//合同名称,默认使用创建合同时的名称-- 选填
};
//2.创建合同签署流程 5.5.1
var
createAddProcess
=
await
self
.
addProcess
(
addProcessParams
,
opName
,
result
);
if
(
createAddProcess
.
code
!=
1
)
{
return
result
;
}
var
tFlowId
=
createAddProcess
.
data
.
flowId
;
var
platformSignTaskParams
=
{
flowId
:
tFlowId
,
//流程id-- 必填
thirdOrderNo
:
tThirdOrderNo
,
//第三方流水号,通知回调使用
posList
:
[{
signType
:
1
,
//盖章位置定位方式,1关键字定位-- 必填
key
:
"sealB"
//-- 必填
}]
};
if
(
sealId
)
{
//印章id,不传时使用账户默认印章
platformSignTaskParams
.
sealId
=
sealId
;
}
//3.发起对接平台自动签署 5.5.2
var
platformSignTaskResult
=
await
self
.
platformSignTask
(
platformSignTaskParams
,
opName
,
result
);
if
(
platformSignTaskResult
.
code
!=
1
)
{
return
result
;
}
var
handPersonSignTaskParams
=
{
flowId
:
tFlowId
,
//流程id-- 必填
accountId
:
ebaoAccountId
,
//签署人账户id-- 必填
thirdOrderNo
:
tThirdOrderNo
,
//第三方流水号,通知回调使用
sealType
:
"0"
,
//印章类型, 指定签署印章类型,0:手绘印章;1:模板印章-- 必填 ?????????????????????????????
posList
:
[{
signType
:
1
,
//盖章位置定位方式,1关键字定位-- 必填
key
:
"sealA"
//-- 必填
}]
};
//4.发起个人手动签署 5.5.4
var
handPersonSignTaskResult
=
await
self
.
handPersonSignTask
(
handPersonSignTaskParams
,
opName
,
result
);
if
(
handPersonSignTaskResult
.
code
!=
1
)
{
return
result
;
}
result
.
data
=
{
flowId
:
tFlowId
,
//流程id
docId
:
tDocId
,
//合同id
signUrl
:
handPersonSignTaskResult
.
data
.
signUrl
,
//签署地址,用户可通过本地址跳转至 e 签宝签署页面进行签署,链接永久有效
signShortUrl
:
handPersonSignTaskResult
.
data
.
signShortUrl
,
//接口调用时传入的对接方业务流水号,用于支持对接方进行上下文关联
templateId
:
params
.
templateId
//模板id,由创建模板接口调用返回的templateId
};
return
result
;
}
/*参数说明:
var params = {
templateId: "2c98d5446734acf5016827d168a6013b", //模板id,由创建模板接口调用返回的templateId 必填
...
...
@@ -997,10 +1095,59 @@ class UtilESignBaoService {
return
result
;
}
//-------------------------------------------------------------------------签署成功后归档-----结束--------------
// async returnResult(params, reqUrl, opClassName, opMethod, result) {
// var data = JSON.stringify(params);
// var rtn = null;
// try {
// rtn = await this.restClient.execPostESignBao(data, reqUrl);
// console.log(rtn, "rtn---------------------------------e签宝--------execPostESignBao---------------->>>>>>>>>>>>>>>>");
// if (rtn.stdout == null || rtn.stdout == "" || rtn.stdout == "undefined") {
// result.errCode = -100;
// result.code = -100;
// result.message = "请求结果返回为空";
// return result;
// }
// return JSON.parse(rtn.stdout);
// } catch (e) {
// console.log(e.stack);
// //日志记录
// logCtl.error({
// optitle: "e签宝opClassName=" + opClassName + ",opMethod=" + opMethod + "操作异常异常error",
// op: "base/service/impl/utilesignbaoSve/returnResult,请求url:" + reqUrl,
// content: "请求参数:" + data + ",返回结果参数rtn.stdout:" + rtn.stdout + ",异常信息error:" + e.stack,
// clientIp: ""
// });
// result.errCode = -200;
// result.code = -200;
// result.message = "操作异常"
// return result;
// }
// }
async
returnResult
(
params
,
reqUrl
,
opClassName
,
opMethod
,
result
)
{
var
data
=
JSON
.
stringify
(
params
);
var
rtn
=
null
;
try
{
if
(
settings
.
env
==
'dev'
)
{
let
rs
=
await
axios
({
method
:
'post'
,
url
:
reqUrl
,
data
:
params
,
headers
:
{
'X-Tsign-Open-App-Id'
:
'5111588557'
,
'X-Tsign-Open-App-Secret'
:
'1595787e8d5b7d19f7b6798f16f41fc2'
},
});
console
.
log
(
rs
);
if
(
rs
.
data
.
errCode
!=
0
)
{
result
.
code
=
-
110
;
result
.
message
=
"接口请求错误"
;
return
result
;
}
result
.
errCode
=
0
;
result
.
data
=
rs
.
data
.
data
;
return
result
;
}
rtn
=
await
this
.
restClient
.
execPostESignBao
(
data
,
reqUrl
);
console
.
log
(
rtn
,
"rtn---------------------------------e签宝--------execPostESignBao---------------->>>>>>>>>>>>>>>>"
);
if
(
rtn
.
stdout
==
null
||
rtn
.
stdout
==
""
||
rtn
.
stdout
==
"undefined"
)
{
...
...
bpo-admin/app/config/localsettings.js
View file @
cbe24048
...
...
@@ -9,7 +9,7 @@ var settings = {
// dbname : "bpo",
// user : "write",
// password : "write",
dbname
:
"bpo
2
"
,
dbname
:
"bpo"
,
user
:
"write"
,
password
:
"write"
,
config
:
{
...
...
bpo-admin/app/front/vues/pages/entcontractall2/entcontractall2.html
0 → 100644
View file @
cbe24048
This diff is collapsed.
Click to expand it.
bpo-admin/app/front/vues/pages/entcontractall2/entcontractall2.js
0 → 100644
View file @
cbe24048
This diff is collapsed.
Click to expand it.
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