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
c8539172
Commit
c8539172
authored
Jan 03, 2020
by
赵庆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
2ad362b7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
9 deletions
+83
-9
bpo-web/app/base/api/impl/entcontractApi.js
+83
-9
bpo-web/app/base/service/impl/entcontractSve.js
+0
-0
No files found.
bpo-web/app/base/api/impl/entcontractApi.js
View file @
c8539172
const
system
=
require
(
"../../system"
);
const
md5
=
require
(
"MD5"
);
class
EntcontractApi
{
constructor
()
{
this
.
entcontractSve
=
system
.
getObject
(
"service.entcontractSve"
);
this
.
ecompanybusiSve
=
system
.
getObject
(
"service.ecompanybusiSve"
);
this
.
idcardClient
=
system
.
getObject
(
"util.idcardClient"
);
this
.
utilesignbaoSve
=
system
.
getObject
(
"service.utilesignbaoSve"
);
}
async
autoSign
(
pobj
)
{
// 处理参数
var
param
=
{
name
:
this
.
trim
(
pobj
.
name
),
//甲方 必填
addr
:
this
.
trim
(
pobj
.
addr
),
//甲方地址
legal
:
this
.
trim
(
pobj
.
legal
),
//甲方法定代表人
contactName
:
this
.
trim
(
pobj
.
contactName
),
//甲方联系人
contactMobile
:
this
.
trim
(
pobj
.
contactMobile
),
//甲方 联系电话
ecid
:
this
.
trim
(
pobj
.
ecid
),
appId
:
this
.
trim
(
pobj
.
appId
),
userId
:
this
.
trim
(
pobj
.
userId
),
name
:
this
.
trim
(
pobj
.
firstAddr
),
//甲方 必填
addr
:
this
.
trim
(
pobj
.
firstAddr
),
//甲方地址
legal
:
this
.
trim
(
pobj
.
firstLegal
),
//甲方法定代表人
contactName
:
this
.
trim
(
pobj
.
firstContactName
),
//甲方联系人
contactMobile
:
this
.
trim
(
pobj
.
firstContactMobile
),
//甲方 联系电话
idName
:
this
.
trim
(
pobj
.
idName
),
//姓名
mobile
:
this
.
trim
(
pobj
.
mobile
),
//手机号
idNo
:
this
.
trim
(
pobj
.
idNo
),
//身份证
...
...
@@ -104,10 +108,10 @@ class EntcontractApi {
}
if
(
!
param
.
idNo
)
{
return
this
.
returnjson
(
-
1
,
"请提供该用户身份证号"
)
}
else
{
if
(
!
await
this
.
idcardClient
.
checkIDCard
(
param
.
idNo
))
{
return
this
.
returnjson
(
-
1
,
"身份证格式不正确"
);
}
}
else
{
if
(
!
await
this
.
idcardClient
.
checkIDCard
(
param
.
idNo
))
{
return
this
.
returnjson
(
-
1
,
"身份证格式不正确"
);
}
}
if
(
!
param
.
nonceStr
)
{
return
this
.
returnjson
(
-
1
,
"请提供随机码"
)
...
...
@@ -134,6 +138,7 @@ class EntcontractApi {
}
var
signStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
busi
.
key
;
var
sign
=
md5
(
signStr
).
toUpperCase
();
console
.
log
(
sign
)
if
(
param
.
sign
!=
sign
)
{
return
this
.
returnjson
(
1001001
,
"签名错误"
);
}
...
...
@@ -146,6 +151,75 @@ class EntcontractApi {
}
}
async
sinedUsers3rd
(
obj
,
req
)
{
// 验证合法性
var
appId
=
obj
.
appId
;
var
nonceStr
=
obj
.
nonceStr
;
var
idNo
=
obj
.
idNo
;
var
startId
=
obj
.
startId
||
0
;
var
userId
=
obj
.
userId
||
""
;
var
pageSize
=
20
;
var
busi
=
await
this
.
ecompanybusiSve
.
findOne
({
appId
:
appId
});
if
(
!
busi
)
{
return
{
code
:
1001003
,
msg
:
"配置信息错误,请联系薪必果人员进行配置"
};
}
var
signArr
=
[];
signArr
.
push
(
"appId="
+
appId
);
signArr
.
push
(
"idNo="
+
idNo
);
signArr
.
push
(
"nonceStr="
+
nonceStr
);
signArr
.
push
(
"startId="
+
startId
);
signArr
.
push
(
"userId="
+
userId
);
signArr
.
push
(
"key="
+
busi
.
key
);
var
sign
=
md5
(
signArr
.
join
(
"&"
)).
toUpperCase
();
if
(
sign
!=
obj
.
sign
)
{
return
{
code
:
1001001
,
msg
:
"签名失败"
};
}
var
params
=
{
entcompanyId
:
busi
.
ecompany_id
,
startId
:
startId
,
idNo
:
idNo
,
pageSize
:
pageSize
,
userId3rd
:
userId
,
};
try
{
var
userList
=
await
this
.
entcontractSve
.
findSignedUses4Push
(
params
);
var
result
=
{
code
:
0
,
msg
:
"success"
,
};
result
.
data
=
userList
;
return
result
;
}
catch
(
e
)
{
var
result
=
{
code
:
500
,
msg
:
"接口异常"
};
console
.
log
(
e
.
stack
);
//日志记录
logCtl
.
error
({
optitle
:
"校验是否签约error"
,
op
:
"api/econtractApi/validContract"
,
content
:
e
.
stack
,
clientIp
:
req
.
clientIp
});
return
result
;
}
}
trim
(
o
)
{
if
(
!
o
)
{
return
""
;
...
...
bpo-web/app/base/service/impl/entcontractSve.js
View file @
c8539172
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