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
13051004
Commit
13051004
authored
Jul 27, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
b406a472
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
6 deletions
+97
-6
bpo-web/app/base/api/impl/bpoSDPJApi.js
+52
-2
bpo-web/app/base/api/impl/tdevApi.js
+4
-4
bpo-web/app/base/service/impl/ccashinfoSve.js
+41
-0
No files found.
bpo-web/app/base/api/impl/bpoSDPJApi.js
View file @
13051004
...
@@ -24,6 +24,9 @@ class BpoSDPJApi {
...
@@ -24,6 +24,9 @@ class BpoSDPJApi {
this
.
ccashinfoSve
=
system
.
getObject
(
"service.ccashinfoSve"
);
this
.
ccashinfoSve
=
system
.
getObject
(
"service.ccashinfoSve"
);
this
.
ecompanybusiSve
=
system
.
getObject
(
"service.ecompanybusiSve"
);
this
.
ecompanybusiSve
=
system
.
getObject
(
"service.ecompanybusiSve"
);
this
.
qrClient
=
system
.
getObject
(
"util.qrClient"
);
this
.
qrClient
=
system
.
getObject
(
"util.qrClient"
);
this
.
idcardClient
=
system
.
getObject
(
"util.idcardClient"
);
this
.
esettleSve
=
system
.
getObject
(
"service.esettleSve"
);
this
.
tdevApi
=
require
(
"./tdevApi"
);
let
resultMap
=
{
let
resultMap
=
{
0
:
"操作成功"
,
0
:
"操作成功"
,
1
:
"操作失败"
,
1
:
"操作失败"
,
...
@@ -156,7 +159,9 @@ class BpoSDPJApi {
...
@@ -156,7 +159,9 @@ class BpoSDPJApi {
});
});
return
this
.
getResult
(
0
,{
return
this
.
getResult
(
0
,{
id_name
:
_cCashInfo
.
id_name
,
id_name
:
_cCashInfo
.
id_name
,
id_no
:
_cCashInfo
.
id_no
id_no
:
_cCashInfo
.
id_no
,
app_id
:
_cCashInfo
.
app_id
,
id
:
_cCashInfo
.
id
})
})
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
);
...
@@ -174,10 +179,36 @@ class BpoSDPJApi {
...
@@ -174,10 +179,36 @@ class BpoSDPJApi {
* @returns {Promise<void>}
* @returns {Promise<void>}
*/
*/
async
authentication
(
obj
,
req
){
async
authentication
(
obj
,
req
){
if
(
!
obj
||
!
obj
.
id_name
||
!
obj
.
id_no
){
if
(
!
obj
||
!
obj
.
id_name
||
!
obj
.
id_no
||
!
obj
.
mchtId
||
!
obj
.
app_id
||
!
obj
.
id
){
return
this
.
getResult
(
1002001
,
null
);
return
this
.
getResult
(
1002001
,
null
);
}
}
try
{
try
{
if
(
!
await
this
.
idcardClient
.
checkIDCard
(
obj
.
id_no
))
{
return
this
.
returnjson
(
-
1
,
"身份证格式不正确"
);
}
let
num
=
await
this
.
esettleSve
.
isValidAge
([
obj
.
mchtId
]);
if
(
num
)
{
let
card
=
await
this
.
idcardClient
.
cardInfo
(
obj
.
id_no
);
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
doAuthRes
=
await
this
.
tdevApi
.
doAuth
({
idName
:
this
.
trim
(
obj
.
id_name
),
idNo
:
this
.
trim
(
obj
.
id_no
)},{
app_id
:
obj
.
app_id
});
//异步推送信息
pushAsync
(
obj
);
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
);
...
@@ -191,6 +222,25 @@ class BpoSDPJApi {
...
@@ -191,6 +222,25 @@ class BpoSDPJApi {
}
}
/**
* fn:异步同送信息
* @param params
*/
pushAsync
(
params
){
/**
* fn:签约
*/
let
res
=
this
.
tdevApi
.
doSign3
(
params
);
/**
* fn:更新验证信息 人名 身份证号
*/
this
.
ccashinfoSve
.
update
(
params
);
}
getResult
(
code
,
data
=
{},
other
=
{}){
getResult
(
code
,
data
=
{},
other
=
{}){
...
...
bpo-web/app/base/api/impl/tdevApi.js
View file @
13051004
...
@@ -50,10 +50,10 @@ class TDEVApi {
...
@@ -50,10 +50,10 @@ class TDEVApi {
// 专票签(三方签)
// 专票签(三方签)
let
signParam
=
{
let
signParam
=
{
ecid
:
this
.
trim
(
cashInfo
.
ecid
),
ecid
:
this
.
trim
(
cashInfo
.
ecid
),
appId
:
this
.
trim
(
cashInfo
.
app
I
d
),
appId
:
this
.
trim
(
cashInfo
.
app
_i
d
),
userId
:
this
.
trim
(
cashInfo
.
id
N
o
),
userId
:
this
.
trim
(
cashInfo
.
id
_n
o
),
idName
:
this
.
trim
(
cashInfo
.
id
N
ame
),
idName
:
this
.
trim
(
cashInfo
.
id
_n
ame
),
idNo
:
this
.
trim
(
cashInfo
.
id
N
o
),
idNo
:
this
.
trim
(
cashInfo
.
id
_n
o
),
};
};
try
{
try
{
let
key
=
`
${
cashInfo
.
mcthId
}
_
${
cashInfo
.
outTradeNo
}
`
;
let
key
=
`
${
cashInfo
.
mcthId
}
_
${
cashInfo
.
outTradeNo
}
`
;
...
...
bpo-web/app/base/service/impl/ccashinfoSve.js
View file @
13051004
...
@@ -58,6 +58,47 @@ class CcashinfoSve extends ServiceBase {
...
@@ -58,6 +58,47 @@ class CcashinfoSve extends ServiceBase {
}
}
}
}
/**
* fn:跟新缓存记录
* @param params
* @returns {Promise<void>}
*/
async
update
(
params
){
try
{
console
.
log
(
`跟新【
${
params
.
id
}
】参数`
+
JSON
.
stringify
(
params
));
if
(
!
params
.
id
){
return
null
;
}
let
bean
=
await
this
.
dao
.
model
.
findOne
({
where
:{
id
:
this
.
trim
(
params
.
id
)
}
});
if
(
!
bean
){
console
.
log
(
`跟新纪录失败 记录【
${
params
.
id
}
】信息不存在 `
);
return
;
}
let
properties
=
{
id
:
this
.
trim
(
params
.
id
)
};
if
(
params
.
id_name
){
properties
.
id_name
=
this
.
trim
(
params
.
id_name
)
}
if
(
params
.
id_no
){
properties
.
id_no
=
this
.
trim
(
params
.
id_no
)
}
if
(
params
.
contract_id
){
properties
.
contract_id
=
this
.
trim
(
params
.
contract_id
)
}
await
this
.
dao
.
update
(
properties
)
return
{
code
:
0
,
null
}
}
catch
(
e
)
{
console
.
log
(
e
);
return
null
;
}
}
}
}
...
...
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