diff --git a/AMESCoreStudio.Web/Controllers/BASController.cs b/AMESCoreStudio.Web/Controllers/BASController.cs index 7884d7fc..cdb99f89 100644 --- a/AMESCoreStudio.Web/Controllers/BASController.cs +++ b/AMESCoreStudio.Web/Controllers/BASController.cs @@ -9,6 +9,8 @@ using Microsoft.AspNetCore.Mvc.Rendering; using AMESCoreStudio.WebApi.Models.BAS; using AMESCoreStudio.WebApi.Models.AMES; using AMESCoreStudio.CommonTools.Result; +using System.Collections.Generic; +using System.Linq; namespace AMESCoreStudio.Web.Controllers { @@ -249,7 +251,7 @@ namespace AMESCoreStudio.Web.Controllers public async Task GetUnitLineJson(string unit_no) { var result = await _basApi.GetLineInfoByUnit(unit_no); - + result = result.OrderBy(o => o.LineID).ToList(); var item = new List(); for (int i = 0; i < result.Count; i++) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 4e4ad3b5..87eca8b2 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -1556,8 +1556,8 @@ namespace AMESCoreStudio.Web.Controllers model.wipBarcode = model.wipBarcodes.FirstOrDefault(); model.ruleStations = await _pcsApi.GetRuleStationByWipNo(model.wipInfo.WipNO); - var q1 = await _pcsApi.GetMaterialSopQuery(itemNo: model.wipAtt.ItemNO); - model.materialSops = q1.Data; + //var q1 = await _pcsApi.GetMaterialSopQuery(itemNo: model.wipAtt.ItemNO); + //model.materialSops = q1.Data; model.wipBoard = await _pcsApi.GetWipBoard(model.wipInfo.WipNO); if (model.wipBoard != null) @@ -3439,7 +3439,6 @@ namespace AMESCoreStudio.Web.Controllers // 抓作業站順序 model.RuleStation = RuleStations.Where(w => w.StationID == model.Station).Select(s => s.RuleStationID).FirstOrDefault(); model.StationSEQ = RuleStations.Where(w => w.StationID == model.Station).Select(s => s.Sequence).FirstOrDefault(); - model.StationTestType = RuleStations.Where(w => w.StationID == model.Station).Select(s => s.Station.TestType).FirstOrDefault(); } // 判斷是否有$符號,代表有不良代碼 if (model.Inputs.Where(w => w.Contains("$")).Any()) @@ -3466,15 +3465,15 @@ namespace AMESCoreStudio.Web.Controllers // 下一個作業站是完工站時再判斷是否都有刷組件 // 判斷組件是否都有輸入 - if (Kp.Count() != 0) - { - var CheckBarCodeKP = await _pcsApi.CheckBarCodeKP(model.WipNO, model.Input, model.UnitNO, Kp); - if (!CheckBarCodeKP.Success) - return Json(new Result() { success = CheckBarCodeKP.Success, msg = CheckBarCodeKP.Msg, data = Data }); + //if (Kp.Count() != 0) + //{ + // var CheckBarCodeKP = await _pcsApi.CheckBarCodeKP(model.WipNO, model.Input, model.UnitNO, Kp); + // if (!CheckBarCodeKP.Success) + // return Json(new Result() { success = CheckBarCodeKP.Success, msg = CheckBarCodeKP.Msg, data = Data }); - if (CheckBarCodeKP.Data != null) - ExtNo = CheckBarCodeKP.Data.FirstOrDefault(); - } + // if (CheckBarCodeKP.Data != null) + // ExtNo = CheckBarCodeKP.Data.FirstOrDefault(); + //} var keyParts = new List(); // 先查詢已綁定組件數量 diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs index cecc55c8..642ffc2f 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs @@ -75,7 +75,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES public async Task>> CheckWipBarcodeOtherByNo(string wipNO, string No) { var wipBarcodeOther = _context.WipBarcodeOthers - .FromSqlInterpolated($" SELECT * FROM WIP_BARCODE_OTHER WHERE {No} BETWEEN START_NO AND END_NO ") + .FromSqlInterpolated($" SELECT * FROM JHAMES.WIP_BARCODE_OTHER WHERE {No} BETWEEN START_NO AND END_NO ") .AsNoTracking().ToList(); wipBarcodeOther = wipBarcodeOther.Where(W => W.WipNO == wipNO).ToList(); diff --git a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs index 7c6f10f4..155c75a0 100644 --- a/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs @@ -154,6 +154,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES var resultKeyParts = await CheckBarCodeKPAsync(barcodeItemKPDto); if (!resultKeyParts.Success) return (ResultModel)resultKeyParts; + else + barCodeCheckDto.extNo = resultKeyParts.Msg; } #endregion @@ -506,6 +508,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES barcodeInfo.RuleStatus = barCodeCheckDto.ruleStatus; barcodeInfo.StatusNo = StatusNo; barcodeInfo.WipID = barCodeCheckDto.wipID; + barcodeInfo.ExtraBarcodeNo = barCodeCheckDto.extNo; if (CheckNextStopCloseStation(barCodeCheckDto.wipNo, barCodeCheckDto.unitNo, barCodeCheckDto.station).Result.Success) { barcodeInfo.StatusID = -1; @@ -1186,7 +1189,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return resultModel; } - if (WipNoItem.Where(w => w.StatusNO == "Y").Any()) + if (WipNoItem.Where(w => w.StatusNO == "E").Any()) { resultModel.Msg = "工單號碼【" + wipNo + "】,該工單已經投入完工,請切換工單"; return resultModel; @@ -1411,7 +1414,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES else { resultModel.Data = new List { barcodeItemKPDto.inputKP[i] }; - resultModel.Msg = "EXT_NO"; + resultModel.Msg = barcodeItemKPDto.inputKP[i]; } } #endregion diff --git a/AMESCoreStudio.WebApi/DTO/BLL/BarCodeCheckDto.cs b/AMESCoreStudio.WebApi/DTO/BLL/BarCodeCheckDto.cs index a2830e92..e8ebb004 100644 --- a/AMESCoreStudio.WebApi/DTO/BLL/BarCodeCheckDto.cs +++ b/AMESCoreStudio.WebApi/DTO/BLL/BarCodeCheckDto.cs @@ -96,6 +96,12 @@ namespace AMESCoreStudio.WebApi.DTO.AMES [DataMember] public List outfits { get; set; } + /// + /// 出貨序號 + /// + [DataMember] + public string extNo { get; set; } = string.Empty; + /// /// 紀錄組件或不良代碼