From e1797a873bf114329f4870062201d388155ef014 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 14 八月 2026 13:39:51 +0800
Subject: [PATCH] refactor(erp): 移除采购来票审核流程并简化业务逻辑

---
 yudao-module-srm/src/main/java/cn/iocoder/yudao/module/srm/controller/admin/certificate/SrmSupplierCertificateController.java |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 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..40d0a03 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;
@@ -34,6 +36,9 @@
 
     @Resource
     private SrmSupplierService supplierService;
+
+    @Resource
+    private StorageAttachmentApi storageAttachmentApi;
 
     @PostMapping("/create")
     @Operation(summary = "鍒涘缓璧勮川璇佷功")
@@ -66,6 +71,7 @@
         var pageResult = certificateService.getCertificatePage(pageReqVO);
         var respList = BeanUtils.toBean(pageResult.getList(), SrmSupplierCertificateRespVO.class);
         enrichSupplierNames(respList);
+        enrichAttachments(respList);
         return success(new PageResult<>(respList, pageResult.getTotal()));
     }
 
@@ -75,6 +81,7 @@
     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);
     }
 
@@ -93,6 +100,7 @@
     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 +126,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