cnf
2025-03-05 4998d0e8529e8cd369ee2285809ba60e8b982ad4
已修改8个文件
65 ■■■■■ 文件已修改
MES.Service/bin/Debug/net8.0/MES.Service.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/bin/Debug/net8.0/MES.Service.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/Controllers/PLM/PLMController.cs 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MES.Service.dll 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MES.Service.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.dll 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.exe 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/bin/Debug/net8.0/MES.Service.dll
Binary files differ
MES.Service/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
MESApplication/Controllers/PLM/PLMController.cs
@@ -37,6 +37,71 @@
        }
    }
    //RetrieveImageFile  调取上传到服务器的拍摄文件
    [HttpGet("GetImageNames")]
    public IActionResult GetImageNames(string releaseNo)
    {
        // 拼接本地文件系统路径
        string basePath = @"D:\MES_FTP\IQC\"; // 服务器D盘下的基础路径
        string folderPath = Path.Combine(basePath, releaseNo); // 动态拼接单号对应的文件夹路径
        // 检查文件夹是否存在
        if (!Directory.Exists(folderPath))
        {
            return NotFound($"文件夹 {folderPath} 不存在。请检查路径是否正确。");
        }
        // 获取文件夹中的所有图片文件名称
        string[] imageExtensions = { ".jpg", ".jpeg", ".png", ".gif", ".bmp" };
        // 获取文件的完整路径,并返回一个包含文件名和完整路径的对象
        var imageFiles = Directory.GetFiles(folderPath)
            .Where(file => imageExtensions.Any(ext => file.ToLower().EndsWith(ext)))
            .Select(file => new
            {
                FileName = Path.GetFileName(file), // 文件名
                FilePath = file,
                FileBasePath = ConvertFileToBase64(file) // 文件的 Base64 数据 // 文件的完整路径
            });
        return Ok(new { success = true, data = imageFiles });
    }
    private string ConvertFileToBase64(string filePath)
    {
        byte[] fileBytes = System.IO.File.ReadAllBytes(filePath);
        return Convert.ToBase64String(fileBytes);
    }
    [HttpDelete("DeleteImageFile")]
    public IActionResult DeleteImageFile([FromQuery] string filePath)
    {
        // 检查文件路径是否为空
        if (string.IsNullOrWhiteSpace(filePath))
        {
            return BadRequest("文件路径不能为空");
        }
        // 确保路径是绝对路径(可以根据需要调整)
        filePath = Path.GetFullPath(filePath);
        // 检查文件是否存在
        if (!System.IO.File.Exists(filePath))
        {
            return NotFound("文件不存在");
        }
        try
        {
            // 删除文件
            System.IO.File.Delete(filePath);
            return Ok("文件删除成功");
        }
        catch (System.Exception ex)
        {
            // 捕获异常并返回错误信息
            return StatusCode(500, $"删除文件时发生错误: {ex.Message}");
        }
    }
    //RetrieveDrawings  调取图纸
    [HttpPost("OpenDrawings")]
    public IActionResult OpenDrawings(string fileId,string fName)
MESApplication/bin/Debug/net8.0/MES.Service.dll
Binary files differ
MESApplication/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
MESApplication/bin/Debug/net8.0/MESApplication.dll
Binary files differ
MESApplication/bin/Debug/net8.0/MESApplication.exe
Binary files differ
MESApplication/bin/Debug/net8.0/MESApplication.pdb
Binary files differ