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
b3d39c7e
Commit
b3d39c7e
authored
May 07, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
e9cc81da
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
147 additions
and
113 deletions
+147
-113
bpo-web/app/base/api/impl/econtractApi.js
+2
-2
bpo-web/app/base/api/impl/entcontractApi.js
+14
-28
bpo-web/app/base/controller/impl/dksignCtl.js
+1
-0
bpo-web/app/base/service/impl/entcontractSve.js
+43
-1
bpo-web/app/base/wxapplet/impl/esignbao.js
+87
-82
No files found.
bpo-web/app/base/api/impl/econtractApi.js
View file @
b3d39c7e
...
...
@@ -248,7 +248,7 @@ class EcontractApi {
// 验证合法性
var
appId
=
obj
.
appId
;
var
nonceStr
=
obj
.
nonceStr
;
var
idNo
=
obj
.
idNo
.
toUpperCase
()
;
var
idNo
=
obj
.
idNo
;
var
startId
=
obj
.
startId
||
0
;
var
userId
=
obj
.
userId
||
""
;
var
userCode
=
obj
.
userCode
||
""
;
...
...
@@ -286,7 +286,7 @@ class EcontractApi {
var
params
=
{
ecompanyId
:
busi
.
ecompany_id
,
startId
:
startId
,
idNo
:
idNo
,
idNo
:
idNo
.
toUpperCase
()
,
pageSize
:
pageSize
,
userId3rd
:
userId
,
userCode3rd
:
userCode
,
...
...
bpo-web/app/base/api/impl/entcontractApi.js
View file @
b3d39c7e
...
...
@@ -50,20 +50,6 @@ class EntcontractApi {
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岁之间"
)
}
}
else
{
if
(
age
<
18
||
age
>
55
)
{
return
this
.
returnjson
(
-
1
,
"签约失败,女限制18-55岁之间"
)
}
}
}
if
(
!
param
.
bankno
)
{
return
this
.
returnjson
(
-
1
,
"请提供该用户银行卡号"
)
...
...
@@ -136,20 +122,20 @@ class EntcontractApi {
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岁之间"
)
}
}
else
{
if
(
age
<
18
||
age
>
55
)
{
return
this
.
returnjson
(
-
1
,
"签约失败,女限制18-55岁之间"
)
}
}
//
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岁之间")
//
}
//
} else {
//
if (age < 18 || age > 55) {
//
return this.returnjson(-1, "签约失败,女限制18-55岁之间")
//
}
//
}
}
if
(
!
param
.
nonceStr
)
{
return
this
.
returnjson
(
-
1
,
"请提供随机码"
)
...
...
bpo-web/app/base/controller/impl/dksignCtl.js
View file @
b3d39c7e
...
...
@@ -155,6 +155,7 @@ class DKSignCtl {
//var loginUser = await this.service.findById(req.session.user.id);
try
{
pobj
.
personsSign
=
pobj
.
personsSign
.
toUpperCase
();
// 获取该身份证帐号信息
var
eaccount
=
await
this
.
usereaccountSve
.
findOne
({
personsSign
:
pobj
.
personsSign
...
...
bpo-web/app/base/service/impl/entcontractSve.js
View file @
b3d39c7e
...
...
@@ -196,7 +196,7 @@ class EntcontractService extends ServiceBase {
}
};
var
ebaoAccountId
=
eaccount
.
eaccountid
;
//签署人账户id-- 必填
var
thirdOrderNo
=
entcontract
.
id
;
//第三方流水号,通知回调使用---选填
var
thirdOrderNo
=
"ent_"
+
entcontract
.
id
;
//第三方流水号,通知回调使用---选填
var
eBaoRedirectBossUrl
=
""
;
var
tt
=
await
this
.
utilesignbaoSve
.
userAutoSignContractNoTemplate
(
signParams
,
ebaoAccountId
,
thirdOrderNo
,
eBaoRedirectBossUrl
,
"econtractSve"
,
sealId
);
if
(
tt
&&
tt
.
data
&&
tt
.
code
==
1
)
{
...
...
@@ -1186,6 +1186,48 @@ class EntcontractService extends ServiceBase {
}
}
async
updateCallbackStatus
(
obj
)
{
obj
=
obj
||
{};
logCtl
.
info
({
optitle
:
"e签宝回调修改合同信息info"
,
op
:
"app/base/service/impl/dkcontractSve/updateCallbackStatus"
,
content
:
"请求参数:"
+
JSON
.
stringify
(
obj
),
clientIp
:
""
});
let
contract
;
try
{
let
signTime
=
obj
.
signTime
;
let
signResult
=
obj
.
signResult
||
"1"
;
let
thirdOrderNo
=
Number
(
obj
.
thirdOrderNo
.
substring
(
4
)
||
0
);
contract
=
await
this
.
findById
(
Number
(
thirdOrderNo
));
if
(
!
contract
)
{
return
;
}
contract
.
eflowstatus
=
signResult
.
toString
();
contract
.
completed_at
=
signTime
;
contract
.
begin_at
=
signTime
;
contract
.
resultDescription
=
obj
.
resultDescription
||
""
;
var
end_at
=
new
Date
(
signTime
);
end_at
.
setFullYear
(
end_at
.
getFullYear
()
+
1
);
contract
.
end_at
=
end_at
;
// 合同下载任务
this
.
redisClient
.
rpushBCD
({
id
:
contract
.
id
,
sve
:
"ent"
});
await
contract
.
save
();
}
catch
(
e
)
{
logCtl
.
error
({
optitle
:
"e签宝回调修改合同信息error"
,
op
:
"app/base/service/impl/dkcontractSve/updateCallbackStatus"
,
content
:
"错误信息:"
+
e
.
stack
,
clientIp
:
""
});
}
return
contract
;
}
async
syncYzSign
(
contractId
)
{
// 查询合同
var
contract
=
await
this
.
dao
.
findById
(
contractId
);
...
...
bpo-web/app/base/wxapplet/impl/esignbao.js
View file @
b3d39c7e
var
system
=
require
(
"../../system"
)
var
settings
=
require
(
"../../../config/settings"
);
const
AppletBase
=
require
(
"../applet.base"
);
const
logCtl
=
system
.
getObject
(
"web.oplogCtl"
);
class
eSignBaoApplet
extends
AppletBase
{
constructor
(){
super
();
this
.
utilesignbaoSve
=
system
.
getObject
(
"service.utilesignbaoSve"
);
this
.
econtractSve
=
system
.
getObject
(
"service.econtractSve"
);
this
.
dkcontractSve
=
system
.
getObject
(
"service.dkcontractSve"
);
}
//e签宝签署回调=post
/*
action:标记该通知的业务类型
action=SIGN_FLOW_UPDATE,5.9.3 签署人签署状态更新通知,e签宝签署状态变化完成后调用(拒签、签署完成),签署人签署完成,调用e签宝归档流程
action=SIGN_FLOW_FINISH,5.9.4 签署任务结束通知,由调用【**归档流程**】后回调此回调
*/
async
noticeCallback
(
obj
,
req
){
//日志记录
logCtl
.
info
({
optitle
:
"e签宝签署回调信息info"
,
op
:
"wxapplet/impl/esignbao/eSignBaoCallback"
,
content
:
"请求参数:"
+
req
?
JSON
.
stringify
(
req
):
""
,
clientIp
:
req
.
clientIp
});
var
result
=
{
code
:
1
,
message
:
"success"
,
shopNum
:
""
,
data
:{}
};
var
system
=
require
(
"../../system"
)
var
settings
=
require
(
"../../../config/settings"
);
const
AppletBase
=
require
(
"../applet.base"
);
const
logCtl
=
system
.
getObject
(
"web.oplogCtl"
);
class
eSignBaoApplet
extends
AppletBase
{
constructor
()
{
super
();
this
.
utilesignbaoSve
=
system
.
getObject
(
"service.utilesignbaoSve"
);
this
.
econtractSve
=
system
.
getObject
(
"service.econtractSve"
);
this
.
dkcontractSve
=
system
.
getObject
(
"service.dkcontractSve"
);
this
.
entcontractSve
=
system
.
getObject
(
"service.entcontractSve"
);
}
var
thirdOrderNo
=
req
.
thirdOrderNo
||
""
;
var
action
=
req
.
action
==
null
||
req
.
action
==
""
||
req
.
action
==
"undefined"
?
""
:
req
.
action
;
var
flowId
=
req
.
flowId
==
null
||
req
.
flowId
==
""
||
req
.
flowId
==
"undefined"
?
""
:
req
.
flowId
;
if
(
action
==
""
||
flowId
==
""
){
result
.
code
=-
101
;
result
.
message
=
"请求参数有误"
;
return
result
;
}
try
{
if
(
action
!=
"SIGN_FLOW_FINISH"
&&
action
!=
"SIGN_FLOW_UPDATE"
){
result
.
code
=-
102
;
result
.
message
=
"action请求参数有误"
;
return
result
;
}
var
params
=
{
flowId
:
flowId
};
var
contractDetails
=
await
this
.
utilesignbaoSve
.
getContractDetails
(
params
,
"eSignBaoApplet"
);
if
(
action
==
"SIGN_FLOW_UPDATE"
){
//5.9.3 签署人签署状态更新通知,e签宝签署状态变化完成后调用(拒签、签署完成)
var
signResultStatus
=
req
.
signResult
==
null
||
req
.
signResult
==
""
||
req
.
signResult
==
"undefined"
?
-
1
:
req
.
signResult
;
if
(
signResultStatus
>=
0
){
// 跟进回调----更新db签署人签署状态
if
(
thirdOrderNo
.
indexOf
(
"dk_"
)
==
0
)
{
this
.
dkcontractSve
.
updateCallbackStatus
(
req
);
}
else
{
this
.
econtractSve
.
updateCallbackStatus
(
req
);
}
if
(
signResultStatus
==
2
){
//签署人签署完成,调用e签宝归档流程
var
archiveProcess
=
await
this
.
utilesignbaoSve
.
archiveProcess
(
params
,
"eSignBaoApplet"
);
}
}
}
else
if
(
action
==
"SIGN_FLOW_FINISH"
)
{
//5.9.4 签署任务结束通知,由调用【**归档流程**】后回调此回调
var
flowStatus
=
req
.
flowStatus
==
null
||
req
.
flowStatus
==
""
||
req
.
flowStatus
==
"undefined"
?
-
1
:
req
.
flowStatus
;
if
(
flowStatus
>=
0
){
//TODO:跟进回调----更新db签署流程状态
}
}
return
result
;
}
catch
(
e
)
{
console
.
log
(
e
.
stack
);
//日志记录
logCtl
.
error
({
optitle
:
"e签宝签署回调异常error"
,
op
:
"wxapplet/impl/esignbao/eSignBaoCallback"
,
content
:
e
.
stack
,
clientIp
:
req
.
clientIp
});
}
}
//e签宝签署回调=post
/*
action:标记该通知的业务类型
action=SIGN_FLOW_UPDATE,5.9.3 签署人签署状态更新通知,e签宝签署状态变化完成后调用(拒签、签署完成),签署人签署完成,调用e签宝归档流程
action=SIGN_FLOW_FINISH,5.9.4 签署任务结束通知,由调用【**归档流程**】后回调此回调
*/
async
noticeCallback
(
obj
,
req
)
{
//日志记录
logCtl
.
info
({
optitle
:
"e签宝签署回调信息info"
,
op
:
"wxapplet/impl/esignbao/eSignBaoCallback"
,
content
:
"请求参数:"
+
req
?
JSON
.
stringify
(
req
)
:
""
,
clientIp
:
req
.
clientIp
});
var
result
=
{
code
:
1
,
message
:
"success"
,
shopNum
:
""
,
data
:
{}
};
var
thirdOrderNo
=
req
.
thirdOrderNo
||
""
;
var
action
=
req
.
action
==
null
||
req
.
action
==
""
||
req
.
action
==
"undefined"
?
""
:
req
.
action
;
var
flowId
=
req
.
flowId
==
null
||
req
.
flowId
==
""
||
req
.
flowId
==
"undefined"
?
""
:
req
.
flowId
;
if
(
action
==
""
||
flowId
==
""
)
{
result
.
code
=
-
101
;
result
.
message
=
"请求参数有误"
;
return
result
;
}
try
{
if
(
action
!=
"SIGN_FLOW_FINISH"
&&
action
!=
"SIGN_FLOW_UPDATE"
)
{
result
.
code
=
-
102
;
result
.
message
=
"action请求参数有误"
;
return
result
;
}
var
params
=
{
flowId
:
flowId
};
var
contractDetails
=
await
this
.
utilesignbaoSve
.
getContractDetails
(
params
,
"eSignBaoApplet"
);
if
(
action
==
"SIGN_FLOW_UPDATE"
)
{
//5.9.3 签署人签署状态更新通知,e签宝签署状态变化完成后调用(拒签、签署完成)
var
signResultStatus
=
req
.
signResult
==
null
||
req
.
signResult
==
""
||
req
.
signResult
==
"undefined"
?
-
1
:
req
.
signResult
;
if
(
signResultStatus
>=
0
)
{
// 跟进回调----更新db签署人签署状态
if
(
thirdOrderNo
.
indexOf
(
"dk_"
)
==
0
)
{
this
.
dkcontractSve
.
updateCallbackStatus
(
req
);
}
else
if
(
thirdOrderNo
.
indexOf
(
"ent_"
)
==
0
)
{
this
.
entcontractSve
.
updateCallbackStatus
(
req
);
}
else
{
this
.
econtractSve
.
updateCallbackStatus
(
req
);
}
if
(
signResultStatus
==
2
)
{
//签署人签署完成,调用e签宝归档流程
var
archiveProcess
=
await
this
.
utilesignbaoSve
.
archiveProcess
(
params
,
"eSignBaoApplet"
);
}
}
}
else
if
(
action
==
"SIGN_FLOW_FINISH"
)
{
//5.9.4 签署任务结束通知,由调用【**归档流程**】后回调此回调
var
flowStatus
=
req
.
flowStatus
==
null
||
req
.
flowStatus
==
""
||
req
.
flowStatus
==
"undefined"
?
-
1
:
req
.
flowStatus
;
if
(
flowStatus
>=
0
)
{
//TODO:跟进回调----更新db签署流程状态
}
}
return
result
;
}
catch
(
e
)
{
console
.
log
(
e
.
stack
);
//日志记录
logCtl
.
error
({
optitle
:
"e签宝签署回调异常error"
,
op
:
"wxapplet/impl/esignbao/eSignBaoCallback"
,
content
:
e
.
stack
,
clientIp
:
req
.
clientIp
});
}
}
}
module
.
exports
=
eSignBaoApplet
;
module
.
exports
=
eSignBaoApplet
;
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