Parcourir la source

Merge branch 'dev' of http://113.31.163.91:7777/quanshu/mp-server into dev

guanglong il y a 3 ans
Parent
commit
6d9262ab88

+ 3 - 1
mp-admin/src/main/java/com/qs/mp/web/controller/api/channel/ChannelMoneyController.java

@@ -60,7 +60,9 @@ public class ChannelMoneyController extends BaseApiController {
     for (ChannelMoneyLogVO logVO : channelMoneyLogVOS) {
       if (logVO.getType() == ChannelMoneyEnum.WITHDRAW) {
         ChannelWithdraw channelWithdraw = channelWithdrawService.getById(logVO.getRefId());
-        logVO.setWithdrawStatus(channelWithdraw.getStatus());
+        if (null != channelWithdraw) {
+          logVO.setWithdrawStatus(channelWithdraw.getStatus());
+        }
       }
     }
     TableDataInfo resp = getDataTable(list);

+ 9 - 2
mp-admin/src/main/java/com/qs/mp/web/controller/api/user/UserExchangeController.java

@@ -1,5 +1,6 @@
 package com.qs.mp.web.controller.api.user;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.qs.mp.admin.domain.Goods;
@@ -72,10 +73,16 @@ public class UserExchangeController extends BaseApiController {
    */
   @PostMapping("/goods/list")
   @ApiOperation(value = "商品列表" , notes = "获取所有可兑换商品")
-  public TableDataInfo list(@RequestBody Goods goods) {
+  public TableDataInfo list(@RequestBody JSONObject param) {
+    Long categoryId = param.getLong("categoryId");
+    Integer startPrice = param.getInteger("startPrice");
+    Integer endPrice = param.getInteger("endPrice");
+
     startPage();
     List<Goods> goodsList = goodsService.list(new LambdaQueryWrapper<Goods>()
-        .eq(null != goods.getCategoryId() && 0 != goods.getCategoryId(), Goods::getCategoryId, goods.getCategoryId())
+        .eq(null != categoryId && 0 != categoryId, Goods::getCategoryId, categoryId)
+        .ge(null != startPrice && 0 != startPrice, Goods::getExchangePrice, startPrice)
+        .le(null != endPrice && 0 != endPrice, Goods::getExchangePrice, endPrice)
         .eq(Goods::getStatus, GoodsStatusEnum.PUT_ON)
         .eq(Goods::getExchangeShow, 1));
     List<GoodsListVO> goodsListVOList = mapperFacade.mapAsList(goodsList, GoodsListVO.class);