From 61763cc1a182effa7e5535ac72d54a6a56f029eb Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期六, 06 九月 2025 09:52:41 +0800
Subject: [PATCH] word版审批表,确认表

---
 blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/controller/FlowMgrController.java |   54 ++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/controller/FlowMgrController.java b/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/controller/FlowMgrController.java
index 1a1a0aa..89f11f7 100644
--- a/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/controller/FlowMgrController.java
+++ b/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/controller/FlowMgrController.java
@@ -5,22 +5,22 @@
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.mail.MessagingException;
 import jakarta.servlet.http.HttpServletResponse;
 import lombok.extern.slf4j.Slf4j;
 import org.flowable.engine.HistoryService;
-import org.flowable.engine.RuntimeService;
 import org.flowable.engine.TaskService;
 import org.flowable.engine.task.Comment;
 import org.flowable.task.api.history.HistoricTaskInstance;
 import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.mdm.flow.service.ApproveRecordService;
-import org.springblade.mdm.flow.service.ApproveTableService;
-import org.springblade.mdm.flow.service.FlowBusinessService;
+import org.springblade.core.tool.utils.UrlUtil;
+import org.springblade.mdm.flow.service.*;
 import org.springblade.mdm.flow.vo.FlowVO;
 import org.springblade.mdm.flow.vo.OvertimeTaskExcelVO;
 import org.springblade.mdm.flow.vo.TaskTraceVO;
@@ -31,8 +31,6 @@
 import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.web.bind.annotation.*;
 
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
@@ -47,17 +45,19 @@
 	private TaskService taskService;
 	@Autowired
 	private FlowBusinessService businessService;
-
+	@Autowired
+	private FlowCommonService flowCommonService;
 	@Autowired
 	private HistoryService historyService;
+
 	@Autowired
-	private RuntimeService runtimeService;
-	@Autowired
-	private ApproveTableService approveTableService;
-	@Autowired
-	private ApproveRecordService approveRecordService;
+	private ProgramConfirmTableService programConfirmTableService;
 	@Autowired
 	private IUserClient userClient;
+	@Autowired
+	private WIthdrawService withdrawService;
+
+
 	@GetMapping("overtime-list")
 	@ApiOperationSupport(order = 3)
 	@Operation(summary = "瓒呮椂鏌ヨ", description = "鏌ヨ鎵�鏈夎秴鏃朵换鍔�")
@@ -165,21 +165,35 @@
 		return R.success();
 	}
 
-	@PostMapping("/export-approve-table")
-	@Operation(summary = "瀵煎嚭瀹℃壒琛�", description = "瀵煎嚭瀹℃壒琛╡xcel")
-	public void exportApproveTable(String processInstanceId, HttpServletResponse response) {
+
+
+	@PostMapping("/export-confirm-table")
+	@Operation(summary = "瀵煎嚭纭琛�", description = "瀵煎嚭鏁版帶绋嬪簭纭琛╬df")
+	public void exportConfirmTable(String processInstanceId, HttpServletResponse response) {
 
 		try {
-
-			String filename = URLEncoder.encode("鏁版帶绋嬪簭缂栧埗瀹℃壒鍗�", StandardCharsets.UTF_8)+ DateUtil.format(DateUtil.now(), "yyyyMMddHHmm")+".pdf";
-
+			FlowProgramProperties props = flowCommonService.getProgramPropertiesFromHis(processInstanceId);
+			String progName = props.getDrawingNo()+"-"+props.getProcessNo()+"-"+props.getProcessEdition();
+			String filename = UrlUtil.encode("鏁版帶绋嬪簭纭琛�"+progName)+".pdf";
 			response.setHeader("Content-Disposition", "attachment; filename="+filename);
 			response.setContentType("application/octet-stream");
-			approveTableService.exportApproveTable(processInstanceId,response.getOutputStream());
+			programConfirmTableService.exportConfirmTable(props,response.getOutputStream());
 		} catch (Exception e) {
-			log.error("瀵煎嚭瀹℃壒琛ㄥ紓甯�", e);
+			log.error("瀵煎嚭鏁版帶绋嬪簭纭琛╬df寮傚父", e);
 			throw new RuntimeException(e);
 		}
 
 	}
+
+	@GetMapping("/withdraw")
+	@Operation(summary = "鎾ゅ洖浠诲姟", description = "浠庡叾浠栦换鍔¤妭鐐圭洿鎺ユ挙鍥炵紪绋嬪憳鑺傜偣")
+	public R<Void> withdraw(String processInstanceId)  {
+		try {
+			withdrawService.withdraw(processInstanceId);
+			return R.success();
+		}catch(Exception e) {
+			log.error("<UNK>", e);
+			return R.fail(e.getMessage());
+		}
+	}
 }

--
Gitblit v1.9.3