diff --git a/AMESCoreStudio.Web/Controllers/FQCController.cs b/AMESCoreStudio.Web/Controllers/FQCController.cs index f4e5a2dc..635465a3 100644 --- a/AMESCoreStudio.Web/Controllers/FQCController.cs +++ b/AMESCoreStudio.Web/Controllers/FQCController.cs @@ -1866,7 +1866,7 @@ namespace AMESCoreStudio.Web.Controllers FQC010Master = new FQC010VIiew() { - DefectDescription = FqcQuery.QaMeno, + DefectDescription = string.IsNullOrWhiteSpace(FqcQuery.QaMeno) ? "N/A" : FqcQuery.QaMeno, InspectionDate = FqcQuery.EndTime, AC = FqcQuery.AcQty.ToString(), Approved = FqcQuery.Supervisor_Name, @@ -1874,30 +1874,30 @@ namespace AMESCoreStudio.Web.Controllers SpeciallyAdoption = FqcQuery.SpecialPo, BIOSVer = FqcQuery.BIOS, ECN = FqcQuery.PLMECN, - ECNMemo = FqcQuery.ECN_Memo, + ECNMemo = string.IsNullOrWhiteSpace(FqcQuery.ECN_Memo) ? "N/A" : FqcQuery.ECN_Memo, Factory = FqcQuery.Werk.Split('-')[0], FactoryRemark = FqcQuery.Werk.Split('-')[1], - InspectionInstrumentNumber = FqcQuery.OutfitNo, + InspectionInstrumentNumber = string.IsNullOrWhiteSpace(FqcQuery.OutfitNo) ? "N/A" : FqcQuery.OutfitNo, InspectionItems = $"OS:[{FqcQuery.OS}] CPU test:[{FqcQuery.CPU}] RAM test:[{FqcQuery.RAM}]", InspectionNumber = FqcQuery.InhouseNo, InspectionStatus = FqcQuery.InspectionStatus, InspectionType = FqcQuery.InspectionTypeName, Inspector = FqcQuery.UpdateUser_Name, Judgment = "Defect Quantity", - Line = FqcQuery.InhouseMemo, + Line = string.IsNullOrWhiteSpace(FqcQuery.InhouseMemo) ? "N/A" : FqcQuery.InhouseMemo, LotSize = FqcQuery.InhouseQty.ToString(), Major = FqcQuery.MajorQty.ToString(), MedicalModel = FqcQuery.CustomerMedical, Minor = FqcQuery.MinorQty.ToString(), Model = FqcQuery.ItemNo, ModelName = FqcQuery.ModelNo, - NOTE = FqcQuery.Note, + NOTE = string.IsNullOrWhiteSpace(FqcQuery.Note) ? "N/A" : FqcQuery.Note, OrderNumber = FqcQuery.WipNo, QuotDescription = FqcQuery.QuotDescription, ReMajor = FqcQuery.ReQty.ToString(), Sample = FqcQuery.QcQty.ToString(), QuotName = FqcQuery.QuotName, - //StorageLocation = "9000", + StorageLocation = FqcQuery.LocationNo, Avalue = "AVALUE", VIP = FqcQuery.CustomerVIP, WaiveRequisition = FqcQuery.StatusName, diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 88afd57f..abb97264 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -6116,25 +6116,7 @@ namespace AMESCoreStudio.Web.Controllers var q = await _pcsApi.GetWipInfoByWipNO(model.WipNO); q = q.Where(w => w.UnitNO == model.UnitNO).ToList(); - // 工單流程ID 取站別 - var ruleStations = await GetRuleStationByFlowRuleID(model.FlowRuleID); - var StationNameSt = ""; // 作業站名稱代碼 提供不二過 - if (model.Station == 0) - model.Station = ruleStations.FirstOrDefault().StationID; - - // 取作業站的生產製程 - var stationUnit = string.Empty; - var station = await _basApi.GetStations(model.Station); - if (station.Count() != 0) - { - stationUnit = station.FirstOrDefault().UnitNo; - } - else - { - ModelState.AddModelError("error", "找不到該作業站的生產單位"); - } - - + if (q.Count() == 0) { ModelState.AddModelError("error", "找不到該生產單位的工單號碼"); @@ -6156,7 +6138,24 @@ namespace AMESCoreStudio.Web.Controllers return View("PCS021", model); } - + // 工單流程ID 取站別 + var ruleStations = await GetRuleStationByFlowRuleID(model.FlowRuleID); + var StationNameSt = ""; // 作業站名稱代碼 提供不二過 + if (model.Station == 0) + model.Station = ruleStations.FirstOrDefault().StationID; + + // 取作業站的生產製程 + var stationUnit = string.Empty; + var station = await _basApi.GetStations(model.Station); + if (station.Count() != 0) + { + stationUnit = station.FirstOrDefault().UnitNo; + } + else + { + ModelState.AddModelError("error", "找不到該作業站的生產單位"); + } + if (model.Station != 0) { if (ruleStations.Where(w => w.StationID == model.Station).Any()) diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs index 7fb91411..37035243 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs @@ -358,7 +358,6 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES { result.Success = false; result.Msg = ex.InnerException.Message; - result.Msg = ex.InnerException.Message; } return result; } diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeItemsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeItemsController.cs index 08a4a3cd..afa8a975 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeItemsController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeItemsController.cs @@ -442,7 +442,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES public async Task>> GetBarcodeItemByDataRedundancy(string itemNO, string partNo) { IQueryable q = _context.BarcodeItems; - var barcodeItem = await q.Where(w => w.ItemNo == itemNO && w.PartNo == partNo).ToListAsync(); + var barcodeItem = await q.Where(w => w.ItemNo.ToUpper() == itemNO.ToUpper() && w.PartNo == partNo).ToListAsync(); if (barcodeItem == null) { diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs index ab436339..0df8e41c 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs @@ -269,7 +269,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES CustomerNo = q4.CustomerNO, CustomerMedical = q4.CustomerMedical, CustomerVIP = q4.CustomerVIP, - Werk = q4.Werks + "-" + q5.FactoryNameCh, + Werk = q5.FactoryNo + "-" + q5.FactoryNameCh, BIOS = q2.BIOS, CPU = q2.CPU, OS = q2.OS, @@ -337,7 +337,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES // 檢查儀器編號 空白時預設帶N/A query = query.Select(s => { - s.OutfitNo = String.IsNullOrEmpty(s.OutfitNo) ? "N/A" : s.OutfitNo; + s.OutfitNo = string.IsNullOrEmpty(s.OutfitNo) ? "N/A" : s.OutfitNo; return s; }).ToList(); diff --git a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs index 66bf4b54..f6fbe239 100644 --- a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs @@ -183,7 +183,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES // 不是維修跑KeyParts判斷 if (barCodeCheckDto.barcodeType != "S") { - if (barCodeCheckDto.inputItems.Where(w => !w.inputType.Contains("NG")).Any()) + if (barCodeCheckDto.inputItems.Where(w => !w.inputType.ToUpper().StartsWith("NG")).Any()) { var barcodeItemKPDto = new BarcodeItemKPDto @@ -192,7 +192,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES barcode = barCodeCheckDto.barcode, unitNo = barCodeCheckDto.unitNo, ststionUnitNo = station.Value.Where(w => w.StationID == barCodeCheckDto.stationID).FirstOrDefault().UnitNo, - inputKP = barCodeCheckDto.inputItems.Where(w => !w.inputType.Contains("NG")).ToList() + inputKP = barCodeCheckDto.inputItems.Where(w => !w.inputType.ToUpper().StartsWith("NG")).ToList() }; var resultKeyParts = await CheckBarCodeKPAsync(barcodeItemKPDto); @@ -212,7 +212,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES if (barCodeCheckDto.barcodeType == "S") { // 確認新舊組件序號是否都有值 - if (barCodeCheckDto.inputItems.Where(w => w.inputType != "NG" && + if (barCodeCheckDto.inputItems.Where(w => w.inputType.ToUpper() != "NG" && (string.IsNullOrWhiteSpace(w.inputData) || string.IsNullOrWhiteSpace(w.oldInputData))).Any()) { resultModel.Msg = "工單號碼【" + barCodeCheckDto.wipNo + "】維修過站資料有缺新舊組件序號,請確認"; @@ -241,7 +241,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES } else { - var q_Kp = MaterialKps.Where(w => w.KpNo == barCodeItem.ItemNo).FirstOrDefault(); + var q_Kp = MaterialKps.Where(w => w.KpNo.ToUpper() == barCodeItem.ItemNo.ToUpper()).FirstOrDefault(); if (q_Kp != null) { #region 比對序號長度是否正確 @@ -1885,7 +1885,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES // 有KpNo以KpNo為主 if (!string.IsNullOrWhiteSpace(barcodeKPDtoItem.inputType)) { - wipKpsItem = wipKps.Where(w => w.KpNo == barcodeKPDtoItem.inputType).FirstOrDefault(); + wipKpsItem = wipKps.Where(w => w.KpNo.ToUpper() == barcodeKPDtoItem.inputType.ToUpper()).FirstOrDefault(); if (wipKpsItem != null) { diff --git a/AMESCoreStudio.WebApi/DTO/BLL/BarCodeCheckDto.cs b/AMESCoreStudio.WebApi/DTO/BLL/BarCodeCheckDto.cs index 019acb57..bf17373a 100644 --- a/AMESCoreStudio.WebApi/DTO/BLL/BarCodeCheckDto.cs +++ b/AMESCoreStudio.WebApi/DTO/BLL/BarCodeCheckDto.cs @@ -117,8 +117,7 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// 刷入類型 NG or KP(Item_No) /// [DataMember] - public string inputType { get { return InputType; } set { InputType = string.IsNullOrWhiteSpace(value) ? "" : value.Trim().ToUpper(); } } - private string InputType; + public string inputType { get; set; } /// /// 刷入組件資料或不良代碼