|
|
@ -97,6 +97,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
{ |
|
|
|
IQueryable<FqcInhouseMasterDto> q = from q1 in _context.FqcInhouseMasters |
|
|
|
join q2 in _context.FqcInhouseDetails on new { q1.InhouseNo, q1.SeqID } equals new { q2.InhouseNo, q2.SeqID } |
|
|
|
join q3 in _context.FqcResultMasters on q1.InhouseNo equals q3.InhouseNo |
|
|
|
select new FqcInhouseMasterDto |
|
|
|
{ |
|
|
|
InhouseNo = q1.InhouseNo, |
|
|
@ -107,7 +108,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
SerialNo = q2.SerialNo, |
|
|
|
StatusName = q1.Status, |
|
|
|
ProTypeName = q1.ProType, |
|
|
|
CreateDate = q1.CreateDate |
|
|
|
CreateDate = q1.CreateDate, |
|
|
|
EndTime = q3.EndTime |
|
|
|
}; |
|
|
|
//q1.Status == "P" ? "允收" : q1.Status == "R" ? "批退" : "未驗收完成",
|
|
|
|
//IQueryable <FqcInhouseDetail> q1 = _context.FqcInhouseDetails;
|
|
|
@ -157,8 +159,15 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
q = q.Skip((page - 1) * limit).Take(limit); |
|
|
|
} |
|
|
|
result.Data = await q.ToListAsync(); |
|
|
|
|
|
|
|
// 判斷結束時間
|
|
|
|
result.Data = result.Data.Select(s => { s.EndTime = s.StatusName == "A" ? null : s.EndTime; return s; }) |
|
|
|
.ToList(); |
|
|
|
|
|
|
|
// 修改狀態名稱
|
|
|
|
result.Data = result.Data.Select(s => { s.StatusName = s.StatusName == "P" ? "允收" : s.StatusName == "R" ? "批退" : "未驗收完成"; return s; }) |
|
|
|
.ToList(); |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
@ -267,9 +276,10 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
public async Task<ResultModel<FqcInhouseMaster>> PostFqcInhouseMaster(FqcInhouseMaster fqcInhouseMaster) |
|
|
|
{ |
|
|
|
ResultModel<FqcInhouseMaster> result = new ResultModel<FqcInhouseMaster>(); |
|
|
|
_context.FqcInhouseMasters.Add(fqcInhouseMaster); |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
_context.FqcInhouseMasters.Add(fqcInhouseMaster); |
|
|
|
await _context.SaveChangesAsync(); |
|
|
|
result.Success = true; |
|
|
|
result.Msg = "OK"; |
|
|
|