|
@ -5662,6 +5662,11 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
public async Task<IActionResult> PCS022QueryAsync(string wipNo, string productNo, string unit, string type, int lineID = 0, int page = 0, int limit = 10) |
|
|
public async Task<IActionResult> PCS022QueryAsync(string wipNo, string productNo, string unit, string type, int lineID = 0, int page = 0, int limit = 10) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (type == "W") |
|
|
|
|
|
productNo = string.Empty; |
|
|
|
|
|
else |
|
|
|
|
|
wipNo = string.Empty; |
|
|
|
|
|
|
|
|
IResultModel<BarcodeInfoDto> result = await _pcsApi.GetBarcodeInfoesByPCS022Query(wipNo: wipNo, |
|
|
IResultModel<BarcodeInfoDto> result = await _pcsApi.GetBarcodeInfoesByPCS022Query(wipNo: wipNo, |
|
|
itemNo: productNo, unit: unit, lineID, page: page, limit: limit); |
|
|
itemNo: productNo, unit: unit, lineID, page: page, limit: limit); |
|
|
|
|
|
|
|
@ -5681,7 +5686,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[HttpGet] |
|
|
[HttpGet] |
|
|
public async Task<IActionResult> PCS022VQuery(int wipID, int ruleStationID,int page = 0, int limit = 10) |
|
|
public async Task<IActionResult> PCS022VQuery(int wipID, int ruleStationID, int page = 0, int limit = 10) |
|
|
{ |
|
|
{ |
|
|
var result = await _pcsApi.GetWipStationBarcodeByPCS022(wipID, ruleStationID, page, limit); |
|
|
var result = await _pcsApi.GetWipStationBarcodeByPCS022(wipID, ruleStationID, page, limit); |
|
|
|
|
|
|
|
@ -5692,6 +5697,65 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
|
|
|
|
|
return Json(new Table() { count = 0, data = null }); |
|
|
return Json(new Table() { count = 0, data = null }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[HttpPost] |
|
|
|
|
|
public async Task<IActionResult> PCS022U(int wipID, int ruleStationID) |
|
|
|
|
|
{ |
|
|
|
|
|
var result = await _pcsApi.GetBarcodeInfoesByWipID(wipID); |
|
|
|
|
|
result = result.Where(w => w.RuleStationID == ruleStationID && w.RuleStatus == "P").ToList(); |
|
|
|
|
|
|
|
|
|
|
|
var FlowRule = result.FirstOrDefault().GetWipInfo.FlowRuleID; |
|
|
|
|
|
var result_RuleStation = await _basApi.GetRuleStationsByFlow(FlowRule, 0); |
|
|
|
|
|
// 只抓標準站 & 排除完工站
|
|
|
|
|
|
result_RuleStation = result_RuleStation.Where(w => w.StationType == "M" && w.StationID != 1000).OrderBy(o => o.Sequence).ToList(); |
|
|
|
|
|
// 當站
|
|
|
|
|
|
var NowSequence = result_RuleStation.Where(w => w.RuleStationID == ruleStationID).FirstOrDefault().Sequence; |
|
|
|
|
|
var NextStationID = 0; |
|
|
|
|
|
// 排除當站為最後一站
|
|
|
|
|
|
if (result_RuleStation.Count != NowSequence + 1) |
|
|
|
|
|
NextStationID = result_RuleStation.Where(w => w.Sequence == NowSequence + 1).FirstOrDefault().StationID; |
|
|
|
|
|
|
|
|
|
|
|
if (NextStationID != 0) |
|
|
|
|
|
{ |
|
|
|
|
|
var resultMsg = string.Empty; |
|
|
|
|
|
foreach (var item in result) |
|
|
|
|
|
{ |
|
|
|
|
|
//自動過站
|
|
|
|
|
|
var barCode = new BarCodeCheckDto |
|
|
|
|
|
{ |
|
|
|
|
|
wipNo = item.GetWipInfo.WipNO, |
|
|
|
|
|
barcode = item.BarcodeNo, |
|
|
|
|
|
barcodeType = "M", |
|
|
|
|
|
station = NextStationID, |
|
|
|
|
|
line = item.GetWipInfo.LineID ?? 0, |
|
|
|
|
|
unitNo = item.GetWipInfo.UnitNO, |
|
|
|
|
|
inputItems = null, |
|
|
|
|
|
userID = GetLogInUserID() |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
var barcode_result = await _pcsApi.PassIngByCheck(JsonConvert.SerializeObject(barCode)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (barcode_result.Success) |
|
|
|
|
|
{ |
|
|
|
|
|
resultMsg += $"{item.BarcodeNo} 內部條碼:資料過站成功!!!" + "</br>"; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
resultMsg += $"{item.BarcodeNo} 內部條碼:資料過站失敗!!!原因:" + barcode_result.Msg + "</br>"; |
|
|
|
|
|
} |
|
|
|
|
|
return Json(new Result() { success = true, msg = resultMsg }); |
|
|
|
|
|
} |
|
|
|
|
|
catch(Exception ex) { |
|
|
|
|
|
return Json(new Result() { success = false, msg = ex.Message }); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return Json(new Result() { success = true, msg = resultMsg }); |
|
|
|
|
|
} |
|
|
|
|
|
return Json(new Result() { success = true, msg = "該站為最後一站,無法執行過站" }); |
|
|
|
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
#region PCS023 條碼置換
|
|
|
#region PCS023 條碼置換
|
|
|