diff --git a/AMESCoreStudio.Web/Controllers/QRSController.cs b/AMESCoreStudio.Web/Controllers/QRSController.cs index b2d1991a..277b1ee9 100644 --- a/AMESCoreStudio.Web/Controllers/QRSController.cs +++ b/AMESCoreStudio.Web/Controllers/QRSController.cs @@ -72,13 +72,14 @@ namespace AMESCoreStudio.Web.Controllers string stationList = ""; for (int j = 0; j < rule_sation.Count; j++) { - if (rule_sation[j].StationID != 1000 && rule_sation[j].StationType == "M") + //if (rule_sation[j].StationID != 1000 && rule_sation[j].StationType == "M") + if (rule_sation[j].StationType == "M") { - stationList = stationList + rule_sation[j].RuleStationID + ","; + stationList = stationList + rule_sation[j].StationID + ","; - wipDataList = wipDataList + "" + rule_sation[j].StationDesc + ""; + wipDataList = wipDataList + "" + rule_sation[j].Station.StationName + ""; - var wip_station = await _pcsApi.GetWipStation4QRS009Group(wip_id, rule_sation[j].RuleStationID); + var wip_station = await _pcsApi.GetWipStation4QRS009Group(wip_id, rule_sation[j].StationID); int okQty = 0, ngQty = 0; if (wip_station.DataTotal > 0) @@ -111,7 +112,7 @@ namespace AMESCoreStudio.Web.Controllers } //stationQty = stationQty + "" + okQty + "/" + ngQty + ""; - stationQty = stationQty + "" + okQty + "/" + ngQty + ""; + stationQty = stationQty + "" + okQty + "/" + ngQty + ""; double rate = ((okQty * 1.0) / (okQty + ngQty)) * 100; @@ -314,7 +315,7 @@ namespace AMESCoreStudio.Web.Controllers { string[] param = id.Split("_"); ViewBag.WIP_ID = param[0]; - ViewBag.RULE_STATION_ID = param[1]; + ViewBag.STATION_ID = param[1]; return View(); } @@ -323,7 +324,7 @@ namespace AMESCoreStudio.Web.Controllers { string[] param = id.Split("_"); ViewBag.WIP_ID = param[0]; - ViewBag.RULE_STATION_ID = param[1]; + ViewBag.STATION_ID = param[1]; return View(); } @@ -332,7 +333,7 @@ namespace AMESCoreStudio.Web.Controllers { string[] param = id.Split("_"); ViewBag.WIP_ID = param[0]; - ViewBag.RULE_STATION_ID = param[1]; + ViewBag.STATION_ID = param[1]; return View(); } @@ -387,13 +388,14 @@ namespace AMESCoreStudio.Web.Controllers string stationList = ""; for (int j = 0; j < rule_sation.Count; j++) { - if (rule_sation[j].StationID != 1000 && rule_sation[j].StationType == "M") + //if (rule_sation[j].StationID != 1000 && rule_sation[j].StationType == "M") + if (rule_sation[j].StationType == "M") { stationList = stationList + rule_sation[j].StationID + ","; - wipDataList = wipDataList + "" + rule_sation[j].StationDesc + ""; + wipDataList = wipDataList + "" + rule_sation[j].Station.StationName + ""; - var wip_station = await _pcsApi.GetWipStation4QRS009Group(wip_id, rule_sation[j].RuleStationID); + var wip_station = await _pcsApi.GetWipStation4QRS009Group(wip_id, rule_sation[j].StationID); int okQty = 0, ngQty = 0; if (wip_station.DataTotal > 0) @@ -413,7 +415,7 @@ namespace AMESCoreStudio.Web.Controllers } //stationQty = stationQty + "" + okQty + "/" + ngQty + ""; - stationQty = stationQty + "" + okQty + "/" + ngQty + ""; + stationQty = stationQty + "" + okQty + "/" + ngQty + ""; double rate = ((okQty * 1.0) / (okQty + ngQty)) * 100; @@ -548,9 +550,9 @@ namespace AMESCoreStudio.Web.Controllers { string[] param = id.Split("_"); int wip_id = int.Parse(param[0]); - int rule_station_id = int.Parse(param[1]); + int station_id = int.Parse(param[1]); - var result = await _pcsApi.GetWipStationBarcode4QRS009(wip_id, rule_station_id, "P", page, limit); + var result = await _pcsApi.GetWipStationBarcode4QRS009(wip_id, station_id, "P", page, limit); if (result.DataTotal > 0) { @@ -566,9 +568,9 @@ namespace AMESCoreStudio.Web.Controllers { string[] param = id.Split("_"); int wip_id = int.Parse(param[0]); - int rule_station_id = int.Parse(param[1]); + int station_id = int.Parse(param[1]); - var result = await _pcsApi.GetWipStationBarcode4QRS009(wip_id, rule_station_id, "F", page, limit); + var result = await _pcsApi.GetWipStationBarcode4QRS009(wip_id, station_id, "F", page, limit); if (result.DataTotal > 0) { @@ -584,9 +586,9 @@ namespace AMESCoreStudio.Web.Controllers { string[] param = id.Split("_"); int wip_id = int.Parse(param[0]); - int rule_station_id = int.Parse(param[1]); + int station_id = int.Parse(param[1]); - var result = await _pcsApi.GetWipBarcode4QRS009(wip_id, rule_station_id, page, limit); + var result = await _pcsApi.GetWipBarcode4QRS009(wip_id, station_id, page, limit); if (result.DataTotal > 0) { diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 8cb62f3d..680571f8 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -970,28 +970,28 @@ namespace AMESCoreStudio.Web /// /// [WebApiClient.Attributes.HttpGet("api/WipStation/GetWipStation4QRS009")] - ITask> GetWipStation4QRS009(int wipID, int ruleStationID); + ITask> GetWipStation4QRS009(int wipID, int stationID); /// /// 查詢工單站别资料 /// /// [WebApiClient.Attributes.HttpGet("api/WipStation/GetWipStation4QRS009Group")] - ITask> GetWipStation4QRS009Group(int wipID, int ruleStationID); + ITask> GetWipStation4QRS009Group(int wipID, int stationID); /// /// 查詢工單站別條碼資料 /// /// [WebApiClient.Attributes.HttpGet("api/BarcodeStation/GetWipStationBarcode4QRS009")] - ITask> GetWipStationBarcode4QRS009(int wipID, int ruleStationID, string ruleStatus, int page, int limit); + ITask> GetWipStationBarcode4QRS009(int wipID, int stationID, string ruleStatus, int page, int limit); /// /// 查詢工單站別在製條碼資料 /// /// [WebApiClient.Attributes.HttpGet("api/BarcodeInfoes/GetWipBarcode4QRS009")] - ITask> GetWipBarcode4QRS009(int wipID, int ruleStationID, int page, int limit); + ITask> GetWipBarcode4QRS009(int wipID, int stationID, int page, int limit); #endregion diff --git a/AMESCoreStudio.Web/Views/QRS/QRS009F.cshtml b/AMESCoreStudio.Web/Views/QRS/QRS009F.cshtml index 931d5750..e468cb71 100644 --- a/AMESCoreStudio.Web/Views/QRS/QRS009F.cshtml +++ b/AMESCoreStudio.Web/Views/QRS/QRS009F.cshtml @@ -6,7 +6,7 @@
- +
@@ -48,6 +48,6 @@ ]; //基本数据表格 - var table = hg.table.datatable('test', '過站FAIL條碼資料', '/QRS/GetWipStationFailBarcode/' + wip_id.value + '_' + rule_station_id.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); + var table = hg.table.datatable('test', '過站FAIL條碼資料', '/QRS/GetWipStationFailBarcode/' + wip_id.value + '_' + station_id.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); } \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/QRS/QRS009P.cshtml b/AMESCoreStudio.Web/Views/QRS/QRS009P.cshtml index 588705c6..adb63045 100644 --- a/AMESCoreStudio.Web/Views/QRS/QRS009P.cshtml +++ b/AMESCoreStudio.Web/Views/QRS/QRS009P.cshtml @@ -6,7 +6,7 @@
- +
@@ -48,6 +48,6 @@ ]; //基本数据表格 - var table = hg.table.datatable('test', '過站PASS條碼資料', '/QRS/GetWipStationPassBarcode/' + wip_id.value + '_' + rule_station_id.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); + var table = hg.table.datatable('test', '過站PASS條碼資料', '/QRS/GetWipStationPassBarcode/' + wip_id.value + '_' + station_id.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); } \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml b/AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml index 57cff918..19e35cf0 100644 --- a/AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml +++ b/AMESCoreStudio.Web/Views/QRS/QRS009W.cshtml @@ -6,7 +6,7 @@
- +
@@ -48,6 +48,6 @@ ]; //基本数据表格 - var table = hg.table.datatable('test', '在製條碼資料', '/QRS/GetWipStationBarcode/' + wip_id.value + '_' + rule_station_id.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); + var table = hg.table.datatable('test', '在製條碼資料', '/QRS/GetWipStationBarcode/' + wip_id.value + '_' + station_id.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); } \ No newline at end of file diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs index e3257207..9ca12e6f 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs @@ -96,7 +96,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES /// [Route("[action]")] [HttpGet] - public async Task> GetWipBarcode4QRS009(int wipID, int ruleStationID, int page = 0, int limit = 10) + public async Task> GetWipBarcode4QRS009(int wipID, int stationID, int page = 0, int limit = 10) { ResultModel result = new ResultModel(); var q = from q1 in _context.BarcodeInfoes @@ -116,7 +116,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES q4.UserName }; - q = q.Where(w => w.WipID == wipID && w.StationID == ruleStationID); + q = q.Where(w => w.WipID == wipID && w.StationID == stationID); //紀錄筆數 diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeStationController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeStationController.cs index 1c98ee4e..03fdb1ec 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeStationController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeStationController.cs @@ -105,7 +105,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES /// [Route("[action]")] [HttpGet] - public async Task> GetWipStationBarcode4QRS009(int wipID, int StationID, string ruleStatus, int page = 0, int limit = 10) + public async Task> GetWipStationBarcode4QRS009(int wipID, int stationID, string ruleStatus, int page = 0, int limit = 10) { ResultModel result = new ResultModel(); var q = from q1 in _context.BarcodeStation @@ -125,7 +125,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES q4.UserName }; - q = q.Where(w => w.WipID == wipID && w.StationID == StationID && w.RuleStatus == ruleStatus); + q = q.Where(w => w.WipID == wipID && w.StationID == stationID && w.RuleStatus == ruleStatus); //紀錄筆數 diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipStationController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipStationController.cs index f18cf8a6..0e5d5a28 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipStationController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipStationController.cs @@ -174,11 +174,12 @@ FROM JHAMES.WIP_STATION"; if (stationID != 0) q = q.Where(w => w.StationID == stationID); - var g = q.GroupBy(x => new { x.StationID, x.RuleStatus }).Select(x => new + var g = q.GroupBy(x => new { x.WipID, x.StationID, x.RuleStatus }).Select(x => new { + WipID = x.Key.WipID, StationID = x.Key.StationID, RuleStatus = x.Key.RuleStatus, - FirstCnt = q.Where(j => j.StationID == x.Key.StationID && j.RuleStatus == x.Key.RuleStatus).Sum(k => k.FirstCnt) + FirstCnt = q.Where(j => j.WipID == x.Key.WipID && j.StationID == x.Key.StationID && j.RuleStatus == x.Key.RuleStatus).Sum(k => k.FirstCnt) }); //var result = await q.ToListAsync();