|
|
@ -26,6 +26,7 @@ using ClosedXML.Excel; |
|
|
|
using Microsoft.VisualBasic; |
|
|
|
using AMESCoreStudio.WebApi.Models.SYS; |
|
|
|
|
|
|
|
|
|
|
|
namespace AMESCoreStudio.Web.Controllers |
|
|
|
{ |
|
|
|
|
|
|
@ -4637,18 +4638,40 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// TestLog
|
|
|
|
var testLogResult = await _pcsApi.GetTestLogByMSSql(result.BarCodeNo); |
|
|
|
foreach (var item in testLogResult) |
|
|
|
{ |
|
|
|
var FileName = (string)item.filename; |
|
|
|
var RecordTime = FileName.Split('-')[1]; |
|
|
|
if (DateTime.TryParseExact(RecordTime, "yyyyMMddHHmmss", null, System.Globalization.DateTimeStyles.None, out DateTime resultDate)) |
|
|
|
{ |
|
|
|
RecordTime = resultDate.ToString("yyyy/MM/dd HH:mm:ss"); |
|
|
|
} |
|
|
|
|
|
|
|
result.testLogs.Add(new TestLog |
|
|
|
{ |
|
|
|
TestId = item.id, |
|
|
|
Result = FileName.Contains("PASS") ? "PASS" : "FAIL", |
|
|
|
Record_Time = RecordTime, |
|
|
|
FileName = FileName, |
|
|
|
//FilePath = $@"/TestLog/{(string)item.workOrder}/{FileName}"
|
|
|
|
}); |
|
|
|
//SopPath = $@"/DocEsop/{Esop.FirstOrDefault().file_path}"
|
|
|
|
} |
|
|
|
return View(result); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<IActionResult> PCS009T(string id) |
|
|
|
public async Task<IActionResult> PCS009T(string sn ,string id) |
|
|
|
{ |
|
|
|
var query = await _pcsApi.GetTestLog("99300023400030"); |
|
|
|
var query = await _pcsApi.GetTestLogByMSSql(sn); |
|
|
|
var result = new List<PCS009TViewModel>(); |
|
|
|
|
|
|
|
if (query.Any()) |
|
|
|
{ |
|
|
|
var item = query.Where(w => w.id == id).FirstOrDefault(); |
|
|
|
// 使用反射獲取属性信息並創建列
|
|
|
|
foreach (var property in query.FirstOrDefault().Children()) |
|
|
|
foreach (var property in item.Children()) |
|
|
|
{ |
|
|
|
var columnName = ((string)property.Name).ToUpper(); |
|
|
|
var columnValue = property.Value.ToString(); |
|
|
|