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
9f68db8d
Commit
9f68db8d
authored
Oct 09, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改产品分类与公司查询
parent
b801cf94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
20 deletions
+3
-20
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductServiceImpl.java
...s/xhx/module/product/service/impl/ProductServiceImpl.java
+3
-20
No files found.
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductServiceImpl.java
View file @
9f68db8d
...
...
@@ -112,7 +112,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
List
<
ProductEntity
>
productList
=
productCategoryResult
.
getList
().
stream
().
map
(
item
->
{
ProductEntity
productEntity
=
this
.
getCache
(
item
.
getProductId
().
toString
());
if
(!
ObjectUtils
.
isEmpty
(
productEntity
))
{
String
companyIds
=
companyProductService
.
find
(
new
CompanyProductQuery
().
productId
(
productEntity
.
getId
())).
stream
().
map
(
i
->
i
.
get
Product
Id
().
toString
()).
collect
(
Collectors
.
joining
(
","
));
String
companyIds
=
companyProductService
.
find
(
new
CompanyProductQuery
().
productId
(
productEntity
.
getId
())).
stream
().
map
(
i
->
i
.
get
Company
Id
().
toString
()).
collect
(
Collectors
.
joining
(
","
));
productEntity
.
setCompanyId
(
companyIds
);
productEntity
.
setCategoryId
(
entity
.
getCategoryId
());
}
...
...
@@ -124,29 +124,12 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
@Override
protected
void
findAfter
(
ProductEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
ProductEntity
>
list
)
throws
AppException
{
list
.
forEach
(
item
->
{
String
categoryIds
=
productCategoryService
.
find
(
new
ProductCategoryQuery
().
productId
(
item
.
getId
())).
stream
().
map
(
i
->
i
.
getCategoryId
().
toString
()).
collect
(
Collectors
.
joining
(
","
));
String
companyIds
=
companyProductService
.
find
(
new
CompanyProductQuery
().
productId
(
item
.
getId
())).
stream
().
map
(
i
->
i
.
get
ProductId
().
toString
()
).
collect
(
Collectors
.
joining
(
","
));
String
categoryIds
=
productCategoryService
.
find
(
new
ProductCategoryQuery
().
productId
(
item
.
getId
())).
stream
().
map
(
i
->
i
.
getCategoryId
().
toString
()).
distinct
().
collect
(
Collectors
.
joining
(
","
));
String
companyIds
=
companyProductService
.
find
(
new
CompanyProductQuery
().
productId
(
item
.
getId
())).
stream
().
map
(
i
->
i
.
get
CompanyId
().
toString
()).
distinct
(
).
collect
(
Collectors
.
joining
(
","
));
item
.
setCompanyId
(
companyIds
);
item
.
setCategoryId
(
categoryIds
);
});
if
(!
ObjectUtils
.
isEmpty
(
params
.
getCategoryId
()))
{
//种类不为空 删除掉空的
Iterator
<
ProductEntity
>
iterator
=
list
.
iterator
();
while
(
iterator
.
hasNext
())
{
ProductEntity
product
=
iterator
.
next
();
String
categoryIds
=
productCategoryService
.
find
(
new
ProductCategoryQuery
().
productId
(
product
.
getId
())).
stream
().
map
(
i
->
i
.
getCategoryId
().
toString
()).
collect
(
Collectors
.
joining
(
","
));
}
}
if
(!
ObjectUtils
.
isEmpty
(
params
.
getCompanyId
()))
{
//公司查询不为空
}
}
@Override
...
...
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