xuhy
2025-08-26 d6116be097a46aa478fc92ee434ffab277b334f1
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -32,6 +32,7 @@
import com.ruoyi.order.vo.*;
import com.ruoyi.other.api.domain.BaseSetting;
import com.ruoyi.other.api.domain.Goods;
import com.ruoyi.other.api.domain.Shop;
import com.ruoyi.other.api.dto.ShopAnalysisDTO;
import com.ruoyi.other.api.feignClient.BaseSettingClient;
import com.ruoyi.other.api.feignClient.ShopClient;
@@ -149,7 +150,7 @@
            @ApiImplicitParam(value = "订单状态", name = "status", required = true, dataType = "int"),
    })
    @GetMapping("/getMyOrderList")
    public TableDataInfo<OrderVO> getMyOrderList(@RequestParam("status") Integer status) {
    public TableDataInfo<OrderVO> getMyOrderList(@RequestParam(value = "status",required = false) Integer status) {
        startPage();
        LoginUser loginUserApplet = tokenService.getLoginUserApplet();
        return getDataTable(orderService.selectOrderListByUserId(status, loginUserApplet.getUserid()));
@@ -675,7 +676,15 @@
                orderExport.setSupplierCostPrice(goods.getShopCost());*/
            }
        });
        List<Shop> data = shopClient.getAllShop().getData();
        // 转化为map
        Map<Integer, Shop> shopMap = data.stream().collect(Collectors.toMap(Shop::getId, shop -> shop));
        for (OrderExport orderExport : orderExportList) {
            Shop shop = shopMap.get(orderExport.getShopId());
            if (shop!=null){
                orderExport.setShopName(shop.getName());
            }
        }
        ExcelUtil<OrderExport> util = new ExcelUtil<OrderExport>(OrderExport.class);
        util.exportExcel(response, orderExportList, "订单数据");
    }