Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
c6a13318
Commit
c6a13318
authored
Sep 07, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询所有叶子类目
parent
78f49de1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
4 deletions
+19
-4
ch-dao/src/main/java/com/wwdz/ch/db/impl/CategoryDaoImpl.java
...ao/src/main/java/com/wwdz/ch/db/impl/CategoryDaoImpl.java
+0
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/request/CategoryRequestDto.java
...ava/com/wwdz/ch/wx/entity/request/CategoryRequestDto.java
+3
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/CategoryServiceImpl.java
...rc/main/java/com/wwdz/ch/wx/impl/CategoryServiceImpl.java
+5
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/CategoryService.java
...src/main/java/com/wwdz/ch/wx/service/CategoryService.java
+2
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/QueryPriceController.java
...rc/main/java/com/wwdz/ch/wx/web/QueryPriceController.java
+7
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxCategoryController.java
...rc/main/java/com/wwdz/ch/wx/web/WxCategoryController.java
+2
-1
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/impl/CategoryDaoImpl.java
View file @
c6a13318
...
@@ -65,8 +65,6 @@ public class CategoryDaoImpl implements CategoryDao {
...
@@ -65,8 +65,6 @@ public class CategoryDaoImpl implements CategoryDao {
return
categoryMapper
.
selectByExample
(
example
);
return
categoryMapper
.
selectByExample
(
example
);
}
}
public
Category
findById
(
Integer
id
)
{
public
Category
findById
(
Integer
id
)
{
return
categoryMapper
.
selectByPrimaryKey
(
id
);
return
categoryMapper
.
selectByPrimaryKey
(
id
);
}
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/request/CategoryRequestDto.java
View file @
c6a13318
...
@@ -3,6 +3,8 @@ package com.wwdz.ch.wx.entity.request;
...
@@ -3,6 +3,8 @@ package com.wwdz.ch.wx.entity.request;
import
com.xxdxxs.entity.Entity
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
@Data
@Data
public
class
CategoryRequestDto
implements
Entity
{
public
class
CategoryRequestDto
implements
Entity
{
private
Integer
id
;
private
Integer
id
;
...
@@ -11,4 +13,5 @@ public class CategoryRequestDto implements Entity {
...
@@ -11,4 +13,5 @@ public class CategoryRequestDto implements Entity {
private
Integer
size
;
private
Integer
size
;
private
String
name
;
private
String
name
;
private
Integer
pid
;
private
Integer
pid
;
private
List
<
Integer
>
pidList
;
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/CategoryServiceImpl.java
View file @
c6a13318
...
@@ -8,7 +8,6 @@ import com.wwdz.ch.db.dto.request.CategorySearchRequestDto;
...
@@ -8,7 +8,6 @@ import com.wwdz.ch.db.dto.request.CategorySearchRequestDto;
import
com.wwdz.ch.wx.entity.TransverseCategory
;
import
com.wwdz.ch.wx.entity.TransverseCategory
;
import
com.wwdz.ch.wx.entity.request.CategoryRequestDto
;
import
com.wwdz.ch.wx.entity.request.CategoryRequestDto
;
import
com.wwdz.ch.wx.entity.vo.CategoryResponseVo
;
import
com.wwdz.ch.wx.entity.vo.CategoryResponseVo
;
import
com.wwdz.ch.wx.entity.vo.CategoryVo
;
import
com.wwdz.ch.wx.entity.vo.TransverseCategoryVo
;
import
com.wwdz.ch.wx.entity.vo.TransverseCategoryVo
;
import
com.wwdz.ch.wx.service.CategoryService
;
import
com.wwdz.ch.wx.service.CategoryService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
...
@@ -45,6 +44,9 @@ public class CategoryServiceImpl implements CategoryService {
...
@@ -45,6 +44,9 @@ public class CategoryServiceImpl implements CategoryService {
public
Result
child
(
CategoryRequestDto
dto
)
{
public
Result
child
(
CategoryRequestDto
dto
)
{
try
{
try
{
logger
.
info
(
"【请求结束】查询子类目成功"
);
logger
.
info
(
"【请求结束】查询子类目成功"
);
if
(!
CollectionUtils
.
isEmpty
(
dto
.
getPidList
()))
{
return
Result
.
success
(
categoryDao
.
queryByPids
(
dto
.
getPidList
()));
}
return
Result
.
success
(
categoryDao
.
queryByPid
(
dto
.
getId
()));
return
Result
.
success
(
categoryDao
.
queryByPid
(
dto
.
getId
()));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询子类目失败"
,
e
);
logger
.
error
(
"查询子类目失败"
,
e
);
...
@@ -208,4 +210,6 @@ public class CategoryServiceImpl implements CategoryService {
...
@@ -208,4 +210,6 @@ public class CategoryServiceImpl implements CategoryService {
}
}
return
Result
.
failed
();
return
Result
.
failed
();
}
}
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/CategoryService.java
View file @
c6a13318
...
@@ -50,4 +50,6 @@ public interface CategoryService {
...
@@ -50,4 +50,6 @@ public interface CategoryService {
* @return
* @return
*/
*/
Result
findCategoryByTransverse
(
CategoryRequestDto
dto
);
Result
findCategoryByTransverse
(
CategoryRequestDto
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/QueryPriceController.java
View file @
c6a13318
...
@@ -57,4 +57,11 @@ public class QueryPriceController {
...
@@ -57,4 +57,11 @@ public class QueryPriceController {
public
Result
findTransverseCategory
(
@RequestBody
CategoryRequestDto
dto
)
{
public
Result
findTransverseCategory
(
@RequestBody
CategoryRequestDto
dto
)
{
return
categoryService
.
findCategoryByTransverse
(
dto
);
return
categoryService
.
findCategoryByTransverse
(
dto
);
}
}
@ApiOperation
(
value
=
"查询所有叶子类目"
)
@PostMapping
(
"/findAllChildCategory"
)
public
Result
findAllChildCategory
(
@RequestBody
CategoryRequestDto
dto
)
{
return
categoryService
.
findCategoryByTransverse
(
dto
);
}
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxCategoryController.java
View file @
c6a13318
...
@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiOperation;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -43,7 +44,7 @@ public class WxCategoryController {
...
@@ -43,7 +44,7 @@ public class WxCategoryController {
@PostMapping
(
value
=
"/child"
)
@PostMapping
(
value
=
"/child"
)
public
Result
child
(
@RequestBody
CategoryRequestDto
dto
)
{
public
Result
child
(
@RequestBody
CategoryRequestDto
dto
)
{
logger
.
info
(
"【请求开始】查询子分类列表,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"【请求开始】查询子分类列表,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
Objects
.
isNull
(
dto
.
getId
()))
{
if
(
Objects
.
isNull
(
dto
.
getId
())
&&
CollectionUtils
.
isEmpty
(
dto
.
getPidList
())
)
{
return
Result
.
failed
(
"分类id不能为空"
);
return
Result
.
failed
(
"分类id不能为空"
);
}
}
return
categoryService
.
child
(
dto
);
return
categoryService
.
child
(
dto
);
...
...
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