gaoluyang
9 天以前 ae2892132b50a1796941fb8d8aa82927d8ae1fcf
yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/controller/admin/supplier/SrmSupplierController.java
@@ -76,7 +76,7 @@
    }
    @GetMapping("/simple-list")
    @Operation(summary = "获取供应商精简列表(仅返回已通过准入审批的供应商)")
    @Operation(summary = "获取供应商精简列表(返回启用状态的供应商档案)")
    public CommonResult<List<SrmSupplierRespVO>> getSupplierSimpleList() {
        List<SrmSupplierDO> list = supplierService.getSupplierSimpleList();
        return success(BeanUtils.toBean(list, SrmSupplierRespVO.class));
@@ -101,6 +101,8 @@
            SrmSupplierExcelVO excelVO = BeanUtils.toBean(supplier, SrmSupplierExcelVO.class);
            excelVO.setType(toTypeLabel(supplier.getType()));
            excelVO.setStatus(toStatusLabel(supplier.getStatus()));
            excelVO.setOnlineStatusLabel(toOnlineStatusLabel(supplier.getOnlineStatus()));
            excelVO.setPurchaseCategoryLabel(toPurchaseCategoryLabel(supplier.getPurchaseCategory()));
            excelList.add(excelVO);
        }
        ExcelUtils.write(response, "供应商数据.xlsx", "供应商", SrmSupplierExcelVO.class, excelList);
@@ -161,6 +163,20 @@
    /**
     * 状态 0 启用 / 1 禁用 -> 中文文案;空值返回空
     */
    private static String toPurchaseCategoryLabel(Integer purchaseCategory) {
        if (purchaseCategory == null || purchaseCategory == 0) {
            return "未分类";
        }
        return purchaseCategory == 2 ? "原辅料" : "代理商品";
    }
    private static String toOnlineStatusLabel(Integer onlineStatus) {
        if (onlineStatus == null) {
            return "在线";
        }
        return onlineStatus == 2 ? "离线" : "在线";
    }
    private static String toStatusLabel(Integer status) {
        if (status == null) {
            return null;