From 9265065bea5a40bcaced67857cb3ba22324ce06c Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 09 十一月 2026 13:28:31 +0800
Subject: [PATCH] feat(seal): 实现印章编辑与删除功能及优化上传组件

---
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pd/seal/PdSealController.java |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pd/seal/PdSealController.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pd/seal/PdSealController.java
index 4ad968d..7ed8c85 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pd/seal/PdSealController.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pd/seal/PdSealController.java
@@ -20,10 +20,22 @@
     @Resource private MesPdProjectController projectController;
     @GetMapping("/list") @PreAuthorize("@ss.hasPermission('mes:pd-seal:manage')")
     public CommonResult<List<Map<String,Object>>> list(){ return success(service.seals(false)); }
+    @GetMapping("/image") @PreAuthorize("@ss.hasPermission('mes:pd-seal:manage')")
+    public void image(@RequestParam long id, HttpServletResponse response) throws java.io.IOException {
+        byte[] image = service.getImage(id);
+        response.setContentType("image/png");
+        response.setHeader("Cache-Control", "no-store, private");
+        response.setHeader("X-Content-Type-Options", "nosniff");
+        response.getOutputStream().write(image);
+    }
     @GetMapping("/available") @PreAuthorize("@ss.hasPermission('mes:pd-project:export')")
     public CommonResult<List<Map<String,Object>>> available(){ return success(service.seals(true)); }
     @PostMapping("/upload") @PreAuthorize("@ss.hasPermission('mes:pd-seal:manage')")
     public CommonResult<Long> upload(@RequestParam String name,@RequestParam MultipartFile file) throws Exception { return success(service.upload(name,file,getLoginUserId())); }
+    @PutMapping("/update") @PreAuthorize("@ss.hasPermission('mes:pd-seal:manage')")
+    public CommonResult<Boolean> update(@RequestParam long id,@RequestParam String name,@RequestParam(required=false) MultipartFile file) throws Exception { service.update(id,name,file); return success(true); }
+    @DeleteMapping("/delete") @PreAuthorize("@ss.hasPermission('mes:pd-seal:manage')")
+    public CommonResult<Boolean> delete(@RequestParam long id){ service.delete(id); return success(true); }
     @PutMapping("/enabled") @PreAuthorize("@ss.hasPermission('mes:pd-seal:manage')")
     public CommonResult<Boolean> enabled(@RequestParam long id,@RequestParam boolean enabled){service.setEnabled(id,enabled);return success(true);}
     public record ApplyReq(Long projectId, Long sealId, String reason) {}

--
Gitblit v1.9.3