|
@ -1344,46 +1344,46 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
#region FQC010 報表
|
|
|
#region FQC010 報表
|
|
|
public async Task<IActionResult> FQC010() |
|
|
public async Task<IActionResult> FQC010_PDF(string inhouseNo, int seqID) |
|
|
{ |
|
|
{ |
|
|
string mimeType = ""; |
|
|
string mimeType = ""; |
|
|
int extension = 1; |
|
|
int extension = 1; |
|
|
var path = $"{this._env.WebRootPath}\\Reports\\View.rdlc"; |
|
|
var path = $"{this._env.WebRootPath}\\Reports\\FQC010View.rdlc"; |
|
|
LocalReport localReport = new LocalReport(path); |
|
|
LocalReport localReport = new LocalReport(path); |
|
|
Dictionary<string, string> param = new Dictionary<string, string>(); |
|
|
Dictionary<string, string> param = new Dictionary<string, string>(); |
|
|
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); |
|
|
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); |
|
|
System.Text.Encoding.GetEncoding(1252); |
|
|
System.Text.Encoding.GetEncoding(1252); |
|
|
var FQC010Master = new FQC010VIiew(); |
|
|
var FQC010Master = new FQC010VIiew(); |
|
|
IResultModel<FqcDto> resultFqcQuery; |
|
|
IResultModel<FqcDto> resultFqcQuery; |
|
|
resultFqcQuery = _fqcApi.GetFqcQuery("QWO0002A1001").InvokeAsync().Result; |
|
|
resultFqcQuery = _fqcApi.GetFqcQuery(inhouseNo, seqID).InvokeAsync().Result; |
|
|
|
|
|
|
|
|
if (resultFqcQuery.Data.Count() != 0) |
|
|
if (resultFqcQuery.Data.Count() != 0) |
|
|
{ |
|
|
{ |
|
|
var FqcQuery = resultFqcQuery.Data.FirstOrDefault(); |
|
|
var FqcQuery = resultFqcQuery.Data.FirstOrDefault(); |
|
|
FQC010Master = new FQC010VIiew() |
|
|
FQC010Master = new FQC010VIiew() |
|
|
{ |
|
|
{ |
|
|
DefectDescription = "N/A", |
|
|
DefectDescription = FqcQuery.QaMeno, |
|
|
InspectionDate = "2022/06/30", |
|
|
InspectionDate = FqcQuery.EndTime, |
|
|
AC = FqcQuery.AcQty.ToString(), |
|
|
AC = FqcQuery.AcQty.ToString(), |
|
|
Approved = "王曉明", |
|
|
Approved = "王曉明", |
|
|
AQL = "2.5", |
|
|
AQL = "2.5", |
|
|
SpeciallyAdoption = "特採Specially Adoption", |
|
|
SpeciallyAdoption = FqcQuery.SpecialPo, |
|
|
BIOSVer = "2.04A CS:7672H", |
|
|
BIOSVer = FqcQuery.BIOS, |
|
|
ECN = "22N0202", |
|
|
ECN = "22N0202", |
|
|
ECNMemo = "工單生產已是最新ECN", |
|
|
ECNMemo = "工單生產已是最新ECN", |
|
|
Factory = "YS00", |
|
|
Factory = FqcQuery.Werk.Split('-')[0], |
|
|
FactoryRemark = "N/A", |
|
|
FactoryRemark = FqcQuery.Werk.Split('-')[1], |
|
|
InspectionInstrumentNumber = "N/A", |
|
|
InspectionInstrumentNumber = FqcQuery.OutfitNo, |
|
|
InspectionItems = "OS:[Win10 IoT]CPU test:[1.10G] RAM test:[4096]", |
|
|
InspectionItems = "OS:[Win10 IoT]CPU test:[1.10G] RAM test:[4096]", |
|
|
InspectionNumber = FqcQuery.InhouseNo, |
|
|
InspectionNumber = FqcQuery.InhouseNo, |
|
|
InspectionStatus = "廠驗", |
|
|
InspectionStatus = "廠驗", |
|
|
InspectionType = FqcQuery.InspectionTypeName, |
|
|
InspectionType = FqcQuery.InspectionTypeName, |
|
|
Inspector = "蔡喬虎", |
|
|
Inspector = "蔡喬虎", |
|
|
Judgment = "Defect Quantity", |
|
|
Judgment = "Defect Quantity", |
|
|
Line = "安勤產線", |
|
|
Line = FqcQuery.InhouseMemo, |
|
|
LotSize = "1", |
|
|
LotSize = FqcQuery.InhouseQty.ToString(), |
|
|
Major = FqcQuery.MajorQty.ToString(), |
|
|
Major = FqcQuery.MajorQty.ToString(), |
|
|
MedicalModel = "N", |
|
|
MedicalModel = FqcQuery.CustomerMedical, |
|
|
Minor = FqcQuery.MinorQty.ToString(), |
|
|
Minor = FqcQuery.MinorQty.ToString(), |
|
|
Model = FqcQuery.ItemNo, |
|
|
Model = FqcQuery.ItemNo, |
|
|
ModelName = FqcQuery.ModelNo, |
|
|
ModelName = FqcQuery.ModelNo, |
|
@ -1399,7 +1399,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
StorageLocation = "9000", |
|
|
StorageLocation = "9000", |
|
|
Avalue = "AVALUE", |
|
|
Avalue = "AVALUE", |
|
|
VIP = FqcQuery.CustomerVIP, |
|
|
VIP = FqcQuery.CustomerVIP, |
|
|
WaiveRequisition = "XX" |
|
|
WaiveRequisition = FqcQuery.StatusName |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 抓全部檢驗工項
|
|
|
// 抓全部檢驗工項
|
|
@ -1461,6 +1461,131 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
|
|
|
|
|
var result = localReport.Execute(RenderType.Pdf, extension, param, mimeType); |
|
|
var result = localReport.Execute(RenderType.Pdf, extension, param, mimeType); |
|
|
return File(result.MainStream, "application/pdf"); |
|
|
return File(result.MainStream, "application/pdf"); |
|
|
|
|
|
|
|
|
|
|
|
//var result = localReport.Execute(RenderType.Excel, extension, param, mimeType);
|
|
|
|
|
|
//return File(result.MainStream, "application/msexcel", "Export.xls");
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<IActionResult> FQC010_Excel(string inhouseNo, int seqID) |
|
|
|
|
|
{ |
|
|
|
|
|
string mimeType = ""; |
|
|
|
|
|
int extension = 1; |
|
|
|
|
|
var path = $"{this._env.WebRootPath}\\Reports\\FQC010View.rdlc"; |
|
|
|
|
|
LocalReport localReport = new LocalReport(path); |
|
|
|
|
|
Dictionary<string, string> param = new Dictionary<string, string>(); |
|
|
|
|
|
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); |
|
|
|
|
|
System.Text.Encoding.GetEncoding(1252); |
|
|
|
|
|
var FQC010Master = new FQC010VIiew(); |
|
|
|
|
|
IResultModel<FqcDto> resultFqcQuery; |
|
|
|
|
|
resultFqcQuery = _fqcApi.GetFqcQuery(inhouseNo, seqID).InvokeAsync().Result; |
|
|
|
|
|
|
|
|
|
|
|
if (resultFqcQuery.Data.Count() != 0) |
|
|
|
|
|
{ |
|
|
|
|
|
var FqcQuery = resultFqcQuery.Data.FirstOrDefault(); |
|
|
|
|
|
FQC010Master = new FQC010VIiew() |
|
|
|
|
|
{ |
|
|
|
|
|
DefectDescription = FqcQuery.QaMeno, |
|
|
|
|
|
InspectionDate = FqcQuery.EndTime, |
|
|
|
|
|
AC = FqcQuery.AcQty.ToString(), |
|
|
|
|
|
Approved = "王曉明", |
|
|
|
|
|
AQL = "2.5", |
|
|
|
|
|
SpeciallyAdoption = FqcQuery.SpecialPo, |
|
|
|
|
|
BIOSVer = FqcQuery.BIOS, |
|
|
|
|
|
ECN = "22N0202", |
|
|
|
|
|
ECNMemo = "工單生產已是最新ECN", |
|
|
|
|
|
Factory = FqcQuery.Werk.Split('-')[0], |
|
|
|
|
|
FactoryRemark = FqcQuery.Werk.Split('-')[1], |
|
|
|
|
|
InspectionInstrumentNumber = FqcQuery.OutfitNo, |
|
|
|
|
|
InspectionItems = "OS:[Win10 IoT]CPU test:[1.10G] RAM test:[4096]", |
|
|
|
|
|
InspectionNumber = FqcQuery.InhouseNo, |
|
|
|
|
|
InspectionStatus = "廠驗", |
|
|
|
|
|
InspectionType = FqcQuery.InspectionTypeName, |
|
|
|
|
|
Inspector = "蔡喬虎", |
|
|
|
|
|
Judgment = "Defect Quantity", |
|
|
|
|
|
Line = FqcQuery.InhouseMemo, |
|
|
|
|
|
LotSize = FqcQuery.InhouseQty.ToString(), |
|
|
|
|
|
Major = FqcQuery.MajorQty.ToString(), |
|
|
|
|
|
MedicalModel = FqcQuery.CustomerMedical, |
|
|
|
|
|
Minor = FqcQuery.MinorQty.ToString(), |
|
|
|
|
|
Model = FqcQuery.ItemNo, |
|
|
|
|
|
ModelName = FqcQuery.ModelNo, |
|
|
|
|
|
NOTE = @"ACC-M2
|
|
|
|
|
|
E1589 |
|
|
|
|
|
ESW-075R |
|
|
|
|
|
ACC-BAT",
|
|
|
|
|
|
OrderNumber = FqcQuery.WipNo, |
|
|
|
|
|
Product99 = "一般二級水準正常檢驗", |
|
|
|
|
|
ReMajor = FqcQuery.ReQty.ToString(), |
|
|
|
|
|
Sample = FqcQuery.QcQty.ToString(), |
|
|
|
|
|
SamplingInspectionPlan = "ANSI/ASQZ 1.4II", |
|
|
|
|
|
StorageLocation = "9000", |
|
|
|
|
|
Avalue = "AVALUE", |
|
|
|
|
|
VIP = FqcQuery.CustomerVIP, |
|
|
|
|
|
WaiveRequisition = FqcQuery.StatusName |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 抓全部檢驗工項
|
|
|
|
|
|
var result_QcItem = await _fqcApi.GetQcItemQuery(0, 0, 0); |
|
|
|
|
|
// 取綁定工單檢驗工項資料
|
|
|
|
|
|
var result_WipFQC = await _fqcApi.GetWipFqcItemByWipNo(FqcQuery.WipNo); |
|
|
|
|
|
if (result_WipFQC.Count == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
//工單無設定檢驗工項時 在抓料號綁定檢驗工項
|
|
|
|
|
|
var result_MaterialFQC = await _fqcApi.GetMaterialFqcItemsByitemNo(FqcQuery.ItemNo); |
|
|
|
|
|
if (result_MaterialFQC.Count != 0) |
|
|
|
|
|
{ |
|
|
|
|
|
// 檢驗工項
|
|
|
|
|
|
foreach (var item in result_QcItem.Data.Where(w => result_MaterialFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList()) |
|
|
|
|
|
{ |
|
|
|
|
|
FQC010Master.Detail1.Add(new FQC010Detail1 |
|
|
|
|
|
{ |
|
|
|
|
|
ItemID = item.ItemID.ToString(), |
|
|
|
|
|
ItemName = item.ItemNameCN, |
|
|
|
|
|
ItemType = item.ItemTypeName |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
// 檢驗工項
|
|
|
|
|
|
foreach (var item in result_QcItem.Data.Where(w => result_WipFQC.Select(s => s.QcItemID).Contains(w.ItemID)).ToList()) |
|
|
|
|
|
{ |
|
|
|
|
|
FQC010Master.Detail1.Add(new FQC010Detail1 |
|
|
|
|
|
{ |
|
|
|
|
|
ItemID = item.ItemID.ToString(), |
|
|
|
|
|
ItemName = item.ItemNameCN, |
|
|
|
|
|
ItemType = item.ItemTypeName |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 條碼細項
|
|
|
|
|
|
var fqcDetail = await _fqcApi.FQC007InhouseDetails(FqcQuery.InhouseNo, Convert.ToInt32(FqcQuery.SeqID)); |
|
|
|
|
|
foreach (var item in fqcDetail.Data) |
|
|
|
|
|
{ |
|
|
|
|
|
FQC010Master.Detail2.Add(new FQC010Detail2 |
|
|
|
|
|
{ |
|
|
|
|
|
ProductionSerialNumber = item.BarcodeNo, |
|
|
|
|
|
ShippingSerialNumber = item.ExtraBarcodeNo, |
|
|
|
|
|
IsSample = item.IsSample, |
|
|
|
|
|
InspectionResults = item.StatusNo |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var FQC010Masters = new List<FQC010VIiew>(); |
|
|
|
|
|
FQC010Masters.Add(FQC010Master); |
|
|
|
|
|
|
|
|
|
|
|
localReport.AddDataSource("DataSet1", FQC010Masters); |
|
|
|
|
|
localReport.AddDataSource("DataSet2", FQC010Master.Detail1); |
|
|
|
|
|
localReport.AddDataSource("DataSet3", FQC010Master.Detail2); |
|
|
|
|
|
|
|
|
|
|
|
//var result = localReport.Execute(RenderType.Pdf, extension, param, mimeType);
|
|
|
|
|
|
//return File(result.MainStream, "application/pdf");
|
|
|
|
|
|
|
|
|
|
|
|
var result = localReport.Execute(RenderType.Excel, extension, param, mimeType); |
|
|
|
|
|
return File(result.MainStream, "application/msexcel", "Export.xls"); |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|