开机和全部设备接口编写
This commit is contained in:
parent
e450312973
commit
63887311b9
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,179 @@
|
|||
/** 版本信息模板在安装目录下,可自行修改。
|
||||
* policy_device.cs
|
||||
*
|
||||
* 功 能: N/A
|
||||
* 类 名: policy_device
|
||||
*
|
||||
* Ver 变更日期 负责人 变更内容
|
||||
* ───────────────────────────────────
|
||||
* V0.01 2024/3/20 9:39:56 N/A 初版
|
||||
*
|
||||
* Copyright (c) 2012 Maticsoft Corporation. All rights reserved.
|
||||
*┌──────────────────────────────────┐
|
||||
*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │
|
||||
*│ 版权所有:动软卓越(北京)科技有限公司 │
|
||||
*└──────────────────────────────────┘
|
||||
*/
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Collections.Generic;
|
||||
using Maticsoft.Common;
|
||||
using DataService.Model;
|
||||
namespace DataService.BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// policy_device
|
||||
/// </summary>
|
||||
public partial class policy_device
|
||||
{
|
||||
private readonly DataService.DAL.policy_device dal=new DataService.DAL.policy_device();
|
||||
public policy_device()
|
||||
{}
|
||||
#region BasicMethod
|
||||
/// <summary>
|
||||
/// 是否存在该记录
|
||||
/// </summary>
|
||||
public bool Exists(string PolicyId)
|
||||
{
|
||||
return dal.Exists(PolicyId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加一条数据
|
||||
/// </summary>
|
||||
public bool Add(DataService.Model.policy_device model)
|
||||
{
|
||||
return dal.Add(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新一条数据
|
||||
/// </summary>
|
||||
public bool Update(DataService.Model.policy_device model)
|
||||
{
|
||||
return dal.Update(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除一条数据
|
||||
/// </summary>
|
||||
public bool Delete(string PolicyId)
|
||||
{
|
||||
|
||||
return dal.Delete(PolicyId);
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除一条数据
|
||||
/// </summary>
|
||||
public bool DeleteList(string PolicyIdlist )
|
||||
{
|
||||
return dal.DeleteList(PolicyIdlist );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个对象实体
|
||||
/// </summary>
|
||||
public DataService.Model.policy_device GetModel(string PolicyId)
|
||||
{
|
||||
|
||||
return dal.GetModel(PolicyId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个对象实体,从缓存中
|
||||
/// </summary>
|
||||
public DataService.Model.policy_device GetModelByCache(string PolicyId)
|
||||
{
|
||||
|
||||
string CacheKey = "policy_deviceModel-" + PolicyId;
|
||||
object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
|
||||
if (objModel == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
objModel = dal.GetModel(PolicyId);
|
||||
if (objModel != null)
|
||||
{
|
||||
int ModelCache = Maticsoft.Common.ConfigHelper.GetConfigInt("ModelCache");
|
||||
Maticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
|
||||
}
|
||||
}
|
||||
catch{}
|
||||
}
|
||||
return (DataService.Model.policy_device)objModel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获得数据列表
|
||||
/// </summary>
|
||||
public DataSet GetList(string strWhere)
|
||||
{
|
||||
return dal.GetList(strWhere);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获得数据列表
|
||||
/// </summary>
|
||||
public List<DataService.Model.policy_device> GetModelList(string strWhere)
|
||||
{
|
||||
DataSet ds = dal.GetList(strWhere);
|
||||
return DataTableToList(ds.Tables[0]);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获得数据列表
|
||||
/// </summary>
|
||||
public List<DataService.Model.policy_device> DataTableToList(DataTable dt)
|
||||
{
|
||||
List<DataService.Model.policy_device> modelList = new List<DataService.Model.policy_device>();
|
||||
int rowsCount = dt.Rows.Count;
|
||||
if (rowsCount > 0)
|
||||
{
|
||||
DataService.Model.policy_device model;
|
||||
for (int n = 0; n < rowsCount; n++)
|
||||
{
|
||||
model = dal.DataRowToModel(dt.Rows[n]);
|
||||
if (model != null)
|
||||
{
|
||||
modelList.Add(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
return modelList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获得数据列表
|
||||
/// </summary>
|
||||
public DataSet GetAllList()
|
||||
{
|
||||
return GetList("");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页获取数据列表
|
||||
/// </summary>
|
||||
public int GetRecordCount(string strWhere)
|
||||
{
|
||||
return dal.GetRecordCount(strWhere);
|
||||
}
|
||||
/// <summary>
|
||||
/// 分页获取数据列表
|
||||
/// </summary>
|
||||
public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
|
||||
{
|
||||
return dal.GetListByPage( strWhere, orderby, startIndex, endIndex);
|
||||
}
|
||||
/// <summary>
|
||||
/// 分页获取数据列表
|
||||
/// </summary>
|
||||
//public DataSet GetList(int PageSize,int PageIndex,string strWhere)
|
||||
//{
|
||||
//return dal.GetList(PageSize,PageIndex,strWhere);
|
||||
//}
|
||||
|
||||
#endregion BasicMethod
|
||||
#region ExtensionMethod
|
||||
|
||||
#endregion ExtensionMethod
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,337 @@
|
|||
/** 版本信息模板在安装目录下,可自行修改。
|
||||
* policy_device.cs
|
||||
*
|
||||
* 功 能: N/A
|
||||
* 类 名: policy_device
|
||||
*
|
||||
* Ver 变更日期 负责人 变更内容
|
||||
* ───────────────────────────────────
|
||||
* V0.01 2024/3/20 9:39:56 N/A 初版
|
||||
*
|
||||
* Copyright (c) 2012 Maticsoft Corporation. All rights reserved.
|
||||
*┌──────────────────────────────────┐
|
||||
*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │
|
||||
*│ 版权所有:动软卓越(北京)科技有限公司 │
|
||||
*└──────────────────────────────────┘
|
||||
*/
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using MySql.Data.MySqlClient;
|
||||
using Maticsoft.DBUtility;//Please add references
|
||||
namespace DataService.DAL
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据访问类:policy_device
|
||||
/// </summary>
|
||||
public partial class policy_device
|
||||
{
|
||||
public policy_device()
|
||||
{}
|
||||
#region BasicMethod
|
||||
|
||||
/// <summary>
|
||||
/// 是否存在该记录
|
||||
/// </summary>
|
||||
public bool Exists(string PolicyId)
|
||||
{
|
||||
StringBuilder strSql=new StringBuilder();
|
||||
strSql.Append("select count(1) from policy_device");
|
||||
strSql.Append(" where PolicyId=@PolicyId ");
|
||||
MySqlParameter[] parameters = {
|
||||
new MySqlParameter("@PolicyId", MySqlDbType.VarChar,255) };
|
||||
parameters[0].Value = PolicyId;
|
||||
|
||||
return DbHelperMySQL.Exists(strSql.ToString(),parameters);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 增加一条数据
|
||||
/// </summary>
|
||||
public bool Add(DataService.Model.policy_device model)
|
||||
{
|
||||
StringBuilder strSql=new StringBuilder();
|
||||
strSql.Append("insert into policy_device(");
|
||||
strSql.Append("PolicyId,PolicyName,PolicyDevice,Reserve1,Reserve2,Reserve3,Reserve4,Reserve5)");
|
||||
strSql.Append(" values (");
|
||||
strSql.Append("@PolicyId,@PolicyName,@PolicyDevice,@Reserve1,@Reserve2,@Reserve3,@Reserve4,@Reserve5)");
|
||||
MySqlParameter[] parameters = {
|
||||
new MySqlParameter("@PolicyId", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@PolicyName", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@PolicyDevice", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@Reserve1", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@Reserve2", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@Reserve3", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@Reserve4", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@Reserve5", MySqlDbType.VarChar,255)};
|
||||
parameters[0].Value = model.PolicyId;
|
||||
parameters[1].Value = model.PolicyName;
|
||||
parameters[2].Value = model.PolicyDevice;
|
||||
parameters[3].Value = model.Reserve1;
|
||||
parameters[4].Value = model.Reserve2;
|
||||
parameters[5].Value = model.Reserve3;
|
||||
parameters[6].Value = model.Reserve4;
|
||||
parameters[7].Value = model.Reserve5;
|
||||
|
||||
int rows=DbHelperMySQL.ExecuteSql(strSql.ToString(),parameters);
|
||||
if (rows > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新一条数据
|
||||
/// </summary>
|
||||
public bool Update(DataService.Model.policy_device model)
|
||||
{
|
||||
StringBuilder strSql=new StringBuilder();
|
||||
strSql.Append("update policy_device set ");
|
||||
strSql.Append("PolicyName=@PolicyName,");
|
||||
strSql.Append("PolicyDevice=@PolicyDevice,");
|
||||
strSql.Append("Reserve1=@Reserve1,");
|
||||
strSql.Append("Reserve2=@Reserve2,");
|
||||
strSql.Append("Reserve3=@Reserve3,");
|
||||
strSql.Append("Reserve4=@Reserve4,");
|
||||
strSql.Append("Reserve5=@Reserve5");
|
||||
strSql.Append(" where PolicyId=@PolicyId ");
|
||||
MySqlParameter[] parameters = {
|
||||
new MySqlParameter("@PolicyName", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@PolicyDevice", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@Reserve1", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@Reserve2", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@Reserve3", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@Reserve4", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@Reserve5", MySqlDbType.VarChar,255),
|
||||
new MySqlParameter("@PolicyId", MySqlDbType.VarChar,255)};
|
||||
parameters[0].Value = model.PolicyName;
|
||||
parameters[1].Value = model.PolicyDevice;
|
||||
parameters[2].Value = model.Reserve1;
|
||||
parameters[3].Value = model.Reserve2;
|
||||
parameters[4].Value = model.Reserve3;
|
||||
parameters[5].Value = model.Reserve4;
|
||||
parameters[6].Value = model.Reserve5;
|
||||
parameters[7].Value = model.PolicyId;
|
||||
|
||||
int rows=DbHelperMySQL.ExecuteSql(strSql.ToString(),parameters);
|
||||
if (rows > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除一条数据
|
||||
/// </summary>
|
||||
public bool Delete(string PolicyId)
|
||||
{
|
||||
|
||||
StringBuilder strSql=new StringBuilder();
|
||||
strSql.Append("delete from policy_device ");
|
||||
strSql.Append(" where PolicyId=@PolicyId ");
|
||||
MySqlParameter[] parameters = {
|
||||
new MySqlParameter("@PolicyId", MySqlDbType.VarChar,255) };
|
||||
parameters[0].Value = PolicyId;
|
||||
|
||||
int rows=DbHelperMySQL.ExecuteSql(strSql.ToString(),parameters);
|
||||
if (rows > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 批量删除数据
|
||||
/// </summary>
|
||||
public bool DeleteList(string PolicyIdlist )
|
||||
{
|
||||
StringBuilder strSql=new StringBuilder();
|
||||
strSql.Append("delete from policy_device ");
|
||||
strSql.Append(" where PolicyId in ("+PolicyIdlist + ") ");
|
||||
int rows=DbHelperMySQL.ExecuteSql(strSql.ToString());
|
||||
if (rows > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个对象实体
|
||||
/// </summary>
|
||||
public DataService.Model.policy_device GetModel(string PolicyId)
|
||||
{
|
||||
|
||||
StringBuilder strSql=new StringBuilder();
|
||||
strSql.Append("select PolicyId,PolicyName,PolicyDevice,Reserve1,Reserve2,Reserve3,Reserve4,Reserve5 from policy_device ");
|
||||
strSql.Append(" where PolicyId=@PolicyId ");
|
||||
MySqlParameter[] parameters = {
|
||||
new MySqlParameter("@PolicyId", MySqlDbType.VarChar,255) };
|
||||
parameters[0].Value = PolicyId;
|
||||
|
||||
DataService.Model.policy_device model=new DataService.Model.policy_device();
|
||||
DataSet ds=DbHelperMySQL.Query(strSql.ToString(),parameters);
|
||||
if(ds.Tables[0].Rows.Count>0)
|
||||
{
|
||||
return DataRowToModel(ds.Tables[0].Rows[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个对象实体
|
||||
/// </summary>
|
||||
public DataService.Model.policy_device DataRowToModel(DataRow row)
|
||||
{
|
||||
DataService.Model.policy_device model=new DataService.Model.policy_device();
|
||||
if (row != null)
|
||||
{
|
||||
if(row["PolicyId"]!=null)
|
||||
{
|
||||
model.PolicyId=row["PolicyId"].ToString();
|
||||
}
|
||||
if(row["PolicyName"]!=null)
|
||||
{
|
||||
model.PolicyName=row["PolicyName"].ToString();
|
||||
}
|
||||
if(row["PolicyDevice"]!=null)
|
||||
{
|
||||
model.PolicyDevice=row["PolicyDevice"].ToString();
|
||||
}
|
||||
if(row["Reserve1"]!=null)
|
||||
{
|
||||
model.Reserve1=row["Reserve1"].ToString();
|
||||
}
|
||||
if(row["Reserve2"]!=null)
|
||||
{
|
||||
model.Reserve2=row["Reserve2"].ToString();
|
||||
}
|
||||
if(row["Reserve3"]!=null)
|
||||
{
|
||||
model.Reserve3=row["Reserve3"].ToString();
|
||||
}
|
||||
if(row["Reserve4"]!=null)
|
||||
{
|
||||
model.Reserve4=row["Reserve4"].ToString();
|
||||
}
|
||||
if(row["Reserve5"]!=null)
|
||||
{
|
||||
model.Reserve5=row["Reserve5"].ToString();
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获得数据列表
|
||||
/// </summary>
|
||||
public DataSet GetList(string strWhere)
|
||||
{
|
||||
StringBuilder strSql=new StringBuilder();
|
||||
strSql.Append("select PolicyId,PolicyName,PolicyDevice,Reserve1,Reserve2,Reserve3,Reserve4,Reserve5 ");
|
||||
strSql.Append(" FROM policy_device ");
|
||||
if(strWhere.Trim()!="")
|
||||
{
|
||||
strSql.Append(" where "+strWhere);
|
||||
}
|
||||
return DbHelperMySQL.Query(strSql.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取记录总数
|
||||
/// </summary>
|
||||
public int GetRecordCount(string strWhere)
|
||||
{
|
||||
StringBuilder strSql=new StringBuilder();
|
||||
strSql.Append("select count(1) FROM policy_device ");
|
||||
if(strWhere.Trim()!="")
|
||||
{
|
||||
strSql.Append(" where "+strWhere);
|
||||
}
|
||||
object obj = DbHelperSQL.GetSingle(strSql.ToString());
|
||||
if (obj == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Convert.ToInt32(obj);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 分页获取数据列表
|
||||
/// </summary>
|
||||
public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
|
||||
{
|
||||
StringBuilder strSql=new StringBuilder();
|
||||
strSql.Append("SELECT * FROM ( ");
|
||||
strSql.Append(" SELECT ROW_NUMBER() OVER (");
|
||||
if (!string.IsNullOrEmpty(orderby.Trim()))
|
||||
{
|
||||
strSql.Append("order by T." + orderby );
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql.Append("order by T.PolicyId desc");
|
||||
}
|
||||
strSql.Append(")AS Row, T.* from policy_device T ");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.Append(" WHERE " + strWhere);
|
||||
}
|
||||
strSql.Append(" ) TT");
|
||||
strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
|
||||
return DbHelperMySQL.Query(strSql.ToString());
|
||||
}
|
||||
|
||||
/*
|
||||
/// <summary>
|
||||
/// 分页获取数据列表
|
||||
/// </summary>
|
||||
public DataSet GetList(int PageSize,int PageIndex,string strWhere)
|
||||
{
|
||||
MySqlParameter[] parameters = {
|
||||
new MySqlParameter("@tblName", MySqlDbType.VarChar, 255),
|
||||
new MySqlParameter("@fldName", MySqlDbType.VarChar, 255),
|
||||
new MySqlParameter("@PageSize", MySqlDbType.Int32),
|
||||
new MySqlParameter("@PageIndex", MySqlDbType.Int32),
|
||||
new MySqlParameter("@IsReCount", MySqlDbType.Bit),
|
||||
new MySqlParameter("@OrderType", MySqlDbType.Bit),
|
||||
new MySqlParameter("@strWhere", MySqlDbType.VarChar,1000),
|
||||
};
|
||||
parameters[0].Value = "policy_device";
|
||||
parameters[1].Value = "PolicyId";
|
||||
parameters[2].Value = PageSize;
|
||||
parameters[3].Value = PageIndex;
|
||||
parameters[4].Value = 0;
|
||||
parameters[5].Value = 0;
|
||||
parameters[6].Value = strWhere;
|
||||
return DbHelperMySQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
|
||||
}*/
|
||||
|
||||
#endregion BasicMethod
|
||||
#region ExtensionMethod
|
||||
|
||||
#endregion ExtensionMethod
|
||||
}
|
||||
}
|
||||
|
|
@ -89,6 +89,7 @@
|
|||
<Compile Include="api\get_real_load.cs" />
|
||||
<Compile Include="api\get_single_control.cs" />
|
||||
<Compile Include="api\get_single_switch.cs" />
|
||||
<Compile Include="api\get_strategy_compilation.cs" />
|
||||
<Compile Include="api\get_system_energy.cs" />
|
||||
<Compile Include="api\get_system_purge.cs" />
|
||||
<Compile Include="api\get_system_ranking.cs" />
|
||||
|
@ -102,6 +103,7 @@
|
|||
<Compile Include="BLL\lighting_info.cs" />
|
||||
<Compile Include="BLL\meteorological_station.cs" />
|
||||
<Compile Include="BLL\multi_rate.cs" />
|
||||
<Compile Include="BLL\policy_device.cs" />
|
||||
<Compile Include="BLL\pollution_discharge.cs" />
|
||||
<Compile Include="BLL\unit_list.cs" />
|
||||
<Compile Include="DAL\boot_strategy.cs" />
|
||||
|
@ -111,6 +113,7 @@
|
|||
<Compile Include="DAL\lighting_info.cs" />
|
||||
<Compile Include="DAL\meteorological_station.cs" />
|
||||
<Compile Include="DAL\multi_rate.cs" />
|
||||
<Compile Include="DAL\policy_device.cs" />
|
||||
<Compile Include="DAL\pollution_discharge.cs" />
|
||||
<Compile Include="DAL\unit_list.cs" />
|
||||
<Compile Include="Model\boot_strategy.cs" />
|
||||
|
@ -120,6 +123,7 @@
|
|||
<Compile Include="Model\lighting_info.cs" />
|
||||
<Compile Include="Model\meteorological_station.cs" />
|
||||
<Compile Include="Model\multi_rate.cs" />
|
||||
<Compile Include="Model\policy_device.cs" />
|
||||
<Compile Include="Model\pollution_discharge.cs" />
|
||||
<Compile Include="Model\unit_list.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
|
|
@ -0,0 +1,105 @@
|
|||
/** 版本信息模板在安装目录下,可自行修改。
|
||||
* policy_device.cs
|
||||
*
|
||||
* 功 能: N/A
|
||||
* 类 名: policy_device
|
||||
*
|
||||
* Ver 变更日期 负责人 变更内容
|
||||
* ───────────────────────────────────
|
||||
* V0.01 2024/3/20 9:39:56 N/A 初版
|
||||
*
|
||||
* Copyright (c) 2012 Maticsoft Corporation. All rights reserved.
|
||||
*┌──────────────────────────────────┐
|
||||
*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │
|
||||
*│ 版权所有:动软卓越(北京)科技有限公司 │
|
||||
*└──────────────────────────────────┘
|
||||
*/
|
||||
using System;
|
||||
namespace DataService.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// policy_device:实体类(属性说明自动提取数据库字段的描述信息)
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public partial class policy_device
|
||||
{
|
||||
public policy_device()
|
||||
{}
|
||||
#region Model
|
||||
private string _policyid;
|
||||
private string _policyname;
|
||||
private string _policydevice;
|
||||
private string _reserve1;
|
||||
private string _reserve2;
|
||||
private string _reserve3;
|
||||
private string _reserve4;
|
||||
private string _reserve5;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PolicyId
|
||||
{
|
||||
set{ _policyid=value;}
|
||||
get{return _policyid;}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PolicyName
|
||||
{
|
||||
set{ _policyname=value;}
|
||||
get{return _policyname;}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PolicyDevice
|
||||
{
|
||||
set{ _policydevice=value;}
|
||||
get{return _policydevice;}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Reserve1
|
||||
{
|
||||
set{ _reserve1=value;}
|
||||
get{return _reserve1;}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Reserve2
|
||||
{
|
||||
set{ _reserve2=value;}
|
||||
get{return _reserve2;}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Reserve3
|
||||
{
|
||||
set{ _reserve3=value;}
|
||||
get{return _reserve3;}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Reserve4
|
||||
{
|
||||
set{ _reserve4=value;}
|
||||
get{return _reserve4;}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Reserve5
|
||||
{
|
||||
set{ _reserve5=value;}
|
||||
get{return _reserve5;}
|
||||
}
|
||||
#endregion Model
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@ namespace DataService.api
|
|||
}
|
||||
public class single_controlData
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string State { get; set; }
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataService.api
|
||||
{
|
||||
public class get_strategy_compilation
|
||||
{
|
||||
public int code { get; set; }
|
||||
public string msg { get; set; }
|
||||
public List<strategy_compilationData> data { get; set; }
|
||||
}
|
||||
public class strategy_compilationData
|
||||
{
|
||||
public List<string> PlantName { get; set; }
|
||||
public List<string> UnitName { get; set; }
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
b71e33957bcf55aa762eabbacd9ebc7eeb582c01
|
||||
cf2cf77474c777e9f1588d28fda551996731fde6
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -61,7 +61,11 @@ namespace LonglslandExhibitionCenter.Controllers.api
|
|||
EH = item.EH,
|
||||
Ranking = "TOP" + count
|
||||
};
|
||||
bdata.Add(model);
|
||||
if (count < 6)
|
||||
{
|
||||
bdata.Add(model);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
res.code = 200;
|
||||
|
|
|
@ -33,7 +33,14 @@ namespace LonglslandExhibitionCenter.Controllers.api
|
|||
modellist.StrategyId = blist.StrategyId;
|
||||
modellist.StrategyName = name;
|
||||
modellist.StrategyState= blist.StrategyState;
|
||||
modellist.Reserve1 = value;
|
||||
if (value == null)
|
||||
{
|
||||
modellist.Reserve1 = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
modellist.Reserve1 = value;
|
||||
}
|
||||
bll.Update(modellist);
|
||||
var list= bll.GetModelList(" StrategyName='" + name + "'").FirstOrDefault();
|
||||
var alist = bll_unit.GetModelList("");
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace LonglslandExhibitionCenter.Controllers.api
|
|||
{
|
||||
var model = new single_controlData()
|
||||
{
|
||||
Id=item.LightingId,
|
||||
name = item.LightingName,
|
||||
State = item.LightingState
|
||||
};
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
using DataService.api;
|
||||
using Microsoft.Ajax.Utilities;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace LonglslandExhibitionCenter.Controllers.api
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取开机设备
|
||||
/// </summary>
|
||||
public class GetStrategyCompilationController : ApiController
|
||||
{
|
||||
DataService.BLL.boot_strategy bll = new DataService.BLL.boot_strategy();
|
||||
DataService.BLL.policy_device bll_policy = new DataService.BLL.policy_device();
|
||||
// GET api/<controller>
|
||||
public HttpResponseMessage Get(string name = "")
|
||||
{
|
||||
var res = new get_strategy_compilation();
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
var data = new List<strategy_compilationData>();
|
||||
var list = bll.GetModelList("");
|
||||
var list2 = bll_policy.GetModelList("");
|
||||
var alist = list.Where(x => x.StrategyName == name).FirstOrDefault();
|
||||
var slist1 = alist.Reserve1;
|
||||
string[] strArray = slist1.Split(',');
|
||||
List<string> blist = new List<string>(strArray);
|
||||
foreach (var item in strArray)
|
||||
{
|
||||
blist.Add(item.Trim());
|
||||
}
|
||||
var plist = new List<string>();
|
||||
foreach (var item in list2)
|
||||
{
|
||||
plist.Add(item.PolicyName);
|
||||
}
|
||||
var model = new strategy_compilationData();
|
||||
model.UnitName = blist;
|
||||
model.PlantName = plist;
|
||||
data.Add(model);
|
||||
res.code = 200;
|
||||
res.msg = "成功";
|
||||
res.data = data;
|
||||
}
|
||||
else
|
||||
{
|
||||
res.code = 201;
|
||||
res.msg = "参数不能为空";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
res.code = 500;
|
||||
res.msg = ex.Message;
|
||||
}
|
||||
HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(JsonConvert.SerializeObject(res), Encoding.GetEncoding("UTF-8"), "application/json") };
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -186,6 +186,7 @@
|
|||
<Compile Include="Controllers\api\GetFailureWarningController.cs" />
|
||||
<Compile Include="Controllers\api\GetFaultConditionController.cs" />
|
||||
<Compile Include="Controllers\api\GetPolicyEditingController.cs" />
|
||||
<Compile Include="Controllers\api\GetStrategyCompilationController.cs" />
|
||||
<Compile Include="Controllers\api\SetFullSwitchController.cs" />
|
||||
<Compile Include="Controllers\api\GetGeneralSituationController.cs" />
|
||||
<Compile Include="Controllers\api\GetLightingControlController.cs" />
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<NameOfLastUsedPublishProfile>E:\林谷项目\长岛展览馆项目\后端\LonglslandExhibitionCenter\LonglslandExhibitionCenter\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
|
||||
</PropertyGroup>
|
||||
<ProjectExtensions>
|
||||
|
|
|
@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<_PublishTargetUrl>E:\林谷项目\长岛展览馆项目\发布文件</_PublishTargetUrl>
|
||||
<History>True|2024-03-07T08:29:08.9381292Z;True|2024-03-05T14:31:05.6269677+08:00;True|2024-03-04T14:37:08.7040845+08:00;True|2024-02-28T11:11:35.8506164+08:00;</History>
|
||||
<History>True|2024-03-20T01:52:41.5444999Z;True|2024-03-20T09:52:28.9463180+08:00;True|2024-03-19T16:26:27.2407972+08:00;True|2024-03-19T15:50:07.1464827+08:00;True|2024-03-14T15:48:46.0852411+08:00;True|2024-03-12T11:15:35.2934238+08:00;True|2024-03-07T16:29:08.9381292+08:00;True|2024-03-05T14:31:05.6269677+08:00;True|2024-03-04T14:37:08.7040845+08:00;True|2024-02-28T11:11:35.8506164+08:00;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
@ -79,19 +79,19 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
<publishTime>09/10/2013 16:29:20</publishTime>
|
||||
</File>
|
||||
<File Include="bin/DataService.dll">
|
||||
<publishTime>03/04/2024 10:39:01</publishTime>
|
||||
<publishTime>03/20/2024 10:07:16</publishTime>
|
||||
</File>
|
||||
<File Include="bin/DataService.pdb">
|
||||
<publishTime>03/04/2024 10:39:01</publishTime>
|
||||
<publishTime>03/20/2024 10:07:16</publishTime>
|
||||
</File>
|
||||
<File Include="bin/log4net.dll">
|
||||
<publishTime>12/13/2023 14:16:07</publishTime>
|
||||
</File>
|
||||
<File Include="bin/LonglslandExhibitionCenter.dll">
|
||||
<publishTime>03/07/2024 16:29:08</publishTime>
|
||||
<publishTime>03/20/2024 10:14:04</publishTime>
|
||||
</File>
|
||||
<File Include="bin/LonglslandExhibitionCenter.pdb">
|
||||
<publishTime>03/07/2024 16:29:08</publishTime>
|
||||
<publishTime>03/20/2024 10:14:04</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Maticsoft.Common.dll">
|
||||
<publishTime>12/13/2023 14:16:06</publishTime>
|
||||
|
@ -430,7 +430,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
<publishTime>03/05/2024 14:17:15</publishTime>
|
||||
</File>
|
||||
<File Include="Controllers/api/GetLoopRankingController.cs">
|
||||
<publishTime>03/04/2024 14:14:25</publishTime>
|
||||
<publishTime>03/14/2024 15:48:22</publishTime>
|
||||
</File>
|
||||
<File Include="Controllers/api/GetMaintenanceReminderController.cs">
|
||||
<publishTime>02/28/2024 10:45:48</publishTime>
|
||||
|
@ -448,7 +448,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
<publishTime>03/05/2024 14:24:07</publishTime>
|
||||
</File>
|
||||
<File Include="Controllers/api/GetPolicyEditingController.cs">
|
||||
<publishTime>03/04/2024 11:29:09</publishTime>
|
||||
<publishTime>03/12/2024 10:33:53</publishTime>
|
||||
</File>
|
||||
<File Include="Controllers/api/GetRealLoadController.cs">
|
||||
<publishTime>02/05/2024 13:40:46</publishTime>
|
||||
|
@ -457,7 +457,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
<publishTime>02/28/2024 10:41:48</publishTime>
|
||||
</File>
|
||||
<File Include="Controllers/api/GetSingleControlController.cs">
|
||||
<publishTime>02/23/2024 16:36:55</publishTime>
|
||||
<publishTime>03/12/2024 11:14:36</publishTime>
|
||||
</File>
|
||||
<File Include="Controllers/api/GetStrategyCompilationController.cs">
|
||||
<publishTime>03/20/2024 10:11:48</publishTime>
|
||||
</File>
|
||||
<File Include="Controllers/api/GetSystemEnergyController.cs">
|
||||
<publishTime>03/05/2024 14:24:04</publishTime>
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
c7a2e736946fd38475aa805ed8a0929fcf1ad549
|
||||
65458ecc580a2202fc70a873c976f472e79ecacb
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
5e09c650feb6b30b4cef77487d691557cc5a57b4
|
||||
c1b222264fd394fa20624931d7820c15476d6379
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -14,7 +14,7 @@
|
|||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||
</dsig:Transforms>
|
||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||
<dsig:DigestValue>twzBcuNTw8doKi+yt8Dcftn3tpRPyy8wXHPGyymirdU=</dsig:DigestValue>
|
||||
<dsig:DigestValue>ysT40iU2igpjZx6kj9cCT/Lt6BsLUnPOcZvNsro9iuE=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
@ -42,14 +42,14 @@
|
|||
</dependentAssembly>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="DataService.dll" size="117248">
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="DataService.dll" size="123904">
|
||||
<assemblyIdentity name="DataService" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
|
||||
<hash>
|
||||
<dsig:Transforms>
|
||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||
</dsig:Transforms>
|
||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||
<dsig:DigestValue>/0gk9TivMCAYEfdiZbuFKZwfpgn1r6q9t3fB0uGtgy0=</dsig:DigestValue>
|
||||
<dsig:DigestValue>lQLMjFJzajZHSOUSCvVbfOucJWf30Tx0kbX6cpFzI6I=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
Binary file not shown.
|
@ -14,7 +14,7 @@
|
|||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||
</dsig:Transforms>
|
||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||
<dsig:DigestValue>twzBcuNTw8doKi+yt8Dcftn3tpRPyy8wXHPGyymirdU=</dsig:DigestValue>
|
||||
<dsig:DigestValue>ysT40iU2igpjZx6kj9cCT/Lt6BsLUnPOcZvNsro9iuE=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
@ -42,14 +42,14 @@
|
|||
</dependentAssembly>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="DataService.dll" size="117248">
|
||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="DataService.dll" size="123904">
|
||||
<assemblyIdentity name="DataService" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
|
||||
<hash>
|
||||
<dsig:Transforms>
|
||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||
</dsig:Transforms>
|
||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||
<dsig:DigestValue>/0gk9TivMCAYEfdiZbuFKZwfpgn1r6q9t3fB0uGtgy0=</dsig:DigestValue>
|
||||
<dsig:DigestValue>lQLMjFJzajZHSOUSCvVbfOucJWf30Tx0kbX6cpFzI6I=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
Loading…
Reference in New Issue