添加获取积分产品列表接口
This commit is contained in:
@ -138,6 +138,11 @@ public class YxStoreProduct extends BaseDomain {
|
||||
private Integer stock;
|
||||
|
||||
|
||||
/** 需要多少积分兑换 */
|
||||
@ApiModelProperty(value = "需要多少积分兑换 只在开启积分兑换时生效")
|
||||
private Integer integral;
|
||||
|
||||
|
||||
/** 状态(0:未上架,1:上架) */
|
||||
@ApiModelProperty(value = "状态(0:未上架,1:上架)")
|
||||
private Integer isShow;
|
||||
|
@ -29,6 +29,9 @@ public class YxStoreProductQueryParam extends QueryParam {
|
||||
@ApiModelProperty(value = "是否新品")
|
||||
private String news;
|
||||
|
||||
@ApiModelProperty(value = "是否积分兑换商品")
|
||||
private Integer isIntegral;
|
||||
|
||||
@ApiModelProperty(value = "价格排序")
|
||||
private String priceOrder;
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package co.yixiang.modules.product.service.dto;
|
||||
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@ -20,4 +21,6 @@ public class ProductResultDto {
|
||||
private Double minCost;
|
||||
|
||||
private Integer stock;
|
||||
|
||||
private Integer minIntegral;
|
||||
}
|
||||
|
@ -60,13 +60,11 @@ import co.yixiang.utils.ShopKeyUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiniu.util.StringUtils;
|
||||
import lombok.val;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -79,8 +77,6 @@ import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static co.yixiang.common.utils.QueryHelpPlus.humpToUnderline;
|
||||
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
@ -237,6 +233,9 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
||||
wrapper.eq(YxStoreProduct::getIsDel, CommonEnum.DEL_STATUS_0.getValue());
|
||||
// wrapper.eq(YxStoreProduct::getIsIntegral, CommonEnum.SHOW_STATUS_1.getValue());
|
||||
|
||||
if(productQueryParam.getIsIntegral()!=null){
|
||||
wrapper.eq(YxStoreProduct::getIsIntegral, productQueryParam.getIsIntegral());
|
||||
}
|
||||
//多字段模糊查询分类搜索
|
||||
if (StrUtil.isNotBlank(productQueryParam.getSid()) &&
|
||||
!ShopConstants.YSHOP_ZERO.equals(productQueryParam.getSid())) {
|
||||
@ -735,6 +734,13 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
||||
.min(Comparator.naturalOrder())
|
||||
.orElse(0d);
|
||||
|
||||
//取最小积分
|
||||
Integer minIntegral = attrs
|
||||
.stream()
|
||||
.map(ProductFormatDto::getIntegral)
|
||||
.min(Comparator.naturalOrder())
|
||||
.orElse(0);
|
||||
|
||||
Double minOtPrice = attrs
|
||||
.stream()
|
||||
.map(ProductFormatDto::getOtPrice)
|
||||
@ -762,6 +768,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
||||
.minOtPrice(minOtPrice)
|
||||
.minCost(minCost)
|
||||
.stock(stock)
|
||||
.minIntegral(minIntegral)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user