110 lines
2.6 KiB
C#
110 lines
2.6 KiB
C#
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 LocationCacheDAL
|
|
{
|
|
private static object lockobj = new object();
|
|
public static List<OrderListModel> LocationList = new List<OrderListModel>();//
|
|
|
|
#region 获取计划任务列表
|
|
public List<OrderListModel> GetLocationList()
|
|
{
|
|
|
|
return LocationList;
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
#region 初始化任务列表
|
|
public void ClearScanList()
|
|
{
|
|
foreach (var planitem in LocationList.ToArray())
|
|
{
|
|
LocationList.Remove(planitem);
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region Job缓存处理方法
|
|
/// <summary>
|
|
/// Job缓存处理方法
|
|
/// </summary>
|
|
/// <param name="JobParam"></param>
|
|
/// <param name="ECommend"></param>
|
|
/// <returns></returns>
|
|
public bool UpdateLocModelList(List<OrderListModel> JobParam, ELCommend CommendType)
|
|
{
|
|
|
|
lock (lockobj)
|
|
{
|
|
|
|
if (CommendType.Equals(ELCommend.Create))
|
|
{
|
|
LocationList.AddRange(JobParam);
|
|
}
|
|
else if (CommendType.Equals(ELCommend.Update))
|
|
{
|
|
List<OrderListModel> ls = LocationList.FindAll(m => m.State == 2);
|
|
ls.ForEach(m => m.State =3);
|
|
JobParam.ForEach(m => m.State = 2);
|
|
|
|
}
|
|
else if (CommendType.Equals(ELCommend.Complete))
|
|
{
|
|
JobParam.ForEach(m => m.State = 3);
|
|
|
|
}
|
|
else if (CommendType.Equals(ELCommend.Execute))
|
|
{
|
|
JobParam.ForEach(m => LocationList.Remove(m));
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
public enum ELCommend
|
|
{
|
|
/// <summary>
|
|
///货位下订单创建
|
|
/// </summary>
|
|
[Description("货位信息添加")]
|
|
Create,
|
|
|
|
/// <summary>
|
|
/// 货位订单处理
|
|
/// </summary>
|
|
[Description("货位订单处理")]
|
|
Update,
|
|
/// <summary>
|
|
/// 货位订单完成
|
|
/// </summary>
|
|
[Description("货位订单完成")]
|
|
Complete,
|
|
/// <summary>
|
|
/// 货位订单删除
|
|
/// </summary>
|
|
[Description("货位订单删除")]
|
|
Execute
|
|
}
|
|
}
|