change 4 жил өмнө
parent
commit
4fe2279751

+ 7 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/order/OrderController.java

@@ -6,6 +6,8 @@ import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
 import com.zhongzheng.common.utils.SecurityUtils;
+import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.framework.web.service.WxTokenService;
 import com.zhongzheng.modules.order.bo.OrderAddBo;
 import com.zhongzheng.modules.order.bo.OrderEditBo;
 import com.zhongzheng.modules.order.bo.OrderGoodsQueryBo;
@@ -15,6 +17,7 @@ import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderListVo;
 import com.zhongzheng.modules.order.vo.OrderVo;
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
@@ -40,6 +43,8 @@ public class OrderController extends BaseController {
 
     private final IOrderGoodsService iOrderGoodsService;
 
+    private final WxTokenService wxTokenService;
+
     /**
      * 查询订单列表
      */
@@ -47,6 +52,8 @@ public class OrderController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<OrderListVo> list(OrderQueryBo bo) {
         startPage();
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
         List<OrderListVo> list = iOrderService.selectList(bo);
         return getDataTable(list);
     }

+ 3 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderMapper.xml

@@ -128,6 +128,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="goodsType != null">
             AND g.goods_type = #{goodsType}
         </if>
+        <if test="userId != null">
+            AND u.user_id = #{userId}
+        </if>
         ORDER BY o.order_id DESC
     </select>