记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
8028267c
Commit
8028267c
authored
Jan 24, 2022
by
zhanggb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~ADMIN:商品分类:+校验;
parent
fdb80c86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
4 deletions
+36
-4
GoblinSelfCategoryAdminController.java
...er/zhengzai/goblin/GoblinSelfCategoryAdminController.java
+36
-4
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/GoblinSelfCategoryAdminController.java
View file @
8028267c
...
...
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Controller;
import
org.springframework.web.bind.annotation.*
;
import
java.time.LocalDateTime
;
import
java.util.Arrays
;
@Api
(
tags
=
"商品分类"
)
@Controller
...
...
@@ -91,11 +92,42 @@ public class GoblinSelfCategoryAdminController extends BaseController {
@PostMapping
(
"addSave"
)
@ResponseBody
public
AjaxResult
addSave
(
GoblinSelfGoodsCategory
selfGoodsCategory
)
{
// TODO: 2022/1/14 zhanggb valid
if
(
selfGoodsCategory
.
getGrade
().
equals
(
"1"
))
{
selfGoodsCategory
.
setCatePid
(
null
);
if
(
StringUtils
.
isBlank
(
selfGoodsCategory
.
getName
()))
{
return
AjaxResult
.
warn
(
"分类名称不能为空"
);
}
String
grade
=
selfGoodsCategory
.
getGrade
();
if
(
StringUtils
.
isBlank
(
grade
))
{
return
AjaxResult
.
warn
(
"分类层级不能为空"
);
}
String
catePid
=
selfGoodsCategory
.
getCatePid
();
if
(!
grade
.
equals
(
"1"
)
&&
StringUtils
.
isBlank
(
catePid
))
{
return
AjaxResult
.
warn
(
"父级分类未指定"
);
}
GoblinSelfGoodsCategory
catePidObj
;
LambdaQueryWrapper
<
GoblinSelfGoodsCategory
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinSelfGoodsCategory
.
class
);
queryWrapper
.
eq
(
GoblinSelfGoodsCategory:
:
getDelFlg
,
"0"
);
switch
(
grade
)
{
case
"1"
:
selfGoodsCategory
.
setCatePid
(
null
);
break
;
case
"2"
:
queryWrapper
.
eq
(
GoblinSelfGoodsCategory:
:
getCateId
,
catePid
).
eq
(
GoblinSelfGoodsCategory:
:
getGrade
,
"1"
);
catePidObj
=
goblinSelfGoodsCategoryService
.
getOne
(
queryWrapper
);
if
(
null
==
catePidObj
)
{
return
AjaxResult
.
warn
(
"父级分类无效"
);
}
break
;
case
"3"
:
queryWrapper
.
eq
(
GoblinSelfGoodsCategory:
:
getCateId
,
catePid
).
eq
(
GoblinSelfGoodsCategory:
:
getGrade
,
"2"
);
catePidObj
=
goblinSelfGoodsCategoryService
.
getOne
(
queryWrapper
);
if
(
null
==
catePidObj
)
{
return
AjaxResult
.
warn
(
"父级分类无效"
);
}
break
;
default
:
return
AjaxResult
.
warn
(
"分类层级无效"
);
}
selfGoodsCategory
.
setCateId
(
IDGenerator
.
nextMilliId2
());
selfGoodsCategory
.
setDelFlg
(
"0"
);
if
(
null
==
selfGoodsCategory
.
getSort
())
{
...
...
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