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
237f96f9
Commit
237f96f9
authored
Apr 21, 2020
by
zhaoxiqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
5668dd80
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
5 deletions
+37
-5
bpo-web/app/base/api/impl/econtractApi.js
+37
-5
No files found.
bpo-web/app/base/api/impl/econtractApi.js
View file @
237f96f9
...
...
@@ -63,8 +63,8 @@ class EcontractApi {
if
(
!
etemplate
)
{
return
0
;
}
let
errors
=
[];
let
ids
=
[];
for
(
var
name
of
names
)
{
try
{
let
company
=
await
this
.
ecompanySve
.
findOne
({
name
:
name
});
...
...
@@ -73,17 +73,49 @@ class EcontractApi {
continue
;
}
// 创建模板
let
etemplate
=
{
};
await
this
.
etemplateSve
.
create
(
etemplate
);
var
newTemplate
=
{
ecompany_id
:
company
.
id
,
name
:
name
,
ecompanyMainId
:
etemplate
.
ecompanyMainId
,
mainId
:
etemplate
.
mainId
,
nameA
:
etemplate
.
nameA
,
templateid
:
etemplate
.
templateid
,
filekey
:
etemplate
.
filekey
,
//e签宝返回文件key
filepath
:
etemplate
.
filepath
,
//需要在后台补充
placeholderkey
:
etemplate
.
placeholderkey
,
//模板占位信息
isEnabled
:
true
,
};
newTemplate
=
await
this
.
etemplateSve
.
create
(
newTemplate
);
ids
.
push
(
newTemplate
.
id
);
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
console
.
log
(
ids
)
this
.
addqrcodeurl
({
ids
:
ids
});
return
errors
;
}
async
addqrcodeurl
(
obj
){
let
ids
=
obj
.
ids
||
[];
if
(
!
ids
||
ids
.
length
==
0
)
{
return
"no ids"
;
}
for
(
let
id
of
ids
)
{
try
{
var
newTemplate
=
await
this
.
etemplateSve
.
findById
(
id
);
if
(
newTemplate
)
{
var
qrcodeurl
=
await
this
.
wxSve
.
makeQrWithScene
(
"wxf616c0a459d66081"
,
newTemplate
.
id
);
newTemplate
.
qrcodeurl
=
qrcodeurl
;
await
newTemplate
.
save
();
}
}
catch
(
e
)
{
console
.
log
(
e
,
id
,
"addqrcodeurl"
);
}
}
}
async
testpushContract
(
obj
,
req
)
{
var
ids
=
obj
.
ids
||
[];
for
(
var
id
of
ids
)
{
...
...
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