|
|
@ -281,35 +281,36 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 判斷MAC區間
|
|
|
|
if (q_Kp.KpNo.ToUpper() == "MAC") |
|
|
|
{ |
|
|
|
|
|
|
|
var wipMAC = await wipMACController.GetWipMAC(barCodeCheckDto.wipNo); |
|
|
|
if (wipMAC.Value == null) |
|
|
|
{ |
|
|
|
resultModel.Msg += "工單號碼【" + barCodeCheckDto.wipNo + "】 找不到綁定MAC區間</br>"; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
// 判斷MAC前置碼是否一樣
|
|
|
|
if (!KPs.inputData.StartsWith(wipMAC.Value.Title)) |
|
|
|
{ |
|
|
|
resultModel.Msg += "組件序號【" + KPs.inputData + "】 與MAC【" + wipMAC.Value.Title + "】前置碼不符合 </br>"; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
// 判斷是否符合區間
|
|
|
|
if (KPs.inputData.Length == 12) |
|
|
|
{ |
|
|
|
if (!(Convert.ToInt32(wipMAC.Value.StartNO, 16) <= Convert.ToInt32(KPs.inputData.Substring(6, 6), 16) |
|
|
|
&& Convert.ToInt32(KPs.inputData.Substring(6, 6), 16) <= Convert.ToInt32(wipMAC.Value.EndNO, 16))) |
|
|
|
{ |
|
|
|
resultModel.Msg += "組件序號【" + KPs.inputData + "】 與工單設定MAC區間不符合 </br>"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 安勤不需要判斷MAC區間
|
|
|
|
//if (q_Kp.KpNo.ToUpper() == "MAC")
|
|
|
|
//{
|
|
|
|
|
|
|
|
// var wipMAC = await wipMACController.GetWipMAC(barCodeCheckDto.wipNo);
|
|
|
|
// if (wipMAC.Value == null)
|
|
|
|
// {
|
|
|
|
// resultModel.Msg += "工單號碼【" + barCodeCheckDto.wipNo + "】 找不到綁定MAC區間</br>";
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// // 判斷MAC前置碼是否一樣
|
|
|
|
// if (!KPs.inputData.StartsWith(wipMAC.Value.Title))
|
|
|
|
// {
|
|
|
|
// resultModel.Msg += "組件序號【" + KPs.inputData + "】 與MAC【" + wipMAC.Value.Title + "】前置碼不符合 </br>";
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// // 判斷是否符合區間
|
|
|
|
// if (KPs.inputData.Length == 12)
|
|
|
|
// {
|
|
|
|
// if (!(Convert.ToInt32(wipMAC.Value.StartNO, 16) <= Convert.ToInt32(KPs.inputData.Substring(6, 6), 16)
|
|
|
|
// && Convert.ToInt32(KPs.inputData.Substring(6, 6), 16) <= Convert.ToInt32(wipMAC.Value.EndNO, 16)))
|
|
|
|
// {
|
|
|
|
// resultModel.Msg += "組件序號【" + KPs.inputData + "】 與工單設定MAC區間不符合 </br>";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 判斷出貨序號
|
|
|
@ -1929,35 +1930,36 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 判斷MAC區間
|
|
|
|
if (wipKpsItem.KpNo.ToUpper() == "MAC") |
|
|
|
{ |
|
|
|
WipMACController wipMACController = new WipMACController(_context); |
|
|
|
var wipMAC = await wipMACController.GetWipMAC(barcodeItemKPDto.WipNo); |
|
|
|
if (wipMAC.Value == null) |
|
|
|
{ |
|
|
|
CheckMsg += "工單號碼【" + barcodeItemKPDto.WipNo + "】 找不到綁定MAC區間</br>"; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
// 判斷MAC前置碼是否一樣
|
|
|
|
if (!barcodeKPDtoItem.inputData.StartsWith(wipMAC.Value.Title)) |
|
|
|
{ |
|
|
|
CheckMsg += "組件序號【" + barcodeKPDtoItem.inputData + "】 與MAC【" + wipMAC.Value.Title + "】前置碼不符合 </br>"; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
// 判斷是否符合區間
|
|
|
|
if (barcodeKPDtoItem.inputData.Length == 12) |
|
|
|
{ |
|
|
|
if (!(Convert.ToInt32(wipMAC.Value.StartNO, 16) <= Convert.ToInt32(barcodeKPDtoItem.inputData.Substring(6, 6), 16) |
|
|
|
&& Convert.ToInt32(barcodeKPDtoItem.inputData.Substring(6, 6), 16) <= Convert.ToInt32(wipMAC.Value.EndNO, 16))) |
|
|
|
{ |
|
|
|
CheckMsg += "組件序號【" + barcodeKPDtoItem.inputData + "】 與工單設定MAC區間不符合 </br>"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 安勤不需要判斷MAC區間
|
|
|
|
//if (wipKpsItem.KpNo.ToUpper() == "MAC")
|
|
|
|
//{
|
|
|
|
// WipMACController wipMACController = new WipMACController(_context);
|
|
|
|
// var wipMAC = await wipMACController.GetWipMAC(barcodeItemKPDto.WipNo);
|
|
|
|
// if (wipMAC.Value == null)
|
|
|
|
// {
|
|
|
|
// CheckMsg += "工單號碼【" + barcodeItemKPDto.WipNo + "】 找不到綁定MAC區間</br>";
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// // 判斷MAC前置碼是否一樣
|
|
|
|
// if (!barcodeKPDtoItem.inputData.StartsWith(wipMAC.Value.Title))
|
|
|
|
// {
|
|
|
|
// CheckMsg += "組件序號【" + barcodeKPDtoItem.inputData + "】 與MAC【" + wipMAC.Value.Title + "】前置碼不符合 </br>";
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// // 判斷是否符合區間
|
|
|
|
// if (barcodeKPDtoItem.inputData.Length == 12)
|
|
|
|
// {
|
|
|
|
// if (!(Convert.ToInt32(wipMAC.Value.StartNO, 16) <= Convert.ToInt32(barcodeKPDtoItem.inputData.Substring(6, 6), 16)
|
|
|
|
// && Convert.ToInt32(barcodeKPDtoItem.inputData.Substring(6, 6), 16) <= Convert.ToInt32(wipMAC.Value.EndNO, 16)))
|
|
|
|
// {
|
|
|
|
// CheckMsg += "組件序號【" + barcodeKPDtoItem.inputData + "】 與工單設定MAC區間不符合 </br>";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 判斷出貨序號
|
|
|
|