@ -516,7 +516,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
//YIRU ADD -----------------------------------------------------------------------------------------------------------------------------------------------
/// <summary>
/// FQC查詢 by TableD
/// FQC查詢 by Table
/// </summary>
/// <param name="barcodeNo">內部序號</param>
/// <param name="wipNo">工單號碼</param>
@ -532,9 +532,9 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
public async Task < ResultModel < FqcInhouseMaster_WareDto > > GetFqcInhouseMasteMultiQuery ( string barcodeNo , string wipNo , string boxNo
, string inhouseNo , string date_str , string date_end , string status , int page = 0 , int limit = 1 0 )
{
IQueryable < FqcInhouseMaster_WareDto > q = from q1 in _ context . FqcInhouseMasters
join q2 in _ context . FqcInhouseDetails on new { q1 . InhouseNo , q1 . SeqID } equals new { q2 . InhouseNo , q2 . SeqID }
join q2_1 in _ context . WipBoxs on q2 . SerialNo equals q2_1 . BoxNo
join q3 in _ context . FqcResultMasters on q1 . InhouseNo equals q3 . InhouseNo
join q4 in _ context . WareHouseings on new { q2 . InhouseNo , q2 . SeqID , q2 . SerialNo } equals new { q4 . InhouseNo , q4 . SeqID , q4 . SerialNo } into q2q4
from q402 in q2q4 . DefaultIfEmpty ( )
@ -553,8 +553,10 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
RecordNumber = q402 . RecordNumber ,
RecordDate = q402 . Create_Date ,
LocationNo = q1 . LocationNo ,
BoxQty = q2_1 . BoxCnt . ToString ( )
} ;
//q1.Status == "P" ? "允收" : q1.Status == "R" ? "批退" : "未驗收完成",
//IQueryable <FqcInhouseDetail> q1 = _context.FqcInhouseDetails;
if ( ! string . IsNullOrWhiteSpace ( inhouseNo ) )
@ -591,14 +593,16 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
if ( DateTime . TryParse ( date_str , out _ ) )
{
q = q . Where ( w = > w . Create Date > = DateTime . Parse ( date_str + " 00:00:00" ) ) ;
q = q . Where ( w = > w . Record Date > = DateTime . Parse ( date_str ) ) ;
}
if ( DateTime . TryParse ( date_end , out _ ) )
{
q = q . Where ( w = > w . Create Date < = DateTime . Parse ( date_end + " 23:59:59" ) ) ;
q = q . Where ( w = > w . Record Date < = DateTime . Parse ( date_end ) ) ;
}
q = q . Where ( w = > w . StatusName = = "P" ) ;
ResultModel < FqcInhouseMaster_WareDto > result = new ResultModel < FqcInhouseMaster_WareDto > ( ) ;
// 紀錄筆數
@ -619,9 +623,13 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
result . Data = result . Data . Select ( s = > { s . StatusName = s . StatusName = = "P" ? "允收" : s . StatusName = = "R" ? "批退" : "未驗收完成" ; return s ; } )
. ToList ( ) ;
result . Data = result . Data . Select ( s = > { s . BoxQty = _ context . BarcodeInfoes . Where ( w = > w . BoxNo = = s . SerialNo ) . Count ( ) . ToString ( ) ; return s ; } ) . ToList ( ) ;
return result ;
}
//YIRU End -----------------------------------------------------------------------------------------------------------------------------------------------
private bool FqcInhouseMasterExists ( string id )