luodangjia
2025-02-07 8ffeb751b3a694e8d1cb6a21bec855f6c49b31b6
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -246,7 +246,6 @@
        List<Order> list = orderService.lambdaQuery()
                .eq(Order::getAppUserId, appUserId)
                .eq(null != shopId && -1 != shopId, Order::getShopId, shopId)
                .eq(Order::getDistributionMode, 1)
                .eq(Order::getPayStatus, 2)
                .isNull(Order::getRefundStatus)
                .eq(Order::getDelFlag, 0)
@@ -269,10 +268,7 @@
        return R.ok(list);
    }
    
    @PostMapping("/confirmDelivery")
    @ApiOperation(value = "已发货操作", tags = {"管理后台-订单管理"})
@@ -525,7 +521,7 @@
    /**
     * 导入物流信息
     */
    @GetMapping("/importExpress")
    @PostMapping("/importExpress")
    public R importExpress(@RequestBody String url){
        JSONObject jsonObject = JSONObject.parseObject(url);
        String url2 = jsonObject.getString("url");
@@ -543,6 +539,20 @@
        ExcelUtil<OrderPageListVo> util = new ExcelUtil<OrderPageListVo>(OrderPageListVo.class);
        util.exportExcel(response, list, "订单数据");
    }
    /**
     * 获取用户订单数量
     * @param appUserId
     * @return
     */
    @PostMapping("/getOrderCountByAppUserId")
    public R<Long> getOrderCountByAppUserId(@RequestParam("id") Long appUserId){
        long count = orderService.count(new LambdaQueryWrapper<Order>().eq(Order::getDelFlag, 0)
                .eq(Order::getAppUserId, appUserId).in(Order::getOrderStatus, Arrays.asList(1, 2, 3, 4, 7, 8))
                .eq(Order::getPayStatus, 2));
        return R.ok(count);
    }
}