|
@@ -24,6 +24,7 @@ import com.qs.mp.common.core.page.TableDataInfo;
|
|
|
import com.qs.mp.common.enums.ErrorCodeEnum;
|
|
|
import com.qs.mp.common.enums.GoodsStatusEnum;
|
|
|
import com.qs.mp.common.utils.StringUtils;
|
|
|
+import com.qs.mp.user.domain.param.ExchangeGoodsListQueryParam;
|
|
|
import com.qs.mp.user.domain.param.ExchangeOrderParam;
|
|
|
import com.qs.mp.user.service.IUserExchangeOrderService;
|
|
|
import com.qs.mp.utils.SecurityUtils;
|
|
@@ -129,28 +130,22 @@ public class UserExchangeController extends BaseApiController {
|
|
|
@ApiResponses(
|
|
|
@ApiResponse(code = 200, message = "success" , response = GoodsListVO.class)
|
|
|
)
|
|
|
- public TableDataInfo list(@RequestBody JSONObject param) {
|
|
|
- Long categoryId = param.getLong("categoryId");
|
|
|
- String tagIds = param.getString("tagIds");
|
|
|
- Integer startPrice = param.getInteger("startPrice");
|
|
|
- Integer endPrice = param.getInteger("endPrice");
|
|
|
- List<Long> categoryIdList = param.getJSONArray("categoryIdList").toJavaList(Long.class);
|
|
|
- String goodsName = param.getString("goodsName");
|
|
|
+ public TableDataInfo list(@RequestBody ExchangeGoodsListQueryParam param) {
|
|
|
|
|
|
List<Long> goodsIds = new ArrayList<>();
|
|
|
- if (StringUtils.isNotBlank(tagIds)) {
|
|
|
+ if (StringUtils.isNotBlank(param.getTagIds())) {
|
|
|
List<GoodsTagRel> goodsTagRelList = goodsTagRelService.list(
|
|
|
new LambdaQueryWrapper<GoodsTagRel>()
|
|
|
- .in(GoodsTagRel::getTagId, Arrays.asList(tagIds.split(","))));
|
|
|
+ .in(GoodsTagRel::getTagId, Arrays.asList(param.getTagIds().split(","))));
|
|
|
goodsIds = goodsTagRelList.stream().map(GoodsTagRel::getGoodsId).collect(Collectors.toList());
|
|
|
}
|
|
|
startPage();
|
|
|
List<Goods> goodsList = goodsService.list(new LambdaQueryWrapper<Goods>()
|
|
|
- .eq(null != categoryId && 0 != categoryId, Goods::getCategoryId, categoryId)
|
|
|
- .ge(null != startPrice && 0 != startPrice, Goods::getExchangePrice, startPrice)
|
|
|
- .le(null != endPrice && 0 != endPrice, Goods::getExchangePrice, endPrice)
|
|
|
- .in(!CollectionUtils.isEmpty(goodsIds), Goods::getCategoryId, categoryIdList)
|
|
|
- .like(StringUtils.isNotBlank(goodsName), Goods::getTitle, goodsName)
|
|
|
+ .eq(null != param.getCategoryId() && 0 != param.getCategoryId(), Goods::getCategoryId, param.getCategoryIdList())
|
|
|
+ .ge(null != param.getStartPrice() && 0 != param.getStartPrice(), Goods::getExchangePrice, param.getStartPrice())
|
|
|
+ .le(null != param.getEndPrice() && 0 != param.getEndPrice(), Goods::getExchangePrice, param.getEndPrice())
|
|
|
+ .in(!CollectionUtils.isEmpty(param.getCategoryIdList()), Goods::getCategoryId, param.getCategoryIdList())
|
|
|
+ .like(StringUtils.isNotBlank(param.getGoodsName()), Goods::getTitle, param.getGoodsName())
|
|
|
.eq(Goods::getStatus, GoodsStatusEnum.PUT_ON)
|
|
|
.eq(Goods::getExchangeShow, 1)
|
|
|
.in(!CollectionUtils.isEmpty(goodsIds), Goods::getGoodsId, goodsIds)
|