diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index dd3940df..384a023a 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -658,7 +658,7 @@ namespace AMESCoreStudio.Web.Controllers } [HttpPost] - public async Task FQC007Async(FqcDto model) + public async Task FQC007Async(FqcDto model, string action) { if (string.IsNullOrWhiteSpace(model.InhouseNo)) { @@ -670,6 +670,23 @@ namespace AMESCoreStudio.Web.Controllers result = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID); + if (action == "儲存") + { + var result_FQCResultMaster = await _fqcApi.GetFqcResultMaster(model.FqcID); + + if (result_FQCResultMaster != null) + { + result_FQCResultMaster.OS = model.OS; + result_FQCResultMaster.CPU = model.CPU; + result_FQCResultMaster.RAM = model.RAM; + result_FQCResultMaster.BIOS = model.BIOS; + result_FQCResultMaster.Supervisor = model.Supervisor; + result_FQCResultMaster.Proved = model.Proved; + result_FQCResultMaster.OutfitNo = model.OutfitNo; + await _fqcApi.PutFqcResultMaster(JsonConvert.SerializeObject(result_FQCResultMaster)); + } + } + if (result.Data.Count() != 0) { model = result.Data.FirstOrDefault(); @@ -701,6 +718,8 @@ namespace AMESCoreStudio.Web.Controllers model.h_SeqID = ""; } + + return View("FQC007", model); } @@ -776,7 +795,9 @@ namespace AMESCoreStudio.Web.Controllers BoxNo = result_BarCodeInfo.FirstOrDefault().BoxNo, StatusNo = model.StatusNo, NgMemo = model.NgMemo, - NgReasonNo = model.NgReasonNo + NgReasonNo = model.NgReasonNo, + CreateUserID = GetLogInUserID(), + UpdateUserID = GetLogInUserID() }; if (string.IsNullOrWhiteSpace(FqcResultDetail.ExtraBarcodeNo)) @@ -806,6 +827,7 @@ namespace AMESCoreStudio.Web.Controllers FqcResultMaster = result_FqcResultMaster.FirstOrDefault(); FqcResultMaster.QaQty += 1; FqcResultMaster.UpdateDate = DateTime.Now; + FqcResultMaster.UpdateUserID = GetLogInUserID(); } else { @@ -821,6 +843,7 @@ namespace AMESCoreStudio.Web.Controllers FqcResultMaster.ModelNo = FirstFqc.ModelNo; FqcResultMaster.StartTime = DateTime.Now; FqcResultMaster.EndTime = DateTime.Now; + FqcResultMaster.CreateUserID = GetLogInUserID(); } // 判斷是PASS || FAIL @@ -909,9 +932,11 @@ namespace AMESCoreStudio.Web.Controllers fqcResultMaster.EndTime = DateTime.Now; fqcResultMaster.UpdateDate = DateTime.Now; fqcResultMaster.SpecialPo = model.SpecialPo; + fqcResultMaster.UpdateUserID = GetLogInUserID(); fqcInhouseMaster.Status = model.QaResult; fqcInhouseMaster.UpdateDate = DateTime.Now; + fqcInhouseMaster.UpdateUserID = GetLogInUserID(); IResultModel result; result = await _fqcApi.PutFqcInhouseMaster(JsonConvert.SerializeObject(fqcInhouseMaster)); diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 5522e073..5417f681 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -1924,6 +1924,14 @@ namespace AMESCoreStudio.Web.Controllers model.WipSops = await _pcsApi.GetWipSopByWipNo(model.wipInfo.WipNO); model.wipInfoBlobs = await _pcsApi.GetWipInfoBlob(model.wipInfo.WipNO); + + // 取料號對應工時 + var standardWorkTimes = await _pcsApi.GetStandardWorkTimeByItemNo(model.wipAtt.ItemNO); + standardWorkTimes = standardWorkTimes.Where(w => w.LineID == model.wipInfo.LineID && + w.UnitNo == model.wipInfo.UnitNO).ToList(); + + if (standardWorkTimes.Count != 0) + model.itemNoCT1 = standardWorkTimes.Sum(m => m.CT).ToString(); } await WipDataSelectAll(model.wipAtt.WipNO, model.wipAtt.ItemNO, model.wipInfo.UnitNO); @@ -2059,7 +2067,7 @@ namespace AMESCoreStudio.Web.Controllers w.UnitNo == model.wipInfo.UnitNO).ToList(); if (standardWorkTimes.Count != 0) - model.itemNoCT1 = standardWorkTimes.FirstOrDefault().CT.ToString(); + model.itemNoCT1 = standardWorkTimes.Sum(m => m.CT).ToString(); } diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml index d0a2509a..2150ec6a 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml @@ -9,6 +9,7 @@
+
@ViewBag.Title
@@ -40,7 +41,7 @@ -
+
@@ -50,149 +51,230 @@
-
- +
+
- +
-
- +
+
- +
-
-
-
- +
+
- +
+
+
+
+ +
- + + +
+
+
- +
-
- +
+
- +
-
- +
+
- +
-
- +
+
- +
+
+ +
- +
+
+ +
+
+
+
+
- +
+
-
- +
+
- +
-
- +
+
- +
-
- +
+
- +
+
+ +
- +
+ +
+
+
+
-
-
- -
+
+ +
+
+
+
+ +
- +
+ +
+
+ +
+
+
+
-
-
- -
+
+
+
+ +
+
+
+
+
+
- +
+ +
+
+
+
- +
+ +
+ Hz +
+
+ +
+
+
+ +
+ Mb +
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+
+ +
+
@@ -313,7 +395,15 @@
+ + @Html.ValidationMessage("error") +
+
+ +
+
+
@@ -327,6 +417,27 @@ }); + //UserName + function getUserName(val) { + if (val.value.length != 0) { + $.ajax( + { + url: "@Url.Action("getUserName", "SYS")", + dataType: 'json', + data: { "userNo": val.value}, + type: 'post', + success: function (result) + { + $(val).closest('div.layui-inline').find('input[id*=' + val.id + '_Name]').val(result.data); + }, + error: function (result) + { + alert(result); + } + }); + } + }; + function edit() { layui.use('layer', function () { var layer = layui.layer; @@ -393,7 +504,6 @@ maxmin: true, content: '/FQC/FQC007A?wipNo=@Model.WipNo&itemNo=@Model.ItemNo', end: function () { - //hg.msg('新增成功'); window.location.reload(); } }); diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml index f9035aae..84fbe6c0 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml @@ -471,8 +471,8 @@ @* - - *@ + + *@
@@ -663,6 +663,17 @@
+
+ @if (!string.IsNullOrWhiteSpace(Model.itemNoCT1)) + { + 標準工時:@Model.itemNoCT1 秒/個 + } + else + { + *無維護工時 + } + +
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index e8a3dfee..2a22da97 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -1098,7 +1098,7 @@ @Html.ValidationMessage("error")
- +
diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs index 917de3b5..1d3e802a 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs @@ -188,6 +188,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES into cp from q2 in cp.DefaultIfEmpty() join q3 in _context.QcCriteria on q1.CritID equals q3.CritID + join q4 in _context.WipInfos on q1.WipNo equals q4.WipNO + join q5 in _context.FactoryInfos on q4.Werks equals q5.FactoryID.ToString() select new FqcDto { InhouseNo = q1.InhouseNo, @@ -203,10 +205,21 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES FqcID = q2.WipNo == null ? 0 : q2.FqcID, InhouseMemo = q2.InhouseMemo, ManualQaMeno = q2.ManualQaMeno, - QaMeno = q2.QaMeno + QaMeno = q2.QaMeno, + CustomerNo = q4.CustomerNO, + CustomerMedical = q4.CustomerMedical, + CustomerVIP = q4.CustomerVIP, + Werk = q4.Werks+"-"+q5.FactoryNameCh, + BIOS = q2.BIOS, + CPU = q2.CPU, + OS = q2.OS, + RAM = q2.RAM, + OutfitNo = q2.OutfitNo, + Supervisor = q2.Supervisor, + Proved = q2.Proved }; - var query = await q.ToListAsync(); + var query = await q.Distinct().ToListAsync(); var FqcDetail = new List(); if (query.Count() != 0) diff --git a/AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs index b23af762..ef070ef6 100644 --- a/AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs +++ b/AMESCoreStudio.WebApi/DTO/AMES/FqcDto.cs @@ -150,6 +150,108 @@ namespace AMESCoreStudio.WebApi.DTO.AMES [Display(Name = "入庫單備註")] public string InhouseMemo { get; set; } + /// + /// 客戶類別醫療(Y-是;N-否) + /// + [DataMember] + public string CustomerMedical { get; set; } = "N"; + + /// + /// 客戶類別VIP(Y-是;N-否) + /// + [DataMember] + public string CustomerVIP { get; set; } = "N"; + + /// + /// 客戶名稱 + /// + [DataMember] + [Display(Name = "客戶名稱")] + public string CustomerNo { get; set; } + + /// + /// 委外廠商 + /// + [DataMember] + [Display(Name = "委外廠商")] + public string Werk { get; set; } + + /// + /// OS + /// + [DataMember] + [Display(Name = "OS")] + [StringLength(20)] + public string OS { get; set; } + + /// + /// CPU test + /// + [DataMember] + [Display(Name = "CPU test")] + public string CPU { get; set; } + + /// + /// RAM test + /// + [DataMember] + [Display(Name = "RAM test")] + public string RAM { get; set; } + + /// + /// BIOS + /// + [DataMember] + [Display(Name = "BIOS")] + public string BIOS { get; set; } + + /// + /// 檢驗儀器編號 + /// + [DataMember] + [Display(Name = "檢驗儀器編號")] + public string OutfitNo { get; set; } + + /// + /// 單位主管 + /// + [DataMember] + public string Supervisor { get; set; } + + + /// + /// 單位主管姓名 Engineer + /// + [NotMapped] + [DataMember] + public string Supervisor_Name { get; set; } + + /// + /// Proved + /// + [DataMember] + public string Proved { get; set; } + + /// + /// Proved姓名 Engineer + /// + [NotMapped] + [DataMember] + public string Proved_Name { get; set; } + + /// + /// 檢驗者 + /// + [DataMember] + public string UpdateUser { get; set; } + + /// + /// 檢驗者姓名 Engineer + /// + [NotMapped] + [DataMember] + public string UpdateUser_Name { get; set; } + public List fqcDetails { get; set; } /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/FqcResultMaster.cs b/AMESCoreStudio.WebApi/Models/AMES/FqcResultMaster.cs index 8ca95c6e..38ffe0c0 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/FqcResultMaster.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/FqcResultMaster.cs @@ -222,5 +222,64 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("UPDATE_DATE")] [DataMember] public DateTime? UpdateDate { get; set; } = DateTime.Now; + + /// + /// OS + /// + [DataMember] + [Display(Name = "OS")] + [Column("OS")] + [StringLength(20)] + public string OS { get; set; } + + /// + /// CPU test + /// + [DataMember] + [Display(Name = "CPU test")] + [Column("CPU")] + [StringLength(20)] + public string CPU { get; set; } + + /// + /// RAM test + /// + [DataMember] + [Display(Name = "RAM test")] + [Column("RAM")] + [StringLength(20)] + public string RAM { get; set; } + + /// + /// BIOS + /// + [DataMember] + [Display(Name = "BIOS")] + [Column("BIOS")] + [StringLength(20)] + public string BIOS { get; set; } + + /// + /// 檢驗儀器編號 + /// + [DataMember] + [Display(Name = "檢驗儀器編號")] + [Column("OUTFIT_NO")] + [StringLength(20)] + public string OutfitNo { get; set; } + + /// + /// 單位主管 + /// + [Column("SUPERVISOR")] + [DataMember] + public string Supervisor { get; set; } + + /// + /// Proved + /// + [Column("PROVED")] + [DataMember] + public string Proved { get; set; } } }