diff --git a/AMESCoreStudio.Web/Controllers/QRSController.cs b/AMESCoreStudio.Web/Controllers/QRSController.cs index 6c7f6ba1..302b223e 100644 --- a/AMESCoreStudio.Web/Controllers/QRSController.cs +++ b/AMESCoreStudio.Web/Controllers/QRSController.cs @@ -1114,6 +1114,7 @@ namespace AMESCoreStudio.Web.Controllers JObject jo = JObject.Parse(item.ToString()); int wip_id = int.Parse(jo["wipID"].ToString()); + //2024-03-26 BB.Wang Modify 修正良率(代小平) //double sum_rate = 100.0; //int sum_idx = 1; @@ -1198,11 +1199,12 @@ namespace AMESCoreStudio.Web.Controllers string dateEnd01 = yCode + "-02-01"; var wipStaiton01 = await _pcsApi.GetWipStation4QRS014GroupS(param[1], dateStart01, dateEnd01, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate01 = 100.0; - //int sum_idx01 = 1; - double sum_rate01 = 0.0; - int sum_idx01 = 0; + double sum_rate01 = 100.0; + int sum_idx01 = 1; + //double sum_rate01 = 0.0; + //int sum_idx01 = 0; if (wipStaiton01.DataTotal > 0) { @@ -1284,9 +1286,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate01 = sum_rate01 * (rate / 100.0); - sum_idx01 = sum_idx01 + 1; - sum_rate01 = sum_rate01 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate01 = sum_rate01 * (rate / 100.0); + //sum_idx01 = sum_idx01 + 1; + //sum_rate01 = sum_rate01 + rate; } } } @@ -1308,12 +1311,13 @@ namespace AMESCoreStudio.Web.Controllers string dateStart02 = yCode + "-02-01"; string dateEnd02 = yCode + "-03-01"; var wipStaiton02 = await _pcsApi.GetWipStation4QRS014GroupS(param[1], dateStart02, dateEnd02, param[5], param[6], param[7]); - + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate02 = 100.0; - //int sum_idx02 = 1; - double sum_rate02 = 0.0; - int sum_idx02 = 0; + double sum_rate02 = 100.0; + int sum_idx02 = 1; + //double sum_rate02 = 0.0; + //int sum_idx02 = 0; if (wipStaiton02.DataTotal > 0) { @@ -1395,9 +1399,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate02 = sum_rate02 * (rate / 100.0); - sum_idx02 = sum_idx02 + 1; - sum_rate02 = sum_rate02 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate02 = sum_rate02 * (rate / 100.0); + //sum_idx02 = sum_idx02 + 1; + //sum_rate02 = sum_rate02 + rate; } } } @@ -1419,11 +1424,14 @@ namespace AMESCoreStudio.Web.Controllers string dateStart03 = yCode + "-03-01"; string dateEnd03 = yCode + "-04-01"; var wipStaiton03 = await _pcsApi.GetWipStation4QRS014GroupS(param[1], dateStart03, dateEnd03, param[5], param[6], param[7]); + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate03 = 100.0; - //int sum_idx03 = 1; - double sum_rate03 = 0.0; - int sum_idx03 = 0; + double sum_rate03 = 100.0; + int sum_idx03 = 1; + //double sum_rate03 = 0.0; + //int sum_idx03 = 0; + if (wipStaiton03.DataTotal > 0) { DataTable dtRate = new DataTable(); @@ -1504,9 +1512,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate03 = sum_rate03 * (rate / 100.0); - sum_idx03 = sum_idx03 + 1; - sum_rate03 = sum_rate03 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate03 = sum_rate03 * (rate / 100.0); + //sum_idx03 = sum_idx03 + 1; + //sum_rate03 = sum_rate03 + rate; } } } @@ -1528,11 +1537,14 @@ namespace AMESCoreStudio.Web.Controllers string dateStart04 = yCode + "-04-01"; string dateEnd04 = yCode + "-05-01"; var wipStaiton04 = await _pcsApi.GetWipStation4QRS014GroupS(param[1], dateStart04, dateEnd04, param[5], param[6], param[7]); + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate04 = 100.0; - //int sum_idx04 = 1; - double sum_rate04 = 0.0; - int sum_idx04 = 0; + double sum_rate04 = 100.0; + int sum_idx04 = 1; + //double sum_rate04 = 0.0; + //int sum_idx04 = 0; + if (wipStaiton04.DataTotal > 0) { DataTable dtRate = new DataTable(); @@ -1613,9 +1625,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate04 = sum_rate04 * (rate / 100.0); - sum_idx04 = sum_idx04 + 1; - sum_rate04 = sum_rate04 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate04 = sum_rate04 * (rate / 100.0); + //sum_idx04 = sum_idx04 + 1; + //sum_rate04 = sum_rate04 + rate; } } } @@ -1637,11 +1650,14 @@ namespace AMESCoreStudio.Web.Controllers string dateStart05 = yCode + "-05-01"; string dateEnd05 = yCode + "-06-01"; var wipStaiton05 = await _pcsApi.GetWipStation4QRS014GroupS(param[1], dateStart05, dateEnd05, param[5], param[6], param[7]); + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate05 = 100.0; - //int sum_idx05 = 1; - double sum_rate05 = 0.0; - int sum_idx05 = 0; + double sum_rate05 = 100.0; + int sum_idx05 = 1; + //double sum_rate05 = 0.0; + //int sum_idx05 = 0; + if (wipStaiton05.DataTotal > 0) { DataTable dtRate = new DataTable(); @@ -1722,9 +1738,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate05 = sum_rate05 * (rate / 100.0); - sum_idx05 = sum_idx05 + 1; - sum_rate05 = sum_rate05 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate05 = sum_rate05 * (rate / 100.0); + //sum_idx05 = sum_idx05 + 1; + //sum_rate05 = sum_rate05 + rate; } } } @@ -1746,11 +1763,14 @@ namespace AMESCoreStudio.Web.Controllers string dateStart06 = yCode + "-06-01"; string dateEnd06 = yCode + "-07-01"; var wipStaiton06 = await _pcsApi.GetWipStation4QRS014GroupS(param[1], dateStart06, dateEnd06, param[5], param[6], param[7]); + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate06 = 100.0; - //int sum_idx06 = 1; - double sum_rate06 = 0.0; - int sum_idx06 = 0; + double sum_rate06 = 100.0; + int sum_idx06 = 1; + //double sum_rate06 = 0.0; + //int sum_idx06 = 0; + if (wipStaiton06.DataTotal > 0) { DataTable dtRate = new DataTable(); @@ -1831,9 +1851,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate06 = sum_rate06 * (rate / 100.0); - sum_idx06 = sum_idx06 + 1; - sum_rate06 = sum_rate06 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate06 = sum_rate06 * (rate / 100.0); + //sum_idx06 = sum_idx06 + 1; + //sum_rate06 = sum_rate06 + rate; } } } @@ -1855,11 +1876,14 @@ namespace AMESCoreStudio.Web.Controllers string dateStart07 = yCode + "-07-01"; string dateEnd07 = yCode + "-08-01"; var wipStaiton07 = await _pcsApi.GetWipStation4QRS014GroupS(param[1], dateStart07, dateEnd07, param[5], param[6], param[7]); + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate07 = 100.0; - //int sum_idx07 = 1; - double sum_rate07 = 0.0; - int sum_idx07 = 0; + double sum_rate07 = 100.0; + int sum_idx07 = 1; + //double sum_rate07 = 0.0; + //int sum_idx07 = 0; + if (wipStaiton07.DataTotal > 0) { DataTable dtRate = new DataTable(); @@ -1940,9 +1964,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate07 = sum_rate07 * (rate / 100.0); - sum_idx07 = sum_idx07 + 1; - sum_rate07 = sum_rate07 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate07 = sum_rate07 * (rate / 100.0); + //sum_idx07 = sum_idx07 + 1; + //sum_rate07 = sum_rate07 + rate; } } } @@ -1964,11 +1989,14 @@ namespace AMESCoreStudio.Web.Controllers string dateStart08 = yCode + "-08-01"; string dateEnd08 = yCode + "-09-01"; var wipStaiton08 = await _pcsApi.GetWipStation4QRS014GroupS(param[1], dateStart08, dateEnd08, param[5], param[6], param[7]); + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate08 = 100.0; - //int sum_idx08 = 1; - double sum_rate08 = 0.0; - int sum_idx08 = 0; + double sum_rate08 = 100.0; + int sum_idx08 = 1; + //double sum_rate08 = 0.0; + //int sum_idx08 = 0; + if (wipStaiton08.DataTotal > 0) { DataTable dtRate = new DataTable(); @@ -2073,11 +2101,14 @@ namespace AMESCoreStudio.Web.Controllers string dateStart09 = yCode + "-09-01"; string dateEnd09 = yCode + "-10-01"; var wipStaiton09 = await _pcsApi.GetWipStation4QRS014GroupS(param[1], dateStart09, dateEnd09, param[5], param[6], param[7]); + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate09 = 100.0; - //int sum_idx09 = 1; - double sum_rate09 = 0.0; - int sum_idx09 = 0; + double sum_rate09 = 100.0; + int sum_idx09 = 1; + //double sum_rate09 = 0.0; + //int sum_idx09 = 0; + if (wipStaiton09.DataTotal > 0) { DataTable dtRate = new DataTable(); @@ -2182,11 +2213,14 @@ namespace AMESCoreStudio.Web.Controllers string dateStart10 = yCode + "-10-01"; string dateEnd10 = yCode + "-11-01"; var wipStaiton10 = await _pcsApi.GetWipStation4QRS014GroupS(param[1], dateStart10, dateEnd10, param[5], param[6], param[7]); + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate10 = 100.0; - //int sum_idx10 = 1; - double sum_rate10 = 0.0; - int sum_idx10 = 0; + double sum_rate10 = 100.0; + int sum_idx10 = 1; + //double sum_rate10 = 0.0; + //int sum_idx10 = 0; + if (wipStaiton10.DataTotal > 0) { DataTable dtRate = new DataTable(); @@ -2267,9 +2301,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate10 = sum_rate10 * (rate / 100.0); - sum_idx10 = sum_idx10 + 1; - sum_rate10 = sum_rate10 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate10 = sum_rate10 * (rate / 100.0); + //sum_idx10 = sum_idx10 + 1; + //sum_rate10 = sum_rate10 + rate; } } } @@ -2291,11 +2326,14 @@ namespace AMESCoreStudio.Web.Controllers string dateStart11 = yCode + "-11-01"; string dateEnd11 = yCode + "-12-01"; var wipStaiton11 = await _pcsApi.GetWipStation4QRS014GroupS(param[1], dateStart11, dateEnd11, param[5], param[6], param[7]); + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate11 = 100.0; - //int sum_idx11 = 1; - double sum_rate11 = 0.0; - int sum_idx11 = 0; + double sum_rate11 = 100.0; + int sum_idx11 = 1; + //double sum_rate11 = 0.0; + //int sum_idx11 = 0; + if (wipStaiton11.DataTotal > 0) { DataTable dtRate = new DataTable(); @@ -2400,12 +2438,13 @@ namespace AMESCoreStudio.Web.Controllers string dateStart12 = yCode + "-12-01"; string dateEnd12 = (int.Parse(yCode) + 1).ToString() + "-01-01"; var wipStaiton12 = await _pcsApi.GetWipStation4QRS014GroupS(param[1], dateStart12, dateEnd12, param[5], param[6], param[7]); - + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate12 = 100.0; - //int sum_idx12 = 1; - double sum_rate12 = 0.0; - int sum_idx12 = 0; + double sum_rate12 = 100.0; + int sum_idx12 = 1; + //double sum_rate12 = 0.0; + //int sum_idx12 = 0; if (wipStaiton12.DataTotal > 0) { @@ -2487,9 +2526,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate12 = sum_rate12 * (rate / 100.0); - sum_idx12 = sum_idx12 + 1; - sum_rate12 = sum_rate12 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate12 = sum_rate12 * (rate / 100.0); + //sum_idx12 = sum_idx12 + 1; + //sum_rate12 = sum_rate12 + rate; } } } @@ -2531,11 +2571,12 @@ namespace AMESCoreStudio.Web.Controllers string dateEnd01 = yCode + "-02-01"; var wipStaiton01 = await _pcsApi.GetWipStation4QRS014GroupB(param[1], dateStart01, dateEnd01, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate01 = 100.0; - //int sum_idx01 = 1; - double sum_rate01 = 0.0; - int sum_idx01 = 0; + double sum_rate01 = 100.0; + int sum_idx01 = 1; + //double sum_rate01 = 0.0; + //int sum_idx01 = 0; if (wipStaiton01.DataTotal > 0) { @@ -2617,9 +2658,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate01 = sum_rate01 * (rate / 100.0); - sum_idx01 = sum_idx01 + 1; - sum_rate01 = sum_rate01 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate01 = sum_rate01 * (rate / 100.0); + //sum_idx01 = sum_idx01 + 1; + //sum_rate01 = sum_rate01 + rate; } } } @@ -2642,11 +2684,12 @@ namespace AMESCoreStudio.Web.Controllers string dateEnd02 = yCode + "-03-01"; var wipStaiton02 = await _pcsApi.GetWipStation4QRS014GroupB(param[1], dateStart02, dateEnd02, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate02 = 100.0; - //int sum_idx02 = 1; - double sum_rate02 = 0.0; - int sum_idx02 = 0; + double sum_rate02 = 100.0; + int sum_idx02 = 1; + //double sum_rate02 = 0.0; + //int sum_idx02 = 0; if (wipStaiton02.DataTotal > 0) { @@ -2728,9 +2771,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate02 = sum_rate02 * (rate / 100.0); - sum_idx02 = sum_idx02 + 1; - sum_rate02 = sum_rate02 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate02 = sum_rate02 * (rate / 100.0); + //sum_idx02 = sum_idx02 + 1; + //sum_rate02 = sum_rate02 + rate; } } } @@ -2752,12 +2796,13 @@ namespace AMESCoreStudio.Web.Controllers string dateStart03 = yCode + "-03-01"; string dateEnd03 = yCode + "-04-01"; var wipStaiton03 = await _pcsApi.GetWipStation4QRS014GroupB(param[1], dateStart03, dateEnd03, param[5], param[6], param[7]); - + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate03 = 100.0; - //int sum_idx03 = 1; - double sum_rate03 = 0.0; - int sum_idx03 = 0; + double sum_rate03 = 100.0; + int sum_idx03 = 1; + //double sum_rate03 = 0.0; + //int sum_idx03 = 0; if (wipStaiton03.DataTotal > 0) { @@ -2839,9 +2884,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate03 = sum_rate03 * (rate / 100.0); - sum_idx03 = sum_idx03 + 1; - sum_rate03 = sum_rate03 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate03 = sum_rate03 * (rate / 100.0); + //sum_idx03 = sum_idx03 + 1; + //sum_rate03 = sum_rate03 + rate; } } } @@ -2864,11 +2910,12 @@ namespace AMESCoreStudio.Web.Controllers string dateEnd04 = yCode + "-05-01"; var wipStaiton04 = await _pcsApi.GetWipStation4QRS014GroupB(param[1], dateStart04, dateEnd04, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate04 = 100.0; - //int sum_idx04 = 1; - double sum_rate04 = 0.0; - int sum_idx04 = 0; + double sum_rate04 = 100.0; + int sum_idx04 = 1; + //double sum_rate04 = 0.0; + //int sum_idx04 = 0; if (wipStaiton04.DataTotal > 0) { @@ -2950,9 +2997,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate04 = sum_rate04 * (rate / 100.0); - sum_idx04 = sum_idx04 + 1; - sum_rate04 = sum_rate04 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate04 = sum_rate04 * (rate / 100.0); + //sum_idx04 = sum_idx04 + 1; + //sum_rate04 = sum_rate04 + rate; } } } @@ -2975,11 +3023,12 @@ namespace AMESCoreStudio.Web.Controllers string dateEnd05 = yCode + "-06-01"; var wipStaiton05 = await _pcsApi.GetWipStation4QRS014GroupB(param[1], dateStart05, dateEnd05, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate05 = 100.0; - //int sum_idx05 = 1; - double sum_rate05 = 0.0; - int sum_idx05 = 0; + double sum_rate05 = 100.0; + int sum_idx05 = 1; + //double sum_rate05 = 0.0; + //int sum_idx05 = 0; if (wipStaiton05.DataTotal > 0) { @@ -3061,9 +3110,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate05 = sum_rate05 * (rate / 100.0); - sum_idx05 = sum_idx05 + 1; - sum_rate05 = sum_rate05 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate05 = sum_rate05 * (rate / 100.0); + //sum_idx05 = sum_idx05 + 1; + //sum_rate05 = sum_rate05 + rate; } } } @@ -3086,11 +3136,12 @@ namespace AMESCoreStudio.Web.Controllers string dateEnd06 = yCode + "-07-01"; var wipStaiton06 = await _pcsApi.GetWipStation4QRS014GroupB(param[1], dateStart06, dateEnd06, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate06 = 100.0; - //int sum_idx06 = 1; - double sum_rate06 = 0.0; - int sum_idx06 = 0; + double sum_rate06 = 100.0; + int sum_idx06 = 1; + //double sum_rate06 = 0.0; + //int sum_idx06 = 0; if (wipStaiton06.DataTotal > 0) { @@ -3172,9 +3223,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate06 = sum_rate06 * (rate / 100.0); - sum_idx06 = sum_idx06 + 1; - sum_rate06 = sum_rate06 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate06 = sum_rate06 * (rate / 100.0); + //sum_idx06 = sum_idx06 + 1; + //sum_rate06 = sum_rate06 + rate; } } } @@ -3197,11 +3249,12 @@ namespace AMESCoreStudio.Web.Controllers string dateEnd07 = yCode + "-08-01"; var wipStaiton07 = await _pcsApi.GetWipStation4QRS014GroupB(param[1], dateStart07, dateEnd07, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate07 = 100.0; - //int sum_idx07 = 1; - double sum_rate07 = 0.0; - int sum_idx07 = 0; + double sum_rate07 = 100.0; + int sum_idx07 = 1; + //double sum_rate07 = 0.0; + //int sum_idx07 = 0; if (wipStaiton07.DataTotal > 0) { @@ -3283,9 +3336,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate07 = sum_rate07 * (rate / 100.0); - sum_idx07 = sum_idx07 + 1; - sum_rate07 = sum_rate07 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate07 = sum_rate07 * (rate / 100.0); + //sum_idx07 = sum_idx07 + 1; + //sum_rate07 = sum_rate07 + rate; } } } @@ -3308,11 +3362,12 @@ namespace AMESCoreStudio.Web.Controllers string dateEnd08 = yCode + "-09-01"; var wipStaiton08 = await _pcsApi.GetWipStation4QRS014GroupB(param[1], dateStart08, dateEnd08, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate08 = 100.0; - //int sum_idx08 = 1; - double sum_rate08 = 0.0; - int sum_idx08 = 0; + double sum_rate08 = 100.0; + int sum_idx08 = 1; + //double sum_rate08 = 0.0; + //int sum_idx08 = 0; if (wipStaiton08.DataTotal > 0) { @@ -3394,9 +3449,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate08 = sum_rate08 * (rate / 100.0); - sum_idx08 = sum_idx08 + 1; - sum_rate08 = sum_rate08 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate08 = sum_rate08 * (rate / 100.0); + //sum_idx08 = sum_idx08 + 1; + //sum_rate08 = sum_rate08 + rate; } } } @@ -3419,11 +3475,12 @@ namespace AMESCoreStudio.Web.Controllers string dateEnd09 = yCode + "-10-01"; var wipStaiton09 = await _pcsApi.GetWipStation4QRS014GroupB(param[1], dateStart09, dateEnd09, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate09 = 100.0; - //int sum_idx09 = 1; - double sum_rate09 = 0.0; - int sum_idx09 = 0; + double sum_rate09 = 100.0; + int sum_idx09 = 1; + //double sum_rate09 = 0.0; + //int sum_idx09 = 0; if (wipStaiton09.DataTotal > 0) { @@ -3505,9 +3562,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate09 = sum_rate09 * (rate / 100.0); - sum_idx09 = sum_idx09 + 1; - sum_rate09 = sum_rate09 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate09 = sum_rate09 * (rate / 100.0); + //sum_idx09 = sum_idx09 + 1; + //sum_rate09 = sum_rate09 + rate; } } } @@ -3530,11 +3588,12 @@ namespace AMESCoreStudio.Web.Controllers string dateEnd10 = yCode + "-11-01"; var wipStaiton10 = await _pcsApi.GetWipStation4QRS014GroupB(param[1], dateStart10, dateEnd10, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate10 = 100.0; - //int sum_idx10 = 1; - double sum_rate10 = 0.0; - int sum_idx10 = 0; + double sum_rate10 = 100.0; + int sum_idx10 = 1; + //double sum_rate10 = 0.0; + //int sum_idx10 = 0; if (wipStaiton10.DataTotal > 0) { @@ -3616,9 +3675,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate10 = sum_rate10 * (rate / 100.0); - sum_idx10 = sum_idx10 + 1; - sum_rate10 = sum_rate10 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate10 = sum_rate10 * (rate / 100.0); + //sum_idx10 = sum_idx10 + 1; + //sum_rate10 = sum_rate10 + rate; } } } @@ -3641,11 +3701,12 @@ namespace AMESCoreStudio.Web.Controllers string dateEnd11 = yCode + "-12-01"; var wipStaiton11 = await _pcsApi.GetWipStation4QRS014GroupB(param[1], dateStart11, dateEnd11, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate11 = 100.0; - //int sum_idx11 = 1; - double sum_rate11 = 0.0; - int sum_idx11 = 0; + double sum_rate11 = 100.0; + int sum_idx11 = 1; + //double sum_rate11 = 0.0; + //int sum_idx11 = 0; if (wipStaiton11.DataTotal > 0) { @@ -3727,9 +3788,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate11 = sum_rate11 * (rate / 100.0); - sum_idx11 = sum_idx11 + 1; - sum_rate11 = sum_rate11 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate11 = sum_rate11 * (rate / 100.0); + //sum_idx11 = sum_idx11 + 1; + //sum_rate11 = sum_rate11 + rate; } } } @@ -3752,11 +3814,12 @@ namespace AMESCoreStudio.Web.Controllers string dateEnd12 = (int.Parse(yCode) + 1).ToString() + "-01-01"; var wipStaiton12 = await _pcsApi.GetWipStation4QRS014GroupB(param[1], dateStart12, dateEnd12, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate12 = 100.0; - //int sum_idx12 = 1; - double sum_rate12 = 0.0; - int sum_idx12 = 0; + double sum_rate12 = 100.0; + int sum_idx12 = 1; + //double sum_rate12 = 0.0; + //int sum_idx12 = 0; if (wipStaiton12.DataTotal > 0) { @@ -3838,9 +3901,10 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate12 = sum_rate12 * (rate / 100.0); - sum_idx12 = sum_idx12 + 1; - sum_rate12 = sum_rate12 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate12 = sum_rate12 * (rate / 100.0); + //sum_idx12 = sum_idx12 + 1; + //sum_rate12 = sum_rate12 + rate; } } } @@ -3861,11 +3925,11 @@ namespace AMESCoreStudio.Web.Controllers } [HttpPost] - public async Task GetYieldData4QRS014CBAsync(string id) + public async Task GetYieldData4QRS014BMAsync(string id) { string[] param = id.Split('_'); - var query = new QRS014CViewModel(); + var query = new QRS014BViewModel(); string yCode = DateTime.Now.Year.ToString(); if (param[3] != null) @@ -3876,28 +3940,39 @@ namespace AMESCoreStudio.Web.Controllers } } - var wipStation = await _pcsApi.GetWipStation4QRS014GroupBByWeek(param[1], param[3], param[4], param[5], param[6], param[7]); + #region 01 - if (wipStation.DataTotal > 0) + string dateStart01 = yCode + "-01-01"; + string dateEnd01 = yCode + "-02-01"; + var wipStaiton01 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart01, dateEnd01, param[5], param[6], param[7]); + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + //2024-03-26 BB.Wang Modify 修正良率(代小平) + double sum_rate01 = 100.0; + int sum_idx01 = 1; + //double sum_rate01 = 0.0; + //int sum_idx01 = 0; + + if (wipStaiton01.DataTotal > 0) { DataTable dtRate = new DataTable(); - dtRate.Columns.Add("WEEK_CODE"); + dtRate.Columns.Add("STATION_ID"); dtRate.Columns.Add("OK_QTY"); dtRate.Columns.Add("NG_QTY"); dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStation.Data) + foreach (var data in wipStaiton01.Data) { JObject j0 = JObject.Parse(data.ToString()); - string weekCode = j0["weekCode"].ToString(); + int stationID = int.Parse(j0["stationID"].ToString()); bool existFlag = false; int idx = 0; for (int i = 0; i < dtRate.Rows.Count; i++) { - if (dtRate.Rows[i]["WEEK_CODE"].ToString() == weekCode) + if (dtRate.Rows[i]["STATION_ID"].ToString() == stationID.ToString()) { idx = i; existFlag = true; @@ -3932,7 +4007,7 @@ namespace AMESCoreStudio.Web.Controllers else { DataRow dr = dtRate.NewRow(); - dr[0] = weekCode; + dr[0] = stationID; dr[1] = okQty; dr[2] = ngQty; @@ -3945,7 +4020,6 @@ namespace AMESCoreStudio.Web.Controllers { for (int j = 0; j < dtRate.Rows.Count; j++) { - string week_code = dtRate.Rows[j][0].ToString(); int okQty = int.Parse(dtRate.Rows[j][1].ToString()); int ngQty = int.Parse(dtRate.Rows[j][2].ToString()); @@ -3957,56 +4031,61 @@ namespace AMESCoreStudio.Web.Controllers rate = (okQty * 1.0 / inputQty) * 100; } - query.FPYDatas.Add(new FPY4WeekGroup + if (rate > 0) { - Week = week_code, - Yield = double.Parse(rate.ToString("0.00")) - }); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate01 = sum_rate01 * (rate / 100.0); + //sum_idx01 = sum_idx01 + 1; + //sum_rate01 = sum_rate01 + rate; + } } } } + else + { + sum_rate01 = 0.00; + } + query.FPYDatas.Add(new FPY4MonthGroup + { + Month = yCode + "-01", + Yield = double.Parse((sum_rate01 / sum_idx01).ToString("0.00")) + }); - return Json(query.FPYDatas); - } - - [HttpPost] - public async Task GetYieldData4QRS014CMAsync(string id) - { - string[] param = id.Split('_'); + #endregion - var query = new QRS014CViewModel(); + #region 02 - string yCode = DateTime.Now.Year.ToString(); - if (param[3] != null) - { - if (param[3] != "") - { - yCode = param[3].Substring(0, 4); - } - } + string dateStart02 = yCode + "-02-01"; + string dateEnd02 = yCode + "-03-01"; + var wipStaiton02 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart02, dateEnd02, param[5], param[6], param[7]); - var wipStation = await _pcsApi.GetWipStation4QRS014GroupMByWeek(param[1], param[3], param[4], param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + //2024-03-26 BB.Wang Modify 修正良率(代小平) + double sum_rate02 = 100.0; + int sum_idx02 = 1; + //double sum_rate02 = 0.0; + //int sum_idx02 = 0; - if (wipStation.DataTotal > 0) + if (wipStaiton02.DataTotal > 0) { DataTable dtRate = new DataTable(); - dtRate.Columns.Add("WEEK_CODE"); + dtRate.Columns.Add("STATION_ID"); dtRate.Columns.Add("OK_QTY"); dtRate.Columns.Add("NG_QTY"); dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStation.Data) + foreach (var data in wipStaiton02.Data) { JObject j0 = JObject.Parse(data.ToString()); - string weekCode = j0["weekCode"].ToString(); + int stationID = int.Parse(j0["stationID"].ToString()); bool existFlag = false; int idx = 0; for (int i = 0; i < dtRate.Rows.Count; i++) { - if (dtRate.Rows[i]["WEEK_CODE"].ToString() == weekCode) + if (dtRate.Rows[i]["STATION_ID"].ToString() == stationID.ToString()) { idx = i; existFlag = true; @@ -4041,7 +4120,7 @@ namespace AMESCoreStudio.Web.Controllers else { DataRow dr = dtRate.NewRow(); - dr[0] = weekCode; + dr[0] = stationID; dr[1] = okQty; dr[2] = ngQty; @@ -4054,7 +4133,6 @@ namespace AMESCoreStudio.Web.Controllers { for (int j = 0; j < dtRate.Rows.Count; j++) { - string week_code = dtRate.Rows[j][0].ToString(); int okQty = int.Parse(dtRate.Rows[j][1].ToString()); int ngQty = int.Parse(dtRate.Rows[j][2].ToString()); @@ -4066,57 +4144,61 @@ namespace AMESCoreStudio.Web.Controllers rate = (okQty * 1.0 / inputQty) * 100; } - query.FPYDatas.Add(new FPY4WeekGroup + if (rate > 0) { - Week = week_code, - Yield = double.Parse(rate.ToString("0.00")) - }); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate02 = sum_rate02 * (rate / 100.0); + //sum_idx02 = sum_idx02 + 1; + //sum_rate02 = sum_rate02 + rate; + } } } } + else + { + sum_rate02 = 0.00; + } + query.FPYDatas.Add(new FPY4MonthGroup + { + Month = yCode + "-02", + Yield = double.Parse((sum_rate02 / sum_idx02).ToString("0.00")) + }); - return Json(query.FPYDatas); - } - - //直通率 --- 周 - [HttpPost] - public async Task GetYieldData4QRS014CSAsync(string id) - { - string[] param = id.Split('_'); + #endregion - var query = new QRS014CViewModel(); + #region 03 - string yCode = DateTime.Now.Year.ToString(); - if (param[3] != null) - { - if (param[3] != "") - { - yCode = param[3].Substring(0, 4); - } - } + string dateStart03 = yCode + "-03-01"; + string dateEnd03 = yCode + "-04-01"; + var wipStaiton03 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart03, dateEnd03, param[5], param[6], param[7]); - var wipStation = await _pcsApi.GetWipStation4QRS014GroupSByWeek(param[1], param[3], param[4], param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + //2024-03-26 BB.Wang Modify 修正良率(代小平) + double sum_rate03 = 100.0; + int sum_idx03 = 1; + //double sum_rate03 = 0.0; + //int sum_idx03 = 0; - if (wipStation.DataTotal > 0) + if (wipStaiton03.DataTotal > 0) { DataTable dtRate = new DataTable(); - dtRate.Columns.Add("WEEK_CODE"); + dtRate.Columns.Add("STATION_ID"); dtRate.Columns.Add("OK_QTY"); dtRate.Columns.Add("NG_QTY"); dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStation.Data) + foreach (var data in wipStaiton03.Data) { JObject j0 = JObject.Parse(data.ToString()); - string weekCode = j0["weekCode"].ToString(); + int stationID = int.Parse(j0["stationID"].ToString()); bool existFlag = false; int idx = 0; for (int i = 0; i < dtRate.Rows.Count; i++) { - if (dtRate.Rows[i]["WEEK_CODE"].ToString() == weekCode) + if (dtRate.Rows[i]["STATION_ID"].ToString() == stationID.ToString()) { idx = i; existFlag = true; @@ -4151,7 +4233,7 @@ namespace AMESCoreStudio.Web.Controllers else { DataRow dr = dtRate.NewRow(); - dr[0] = weekCode; + dr[0] = stationID; dr[1] = okQty; dr[2] = ngQty; @@ -4164,7 +4246,6 @@ namespace AMESCoreStudio.Web.Controllers { for (int j = 0; j < dtRate.Rows.Count; j++) { - string week_code = dtRate.Rows[j][0].ToString(); int okQty = int.Parse(dtRate.Rows[j][1].ToString()); int ngQty = int.Parse(dtRate.Rows[j][2].ToString()); @@ -4176,47 +4257,42 @@ namespace AMESCoreStudio.Web.Controllers rate = (okQty * 1.0 / inputQty) * 100; } - query.FPYDatas.Add(new FPY4WeekGroup + if (rate > 0) { - Week = week_code, - Yield = double.Parse(rate.ToString("0.00")) - }); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate03 = sum_rate03 * (rate / 100.0); + //sum_idx03 = sum_idx03 + 1; + //sum_rate03 = sum_rate03 + rate; + } } } } - - return Json(query.FPYDatas); - } - - [HttpPost] - public async Task GetYieldData4QRS014BMAsync(string id) - { - string[] param = id.Split('_'); - - var query = new QRS014BViewModel(); - - string yCode = DateTime.Now.Year.ToString(); - if (param[3] != null) + else { - if (param[3] != "") - { - yCode = param[3].Substring(0, 4); - } + sum_rate03 = 0.00; } + query.FPYDatas.Add(new FPY4MonthGroup + { + Month = yCode + "-03", + Yield = double.Parse((sum_rate03 / sum_idx03).ToString("0.00")) + }); - #region 01 + #endregion - string dateStart01 = yCode + "-01-01"; - string dateEnd01 = yCode + "-02-01"; - var wipStaiton01 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart01, dateEnd01, param[5], param[6], param[7]); + #region 04 + + string dateStart04 = yCode + "-04-01"; + string dateEnd04 = yCode + "-05-01"; + var wipStaiton04 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart04, dateEnd04, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate01 = 100.0; - //int sum_idx01 = 1; - double sum_rate01 = 0.0; - int sum_idx01 = 0; + double sum_rate04 = 100.0; + int sum_idx04 = 1; + //double sum_rate04 = 0.0; + //int sum_idx04 = 0; - if (wipStaiton01.DataTotal > 0) + if (wipStaiton04.DataTotal > 0) { DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -4225,7 +4301,7 @@ namespace AMESCoreStudio.Web.Controllers dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStaiton01.Data) + foreach (var data in wipStaiton04.Data) { JObject j0 = JObject.Parse(data.ToString()); int stationID = int.Parse(j0["stationID"].ToString()); @@ -4296,38 +4372,40 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate01 = sum_rate01 * (rate / 100.0); - sum_idx01 = sum_idx01 + 1; - sum_rate01 = sum_rate01 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate04 = sum_rate04 * (rate / 100.0); + //sum_idx04 = sum_idx04 + 1; + //sum_rate04 = sum_rate04 + rate; } } } } else { - sum_rate01 = 0.00; + sum_rate04 = 0.00; } query.FPYDatas.Add(new FPY4MonthGroup { - Month = yCode + "-01", - Yield = double.Parse((sum_rate01 / sum_idx01).ToString("0.00")) + Month = yCode + "-04", + Yield = double.Parse((sum_rate04 / sum_idx04).ToString("0.00")) }); #endregion - #region 02 + #region 05 - string dateStart02 = yCode + "-02-01"; - string dateEnd02 = yCode + "-03-01"; - var wipStaiton02 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart02, dateEnd02, param[5], param[6], param[7]); + string dateStart05 = yCode + "-05-01"; + string dateEnd05 = yCode + "-06-01"; + var wipStaiton05 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart05, dateEnd05, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate02 = 100.0; - //int sum_idx02 = 1; - double sum_rate02 = 0.0; - int sum_idx02 = 0; + double sum_rate05 = 100.0; + int sum_idx05 = 1; + //double sum_rate05 = 0.0; + //int sum_idx05 = 0; - if (wipStaiton02.DataTotal > 0) + if (wipStaiton05.DataTotal > 0) { DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -4336,7 +4414,7 @@ namespace AMESCoreStudio.Web.Controllers dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStaiton02.Data) + foreach (var data in wipStaiton05.Data) { JObject j0 = JObject.Parse(data.ToString()); int stationID = int.Parse(j0["stationID"].ToString()); @@ -4407,38 +4485,40 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate02 = sum_rate02 * (rate / 100.0); - sum_idx02 = sum_idx02 + 1; - sum_rate02 = sum_rate02 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate05 = sum_rate05 * (rate / 100.0); + //sum_idx05 = sum_idx05 + 1; + //sum_rate05 = sum_rate05 + rate; } } } } else { - sum_rate02 = 0.00; + sum_rate05 = 0.00; } query.FPYDatas.Add(new FPY4MonthGroup { - Month = yCode + "-02", - Yield = double.Parse((sum_rate02 / sum_idx02).ToString("0.00")) + Month = yCode + "-05", + Yield = double.Parse((sum_rate05 / sum_idx05).ToString("0.00")) }); #endregion - #region 03 + #region 06 - string dateStart03 = yCode + "-03-01"; - string dateEnd03 = yCode + "-04-01"; - var wipStaiton03 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart03, dateEnd03, param[5], param[6], param[7]); + string dateStart06 = yCode + "-06-01"; + string dateEnd06 = yCode + "-07-01"; + var wipStaiton06 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart06, dateEnd06, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate03 = 100.0; - //int sum_idx03 = 1; - double sum_rate03 = 0.0; - int sum_idx03 = 0; + double sum_rate06 = 100.0; + int sum_idx06 = 1; + //double sum_rate06 = 0.0; + //int sum_idx06 = 0; - if (wipStaiton03.DataTotal > 0) + if (wipStaiton06.DataTotal > 0) { DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -4447,7 +4527,7 @@ namespace AMESCoreStudio.Web.Controllers dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStaiton03.Data) + foreach (var data in wipStaiton06.Data) { JObject j0 = JObject.Parse(data.ToString()); int stationID = int.Parse(j0["stationID"].ToString()); @@ -4518,38 +4598,40 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate03 = sum_rate03 * (rate / 100.0); - sum_idx03 = sum_idx03 + 1; - sum_rate03 = sum_rate03 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate06 = sum_rate06 * (rate / 100.0); + //sum_idx06 = sum_idx06 + 1; + //sum_rate06 = sum_rate06 + rate; } } } } else { - sum_rate03 = 0.00; + sum_rate06 = 0.00; } query.FPYDatas.Add(new FPY4MonthGroup { - Month = yCode + "-03", - Yield = double.Parse((sum_rate03 / sum_idx03).ToString("0.00")) + Month = yCode + "-06", + Yield = double.Parse((sum_rate06 / sum_idx06).ToString("0.00")) }); #endregion - #region 04 + #region 07 - string dateStart04 = yCode + "-04-01"; - string dateEnd04 = yCode + "-05-01"; - var wipStaiton04 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart04, dateEnd04, param[5], param[6], param[7]); + string dateStart07 = yCode + "-07-01"; + string dateEnd07 = yCode + "-08-01"; + var wipStaiton07 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart07, dateEnd07, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate04 = 100.0; - //int sum_idx04 = 1; - double sum_rate04 = 0.0; - int sum_idx04 = 0; + double sum_rate07 = 100.0; + int sum_idx07 = 1; + //double sum_rate07 = 0.0; + //int sum_idx07 = 0; - if (wipStaiton04.DataTotal > 0) + if (wipStaiton07.DataTotal > 0) { DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -4558,7 +4640,7 @@ namespace AMESCoreStudio.Web.Controllers dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStaiton04.Data) + foreach (var data in wipStaiton07.Data) { JObject j0 = JObject.Parse(data.ToString()); int stationID = int.Parse(j0["stationID"].ToString()); @@ -4629,38 +4711,39 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate04 = sum_rate04 * (rate / 100.0); - sum_idx04 = sum_idx04 + 1; - sum_rate04 = sum_rate04 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate07 = sum_rate07 * (rate / 100.0); + //sum_idx07 = sum_idx07 + 1; + //sum_rate07 = sum_rate07 + rate; } } } } else { - sum_rate04 = 0.00; + sum_rate07 = 0.00; } query.FPYDatas.Add(new FPY4MonthGroup { - Month = yCode + "-04", - Yield = double.Parse((sum_rate04 / sum_idx04).ToString("0.00")) + Month = yCode + "-07", + Yield = double.Parse((sum_rate07 / sum_idx07).ToString("0.00")) }); #endregion - #region 05 + #region 08 - string dateStart05 = yCode + "-05-01"; - string dateEnd05 = yCode + "-06-01"; - var wipStaiton05 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart05, dateEnd05, param[5], param[6], param[7]); - + string dateStart08 = yCode + "-08-01"; + string dateEnd08 = yCode + "-09-01"; + var wipStaiton08 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart08, dateEnd08, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate05 = 100.0; - //int sum_idx05 = 1; - double sum_rate05 = 0.0; - int sum_idx05 = 0; + double sum_rate08 = 100.0; + int sum_idx08 = 1; + //double sum_rate08 = 0.0; + //int sum_idx08 = 0; - if (wipStaiton05.DataTotal > 0) + if (wipStaiton08.DataTotal > 0) { DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -4669,7 +4752,7 @@ namespace AMESCoreStudio.Web.Controllers dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStaiton05.Data) + foreach (var data in wipStaiton08.Data) { JObject j0 = JObject.Parse(data.ToString()); int stationID = int.Parse(j0["stationID"].ToString()); @@ -4740,38 +4823,40 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate05 = sum_rate05 * (rate / 100.0); - sum_idx05 = sum_idx05 + 1; - sum_rate05 = sum_rate05 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate08 = sum_rate08 * (rate / 100.0); + //sum_idx08 = sum_idx08 + 1; + //sum_rate08 = sum_rate08 + rate; } } } } else { - sum_rate05 = 0.00; + sum_rate08 = 0.00; } query.FPYDatas.Add(new FPY4MonthGroup { - Month = yCode + "-05", - Yield = double.Parse((sum_rate05 / sum_idx05).ToString("0.00")) + Month = yCode + "-08", + Yield = double.Parse((sum_rate08 / sum_idx08).ToString("0.00")) }); #endregion - #region 06 + #region 09 - string dateStart06 = yCode + "-06-01"; - string dateEnd06 = yCode + "-07-01"; - var wipStaiton06 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart06, dateEnd06, param[5], param[6], param[7]); + string dateStart09 = yCode + "-09-01"; + string dateEnd09 = yCode + "-10-01"; + var wipStaiton09 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart09, dateEnd09, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate06 = 100.0; - //int sum_idx06 = 1; - double sum_rate06 = 0.0; - int sum_idx06 = 0; + double sum_rate09 = 100.0; + int sum_idx09 = 1; + //double sum_rate09 = 0.0; + //int sum_idx09 = 0; - if (wipStaiton06.DataTotal > 0) + if (wipStaiton09.DataTotal > 0) { DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -4780,7 +4865,7 @@ namespace AMESCoreStudio.Web.Controllers dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStaiton06.Data) + foreach (var data in wipStaiton09.Data) { JObject j0 = JObject.Parse(data.ToString()); int stationID = int.Parse(j0["stationID"].ToString()); @@ -4851,38 +4936,40 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate06 = sum_rate06 * (rate / 100.0); - sum_idx06 = sum_idx06 + 1; - sum_rate06 = sum_rate06 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate09 = sum_rate09 * (rate / 100.0); + //sum_idx09 = sum_idx09 + 1; + //sum_rate09 = sum_rate09 + rate; } } } } else { - sum_rate06 = 0.00; + sum_rate09 = 0.00; } query.FPYDatas.Add(new FPY4MonthGroup { - Month = yCode + "-06", - Yield = double.Parse((sum_rate06 / sum_idx06).ToString("0.00")) + Month = yCode + "-09", + Yield = double.Parse((sum_rate09 / sum_idx09).ToString("0.00")) }); #endregion - #region 07 + #region 10 - string dateStart07 = yCode + "-07-01"; - string dateEnd07 = yCode + "-08-01"; - var wipStaiton07 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart07, dateEnd07, param[5], param[6], param[7]); - + string dateStart10 = yCode + "-10-01"; + string dateEnd10 = yCode + "-11-01"; + var wipStaiton10 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart10, dateEnd10, param[5], param[6], param[7]); + + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate07 = 100.0; - //int sum_idx07 = 1; - double sum_rate07 = 0.0; - int sum_idx07 = 0; + double sum_rate10 = 100.0; + int sum_idx10 = 1; + //double sum_rate10 = 0.0; + //int sum_idx10 = 0; - if (wipStaiton07.DataTotal > 0) + if (wipStaiton10.DataTotal > 0) { DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -4891,7 +4978,7 @@ namespace AMESCoreStudio.Web.Controllers dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStaiton07.Data) + foreach (var data in wipStaiton10.Data) { JObject j0 = JObject.Parse(data.ToString()); int stationID = int.Parse(j0["stationID"].ToString()); @@ -4962,38 +5049,40 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate07 = sum_rate07 * (rate / 100.0); - sum_idx07 = sum_idx07 + 1; - sum_rate07 = sum_rate07 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate10 = sum_rate10 * (rate / 100.0); + //sum_idx10 = sum_idx10 + 1; + //sum_rate10 = sum_rate10 + rate; } } } } else { - sum_rate07 = 0.00; + sum_rate10 = 0.00; } query.FPYDatas.Add(new FPY4MonthGroup { - Month = yCode + "-07", - Yield = double.Parse((sum_rate07 / sum_idx07).ToString("0.00")) + Month = yCode + "-10", + Yield = double.Parse((sum_rate10 / sum_idx10).ToString("0.00")) }); #endregion - #region 08 + #region 11 - string dateStart08 = yCode + "-08-01"; - string dateEnd08 = yCode + "-09-01"; - var wipStaiton08 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart08, dateEnd08, param[5], param[6], param[7]); + string dateStart11 = yCode + "-11-01"; + string dateEnd11 = yCode + "-12-01"; + var wipStaiton11 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart11, dateEnd11, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate08 = 100.0; - //int sum_idx08 = 1; - double sum_rate08 = 0.0; - int sum_idx08 = 0; + double sum_rate11 = 100.0; + int sum_idx11 = 1; + //double sum_rate11 = 0.0; + //int sum_idx11 = 0; - if (wipStaiton08.DataTotal > 0) + if (wipStaiton11.DataTotal > 0) { DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -5002,7 +5091,7 @@ namespace AMESCoreStudio.Web.Controllers dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStaiton08.Data) + foreach (var data in wipStaiton11.Data) { JObject j0 = JObject.Parse(data.ToString()); int stationID = int.Parse(j0["stationID"].ToString()); @@ -5073,38 +5162,40 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate08 = sum_rate08 * (rate / 100.0); - sum_idx08 = sum_idx08 + 1; - sum_rate08 = sum_rate08 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate11 = sum_rate11 * (rate / 100.0); + //sum_idx11 = sum_idx11 + 1; + //sum_rate11 = sum_rate11 + rate; } } } } else { - sum_rate08 = 0.00; + sum_rate11 = 0.00; } query.FPYDatas.Add(new FPY4MonthGroup { - Month = yCode + "-08", - Yield = double.Parse((sum_rate08 / sum_idx08).ToString("0.00")) + Month = yCode + "-11", + Yield = double.Parse((sum_rate11 / sum_idx11).ToString("0.00")) }); #endregion - #region 09 + #region 12 - string dateStart09 = yCode + "-09-01"; - string dateEnd09 = yCode + "-10-01"; - var wipStaiton09 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart09, dateEnd09, param[5], param[6], param[7]); + string dateStart12 = yCode + "-12-01"; + string dateEnd12 = (int.Parse(yCode) + 1).ToString() + "-01-01"; + var wipStaiton12 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart12, dateEnd12, param[5], param[6], param[7]); + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate09 = 100.0; - //int sum_idx09 = 1; - double sum_rate09 = 0.0; - int sum_idx09 = 0; + double sum_rate12 = 100.0; + int sum_idx12 = 1; + //double sum_rate12 = 0.0; + //int sum_idx12 = 0; - if (wipStaiton09.DataTotal > 0) + if (wipStaiton12.DataTotal > 0) { DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -5113,7 +5204,7 @@ namespace AMESCoreStudio.Web.Controllers dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStaiton09.Data) + foreach (var data in wipStaiton12.Data) { JObject j0 = JObject.Parse(data.ToString()); int stationID = int.Parse(j0["stationID"].ToString()); @@ -5184,57 +5275,67 @@ namespace AMESCoreStudio.Web.Controllers if (rate > 0) { - //sum_rate09 = sum_rate09 * (rate / 100.0); - sum_idx09 = sum_idx09 + 1; - sum_rate09 = sum_rate09 + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate12 = sum_rate12 * (rate / 100.0); + //sum_idx12 = sum_idx12 + 1; + //sum_rate12 = sum_rate12 + rate; } } } } else { - sum_rate09 = 0.00; + sum_rate12 = 0.00; } query.FPYDatas.Add(new FPY4MonthGroup { - Month = yCode + "-09", - Yield = double.Parse((sum_rate09 / sum_idx09).ToString("0.00")) + Month = yCode + "-12", + Yield = double.Parse((sum_rate12 / sum_idx12).ToString("0.00")) }); #endregion - #region 10 + return Json(query.FPYDatas); + } - string dateStart10 = yCode + "-10-01"; - string dateEnd10 = yCode + "-11-01"; - var wipStaiton10 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart10, dateEnd10, param[5], param[6], param[7]); + [HttpPost] + public async Task GetYieldData4QRS014CBAsync(string id) + { + string[] param = id.Split('_'); - //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate10 = 100.0; - //int sum_idx10 = 1; - double sum_rate10 = 0.0; - int sum_idx10= 0; + var query = new QRS014CViewModel(); - if (wipStaiton10.DataTotal > 0) + string yCode = DateTime.Now.Year.ToString(); + if (param[3] != null) + { + if (param[3] != "") + { + yCode = param[3].Substring(0, 4); + } + } + + var wipStation = await _pcsApi.GetWipStation4QRS014GroupBByWeek(param[1], param[3], param[4], param[5], param[6], param[7]); + + if (wipStation.DataTotal > 0) { DataTable dtRate = new DataTable(); - dtRate.Columns.Add("STATION_ID"); + dtRate.Columns.Add("WEEK_CODE"); dtRate.Columns.Add("OK_QTY"); dtRate.Columns.Add("NG_QTY"); dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStaiton10.Data) + foreach (var data in wipStation.Data) { JObject j0 = JObject.Parse(data.ToString()); - int stationID = int.Parse(j0["stationID"].ToString()); + string weekCode = j0["weekCode"].ToString(); bool existFlag = false; int idx = 0; for (int i = 0; i < dtRate.Rows.Count; i++) { - if (dtRate.Rows[i]["STATION_ID"].ToString() == stationID.ToString()) + if (dtRate.Rows[i]["WEEK_CODE"].ToString() == weekCode) { idx = i; existFlag = true; @@ -5269,7 +5370,7 @@ namespace AMESCoreStudio.Web.Controllers else { DataRow dr = dtRate.NewRow(); - dr[0] = stationID; + dr[0] = weekCode; dr[1] = okQty; dr[2] = ngQty; @@ -5282,6 +5383,7 @@ namespace AMESCoreStudio.Web.Controllers { for (int j = 0; j < dtRate.Rows.Count; j++) { + string week_code = dtRate.Rows[j][0].ToString(); int okQty = int.Parse(dtRate.Rows[j][1].ToString()); int ngQty = int.Parse(dtRate.Rows[j][2].ToString()); @@ -5293,59 +5395,56 @@ namespace AMESCoreStudio.Web.Controllers rate = (okQty * 1.0 / inputQty) * 100; } - if (rate > 0) + query.FPYDatas.Add(new FPY4WeekGroup { - //sum_rate10 = sum_rate10 * (rate / 100.0); - sum_idx10 = sum_idx10 + 1; - sum_rate10 = sum_rate10 + rate; - } + Week = week_code, + Yield = double.Parse(rate.ToString("0.00")) + }); } } } - else - { - sum_rate10 = 0.00; - } - query.FPYDatas.Add(new FPY4MonthGroup - { - Month = yCode + "-10", - Yield = double.Parse((sum_rate10 / sum_idx10).ToString("0.00")) - }); - #endregion + return Json(query.FPYDatas); + } - #region 11 + [HttpPost] + public async Task GetYieldData4QRS014CMAsync(string id) + { + string[] param = id.Split('_'); - string dateStart11 = yCode + "-11-01"; - string dateEnd11 = yCode + "-12-01"; - var wipStaiton11 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart11, dateEnd11, param[5], param[6], param[7]); + var query = new QRS014CViewModel(); - //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate11 = 100.0; - //int sum_idx11 = 1; - double sum_rate11 = 0.0; - int sum_idx11 = 0; + string yCode = DateTime.Now.Year.ToString(); + if (param[3] != null) + { + if (param[3] != "") + { + yCode = param[3].Substring(0, 4); + } + } - if (wipStaiton11.DataTotal > 0) + var wipStation = await _pcsApi.GetWipStation4QRS014GroupMByWeek(param[1], param[3], param[4], param[5], param[6], param[7]); + + if (wipStation.DataTotal > 0) { DataTable dtRate = new DataTable(); - dtRate.Columns.Add("STATION_ID"); + dtRate.Columns.Add("WEEK_CODE"); dtRate.Columns.Add("OK_QTY"); dtRate.Columns.Add("NG_QTY"); dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStaiton11.Data) + foreach (var data in wipStation.Data) { JObject j0 = JObject.Parse(data.ToString()); - int stationID = int.Parse(j0["stationID"].ToString()); + string weekCode = j0["weekCode"].ToString(); bool existFlag = false; int idx = 0; for (int i = 0; i < dtRate.Rows.Count; i++) { - if (dtRate.Rows[i]["STATION_ID"].ToString() == stationID.ToString()) + if (dtRate.Rows[i]["WEEK_CODE"].ToString() == weekCode) { idx = i; existFlag = true; @@ -5380,7 +5479,7 @@ namespace AMESCoreStudio.Web.Controllers else { DataRow dr = dtRate.NewRow(); - dr[0] = stationID; + dr[0] = weekCode; dr[1] = okQty; dr[2] = ngQty; @@ -5393,6 +5492,7 @@ namespace AMESCoreStudio.Web.Controllers { for (int j = 0; j < dtRate.Rows.Count; j++) { + string week_code = dtRate.Rows[j][0].ToString(); int okQty = int.Parse(dtRate.Rows[j][1].ToString()); int ngQty = int.Parse(dtRate.Rows[j][2].ToString()); @@ -5404,59 +5504,57 @@ namespace AMESCoreStudio.Web.Controllers rate = (okQty * 1.0 / inputQty) * 100; } - if (rate > 0) + query.FPYDatas.Add(new FPY4WeekGroup { - //sum_rate11 = sum_rate11 * (rate / 100.0); - sum_idx11 = sum_idx11 + 1; - sum_rate11 = sum_rate11 + rate; - } + Week = week_code, + Yield = double.Parse(rate.ToString("0.00")) + }); } } } - else - { - sum_rate11 = 0.00; - } - query.FPYDatas.Add(new FPY4MonthGroup - { - Month = yCode + "-11", - Yield = double.Parse((sum_rate11 / sum_idx11).ToString("0.00")) - }); - #endregion + return Json(query.FPYDatas); + } - #region 12 + //直通率 --- 周 + [HttpPost] + public async Task GetYieldData4QRS014CSAsync(string id) + { + string[] param = id.Split('_'); - string dateStart12 = yCode + "-12-01"; - string dateEnd12 = (int.Parse(yCode) + 1).ToString() + "-01-01"; - var wipStaiton12 = await _pcsApi.GetWipStation4QRS014GroupM(param[1], dateStart12, dateEnd12, param[5], param[6], param[7]); + var query = new QRS014CViewModel(); - //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate12 = 100.0; - //int sum_idx12 = 1; - double sum_rate12 = 0.0; - int sum_idx12 = 0; + string yCode = DateTime.Now.Year.ToString(); + if (param[3] != null) + { + if (param[3] != "") + { + yCode = param[3].Substring(0, 4); + } + } - if (wipStaiton12.DataTotal > 0) + var wipStation = await _pcsApi.GetWipStation4QRS014GroupSByWeek(param[1], param[3], param[4], param[5], param[6], param[7]); + + if (wipStation.DataTotal > 0) { DataTable dtRate = new DataTable(); - dtRate.Columns.Add("STATION_ID"); + dtRate.Columns.Add("WEEK_CODE"); dtRate.Columns.Add("OK_QTY"); dtRate.Columns.Add("NG_QTY"); dtRate.PrimaryKey = new DataColumn[] { dtRate.Columns[0] }; dtRate.AcceptChanges(); - foreach (var data in wipStaiton12.Data) + foreach (var data in wipStation.Data) { JObject j0 = JObject.Parse(data.ToString()); - int stationID = int.Parse(j0["stationID"].ToString()); + string weekCode = j0["weekCode"].ToString(); bool existFlag = false; int idx = 0; for (int i = 0; i < dtRate.Rows.Count; i++) { - if (dtRate.Rows[i]["STATION_ID"].ToString() == stationID.ToString()) + if (dtRate.Rows[i]["WEEK_CODE"].ToString() == weekCode) { idx = i; existFlag = true; @@ -5491,7 +5589,7 @@ namespace AMESCoreStudio.Web.Controllers else { DataRow dr = dtRate.NewRow(); - dr[0] = stationID; + dr[0] = weekCode; dr[1] = okQty; dr[2] = ngQty; @@ -5504,6 +5602,7 @@ namespace AMESCoreStudio.Web.Controllers { for (int j = 0; j < dtRate.Rows.Count; j++) { + string week_code = dtRate.Rows[j][0].ToString(); int okQty = int.Parse(dtRate.Rows[j][1].ToString()); int ngQty = int.Parse(dtRate.Rows[j][2].ToString()); @@ -5515,30 +5614,20 @@ namespace AMESCoreStudio.Web.Controllers rate = (okQty * 1.0 / inputQty) * 100; } - if (rate > 0) + query.FPYDatas.Add(new FPY4WeekGroup { - //sum_rate12 = sum_rate12 * (rate / 100.0); - sum_idx12 = sum_idx12 + 1; - sum_rate12 = sum_rate12 + rate; - } + Week = week_code, + Yield = double.Parse(rate.ToString("0.00")) + }); } } } - else - { - sum_rate12 = 0.00; - } - query.FPYDatas.Add(new FPY4MonthGroup - { - Month = yCode + "-12", - Yield = double.Parse((sum_rate12 / sum_idx12).ToString("0.00")) - }); - - #endregion return Json(query.FPYDatas); } + + public async Task QRS014AAsync(string unitNo, string werksNo, string itemNO, string wipNO, string dateStart, string dateEnd, string modelNO, string dateType) { if (werksNo == "*") @@ -5607,8 +5696,8 @@ namespace AMESCoreStudio.Web.Controllers rateDataList = rateDataList + "" + wip_no + "" + type + "" + item_no + ""; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - double sum_rate = 100.0; int sum_idx = 1; //double sum_rate = 0.0; @@ -5714,6 +5803,7 @@ namespace AMESCoreStudio.Web.Controllers var wipStaiton01 = await _pcsApi.GetWipStation4QRS014GroupS(itemNO, dateStart01, dateEnd01, modelNO, werksNo, dateType); if (wipStaiton01.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 照著小平的寫法(QRS014A) double sum_rate = 100.0; int sum_idx = 1; @@ -5820,6 +5910,7 @@ namespace AMESCoreStudio.Web.Controllers var wipStaiton02 = await _pcsApi.GetWipStation4QRS014GroupS(itemNO, dateStart02, dateEnd02, modelNO, werksNo, dateType); if (wipStaiton02.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -5926,6 +6017,7 @@ namespace AMESCoreStudio.Web.Controllers var wipStaiton03 = await _pcsApi.GetWipStation4QRS014GroupS(itemNO, dateStart03, dateEnd03, modelNO, werksNo, dateType); if (wipStaiton03.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -6032,6 +6124,7 @@ namespace AMESCoreStudio.Web.Controllers var wipStaiton04 = await _pcsApi.GetWipStation4QRS014GroupS(itemNO, dateStart04, dateEnd04, modelNO, werksNo, dateType); if (wipStaiton04.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -6138,6 +6231,7 @@ namespace AMESCoreStudio.Web.Controllers var wipStaiton05 = await _pcsApi.GetWipStation4QRS014GroupS(itemNO, dateStart05, dateEnd05, modelNO, werksNo, dateType); if (wipStaiton05.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -6244,6 +6338,7 @@ namespace AMESCoreStudio.Web.Controllers var wipStaiton06 = await _pcsApi.GetWipStation4QRS014GroupS(itemNO, dateStart06, dateEnd06, modelNO, werksNo, dateType); if (wipStaiton06.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -6350,6 +6445,7 @@ namespace AMESCoreStudio.Web.Controllers var wipStaiton07 = await _pcsApi.GetWipStation4QRS014GroupS(itemNO, dateStart07, dateEnd07, modelNO, werksNo, dateType); if (wipStaiton07.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -6456,6 +6552,7 @@ namespace AMESCoreStudio.Web.Controllers var wipStaiton08 = await _pcsApi.GetWipStation4QRS014GroupS(itemNO, dateStart08, dateEnd08, modelNO, werksNo, dateType); if (wipStaiton08.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -6562,6 +6659,7 @@ namespace AMESCoreStudio.Web.Controllers var wipStaiton09 = await _pcsApi.GetWipStation4QRS014GroupS(itemNO, dateStart09, dateEnd09, modelNO, werksNo, dateType); if (wipStaiton09.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -6668,6 +6766,7 @@ namespace AMESCoreStudio.Web.Controllers var wipStaiton10 = await _pcsApi.GetWipStation4QRS014GroupS(itemNO, dateStart10, dateEnd10, modelNO, werksNo, dateType); if (wipStaiton10.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -6774,6 +6873,7 @@ namespace AMESCoreStudio.Web.Controllers var wipStaiton11 = await _pcsApi.GetWipStation4QRS014GroupS(itemNO, dateStart11, dateEnd11, modelNO, werksNo, dateType); if (wipStaiton11.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -6880,6 +6980,7 @@ namespace AMESCoreStudio.Web.Controllers var wipStaiton12 = await _pcsApi.GetWipStation4QRS014GroupS(itemNO, dateStart12, dateEnd12, modelNO, werksNo, dateType); if (wipStaiton12.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -6991,6 +7092,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton01 = await _pcsApi.GetWipStation4QRS014GroupB(itemNO, dateStart01, dateEnd01, modelNO, werksNo, dateType); if (wipStaiton01.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -7097,6 +7199,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton02 = await _pcsApi.GetWipStation4QRS014GroupB(itemNO, dateStart02, dateEnd02, modelNO, werksNo, dateType); if (wipStaiton02.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -7203,6 +7306,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton03 = await _pcsApi.GetWipStation4QRS014GroupB(itemNO, dateStart03, dateEnd03, modelNO, werksNo, dateType); if (wipStaiton03.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -7309,6 +7413,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton04 = await _pcsApi.GetWipStation4QRS014GroupB(itemNO, dateStart04, dateEnd04, modelNO, werksNo, dateType); if (wipStaiton04.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -7415,6 +7520,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton05 = await _pcsApi.GetWipStation4QRS014GroupB(itemNO, dateStart05, dateEnd05, modelNO, werksNo, dateType); if (wipStaiton05.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -7521,6 +7627,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton06 = await _pcsApi.GetWipStation4QRS014GroupB(itemNO, dateStart06, dateEnd06, modelNO, werksNo, dateType); if (wipStaiton06.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -7627,6 +7734,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton07 = await _pcsApi.GetWipStation4QRS014GroupB(itemNO, dateStart07, dateEnd07, modelNO, werksNo, dateType); if (wipStaiton07.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -7733,6 +7841,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton08 = await _pcsApi.GetWipStation4QRS014GroupB(itemNO, dateStart08, dateEnd08, modelNO, werksNo, dateType); if (wipStaiton08.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -7839,6 +7948,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton09 = await _pcsApi.GetWipStation4QRS014GroupB(itemNO, dateStart09, dateEnd09, modelNO, werksNo, dateType); if (wipStaiton09.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -7945,6 +8055,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton10 = await _pcsApi.GetWipStation4QRS014GroupB(itemNO, dateStart10, dateEnd10, modelNO, werksNo, dateType); if (wipStaiton10.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -8051,6 +8162,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton11 = await _pcsApi.GetWipStation4QRS014GroupB(itemNO, dateStart11, dateEnd11, modelNO, werksNo, dateType); if (wipStaiton11.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -8157,6 +8269,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton12 = await _pcsApi.GetWipStation4QRS014GroupB(itemNO, dateStart12, dateEnd12, modelNO, werksNo, dateType); if (wipStaiton12.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -8268,6 +8381,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton01 = await _pcsApi.GetWipStation4QRS014GroupM(itemNO, dateStart01, dateEnd01, modelNO, werksNo, dateType); if (wipStaiton01.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -8374,6 +8488,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton02 = await _pcsApi.GetWipStation4QRS014GroupM(itemNO, dateStart02, dateEnd02, modelNO, werksNo, dateType); if (wipStaiton02.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -8480,6 +8595,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton03 = await _pcsApi.GetWipStation4QRS014GroupM(itemNO, dateStart03, dateEnd03, modelNO, werksNo, dateType); if (wipStaiton03.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -8586,6 +8702,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton04 = await _pcsApi.GetWipStation4QRS014GroupM(itemNO, dateStart04, dateEnd04, modelNO, werksNo, dateType); if (wipStaiton04.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -8692,6 +8809,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton05 = await _pcsApi.GetWipStation4QRS014GroupM(itemNO, dateStart05, dateEnd05, modelNO, werksNo, dateType); if (wipStaiton05.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -8798,6 +8916,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton06 = await _pcsApi.GetWipStation4QRS014GroupM(itemNO, dateStart06, dateEnd06, modelNO, werksNo, dateType); if (wipStaiton06.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -8904,6 +9023,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton07 = await _pcsApi.GetWipStation4QRS014GroupM(itemNO, dateStart07, dateEnd07, modelNO, werksNo, dateType); if (wipStaiton07.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -9010,6 +9130,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton08 = await _pcsApi.GetWipStation4QRS014GroupM(itemNO, dateStart08, dateEnd08, modelNO, werksNo, dateType); if (wipStaiton08.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -9116,6 +9237,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton09 = await _pcsApi.GetWipStation4QRS014GroupM(itemNO, dateStart09, dateEnd09, modelNO, werksNo, dateType); if (wipStaiton09.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -9222,6 +9344,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton10 = await _pcsApi.GetWipStation4QRS014GroupM(itemNO, dateStart10, dateEnd10, modelNO, werksNo, dateType); if (wipStaiton10.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -9328,6 +9451,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton11 = await _pcsApi.GetWipStation4QRS014GroupM(itemNO, dateStart11, dateEnd11, modelNO, werksNo, dateType); if (wipStaiton11.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; @@ -9434,6 +9558,7 @@ namespace AMESCoreStudio.Web.Controllers wipStaiton12 = await _pcsApi.GetWipStation4QRS014GroupM(itemNO, dateStart12, dateEnd12, modelNO, werksNo, dateType); if (wipStaiton12.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) double sum_rate = 100.0; int sum_idx = 1; diff --git a/AMESCoreStudio.Web/Views/RPT/RPT001.cshtml b/AMESCoreStudio.Web/Views/RPT/RPT001.cshtml index 5877c41f..2ef302e8 100644 --- a/AMESCoreStudio.Web/Views/RPT/RPT001.cshtml +++ b/AMESCoreStudio.Web/Views/RPT/RPT001.cshtml @@ -182,7 +182,7 @@
- +
@Model.invalidHours

H

diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionWorktimesController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionWorktimesController.cs index 62af6e77..94904e0e 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionWorktimesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionWorktimesController.cs @@ -351,14 +351,29 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES public async Task> GetExceptionWorktime4RPT001(string sdate, string edate) { ResultModel result = new ResultModel(); + //--------------------------------------------------------------------------- + //var q = from q1 in _context.ExceptionWorktimes + // select new + // { + // q1.ExceptionID, + // q1.ExceptionDate, + // q1.Time + + // }; + //--------------------------------------------------------------------------- var q = from q1 in _context.ExceptionWorktimes + join q2 in _context.ExceptionCodes on q1.ExceptionNo equals q2.ExceptionNo + join q3 in _context.ExceptionClasses on q2.ExceptionClassNo equals q3.ExceptionClassNo select new { q1.ExceptionID, q1.ExceptionDate, - q1.Time - + q1.Time, + q1.ExceptionNo, + q3.ExceptionClassNo + }; + //--------------------------------------------------------------------------- DateTime dateValue; if (sdate != "*") diff --git a/AMESCoreStudio.WebApi/Controllers/BLL/RPTController.cs b/AMESCoreStudio.WebApi/Controllers/BLL/RPTController.cs index 831a83ba..e1a80133 100644 --- a/AMESCoreStudio.WebApi/Controllers/BLL/RPTController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BLL/RPTController.cs @@ -109,7 +109,7 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL double errTime = 0.00; if (c.DataTotal > 0) { - foreach (var item in c.Data) + foreach (var item in c.Data.Where(w => w.ExceptionClassNo == "O")) { string str = item.ToString(); string[] str2 = str.Replace("{", "").Replace("}", "").Split(','); @@ -135,11 +135,12 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL var d = await new WipStationController(_context).GetWipStation4QRS014GroupALL(null, sDate, eDate, null, "YS00", "FqcDate"); if (d.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate = 100.0; - //int sum_idx = 1; - double sum_rate = 0.0; - int sum_idx = 0; + double sum_rate = 100.0; + int sum_idx = 1; + //double sum_rate = 0.0; + //int sum_idx = 0; DataTable dtRate = new DataTable(); @@ -228,9 +229,10 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL if (rate > 0) { - //sum_rate = sum_rate * (rate / 100.0); - sum_idx = sum_idx + 1; - sum_rate = sum_rate + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate = sum_rate * (rate / 100.0); + //sum_idx = sum_idx + 1; + //sum_rate = sum_rate + rate; } } } @@ -1266,11 +1268,12 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL var f_FPYBoard_LEI = await new WipStationController(_context).GetWipStation4QRS014GroupS(null, sDate, sEnd_Date, null, "YS00", "FqcDate"); if (f_FPYBoard_LEI.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate = 100.0; - //int sum_idx = 1; - double sum_rate = 0.0; - int sum_idx = 0; + double sum_rate = 100.0; + int sum_idx = 1; + //double sum_rate = 0.0; + //int sum_idx = 0; DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -1358,9 +1361,10 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL if (rate > 0) { - //sum_rate = sum_rate * (rate / 100.0); - sum_idx = sum_idx + 1; - sum_rate = sum_rate + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate = sum_rate * (rate / 100.0); + //sum_idx = sum_idx + 1; + //sum_rate = sum_rate + rate; } } } @@ -1376,11 +1380,12 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL var f_FPYSystem_LEI = await new WipStationController(_context).GetWipStation4QRS014GroupB(null, sDate, sEnd_Date, null, "YS00", "FqcDate"); if (f_FPYSystem_LEI.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate = 100.0; - //int sum_idx = 1; - double sum_rate = 0.0; - int sum_idx = 0; + double sum_rate = 100.0; + int sum_idx = 1; + //double sum_rate = 0.0; + //int sum_idx = 0; DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -1468,9 +1473,10 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL if (rate > 0) { - //sum_rate = sum_rate * (rate / 100.0); - sum_idx = sum_idx + 1; - sum_rate = sum_rate + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate = sum_rate * (rate / 100.0); + //sum_idx = sum_idx + 1; + //sum_rate = sum_rate + rate; } } } @@ -1486,11 +1492,12 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL var f_FPYMedical_LEI = await new WipStationController(_context).GetWipStation4QRS014GroupM(null, sDate, sEnd_Date, null, "YS00", "FqcDate"); if (f_FPYMedical_LEI.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate = 100.0; - //int sum_idx = 1; - double sum_rate = 0.0; - int sum_idx = 0; + double sum_rate = 100.0; + int sum_idx = 1; + //double sum_rate = 0.0; + //int sum_idx = 0; DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -1578,9 +1585,10 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL if (rate > 0) { - //sum_rate = sum_rate * (rate / 100.0); - sum_idx = sum_idx + 1; - sum_rate = sum_rate + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate = sum_rate * (rate / 100.0); + //sum_idx = sum_idx + 1; + //sum_rate = sum_rate + rate; } } } @@ -1596,11 +1604,12 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL var f_FPYBoard = await new WipStationController(_context).GetWipStation4QRS014GroupS(null, sDate, sEnd_Date, null, werksNo, "FqcDate"); if (f_FPYBoard.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate = 100.0; - //int sum_idx = 1; - double sum_rate = 0.0; - int sum_idx = 0; + double sum_rate = 100.0; + int sum_idx = 1; + //double sum_rate = 0.0; + //int sum_idx = 0; DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -1688,9 +1697,10 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL if (rate > 0) { - //sum_rate = sum_rate * (rate / 100.0); - sum_idx = sum_idx + 1; - sum_rate = sum_rate + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate = sum_rate * (rate / 100.0); + //sum_idx = sum_idx + 1; + //sum_rate = sum_rate + rate; } } } @@ -1706,11 +1716,12 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL var f_FPYSystem = await new WipStationController(_context).GetWipStation4QRS014GroupB(null, sDate, sEnd_Date, null, werksNo, "FqcDate"); if (f_FPYSystem.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate = 100.0; - //int sum_idx = 1; - double sum_rate = 0.0; - int sum_idx = 0; + double sum_rate = 100.0; + int sum_idx = 1; + //double sum_rate = 0.0; + //int sum_idx = 0; DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -1798,9 +1809,10 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL if (rate > 0) { - //sum_rate = sum_rate * (rate / 100.0); - sum_idx = sum_idx + 1; - sum_rate = sum_rate + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate = sum_rate * (rate / 100.0); + //sum_idx = sum_idx + 1; + //sum_rate = sum_rate + rate; } } } @@ -1816,11 +1828,12 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL var f_FPYMedical = await new WipStationController(_context).GetWipStation4QRS014GroupM(null, sDate, sEnd_Date, null, werksNo, "FqcDate"); if (f_FPYMedical.DataTotal > 0) { + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 //2024-03-26 BB.Wang Modify 修正良率(代小平) - //double sum_rate = 100.0; - //int sum_idx = 1; - double sum_rate = 0.0; - int sum_idx = 0; + double sum_rate = 100.0; + int sum_idx = 1; + //double sum_rate = 0.0; + //int sum_idx = 0; DataTable dtRate = new DataTable(); dtRate.Columns.Add("STATION_ID"); @@ -1908,9 +1921,10 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL if (rate > 0) { - //sum_rate = sum_rate * (rate / 100.0); - sum_idx = sum_idx + 1; - sum_rate = sum_rate + rate; + //2024-04-11 Marvin 修正,安勤品管Jeason提出,直通率改回原先系統算法,各站良率相乘 + sum_rate = sum_rate * (rate / 100.0); + //sum_idx = sum_idx + 1; + //sum_rate = sum_rate + rate; } } }