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
ba572f4a
Commit
ba572f4a
authored
Mar 25, 2020
by
zhaoxiqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
4c7c2ee2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
8 deletions
+27
-8
bpo-web/app/base/api/impl/yzcontractApi.js
+20
-6
bpo-web/app/base/db/models/enttemplate.js
+3
-0
bpo-web/app/base/service/impl/entcontractSve.js
+4
-2
No files found.
bpo-web/app/base/api/impl/yzcontractApi.js
View file @
ba572f4a
...
@@ -7,14 +7,14 @@ class YZContractApi {
...
@@ -7,14 +7,14 @@ class YZContractApi {
this
.
idcardClient
=
system
.
getObject
(
"util.idcardClient"
);
this
.
idcardClient
=
system
.
getObject
(
"util.idcardClient"
);
this
.
utilesignbaoSve
=
system
.
getObject
(
"service.utilesignbaoSve"
);
this
.
utilesignbaoSve
=
system
.
getObject
(
"service.utilesignbaoSve"
);
this
.
ecompanybusiSve
=
system
.
getObject
(
"service.ecompanybusiSve"
);
this
.
ecompanybusiSve
=
system
.
getObject
(
"service.ecompanybusiSve"
);
this
.
enttemplateSve
=
system
.
getObject
(
"service.enttemplateSve"
);
this
.
econtractSve
=
system
.
getObject
(
"service.econtractSve"
);
this
.
econtractSve
=
system
.
getObject
(
"service.econtractSve"
);
this
.
esettleSve
=
system
.
getObject
(
"service.esettleSve"
);
this
.
esettleSve
=
system
.
getObject
(
"service.esettleSve"
);
this
.
etemplatebusiSve
=
system
.
getObject
(
"service.etemplatebusiSve"
);
this
.
etemplatebusiSve
=
system
.
getObject
(
"service.etemplatebusiSve"
);
this
.
appId
=
"1201869719607517185"
;
//
this.appId = "1201869719607517185";
this
.
key
=
"bee7870e008ab144bf518b70ef91f8ac"
;
//
this.key = "bee7870e008ab144bf518b70ef91f8ac";
}
}
async
syncSignedFile
()
{
async
syncSignedFile
()
{
...
@@ -74,6 +74,11 @@ class YZContractApi {
...
@@ -74,6 +74,11 @@ class YZContractApi {
return
this
.
returnjson
(
-
1
,
"请提供随机码"
)
return
this
.
returnjson
(
-
1
,
"请提供随机码"
)
}
}
var
enttemplate
=
await
this
.
enttemplateSve
.
findById
(
param
.
ecid
);
if
(
!
enttemplate
||
!
enttemplate
.
key
)
{
return
this
.
returnjson
(
1001003
,
"配置信息错误,请联系薪必果人员进行配置"
);
}
// 签名
// 签名
var
signArr
=
[];
var
signArr
=
[];
var
keys
=
Object
.
keys
(
param
).
sort
();
var
keys
=
Object
.
keys
(
param
).
sort
();
...
@@ -85,7 +90,7 @@ class YZContractApi {
...
@@ -85,7 +90,7 @@ class YZContractApi {
}
}
signArr
.
push
(
k
+
"="
+
v
);
signArr
.
push
(
k
+
"="
+
v
);
}
}
var
signStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
this
.
key
;
var
signStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
enttemplate
.
key
;
var
sign
=
md5
(
signStr
).
toUpperCase
();
var
sign
=
md5
(
signStr
).
toUpperCase
();
console
.
log
(
sign
)
console
.
log
(
sign
)
if
(
param
.
sign
!=
sign
)
{
if
(
param
.
sign
!=
sign
)
{
...
@@ -263,13 +268,22 @@ class YZContractApi {
...
@@ -263,13 +268,22 @@ class YZContractApi {
var
merchantId
=
obj
.
merchantId
||
""
;
var
merchantId
=
obj
.
merchantId
||
""
;
var
pageSize
=
20
;
var
pageSize
=
20
;
if
(
!
obj
.
appId
)
{
return
this
.
returnjson
(
-
1
,
"请传入appId"
)
}
var
enttemplate
=
await
this
.
enttemplateSve
.
findOne
({
appid
:
obj
.
appId
});
if
(
!
enttemplate
||
!
enttemplate
.
key
)
{
return
this
.
returnjson
(
1001003
,
"配置信息错误,请联系薪必果人员进行配置"
);
}
var
signArr
=
[];
var
signArr
=
[];
signArr
.
push
(
"appId="
+
this
.
appId
);
signArr
.
push
(
"appId="
+
enttemplate
.
appId
);
signArr
.
push
(
"idNo="
+
idNo
);
signArr
.
push
(
"idNo="
+
idNo
);
signArr
.
push
(
"merchantId="
+
merchantId
);
signArr
.
push
(
"merchantId="
+
merchantId
);
signArr
.
push
(
"nonceStr="
+
nonceStr
);
signArr
.
push
(
"nonceStr="
+
nonceStr
);
signArr
.
push
(
"startId="
+
startId
);
signArr
.
push
(
"startId="
+
startId
);
signArr
.
push
(
"key="
+
this
.
key
);
signArr
.
push
(
"key="
+
enttemplate
.
key
);
var
sign
=
md5
(
signArr
.
join
(
"&"
)).
toUpperCase
();
var
sign
=
md5
(
signArr
.
join
(
"&"
)).
toUpperCase
();
console
.
log
(
sign
);
console
.
log
(
sign
);
if
(
sign
!=
obj
.
sign
)
{
if
(
sign
!=
obj
.
sign
)
{
...
...
bpo-web/app/base/db/models/enttemplate.js
View file @
ba572f4a
...
@@ -6,6 +6,9 @@ module.exports = (db, DataTypes) => {
...
@@ -6,6 +6,9 @@ module.exports = (db, DataTypes) => {
codeurl
:
DataTypes
.
STRING
,
codeurl
:
DataTypes
.
STRING
,
remark
:
DataTypes
.
STRING
,
remark
:
DataTypes
.
STRING
,
templateid
:
DataTypes
.
STRING
,
templateid
:
DataTypes
.
STRING
,
appid
:
DataTypes
.
STRING
,
mcthid
:
DataTypes
.
STRING
,
key
:
DataTypes
.
STRING
,
},{
},{
paranoid
:
true
,
//假的删除
paranoid
:
true
,
//假的删除
underscored
:
true
,
underscored
:
true
,
...
...
bpo-web/app/base/service/impl/entcontractSve.js
View file @
ba572f4a
...
@@ -208,8 +208,8 @@ class EntcontractService extends ServiceBase {
...
@@ -208,8 +208,8 @@ class EntcontractService extends ServiceBase {
async
createYzMerchant
(
params
)
{
async
createYzMerchant
(
params
)
{
var
data
=
{
var
data
=
{
appId
:
"1202849621743763458"
,
appId
:
params
.
toAppId
,
mchtId
:
"1202848945651318786"
,
mchtId
:
params
.
toMcthid
,
type
:
"0"
,
// 类型 0 一般纳税人 1 小规模纳税人
type
:
"0"
,
// 类型 0 一般纳税人 1 小规模纳税人
companyName
:
params
.
merchantName
,
//商户名称
companyName
:
params
.
merchantName
,
//商户名称
mobile
:
params
.
mobile
,
//手机号
mobile
:
params
.
mobile
,
//手机号
...
@@ -667,6 +667,8 @@ class EntcontractService extends ServiceBase {
...
@@ -667,6 +667,8 @@ class EntcontractService extends ServiceBase {
await
entcontract
.
save
();
await
entcontract
.
save
();
params
.
entcontract_id
=
entcontract
.
id
;
params
.
entcontract_id
=
entcontract
.
id
;
// this.syncSign(entcontract.id);
// this.syncSign(entcontract.id);
params
.
toAppId
=
enttemplate
.
appid
;
params
.
toMcthid
=
enttemplate
.
mcthid
;
return
await
this
.
createYzMerchant
(
params
);
return
await
this
.
createYzMerchant
(
params
);
// return this.returnjson(0, "success", {
// return this.returnjson(0, "success", {
// contractId: entcontract.id
// contractId: entcontract.id
...
...
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