|
|
@ -966,9 +966,25 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
var NgItem = barCodeCheckDto.inputItems.Where(w => w.inputData.Contains("$")).ToList(); |
|
|
|
var result = new ResultModel<NgInfo>() { Success = true }; |
|
|
|
var result_NgComponent = new ResultModel<NgComponent>(); |
|
|
|
|
|
|
|
// 新增 NgInfo
|
|
|
|
if (NgItem.Count != 0) |
|
|
|
{ |
|
|
|
// 判斷是否不良代碼
|
|
|
|
IQueryable<NGReason> q = _context.NGReasons; |
|
|
|
foreach (var item in NgItem.Select(s => s.inputData)) |
|
|
|
{ |
|
|
|
if (!q.Where(w => w.NGReasonNo.Trim().ToUpper() == item.Replace("$", "").Trim().ToUpper() |
|
|
|
&& w.Status == "A").Any()) |
|
|
|
{ |
|
|
|
result.Success = false; |
|
|
|
result.Msg = $"查無不良代碼【{item.Replace("$", "").Trim().ToUpper()}】"; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NgInfo ngInfo = new NgInfo |
|
|
|
{ |
|
|
|
TypeNo = _context.Stationses.Where(w => w.StationID == barCodeCheckDto.stationID).FirstOrDefault().TestType, |
|
|
@ -1682,7 +1698,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES |
|
|
|
if (CheckNowFirstStation(wipNo, unitNo, stationID) == "Y") |
|
|
|
{ |
|
|
|
var FirstWipInfo = WipNoItem.FirstOrDefault(); |
|
|
|
if (FirstWipInfo.CompleteQTY >= FirstWipInfo.PlanQTY) |
|
|
|
if (FirstWipInfo.CompleteQTY >= FirstWipInfo.PlanQTY) |
|
|
|
{ |
|
|
|
resultModel.Msg = "工單號碼【" + wipNo + "】,已投入數量>=工單數量,請在確認"; |
|
|
|
return resultModel; |
|
|
|