|
@ -159,6 +159,10 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 治具判斷
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 維修過站 組件需獨立判斷
|
|
|
// 維修過站 組件需獨立判斷
|
|
@ -448,6 +452,11 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//if (!Table_BarcodeOutfit(barCodeCheckDto).Result.Success)
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
if (!Table_NgInfo(barCodeCheckDto).Result.Success) |
|
|
if (!Table_NgInfo(barCodeCheckDto).Result.Success) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
@ -539,7 +548,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// NgInfo-組件资料
|
|
|
/// BarcodeItem-組件资料
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="barCodeCheckDto"></param>
|
|
|
/// <param name="barCodeCheckDto"></param>
|
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
@ -569,6 +578,36 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
return resut; |
|
|
return resut; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// BarcodeOutfit-治具资料
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="barCodeCheckDto"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
private async Task<ResultModel<BarcodeOutfit>> Table_BarcodeOutfit(BarCodeCheckDto barCodeCheckDto) |
|
|
|
|
|
{ |
|
|
|
|
|
BarcodeOutfitController barcodeOutfitController = new BarcodeOutfitController(_context); |
|
|
|
|
|
var OutfitsItem = barCodeCheckDto.outfits; |
|
|
|
|
|
var resut = new ResultModel<BarcodeOutfit>(); |
|
|
|
|
|
// 新增 BarCodeStation
|
|
|
|
|
|
foreach (var item in OutfitsItem) |
|
|
|
|
|
{ |
|
|
|
|
|
var barcodeOutfit = new BarcodeOutfit |
|
|
|
|
|
{ |
|
|
|
|
|
BarcodeNo = barCodeCheckDto.barcode, |
|
|
|
|
|
WipNo = barCodeCheckDto.wipNo, |
|
|
|
|
|
OutfitNo = item.inputData, |
|
|
|
|
|
StationID = barCodeCheckDto.station, |
|
|
|
|
|
CreateUserID = 0, |
|
|
|
|
|
CreateDate = DateTime.Now, |
|
|
|
|
|
UpdateUserID = 0, |
|
|
|
|
|
UpdateDate = DateTime.Now |
|
|
|
|
|
}; |
|
|
|
|
|
await barcodeOutfitController.PostBarcodeOutfit(barcodeOutfit); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return resut; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// NgInfo-測試不良基本資料檔
|
|
|
/// NgInfo-測試不良基本資料檔
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
@ -1263,7 +1302,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
public async Task<IResultModel> CheckBarCodeKPAsync([FromQuery] BarcodeItemKPDto barcodeItemKPDto) |
|
|
public async Task<IResultModel> CheckBarCodeKPAsync([FromQuery] BarcodeItemKPDto barcodeItemKPDto) |
|
|
{ |
|
|
{ |
|
|
ResultModel<string> resultModel = new ResultModel<string> { Success = false }; |
|
|
ResultModel<string> resultModel = new ResultModel<string> { Success = false }; |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
#region 判斷是否有工單
|
|
|
#region 判斷是否有工單
|
|
|
WipInfosController wipInfosController = new WipInfosController(_context); |
|
|
WipInfosController wipInfosController = new WipInfosController(_context); |
|
|
var q = await wipInfosController.GetWipInfoByWipNo(barcodeItemKPDto.WipNo); |
|
|
var q = await wipInfosController.GetWipInfoByWipNo(barcodeItemKPDto.WipNo); |
|
@ -1430,6 +1470,35 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
resultModel.Success = true; |
|
|
resultModel.Success = true; |
|
|
return resultModel; |
|
|
return resultModel; |
|
|
} |
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
resultModel.Success = false; |
|
|
|
|
|
resultModel.Msg = ex.Message; |
|
|
|
|
|
return resultModel; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 確認治具狀態
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("BarCodeOutfit")] |
|
|
|
|
|
public async Task<IResultModel> CheckBarCodeOutfitAsync(string barcodeNo, string wipNo, string outfitNo) |
|
|
|
|
|
{ |
|
|
|
|
|
ResultModel<string> resultModel = new ResultModel<string> { Success = false }; |
|
|
|
|
|
|
|
|
|
|
|
#region 判斷是否有重複治具紀錄
|
|
|
|
|
|
BarcodeOutfitController barcodeOutfitController = new BarcodeOutfitController(_context); |
|
|
|
|
|
var q = await barcodeOutfitController.GetBarcodeOutfitByBarcodeNo(barcodeNo); |
|
|
|
|
|
if (q.Value.Any(w => w.WipNo == wipNo && w.OutfitNo == outfitNo)) |
|
|
|
|
|
{ |
|
|
|
|
|
resultModel.Msg = "治具編號號碼【" + outfitNo + "】,已有在條碼【" + barcodeNo + "】使用紀錄"; |
|
|
|
|
|
return resultModel; |
|
|
|
|
|
} |
|
|
|
|
|
#endregion
|
|
|
|
|
|
resultModel.Success = true; |
|
|
|
|
|
return resultModel; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 確認組件數量正確
|
|
|
/// 確認組件數量正確
|
|
|