using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.Service
|
{
|
public partial class CustomRealJob
|
{
|
/// <summary>
|
/// 创建编号
|
/// </summary>
|
private string CreateNO()
|
{
|
var all=GetAll();
|
var noList = all.Select(x => x.NO).ToList();
|
var number = noList.Count + 1;
|
var no = GetFormatNO(number);
|
while (noList.Contains(no))
|
{
|
number++;
|
no = GetFormatNO(number);
|
}
|
return no;
|
}
|
|
//获取格式化NO
|
private string GetFormatNO(int number)
|
{
|
return $"CRJ-{number:000000}";
|
}
|
|
}
|
}
|