You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
836 B
C#

2 years ago
using Khd.Core.EntityFramework;
2 years ago
namespace Khd.Core.Wcs
2 years ago
{
public class SystemData
{
1 year ago
public readonly static int maxTray = 5;
1 year ago
2 years ago
private static long _serialNo { get; set; } = 1;
2 years ago
2 years ago
private static object serialLock = new object();
2 years ago
public static long GetSerialNo(DefaultDbContext dbContext)
{
lock (serialLock)
{
List<long?> list = dbContext.WcsTask.Select(t => t.serialNo).ToList();
while (list.Contains(_serialNo))
{
_serialNo++;
2 years ago
if (_serialNo > 9999)
2 years ago
{
_serialNo = 1;
}
}
return _serialNo;
}
}
2 years ago
public static object outStockLock = new object();
1 year ago
2 years ago
}
}