From 193db7edfe3fca91b0c57b5ca474e21436f0b478 Mon Sep 17 00:00:00 2001 From: "BB.Wang" Date: Fri, 14 Jul 2023 09:44:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=8C=E5=B7=A5=E5=85=A5?= =?UTF-8?q?=E5=BA=AB=E9=81=B8=E6=93=87=E6=98=B6=E4=BA=AB=E6=99=82=EF=BC=8C?= =?UTF-8?q?=E5=B7=A5=E5=96=AE=E9=9C=80=E5=B0=8D=E6=87=89=E5=AE=89=E5=8B=A4?= =?UTF-8?q?=E5=B7=A5=E5=96=AE=E3=80=81=E6=96=99=E8=99=9F=20=E5=AE=8C?= =?UTF-8?q?=E5=B7=A5=E5=85=A5=E5=BA=AB=E6=95=B8=E9=87=8F=E6=94=B9=E6=8A=93?= =?UTF-8?q?Barcode=5Finfo=20(=E8=A7=A3=E6=B1=BA=E6=8B=86=E7=AE=B1=E5=BE=8C?= =?UTF-8?q?=E5=AF=A6=E9=9A=9B=E6=95=B8=E9=87=8F=E8=88=87Wip=5Fbox=20?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 20 ++++++++++++++++++- .../AMES/FqcInhouseMasterController.cs | 18 ++++++++++++----- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index ac7a003b..1ab6ab76 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -7378,9 +7378,27 @@ namespace AMESCoreStudio.Web.Controllers foreach (var item in result_EVER.Data) { - var wipresult= await _pcsApi.GetWipInfoByWipNO_EVER(wipno: item.WipNo); + var wipresult= await _pcsApi.GetWipInfoByWipNO_EVER(wipno: item.WipNo); //查對應安勤工單&料號 item.WipNo = wipresult.Select(s => s.RelatedWONO).FirstOrDefault(); + if (!string.IsNullOrWhiteSpace(item.WipNo)) + { + + var itemresult = await _pcsApi.GetWipAtt(id: item.WipNo); + if ( itemresult != null) + { + item.ItemNo = itemresult.ItemNO; + } + else + { + item.ItemNo = ""; + } + } + else + { + item.ItemNo =""; + } + } result = result_EVER ; } diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs index 676ceabd..d60830bf 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs @@ -516,7 +516,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES //YIRU ADD ----------------------------------------------------------------------------------------------------------------------------------------------- /// - /// FQC查詢 by TableD + /// FQC查詢 by Table /// /// 內部序號 /// 工單號碼 @@ -532,9 +532,9 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES public async Task> GetFqcInhouseMasteMultiQuery(string barcodeNo, string wipNo, string boxNo , string inhouseNo, string date_str, string date_end, string status, int page = 0, int limit = 10) { + IQueryable q = from q1 in _context.FqcInhouseMasters join q2 in _context.FqcInhouseDetails on new { q1.InhouseNo, q1.SeqID } equals new { q2.InhouseNo, q2.SeqID } - join q2_1 in _context.WipBoxs on q2.SerialNo equals q2_1.BoxNo join q3 in _context.FqcResultMasters on q1.InhouseNo equals q3.InhouseNo join q4 in _context.WareHouseings on new { q2.InhouseNo, q2.SeqID, q2.SerialNo } equals new { q4.InhouseNo, q4.SeqID, q4.SerialNo } into q2q4 from q402 in q2q4.DefaultIfEmpty() @@ -553,8 +553,10 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES RecordNumber = q402.RecordNumber, RecordDate = q402.Create_Date, LocationNo = q1.LocationNo, - BoxQty = q2_1.BoxCnt.ToString() }; + + + //q1.Status == "P" ? "允收" : q1.Status == "R" ? "批退" : "未驗收完成", //IQueryable q1 = _context.FqcInhouseDetails; if (!string.IsNullOrWhiteSpace(inhouseNo)) @@ -591,14 +593,16 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES if (DateTime.TryParse(date_str, out _)) { - q = q.Where(w => w.CreateDate >= DateTime.Parse(date_str + " 00:00:00")); + q = q.Where(w => w.RecordDate >= DateTime.Parse(date_str)); } if (DateTime.TryParse(date_end, out _)) { - q = q.Where(w => w.CreateDate <= DateTime.Parse(date_end + " 23:59:59")); + q = q.Where(w => w.RecordDate <= DateTime.Parse(date_end)); } q = q.Where(w => w.StatusName == "P"); + + ResultModel result = new ResultModel(); // 紀錄筆數 @@ -619,9 +623,13 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES result.Data = result.Data.Select(s => { s.StatusName = s.StatusName == "P" ? "允收" : s.StatusName == "R" ? "批退" : "未驗收完成"; return s; }) .ToList(); + result.Data = result.Data.Select(s => { s.BoxQty = _context.BarcodeInfoes.Where(w => w.BoxNo == s.SerialNo).Count().ToString(); return s; }).ToList(); + return result; } + + //YIRU End ----------------------------------------------------------------------------------------------------------------------------------------------- private bool FqcInhouseMasterExists(string id)