From e5942452ad33bdbf8b944488385170766c29a38f Mon Sep 17 00:00:00 2001 From: ray Date: Wed, 30 Mar 2022 01:33:54 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=B7=A5=E5=96=AE=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E6=AA=94=E6=A1=88=E4=B8=8A=E5=82=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 37 +- AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs | 11 + .../ViewModels/PCS/WipViewModel.cs | 8 + AMESCoreStudio.Web/Views/PCS/PCS001.cshtml | 8 +- AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml | 718 +++++++++--------- AMESCoreStudio.Web/Views/PCS/PCS003.cshtml | 437 ++++++----- .../Controllers/AMES/WipBoardController.cs | 3 +- .../Controllers/AMES/WipInfoBlobController.cs | 123 +++ .../Controllers/AMES/WipSystemController.cs | 29 +- .../Models/AMES/WipInfoBlob.cs | 82 ++ AMESCoreStudio.WebApi/Models/AMESContext.cs | 6 + 11 files changed, 906 insertions(+), 556 deletions(-) create mode 100644 AMESCoreStudio.WebApi/Controllers/AMES/WipInfoBlobController.cs create mode 100644 AMESCoreStudio.WebApi/Models/AMES/WipInfoBlob.cs diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 765aca44..6d5d5965 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -1502,6 +1502,8 @@ namespace AMESCoreStudio.Web.Controllers model.WipOutfits = await _pcsApi.GetWipOutfitByWipNo(model.wipInfo.WipNO); model.WipSops = await _pcsApi.GetWipSopByWipNo(model.wipInfo.WipNO); + + model.wipInfoBlobs = await _pcsApi.GetWipInfoBlob(model.wipInfo.WipID); } await GetItemsList(); await GetProductType(); @@ -1587,6 +1589,8 @@ namespace AMESCoreStudio.Web.Controllers model.WipOutfits = await _pcsApi.GetWipOutfitByWipNo(model.wipInfo.WipNO); model.WipSops = await _pcsApi.GetWipSopByWipNo(model.wipInfo.WipNO); + + model.wipInfoBlobs = await _pcsApi.GetWipInfoBlob(model.wipInfo.WipID); } await GetItemsList(); await GetProductType(); @@ -1616,7 +1620,7 @@ namespace AMESCoreStudio.Web.Controllers return View(model); } [HttpPost] - public async Task PCS003Async(WipDataViewModel model, string action) + public async Task PCS003Async(WipDataViewModel model, string action, IFormFile formFile) { #region 選單 @@ -1855,6 +1859,37 @@ namespace AMESCoreStudio.Web.Controllers else await _pcsApi.PutWipSop(JsonConvert.SerializeObject(item)); } + + // 檔案上傳 + string FileName = string.Empty; + string NewName = string.Empty; + string FilePath = string.Empty; + + //var fileProvider = _fileServerProvider.GetProvider("/aa"); + //var fileInfo = fileProvider.GetFileInfo("/"); + if (formFile != null) + { + if (formFile.Length > 0) + { + //取得使用者上傳檔案的原始檔名 + FileName = Path.GetFileName(formFile.FileName); + //取原始檔名中的副檔名 + var fileExt = Path.GetExtension(FileName); + //為避免使用者上傳的檔案名稱發生重複,重新給一個亂數名稱 + NewName = Path.GetRandomFileName() + fileExt; + //指定要寫入的路徑、檔名和副檔名 + FilePath = $"\\PDF\\";//本機目錄 + using (var stream = new FileStream(_env.WebRootPath + FilePath + FileName, FileMode.Create)) + { + await formFile.CopyToAsync(stream); + } + + model.wipInfoBlob.WipID = model.wipInfo.WipID; + model.wipInfoBlob.ImageName = FileName; + model.wipInfoBlob.Filepath = FilePath; + result = await _pcsApi.PostWipInfoBlob(JsonConvert.SerializeObject(model.wipInfoBlob)); + } + } } diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index af33c3be..d44b722f 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -989,5 +989,16 @@ namespace AMESCoreStudio.Web ITask> PutWipCheckByPMC([FromBody, RawJsonContent] string model); #endregion + #region WipInfoBlob 工單上傳圖檔資料表 + [WebApiClient.Attributes.HttpPut("api/WipInfoBlob")] + ITask> PutWipInfoBlob([FromBody, RawJsonContent] string model); + + [WebApiClient.Attributes.HttpPost("api/WipInfoBlob")] + ITask> PostWipInfoBlob([FromBody, RawJsonContent] string model); + + [WebApiClient.Attributes.HttpGet("api/WipInfoBlob/{id}")] + ITask> GetWipInfoBlob(int id); + #endregion + } } diff --git a/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs b/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs index 12bf0fea..a72ba312 100644 --- a/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs +++ b/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs @@ -19,6 +19,7 @@ namespace AMESCoreStudio.Web.ViewModels.PCS Outfits = new List(); WipSops = new List(); WipOutfits = new List(); + wipInfoBlobs = new List(); wipMAC = new WipMAC(); wipBarcodeOther = new WipBarcodeOther(); @@ -58,6 +59,8 @@ namespace AMESCoreStudio.Web.ViewModels.PCS public IEnumerable Outfits { get; set; } + public IEnumerable wipInfoBlobs { get; set; } + /// /// /// @@ -77,6 +80,11 @@ namespace AMESCoreStudio.Web.ViewModels.PCS /// 條碼區間設定 /// public WipBarcodeOther wipBarcodeOther { get; set; } + + /// + /// 工單圖檔資料 + /// + public WipInfoBlob wipInfoBlob { get; set; } } public class WipDataViewModel : WipNoDetailViewModel diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml index b54eeafd..f582d5f6 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml @@ -340,11 +340,9 @@
-
- -
- -
+ +
+
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml index 4c17307b..f50af061 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml @@ -148,14 +148,15 @@
  • 工單屬性
  • -
  • 生產流程
  • 序號編碼
  • Keypart組合
  • -
  • 治具組合
  • +
  • 生產流程
  • 板卡-工程資訊
  • 系統-工程資訊
  • -
  • 標籤選項
  • +
  • 治具組合
  • SOP文件
  • +
  • 標籤選項
  • +
  • 上傳檔案
@* 工單屬性sheet *@ @@ -223,129 +224,70 @@
- @* 生產流程sheet *@ + @* 序號編碼sheet *@
+ + + + + + + + + + + @foreach (var index in Model.wipBarcodes) + { + + + + + } + +
+ 起始生產序號 + + 結束生產序號 +
+ @index.StartNO + + @index.EndNO +
+
- +
- + +
+
-
+
+
- -
-
-
- - - - - - - - - - - - @foreach (var index in Model.ruleStations) - { - - - - - - - - } - -
- 生產單位 - - 流程名稱 - - 站別描述 - - 站別順序 - - 站別類型 -
- @index.UnitNoName - - @index.FlowRuleName - - @index.StationDesc - - @index.Sequence - - @index.StationType -
-
- - @* 序號編碼sheet *@ -
- - - - - - - - - - - @foreach (var index in Model.wipBarcodes) - { - - - - - } - -
- 起始生產序號 - - 結束生產序號 -
- @index.StartNO - - @index.EndNO -
-
-
- -
- -
-
-
-
- +
+
+ +
+ +
+
-
+
+ +
-
-
-
- -
- -
-
-
-
- +
+ +
+
-
- -
- -
-
-
- @* Keypart組合sheet *@
@@ -406,278 +348,301 @@
- @* 治具組合sheet *@ + @* 生產流程sheet *@
- - @{ int j = 0;} - - - - - - - - - @foreach (var index in Model.WipOutfits) - { +
+
+ +
+ +
+ +
+
+ +
+
- 設備編碼 - - 設備名稱 - - 生產單位 -
+ - - - + + + + + - j++; - } - -
- - @index.OutfitNo - - @index.PartNo - - @index.UnitNoName - + 生產單位 + + 流程名稱 + + 站別描述 + + 站別順序 + + 站別類型 +
+ + + @foreach (var index in Model.ruleStations) + { + + + @index.UnitNoName + + + @index.FlowRuleName + + + @index.StationDesc + + + @index.Sequence + + + @index.StationType + + + } + + +
+ @* 板卡-工程資訊sheet *@ -
-
-
- -
- -
+
+
+
+ +
+ +
- -
- + +
+ +
-
-
-
- -
- +
+
+ +
+ +
-
- -
- -
- -
-
-
-
- +
+
- +
-
-
- -
- +
+
+ +
+ +
+
-
-
-
- +
+
- - - - - @* - - *@ +
-
- -
- -
- -
-
-
-
- -
- - @**@ -
-
- +
+
+
- + + + + + @* + + *@
-
-
-
- -
- +
+ +
+ +
-
-
-
- +
+
+ +
+ + @**@ +
+
+ +
+ +
+
- -
-
-
- + +
+
- - +
-
-
- -
- +
+
+ +
+
+ +
+ +
+
+
+ +
+ + +
+
-
-
-
- -
- +
+ +
+
-
-
- -
- +
+
+ +
+ +
+
-
-
-
- +
+
- +
-
-
- -
- +
+
+ +
+ +
+
-
-
-
- -
- +
+ +
+
-
-
- -
- +
+
+ +
+ +
+
-
-
-
-
- -
- - -
+
+ +
+
-
- -
- - +
+ +
+
+
+ +
+ + +
-
-
- -
- - +
+ +
+ + +
+
+
+ +
+ + +
-
-
- -
- +
+ +
+ +
-
-
-
- -
- - +
+
+ +
+ + +
-
-
- -
- +
+ +
+ +
-
-
-
- -
- - +
+
+ +
+ + +
-
-
- -
- +
+ +
+ +
-
@* 系統-工程資訊sheet *@
@@ -844,6 +809,81 @@
+ @* 治具組合sheet *@ +
+ + @{ int j = 0;} + + + + + + + + + @foreach (var index in Model.WipOutfits) + { + + + + + + j++; + } + +
+ 設備編碼 + + 設備名稱 + + 生產單位 +
+ + @index.OutfitNo + + @index.PartNo + + @index.UnitNoName +
+
+ + @* SOP文件 sheet *@ +
+
+ + @{ int l = 0;} + + + + + + + + + + @foreach (var index in Model.WipSops) + { + + + + + + + l++; + } + +
SOP文件敘述檔案路徑SOP類型生產單位
+ + @index.SOPName + + @index.SOPPath + + @index.SOPTypeName + + @index.UnitNoName +
+
+ @* 標籤選項sheet *@
@@ -887,43 +927,33 @@
- @* SOP文件 sheet *@ -
-
- - @{ int l = 0;} - - - - - - - - - - @foreach (var index in Model.WipSops) - { + @* 上傳資料sheet *@ +
+
+
SOP文件敘述檔案路徑SOP類型生產單位
+ - - - - + + - l++; - } - -
- - @index.SOPName - - @index.SOPPath - - @index.SOPTypeName - - @index.UnitNoName - 檔案名稱檔案路徑
-
+ + + @foreach (var index in Model.wipInfoBlobs) + { + + + @index.ImageName + + + @index.Filepath + + + } + + +
+
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index 9eac86f3..ee3790b1 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -162,6 +162,7 @@
  • 治具組合
  • SOP文件
  • 標籤選項
  • +
  • 上傳檔案
  • @* 工單屬性sheet *@ @@ -231,33 +232,48 @@ @* 序號編碼sheet *@
    - - - - - - - - - - - @foreach (var index in Model.wipBarcodes) - { + @* +
    - 起始生產序號 - - 結束生產序號 -
    + - - + + + - } - -
    - @index.StartNO - - @index.EndNO - + 起始生產序號 + + 結束生產序號 +
    + + + @foreach (var index in Model.wipBarcodes) + { + + + @index.StartNO + + + @index.EndNO + + + } + + *@ +
    +
    + +
    + +
    +
    -
    +
    + +
    +
    + +
    +
    +
    @@ -424,238 +440,240 @@
    @* 板卡-工程資訊sheet *@ -
    -
    -
    - -
    - +
    +
    +
    + +
    + +
    + + +
    + +
    +
    - -
    - +
    +
    + +
    + +
    -
    -
    -
    - +
    +
    - +
    -
    -
    - -
    - +
    +
    + +
    + +
    +
    -
    -
    -
    - +
    +
    - +
    -
    -
    - -
    - +
    +
    + +
    + + + + + @* + + *@ +
    +
    -
    -
    -
    - +
    +
    - - - - - @* - - *@ +
    -
    - -
    - -
    - -
    -
    -
    -
    - -
    - - @**@ -
    -
    - -
    - +
    +
    + +
    + + @**@ +
    +
    + +
    + +
    -
    +
    -
    -
    - -
    - +
    + +
    + +
    -
    -
    -
    - - -
    - +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    + + +
    -
    - + +
    +
    - - +
    -
    -
    - -
    - +
    +
    + +
    + +
    +
    -
    -
    -
    - -
    - +
    + +
    +
    -
    -
    - -
    - +
    +
    + +
    + +
    +
    -
    -
    -
    - +
    +
    - +
    -
    -
    - -
    - -
    -
    - -
    -
    - -
    - +
    +
    + +
    + +
    -
    -
    - -
    - +
    + +
    + +
    -
    -
    -
    -
    - -
    - - +
    +
    +
    + +
    + + +
    -
    -
    - -
    - - +
    + +
    + + +
    -
    -
    - -
    - - +
    + +
    + + +
    -
    -
    - -
    - +
    + +
    + +
    -
    -
    -
    - -
    - - +
    +
    + +
    + + +
    -
    -
    - -
    - +
    + +
    + +
    -
    -
    -
    - -
    - - +
    +
    + +
    + + +
    -
    -
    - -
    - +
    + +
    + +
    -
    @* 系統-工程資訊sheet *@
    @@ -1010,6 +1028,45 @@
    + + @* 上傳資料sheet *@ +
    +
    + + + + + + + + + @foreach (var index in Model.wipInfoBlobs) + { + + + + + } + +
    檔案名稱檔案路徑
    + + @index.ImageName + + @index.Filepath +
    +
    +
    +
    + + + +
    +
    +
    diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipBoardController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipBoardController.cs index ff3826fc..e6ddf947 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipBoardController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipBoardController.cs @@ -83,9 +83,10 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES public async Task> PutWipBoard([FromBody] WipBoard wipBoard) { ResultModel result = new ResultModel(); + var wipNo = wipBoard.WipNo; try { - if (GetWipBoard(wipBoard.WipNo).Result.Value != null) + if (_context.WipBoards.Any(e => e.WipNo == wipNo)) { _context.Entry(wipBoard).State = EntityState.Modified; _context.Entry(wipBoard).Property("CreateDate").IsModified = false; diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfoBlobController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfoBlobController.cs new file mode 100644 index 00000000..de114edb --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfoBlobController.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using AMESCoreStudio.WebApi; +using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.WebApi.DTO.AMES; +using AMESCoreStudio.CommonTools.Result; + +namespace AMESCoreStudio.WebApi.Controllers.AMES +{ + /// + /// 工單上傳圖檔資料表 + /// + [Route("api/[controller]")] + [ApiController] + public class WipInfoBlobController : ControllerBase + { + private readonly AMESContext _context; + + public WipInfoBlobController(AMESContext context) + { + _context = context; + } + + // GET: api/WipInfoBlob + [HttpGet] + public async Task>> GetWipInfoBlobs() + { + return await _context.WipInfoBlobs.ToListAsync(); + } + + // GET: api/WipInfoBlob/5 + [HttpGet("{id}")] + public async Task>> GetWipInfoBlob(int id) + { + var wipInfoBlob = await _context.WipInfoBlobs.Where(w => w.WipID == id).ToListAsync(); + return wipInfoBlob; + } + + + + /// + /// 更新工單上傳圖檔資料表 + /// + /// + /// + [HttpPut("{id}")] + public async Task> PutWipInfoBlob(WipInfoBlob wipInfoBlob) + { + ResultModel result = new ResultModel(); + _context.Entry(wipInfoBlob).State = EntityState.Modified; + //設置容器空間某一個模型的某一個欄位 不提交到資料庫 + //DbContent.Entry是要更新到資料庫的整個對象 + _context.Entry(wipInfoBlob).Property("CreateDate").IsModified = false; + _context.Entry(wipInfoBlob).Property("CreateUserID").IsModified = false; + wipInfoBlob.UpdateDate = DateTime.Now; + wipInfoBlob.UpdateUserID = 0; + + try + { + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; + } + catch (Exception ex) + { + result.Success = false; + result.Msg = ex.InnerException.Message; + + } + return result; + } + + /// + /// 新增工單上傳圖檔資料表 + /// + /// + /// + [HttpPost] + public async Task> PostWipInfoBlob(WipInfoBlob wipInfoBlob) + { + ResultModel result = new ResultModel(); + _context.WipInfoBlobs.Add(wipInfoBlob); + try + { + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; + } + catch (Exception ex) + { + result.Success = false; + result.Msg = ex.InnerException.Message; + } + return result; + } + + // DELETE: api/WipInfoBlob/5 + [HttpDelete("{id}")] + public async Task> DeleteWipInfoBlob(int id) + { + var wipInfoBlob = await _context.WipInfoBlobs.FindAsync(id); + if (wipInfoBlob == null) + { + return NotFound(); + } + + _context.WipInfoBlobs.Remove(wipInfoBlob); + await _context.SaveChangesAsync(); + + return wipInfoBlob; + } + + private bool WipInfoBlobExists(int id) + { + return _context.WipInfoBlobs.Any(e => e.WipID == id); + } + } +} diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipSystemController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipSystemController.cs index 1bb3b910..1a74cfa5 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipSystemController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipSystemController.cs @@ -79,23 +79,22 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES public async Task> PutWipSystem([FromBody] WipSystem wipSystem) { ResultModel result = new ResultModel(); - - var getwipSystem = GetWipSystem(wipSystem.WipNo).Result.Value; - if (getwipSystem != null) - { - _context.Entry(wipSystem).State = EntityState.Modified; - _context.Entry(wipSystem).Property("CreateDate").IsModified = false; - _context.Entry(wipSystem).Property("CreateUserID").IsModified = false; - wipSystem.UpdateDate = DateTime.Now; - wipSystem.UpdateUserID = 0; - } - else - { - _context.WipSystems.Add(wipSystem); - } - + var wipNo = wipSystem.WipNo; try { + if (_context.WipSystems.Any(e => e.WipNo == wipNo)) + { + _context.Entry(wipSystem).State = EntityState.Modified; + _context.Entry(wipSystem).Property("CreateDate").IsModified = false; + _context.Entry(wipSystem).Property("CreateUserID").IsModified = false; + wipSystem.UpdateDate = DateTime.Now; + wipSystem.UpdateUserID = 0; + } + else + { + _context.WipSystems.Add(wipSystem); + } + await _context.SaveChangesAsync(); result.Success = true; result.Msg = "OK"; diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipInfoBlob.cs b/AMESCoreStudio.WebApi/Models/AMES/WipInfoBlob.cs new file mode 100644 index 00000000..7e709a1d --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/WipInfoBlob.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; +using System.Runtime.Serialization; +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 工單上傳圖檔資料表 + /// + [Keyless] + [Table("WIP_INFO_BLOB", Schema = "JHAMES")] + public partial class WipInfoBlob + { + /// + /// 工單ID + /// + [Key] + [Column("WIP_ID")] + [DataMember] + public int WipID { get; set; } + + /// + /// 圖檔名稱 + /// + [Key] + [Required] + [Column("IMAGE_NAME")] + [StringLength(50)] + [DataMember] + public string ImageName { get; set; } + + /// + /// 圖檔 + /// + [Column("IMAGE_BLOB", TypeName = "BLOB")] + [DataMember] + public byte[] ImageBlob { get; set; } + + /// + /// 上傳路徑 + /// + [Required] + [Column("FILEPATH")] + [StringLength(100)] + [DataMember] + public string Filepath { get; set; } + + /// + /// 建立UserID + /// + [Column("CREATE_USERID")] + [Required] + [DataMember] + public int CreateUserID { get; set; } = 0; + + /// + /// 建立日期 + /// + [Required] + [Column("CREATE_DATE")] + [DataMember] + public DateTime CreateDate { get; set; } = DateTime.Now; + + /// + /// 更新UserID + /// + [Column("UPDATE_USERID")] + [DataMember] + public int UpdateUserID { get; set; } = 0; + + /// + /// 更新日期 + /// + [Column("UPDATE_DATE")] + [DataMember] + public DateTime? UpdateDate { get; set; } = DateTime.Now; + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMESContext.cs b/AMESCoreStudio.WebApi/Models/AMESContext.cs index 26320fe0..40de7d55 100644 --- a/AMESCoreStudio.WebApi/Models/AMESContext.cs +++ b/AMESCoreStudio.WebApi/Models/AMESContext.cs @@ -46,6 +46,7 @@ namespace AMESCoreStudio.WebApi modelBuilder.Entity().HasKey(c => new { c.WipNO, c.RuleStationID, c.KeyNo }); modelBuilder.Entity().HasKey(c => new { c.WipNO, c.StartNO, c.EndNO }); + modelBuilder.Entity().HasKey(c => new { c.WipID, c.ImageName}); modelBuilder.Entity().HasOne(r => r.B).WithMany().HasForeignKey(r => r.BarcodeID).IsRequired(); modelBuilder.Entity().HasOne(r => r.I).WithMany().HasForeignKey(r => r.ItemNo).IsRequired(); modelBuilder.Entity().HasOne(r => r.S).WithMany().HasForeignKey(r => r.RuleStationID).IsRequired(); @@ -748,6 +749,11 @@ namespace AMESCoreStudio.WebApi /// 工單治具資料檔 /// public virtual DbSet WipOutfits { get; set; } + + /// + /// 工單上傳圖檔資料表 + /// + public virtual DbSet WipInfoBlobs { get; set; } } }