From 9df95e8eca9104ff4b3f64064b817310e096617a Mon Sep 17 00:00:00 2001 From: Marvin Date: Wed, 9 Feb 2022 20:45:24 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=9C=A8=E8=A3=BD=E5=88=86?= =?UTF-8?q?=E5=B8=83=E5=9C=96=201.1.=E4=BF=AE=E6=94=B9=E8=89=AF=E7=8E=87?= =?UTF-8?q?=E9=A1=8F=E8=89=B2(=E4=BD=8E=E6=96=BC=E7=AD=89=E6=96=BC90?= =?UTF-8?q?=E7=B4=85=E8=89=B2,=E9=AB=98=E6=96=BC=E7=AD=89=E6=96=BC98?= =?UTF-8?q?=E7=B6=A0=E8=89=B2,=E8=99=95=E6=96=BC95~97=E9=BB=83=E8=89=B2=20?= =?UTF-8?q?1.2.=E5=A2=9E=E5=8A=A0=E9=81=8E=E7=AB=99PASS=E6=95=B8=E9=87=8F?= =?UTF-8?q?=E5=BD=88=E7=AA=97=E9=A1=AF=E7=A4=BA=E6=A2=9D=E7=A2=BC=E4=BF=A1?= =?UTF-8?q?=E6=81=AFQRS009P=201.3.=E5=A2=9E=E5=8A=A0=E9=81=8E=E7=AB=99FAIL?= =?UTF-8?q?=E6=95=B8=E9=87=8F=E5=BD=88=E7=AA=97=E9=A1=AF=E7=A4=BA=E6=A2=9D?= =?UTF-8?q?=E7=A2=BC=E4=BF=A1=E6=81=AFQRS009F=201.4.=E5=A2=9E=E5=8A=A0WIP?= =?UTF-8?q?=E6=95=B8=E9=87=8F=E5=BD=88=E7=AA=97=E9=A1=AF=E7=A4=BA=E6=A2=9D?= =?UTF-8?q?=E7=A2=BC=E4=BF=A1=E6=81=AFQRS009W?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/QRSController.cs | 124 +++++++++++++++++- AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs | 14 ++ AMESCoreStudio.Web/Views/QRS/QRS009F.cshtml | 53 ++++++++ AMESCoreStudio.Web/Views/QRS/QRS009P.cshtml | 53 ++++++++ AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml | 53 ++++++++ .../AMES/BarcodeInfoesController.cs | 52 ++++++++ .../AMES/BarcodeStationController.cs | 52 ++++++++ 7 files changed, 396 insertions(+), 5 deletions(-) create mode 100644 AMESCoreStudio.Web/Views/QRS/QRS009F.cshtml create mode 100644 AMESCoreStudio.Web/Views/QRS/QRS009P.cshtml create mode 100644 AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml diff --git a/AMESCoreStudio.Web/Controllers/QRSController.cs b/AMESCoreStudio.Web/Controllers/QRSController.cs index 2444b457..b99b707f 100644 --- a/AMESCoreStudio.Web/Controllers/QRSController.cs +++ b/AMESCoreStudio.Web/Controllers/QRSController.cs @@ -3,8 +3,8 @@ using System.Threading.Tasks; using Microsoft.Extensions.Logging; using AMESCoreStudio.CommonTools.Result; using Microsoft.AspNetCore.Hosting; -using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using AMESCoreStudio.Web.Models; namespace AMESCoreStudio.Web.Controllers { @@ -92,17 +92,50 @@ namespace AMESCoreStudio.Web.Controllers } } - stationQty = stationQty + "" + okQty + "/" + ngQty + ""; + //stationQty = stationQty + "" + okQty + "/" + ngQty + ""; + stationQty = stationQty + "" + okQty + "/" + ngQty + ""; double rate = ((okQty * 1.0) / (okQty + ngQty)) * 100; if (j == rule_sation.Count - 2) { - stationRate = stationRate + "" + rate.ToString("0.00") + "%" + ""; + if (rate <= 90) + { + stationRate = stationRate + "" + rate.ToString("0.00") + "%" + ""; + } + else if (rate >= 95 && rate <= 97) + { + stationRate = stationRate + "" + rate.ToString("0.00") + "%" + ""; + } + else if (rate >= 98) + { + stationRate = stationRate + "" + rate.ToString("0.00") + "%" + ""; + } + else + { + stationRate = stationRate + "" + rate.ToString("0.00") + "%" + ""; + } + //stationRate = stationRate + "" + rate.ToString("0.00") + "%" + ""; } else { - stationRate = stationRate + "" + rate.ToString("0.00") + "%" + ""; + //stationRate = stationRate + "" + rate.ToString("0.00") + "%" + ""; + if (rate <= 90) + { + stationRate = stationRate + "" + rate.ToString("0.00") + "%" + ""; + } + else if (rate >= 95 && rate <= 97) + { + stationRate = stationRate + "" + rate.ToString("0.00") + "%" + ""; + } + else if (rate >= 98) + { + stationRate = stationRate + "" + rate.ToString("0.00") + "%" + ""; + } + else + { + stationRate = stationRate + "" + rate.ToString("0.00") + "%" + ""; + } stationRate = stationRate + "" + "" + " >> " + "" + ""; } } @@ -155,7 +188,7 @@ namespace AMESCoreStudio.Web.Controllers } } } - stationWip = stationWip + "" + (okQty1 + ngQty1 - okQty2 - ngQty2) + ""; + stationWip = stationWip + "" + (okQty1 + ngQty1 - okQty2 - ngQty2) + ""; } stationWip = stationWip + "
"; @@ -219,5 +252,86 @@ namespace AMESCoreStudio.Web.Controllers ViewData["WipDataList"] = wipDataList; return View(); } + + public IActionResult QRS009P(string id) + { + string[] param = id.Split("_"); + ViewBag.WIP_ID = param[0]; + ViewBag.RULE_STATION_ID = param[1]; + + return View(); + } + + public IActionResult QRS009F(string id) + { + string[] param = id.Split("_"); + ViewBag.WIP_ID = param[0]; + ViewBag.RULE_STATION_ID = param[1]; + + return View(); + } + + public IActionResult QRS009W(string id) + { + string[] param = id.Split("_"); + ViewBag.WIP_ID = param[0]; + ViewBag.RULE_STATION_ID = param[1]; + + return View(); + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetWipStationPassBarcode(string id, int page = 1, int limit = 10) + { + string[] param = id.Split("_"); + int wip_id = int.Parse(param[0]); + int rule_station_id = int.Parse(param[1]); + + var result = await _pcsApi.GetWipStationBarcode4QRS009(wip_id, rule_station_id, "P", page, limit); + + if (result.DataTotal > 0) + { + return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); + } + + return Json(new Table() { count = 0, data = null }); + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetWipStationFailBarcode(string id, int page = 1, int limit = 10) + { + string[] param = id.Split("_"); + int wip_id = int.Parse(param[0]); + int rule_station_id = int.Parse(param[1]); + + var result = await _pcsApi.GetWipStationBarcode4QRS009(wip_id, rule_station_id, "F", page, limit); + + if (result.DataTotal > 0) + { + return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); + } + + return Json(new Table() { count = 0, data = null }); + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetWipStationBarcode(string id, int page = 1, int limit = 10) + { + string[] param = id.Split("_"); + int wip_id = int.Parse(param[0]); + int rule_station_id = int.Parse(param[1]); + + var result = await _pcsApi.GetWipBarcode4QRS009(wip_id, rule_station_id, page, limit); + + if (result.DataTotal > 0) + { + return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); + } + + return Json(new Table() { count = 0, data = null }); + } } } diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 6df36cd4..eb9e8250 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -739,6 +739,20 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpGet("api/WipStation/GetWipStation4QRS009")] ITask> GetWipStation4QRS009(int wipID,int ruleStationID); + /// + /// 查詢工單站別條碼資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/BarcodeStation/GetWipStationBarcode4QRS009")] + ITask> GetWipStationBarcode4QRS009(int wipID, int ruleStationID, string ruleStatus, int page, int limit); + + /// + /// 查詢工單站別在製條碼資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/BarcodeInfoes/GetWipBarcode4QRS009")] + ITask> GetWipBarcode4QRS009(int wipID, int ruleStationID, int page, int limit); + #endregion diff --git a/AMESCoreStudio.Web/Views/QRS/QRS009F.cshtml b/AMESCoreStudio.Web/Views/QRS/QRS009F.cshtml new file mode 100644 index 00000000..931d5750 --- /dev/null +++ b/AMESCoreStudio.Web/Views/QRS/QRS009F.cshtml @@ -0,0 +1,53 @@ +@{ + ViewData["Title"] = "在製分布圖-過站FAIL條碼資料"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+ + +
+
+
+ +@section Scripts{ + +} \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/QRS/QRS009P.cshtml b/AMESCoreStudio.Web/Views/QRS/QRS009P.cshtml new file mode 100644 index 00000000..588705c6 --- /dev/null +++ b/AMESCoreStudio.Web/Views/QRS/QRS009P.cshtml @@ -0,0 +1,53 @@ +@{ + ViewData["Title"] = "在製分布圖-過站PASS條碼資料"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+ + +
+
+
+ +@section Scripts{ + +} \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml b/AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml new file mode 100644 index 00000000..57cff918 --- /dev/null +++ b/AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml @@ -0,0 +1,53 @@ +@{ + ViewData["Title"] = "在製分布圖-在製條碼資料"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+ + +
+
+
+ +@section Scripts{ + +} \ No newline at end of file diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs index 67cbb228..1966a8b1 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs @@ -89,6 +89,58 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return barcodeInfo; } + /// + /// 查詢工單站別在製條碼資料 + /// + /// + [Route("[action]")] + [HttpGet] + public async Task> GetWipBarcode4QRS009(int wipID, int ruleStationID, int page = 1, int limit = 10) + { + ResultModel result = new ResultModel(); + var q = from q1 in _context.BarcodeInfoes + join q2 in _context.WipInfos on q1.WipID equals q2.WipID + join q3 in _context.LineInfoes on q2.LineID equals q3.LineID + join q4 in _context.UserInfoes on q1.CreateUserID equals q4.UserID + select new + { + q1.BarcodeID, + q1.WipID, + q1.RuleStationID, + q1.BarcodeNo, + q3.LineDesc, + q1.RuleStatus, + q1.SysType, + q1.CreateDate, + q4.UserName + }; + + q = q.Where(w => w.WipID == wipID && w.RuleStationID == ruleStationID); + + + //紀錄筆數 + result.DataTotal = q.Count(); + + //Table 頁數 + if (page > 0) + { + q = q.Skip((page - 1) * limit).Take(limit); + } + + result.Data = await q.ToListAsync(); + + if (result == null) + { + result.Msg = "查無資料"; + result.Success = false; + return result; + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + /// /// 用工單號碼获取该條碼资料 /// diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeStationController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeStationController.cs index acad5dd6..afafa7b6 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeStationController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeStationController.cs @@ -93,6 +93,58 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return barcodeStation; } + /// + /// 查詢工單站別條碼資料 + /// + /// + [Route("[action]")] + [HttpGet] + public async Task> GetWipStationBarcode4QRS009(int wipID, int ruleStationID, string ruleStatus, int page = 1, int limit = 10) + { + ResultModel result = new ResultModel(); + var q = from q1 in _context.BarcodeStation + join q2 in _context.BarcodeInfoes on q1.BarcodeID equals q2.BarcodeID + join q3 in _context.LineInfoes on q1.LineId equals q3.LineID + join q4 in _context.UserInfoes on q1.CreateUserID equals q4.UserID + select new + { + q1.BarcodeID, + q1.WipID, + q1.RuleStationID, + q2.BarcodeNo, + q3.LineDesc, + q1.RuleStatus, + q1.Systype, + q1.InputDate, + q4.UserName + }; + + q = q.Where(w => w.WipID == wipID && w.RuleStationID == ruleStationID && w.RuleStatus == ruleStatus); + + + //紀錄筆數 + result.DataTotal = q.Count(); + + //Table 頁數 + if (page > 0) + { + q = q.Skip((page - 1) * limit).Take(limit); + } + + result.Data = await q.ToListAsync(); + + if (result == null) + { + result.Msg = "查無資料"; + result.Success = false; + return result; + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + /// /// 用工單ID查是否有過站紀錄 ///