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
99143124
Commit
99143124
authored
Aug 18, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aaa
parent
5b691945
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
12 deletions
+61
-12
gsb-marketplat/app/base/controller/impl/template/templateinfoCtl.js
+13
-0
gsb-marketplat/app/base/db/models/template/templateinfo.js
+1
-0
gsb-marketplat/app/base/service/impl/template/templateinfoSve.js
+30
-0
gsb-marketplat/app/base/system.js
+1
-1
gsb-marketplat/app/base/utils/logClient.js
+16
-11
No files found.
gsb-marketplat/app/base/controller/impl/template/templateinfoCtl.js
View file @
99143124
...
...
@@ -33,6 +33,19 @@ class TemplateinfoCtl extends CtlBase {
return
result
;
}
/**
* 根据id获取模板信息
* @param {*} pobj
*/
async
getTemplateInfoById
(
pobj
){
let
result
=
await
this
.
templateinfoSve
.
getTemplateInfoById
(
pobj
);
return
result
;
}
async
setTemplateBusinessId
(
pobj
){
let
result
=
await
this
.
templateinfoSve
.
setTemplateBusinessId
(
pobj
);
return
result
;
}
/**
* 重写保存方法
* @param pobj
* @returns {Promise<void>}
...
...
gsb-marketplat/app/base/db/models/template/templateinfo.js
View file @
99143124
...
...
@@ -16,6 +16,7 @@ module.exports = (db, DataTypes) => {
is_enabled
:
DataTypes
.
INTEGER
,
template_content
:
DataTypes
.
JSON
,
form_id
:
DataTypes
.
INTEGER
,
business_code
:
DataTypes
.
STRING
,
notes
:
DataTypes
.
STRING
,
user_id
:
DataTypes
.
STRING
(
100
),
user_name
:
DataTypes
.
STRING
(
100
),
//user_name 用户名称
...
...
gsb-marketplat/app/base/service/impl/template/templateinfoSve.js
View file @
99143124
...
...
@@ -48,6 +48,36 @@ class TemplateinfoService extends ServiceBase {
});
return
system
.
getResultSuccess
(
templateInfo
);
}
async
getTemplateInfoById
(
pobj
){
var
ab
=
pobj
;
if
(
!
ab
){
return
system
.
getResultFail
(
-
100
,
"参数错误"
);
}
if
(
!
ab
.
id
){
return
system
.
getResultFail
(
-
101
,
"模板ID不能为空"
);
}
var
templateInfo
=
await
this
.
dao
.
model
.
findOne
({
where
:{
id
:
ab
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
(
templateInfo
);
}
async
setTemplateBusinessId
(
pobj
){
var
ab
=
pobj
;
if
(
!
ab
){
return
system
.
getResultFail
(
-
100
,
"参数错误"
);
}
if
(
!
ab
.
id
){
return
system
.
getResultFail
(
-
101
,
"模板ID不能为空"
);
}
if
(
!
ab
.
business_code
){
return
system
.
getResultFail
(
-
102
,
"商品ID不能为空"
);
}
await
this
.
dao
.
update
({
id
:
ab
.
id
,
business_code
:
ab
.
business_code
});
var
templateInfo
=
await
this
.
dao
.
model
.
findOne
({
where
:{
id
:
ab
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
(
templateInfo
);
}
/**
* 根据模板编码获取模板信息(模板调用)
* 编辑模板时使用此接口
...
...
gsb-marketplat/app/base/system.js
View file @
99143124
...
...
@@ -75,7 +75,7 @@ class System {
},
body
:
data
},
function
(
error
,
response
,
body
)
{
rtn
.
statusCode
=
response
.
statusCode
rtn
.
statusCode
=
response
&&
response
.
statusCode
?
response
.
statusCode
:
""
;
if
(
!
error
)
{
if
(
body
)
{
rtn
.
data
=
body
...
...
gsb-marketplat/app/base/utils/logClient.js
View file @
99143124
...
...
@@ -11,18 +11,23 @@ class LogClient {
return
u
;
}
async
log
(
pobj
,
req
,
rtninfo
,
errinfo
)
{
rtninfo
.
requestId
=
this
.
getUUID
()
req
.
params
.
param
=
pobj
//第三个字段应该存公司id
system
.
execLogs
(
settings
.
appname
+
"_"
+
req
.
xctx
.
codetitle
,
req
.
params
,
"_"
+
pobj
.
company_id
+
"_"
,
rtninfo
,
errinfo
).
then
(
res
=>
{
if
(
res
&&
res
.
status
==
1
)
{
console
.
log
(
"log.....success"
)
}
else
{
try
{
rtninfo
.
requestId
=
this
.
getUUID
()
req
.
params
.
param
=
pobj
//第三个字段应该存公司id
system
.
execLogs
(
settings
.
appname
+
"_"
+
req
.
xctx
.
codetitle
,
req
.
params
,
"_"
+
pobj
.
company_id
+
"_"
,
rtninfo
,
errinfo
).
then
(
res
=>
{
if
(
res
&&
res
.
status
==
1
)
{
console
.
log
(
"log.....success"
)
}
else
{
console
.
log
(
"log.....fail"
)
}
}).
catch
(
e
=>
{
console
.
log
(
"log.....fail"
)
}
}).
catch
(
e
=>
{
console
.
log
(
"log.....fail"
)
})
})
}
catch
(
error
)
{
console
.
log
(
error
);
}
}
}
module
.
exports
=
LogClient
;
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