This commit is contained in:
jl
2023-04-17 14:10:34 +08:00
parent bf208bde56
commit ab8ac9cce6
13 changed files with 480 additions and 141 deletions

View File

@ -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
}
}

View 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; }
}
}

View File

@ -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" />