From 96b22db20a74963e39e490e94bf969cc60ef1b04 Mon Sep 17 00:00:00 2001 From: cnf <3200815559@qq.com> Date: 星期一, 12 五月 2025 17:45:49 +0800 Subject: [PATCH] 最新 --- StandardInterface/MESApplication/Controllers/PLM/PLMController.cs | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/StandardInterface/MESApplication/Controllers/PLM/PLMController.cs b/StandardInterface/MESApplication/Controllers/PLM/PLMController.cs index 902e37a..ea5a72b 100644 --- a/StandardInterface/MESApplication/Controllers/PLM/PLMController.cs +++ b/StandardInterface/MESApplication/Controllers/PLM/PLMController.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc; using System.Dynamic; using System.IO; +using System.Net.Http.Headers; namespace MESApplication.Controllers.PLM; @@ -122,4 +123,33 @@ }); } } + + //MP-O鍨嬪湀-83070100066鏍峰搧1-83070100068鏍峰搧2.pdf + //e18f53b6-6615-8140-11ee-423d1dd32487 + //RetrieveDrawings 璋冨彇鍥剧焊 get鏂瑰紡 + [HttpGet("OpenDrawingsGet")] + public IActionResult OpenDrawingsGet(string fileId, string fName) + { + try + { + var resultInfos = wdd.SendRequest("Download", fileId); + + // 娣诲姞Content-Disposition鍝嶅簲澶� + var cd = new ContentDispositionHeaderValue("attachment"); + cd.FileNameStar = fName; // 鑷姩澶勭悊缂栫爜 + Response.Headers.Add("Content-Disposition", cd.ToString()); + + return File(resultInfos, "application/octet-stream", fName); + } + catch (Exception ex) + { + return StatusCode(500, new ResponseResult + { + status = 1, + message = ex.Message, + data = null + }); + } + } + } -- Gitblit v1.9.3