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.
|
|
|
|
|
using Khd.Core.EntityFramework;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Khd.Core.Wcs
|
|
|
|
|
|
{
|
|
|
|
|
|
public class SystemData
|
|
|
|
|
|
{
|
|
|
|
|
|
public static long _serialNo { get; set; } = 1;
|
|
|
|
|
|
|
|
|
|
|
|
public static object serialLock = new object();
|
|
|
|
|
|
|
|
|
|
|
|
public static long GetSerialNo(DefaultDbContext dbContext)
|
|
|
|
|
|
{
|
|
|
|
|
|
lock (serialLock)
|
|
|
|
|
|
{
|
|
|
|
|
|
List<long?> list = dbContext.WcsTask.Select(t => t.serialNo).ToList();
|
|
|
|
|
|
while (list.Contains(_serialNo))
|
|
|
|
|
|
{
|
|
|
|
|
|
_serialNo++;
|
|
|
|
|
|
if (_serialNo > 9999)
|
|
|
|
|
|
{
|
|
|
|
|
|
_serialNo = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return _serialNo;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|