111
cnf
2025-02-19 9f7ba7872cbaab50a470f4df822621fbcd28d0e3
MESApplication/Controllers/PLM/PLMController.cs
@@ -1,7 +1,9 @@
using MES.Service.service.PLM;
using ConsoleApp1;
using MES.Service.service.PLM;
using MES.Service.util;
using Microsoft.AspNetCore.Mvc;
using System.Dynamic;
using System.IO;
namespace MESApplication.Controllers.PLM;
@@ -11,6 +13,7 @@
public class PLMController : ControllerBase
{
    private readonly PLMManager m = new();
    private readonly WarehouseDownloadDoc wdd = new();
    //RetrieveDrawings  调取图纸
    [HttpPost("RetrieveDrawings")]
@@ -33,4 +36,25 @@
            return ResponseResult.ResponseError(ex);
        }
    }
    //RetrieveDrawings  调取图纸
    [HttpPost("OpenDrawings")]
    public IActionResult OpenDrawings(string fileId,string fName)
    {
        try
        {
            var resultInfos = wdd.SendRequest("Download", fileId);
            return File(resultInfos, "application/octet-stream", fName);
        }
        catch (Exception ex)
        {
            return StatusCode(500, new ResponseResult
            {
                status = 1,
                message = ex.Message,
                data = null
            });
        }
    }
}