Browse Source

1. 過站SOP判斷 加入標準SOP

PTD
Ray 2 years ago
parent
commit
7a8900b498
  1. 22
      AMESCoreStudio.Web/Controllers/PCSController.cs
  2. 10
      AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs
  3. 3
      AMESCoreStudio.WebApi/Controllers/AMES/WipSopController.cs
  4. 12
      AMESCoreStudio.WebApi/Controllers/QASRV/DocEsopViewController.cs
  5. 5
      AMESCoreStudio.WebApi/DTO/AMES/WipSopDto.cs

22
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -5368,18 +5368,34 @@ namespace AMESCoreStudio.Web.Controllers
model.KpItemName = string.Empty;
// 工單SOP
var wipSOP = await _pcsApi.GetWipSopByWipNo(model.WipNO);
// 標準SOP A
if (wipSOP.Where(w => w.UnitNo == stationUnit && w.SOPType == "A").Any())
{
var wipSOPTypeA = wipSOP.Where(w => w.UnitNo == stationUnit && w.SOPType == "A")
.OrderByDescending(w => w.UpdateTime).FirstOrDefault();
var Esop = await _pcsApi.GetDocEsopViewByNo(wipSOPTypeA.SOPPath);
if (Esop.Count != 0)
{
model.Sops.Add(new PCS021ViewModel_SOP
{
SopName = "SOP文件",
SopPath = "/PDF/標準SOP.pdf"
SopPath = @$"\\qasrv-n\Web\ISOZone\{Esop.FirstOrDefault().file_path}"
});
}
}
// 暫行SOP D
if (wipSOP.Where(w => w.UnitNo == stationUnit && w.SOPType == "D").Any())
{
var wipSOPTypeD = wipSOP.Where(w => w.UnitNo == stationUnit && w.SOPType == "D")
.OrderByDescending(w => w.UpdateTime).FirstOrDefault();
model.Sops.Add(new PCS021ViewModel_SOP
{
SopName = "暫行文件",
SopPath = "/PDF/暫行SOP.pdf"
});
}
// 不二過
model.Sops.Add(new PCS021ViewModel_SOP
{
SopName = "不二過",

10
AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs

@ -8,6 +8,7 @@ using AMESCoreStudio.WebApi.Models.AMES;
using AMESCoreStudio.WebApi.Models.BAS;
using AMESCoreStudio.CommonTools.Result;
using AMESCoreStudio.WebApi.DTO.AMES;
using AMESCoreStudio.WebApi.Models.QASRV;
namespace AMESCoreStudio.Web
{
@ -1266,7 +1267,6 @@ namespace AMESCoreStudio.Web
ITask<ResultModel<WipReturn>> PostWipReturn([FromBody, RawJsonContent] string model);
#endregion
#region 取出貨序號
[WebApiClient.Attributes.HttpGet("api/SerialRules/ByQurey/{itemNo}/{lotNo}/{num}")]
ITask<ResultModel<string>> GetSerialRuleByQurey(string itemNo, string lotNo, int num);
@ -1359,5 +1359,13 @@ namespace AMESCoreStudio.Web
#endregion
//YIRU End ----------------------------------------------------------------------------------------
/// <summary>
/// 查詢標準SOP路徑
/// </summary>
/// <param name="id">編號</param>
/// <returns></returns>
[WebApiClient.Attributes.HttpGet("api/DocEsopView/ByNo/{id}")]
ITask<List<DocEsopView>> GetDocEsopViewByNo(string id);
}
}

3
AMESCoreStudio.WebApi/Controllers/AMES/WipSopController.cs

@ -78,7 +78,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
SOPPath = q1.SOPPath,
SOPType = q1.SOPType,
UnitNo = q1.UnitNo,
UnitNoName = q2.UnitName
UnitNoName = q2.UnitName,
UpdateTime = q1.UpdateDate
};
var result = await q.ToListAsync();

12
AMESCoreStudio.WebApi/Controllers/QASRV/DocEsopViewController.cs

@ -39,5 +39,17 @@ namespace AMESCoreStudio.WebApi.Controllers.QASRV
IQueryable<DocEsopView> q = _context.DocEsopViews;
return await q.Take(100).ToListAsync();
}
/// <summary>
/// Get標準SOP路徑 By documentNo
/// </summary>
/// <param name="id">編號</param>
/// <returns></returns>
[HttpGet("ByNo/{id}")]
public async Task<ActionResult<IEnumerable<DocEsopView>>> GetDocEsopViewByNo(string id)
{
IQueryable<DocEsopView> q = _context.DocEsopViews.Where(w => w.document_no == id);
return await q.Take(100).ToListAsync();
}
}
}

5
AMESCoreStudio.WebApi/DTO/AMES/WipSopDto.cs

@ -64,5 +64,10 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
public string UnitNoName { get; set; }
/// <summary>
/// 更新時間
/// </summary>
public DateTime? UpdateTime { get; set; }
}
}

Loading…
Cancel
Save