Commit 2c9b5e82912a38432be13ae79a8f685c15693ea3
1 parent
934f7a6e
公共池排序bug修复
Showing
1 changed file
with
6 additions
and
5 deletions
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/follow/PoolBizService.java
... | ... | @@ -29,7 +29,6 @@ import org.springframework.beans.BeanUtils; |
29 | 29 | import org.springframework.stereotype.Service; |
30 | 30 | |
31 | 31 | import java.time.LocalDate; |
32 | -import java.time.Period; | |
33 | 32 | import java.util.*; |
34 | 33 | import java.util.stream.Collectors; |
35 | 34 | |
... | ... | @@ -96,7 +95,7 @@ public class PoolBizService { |
96 | 95 | List<Long> custIds = affiliationRecordList.stream().map(AffiliationRecord::getCustomerId).distinct().collect(Collectors.toList()); |
97 | 96 | |
98 | 97 | Page<PublicPool> opage = new Page<>(queryVO.getCurrent(), queryVO.getPageSize()); |
99 | - opage = publicPoolService.page(opage, Wrappers.<PublicPool>lambdaQuery() | |
98 | + LambdaQueryWrapper<PublicPool> queryWrapper = Wrappers.<PublicPool>lambdaQuery() | |
100 | 99 | .eq(PublicPool::getGroupId, queryVO.getGroupId()) |
101 | 100 | .eq(StringUtils.isValid(queryVO.getPlateNo()), PublicPool::getPlateNo, "%" + queryVO.getPlateNo() + "%") |
102 | 101 | .eq(StringUtils.isValid(queryVO.getFrameNo()), PublicPool::getFrameNo, "%" + queryVO.getFrameNo() + "%") |
... | ... | @@ -106,9 +105,11 @@ public class PoolBizService { |
106 | 105 | .eq(Objects.nonNull(queryVO.getSpecId()), PublicPool::getSpecId, queryVO.getSpecId()) |
107 | 106 | .in(CollectionUtils.isNotEmpty(queryVO.getShopIds()), PublicPool::getShopId, queryVO.getShopIds()) |
108 | 107 | .eq(StringUtils.isValid(queryVO.getShopName()), PublicPool::getShopName, "%" + queryVO.getShopName() + "%") |
109 | - .notIn(CollectionUtils.isNotEmpty(custIds), PublicPool::getCustomerId, custIds) | |
110 | - .orderBy(Objects.nonNull(queryVO.getOrder()) && StringUtils.isValid(queryVO.getOrderAtt()), queryVO.getOrder() == 1, PublicPool::getTimes) | |
111 | - ); | |
108 | + .notIn(CollectionUtils.isNotEmpty(custIds), PublicPool::getCustomerId, custIds); | |
109 | + if (Objects.nonNull(queryVO.getOrder()) && StringUtils.isValid(queryVO.getOrderAtt())) { | |
110 | + queryWrapper = queryWrapper.orderBy(true, 1 == queryVO.getOrder(), PublicPool::getTimes); | |
111 | + } | |
112 | + opage = publicPoolService.page(opage, queryWrapper); | |
112 | 113 | AppPageVO<PublicPoolVO> page = AppPageVO.init(queryVO); |
113 | 114 | List<PublicPool> list = opage.getRecords(); |
114 | 115 | page.setTotal(opage.getTotal()); | ... | ... |