|
@ -878,9 +878,39 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
result_FQCResultMaster.ECN_Memo = model.ECN_Memo; |
|
|
result_FQCResultMaster.ECN_Memo = model.ECN_Memo; |
|
|
result_FQCResultMaster.InspectionStatus = model.InspectionStatus; |
|
|
result_FQCResultMaster.InspectionStatus = model.InspectionStatus; |
|
|
result_FQCResultMaster.PLM_ECN = model.PLMECN; |
|
|
result_FQCResultMaster.PLM_ECN = model.PLMECN; |
|
|
|
|
|
result_FQCResultMaster.UpdateUserID = GetLogInUserID(); |
|
|
await _fqcApi.PutFqcResultMaster(JsonConvert.SerializeObject(result_FQCResultMaster)); |
|
|
await _fqcApi.PutFqcResultMaster(JsonConvert.SerializeObject(result_FQCResultMaster)); |
|
|
ModelState.AddModelError("error", "儲存成功!"); |
|
|
ModelState.AddModelError("error", "儲存成功!"); |
|
|
} |
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
var fqcResultMaster = new FqcResultMaster(); |
|
|
|
|
|
fqcResultMaster.InhouseNo = model.InhouseNo; |
|
|
|
|
|
fqcResultMaster.SeqID = Convert.ToInt16(model.SeqID); |
|
|
|
|
|
fqcResultMaster.LotQty = model.InhouseQty; |
|
|
|
|
|
fqcResultMaster.WipNo = model.WipNo; |
|
|
|
|
|
fqcResultMaster.QaQty = 1; |
|
|
|
|
|
fqcResultMaster.ItemNo = model.ItemNo; |
|
|
|
|
|
fqcResultMaster.ModelNo = model.ModelNo; |
|
|
|
|
|
fqcResultMaster.StartTime = DateTime.Now; |
|
|
|
|
|
fqcResultMaster.EndTime = DateTime.Now; |
|
|
|
|
|
fqcResultMaster.CreateUserID = GetLogInUserID(); |
|
|
|
|
|
fqcResultMaster.UpdateUserID = GetLogInUserID(); |
|
|
|
|
|
fqcResultMaster.OS = model.OS; |
|
|
|
|
|
fqcResultMaster.CPU = model.CPU; |
|
|
|
|
|
fqcResultMaster.RAM = model.RAM; |
|
|
|
|
|
fqcResultMaster.BIOS = model.BIOS; |
|
|
|
|
|
fqcResultMaster.Supervisor = model.Supervisor; |
|
|
|
|
|
fqcResultMaster.Proved = model.Proved; |
|
|
|
|
|
fqcResultMaster.OutfitNo = model.OutfitNo; |
|
|
|
|
|
fqcResultMaster.InspectionType = model.InspectionType; |
|
|
|
|
|
fqcResultMaster.Note = model.Note; |
|
|
|
|
|
fqcResultMaster.ECN_Memo = model.ECN_Memo; |
|
|
|
|
|
fqcResultMaster.InspectionStatus = model.InspectionStatus; |
|
|
|
|
|
fqcResultMaster.PLM_ECN = model.PLMECN; |
|
|
|
|
|
await _fqcApi.PostFqcResultMaster(JsonConvert.SerializeObject(fqcResultMaster)); |
|
|
|
|
|
ModelState.AddModelError("error", "儲存成功!"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (result.Data.Count() != 0) |
|
|
if (result.Data.Count() != 0) |
|
@ -939,6 +969,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
result_FQCResultMaster.ECN_Memo = model.ECN_Memo; |
|
|
result_FQCResultMaster.ECN_Memo = model.ECN_Memo; |
|
|
result_FQCResultMaster.InspectionStatus = model.InspectionStatus; |
|
|
result_FQCResultMaster.InspectionStatus = model.InspectionStatus; |
|
|
result_FQCResultMaster.PLM_ECN = model.PLMECN; |
|
|
result_FQCResultMaster.PLM_ECN = model.PLMECN; |
|
|
|
|
|
result_FQCResultMaster.UpdateUserID = GetLogInUserID(); |
|
|
await _fqcApi.PutFqcResultMaster(JsonConvert.SerializeObject(result_FQCResultMaster)); |
|
|
await _fqcApi.PutFqcResultMaster(JsonConvert.SerializeObject(result_FQCResultMaster)); |
|
|
ModelState.AddModelError("error", "儲存成功!"); |
|
|
ModelState.AddModelError("error", "儲存成功!"); |
|
|
} |
|
|
} |
|
@ -955,6 +986,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
fqcResultMaster.StartTime = DateTime.Now; |
|
|
fqcResultMaster.StartTime = DateTime.Now; |
|
|
fqcResultMaster.EndTime = DateTime.Now; |
|
|
fqcResultMaster.EndTime = DateTime.Now; |
|
|
fqcResultMaster.CreateUserID = GetLogInUserID(); |
|
|
fqcResultMaster.CreateUserID = GetLogInUserID(); |
|
|
|
|
|
fqcResultMaster.UpdateUserID = GetLogInUserID(); |
|
|
fqcResultMaster.OS = model.OS; |
|
|
fqcResultMaster.OS = model.OS; |
|
|
fqcResultMaster.CPU = model.CPU; |
|
|
fqcResultMaster.CPU = model.CPU; |
|
|
fqcResultMaster.RAM = model.RAM; |
|
|
fqcResultMaster.RAM = model.RAM; |
|
@ -1167,8 +1199,8 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
var result = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID); |
|
|
var result = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID); |
|
|
var fqcItem = result.Data.FirstOrDefault(); |
|
|
var fqcItem = result.Data.FirstOrDefault(); |
|
|
|
|
|
|
|
|
// Fail數量 小於0 才要判斷抽樣數量
|
|
|
// Fail數量 小於0 才要判斷抽樣數量 && 不等於免驗
|
|
|
if (fqcItem.FailQty <= 0) |
|
|
if (fqcItem.FailQty <= 0 && fqcItem.InspectionStatus != "C") |
|
|
{ |
|
|
{ |
|
|
// 抽驗數量 大於 本批次送驗量
|
|
|
// 抽驗數量 大於 本批次送驗量
|
|
|
if (fqcItem.QcQty > fqcItem.InhouseQty) |
|
|
if (fqcItem.QcQty > fqcItem.InhouseQty) |
|
@ -1224,34 +1256,39 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
{ |
|
|
{ |
|
|
var FqcQuery = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID); |
|
|
var FqcQuery = await _fqcApi.GetFqcQuery(model.InhouseNo, model.SeqID); |
|
|
var fqcItem = FqcQuery.Data.FirstOrDefault(); |
|
|
var fqcItem = FqcQuery.Data.FirstOrDefault(); |
|
|
// 判斷狀態選擇
|
|
|
|
|
|
if (fqcItem.FailQty >= fqcItem.ReQty) |
|
|
// 免驗排除
|
|
|
|
|
|
if (fqcItem.InspectionStatus != "C") |
|
|
{ |
|
|
{ |
|
|
if (model.QaResult == "P" && string.IsNullOrWhiteSpace(model.SpecialPo)) |
|
|
// 判斷狀態選擇
|
|
|
|
|
|
if (fqcItem.FailQty >= fqcItem.ReQty) |
|
|
{ |
|
|
{ |
|
|
ModelState.AddModelError("error", "請輸入特採單號"); |
|
|
if (model.QaResult == "P" && string.IsNullOrWhiteSpace(model.SpecialPo)) |
|
|
return View("FQC007B", model); |
|
|
{ |
|
|
|
|
|
ModelState.AddModelError("error", "請輸入特採單號"); |
|
|
|
|
|
return View("FQC007B", model); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 判斷有Fail但抽驗量不足 不可開立允收
|
|
|
// 判斷有Fail但抽驗量不足 不可開立允收
|
|
|
if (fqcItem.FailQty > 0) |
|
|
if (fqcItem.FailQty > 0) |
|
|
{ |
|
|
|
|
|
// 抽驗數量 大於 本批次送驗量
|
|
|
|
|
|
if (fqcItem.QcQty > fqcItem.InhouseQty) |
|
|
|
|
|
{ |
|
|
{ |
|
|
if (fqcItem.PassQty + fqcItem.FailQty != fqcItem.InhouseQty && model.QaResult == "P") |
|
|
// 抽驗數量 大於 本批次送驗量
|
|
|
|
|
|
if (fqcItem.QcQty > fqcItem.InhouseQty) |
|
|
|
|
|
{ |
|
|
|
|
|
if (fqcItem.PassQty + fqcItem.FailQty != fqcItem.InhouseQty && model.QaResult == "P") |
|
|
|
|
|
{ |
|
|
|
|
|
ModelState.AddModelError("error", "抽樣數量不足,不可判定允收"); |
|
|
|
|
|
return View("FQC007B", model); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//當抽驗數量 小於 抽樣數量就離開
|
|
|
|
|
|
else if (fqcItem.QcQty > fqcItem.PassQty + fqcItem.FailQty && model.QaResult == "P") |
|
|
{ |
|
|
{ |
|
|
ModelState.AddModelError("error", "抽樣數量不足,不可判定允收"); |
|
|
ModelState.AddModelError("error", "抽樣數量不足,不可判定允收"); |
|
|
return View("FQC007B", model); |
|
|
return View("FQC007B", model); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//當抽驗數量 小於 抽樣數量就離開
|
|
|
|
|
|
else if (fqcItem.QcQty > fqcItem.PassQty + fqcItem.FailQty && model.QaResult == "P") |
|
|
|
|
|
{ |
|
|
|
|
|
ModelState.AddModelError("error", "抽樣數量不足,不可判定允收"); |
|
|
|
|
|
return View("FQC007B", model); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var fqcResultMaster = await _fqcApi.GetFqcResultMaster(model.FqcID); |
|
|
var fqcResultMaster = await _fqcApi.GetFqcResultMaster(model.FqcID); |
|
@ -1546,7 +1583,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
|
|
|
|
|
public async Task<IActionResult> FQC008QueryAsync(string barcodeNo, string wipNo |
|
|
public async Task<IActionResult> FQC008QueryAsync(string barcodeNo, string wipNo |
|
|
, string boxNo, string inhouseNo, string dateStr, string dateEnd, string factoryID |
|
|
, string boxNo, string inhouseNo, string dateStr, string dateEnd, string factoryID |
|
|
, string status ="A", int page = 0, int limit = 10) |
|
|
, string status = "A", int page = 0, int limit = 10) |
|
|
{ |
|
|
{ |
|
|
IResultModel<FqcInhouseMasterDto> result = await _fqcApi.GetFqcInhouseMasterQuery(barcodeNo: barcodeNo, wipNo: wipNo |
|
|
IResultModel<FqcInhouseMasterDto> result = await _fqcApi.GetFqcInhouseMasterQuery(barcodeNo: barcodeNo, wipNo: wipNo |
|
|
, boxNo: boxNo, inhouseNo: inhouseNo, date_str: dateStr, date_end: dateEnd |
|
|
, boxNo: boxNo, inhouseNo: inhouseNo, date_str: dateStr, date_end: dateEnd |
|
@ -1725,7 +1762,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
Avalue = "AVALUE", |
|
|
Avalue = "AVALUE", |
|
|
VIP = FqcQuery.CustomerVIP, |
|
|
VIP = FqcQuery.CustomerVIP, |
|
|
WaiveRequisition = FqcQuery.StatusName, |
|
|
WaiveRequisition = FqcQuery.StatusName, |
|
|
AQLType = FqcQuery.AQLType |
|
|
AQLType = FqcQuery.AQLType, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 抓全部檢驗工項
|
|
|
// 抓全部檢驗工項
|
|
@ -1776,6 +1813,35 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
InspectionResults = item.StatusNo |
|
|
InspectionResults = item.StatusNo |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 圖檔轉BASE64
|
|
|
|
|
|
string ApprovedSign = ""; |
|
|
|
|
|
string InspectorSign = ""; |
|
|
|
|
|
if (System.IO.File.Exists($"{this._env.WebRootPath}/images/ElectronicSignature/{FQC010Master.Approved}.png")) |
|
|
|
|
|
{ |
|
|
|
|
|
using (var b = new System.Drawing.Bitmap($"{this._env.WebRootPath}/images/ElectronicSignature/{FQC010Master.Approved}.png")) |
|
|
|
|
|
{ |
|
|
|
|
|
using (var ms = new MemoryStream()) |
|
|
|
|
|
{ |
|
|
|
|
|
b.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); |
|
|
|
|
|
ApprovedSign = Convert.ToBase64String(ms.ToArray()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (System.IO.File.Exists($"{this._env.WebRootPath}/images/ElectronicSignature/{FQC010Master.Inspector}.png")) |
|
|
|
|
|
{ |
|
|
|
|
|
using (var b = new System.Drawing.Bitmap($"{this._env.WebRootPath}/images/ElectronicSignature/{FQC010Master.Inspector}.png")) |
|
|
|
|
|
{ |
|
|
|
|
|
using (var ms = new MemoryStream()) |
|
|
|
|
|
{ |
|
|
|
|
|
b.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); |
|
|
|
|
|
InspectorSign = Convert.ToBase64String(ms.ToArray()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
FQC010Master.ApprovedSignImg = ApprovedSign; |
|
|
|
|
|
FQC010Master.InspectorSignImg = InspectorSign; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var FQC010Masters = new List<FQC010VIiew>(); |
|
|
var FQC010Masters = new List<FQC010VIiew>(); |
|
|