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
c14f1a83
Commit
c14f1a83
authored
Sep 06, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
藏品交换列表随机排序
parent
b19d216b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
1 deletion
+50
-1
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/SupplierItemDao.java
...java/com/wwdz/ch/db/dao/distribution/SupplierItemDao.java
+8
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
...com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
+23
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+19
-1
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/SupplierItemDao.java
View file @
c14f1a83
...
@@ -28,6 +28,14 @@ public interface SupplierItemDao {
...
@@ -28,6 +28,14 @@ public interface SupplierItemDao {
*/
*/
List
<
SupplierItem
>
findListForSort
(
SupplierItemRequestDto
supplierItemRequestDto
);
List
<
SupplierItem
>
findListForSort
(
SupplierItemRequestDto
supplierItemRequestDto
);
/**
* 换藏商品列表,随机排序
* @param supplierItemRequestDto
* @return
*/
List
<
SupplierItem
>
findListForRandomSort
(
SupplierItemRequestDto
supplierItemRequestDto
);
/**
/**
* 查询用户上传的已经售罄的商品
* 查询用户上传的已经售罄的商品
* @param dto
* @param dto
...
...
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/SupplierItemDaoImpl.java
View file @
c14f1a83
...
@@ -76,6 +76,29 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
...
@@ -76,6 +76,29 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
return
supplierItemMapper
.
selectByExampleWithBLOBs
(
supplierItemExample
);
return
supplierItemMapper
.
selectByExampleWithBLOBs
(
supplierItemExample
);
}
}
@Override
public
List
<
SupplierItem
>
findListForRandomSort
(
SupplierItemRequestDto
dto
)
{
SupplierItemExample
supplierItemExample
=
new
SupplierItemExample
();
SupplierItemExample
.
Criteria
criteria
=
supplierItemExample
.
createCriteria
();
JdbcHelper
.
ifPresent
(
dto
.
getCreatorId
(),
criteria:
:
andCreatorIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getId
(),
criteria:
:
andIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getIds
(),
criteria:
:
andIdIn
);
JdbcHelper
.
ifPresent
(
dto
.
getFilterIds
(),
criteria:
:
andIdNotIn
);
if
(
StringUtils
.
hasLength
(
dto
.
getName
()))
{
criteria
.
andNameLike
(
"%"
+
dto
.
getName
()
+
"%"
);
}
JdbcHelper
.
ifPresent
(
dto
.
getType
(),
criteria:
:
andTypeEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getFilterType
(),
criteria:
:
andTypeNotIn
);
JdbcHelper
.
ifPresent
(
dto
.
getStock
(),
criteria:
:
andStockGreaterThan
);
JdbcHelper
.
ifPresent
(
dto
.
getIsOnSale
(),
criteria:
:
andIsOnSaleEqualTo
);
// JdbcHelper.ifPresent(dto.getIsDeleted(), criteria::andIsDeletedEqualTo);
criteria
.
andIsDeletedEqualTo
(
false
);
supplierItemExample
.
setOrderByClause
(
" rand()"
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
return
supplierItemMapper
.
selectByExampleWithBLOBs
(
supplierItemExample
);
}
@Override
@Override
public
List
<
SupplierItem
>
findSellOutList
(
SupplierItemRequestDto
dto
)
{
public
List
<
SupplierItem
>
findSellOutList
(
SupplierItemRequestDto
dto
)
{
SupplierItemExample
supplierItemExample
=
new
SupplierItemExample
();
SupplierItemExample
supplierItemExample
=
new
SupplierItemExample
();
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
c14f1a83
...
@@ -219,8 +219,26 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -219,8 +219,26 @@ public class SupplierItemServiceImpl implements SupplierItemService {
//必须要有官方估价才能展示在交换列表
//必须要有官方估价才能展示在交换列表
dto
.
setOfficialEstimatedPriceNotNull
(
true
);
dto
.
setOfficialEstimatedPriceNotNull
(
true
);
}
}
List
<
SupplierItem
>
supplierItemList
=
supplierItemDao
.
findListForSort
(
dto
);
String
viewKey
=
dto
.
getUserId
()
+
":exchangeItemList"
;
if
(
dto
.
getPage
()
==
1
)
{
if
(
redisUtils
.
hasKey
(
viewKey
))
{
redisUtils
.
delete
(
viewKey
);
}
}
if
(
redisUtils
.
hasKey
(
viewKey
))
{
List
<
Long
>
searchItemIds
=
(
List
<
Long
>)
redisUtils
.
get
(
viewKey
);
dto
.
setFilterIds
(
searchItemIds
);
}
List
<
SupplierItem
>
supplierItemList
=
supplierItemDao
.
findListForRandomSort
(
dto
);
PageInfo
pageInfo
=
new
PageInfo
(
supplierItemList
);
PageInfo
pageInfo
=
new
PageInfo
(
supplierItemList
);
List
<
Long
>
filterItemIds
=
supplierItemList
.
stream
().
map
(
SupplierItem:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
redisUtils
.
hasKey
(
viewKey
))
{
List
<
Long
>
searchItemIds
=
(
List
<
Long
>)
redisUtils
.
get
(
viewKey
);
searchItemIds
.
addAll
(
filterItemIds
);
redisUtils
.
set
(
viewKey
,
searchItemIds
,
60
*
60
*
2
);
}
else
{
redisUtils
.
set
(
viewKey
,
filterItemIds
,
60
*
60
*
2
);
}
for
(
SupplierItem
supplierItem
:
supplierItemList
)
{
for
(
SupplierItem
supplierItem
:
supplierItemList
)
{
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
EntityMapper
.
copyAttribute
(
supplierItem
,
supplierItemVo
);
EntityMapper
.
copyAttribute
(
supplierItem
,
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