gaoluyang
9 天以前 ae2892132b50a1796941fb8d8aa82927d8ae1fcf
yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/controller/admin/supplier/SrmSupplierController.java
@@ -63,7 +63,6 @@
    @GetMapping("/get")
    @Operation(summary = "获取供应商详情")
    @Parameter(name = "id", description = "编号", required = true)
    @PreAuthorize("@ss.hasPermission('srm:supplier:query')")
    public CommonResult<SrmSupplierRespVO> getSupplier(@RequestParam("id") Long id) {
        SrmSupplierDO supplier = supplierService.getSupplier(id);
        return success(BeanUtils.toBean(supplier, SrmSupplierRespVO.class));
@@ -71,14 +70,13 @@
    @GetMapping("/page")
    @Operation(summary = "供应商分页查询")
    @PreAuthorize("@ss.hasPermission('srm:supplier:query')")
    public CommonResult<PageResult<SrmSupplierRespVO>> getSupplierPage(@Valid SrmSupplierPageReqVO pageReqVO) {
        PageResult<SrmSupplierDO> pageResult = supplierService.getSupplierPage(pageReqVO);
        return success(BeanUtils.toBean(pageResult, SrmSupplierRespVO.class));
    }
    @GetMapping("/simple-list")
    @Operation(summary = "获取供应商精简列表(仅返回已通过准入审批的供应商)")
    @Operation(summary = "获取供应商精简列表(返回启用状态的供应商档案)")
    public CommonResult<List<SrmSupplierRespVO>> getSupplierSimpleList() {
        List<SrmSupplierDO> list = supplierService.getSupplierSimpleList();
        return success(BeanUtils.toBean(list, SrmSupplierRespVO.class));
@@ -103,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);
@@ -163,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;