StandardInterface/MES.Service/Modes/MesQamftp.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
StandardInterface/MES.Service/Modes/QamftpDto.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
StandardInterface/MESApplication/Controllers/AttachmentController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
StandardInterface/MES.Service/Modes/MesQamftp.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,54 @@ using System; using SqlSugar; namespace MES.Service.Modes { [SugarTable("MES_QAMFTP")] public class MesQamftp { [SugarColumn(ColumnName = "ID")] public decimal Id { get; set; } [SugarColumn(ColumnName = "ITEM_NO")] public string ItemNo { get; set; } [SugarColumn(ColumnName = "FTYPE")] public string Ftype { get; set; } [SugarColumn(ColumnName = "FATTACH")] public string Fattach { get; set; } [SugarColumn(ColumnName = "FVERSION")] public string Fversion { get; set; } [SugarColumn(ColumnName = "FDATE")] public string Fdate { get; set; } [SugarColumn(ColumnName = "CREATE_BY")] public string CreateBy { get; set; } [SugarColumn(ColumnName = "CREATE_DATE")] public string CreateDate { get; set; } [SugarColumn(ColumnName = "COMPANY")] public string Company { get; set; } [SugarColumn(ColumnName = "FACTORY")] public string Factory { get; set; } [SugarColumn(ColumnName = "RELEASE_NO")] public string ReleaseNo { get; set; } [SugarColumn(ColumnName = "F_TYPE")] public int? F_type { get; set; } [SugarColumn(ColumnName = "LASTUPDATE_BY")] public string LastupdateBy { get; set; } [SugarColumn(ColumnName = "LASTUPDATE_DATE")] public DateTime? LastupdateDate { get; set; } [SugarColumn(ColumnName = "ITEM_ID")] public decimal? ItemId { get; set; } } } StandardInterface/MES.Service/Modes/QamftpDto.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,23 @@ using System; namespace MES.Service.Modes { public class QamftpDto { public decimal Id { get; set; } public string ItemNo { get; set; } public string Ftype { get; set; } public string Fattach { get; set; } public string Fversion { get; set; } public string Fdate { get; set; } public string CreateBy { get; set; } public string CreateDate { get; set; } public string Company { get; set; } public string Factory { get; set; } public string ReleaseNo { get; set; } public int? F_type { get; set; } public string LastupdateBy { get; set; } public DateTime? LastupdateDate { get; set; } public decimal? ItemId { get; set; } } } StandardInterface/MESApplication/Controllers/AttachmentController.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,32 @@ using Microsoft.AspNetCore.Mvc; using System.IO; namespace MESApplication.Controllers { [ApiController] [Route("Attachment")] public class AttachmentController : ControllerBase { // æ ¹ç®å½ private readonly string ftpRootPath = @"D:\MES_FTP\IQC"; [HttpGet("Download")] public IActionResult Download([FromQuery] string itemNo, [FromQuery] string fileName) { if (string.IsNullOrWhiteSpace(itemNo) || string.IsNullOrWhiteSpace(fileName)) return BadRequest("ç©æç¼ç åæä»¶åä¸è½ä¸ºç©º"); // 鲿¢è·¯å¾ç©¿è¶æ»å» var safeItemNo = Path.GetFileName(itemNo.Trim()); var safeFileName = Path.GetFileName(fileName.Trim()); var filePath = Path.Combine(ftpRootPath, safeItemNo, safeFileName); if (!System.IO.File.Exists(filePath)) return NotFound("æä»¶ä¸åå¨"); var contentType = "application/octet-stream"; return PhysicalFile(filePath, contentType, safeFileName); } } }