Browse Source

修改完工入庫選擇昶享時,工單需對應安勤工單、料號

完工入庫數量改抓Barcode_info (解決拆箱後實際數量與Wip_box 不一致)
PTD
BB.Wang 2 years ago
parent
commit
193db7edfe
  1. 20
      AMESCoreStudio.Web/Controllers/PCSController.cs
  2. 18
      AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs

20
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -7378,9 +7378,27 @@ namespace AMESCoreStudio.Web.Controllers
foreach (var item in result_EVER.Data)
{
var wipresult= await _pcsApi.GetWipInfoByWipNO_EVER(wipno: item.WipNo);
var wipresult= await _pcsApi.GetWipInfoByWipNO_EVER(wipno: item.WipNo); //查對應安勤工單&料號
item.WipNo = wipresult.Select(s => s.RelatedWONO).FirstOrDefault();
if (!string.IsNullOrWhiteSpace(item.WipNo))
{
var itemresult = await _pcsApi.GetWipAtt(id: item.WipNo);
if ( itemresult != null)
{
item.ItemNo = itemresult.ItemNO;
}
else
{
item.ItemNo = "";
}
}
else
{
item.ItemNo ="";
}
}
result = result_EVER ;
}

18
AMESCoreStudio.WebApi/Controllers/AMES/FqcInhouseMasterController.cs

@ -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 = 10)
{
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.CreateDate >= DateTime.Parse(date_str + " 00:00:00"));
q = q.Where(w => w.RecordDate >= DateTime.Parse(date_str));
}
if (DateTime.TryParse(date_end, out _))
{
q = q.Where(w => w.CreateDate <= DateTime.Parse(date_end + " 23:59:59"));
q = q.Where(w => w.RecordDate <= 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)

Loading…
Cancel
Save