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
c1215861
Commit
c1215861
authored
Feb 14, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
c6372040
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
526 additions
and
37 deletions
+526
-37
bpo-web/app/base/api/impl/yzcontractApi.js
+255
-0
bpo-web/app/base/service/impl/entcontractSve.js
+217
-19
bpo-web/app/base/service/impl/utilesignbaoSve.js
+21
-0
bpo-web/app/config/localsettings.js
+6
-2
bpo-web/package-lock.json
+26
-16
bpo-web/package.json
+1
-0
No files found.
bpo-web/app/base/api/impl/yzcontractApi.js
0 → 100644
View file @
c1215861
const
system
=
require
(
"../../system"
);
const
md5
=
require
(
"MD5"
);
class
YZContractApi
{
constructor
()
{
this
.
entcontractSve
=
system
.
getObject
(
"service.entcontractSve"
);
this
.
idcardClient
=
system
.
getObject
(
"util.idcardClient"
);
this
.
utilesignbaoSve
=
system
.
getObject
(
"service.utilesignbaoSve"
);
this
.
appId
=
"1201869719607517185"
;
this
.
key
=
"bee7870e008ab144bf518b70ef91f8ac"
;
}
async
merchantSign
(
pobj
)
{
// 处理参数
var
param
=
{
ecid
:
this
.
trim
(
pobj
.
ecid
),
appId
:
this
.
trim
(
pobj
.
appId
),
merchantId
:
this
.
trim
(
pobj
.
merchantId
),
merchantName
:
this
.
trim
(
pobj
.
merchantName
),
//甲方 必填
merchantAddr
:
this
.
trim
(
pobj
.
merchantAddr
),
//甲方地址
merchantLegal
:
this
.
trim
(
pobj
.
merchantLegal
),
//甲方法定代表人
idName
:
this
.
trim
(
pobj
.
idName
),
// 代理人姓名
mobile
:
this
.
trim
(
pobj
.
mobile
),
// 代理人手机号
idNo
:
this
.
trim
(
pobj
.
idNo
),
// 代理人身份证
nonceStr
:
this
.
trim
(
pobj
.
nonceStr
),
//随机码
sign
:
this
.
trim
(
pobj
.
sign
)
};
if
(
!
param
.
ecid
)
{
return
this
.
returnjson
(
-
1
,
"请传入薪必果提供的ecid"
)
}
if
(
!
param
.
appId
)
{
return
this
.
returnjson
(
-
1
,
"请传入薪必果提供的appId"
)
}
if
(
!
param
.
idName
)
{
return
this
.
returnjson
(
-
1
,
"请提供代理人姓名"
)
}
if
(
!
param
.
idNo
)
{
return
this
.
returnjson
(
-
1
,
"请提供代理人身份证号"
)
}
else
{
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
.
nonceStr
)
{
return
this
.
returnjson
(
-
1
,
"请提供随机码"
)
}
// 签名
var
signArr
=
[];
var
keys
=
Object
.
keys
(
param
).
sort
();
for
(
var
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
var
k
=
keys
[
i
];
var
v
=
param
[
k
];
if
(
!
k
||
!
v
||
k
==
'sign'
)
{
continue
;
}
signArr
.
push
(
k
+
"="
+
v
);
}
var
signStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
this
.
key
;
var
sign
=
md5
(
signStr
).
toUpperCase
();
console
.
log
(
signStr
,
sign
);
if
(
param
.
sign
!=
sign
)
{
return
this
.
returnjson
(
1001001
,
"签名错误"
);
}
try
{
var
result
=
await
this
.
entcontractSve
.
yzMerchantAutoSign
(
param
);
return
result
;
}
catch
(
error
)
{
console
.
log
(
error
);
}
}
async
autoSign
(
pobj
)
{
// 处理参数
var
param
=
{
ecid
:
this
.
trim
(
pobj
.
ecid
),
appId
:
this
.
trim
(
pobj
.
appId
),
userId
:
this
.
trim
(
pobj
.
userId
),
idName
:
this
.
trim
(
pobj
.
idName
),
mobile
:
this
.
trim
(
pobj
.
mobile
),
idNo
:
this
.
trim
(
pobj
.
idNo
),
nonceStr
:
this
.
trim
(
pobj
.
nonceStr
),
sign
:
this
.
trim
(
pobj
.
sign
)
};
if
(
!
param
.
ecid
)
{
return
this
.
returnjson
(
-
1
,
"请传入薪必果提供的ecid"
)
}
if
(
!
param
.
appId
)
{
return
this
.
returnjson
(
-
1
,
"请传入薪必果提供的appId"
)
}
if
(
!
param
.
userId
)
{
return
this
.
returnjson
(
-
1
,
"请提供该用户的userId"
)
}
if
(
!
param
.
idName
)
{
return
this
.
returnjson
(
-
1
,
"请提供该用户姓名"
)
}
if
(
!
param
.
idNo
)
{
return
this
.
returnjson
(
-
1
,
"请提供该用户身份证号"
)
}
else
{
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
.
nonceStr
)
{
return
this
.
returnjson
(
-
1
,
"请提供随机码"
);
}
// 签名
var
signArr
=
[];
var
keys
=
Object
.
keys
(
param
).
sort
();
for
(
var
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
var
k
=
keys
[
i
];
var
v
=
param
[
k
];
if
(
!
k
||
!
v
||
k
==
'sign'
)
{
continue
;
}
signArr
.
push
(
k
+
"="
+
v
);
}
var
signStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
this
.
key
;
var
sign
=
md5
(
signStr
).
toUpperCase
();
console
.
log
(
sign
)
if
(
param
.
sign
!=
sign
)
{
return
this
.
returnjson
(
1001001
,
"签名错误"
);
}
try
{
var
result
=
await
this
.
entcontractSve
.
yzPersonAutoSign
(
param
);
return
result
;
}
catch
(
error
)
{
console
.
log
(
error
);
}
}
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
""
;
}
return
o
.
toString
().
trim
();
}
returnjson
(
code
,
msg
,
data
)
{
return
{
code
:
code
,
msg
:
msg
,
data
:
data
||
null
}
}
}
module
.
exports
=
YZContractApi
;
\ No newline at end of file
bpo-web/app/base/service/impl/entcontractSve.js
View file @
c1215861
...
...
@@ -4,6 +4,8 @@ const moment = require('moment');
const
system
=
require
(
"../../system"
);
const
md5
=
require
(
"MD5"
);
const
axios
=
require
(
'axios'
);
class
EntcontractService
extends
ServiceBase
{
constructor
()
{
super
(
ServiceBase
.
getDaoName
(
EntcontractService
));
...
...
@@ -17,6 +19,11 @@ class EntcontractService extends ServiceBase {
this
.
ejobapplySve
=
system
.
getObject
(
"service.ejobapplySve"
);
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
yzmerchantsignedDao
=
system
.
getObject
(
"db.yzmerchantsignedDao"
);
this
.
etemplateDao
=
system
.
getObject
(
"db.etemplateDao"
);
this
.
ecompanyDao
=
system
.
getObject
(
"db.ecompanyDao"
);
this
.
URL
=
"http://39.106.185.66:8000/merchant/busi/reg"
;
this
.
YZKEY
=
"4a112ce87c38464d8d454caf23b7b31f"
}
...
...
@@ -180,7 +187,7 @@ class EntcontractService extends ServiceBase {
await
entcontract
.
save
();
// this.syncSign(entcontract.id);
return
await
this
.
createMerchant
(
params
);
// return await this.createMerchant(params); 暂时先不用了
// return this.returnjson(0, "success", {
// contractId: entcontract.id
// });
...
...
@@ -188,15 +195,17 @@ class EntcontractService extends ServiceBase {
return
this
.
returnjson
(
-
1
,
tt
.
message
||
"签约失败"
,
tt
.
code
);
}
async
createMerchant
(
params
)
{
async
createYzMerchant
(
params
)
{
var
data
=
{
appId
:
"1202849621743763458"
,
mchtId
:
"1202848945651318786"
,
type
:
"0"
,
// 类型 0 一般纳税人 1 小规模纳税人
companyName
:
params
.
n
ame
,
//商户名称
mobile
:
params
.
contactM
obile
,
//手机号
companyName
:
params
.
merchantN
ame
,
//商户名称
mobile
:
params
.
m
obile
,
//手机号
mainId
:
"67731504"
,
//代征主体 67731101
signedName
:
params
.
n
ame
,
//合同名称 使用商户名称
signedName
:
params
.
merchantN
ame
,
//合同名称 使用商户名称
beginTime
:
moment
().
format
(
"YYYY-MM-DD"
),
//当前时间, // 签约开始时间
invalidTime
:
moment
().
add
(
2
,
'y'
).
format
(
"YYYY-MM-DD"
),
// 签约失效时间
completeTime
:
moment
().
format
(
"YYYY-MM-DD"
),
// 签约完成时间 取当前时间
...
...
@@ -208,7 +217,7 @@ class EntcontractService extends ServiceBase {
operatingCost
:
'0.0'
,
// 核定成本费用率(%)
taxChargeMode
:
"0"
,
// 个税计费模式 0 按月,1 按年
signType
:
'MD5'
,
nonceStr
:
"1398243242129742"
nonceStr
:
await
this
.
getUidStr
(
16
,
36
)
};
var
signArr
=
[];
var
keys
=
Object
.
keys
(
data
).
sort
();
...
...
@@ -241,21 +250,18 @@ class EntcontractService extends ServiceBase {
];
var
rtn
=
null
;
try
{
rtn
=
await
this
.
restClient
.
execPost
(
data
,
this
.
URL
);
if
(
rtn
.
stdout
==
null
||
rtn
.
stdout
==
""
||
rtn
.
stdout
==
"undefined"
)
{
result
.
errCode
=
-
100
;
result
.
code
=
-
100
;
result
.
message
=
"请求结果返回为空"
;
return
result
;
}
let
rs
=
await
axios
({
method
:
'post'
,
url
:
this
.
URL
,
data
:
data
,
});
var
reso
=
rs
.
data
;
var
erchants
=
await
this
.
yzmerchantsignedDao
.
findOne
({
companyName
:
params
.
n
ame
,
companyName
:
params
.
merchantN
ame
,
});
var
reso
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
!
erchants
)
{
this
.
yzmerchantsignedDao
.
create
({
companyName
:
params
.
n
ame
,
companyName
:
params
.
merchantN
ame
,
appId
:
reso
.
data
.
appId
,
mchtId
:
reso
.
data
.
mchtId
,
mainId
:
reso
.
data
.
mainId
,
...
...
@@ -263,6 +269,29 @@ class EntcontractService extends ServiceBase {
});
}
// 创建ecompany
let
ecompany
=
await
this
.
ecompanyDao
.
create
({
"name"
:
params
.
merchantName
,
"nameA"
:
''
,
"isEnabled"
:
true
,
"isQuiet"
:
true
,
"sealurl"
:
""
,
"encryptkey"
:
""
,
"posturl"
:
""
});
let
temp
=
await
this
.
etemplateDao
.
findById
(
10222
);
let
template
=
await
this
.
etemplateDao
.
create
({
ecompany_id
:
ecompany
.
id
,
name
:
ecompany
.
name
,
templateid
:
temp
.
templateid
,
filekey
:
temp
.
filekey
,
//e签宝返回文件key
filepath
:
temp
.
filepath
,
//需要在后台补充
placeholderkey
:
temp
.
placeholderkey
,
//模板占位信息
isEnabled
:
true
,
});
reso
.
data
.
ecid
=
template
.
id
;
return
reso
;
}
catch
(
e
)
{
console
.
log
(
e
.
stack
);
...
...
@@ -273,7 +302,7 @@ class EntcontractService extends ServiceBase {
}
}
async
autoSignToPer
(
params
)
{
async
yzPersonAutoSign
(
params
)
{
var
ecid
=
params
.
ecid
;
var
unionId
=
params
.
appId
+
"_"
+
params
.
userId
;
...
...
@@ -324,7 +353,7 @@ class EntcontractService extends ServiceBase {
});
if
(
entcontract
)
{
return
this
.
returnjson
(
0
,
"
用户已经
签约"
,
{
return
this
.
returnjson
(
0
,
"
该商户已
签约"
,
{
contractId
:
entcontract
.
id
});
}
...
...
@@ -570,6 +599,175 @@ class EntcontractService extends ServiceBase {
return
uuid
.
join
(
''
);
}
async
yzMerchantAutoSign
(
params
)
{
var
ecid
=
params
.
ecid
;
var
unionId
=
params
.
appId
+
"_"
+
params
.
merchantId
+
"_"
+
params
.
idNo
;
// enttemplate 模板查询
var
enttemplate
=
await
this
.
enttemplateSve
.
findById
(
ecid
);
// entcompany
var
entcompany
=
await
this
.
entcompanyDao
.
findById
(
enttemplate
.
entcompany_id
);
// p_user
var
user
=
await
this
.
userDao
.
findOne
({
unionId
:
unionId
,
});
if
(
!
user
)
{
user
=
await
this
.
userDao
.
create
({
appkey
:
params
.
appId
,
unionId
:
unionId
,
userId3rd
:
params
.
merchantId
,
userName
:
params
.
idName
,
mobile
:
params
.
mobile
,
utype
:
0
,
});
}
// p_user_eaccount
var
eaccount
=
await
this
.
usereaccountDao
.
findOne
({
user_id
:
user
.
id
,
personsSign
:
params
.
idNo
,
})
||
{};
var
isNeedCreate
=
!
eaccount
.
eaccountid
||
eaccount
.
userName
!=
params
.
idName
||
eaccount
.
mobile
!=
params
.
mobile
;
eaccount
.
user_id
=
user
.
id
;
eaccount
.
userName
=
params
.
idName
;
eaccount
.
mobile
=
params
.
mobile
;
eaccount
.
bankno
=
""
;
eaccount
.
personsSign
=
params
.
idNo
;
if
(
eaccount
.
id
)
{
await
eaccount
.
save
();
}
else
{
eaccount
=
await
this
.
usereaccountDao
.
create
(
eaccount
);
}
// c_entcontract
var
entcontract
=
await
this
.
dao
.
findOne
({
eflowstatus
:
'2'
,
usereaccount_id
:
eaccount
.
id
,
enttemplate_id
:
ecid
,
});
if
(
entcontract
)
{
return
this
.
returnjson
(
0
,
"该商户已签约"
);
}
// e签宝流程
if
(
isNeedCreate
)
{
// 任博说有赞商户不验证银行卡三要素
// var bankthreeParams = {
// name: eaccount.userName,
// idno: eaccount.personsSign,
// cardno: eaccount.bankno
// };
// var threeResult = await this.utilesignbaoSve.bankthree(bankthreeParams, "bankinfoAuth");
// console.log("threeResult-----------------------------", threeResult);
// if (!threeResult || threeResult.code == -120) {
// return this.returnjson(-1, "银行三要素(姓名、身份证、银行卡号)验证失败");
// }
// if (threeResult.code == -110) {
// return this.returnjson(-1, "银行三要素验证失败");
// }
var
uidStr
=
await
this
.
getUidStr
(
8
,
36
);
var
thirdId
=
enttemplate
.
id
+
"_"
+
eaccount
.
id
+
uidStr
;
//2.创建e签宝account 5.2.1 , 创建后save()
let
createParams
=
{
thirdId
:
thirdId
,
name
:
eaccount
.
userName
,
idNo
:
eaccount
.
personsSign
,
idType
:
19
,
mobile
:
eaccount
.
mobile
};
var
getAccount
=
await
this
.
utilesignbaoSve
.
createAccountId
(
createParams
,
"econtractSve"
);
if
(
getAccount
&&
getAccount
.
code
==
1
&&
getAccount
.
data
)
{
eaccount
.
eaccountid
=
getAccount
.
data
.
accountId
;
await
eaccount
.
save
();
}
else
{
return
this
.
returnjson
(
-
1
,
"账户创建失败"
);
}
}
// 3.设置静默签署授权 5.2.5
if
(
!
eaccount
.
isGrantAuto
)
{
var
paramsGrant
=
{
grantAccountId
:
eaccount
.
eaccountid
};
var
grantAuto
=
await
this
.
utilesignbaoSve
.
grantAuthorization
(
paramsGrant
,
"econtractSve"
);
if
(
grantAuto
.
code
!=
1
)
{
return
this
.
returnjson
(
-
1
,
"静默签署设置失败"
);
}
eaccount
.
isGrantAuto
=
true
;
await
eaccount
.
save
();
}
// 创建合同
entcontract
=
{
name
:
entcompany
.
name
,
eflowstatusname
:
"签约中"
,
eflowstatus
:
"1"
,
user_id
:
eaccount
.
user_id
,
usereaccount_id
:
eaccount
.
id
,
enttemplate_id
:
enttemplate
.
id
,
entcompany_id
:
entcompany
.
id
,
};
entcontract
=
await
this
.
create
(
entcontract
);
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
:
eaccount
.
userName
,
//乙方 必填
addressB
:
entcompany
.
addr
,
//乙方 地址
representB
:
entcompany
.
legal
,
//乙方 法定代表人
agentB
:
entcompany
.
contactName
,
//乙方 联系人
agentMobileB
:
eaccount
.
mobile
,
//乙方 联系电话
bankNameB
:
entcompany
.
bankAccount
,
//账户名称
bank
:
entcompany
.
bankName
,
//开户行
bankNumB
:
entcompany
.
bankNo
,
//账号
signDate
:
today
,
//签约时间
signDateA
:
today
,
//甲方签约日期 必填
signDateB
:
today
//乙方签约日期 必填
}
};
var
ebaoAccountId
=
eaccount
.
eaccountid
;
//签署人账户id-- 必填
var
thirdOrderNo
=
entcontract
.
id
;
//第三方流水号,通知回调使用---选填
var
eBaoRedirectBossUrl
=
""
;
var
tt
=
await
this
.
utilesignbaoSve
.
userAutoSignContractNoTemplate
(
signParams
,
ebaoAccountId
,
thirdOrderNo
,
eBaoRedirectBossUrl
,
"econtractSve"
,
sealId
);
if
(
tt
&&
tt
.
data
&&
tt
.
code
==
1
)
{
entcontract
.
eflowid
=
tt
.
data
.
flowId
;
entcontract
.
edocid
=
tt
.
data
.
docId
;
entcontract
.
eflowstatus
=
'2'
;
entcontract
.
eflowstatusname
=
"已完成"
;
var
signTime
=
new
Date
();
entcontract
.
completed_at
=
signTime
;
entcontract
.
begin_at
=
signTime
;
var
end_at
=
new
Date
();
end_at
.
setFullYear
(
end_at
.
getFullYear
()
+
1
);
entcontract
.
end_at
=
end_at
;
await
entcontract
.
save
();
// this.syncSign(entcontract.id);
return
await
this
.
createYzMerchant
(
params
);
// return this.returnjson(0, "success", {
// contractId: entcontract.id
// });
}
return
this
.
returnjson
(
-
1
,
tt
.
message
||
"签约失败"
,
tt
.
code
);
}
returnjson
(
code
,
msg
,
data
)
{
return
{
code
:
code
,
...
...
bpo-web/app/base/service/impl/utilesignbaoSve.js
View file @
c1215861
...
...
@@ -5,6 +5,10 @@ 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
()
{
...
...
@@ -1005,6 +1009,23 @@ class UtilESignBaoService {
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-web/app/config/localsettings.js
View file @
c1215861
...
...
@@ -6,13 +6,17 @@ var settings = {
db
:
11
,
},
database
:
{
dbname
:
"bpo"
,
dbname
:
"bpo
2
"
,
user
:
"write"
,
password
:
"write"
,
config
:
{
host
:
'192.168.18.237'
,
dialect
:
'mysql'
,
operatorsAliases
:
false
,
host
:
'43.247.184.35'
,
port
:
8899
,
// host: '192.168.18.237',
// port: 3306,
pool
:
{
max
:
5
,
min
:
0
,
...
...
bpo-web/package-lock.json
View file @
c1215861
...
...
@@ -333,6 +333,14 @@
"resolved"
:
"https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz"
,
"integrity"
:
"sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w=="
},
"axios"
:
{
"version"
:
"0.19.2"
,
"resolved"
:
"https://registry.npmjs.org/axios/-/axios-0.19.2.tgz"
,
"integrity"
:
"sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA=="
,
"requires"
:
{
"follow-redirects"
:
"1.5.10"
}
},
"babel-helper-vue-jsx-merge-props"
:
{
"version"
:
"2.0.3"
,
"resolved"
:
"https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz"
,
...
...
@@ -1611,6 +1619,24 @@
}
}
},
"follow-redirects"
:
{
"version"
:
"1.5.10"
,
"resolved"
:
"https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz"
,
"integrity"
:
"sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ=="
,
"requires"
:
{
"debug"
:
"=3.1.0"
},
"dependencies"
:
{
"debug"
:
{
"version"
:
"3.1.0"
,
"resolved"
:
"https://registry.npmjs.org/debug/-/debug-3.1.0.tgz"
,
"integrity"
:
"sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g=="
,
"requires"
:
{
"ms"
:
"2.0.0"
}
}
}
},
"forever-agent"
:
{
"version"
:
"0.6.1"
,
"resolved"
:
"https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"
,
...
...
@@ -1947,11 +1973,6 @@
"resolved"
:
"https://registry.npmjs.org/is-bluebird/-/is-bluebird-1.0.2.tgz"
,
"integrity"
:
"sha1-CWQ5Bg9KpBGr7hkUOoTWpVNG1uI="
},
"is-buffer"
:
{
"version"
:
"1.1.6"
,
"resolved"
:
"https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz"
,
"integrity"
:
"sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
},
"is-builtin-module"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz"
,
...
...
@@ -2255,16 +2276,6 @@
"es5-ext"
:
"~0.10.2"
}
},
"md5"
:
{
"version"
:
"2.2.1"
,
"resolved"
:
"https://registry.npmjs.org/md5/-/md5-2.2.1.tgz"
,
"integrity"
:
"sha1-U6s41f48iJG6RlMp6iP6wFQBJvk="
,
"requires"
:
{
"charenc"
:
"~0.0.1"
,
"crypt"
:
"~0.0.1"
,
"is-buffer"
:
"~1.1.1"
}
},
"media-typer"
:
{
"version"
:
"0.3.0"
,
"resolved"
:
"https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz"
,
...
...
@@ -4285,7 +4296,6 @@
"resolved"
:
"https://registry.npmjs.org/wx-pay/-/wx-pay-1.0.2.tgz"
,
"integrity"
:
"sha1-rhQqFRQ0yjgKgDffgytl3f9JdQQ="
,
"requires"
:
{
"md5"
:
"^2.0.0"
,
"request"
:
"^2.54.0"
,
"xml2js"
:
"^0.4.6"
}
...
...
bpo-web/package.json
View file @
c1215861
...
...
@@ -11,6 +11,7 @@
"dependencies"
:
{
"
after
"
:
"^0.8.2"
,
"
ali-oss
"
:
"^4.12.2"
,
"
axios
"
:
"^0.19.2"
,
"
babel-polyfill
"
:
"^6.26.0"
,
"
base64id
"
:
"^1.0.0"
,
"
bluebird
"
:
"^3.5.1"
,
...
...
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