111
cnf
2025-02-19 9f7ba7872cbaab50a470f4df822621fbcd28d0e3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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;
 
 
[ApiController]
[Route("api/PLM")]
public class PLMController : ControllerBase
{
    private readonly PLMManager m = new();
    private readonly WarehouseDownloadDoc wdd = new();
 
    //RetrieveDrawings  调取图纸
    [HttpPost("RetrieveDrawings")]
    public ResponseResult RetrieveDrawings(string ItemNo)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos = m.RetrieveDrawings(ItemNo);
 
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            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
            });
        }
    }
}