From 3d558e1bb5091b76a6525f6fab015574e1755200 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期二, 09 九月 2025 18:27:30 +0800
Subject: [PATCH] 确认单下载增加容错
---
blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/controller/FlowMgrController.java | 38 ++++++++++++++------------------------
1 files changed, 14 insertions(+), 24 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 ae9ad8b..ee7bdf9 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
@@ -31,9 +31,6 @@
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
-import java.io.IOException;
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
@@ -52,8 +49,7 @@
private FlowCommonService flowCommonService;
@Autowired
private HistoryService historyService;
- @Autowired
- private ApproveTableService approveTableService;
+
@Autowired
private ProgramConfirmTableService programConfirmTableService;
@Autowired
@@ -169,24 +165,7 @@
return R.success();
}
- @PostMapping("/export-approve-table")
- @Operation(summary = "瀵煎嚭瀹℃壒琛�", description = "瀵煎嚭瀹℃壒琛╬df")
- public void exportApproveTable(String processInstanceId, HttpServletResponse response) {
- try {
- FlowProgramProperties props = flowCommonService.getProgramPropertiesFromHis(processInstanceId);
- String progName = props.getDrawingNo()+"-"+props.getProcessNo()+"-"+props.getProcessEdition();
- //String filename = URLEncoder.encode("鏁版帶绋嬪簭缂栧埗瀹℃壒鍗�", StandardCharsets.UTF_8)+ DateUtil.format(DateUtil.now(), "yyyyMMddHHmm")+".pdf";
- String filename = UrlUtil.encode("鏁版帶绋嬪簭缂栧埗瀹℃壒鍗�"+progName)+".pdf";
- response.setHeader("Content-Disposition", "attachment; filename="+filename);
- response.setContentType("application/octet-stream");
- approveTableService.exportApproveTable(processInstanceId,response.getOutputStream());
- } catch (Exception e) {
- log.error("瀵煎嚭瀹℃壒琛ㄥ紓甯�", e);
- throw new RuntimeException(e);
- }
-
- }
@PostMapping("/export-confirm-table")
@Operation(summary = "瀵煎嚭纭琛�", description = "瀵煎嚭鏁版帶绋嬪簭纭琛╬df")
@@ -195,11 +174,10 @@
try {
FlowProgramProperties props = flowCommonService.getProgramPropertiesFromHis(processInstanceId);
String progName = props.getDrawingNo()+"-"+props.getProcessNo()+"-"+props.getProcessEdition();
- //String filename = URLEncoder.encode("鏁版帶绋嬪簭缂栧埗瀹℃壒鍗�", StandardCharsets.UTF_8)+ DateUtil.format(DateUtil.now(), "yyyyMMddHHmm")+".pdf";
String filename = UrlUtil.encode("鏁版帶绋嬪簭纭琛�"+progName)+".pdf";
response.setHeader("Content-Disposition", "attachment; filename="+filename);
response.setContentType("application/octet-stream");
- programConfirmTableService.exportConfirmTable(processInstanceId,response.getOutputStream());
+ programConfirmTableService.exportConfirmTable(props,response.getOutputStream());
} catch (Exception e) {
log.error("瀵煎嚭鏁版帶绋嬪簭纭琛╬df寮傚父", e);
throw new RuntimeException(e);
@@ -218,4 +196,16 @@
return R.fail(e.getMessage());
}
}
+
+ @GetMapping("/takeback")
+ @Operation(summary = "缁勯暱鍙栧洖", description = "浠庡叾浠栦换鍔¤妭鐐圭洿鎺ユ挙鍥炲埌缁勯暱娲惧伐鑺傜偣")
+ public R<Void> takeback(String processInstanceId) {
+ try {
+ withdrawService.takeBackToDispatch(processInstanceId);
+ return R.success();
+ }catch(Exception e) {
+ log.error("<UNK>", e);
+ return R.fail(e.getMessage());
+ }
+ }
}
--
Gitblit v1.9.3