From bd961491fb449a92e7c357376073e138f99c5a29 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 09 十一月 2026 12:15:22 +0800
Subject: [PATCH] refactor(seal): 重构用印管理与申请模块并优化交互体验

---
 yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/pd/seal/PdSealServiceTest.java |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/pd/seal/PdSealServiceTest.java b/yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/pd/seal/PdSealServiceTest.java
index 02fb810..388383d 100644
--- a/yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/pd/seal/PdSealServiceTest.java
+++ b/yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/pd/seal/PdSealServiceTest.java
@@ -34,6 +34,21 @@
         when(tasks.getTaskListByProcessInstanceId("p",true)).thenReturn(List.of(task));
         assertThrows(ServiceException.class, () -> service.download(1,7));
     }
+    @Test void allowsManualApprovalByApplicant() throws Exception {
+        var buffer = new ByteArrayOutputStream();
+        try (var zip = new ZipOutputStream(buffer)) {
+            zip.putNextEntry(new ZipEntry("word/media/seal.png"));
+            zip.write(new byte[]{1});
+            zip.closeEntry();
+        }
+        when(jdbc.queryForList(anyString(), any(Object[].class))).thenReturn(List.of(Map.of(
+                "process_instance_id", "p", "document_snapshot", buffer.toByteArray(), "seal_image", new byte[]{2})));
+        HistoricTaskInstance task = mock(HistoricTaskInstance.class);
+        when(task.getAssignee()).thenReturn("7");
+        when(task.getTaskLocalVariables()).thenReturn(Map.of("TASK_STATUS", 2, "TASK_REASON", ""));
+        when(tasks.getTaskListByProcessInstanceId("p", true)).thenReturn(List.of(task));
+        assertNotNull(service.download(1, 7));
+    }
     @Test void approvedDownloadEmbedsSelectedImage() throws Exception {
         var buffer=new ByteArrayOutputStream();
         try(var zip=new ZipOutputStream(buffer)){zip.putNextEntry(new ZipEntry("word/media/seal.png"));zip.write(new byte[]{1});zip.closeEntry();}

--
Gitblit v1.9.3