1.库存排序
This commit is contained in:
@@ -12,7 +12,7 @@ public class StockQueryDto {
|
|||||||
private Double num;
|
private Double num;
|
||||||
private Integer isStock;
|
private Integer isStock;
|
||||||
private String categoryId;
|
private String categoryId;
|
||||||
private boolean sort;
|
private String sort;
|
||||||
|
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
if (StringUtils.isNotBlank(name)) {
|
if (StringUtils.isNotBlank(name)) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.ysk.cashier.service.impl.productimpl;
|
package cn.ysk.cashier.service.impl.productimpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.ysk.cashier.dto.product.OutAndOnDto;
|
import cn.ysk.cashier.dto.product.OutAndOnDto;
|
||||||
import cn.ysk.cashier.dto.product.StockQueryDto;
|
import cn.ysk.cashier.dto.product.StockQueryDto;
|
||||||
import cn.ysk.cashier.dto.product.TbProductDto;
|
import cn.ysk.cashier.dto.product.TbProductDto;
|
||||||
@@ -73,7 +74,7 @@ public class StockServiceImpl implements StockService {
|
|||||||
@Override
|
@Override
|
||||||
public Page queryAllV2(StockQueryDto criteria, Integer page, Integer size) {
|
public Page queryAllV2(StockQueryDto criteria, Integer page, Integer size) {
|
||||||
Pageable pageable = PageRequest.of(page, size);
|
Pageable pageable = PageRequest.of(page, size);
|
||||||
if (criteria.isSort()) {
|
if (StrUtil.isNotBlank(criteria.getSort()) && Boolean.parseBoolean(criteria.getSort())) {
|
||||||
return tbProductSkuRepository.searchProStockV2ByDesc(criteria.getShopId(), criteria.getName(), criteria.getIsStock(), criteria.getCategoryId(), pageable);
|
return tbProductSkuRepository.searchProStockV2ByDesc(criteria.getShopId(), criteria.getName(), criteria.getIsStock(), criteria.getCategoryId(), pageable);
|
||||||
}
|
}
|
||||||
return tbProductSkuRepository.searchProStockV2(criteria.getShopId(), criteria.getName(), criteria.getIsStock(), criteria.getCategoryId(), pageable);
|
return tbProductSkuRepository.searchProStockV2(criteria.getShopId(), criteria.getName(), criteria.getIsStock(), criteria.getCategoryId(), pageable);
|
||||||
|
|||||||
Reference in New Issue
Block a user