1.库存排序

This commit is contained in:
2024-08-20 14:47:32 +08:00
parent fcfe0a2f53
commit b388b3a044
2 changed files with 3 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ public class StockQueryDto {
private Double num;
private Integer isStock;
private String categoryId;
private boolean sort;
private String sort;
public void setName(String name) {
if (StringUtils.isNotBlank(name)) {

View File

@@ -1,5 +1,6 @@
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.StockQueryDto;
import cn.ysk.cashier.dto.product.TbProductDto;
@@ -73,7 +74,7 @@ public class StockServiceImpl implements StockService {
@Override
public Page queryAllV2(StockQueryDto criteria, Integer page, Integer 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.searchProStockV2(criteria.getShopId(), criteria.getName(), criteria.getIsStock(), criteria.getCategoryId(), pageable);