|
@ -438,13 +438,37 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL |
|
|
result.IPQCTotal = 12; |
|
|
result.IPQCTotal = 12; |
|
|
|
|
|
|
|
|
// FQC批退率 Board
|
|
|
// FQC批退率 Board
|
|
|
result.FQCRRBoard = 5.08; |
|
|
//result.FQCRRBoard = 5.08;
|
|
|
|
|
|
var f_FQCRRBoard = await new FqcResultMasterController(_context).GetFQCHeaderData4QRS016ByDetail(null, null, null, sDate, eDate, "1001"); |
|
|
|
|
|
if (f_FQCRRBoard.DataTotal > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (var item in f_FQCRRBoard.Data.Where(W => W.type == "單板")) |
|
|
|
|
|
{ |
|
|
|
|
|
result.FQCRRBoard = item.rejectRate; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// FQC批退率 System
|
|
|
// FQC批退率 System
|
|
|
result.FQCRRSystem = 12.12; |
|
|
//result.FQCRRSystem = 12.12;
|
|
|
|
|
|
var f_FQCRRSystem = await new FqcResultMasterController(_context).GetFQCHeaderData4QRS016ByDetail(null, null, null, sDate, eDate, "1001"); |
|
|
|
|
|
if (f_FQCRRSystem.DataTotal > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (var item in f_FQCRRSystem.Data.Where(W => W.type == "系統組裝")) |
|
|
|
|
|
{ |
|
|
|
|
|
result.FQCRRSystem = item.rejectRate; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// FQC批退率 Medical
|
|
|
// FQC批退率 Medical
|
|
|
result.FQCRRMedical = 11.11; |
|
|
//result.FQCRRMedical = 11.11;
|
|
|
|
|
|
var f_FQCRRMedical = await new FqcResultMasterController(_context).GetFQCHeaderData4QRS016ByDetail(null, null, null, sDate, eDate, "1001"); |
|
|
|
|
|
if (f_FQCRRSystem.DataTotal > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (var item in f_FQCRRMedical.Data.Where(W => W.type == "醫療")) |
|
|
|
|
|
{ |
|
|
|
|
|
result.FQCRRMedical = item.rejectRate; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// DOA Board
|
|
|
// DOA Board
|
|
|
result.DOABoard = 0.04; |
|
|
result.DOABoard = 0.04; |
|
@ -456,7 +480,107 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL |
|
|
result.DOAMedical = 0.00; |
|
|
result.DOAMedical = 0.00; |
|
|
|
|
|
|
|
|
// FPY 立德 Board
|
|
|
// FPY 立德 Board
|
|
|
result.FPYBoard_LEI = 99.15; |
|
|
//result.FPYBoard_LEI = 99.15;
|
|
|
|
|
|
var f_FPYBoard_LEI = await new WipStationController(_context).GetWipStation4QRS014GroupB(null, sDate, eDate, null, null, null); |
|
|
|
|
|
if (f_FPYBoard_LEI.DataTotal > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
double sum_rate = 100.0; |
|
|
|
|
|
int sum_idx = 1; |
|
|
|
|
|
|
|
|
|
|
|
DataTable dtRate = new DataTable(); |
|
|
|
|
|
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 f_FPYBoard_LEI.Data) |
|
|
|
|
|
{ |
|
|
|
|
|
string str = data.ToString(); |
|
|
|
|
|
string[] str2 = str.Replace("{", "").Replace("}", "").Split(','); |
|
|
|
|
|
string str3 = ""; |
|
|
|
|
|
for (int i = 0; i < str2.Length; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
string[] str21 = str2[i].Split("="); |
|
|
|
|
|
str3 = str3 + str21[0].Trim() + ":" + "'" + str21[1].Trim() + "',"; |
|
|
|
|
|
} |
|
|
|
|
|
JObject j0 = JObject.Parse("{" + str3.Substring(0, str3.Length - 1) + "}"); |
|
|
|
|
|
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]["STATION_ID"].ToString() == stationID.ToString()) |
|
|
|
|
|
{ |
|
|
|
|
|
idx = i; |
|
|
|
|
|
existFlag = true; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int okQty = 0, ngQty = 0; |
|
|
|
|
|
|
|
|
|
|
|
if (j0["RuleStatus"].ToString() == "P") |
|
|
|
|
|
{ |
|
|
|
|
|
okQty = int.Parse(j0["FirstCnt"].ToString()); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
ngQty = int.Parse(j0["FirstCnt"].ToString()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (existFlag) |
|
|
|
|
|
{ |
|
|
|
|
|
if (okQty > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
dtRate.Rows[idx][1] = okQty; |
|
|
|
|
|
} |
|
|
|
|
|
if (ngQty > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
dtRate.Rows[idx][2] = ngQty; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dtRate.AcceptChanges(); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
DataRow dr = dtRate.NewRow(); |
|
|
|
|
|
dr[0] = stationID; |
|
|
|
|
|
dr[1] = okQty; |
|
|
|
|
|
dr[2] = ngQty; |
|
|
|
|
|
|
|
|
|
|
|
dtRate.Rows.Add(dr); |
|
|
|
|
|
dtRate.AcceptChanges(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (dtRate.Rows.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
for (int j = 0; j < dtRate.Rows.Count; j++) |
|
|
|
|
|
{ |
|
|
|
|
|
int okQty = int.Parse(dtRate.Rows[j][1].ToString()); |
|
|
|
|
|
int ngQty = int.Parse(dtRate.Rows[j][2].ToString()); |
|
|
|
|
|
|
|
|
|
|
|
int inputQty = okQty + ngQty; |
|
|
|
|
|
|
|
|
|
|
|
double rate = 0; |
|
|
|
|
|
if (okQty > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
rate = (okQty * 1.0 / inputQty) * 100; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (rate > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
//sum_rate = sum_rate * (rate / 100.0);
|
|
|
|
|
|
sum_idx = sum_idx + 1; |
|
|
|
|
|
sum_rate = sum_rate + rate; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
result.FPYBoard_LEI = double.Parse((sum_rate / sum_idx).ToString("0.00")); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// FPY 立德 System
|
|
|
// FPY 立德 System
|
|
|
result.FPYSystem_LEI = 92.12; |
|
|
result.FPYSystem_LEI = 92.12; |
|
|