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
3d281a9b
Commit
3d281a9b
authored
Aug 11, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加验证,去重
parent
9f77482d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
9 deletions
+34
-9
gsb-marketplat/app/base/controller/impl/configmag/maininfoCtl.js
+1
-1
gsb-marketplat/app/base/controller/impl/configmag/puttypeCtl.js
+1
-1
gsb-marketplat/app/base/service/impl/configmag/maininfoSve.js
+17
-4
gsb-marketplat/app/base/service/impl/configmag/puttypeSve.js
+15
-3
No files found.
gsb-marketplat/app/base/controller/impl/configmag/maininfoCtl.js
View file @
3d281a9b
...
@@ -9,7 +9,7 @@ class MainInfoCtl extends CtlBase {
...
@@ -9,7 +9,7 @@ class MainInfoCtl extends CtlBase {
async
create
(
pobj
,
qobj
,
req
)
{
async
create
(
pobj
,
qobj
,
req
)
{
pobj
.
company_id
=
req
&&
req
.
xctx
&&
req
.
xctx
.
companyid
?
req
.
xctx
.
companyid
:
""
;
pobj
.
company_id
=
req
&&
req
.
xctx
&&
req
.
xctx
.
companyid
?
req
.
xctx
.
companyid
:
""
;
const
up
=
await
this
.
service
.
create
(
pobj
);
const
up
=
await
this
.
service
.
create
(
pobj
);
return
system
.
getResult
(
up
)
;
return
up
;
}
}
}
}
module
.
exports
=
MainInfoCtl
;
module
.
exports
=
MainInfoCtl
;
gsb-marketplat/app/base/controller/impl/configmag/puttypeCtl.js
View file @
3d281a9b
...
@@ -9,7 +9,7 @@ class PutTypeCtl extends CtlBase {
...
@@ -9,7 +9,7 @@ class PutTypeCtl extends CtlBase {
async
create
(
pobj
,
qobj
,
req
)
{
async
create
(
pobj
,
qobj
,
req
)
{
pobj
.
company_id
=
req
&&
req
.
xctx
&&
req
.
xctx
.
companyid
?
req
.
xctx
.
companyid
:
""
;
pobj
.
company_id
=
req
&&
req
.
xctx
&&
req
.
xctx
.
companyid
?
req
.
xctx
.
companyid
:
""
;
const
up
=
await
this
.
service
.
create
(
pobj
);
const
up
=
await
this
.
service
.
create
(
pobj
);
return
system
.
getResult
(
up
)
;
return
up
;
}
}
}
}
module
.
exports
=
PutTypeCtl
;
module
.
exports
=
PutTypeCtl
;
gsb-marketplat/app/base/service/impl/configmag/maininfoSve.js
View file @
3d281a9b
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
{
getResultSuccess
}
=
require
(
"../../../system"
);
class
MaininfoService
extends
ServiceBase
{
class
MaininfoService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"configmag"
,
ServiceBase
.
getDaoName
(
MaininfoService
));
super
(
"configmag"
,
ServiceBase
.
getDaoName
(
MaininfoService
));
}
}
async
create
(
pobj
){
async
create
(
pobj
)
{
// var code = await this.getBusUid("main");
if
(
!
pobj
.
name
)
{
// pobj.code = code;
return
system
.
getResultFail
(
-
101
,
'name can not be empty'
);
return
this
.
dao
.
create
(
pobj
);
}
if
(
!
pobj
.
code
)
{
return
system
.
getResultFail
(
-
102
,
'code can not be empty'
);
}
let
whereParams
=
{
code
:
pobj
.
code
,
}
let
searchResult
=
await
this
.
findOne
(
whereParams
,
[]);
if
(
searchResult
)
{
return
system
.
getResultFail
(
-
103
,
'主体参数已存在,请勿重复添加'
);
}
return
system
.
getResultSuccess
(
this
.
dao
.
create
(
pobj
));
}
}
}
}
module
.
exports
=
MaininfoService
;
module
.
exports
=
MaininfoService
;
\ No newline at end of file
gsb-marketplat/app/base/service/impl/configmag/puttypeSve.js
View file @
3d281a9b
...
@@ -7,9 +7,20 @@ class PuttypeService extends ServiceBase {
...
@@ -7,9 +7,20 @@ class PuttypeService extends ServiceBase {
}
}
async
create
(
pobj
){
async
create
(
pobj
){
var
code
=
await
this
.
getBusUid
(
"put"
);
if
(
!
pobj
.
name
)
{
pobj
.
code
=
code
;
return
system
.
getResultFail
(
-
101
,
'name can not be empty'
);
return
this
.
dao
.
create
(
pobj
);
}
if
(
!
pobj
.
code
)
{
return
system
.
getResultFail
(
-
102
,
'code can not be empty'
);
}
let
whereParams
=
{
code
:
pobj
.
code
}
let
searchResult
=
await
this
.
findOne
(
whereParams
,
[]);
if
(
searchResult
)
{
return
system
.
getResultFail
(
-
103
,
'投放方式参数已存在,请勿重复添加'
);
}
return
system
.
getResultSuccess
(
this
.
dao
.
create
(
pobj
));
}
}
}
}
module
.
exports
=
PuttypeService
;
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