|
|
@ -274,8 +274,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
// 判斷是否符合區間
|
|
|
|
if (KPs.inputData.Length == 12) |
|
|
|
{ |
|
|
|
if (!(Convert.ToInt32(wipMAC.Value.StartNO, 16) <= Convert.ToInt32(KPs.inputData.Substring(7, 6), 16) |
|
|
|
&& Convert.ToInt32(KPs.inputData.Substring(7, 6), 16) <= Convert.ToInt32(wipMAC.Value.EndNO, 16))) |
|
|
|
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>"; |
|
|
|
} |
|
|
@ -329,8 +329,12 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
|
|
|
|
//var NextStopCloseStation = await CheckNextStopCloseStation(barCodeCheckDto.wipNo, barCodeCheckDto.unitNo, barCodeCheckDto.station);
|
|
|
|
|
|
|
|
#region 判斷下一站為完工時.組件是否都有資料
|
|
|
|
if (CheckNextStopCloseStation(barCodeCheckDto.wipNo, barCodeCheckDto.unitNo, barCodeCheckDto.station).Result.Success) |
|
|
|
#region 判斷為CHECK站.組件是否都有資料
|
|
|
|
// 判斷作業站是否為燒機站
|
|
|
|
StationsesController stationsesController = new StationsesController(_context); |
|
|
|
var station = await stationsesController.GetStations(barCodeCheckDto.station); |
|
|
|
if (station.Value.Where(w => w.TypeNo == "C").Any()) |
|
|
|
//if (CheckNextStopCloseStation(barCodeCheckDto.wipNo, barCodeCheckDto.unitNo, barCodeCheckDto.station).Result.Success)
|
|
|
|
{ |
|
|
|
// 過站輸入組件數量
|
|
|
|
var inputKPQty = barCodeCheckDto.inputItems.Where(w => !w.inputData.Contains("$")).Count(); |
|
|
@ -345,7 +349,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
if (wipKpQty != inputKPQty + BarCodeItemsQty) |
|
|
|
{ |
|
|
|
resultModel.Success = false; |
|
|
|
resultModel.Msg = "該作業站為流程最後最後一站,組件資料筆數不符,請確認"; |
|
|
|
resultModel.Msg = "組件資料筆數不符,請確認"; |
|
|
|
return resultModel; |
|
|
|
} |
|
|
|
} |
|
|
@ -666,7 +670,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
SysType = "S", |
|
|
|
CreateUserID = barCodeCheckDto.userID, |
|
|
|
CreateDate = DateTime.Now, |
|
|
|
UpdateDate = DateTime.Now |
|
|
|
UpdateDate = DateTime.Now, |
|
|
|
KpItemNo = KeyPartsItem[i].kpItemNo |
|
|
|
}; |
|
|
|
result = await barcodeItemsController.PostBarcodeItems(barcodeItem); |
|
|
|
if (!result.Success) |
|
|
@ -773,7 +778,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
if (item != null) |
|
|
|
{ |
|
|
|
item.FinishTime = DateTime.Now; |
|
|
|
item.OutUserID = 1; |
|
|
|
item.OutUserID = model.userID; |
|
|
|
item.UpdateDate = DateTime.Now; |
|
|
|
item.UpdateUserID = model.userID; |
|
|
|
result = await burnInfoeController.PutBurnInfo(item); |
|
|
@ -788,7 +793,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
BurnPlanHour = PlanHour, |
|
|
|
StartTime = DateTime.Now, |
|
|
|
ScheduleFinishTime = DateTime.Now.AddMinutes((double)PlanHour), |
|
|
|
InUserID = 0, |
|
|
|
InUserID = model.userID, |
|
|
|
Status = 0, |
|
|
|
CreateUserID = model.userID, |
|
|
|
UpdateUserID = model.userID |
|
|
@ -1085,11 +1090,12 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
/// <param name="unitno">生產單位</param>
|
|
|
|
/// <param name="line">線別</param>
|
|
|
|
/// <param name="flowrule">流程</param>
|
|
|
|
/// <param name="stationID">作業站ID</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("CheckWipNoSation")] |
|
|
|
public IActionResult GetCheckWipNoSation(string wipno, string unitno, int line, int flowrule) |
|
|
|
public IActionResult GetCheckWipNoSation(string wipno, string unitno, int line, int flowrule, int stationID) |
|
|
|
{ |
|
|
|
var result = CheckWipNoSationAsync(wipNo: wipno, unitNo: unitno, flowRuleID: flowrule, line: line); |
|
|
|
var result = CheckWipNoSationAsync(wipNo: wipno, unitNo: unitno, flowRuleID: flowrule, line: line, station: stationID); |
|
|
|
return Ok(result.Result); |
|
|
|
} |
|
|
|
|
|
|
@ -1452,36 +1458,53 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
return resultModel; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!WipNoItem.Where(w => w.LineID == line).Any()) |
|
|
|
{ |
|
|
|
resultModel.Msg = "工單號碼【" + wipNo + "】,尚未設定此線別"; |
|
|
|
return resultModel; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (WipNoItem.Where(w => w.StatusNO == "E").Any()) |
|
|
|
{ |
|
|
|
resultModel.Msg = "工單號碼【" + wipNo + "】,該工單已經投入完工,請切換工單"; |
|
|
|
return resultModel; |
|
|
|
} |
|
|
|
|
|
|
|
int WipID = WipNoItem.FirstOrDefault().WipID; |
|
|
|
LineInfoesController lineInfoesController = new LineInfoesController(_context); |
|
|
|
var q2 = await lineInfoesController.GetLineInfoByWipID(WipID); |
|
|
|
if (!q2.Value.Where(w => w.LineID == line).Any()) |
|
|
|
// 判斷是否是投入站
|
|
|
|
var RuleStation = await _context.RuleStations.Where(w => w.FlowRuleID == flowRuleID && w.StationID == station) |
|
|
|
.FirstOrDefaultAsync(); |
|
|
|
if (RuleStation != null) |
|
|
|
{ |
|
|
|
resultModel.Msg = "工單號碼【" + wipNo + "】,工單尚未開線,不可過站"; |
|
|
|
return resultModel; |
|
|
|
if (RuleStation.Sequence == 1) |
|
|
|
{ |
|
|
|
int WipID = WipNoItem.FirstOrDefault().WipID; |
|
|
|
LineInfoesController lineInfoesController = new LineInfoesController(_context); |
|
|
|
var q2 = await lineInfoesController.GetLineInfoByWipID(WipID); |
|
|
|
if (!q2.Value.Where(w => w.LineID == line).Any()) |
|
|
|
{ |
|
|
|
resultModel.Msg = "工單號碼【" + wipNo + "】,工單尚未開線,不可過站"; |
|
|
|
return resultModel; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 該筆工單號碼鎖定
|
|
|
|
WipLockController wipLockController = new WipLockController(_context); |
|
|
|
var q3 = await wipLockController.GetWipLockByWipNO(wipNo); |
|
|
|
if (q3.Data.Where(w => w.LockStatus == "0" && w.StationID == station).Any()) |
|
|
|
if (q3.Data.Where(w => w.LockStatus == "0" && w.StationID == 0).Any()) |
|
|
|
{ |
|
|
|
resultModel.Msg = "工單號碼【" + wipNo + "】,已被鎖定,不可過站"; |
|
|
|
return resultModel; |
|
|
|
} |
|
|
|
// StationID = 0 代表批次鎖定
|
|
|
|
else if (q3.Data.Where(w => w.LockStatus == "0" && w.StationID == station).Any()) |
|
|
|
{ |
|
|
|
resultModel.Msg = "工單號碼【" + wipNo + "】,工單在當前站別被鎖定,不可過站"; |
|
|
|
return resultModel; |
|
|
|
} |
|
|
|
|
|
|
|
resultModel.Success = true; |
|
|
|
return resultModel; |
|
|
|
} |
|
|
|