Browse Source

1. 過站加入不良代碼判斷

PTD
ray 2 years ago
parent
commit
0db7df744d
  1. 16
      AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs

16
AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs

@ -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,

Loading…
Cancel
Save