Commit 998af54f by fanjiaxin

商品列表检索为空,返回参处理

parent a4573ed8
Pipeline #71667 passed with stages
in 1 minute 4 seconds
...@@ -27,10 +27,7 @@ import org.springframework.util.CollectionUtils; ...@@ -27,10 +27,7 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -130,9 +127,9 @@ public class ProductServiceImpl implements IProductService { ...@@ -130,9 +127,9 @@ public class ProductServiceImpl implements IProductService {
.stream() .stream()
.filter(Objects::nonNull) .filter(Objects::nonNull)
.collect(Collectors.toList()); .collect(Collectors.toList());
pageVO.setList(productList); boolean isEmpty = CollectionUtils.isEmpty(productList);
pageVO.setHasMore(!CollectionUtils.isEmpty(productList) pageVO.setList(isEmpty ? new ArrayList<>(0) : productList);
&& productList.size() >= pageQuery.getPageSize()); pageVO.setHasMore(!isEmpty && productList.size() >= pageQuery.getPageSize());
pageVO.setNextKey(productListVO.getNext_key()); pageVO.setNextKey(productListVO.getNext_key());
} }
log.info("商品列表查询返回:{}", System.currentTimeMillis()); log.info("商品列表查询返回:{}", System.currentTimeMillis());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment