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
6950ee5f
Commit
6950ee5f
authored
Nov 07, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页置顶商品
parent
103c3d6f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
...com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
+2
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+5
-5
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
View file @
6950ee5f
...
...
@@ -185,6 +185,7 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
criteria
.
andTypeIn
(
dto
.
getTypeList
());
criteria
.
andStockGreaterThan
(
0
);
criteria
.
andIsDeletedEqualTo
(
false
);
criteria
.
andSortNotEqualTo
(-
100
);
JdbcHelper
.
ifPresent
(
dto
.
getFilterIds
(),
criteria:
:
andIdNotIn
);
// criteria.andIsOnSaleEqualTo(true);
if
(!
CollectionUtils
.
isEmpty
(
dto
.
getIds
()))
{
...
...
@@ -193,6 +194,7 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
orCriteria
.
andTypeIn
(
dto
.
getTypeList
());
orCriteria
.
andStockGreaterThan
(
0
);
orCriteria
.
andIsDeletedEqualTo
(
false
);
criteria
.
andSortNotEqualTo
(-
100
);
// orCriteria.andIsOnSaleEqualTo(true);
}
// supplierItemExample.setOrderByClause(" create_time desc");
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
6950ee5f
...
...
@@ -1273,6 +1273,10 @@ public class SupplierItemServiceImpl implements SupplierItemService {
searchDto
.
setPage
(
1
);
List
<
SupplierItem
>
supplierItemList
=
supplierItemDao
.
findForHomePage
(
searchDto
);
PageInfo
<
SupplierItem
>
pageInfo
=
new
PageInfo
(
supplierItemList
);
SupplierItem
topSupplierItem
=
supplierItemDao
.
findTopItem
();
if
(
topSupplierItem
!=
null
)
{
supplierItemList
.
add
(
0
,
topSupplierItem
);
}
List
<
Long
>
filterItemIds
=
supplierItemList
.
stream
().
map
(
SupplierItem:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
redisUtils
.
hasKey
(
viewKey
))
{
List
<
Long
>
searchItemIds
=
(
List
<
Long
>)
redisUtils
.
get
(
viewKey
);
...
...
@@ -1281,11 +1285,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
}
else
{
redisUtils
.
set
(
viewKey
,
filterItemIds
,
60
*
60
*
2
);
}
//如果是第一页,就加上置顶的商品
SupplierItem
topSupplierItem
=
supplierItemDao
.
findTopItem
();
if
(
topSupplierItem
!=
null
)
{
supplierItemList
.
add
(
0
,
topSupplierItem
);
}
Date
now
=
new
Date
();
supplierItemList
.
forEach
(
supplierItem
->
{
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
...
...
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