|
|
@ -90,10 +90,11 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
/// <param name="status">抽驗結果</param>
|
|
|
|
/// <param name="page">頁數</param>
|
|
|
|
/// <param name="limit">筆數</param>
|
|
|
|
/// <param name="factoryID">委外廠商ID</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("FqcInhouseMasterQuery")] |
|
|
|
public async Task<ResultModel<FqcInhouseMasterDto>> GetFqcInhouseMasterQuery(string barcodeNo, string wipNo, string boxNo |
|
|
|
, string inhouseNo, string date_str, string date_end, string status, int page = 0, int limit = 10) |
|
|
|
, string inhouseNo, string date_str, string date_end, string status, string factoryID, int page = 0, int limit = 10) |
|
|
|
{ |
|
|
|
var q = from q1 in _context.FqcInhouseMasters |
|
|
|
//join q2 in _context.FqcInhouseDetails on new { q1.InhouseNo, q1.SeqID } equals new { q2.InhouseNo, q2.SeqID }
|
|
|
@ -101,9 +102,12 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
from q3 in j1.DefaultIfEmpty() |
|
|
|
join q4 in _context.WipInfos on q1.WipNo equals q4.WipNO into s |
|
|
|
from q4 in s.DefaultIfEmpty() |
|
|
|
join q5 in _context.FactoryInfos on q4.Werks equals q5.FactoryID.ToString() into j2 |
|
|
|
from q5 in j2.DefaultIfEmpty() |
|
|
|
select new FqcInhouseMasterDto |
|
|
|
{ |
|
|
|
Werks = q4.Werks, |
|
|
|
FactoryNo = q5.FactoryNo, |
|
|
|
InhouseNo = q1.InhouseNo, |
|
|
|
SeqID = q1.SeqID, |
|
|
|
WipNo = q1.WipNo, |
|
|
@ -126,6 +130,9 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
if (!string.IsNullOrWhiteSpace(status)) |
|
|
|
q = q.Where(w => w.StatusName == status); |
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(factoryID)) |
|
|
|
q = q.Where(w => w.Werks.ToString() == factoryID); |
|
|
|
|
|
|
|
// 優先用內部序號取出包裝序號
|
|
|
|
if (!string.IsNullOrWhiteSpace(barcodeNo)) |
|
|
|
{ |
|
|
@ -218,7 +225,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
CustomerNo = q4.CustomerNO, |
|
|
|
CustomerMedical = q4.CustomerMedical, |
|
|
|
CustomerVIP = q4.CustomerVIP, |
|
|
|
Werk = q4.Werks+"-"+q5.FactoryNameCh, |
|
|
|
Werk = q4.Werks + "-" + q5.FactoryNameCh, |
|
|
|
BIOS = q2.BIOS, |
|
|
|
CPU = q2.CPU, |
|
|
|
OS = q2.OS, |
|
|
@ -229,7 +236,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
Proved = q2.Proved, |
|
|
|
Proved_Name = q7.UserName, |
|
|
|
UpdateUser = q8.UserNo, |
|
|
|
UpdateUser_Name =q8.UserName |
|
|
|
UpdateUser_Name = q8.UserName |
|
|
|
}; |
|
|
|
|
|
|
|
var query = await q.Distinct().ToListAsync(); |
|
|
|