添加项目文件。

This commit is contained in:
jl
2023-01-13 15:30:20 +08:00
parent 40ed216831
commit bf208bde56
834 changed files with 470902 additions and 0 deletions

View File

@ -0,0 +1,94 @@
using Epost.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Epost.DAL.Cache
{
public class BoxCodeCacheDAL
{
private static object lockboxobj = new object();
public static List<BoxModel> BoxList = new List<BoxModel>();//
#region
public List<BoxModel> GetBoxList()
{
return BoxList;
}
#endregion
#region
public void ClearBoxList()
{
foreach (var planitem in BoxList.ToArray())
{
BoxList.Remove(planitem);
}
}
#endregion
#region Job缓存处理方法
/// <summary>
/// Job缓存处理方法
/// </summary>
/// <param name="JobParam"></param>
/// <param name="ECommend"></param>
/// <returns></returns>
public bool UpdateBoxList(List<BoxModel> JobParam, EboxCommend CommendType)
{
lock (lockboxobj)
{
if (CommendType.Equals(EboxCommend.Create))
{
BoxList.AddRange(JobParam);
}
else if (CommendType.Equals(EboxCommend.Execute))
{
// JobParam.ForEach(m => BoxList.Remove(m));
List<BoxModel> list= BoxList.FindAll(p=>p.Block== JobParam.FirstOrDefault().Block);
foreach (BoxModel item in list)
{
BoxList.Remove(item);
}
}
return true;
}
}
#endregion
}
public enum EboxCommend
{
/// <summary>
/// 接收扫描任务
/// </summary>
[Description("接收扫描任务")]
Create,
/// <summary>
/// 任务处理
/// </summary>
[Description("任务处理")]
Execute
}
}