Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
enterprise-platform
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
赵啸非
enterprise-platform
Commits
08cb86d9
Commit
08cb86d9
authored
Dec 26, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改测试bug
parent
06abac86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductServiceImpl.java
...s/xhx/module/product/service/impl/ProductServiceImpl.java
+4
-0
No files found.
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductServiceImpl.java
View file @
08cb86d9
...
@@ -72,6 +72,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
...
@@ -72,6 +72,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getCategoryId
())
&&
ObjectUtils
.
isEmpty
(
entity
.
getCompanyId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getCategoryId
())
&&
ObjectUtils
.
isEmpty
(
entity
.
getCompanyId
()))
{
Result
<
ProductCategoryEntity
>
productCategoryResult
=
productCategoryService
.
find
(
new
ProductCategoryQuery
().
categoryId
(
Long
.
parseLong
(
entity
.
getCategoryId
())),
pageInfo
,
context
);
Result
<
ProductCategoryEntity
>
productCategoryResult
=
productCategoryService
.
find
(
new
ProductCategoryQuery
().
categoryId
(
Long
.
parseLong
(
entity
.
getCategoryId
())),
pageInfo
,
context
);
List
<
ProductEntity
>
productList
=
getProductEntitiesByCategory
(
entity
,
productCategoryResult
);
List
<
ProductEntity
>
productList
=
getProductEntitiesByCategory
(
entity
,
productCategoryResult
);
productList
=
productList
.
stream
().
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
hot
))
{
if
(!
ObjectUtils
.
isEmpty
(
hot
))
{
//过滤热门与非热门
//过滤热门与非热门
productList
=
productList
.
stream
().
filter
(
f
->
f
.
getHot
()
==
hot
).
collect
(
Collectors
.
toList
());
productList
=
productList
.
stream
().
filter
(
f
->
f
.
getHot
()
==
hot
).
collect
(
Collectors
.
toList
());
...
@@ -88,6 +89,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
...
@@ -88,6 +89,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
Result
<
CompanyProductEntity
>
companyProductEntityResult
=
companyProductService
.
find
(
new
CompanyProductQuery
().
companyId
(
Long
.
parseLong
(
entity
.
getCompanyId
())),
pageInfo
,
context
);
Result
<
CompanyProductEntity
>
companyProductEntityResult
=
companyProductService
.
find
(
new
CompanyProductQuery
().
companyId
(
Long
.
parseLong
(
entity
.
getCompanyId
())),
pageInfo
,
context
);
List
<
CompanyProductEntity
>
companyProducList
=
companyProductEntityResult
.
getList
();
List
<
CompanyProductEntity
>
companyProducList
=
companyProductEntityResult
.
getList
();
List
<
ProductEntity
>
productList
=
getProductEntitiesByCompanyId
(
entity
,
companyProducList
);
List
<
ProductEntity
>
productList
=
getProductEntitiesByCompanyId
(
entity
,
companyProducList
);
productList
=
productList
.
stream
().
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
hot
))
{
if
(!
ObjectUtils
.
isEmpty
(
hot
))
{
//过滤热门与非热门
//过滤热门与非热门
productList
=
productList
.
stream
().
filter
(
f
->
f
.
getHot
()
==
hot
).
collect
(
Collectors
.
toList
());
productList
=
productList
.
stream
().
filter
(
f
->
f
.
getHot
()
==
hot
).
collect
(
Collectors
.
toList
());
...
@@ -109,6 +111,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
...
@@ -109,6 +111,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
//求2个list的交集
//求2个list的交集
List
<
ProductEntity
>
collect
=
CollUtil
.
intersection
(
productCategoryList
,
productCompanyList
).
stream
().
collect
(
Collectors
.
toList
());
List
<
ProductEntity
>
collect
=
CollUtil
.
intersection
(
productCategoryList
,
productCompanyList
).
stream
().
collect
(
Collectors
.
toList
());
collect
=
collect
.
stream
().
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
hot
))
{
if
(!
ObjectUtils
.
isEmpty
(
hot
))
{
//过滤热门与非热门
//过滤热门与非热门
collect
=
collect
.
stream
().
filter
(
f
->
f
.
getHot
()
==
hot
).
collect
(
Collectors
.
toList
());
collect
=
collect
.
stream
().
filter
(
f
->
f
.
getHot
()
==
hot
).
collect
(
Collectors
.
toList
());
...
@@ -158,6 +161,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
...
@@ -158,6 +161,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
}
}
});
});
}
}
productList
=
productList
.
stream
().
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
productList
=
productList
.
stream
().
filter
(
f
->
f
.
getShelves
()
==
1
).
collect
(
Collectors
.
toList
());
productList
=
productList
.
stream
().
filter
(
f
->
f
.
getShelves
()
==
1
).
collect
(
Collectors
.
toList
());
productList
=
productList
.
stream
().
sorted
(
Comparator
.
comparing
(
ProductEntity:
:
getPublishTime
).
reversed
())
productList
=
productList
.
stream
().
sorted
(
Comparator
.
comparing
(
ProductEntity:
:
getPublishTime
).
reversed
())
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
...
...
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