From 6d4d8b48f3d70df918bdced6e8ff6830cb74ca9b Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 18 Aug 2022 18:15:38 +0800 Subject: [PATCH] =?UTF-8?q?1.=20FQC=E7=9B=B8=E9=97=9C=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FQCController.cs | 216 ++++++++++-------- AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs | 11 +- AMESCoreStudio.Web/Views/FQC/FQC007.cshtml | 62 ++++- AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml | 24 +- .../AMES/FqcInhouseDetailController.cs | 83 ++++++- .../AMES/FqcInhouseMasterController.cs | 15 +- .../Controllers/AMES/NGReasonsController.cs | 2 +- AMESCoreStudio.WebApi/DTO/AMES/FQC010VIiew.cs | 33 +++ AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs | 41 ++++ .../DTO/AMES/FqcResultDto.cs | 16 +- AMESCoreStudio.WebApi/Enums/EnumFQC.cs | 19 ++ .../Models/AMES/FqcResultMaster.cs | 27 ++- 12 files changed, 437 insertions(+), 112 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index 45c2cc93..60cf6a4a 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -159,9 +159,9 @@ namespace AMESCoreStudio.Web.Controllers var item = new List(); - for (int i = 0; i < result.Count; i++) + foreach (var items in result.Data) { - item.Add(new SelectListItem(result[i].NGReasonDesc, result[i].NGReasonNo.ToString())); + item.Add(new SelectListItem(items.NGReasonDesc, items.NGReasonNo.ToString())); } //将数据Json化并传到前台视图 return Json(new { data = item }); @@ -209,6 +209,27 @@ namespace AMESCoreStudio.Web.Controllers ViewBag.GetQCItem_TypeSelect = q; } + + /// + /// 抽樣計畫允收標準 + /// + /// + private void GetInspection_TypeSelect(string SelectedValue = null) + { + List values = new List(); + if (SelectedValue != null) + { + values = SelectedValue.Split(',').ToList(); + } + var q = Enum.GetValues(typeof(EnumFQC.EnumInspection_Type)).Cast() + .Select(s => new SelectListItem + { + Text = EnumPCS.GetDisplayName(s).ToString(), + Value = s.ToString() + }).ToList(); + + ViewBag.GetInspection_TypeSelect = q; + } #endregion #region FQC001 檢驗類別維護 @@ -703,6 +724,8 @@ namespace AMESCoreStudio.Web.Controllers #region FQC007 FQC抽驗作業 public async Task FQC007(string inhouseNo = null, int seqID = 0) { + GetInspection_TypeSelect(); + var model = new FqcDto(); if (!string.IsNullOrWhiteSpace(inhouseNo) && seqID != 0) { @@ -731,6 +754,10 @@ namespace AMESCoreStudio.Web.Controllers { model.qcItemDtos = result_QcItem.Data.Where(w => result_WipFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList(); } + + // + var fqcDetail = await _fqcApi.FQC007InhouseDetails(inhouseNo, seqID); + model.fqcResultDetails = fqcDetail.Data.ToList(); } else { @@ -769,6 +796,7 @@ namespace AMESCoreStudio.Web.Controllers result_FQCResultMaster.Supervisor = model.Supervisor; result_FQCResultMaster.Proved = model.Proved; result_FQCResultMaster.OutfitNo = model.OutfitNo; + result_FQCResultMaster.InspectionType = model.InspectionType; await _fqcApi.PutFqcResultMaster(JsonConvert.SerializeObject(result_FQCResultMaster)); ModelState.AddModelError("error", "儲存成功!"); } @@ -889,7 +917,7 @@ namespace AMESCoreStudio.Web.Controllers if (string.IsNullOrWhiteSpace(FqcResultDetail.ExtraBarcodeNo)) { - ModelState.AddModelError("error", "找不到該筆資料的客戶序號"); + ModelState.AddModelError("error", "找不到該筆資料的出貨序號"); return View("FQC007C", model); } #endregion @@ -1025,6 +1053,8 @@ namespace AMESCoreStudio.Web.Controllers fqcResultMaster.UpdateDate = DateTime.Now; fqcResultMaster.SpecialPo = model.SpecialPo; fqcResultMaster.UpdateUserID = GetLogInUserID(); + fqcResultMaster.MajorQty = model.MajorQty; + fqcResultMaster.MinorQty = model.MinorQty; fqcInhouseMaster.Status = model.QaResult; fqcInhouseMaster.UpdateDate = DateTime.Now; @@ -1314,7 +1344,7 @@ namespace AMESCoreStudio.Web.Controllers #endregion #region FQC010 報表 - public ActionResult FQC010() + public async Task FQC010() { string mimeType = ""; int extension = 1; @@ -1323,98 +1353,104 @@ namespace AMESCoreStudio.Web.Controllers Dictionary param = new Dictionary(); System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); System.Text.Encoding.GetEncoding(1252); - var FQC010Master = new FQC010VIiew - { - DefectDescription = "N/A", - InspectionDate = "2022/06/30", - AC = "0", - Approved = "王曉明", - AQL = "2.5", - SpeciallyAdoption = "特採Specially Adoption", - BIOSVer = "2.04A CS:7672H", - ECN = "22N0202", - ECNMemo = "工單生產已是最新ECN", - Factory = "YS00", - FactoryRemark = "N/A", - InspectionInstrumentNumber = "N/A", - InspectionItems = "OS:[Win10 IoT]CPU test:[1.10G] RAM test:[4096]", - InspectionNumber = "Q944000114000001", - InspectionStatus = "廠驗", - InspectionType = "First Insp.", - Inspector = "蔡喬虎", - Judgment = "Defect Quantity", - Line = "安勤產線", - LotSize = "1", - Major = "0", - MedicalModel = "N", - Minor = "1", - Model = "CAXA0-1000A1-S01R", - ModelName = "CAXA0 w/N3350/4G RAM/64G SSD/NFC", - NOTE = @"ACC-M2 + var FQC010Master = new FQC010VIiew(); + IResultModel resultFqcQuery; + resultFqcQuery = _fqcApi.GetFqcQuery("QWO0002A1001").InvokeAsync().Result; + + if (resultFqcQuery.Data.Count() != 0) + { + var FqcQuery = resultFqcQuery.Data.FirstOrDefault(); + FQC010Master = new FQC010VIiew() + { + DefectDescription = "N/A", + InspectionDate = "2022/06/30", + AC = FqcQuery.AcQty.ToString(), + Approved = "王曉明", + AQL = "2.5", + SpeciallyAdoption = "特採Specially Adoption", + BIOSVer = "2.04A CS:7672H", + ECN = "22N0202", + ECNMemo = "工單生產已是最新ECN", + Factory = "YS00", + FactoryRemark = "N/A", + InspectionInstrumentNumber = "N/A", + InspectionItems = "OS:[Win10 IoT]CPU test:[1.10G] RAM test:[4096]", + InspectionNumber = FqcQuery.InhouseNo, + InspectionStatus = "廠驗", + InspectionType = FqcQuery.InspectionTypeName, + Inspector = "蔡喬虎", + Judgment = "Defect Quantity", + Line = "安勤產線", + LotSize = "1", + Major = FqcQuery.MajorQty.ToString(), + MedicalModel = "N", + Minor = FqcQuery.MinorQty.ToString(), + Model = FqcQuery.ItemNo, + ModelName = FqcQuery.ModelNo, + NOTE = @"ACC-M2 E1589 ESW-075R ACC-BAT", - OrderNumber = "9440001400", - Product99 = "一般二級水準正常檢驗", - ReMajor = "1", - Sample = "5", - SamplingInspectionPlan = "ANSI/ASQZ 1.4II", - StorageLocation = "9000", - Avalue = "AVALUE", - VIP = "N", - WaiveRequisition = "XX", - Detail1 = new List{ - new FQC010Detail1 + OrderNumber = FqcQuery.WipNo, + Product99 = "一般二級水準正常檢驗", + ReMajor = FqcQuery.ReQty.ToString(), + Sample = FqcQuery.QcQty.ToString(), + SamplingInspectionPlan = "ANSI/ASQZ 1.4II", + StorageLocation = "9000", + Avalue = "AVALUE", + VIP = FqcQuery.CustomerVIP, + WaiveRequisition = "XX" + }; + + // 抓全部檢驗工項 + var result_QcItem = await _fqcApi.GetQcItemQuery(0, 0, 0); + // 取綁定工單檢驗工項資料 + var result_WipFQC = await _fqcApi.GetWipFqcItemByWipNo(FqcQuery.WipNo); + if (result_WipFQC.Count == 0) { - ItemID = "1", - ItemName = "AA", - ItemType = "Major" - }, - new FQC010Detail1{ - ItemID = "2", - ItemName = "BB", - ItemType = "Major" - }, - new FQC010Detail1{ - ItemID = "2", - ItemName = "BB", - ItemType = "Major" - }, - new FQC010Detail1{ - ItemID = "2", - ItemName = "BB", - ItemType = "Major" - }, - new FQC010Detail1{ - ItemID = "2", - ItemName = "BB", - ItemType = "Major" - }, - new FQC010Detail1{ - ItemID = "2", - ItemName = "BB", - ItemType = "Major" - }, - new FQC010Detail1{ - ItemID = "2", - ItemName = "BB", - ItemType = "Major" - }, - new FQC010Detail1{ - ItemID = "2", - ItemName = "BB", - ItemType = "Major" - }}, - Detail2 = new List + //工單無設定檢驗工項時 在抓料號綁定檢驗工項 + var result_MaterialFQC = await _fqcApi.GetMaterialFqcItemsByitemNo(FqcQuery.ItemNo); + if (result_MaterialFQC.Count != 0) + { + // 檢驗工項 + foreach (var item in result_QcItem.Data.Where(w => result_MaterialFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList()) + { + FQC010Master.Detail1.Add(new FQC010Detail1 + { + ItemID = item.ItemID.ToString(), + ItemName = item.ItemNameCN, + ItemType = item.ItemTypeName + }); + } + } + } + else { - new FQC010Detail2 + // 檢驗工項 + foreach (var item in result_QcItem.Data.Where(w => result_WipFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList()) + { + FQC010Master.Detail1.Add(new FQC010Detail1 + { + ItemID = item.ItemID.ToString(), + ItemName = item.ItemNameCN, + ItemType = item.ItemTypeName + }); + } + } + + // 條碼細項 + var fqcDetail = await _fqcApi.FQC007InhouseDetails(FqcQuery.InhouseNo, Convert.ToInt32(FqcQuery.SeqID)); + foreach (var item in fqcDetail.Data) { - ShippingSerialNumber= "AAAAAAAAAAAAAAAA", - IsSample ="Y", - ProductionSerialNumber = "DASKJDKLFJS", - InspectionResults = "1" - }} - }; + FQC010Master.Detail2.Add(new FQC010Detail2 + { + ProductionSerialNumber = item.BarcodeNo, + ShippingSerialNumber = item.ExtraBarcodeNo, + IsSample = item.IsSample, + InspectionResults = item.StatusNo + }); + } + } var FQC010Masters = new List(); FQC010Masters.Add(FQC010Master); diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs b/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs index d3baeb46..ee45fbae 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IFQC.cs @@ -343,7 +343,7 @@ namespace AMESCoreStudio.Web /// /// [WebApiClient.Attributes.HttpGet("api/NGReasons/Class/{no}")] - ITask> GetNGReasonsByClass(string no , int page = 0, int limit = 1000); + ITask> GetNGReasonsByClass(string no , int page = 0, int limit = 1000); /// /// 用內部序號取BarCode資料 @@ -457,6 +457,15 @@ namespace AMESCoreStudio.Web /// [WebApiClient.Attributes.HttpGet("api/FqcInhouseDetail/FqcInhouseDetailByFQC007V")] ITask> FQC007V(string inhouseNo, int seqID, string boxNo); + + /// + /// FQC 細項資料(全部) + /// + /// 入庫單號 + /// 順序 + /// + [WebApiClient.Attributes.HttpGet("api/FqcInhouseDetail/FqcInhouseDetailByFQC007All")] + ITask> FQC007InhouseDetails(string inhouseNo, int seqID); #endregion #region FQC008 FQC查詢 diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml index eb3b608f..82c1af19 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml @@ -25,15 +25,15 @@ @@ -85,6 +85,14 @@
+
+ +
+
+
+ +
+
@@ -397,6 +405,52 @@
+
+

細項資料(全部)

+
+ + + + + + + + + + + + @foreach (var index in Model.fqcResultDetails) + { + + + + + + + + } + +
生產序號 + 出貨序號 + + 箱號 + + IsSample + + 檢驗結果 +
+ @index.BarcodeNo + + @index.ExtraBarcodeNo + + @index.BoxNo + + @index.IsSample + + @index.StatusNo +
+
+
@Html.ValidationMessage("error") diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml index 51bc91d4..a841270c 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007B.cshtml @@ -62,6 +62,28 @@ +
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
@@ -110,7 +132,7 @@ } $("#Special").hide(); - + }); diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseDetailController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseDetailController.cs index f236eb03..bae309fb 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseDetailController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseDetailController.cs @@ -60,7 +60,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES var fqcResultDto = new List(); var FqcInhouseDetails = await _context.FqcInhouseDetails.Where(w => w.SerialNo == boxNo && w.InhouseNo == inhouseNo && w.SeqID == seqID).FirstOrDefaultAsync(); - + // 取FQC_ID if (FqcInhouseDetails != null) { @@ -71,7 +71,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES BarcodeInfo = await _context.BarcodeInfoes.Where(w => w.BarcodeNo == FqcInhouseDetails.SerialNo).ToListAsync(); // 先塞入資料 - foreach(var item in BarcodeInfo) + foreach (var item in BarcodeInfo) { fqcResultDto.Add(new FqcResultDto { @@ -89,9 +89,9 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES if (FqcResultMaster != null) { var FqcResultDetail = await _context.FqcResultDetails.Where(w => w.FqcID == FqcResultMaster.FqcID).ToListAsync(); - foreach(var item in FqcResultDetail) + foreach (var item in FqcResultDetail) { - foreach(var item2 in fqcResultDto) + foreach (var item2 in fqcResultDto) { if (item.BarcodeNo == item2.BarcodeNo) { @@ -120,6 +120,81 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return result; } + /// + /// FQC細項資料(全部) + /// + /// + [HttpGet("FqcInhouseDetailByFQC007All")] + public async Task> GetFqcInhouseDetailByFQC007All(string inhouseNo, int seqID) + { + ResultModel result = new ResultModel(); + var fqcResultDto = new List(); + var FqcInhouseDetails = await _context.FqcInhouseDetails.Where(w => w.InhouseNo == inhouseNo + && w.SeqID == seqID).ToListAsync(); + + // 取FQC_ID + if (FqcInhouseDetails.Count != 0) + { + foreach (var item in FqcInhouseDetails) + { + var BarcodeInfo = new List(); + if (item.SerialType == "B") + BarcodeInfo = await _context.BarcodeInfoes.Where(w => w.BoxNo == item.SerialNo).ToListAsync(); + else + BarcodeInfo = await _context.BarcodeInfoes.Where(w => w.BarcodeNo == item.SerialNo).ToListAsync(); + + // 先塞入資料 + foreach (var item1 in BarcodeInfo) + { + fqcResultDto.Add(new FqcResultDto + { + BarcodeNo = item1.BarcodeNo, + ExtraBarcodeNo = item1.ExtraBarcodeNo, + BoxNo = item1.BoxNo, + StatusNo = "" + }); + } + + var FqcResultMaster = await _context.FqcResultMasters.Where(w => w.InhouseNo == item.InhouseNo + && w.SeqID == item.SeqID) + .FirstOrDefaultAsync(); + // 取抽驗結果 + if (FqcResultMaster != null) + { + var FqcResultDetail = await _context.FqcResultDetails.Where(w => w.FqcID == FqcResultMaster.FqcID).ToListAsync(); + foreach (var item1 in FqcResultDetail) + { + foreach (var item2 in fqcResultDto) + { + if (item1.BarcodeNo == item2.BarcodeNo) + { + item2.StatusNo = item1.StatusNo == "P" ? "PASS" : "NG"; + item2.NgReasonNo = item1.NgReasonNo; + item2.NgMemo = item1.NgMemo; + item2.IsSample = "Y"; + item2.CreateName = await new Helper(_context).GetUserName(item.CreateUserID); + continue; + } + } + } + } + } + } + + result.Data = fqcResultDto.ToList(); + + if (result == null) + { + result.Msg = "查無資料"; + result.Success = false; + return result; + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + /// /// 新增檢驗單明細資料檔 /// diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs index 1aaf0922..ad0c49b5 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs @@ -9,6 +9,7 @@ using AMESCoreStudio.WebApi; using AMESCoreStudio.WebApi.Models.AMES; using AMESCoreStudio.WebApi.DTO.AMES; using AMESCoreStudio.CommonTools.Result; +using AMESCoreStudio.WebApi.Enum; namespace AMESCoreStudio.WebApi.Controllers.AMES { @@ -94,7 +95,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES /// [HttpGet("FqcInhouseMasterQuery")] public async Task> GetFqcInhouseMasterQuery(string barcodeNo, string wipNo, string boxNo - , string inhouseNo, string date_str, string date_end, string status, string factoryID, int page = 0, int limit = 10) + , string inhouseNo, string date_str, string date_end, string status, string factoryID, int page = 0, int limit = 10) { var q = from q1 in _context.FqcInhouseMasters //join q2 in _context.FqcInhouseDetails on new { q1.InhouseNo, q1.SeqID } equals new { q2.InhouseNo, q2.SeqID } @@ -236,11 +237,21 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES Proved = q2.Proved, Proved_Name = q7.UserName, UpdateUser = q8.UserNo, - UpdateUser_Name = q8.UserName + UpdateUser_Name = q8.UserName, + InspectionType = q2.InspectionType, + MajorQty = q2.MajorQty, + MinorQty = q2.MinorQty, + EndTime = q2.EndTime.ToString() + }; var query = await q.Distinct().ToListAsync(); + query.Select(s => s.InspectionTypeName = + System.Enum.IsDefined(typeof(EnumFQC.EnumInspection_Type), s.InspectionType ?? "") ? + EnumFQC.GetDisplayName((EnumFQC.EnumInspection_Type)System.Enum.Parse(typeof(EnumFQC.EnumInspection_Type), s.InspectionType)) : "") + .ToList(); + var FqcDetail = new List(); if (query.Count() != 0) { diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/NGReasonsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/NGReasonsController.cs index 14b0b1f3..a70ada29 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/NGReasonsController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/NGReasonsController.cs @@ -83,7 +83,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES result.Data = ngReason; - if (ngReason == null) + if (ngReason.Count == 0) { result.Msg = "查無資料"; result.Success = false; diff --git a/AMESCoreStudio.WebApi/DTO/AMES/FQC010VIiew.cs b/AMESCoreStudio.WebApi/DTO/AMES/FQC010VIiew.cs index 8540d29d..f8d748a3 100644 --- a/AMESCoreStudio.WebApi/DTO/AMES/FQC010VIiew.cs +++ b/AMESCoreStudio.WebApi/DTO/AMES/FQC010VIiew.cs @@ -9,6 +9,12 @@ namespace AMESCoreStudio.WebApi.DTO.AMES { public partial class FQC010VIiew { + public FQC010VIiew() + { + Detail1 = new List(); + Detail2 = new List(); + } + /// /// QC編號 /// @@ -140,23 +146,50 @@ namespace AMESCoreStudio.WebApi.DTO.AMES public List Detail2 { get; set; } } + /// + /// 檢驗工項 + /// public partial class FQC010Detail1 { + /// + /// + /// public string ItemID { get; set; } + /// + /// 檢驗工項名稱 + /// public string ItemName { get; set; } + /// + /// 檢驗類型 + /// public string ItemType { get; set; } } + /// + /// 檢驗 + /// public partial class FQC010Detail2 { + /// + /// 出貨序號 + /// public string ShippingSerialNumber { get; set; } + /// + /// 生產序號 + /// public string ProductionSerialNumber { get; set; } + /// + /// 是否抽驗 + /// public string IsSample { get; set; } + /// + /// 檢驗結果 + /// public string InspectionResults { get; set; } } } diff --git a/AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs index ef070ef6..7f1924f0 100644 --- a/AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs +++ b/AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs @@ -20,6 +20,7 @@ namespace AMESCoreStudio.WebApi.DTO.AMES fqcDetails = new List(); fqcResultMasterBlobs = new List(); qcItemDtos = new List(); + fqcResultDetails = new List(); } /// @@ -93,6 +94,13 @@ namespace AMESCoreStudio.WebApi.DTO.AMES public string StatusName { get; set; } + /// + /// 檢驗時間 + /// + [DataMember] + [Display(Name = "檢驗時間")] + public string EndTime { get; set; } + /// /// 抽驗數量 /// @@ -252,6 +260,34 @@ namespace AMESCoreStudio.WebApi.DTO.AMES [DataMember] public string UpdateUser_Name { get; set; } + /// + /// 抽樣允收標準 + /// + [NotMapped] + [DataMember] + public string InspectionType { get; set; } + + /// + /// 抽樣允收標準 名稱 + /// + [NotMapped] + [DataMember] + public string InspectionTypeName { get; set; } + + /// + /// Major Qty + /// + [NotMapped] + [DataMember] + public int MajorQty { get; set; } + + /// + /// Minor Qty + /// + [NotMapped] + [DataMember] + public int MinorQty { get; set; } + public List fqcDetails { get; set; } /// @@ -259,6 +295,11 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// public List fqcResultMasterBlobs { get; set; } + /// + /// 檢驗 + /// + public List fqcResultDetails { get; set; } + /// /// 檢查工項 /// diff --git a/AMESCoreStudio.WebApi/DTO/AMES/FqcResultDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/FqcResultDto.cs index 29a8d05e..eae62e8b 100644 --- a/AMESCoreStudio.WebApi/DTO/AMES/FqcResultDto.cs +++ b/AMESCoreStudio.WebApi/DTO/AMES/FqcResultDto.cs @@ -42,7 +42,6 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// [Display(Name = "箱號")] [Column("BOX_NO")] - [StringLength(30)] public string BoxNo { get; set; } /// @@ -50,15 +49,13 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// [Display(Name = "生產序號")] [Column("BARCODE_NO")] - [StringLength(30)] public string BarcodeNo { get; set; } /// - /// 外部序號 + /// 出貨序號 /// - [Display(Name = "外部序號")] + [Display(Name = "出貨序號")] [Column("EXTRA_BARCODE_NO")] - [StringLength(30)] public string ExtraBarcodeNo { get; set; } /// @@ -66,15 +63,19 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// [Display(Name = "狀態")] [Column("STATUS_NO")] - [StringLength(2)] public string StatusNo { get; set; } = "P"; + /// + /// IsSample + /// + [Display(Name = "IsSample")] + public string IsSample { get; set; } = "N"; + /// /// 不良代碼 /// [Display(Name = "不良代碼")] [Column("NG_REASON_NO")] - [StringLength(6)] public string NgReasonNo { get; set; } /// @@ -82,7 +83,6 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// [Display(Name = "不良備註")] [Column("NG_MEMO")] - [StringLength(100)] public string NgMemo { get; set; } /// diff --git a/AMESCoreStudio.WebApi/Enums/EnumFQC.cs b/AMESCoreStudio.WebApi/Enums/EnumFQC.cs index 7083f0c6..0027ccc8 100644 --- a/AMESCoreStudio.WebApi/Enums/EnumFQC.cs +++ b/AMESCoreStudio.WebApi/Enums/EnumFQC.cs @@ -13,6 +13,25 @@ namespace AMESCoreStudio.WebApi.Enum /// public class EnumFQC { + /// + /// 抽樣計畫允收標準 + /// + public enum EnumInspection_Type + { + /// + /// First Insp. + /// + [Display(Name = "First Insp.")] + A = 1, + + /// + /// Minor + /// + [Display(Name = "Rework Insp.")] + B = 2 + + } + /// /// 檢驗項目_類型 /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/FqcResultMaster.cs b/AMESCoreStudio.WebApi/Models/AMES/FqcResultMaster.cs index 61d09798..454f3172 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/FqcResultMaster.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/FqcResultMaster.cs @@ -280,6 +280,31 @@ namespace AMESCoreStudio.WebApi.Models.AMES ///
[Column("PROVED")] [DataMember] - public string Proved { get; set; } + public string Proved { get; set; } + + /// + /// 抽樣允收標準 + /// + [Column("INSPECTION_TYPE")] + [DataMember] + public string InspectionType { get; set; } + + /// + /// Major + /// + [DataMember] + [Display(Name = "Major")] + [Required(ErrorMessage = "{0},不能空白")] + [Column("MAJOR_QTY")] + public int MajorQty { get; set; } = 0; + + /// + /// Minor + /// + [DataMember] + [Display(Name = "Minor")] + [Required(ErrorMessage = "{0},不能空白")] + [Column("MINOR_QTY")] + public int MinorQty { get; set; } = 0; } }