using Epost.Common; 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 ScanModelCacheDAL { private static object lockobj = new object(); public static List PlanScanList = new List();// #region 获取计划任务列表 public List GetPlanScanList() { return PlanScanList; } #endregion #region 初始化任务列表 public void ClearScanList() { foreach (var planitem in PlanScanList.ToArray()) { PlanScanList.Remove(planitem); } } #endregion #region Job缓存处理方法 /// /// Job缓存处理方法 /// /// /// /// public bool UpdateScanModelList(List JobParam, ECommend CommendType) { lock (lockobj) { if (CommendType.Equals(ECommend.Create)) { PlanScanList.AddRange(JobParam); } else if (CommendType.Equals(ECommend.Execute)) { JobParam.ForEach(m => PlanScanList.Remove(m)); } return true; } } #endregion //#region 员工号缓存处理方法 ///// ///// Job缓存处理方法 ///// ///// ///// ///// //public bool UpdateUserList(List JobParam, ECommend CommendType) //{ // lock (lockobj) // { // if (CommendType.Equals(ECommend.Create)) // { // UserCodeList.AddRange(JobParam); // } // else if (CommendType.Equals(ECommend.Execute)) // { // JobParam.ForEach(m => UserCodeList.Remove(m)); // UserCodeList.AddRange(JobParam); // } // return true; // } //} //#endregion } public enum ECommend { /// /// 接收扫描任务 /// [Description("接收扫描任务")] Create, /// /// 任务处理 /// [Description("任务处理")] Execute } }