This commit is contained in:
@ -809,5 +809,26 @@ namespace Epost.DAL
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 灯带
|
||||
#region 查询设备信息
|
||||
public DataTable QueryAddrList(string strwhere)
|
||||
{
|
||||
string sql = string.Format("select * from v_address where 1=1 " + strwhere);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region 查询设备信息
|
||||
public DataTable QueryControlList(string strwhere)
|
||||
{
|
||||
string sql = string.Format(" select distinct controlip ,port,waveno,address from v_address where 1=1 " + strwhere);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
94
Epost.DAL/Cache/LightControlCacheDAL.cs
Normal file
94
Epost.DAL/Cache/LightControlCacheDAL.cs
Normal file
@ -0,0 +1,94 @@
|
||||
using LightContrl;
|
||||
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 LightControlCacheDAL
|
||||
{
|
||||
|
||||
private static object lockconobj = new object();
|
||||
public static List<LightcontrolModel> MainControlList = new List<LightcontrolModel>();//
|
||||
|
||||
#region 获取计划任务列表
|
||||
public List<LightcontrolModel> GetControlList()
|
||||
{
|
||||
return MainControlList;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 初始化任务列表
|
||||
public void ClearControlList()
|
||||
{
|
||||
foreach (var planitem in MainControlList.ToArray())
|
||||
{
|
||||
MainControlList.Remove(planitem);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Job缓存处理方法
|
||||
/// <summary>
|
||||
/// Job缓存处理方法
|
||||
/// </summary>
|
||||
/// <param name="JobParam"></param>
|
||||
/// <param name="ECommend"></param>
|
||||
/// <returns></returns>
|
||||
public bool UpdateControlList(List<LightcontrolModel> JobParam, EcontrolCommend CommendType)
|
||||
{
|
||||
|
||||
lock (lockconobj)
|
||||
{
|
||||
|
||||
if (CommendType.Equals(EcontrolCommend.Create))
|
||||
{
|
||||
|
||||
MainControlList.AddRange(JobParam);
|
||||
}
|
||||
|
||||
else if (CommendType.Equals(EcontrolCommend.Execute))
|
||||
{
|
||||
JobParam.ForEach(m => MainControlList.Remove(m));
|
||||
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
public enum EcontrolCommend
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建
|
||||
/// </summary>
|
||||
[Description("创建")]
|
||||
Create,
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
[Description("删除")]
|
||||
Execute
|
||||
}
|
||||
|
||||
public class LightcontrolModel
|
||||
{
|
||||
private string _controlip = string.Empty;
|
||||
MainControl _maincontrol = new MainControl();
|
||||
|
||||
public MainControl maincontrol { get => _maincontrol; set => _maincontrol = value; }
|
||||
public string controlip { get => _controlip; set => _controlip = value; }
|
||||
}
|
||||
}
|
@ -82,6 +82,9 @@
|
||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="LightContrl">
|
||||
<HintPath>..\DLL\LightContrl.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
@ -106,6 +109,7 @@
|
||||
<Compile Include="Cache\EPlightCacheDAL.cs" />
|
||||
<Compile Include="Cache\JobDownCacheDAL.cs" />
|
||||
<Compile Include="Cache\JobModelCacheDAL.cs" />
|
||||
<Compile Include="Cache\LightControlCacheDAL.cs" />
|
||||
<Compile Include="Cache\LocationCacheDAL.cs" />
|
||||
<Compile Include="Cache\ScanModelCacheDAL.cs" />
|
||||
<Compile Include="Cache\ShowMesCacheDAL.cs" />
|
||||
|
Reference in New Issue
Block a user