|
@@ -1,5 +1,6 @@
|
|
|
using Newtonsoft.Json;
|
|
|
using ServiceCenter.Extensions;
|
|
|
+using ServiceCenter.Logs;
|
|
|
using ServiceCenter.SqlSugars;
|
|
|
using System.ComponentModel;
|
|
|
using WCS.Core;
|
|
@@ -63,21 +64,29 @@ namespace WCS.WorkEngineering.Systems
|
|
|
}
|
|
|
|
|
|
//先更新对应的位信息
|
|
|
- var index = 0;
|
|
|
- foreach (var loc in row.Locs.Where(x => !x.IsEmpty).OrderBy(x => x.XYNo))
|
|
|
+ try
|
|
|
{
|
|
|
- if (index < cacheLine.Locations.Count)
|
|
|
+ var index = 0;
|
|
|
+ foreach (var loc in row.Locs.Where(x => !x.IsEmpty).OrderBy(x => x.XYNo))
|
|
|
{
|
|
|
- var cacheLoc = cacheLine.Locations[index];
|
|
|
- cacheLoc = db.Queryable<WCS_CacheLineLoc>().Single(x => x.Id == cacheLoc.Id);
|
|
|
- loc.TaskId = cacheLoc.TaskId;
|
|
|
- loc.Finish = true;
|
|
|
-
|
|
|
- upDateableLoc.Add(loc);
|
|
|
- deleteLoc.Add(cacheLoc);
|
|
|
- index++;
|
|
|
+ if (index < cacheLine.Locations.Count)
|
|
|
+ {
|
|
|
+ var cacheLoc = cacheLine.Locations[index];
|
|
|
+ cacheLoc = db.Queryable<WCS_CacheLineLoc>().Single(x => x.Id == cacheLoc.Id);
|
|
|
+ loc.TaskId = cacheLoc.TaskId;
|
|
|
+ loc.Finish = true;
|
|
|
+
|
|
|
+ upDateableLoc.Add(loc);
|
|
|
+ deleteLoc.Add(cacheLoc);
|
|
|
+ index++;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ catch (Exception a)
|
|
|
+ {
|
|
|
+ throw new KnownException(a.Message, LogLevelEnum.High);
|
|
|
+ }
|
|
|
+
|
|
|
row.Finish = true;
|
|
|
upDateableRow.Add(row);
|
|
|
deleteCacheLine.Add(cacheLine);
|