From fec1341c1cb8e11cfbe3fa7dfabe447edb72b630 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 27 十月 2026 15:12:43 +0800
Subject: [PATCH] refactor(auth): 移除多个模块中的权限校验注解
---
yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/controller/admin/certificate/SrmSupplierCertificateController.java | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/controller/admin/certificate/SrmSupplierCertificateController.java b/yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/controller/admin/certificate/SrmSupplierCertificateController.java
index 003ed7e..70bd3d6 100644
--- a/yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/controller/admin/certificate/SrmSupplierCertificateController.java
+++ b/yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/controller/admin/certificate/SrmSupplierCertificateController.java
@@ -6,7 +6,9 @@
import cn.iocoder.yudao.module.srm.controller.admin.certificate.vo.*;
import cn.iocoder.yudao.module.srm.dal.dataobject.SrmSupplierDO;
import cn.iocoder.yudao.module.srm.service.certificate.SrmSupplierCertificateService;
+import cn.iocoder.yudao.module.srm.service.certificate.SrmSupplierCertificateServiceImpl;
import cn.iocoder.yudao.module.srm.service.supplier.SrmSupplierService;
+import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -35,6 +37,9 @@
@Resource
private SrmSupplierService supplierService;
+ @Resource
+ private StorageAttachmentApi storageAttachmentApi;
+
@PostMapping("/create")
@Operation(summary = "鍒涘缓璧勮川璇佷功")
@PreAuthorize("@ss.hasPermission('srm:supplier-certificate:create')")
@@ -61,26 +66,25 @@
@GetMapping("/page")
@Operation(summary = "鑾峰彇璧勮川璇佷功鍒嗛〉")
- @PreAuthorize("@ss.hasPermission('srm:supplier-certificate:query')")
public CommonResult<PageResult<SrmSupplierCertificateRespVO>> getCertificatePage(@Valid SrmSupplierCertificatePageReqVO pageReqVO) {
var pageResult = certificateService.getCertificatePage(pageReqVO);
var respList = BeanUtils.toBean(pageResult.getList(), SrmSupplierCertificateRespVO.class);
enrichSupplierNames(respList);
+ enrichAttachments(respList);
return success(new PageResult<>(respList, pageResult.getTotal()));
}
@GetMapping("/list-by-supplier")
@Operation(summary = "鏍规嵁渚涘簲鍟咺D鑾峰彇璧勮川鍒楄〃")
- @PreAuthorize("@ss.hasPermission('srm:supplier-certificate:query')")
public CommonResult<List<SrmSupplierCertificateRespVO>> getListBySupplier(@RequestParam("supplierId") Long supplierId) {
var list = BeanUtils.toBean(certificateService.getCertificateListBySupplierId(supplierId), SrmSupplierCertificateRespVO.class);
enrichSupplierNames(list);
+ enrichAttachments(list);
return success(list);
}
@GetMapping("/expiring-list")
@Operation(summary = "鑾峰彇鍗冲皢鍒版湡鐨勮祫璐ㄥ垪琛紙30澶╁唴锛�")
- @PreAuthorize("@ss.hasPermission('srm:supplier-certificate:query')")
public CommonResult<List<SrmSupplierCertificateRespVO>> getExpiringList() {
var list = BeanUtils.toBean(certificateService.getExpiringCertificates(), SrmSupplierCertificateRespVO.class);
enrichSupplierNames(list);
@@ -89,10 +93,10 @@
@GetMapping("/get")
@Operation(summary = "鑾峰彇璧勮川璇佷功璇︽儏")
- @PreAuthorize("@ss.hasPermission('srm:supplier-certificate:query')")
public CommonResult<SrmSupplierCertificateRespVO> getCertificate(@RequestParam("id") Long id) {
var resp = BeanUtils.toBean(certificateService.getCertificate(id), SrmSupplierCertificateRespVO.class);
enrichSupplierName(resp);
+ enrichAttachments(List.of(resp));
return success(resp);
}
@@ -118,4 +122,10 @@
}
}
+ private void enrichAttachments(List<SrmSupplierCertificateRespVO> list) {
+ if (list == null || list.isEmpty()) return;
+ list.forEach(vo -> vo.setAttachmentList(storageAttachmentApi.listAttachments(
+ SrmSupplierCertificateServiceImpl.CERTIFICATE_RECORD_TYPE, vo.getId())));
+ }
+
}
--
Gitblit v1.9.3