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
a80a3f65
Commit
a80a3f65
authored
Sep 11, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/quanku_0914' into quanku_0914
parents
90987c31
c7f577f4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
0 deletions
+49
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/CategoryServiceImpl.java
...rc/main/java/com/wwdz/ch/wx/impl/CategoryServiceImpl.java
+33
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+2
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/CategoryService.java
...src/main/java/com/wwdz/ch/wx/service/CategoryService.java
+8
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxCategoryController.java
...rc/main/java/com/wwdz/ch/wx/web/WxCategoryController.java
+6
-0
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/CategoryServiceImpl.java
View file @
a80a3f65
...
...
@@ -7,6 +7,7 @@ import com.wwdz.ch.db.domain.Category;
import
com.wwdz.ch.db.dto.request.CategorySearchRequestDto
;
import
com.wwdz.ch.wx.entity.TransverseCategory
;
import
com.wwdz.ch.wx.entity.request.CategoryRequestDto
;
import
com.wwdz.ch.wx.entity.vo.AgentTranceResponseVo
;
import
com.wwdz.ch.wx.entity.vo.CategoryResponseVo
;
import
com.wwdz.ch.wx.entity.vo.TransverseCategoryVo
;
import
com.wwdz.ch.wx.service.CategoryService
;
...
...
@@ -129,6 +130,38 @@ public class CategoryServiceImpl implements CategoryService {
}
}
@Override
public
Result
queryPriceFindNames
(
CategoryRequestDto
dto
)
{
if
(
StringUtils
.
isBlank
(
dto
.
getName
()))
{
return
Result
.
success
(
new
ArrayList
<>());
}
try
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
AgentTranceResponseVo
>
resultList
=
new
ArrayList
<>();
CategorySearchRequestDto
categorySearchRequestDto
=
new
CategorySearchRequestDto
();
categorySearchRequestDto
.
setName
(
dto
.
getName
());
List
<
Category
>
list
=
categoryDao
.
listSelective
(
categorySearchRequestDto
);
// 筛选叶子节点
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
Category
category
:
list
)
{
if
(!
categoryDao
.
isExistedChild
(
category
.
getId
()))
{
AgentTranceResponseVo
vo
=
new
AgentTranceResponseVo
();
vo
.
setAgentTraceInfo_
(
""
);
vo
.
setViewType
(
1
);
vo
.
setDetail
(
category
);
resultList
.
add
(
vo
);
}
}
}
map
.
put
(
"list"
,
resultList
);
map
.
put
(
"hasNextPage"
,
false
);
return
Result
.
success
(
map
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"搜索分类失败"
,
e
);
return
Result
.
failed
(
"搜索分类失败"
);
}
}
/**
* 分类列表树形转换
*
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
a80a3f65
...
...
@@ -186,6 +186,8 @@ public class ItemServiceImpl implements ItemService {
List
<
Long
>
itemIds
=
userItemsRelations
.
stream
()
.
map
(
UserItemsRelation:
:
getItemId
).
collect
(
Collectors
.
toList
());
CoinRequestDto
coinRequestDto
=
new
CoinRequestDto
();
coinRequestDto
.
setPage
(
dto
.
getPage
());
coinRequestDto
.
setLimit
(
dto
.
getSize
());
coinRequestDto
.
setIds
(
itemIds
);
// 分页查询
PageInfo
<
Item
>
pageInfo
=
itemDao
.
findPageNotDeleted
(
coinRequestDto
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/CategoryService.java
View file @
a80a3f65
...
...
@@ -43,6 +43,14 @@ public interface CategoryService {
*/
Result
findNames
(
CategoryRequestDto
dto
);
/**
* 按名称搜索模糊匹配返回分类列表(查价)
*
* @param dto
* @return
*/
Result
queryPriceFindNames
(
CategoryRequestDto
dto
);
/**
* 查价页面横向展示类目
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxCategoryController.java
View file @
a80a3f65
...
...
@@ -67,4 +67,10 @@ public class WxCategoryController {
public
Result
findNames
(
@RequestBody
CategoryRequestDto
dto
)
{
return
categoryService
.
findNames
(
dto
);
}
@ApiOperation
(
value
=
"名称模糊联想(查价)"
)
@PostMapping
(
value
=
"/queryPrice/findNames"
)
public
Result
queryPriceFindNames
(
@RequestBody
CategoryRequestDto
dto
)
{
return
categoryService
.
queryPriceFindNames
(
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