diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index ddc3ea42..2c21f25e 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -878,9 +878,39 @@ namespace AMESCoreStudio.Web.Controllers result_FQCResultMaster.ECN_Memo = model.ECN_Memo; result_FQCResultMaster.InspectionStatus = model.InspectionStatus; result_FQCResultMaster.PLM_ECN = model.PLMECN; + result_FQCResultMaster.UpdateUserID = GetLogInUserID(); await _fqcApi.PutFqcResultMaster(JsonConvert.SerializeObject(result_FQCResultMaster)); ModelState.AddModelError("error", "儲存成功!"); } + else + { + var fqcResultMaster = new FqcResultMaster(); + fqcResultMaster.InhouseNo = model.InhouseNo; + fqcResultMaster.SeqID = Convert.ToInt16(model.SeqID); + fqcResultMaster.LotQty = model.InhouseQty; + fqcResultMaster.WipNo = model.WipNo; + fqcResultMaster.QaQty = 1; + fqcResultMaster.ItemNo = model.ItemNo; + fqcResultMaster.ModelNo = model.ModelNo; + fqcResultMaster.StartTime = DateTime.Now; + fqcResultMaster.EndTime = DateTime.Now; + fqcResultMaster.CreateUserID = GetLogInUserID(); + fqcResultMaster.UpdateUserID = GetLogInUserID(); + fqcResultMaster.OS = model.OS; + fqcResultMaster.CPU = model.CPU; + fqcResultMaster.RAM = model.RAM; + fqcResultMaster.BIOS = model.BIOS; + fqcResultMaster.Supervisor = model.Supervisor; + fqcResultMaster.Proved = model.Proved; + fqcResultMaster.OutfitNo = model.OutfitNo; + fqcResultMaster.InspectionType = model.InspectionType; + fqcResultMaster.Note = model.Note; + fqcResultMaster.ECN_Memo = model.ECN_Memo; + fqcResultMaster.InspectionStatus = model.InspectionStatus; + fqcResultMaster.PLM_ECN = model.PLMECN; + await _fqcApi.PostFqcResultMaster(JsonConvert.SerializeObject(fqcResultMaster)); + ModelState.AddModelError("error", "儲存成功!"); + } } if (result.Data.Count() != 0) @@ -939,6 +969,7 @@ namespace AMESCoreStudio.Web.Controllers result_FQCResultMaster.ECN_Memo = model.ECN_Memo; result_FQCResultMaster.InspectionStatus = model.InspectionStatus; result_FQCResultMaster.PLM_ECN = model.PLMECN; + result_FQCResultMaster.UpdateUserID = GetLogInUserID(); await _fqcApi.PutFqcResultMaster(JsonConvert.SerializeObject(result_FQCResultMaster)); ModelState.AddModelError("error", "儲存成功!"); } @@ -955,6 +986,7 @@ namespace AMESCoreStudio.Web.Controllers fqcResultMaster.StartTime = DateTime.Now; fqcResultMaster.EndTime = DateTime.Now; fqcResultMaster.CreateUserID = GetLogInUserID(); + fqcResultMaster.UpdateUserID = GetLogInUserID(); fqcResultMaster.OS = model.OS; fqcResultMaster.CPU = model.CPU; fqcResultMaster.RAM = model.RAM; @@ -1167,8 +1199,8 @@ namespace AMESCoreStudio.Web.Controllers var result = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID); var fqcItem = result.Data.FirstOrDefault(); - // Fail數量 小於0 才要判斷抽樣數量 - if (fqcItem.FailQty <= 0) + // Fail數量 小於0 才要判斷抽樣數量 && 不等於免驗 + if (fqcItem.FailQty <= 0 && fqcItem.InspectionStatus != "C") { // 抽驗數量 大於 本批次送驗量 if (fqcItem.QcQty > fqcItem.InhouseQty) @@ -1224,34 +1256,39 @@ namespace AMESCoreStudio.Web.Controllers { var FqcQuery = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID); var fqcItem = FqcQuery.Data.FirstOrDefault(); - // 判斷狀態選擇 - if (fqcItem.FailQty >= fqcItem.ReQty) + + // 免驗排除 + if (fqcItem.InspectionStatus != "C") { - if (model.QaResult == "P" && string.IsNullOrWhiteSpace(model.SpecialPo)) + // 判斷狀態選擇 + if (fqcItem.FailQty >= fqcItem.ReQty) { - ModelState.AddModelError("error", "請輸入特採單號"); - return View("FQC007B", model); + if (model.QaResult == "P" && string.IsNullOrWhiteSpace(model.SpecialPo)) + { + ModelState.AddModelError("error", "請輸入特採單號"); + return View("FQC007B", model); + } } - } - // 判斷有Fail但抽驗量不足 不可開立允收 - if (fqcItem.FailQty > 0) - { - // 抽驗數量 大於 本批次送驗量 - if (fqcItem.QcQty > fqcItem.InhouseQty) + // 判斷有Fail但抽驗量不足 不可開立允收 + if (fqcItem.FailQty > 0) { - if (fqcItem.PassQty + fqcItem.FailQty != fqcItem.InhouseQty && model.QaResult == "P") + // 抽驗數量 大於 本批次送驗量 + if (fqcItem.QcQty > fqcItem.InhouseQty) + { + if (fqcItem.PassQty + fqcItem.FailQty != fqcItem.InhouseQty && model.QaResult == "P") + { + ModelState.AddModelError("error", "抽樣數量不足,不可判定允收"); + return View("FQC007B", model); + } + } + //當抽驗數量 小於 抽樣數量就離開 + else if (fqcItem.QcQty > fqcItem.PassQty + fqcItem.FailQty && model.QaResult == "P") { ModelState.AddModelError("error", "抽樣數量不足,不可判定允收"); return View("FQC007B", model); } } - //當抽驗數量 小於 抽樣數量就離開 - else if (fqcItem.QcQty > fqcItem.PassQty + fqcItem.FailQty && model.QaResult == "P") - { - ModelState.AddModelError("error", "抽樣數量不足,不可判定允收"); - return View("FQC007B", model); - } } var fqcResultMaster = await _fqcApi.GetFqcResultMaster(model.FqcID); @@ -1546,7 +1583,7 @@ namespace AMESCoreStudio.Web.Controllers public async Task FQC008QueryAsync(string barcodeNo, string wipNo , string boxNo, string inhouseNo, string dateStr, string dateEnd, string factoryID - , string status ="A", int page = 0, int limit = 10) + , string status = "A", int page = 0, int limit = 10) { IResultModel result = await _fqcApi.GetFqcInhouseMasterQuery(barcodeNo: barcodeNo, wipNo: wipNo , boxNo: boxNo, inhouseNo: inhouseNo, date_str: dateStr, date_end: dateEnd @@ -1725,7 +1762,7 @@ namespace AMESCoreStudio.Web.Controllers Avalue = "AVALUE", VIP = FqcQuery.CustomerVIP, WaiveRequisition = FqcQuery.StatusName, - AQLType = FqcQuery.AQLType + AQLType = FqcQuery.AQLType, }; // 抓全部檢驗工項 @@ -1776,6 +1813,35 @@ namespace AMESCoreStudio.Web.Controllers InspectionResults = item.StatusNo }); } + + // 圖檔轉BASE64 + string ApprovedSign = ""; + string InspectorSign = ""; + if (System.IO.File.Exists($"{this._env.WebRootPath}/images/ElectronicSignature/{FQC010Master.Approved}.png")) + { + using (var b = new System.Drawing.Bitmap($"{this._env.WebRootPath}/images/ElectronicSignature/{FQC010Master.Approved}.png")) + { + using (var ms = new MemoryStream()) + { + b.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); + ApprovedSign = Convert.ToBase64String(ms.ToArray()); + } + } + } + if (System.IO.File.Exists($"{this._env.WebRootPath}/images/ElectronicSignature/{FQC010Master.Inspector}.png")) + { + using (var b = new System.Drawing.Bitmap($"{this._env.WebRootPath}/images/ElectronicSignature/{FQC010Master.Inspector}.png")) + { + using (var ms = new MemoryStream()) + { + b.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); + InspectorSign = Convert.ToBase64String(ms.ToArray()); + } + } + } + + FQC010Master.ApprovedSignImg = ApprovedSign; + FQC010Master.InspectorSignImg = InspectorSign; } var FQC010Masters = new List(); diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml index 22044c66..7c58d797 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007.cshtml @@ -44,6 +44,10 @@ + + + +
@@ -248,9 +252,9 @@
-
+ @*
-
+
*@
diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml index ba799449..0d3a009d 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007C.cshtml @@ -9,6 +9,10 @@ .control-label { justify-content: flex-end !important; } + + .layui-form-select dl { + max-height: 200px; + }
@@ -50,6 +54,7 @@
@@ -75,7 +80,7 @@
- +
@@ -185,7 +190,7 @@ } else parent.hg.msg(error); - } + } }); function add() { diff --git a/AMESCoreStudio.Web/Views/FQC/FQC007V.cshtml b/AMESCoreStudio.Web/Views/FQC/FQC007V.cshtml index bbf19d35..d1a188c0 100644 --- a/AMESCoreStudio.Web/Views/FQC/FQC007V.cshtml +++ b/AMESCoreStudio.Web/Views/FQC/FQC007V.cshtml @@ -38,8 +38,8 @@ title: '抽驗狀態' }, { - field: 'ngReasonNo', - title: '不良代碼' + field: 'ngReasonDesc', + title: '不良現象' }, { field: 'ngMemo', diff --git a/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/ADMIN.png b/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/ADMIN.png new file mode 100644 index 00000000..530cef17 Binary files /dev/null and b/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/ADMIN.png differ diff --git a/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/楊其達.png b/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/楊其達.png new file mode 100644 index 00000000..5e65395e Binary files /dev/null and b/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/楊其達.png differ diff --git a/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/江旭民.png b/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/江旭民.png new file mode 100644 index 00000000..898996d5 Binary files /dev/null and b/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/江旭民.png differ diff --git a/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/沈俊輝.png b/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/沈俊輝.png new file mode 100644 index 00000000..c7159c58 Binary files /dev/null and b/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/沈俊輝.png differ diff --git a/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/沈秀慧.png b/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/沈秀慧.png new file mode 100644 index 00000000..530cef17 Binary files /dev/null and b/AMESCoreStudio.Web/wwwroot/images/ElectronicSignature/沈秀慧.png differ diff --git a/AMESCoreStudio.Web/wwwroot/images/avalue.png b/AMESCoreStudio.Web/wwwroot/images/avalue.png new file mode 100644 index 00000000..14510398 Binary files /dev/null and b/AMESCoreStudio.Web/wwwroot/images/avalue.png differ diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseDetailController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseDetailController.cs index bae309fb..7ab70ed4 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseDetailController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseDetailController.cs @@ -89,6 +89,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES if (FqcResultMaster != null) { var FqcResultDetail = await _context.FqcResultDetails.Where(w => w.FqcID == FqcResultMaster.FqcID).ToListAsync(); + var NgReasons = await _context.NGReasons.ToListAsync(); foreach (var item in FqcResultDetail) { foreach (var item2 in fqcResultDto) @@ -97,6 +98,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES { item2.StatusNo = item.StatusNo; item2.NgReasonNo = item.NgReasonNo; + item2.NgReasonDesc = NgReasons.Where(w => w.NGReasonNo == item.NgReasonNo).FirstOrDefault() == null ? "" : NgReasons.Where(w => w.NGReasonNo == item.NgReasonNo).FirstOrDefault().NGReasonDesc; item2.NgMemo = item.NgMemo; item2.CreateName = await new Helper(_context).GetUserName(item.CreateUserID); continue; @@ -158,6 +160,9 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES var FqcResultMaster = await _context.FqcResultMasters.Where(w => w.InhouseNo == item.InhouseNo && w.SeqID == item.SeqID) .FirstOrDefaultAsync(); + + var NgReasons = await _context.NGReasons.ToListAsync(); + // 取抽驗結果 if (FqcResultMaster != null) { @@ -170,6 +175,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES { item2.StatusNo = item1.StatusNo == "P" ? "PASS" : "NG"; item2.NgReasonNo = item1.NgReasonNo; + item2.NgReasonDesc = NgReasons.Where(w => w.NGReasonNo == item1.NgReasonNo).FirstOrDefault() == null ? "" : NgReasons.Where(w => w.NGReasonNo == item1.NgReasonNo).FirstOrDefault().NGReasonDesc; item2.NgMemo = item1.NgMemo; item2.IsSample = "Y"; item2.CreateName = await new Helper(_context).GetUserName(item.CreateUserID); diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs index d6d1859d..b8b160a9 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs @@ -199,7 +199,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES 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() - join q6 in _context.UserInfoes on q2.Supervisor equals q6.UserNo into cp6 + join q6 in _context.UserInfoes on "182" equals q6.UserNo into cp6 from q6 in cp6.DefaultIfEmpty() join q7 in _context.UserInfoes on q2.Proved equals q7.UserNo into cp7 from q7 in cp7.DefaultIfEmpty() @@ -228,7 +228,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES OS = q2.OS, RAM = q2.RAM, OutfitNo = q2.OutfitNo, - Supervisor = q2.Supervisor, + Supervisor = "182", Supervisor_Name = q6.UserName, Proved = q2.Proved, Proved_Name = q7.UserName, diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcResultDetailController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcResultDetailController.cs index 2c914226..2963ed20 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcResultDetailController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcResultDetailController.cs @@ -56,8 +56,6 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES ResultModel result = new ResultModel(); _context.Entry(fqcResultDetail).State = EntityState.Modified; fqcResultDetail.UpdateDate = DateTime.Now; - fqcResultDetail.UpdateUserID = 0; - try { await _context.SaveChangesAsync(); diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcResultMasterController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcResultMasterController.cs index 5f42bc37..f75fb875 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcResultMasterController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcResultMasterController.cs @@ -72,7 +72,6 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES ResultModel result = new ResultModel(); _context.Entry(fqcResultMaster).State = EntityState.Modified; fqcResultMaster.UpdateDate = DateTime.Now; - fqcResultMaster.UpdateUserID = 0; try { diff --git a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs index 70e0f495..140eb119 100644 --- a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs @@ -740,7 +740,6 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES barcodeInfo.StatusNo = StatusNo; barcodeInfo.WipID = barCodeCheckDto.wipID; barcodeInfo.StatusID = 1; - barcodeInfo.BoxNo = ""; barcodeInfo.ExtraBarcodeNo = barCodeCheckDto.extNo; if (CheckNextStopCloseStation(barCodeCheckDto.wipNo, barCodeCheckDto.unitNo, barCodeCheckDto.stationID).Result.Success) { diff --git a/AMESCoreStudio.WebApi/DTO/AMES/FQC010VIiew.cs b/AMESCoreStudio.WebApi/DTO/AMES/FQC010VIiew.cs index 368214f0..5e5d9b10 100644 --- a/AMESCoreStudio.WebApi/DTO/AMES/FQC010VIiew.cs +++ b/AMESCoreStudio.WebApi/DTO/AMES/FQC010VIiew.cs @@ -184,6 +184,16 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// public string Inspector { get; set; } + /// + /// 抽驗人員簽名檔 + /// + public string ApprovedSignImg { get; set; } + + /// + /// 主管簽名檔 + /// + public string InspectorSignImg { get; set; } + public List Detail1 { get; set; } public List Detail2 { get; set; } diff --git a/AMESCoreStudio.WebApi/DTO/AMES/FqcResultDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/FqcResultDto.cs index eae62e8b..b970b3a0 100644 --- a/AMESCoreStudio.WebApi/DTO/AMES/FqcResultDto.cs +++ b/AMESCoreStudio.WebApi/DTO/AMES/FqcResultDto.cs @@ -78,6 +78,13 @@ namespace AMESCoreStudio.WebApi.DTO.AMES [Column("NG_REASON_NO")] public string NgReasonNo { get; set; } + /// + /// 不良現象 + /// + [Display(Name = "不良現象")] + [Column("NG_REASON_Desc")] + public string NgReasonDesc { get; set; } + /// /// 不良備註 ///