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
b5feb287
Commit
b5feb287
authored
Aug 13, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加图片管理,投放方式,营销主体的修改、删除判断限制
parent
55f7d157
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
3 deletions
+79
-3
gsb-marketplat/app/base/controller/impl/configmag/maininfoCtl.js
+11
-1
gsb-marketplat/app/base/controller/impl/configmag/puttypeCtl.js
+11
-0
gsb-marketplat/app/base/service/impl/configmag/maininfoSve.js
+27
-0
gsb-marketplat/app/base/service/impl/configmag/puttypeSve.js
+30
-2
No files found.
gsb-marketplat/app/base/controller/impl/configmag/maininfoCtl.js
View file @
b5feb287
...
...
@@ -15,7 +15,17 @@ class MainInfoCtl extends CtlBase {
async
refQuery
(
pobj
,
qobj
,
req
)
{
pobj
.
refwhere
.
company_id
=
pobj
.
company_id
;
let
rtn
=
await
this
.
service
.
refQuery
(
pobj
);
return
rtn
return
rtn
;
}
async
update
(
pobj
,
qobj
,
req
)
{
const
up
=
await
this
.
service
.
update
(
pobj
);
return
up
;
}
async
delete
(
pobj
,
qobj
,
req
)
{
const
up
=
await
this
.
service
.
delete
(
pobj
);
return
up
;
}
}
module
.
exports
=
MainInfoCtl
;
gsb-marketplat/app/base/controller/impl/configmag/puttypeCtl.js
View file @
b5feb287
...
...
@@ -6,10 +6,21 @@ class PutTypeCtl extends CtlBase {
constructor
()
{
super
(
"configmag"
,
CtlBase
.
getServiceName
(
PutTypeCtl
));
}
async
create
(
pobj
,
qobj
,
req
)
{
pobj
.
company_id
=
req
&&
req
.
xctx
&&
req
.
xctx
.
companyid
?
req
.
xctx
.
companyid
:
""
;
const
up
=
await
this
.
service
.
create
(
pobj
);
return
up
;
}
async
update
(
pobj
,
qobj
,
req
)
{
const
up
=
await
this
.
service
.
update
(
pobj
);
return
up
;
}
async
delete
(
pobj
,
qobj
,
req
)
{
const
up
=
await
this
.
service
.
delete
(
pobj
);
return
up
;
}
}
module
.
exports
=
PutTypeCtl
;
gsb-marketplat/app/base/service/impl/configmag/maininfoSve.js
View file @
b5feb287
...
...
@@ -23,5 +23,31 @@ class MaininfoService extends ServiceBase {
}
return
system
.
getResultSuccess
(
this
.
dao
.
create
(
pobj
));
}
async
update
(
pobj
)
{
let
whereParams
=
{
lauch_type_code
:
pobj
.
code
}
let
searchResult
=
await
this
.
templateLink
.
findOne
(
whereParams
,
[]);
if
(
searchResult
.
is_enabled
==
1
)
{
return
system
.
getResultFail
(
-
104
,
'该业务正在投放中,不能修改'
);
}
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
pobj
));
}
async
delete
(
pobj
)
{
let
whereParams
=
{
id
:
pobj
.
id
}
let
searchResult
=
await
this
.
findOne
(
whereParams
,
[]);
let
linkWhere
=
{
lauch_type_code
:
searchResult
.
code
}
let
searchLink
=
await
this
.
templateLink
.
findOne
(
linkWhere
,
[]);
if
(
searchLink
.
is_enabled
==
1
)
{
return
system
.
getResultFail
(
-
105
,
'该业务正在投放中,不能删除'
);
}
return
system
.
getResultSuccess
(
this
.
dao
.
delete
(
pobj
));
}
}
module
.
exports
=
MaininfoService
;
\ No newline at end of file
gsb-marketplat/app/base/service/impl/configmag/puttypeSve.js
View file @
b5feb287
...
...
@@ -4,9 +4,10 @@ const settings = require("../../../../config/settings");
class
PuttypeService
extends
ServiceBase
{
constructor
()
{
super
(
"configmag"
,
ServiceBase
.
getDaoName
(
PuttypeService
));
this
.
templateLink
=
system
.
getObject
(
"db.template.templatelinkDao"
);;
}
async
create
(
pobj
){
async
create
(
pobj
)
{
if
(
!
pobj
.
name
)
{
return
system
.
getResultFail
(
-
101
,
'name can not be empty'
);
}
...
...
@@ -22,5 +23,31 @@ class PuttypeService extends ServiceBase {
}
return
system
.
getResultSuccess
(
this
.
dao
.
create
(
pobj
));
}
async
update
(
pobj
)
{
let
whereParams
=
{
lauch_type_code
:
pobj
.
code
}
let
searchResult
=
await
this
.
templateLink
.
findOne
(
whereParams
,
[]);
if
(
searchResult
.
is_enabled
==
1
)
{
return
system
.
getResultFail
(
-
104
,
'该业务正在投放中,不能修改'
);
}
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
pobj
));
}
async
delete
(
pobj
)
{
let
whereParams
=
{
id
:
pobj
.
id
}
let
searchResult
=
await
this
.
findOne
(
whereParams
,
[]);
let
linkWhere
=
{
lauch_type_code
:
searchResult
.
code
}
let
searchLink
=
await
this
.
templateLink
.
findOne
(
linkWhere
,
[]);
if
(
searchLink
.
is_enabled
==
1
)
{
return
system
.
getResultFail
(
-
105
,
'该业务正在投放中,不能删除'
);
}
return
system
.
getResultSuccess
(
this
.
dao
.
delete
(
pobj
));
}
}
module
.
exports
=
PuttypeService
;
\ No newline at end of file
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