修改概况的接口、新增设备运行状态接口、获取空调数据接口
This commit is contained in:
parent
3b9eb8f633
commit
301f8bcdf1
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.
|
@ -51,6 +51,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="api\export_carbon_trendData.cs" />
|
||||
<Compile Include="api\get_aircondition.cs" />
|
||||
<Compile Include="api\get_airconditioning_load.cs" />
|
||||
<Compile Include="api\get_big_screen.cs" />
|
||||
<Compile Include="api\get_boot_strategy.cs" />
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataService.api
|
||||
{
|
||||
public class get_aircondition
|
||||
{
|
||||
public int code { get; set; }
|
||||
public string msg { get; set; }
|
||||
public List<aircondition_data> data { get; set; }
|
||||
}
|
||||
|
||||
public class aircondition_data
|
||||
{
|
||||
public string UnitName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机组设定模式 1=制热模式,2=制冷模式
|
||||
/// </summary>
|
||||
public int UnitMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机组累计运行时间 单位:小时
|
||||
/// </summary>
|
||||
public string OperatingTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统出水温度 单位:℃
|
||||
/// </summary>
|
||||
public string OutTemperature { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 系统回水温度 单位:℃
|
||||
/// </summary>
|
||||
public string ReturnTemperature { get; set; }
|
||||
}
|
||||
}
|
|
@ -15,6 +15,6 @@ namespace DataService.api
|
|||
public class maintenance_reminderData
|
||||
{
|
||||
public string DeviceName { get; set; }
|
||||
public int OverDue { get; set; }
|
||||
public int Status { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
286deb3289b3eb7591e1ddc005111f370b30c3f0
|
||||
4b05a6d94d12df35361561ab0d2b7a78865ca502
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
5388fa28f712e2fbeafc21c7f14644c5c539a691
|
||||
9b2a89855493356785272983b4e0b1309a3ab529
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,68 @@
|
|||
using DataService.api;
|
||||
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 GetAirconditionController : ApiController
|
||||
{
|
||||
DataService.BLL.unit_list bll = new DataService.BLL.unit_list();
|
||||
|
||||
public HttpResponseMessage Get()
|
||||
{
|
||||
var res = new get_aircondition();
|
||||
try
|
||||
{
|
||||
var data = new List<aircondition_data>();
|
||||
var list = bll.GetModelList(" Type='机组' order by UnitName asc ");
|
||||
var device_list = list.GroupBy(a => a.UnitName).ToList();
|
||||
foreach (var item in device_list)
|
||||
{
|
||||
var model = new aircondition_data();
|
||||
model.UnitName = item.Key;
|
||||
var attr_model1 = list.Where(a => a.UnitName == item.Key && a.DeviceName == "机组设定模式").FirstOrDefault();
|
||||
if (attr_model1 != null)
|
||||
{
|
||||
model.UnitMode = (int)decimal.Parse(attr_model1.Status);
|
||||
}
|
||||
var attr_model2 = list.Where(a => a.UnitName == item.Key && a.DeviceName == "机组累计运行时间").FirstOrDefault();
|
||||
if (attr_model2 != null)
|
||||
{
|
||||
model.OperatingTime = attr_model2.Status;
|
||||
}
|
||||
var attr_model3 = list.Where(a => a.UnitName == item.Key && a.DeviceName == "系统出水温度").FirstOrDefault();
|
||||
if (attr_model3 != null)
|
||||
{
|
||||
model.OutTemperature = attr_model3.Status;
|
||||
|
||||
}
|
||||
var attr_model4 = list.Where(a => a.UnitName == item.Key && a.DeviceName == "系统回水温度").FirstOrDefault();
|
||||
if (attr_model4 != null)
|
||||
{
|
||||
model.ReturnTemperature = attr_model4.Status;
|
||||
}
|
||||
data.Add(model);
|
||||
}
|
||||
res.code = 200;
|
||||
res.msg = "成功";
|
||||
res.data = data;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,12 +23,22 @@ namespace LonglslandExhibitionCenter.Controllers.api
|
|||
try
|
||||
{
|
||||
var data = new List<general_situationData>();
|
||||
var list = bll.GetModelList("");
|
||||
var list = bll.GetModelList(" Type='机组' ");
|
||||
var total = list.GroupBy(a => a.UnitName).Count();
|
||||
var power_list = list.Where(a => a.DeviceName == "开机命令").ToList();
|
||||
var index = 0;
|
||||
foreach (var item in power_list)
|
||||
{
|
||||
var status = (int)decimal.Parse(item.Status);
|
||||
if (status == 1)
|
||||
{
|
||||
index++;
|
||||
}
|
||||
}
|
||||
var model = new general_situationData()
|
||||
{
|
||||
Operation = total,
|
||||
Stop = 0,
|
||||
Operation = index,
|
||||
Stop = total - index,
|
||||
Area = Convert.ToDecimal(2.601),
|
||||
Amount = total
|
||||
};
|
||||
|
|
|
@ -12,54 +12,29 @@ using System.Web.Http;
|
|||
namespace LonglslandExhibitionCenter.Controllers.api
|
||||
{
|
||||
/// <summary>
|
||||
/// 空调-维护提醒
|
||||
/// 空调-设备运行状态
|
||||
/// </summary>
|
||||
public class GetMaintenanceReminderController : ApiController
|
||||
{
|
||||
public HttpResponseMessage Get(string name="")
|
||||
DataService.BLL.unit_list bll = new DataService.BLL.unit_list();
|
||||
|
||||
public HttpResponseMessage Get()
|
||||
{
|
||||
var res = new get_maintenance_reminder();
|
||||
try
|
||||
{
|
||||
var data = new List<maintenance_reminderData>();
|
||||
var now = DateTime.Now;
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
var list = bll.GetModelList(" DeviceName='开机命令' or Type='循环泵' order by UnitName asc ");
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (name == "已超期")
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
var model = new maintenance_reminderData()
|
||||
{
|
||||
DeviceName = i+1+"号主机",
|
||||
OverDue = 1
|
||||
};
|
||||
data.Add(model);
|
||||
}
|
||||
|
||||
}
|
||||
if (name == "即将开始")
|
||||
{
|
||||
for (int i = 0;i<10; i++)
|
||||
{
|
||||
var model = new maintenance_reminderData()
|
||||
{
|
||||
DeviceName = i+1+"号主机",
|
||||
OverDue = 1
|
||||
};
|
||||
data.Add(model);
|
||||
}
|
||||
|
||||
}
|
||||
res.code = 200;
|
||||
res.msg = "成功";
|
||||
res.data = data;
|
||||
}
|
||||
else
|
||||
{
|
||||
res.code = 201;
|
||||
res.msg = "参数不能为空";
|
||||
var model = new maintenance_reminderData();
|
||||
model.DeviceName = item.UnitName;
|
||||
model.Status = (int)decimal.Parse(item.Status);
|
||||
data.Add(model);
|
||||
}
|
||||
res.code = 200;
|
||||
res.msg = "成功";
|
||||
res.data = data;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
@ -71,7 +71,6 @@ namespace LonglslandExhibitionCenter.Controllers.api
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
res.code = 500;
|
||||
res.msg = ex.Message;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,9 @@ using System.Web.Http;
|
|||
|
||||
namespace LonglslandExhibitionCenter.Controllers.api
|
||||
{
|
||||
/// <summary>
|
||||
/// 空调-策略控制开关接口
|
||||
/// </summary>
|
||||
public class SetAirconditionController : ApiController
|
||||
{
|
||||
DataService.BLL.unit_list unit_bll = new DataService.BLL.unit_list();
|
||||
|
|
|
@ -11,6 +11,9 @@ using System.Web.Http;
|
|||
|
||||
namespace LonglslandExhibitionCenter.Controllers.api
|
||||
{
|
||||
/// <summary>
|
||||
/// 显示屏-控制大屏全开全关接口
|
||||
/// </summary>
|
||||
public class SetScreenStateController : ApiController
|
||||
{
|
||||
DataService.BLL.viewing_screen bll = new DataService.BLL.viewing_screen();
|
||||
|
|
|
@ -234,6 +234,7 @@
|
|||
<Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" />
|
||||
<Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
|
||||
<Compile Include="Controllers\api\ExportCarbonTrendController.cs" />
|
||||
<Compile Include="Controllers\api\GetAirconditionController.cs" />
|
||||
<Compile Include="Controllers\api\GetAirconditioningLoadController.cs" />
|
||||
<Compile Include="Controllers\api\GetBigScreenController.cs" />
|
||||
<Compile Include="Controllers\api\GetBootStrategyController.cs" />
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<NameOfLastUsedPublishProfile>F:\项目\长岛展览馆\项目\LonglslandExhibitionCenter\LonglslandExhibitionCenter\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
|
||||
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
|
||||
<Controller_SelectedScaffolderCategoryPath>root/Common/Web API</Controller_SelectedScaffolderCategoryPath>
|
||||
|
|
|
@ -82,10 +82,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
<publishTime>05/08/2024 00:05:28</publishTime>
|
||||
</File>
|
||||
<File Include="bin/DataService.dll">
|
||||
<publishTime>09/24/2024 15:22:42</publishTime>
|
||||
<publishTime>09/27/2024 15:24:04</publishTime>
|
||||
</File>
|
||||
<File Include="bin/DataService.pdb">
|
||||
<publishTime>09/24/2024 15:22:42</publishTime>
|
||||
<publishTime>09/27/2024 15:24:04</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Enums.NET.dll">
|
||||
<publishTime>11/19/2022 06:40:50</publishTime>
|
||||
|
@ -106,10 +106,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
<publishTime>08/13/2024 17:44:43</publishTime>
|
||||
</File>
|
||||
<File Include="bin/LonglslandExhibitionCenter.dll">
|
||||
<publishTime>09/24/2024 15:22:43</publishTime>
|
||||
<publishTime>09/27/2024 15:24:05</publishTime>
|
||||
</File>
|
||||
<File Include="bin/LonglslandExhibitionCenter.pdb">
|
||||
<publishTime>09/24/2024 15:22:43</publishTime>
|
||||
<publishTime>09/27/2024 15:24:05</publishTime>
|
||||
</File>
|
||||
<File Include="bin/MathNet.Numerics.dll">
|
||||
<publishTime>04/03/2022 22:02:06</publishTime>
|
||||
|
@ -379,7 +379,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
<publishTime>08/13/2024 17:44:44</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Upload/长岛海洋生态文明展览馆碳排放统计报表.docx">
|
||||
<publishTime>08/27/2024 17:56:50</publishTime>
|
||||
<publishTime>09/25/2024 14:05:17</publishTime>
|
||||
</File>
|
||||
<File Include="bin/WebGrease.dll">
|
||||
<publishTime>08/13/2024 17:44:45</publishTime>
|
||||
|
@ -631,7 +631,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
<publishTime>08/13/2024 17:44:43</publishTime>
|
||||
</File>
|
||||
<File Include="Upload/长岛海洋生态文明展览馆碳排放统计报表.docx">
|
||||
<publishTime>08/27/2024 17:56:50</publishTime>
|
||||
<publishTime>09/25/2024 14:05:17</publishTime>
|
||||
</File>
|
||||
<File Include="Util/MqttClientService.cs">
|
||||
<publishTime>02/23/2024 18:15:19</publishTime>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
长岛海洋生态文明展览馆
|
||||
碳排放统计报表
|
||||
2021年,烟台市提出打造`长岛国际零碳岛',组织专家团队进行了科学研究,规划成果在2023年联合国气候变化迪拜大会发布,目标是到2035年长岛全域实现净零排放。"
|
||||
year-month,长岛海洋生态文明展览馆用电量为electricity千瓦时,二氧化碳排放量为carbon吨。
|
||||
year-month,长岛海洋生态文明展览馆用电量为electricity千瓦时,二氧化碳排放量为carbon万吨。
|
||||
月份
|
||||
用电量(kWh)
|
||||
碳排放量(tCO2)
|
||||
碳排放量(万tCO2)
|
||||
备注
|
||||
1月
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,10 +1,10 @@
|
|||
长岛海洋生态文明展览馆
|
||||
碳排放统计报表
|
||||
2021年,烟台市提出打造`长岛国际零碳岛',组织专家团队进行了科学研究,规划成果在2023年联合国气候变化迪拜大会发布,目标是到2035年长岛全域实现净零排放。"
|
||||
year-month,长岛海洋生态文明展览馆用电量为electricity千瓦时,二氧化碳排放量为carbon吨。
|
||||
year-month,长岛海洋生态文明展览馆用电量为electricity千瓦时,二氧化碳排放量为carbon万吨。
|
||||
月份
|
||||
用电量(kWh)
|
||||
碳排放量(tCO2)
|
||||
碳排放量(万tCO2)
|
||||
备注
|
||||
1月
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
694063c687b50a6323e8f1095134d7b46e41465b
|
||||
ddd0bc2fdf9b9c94f86bfebdfc81b81b8a84af99
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
8de8f8e4bd6e51dcab02983f89d0877a0e68851f
|
||||
d9f2f0651070f4225fe43415422937cea96eecbb
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,10 +1,10 @@
|
|||
长岛海洋生态文明展览馆
|
||||
碳排放统计报表
|
||||
2021年,烟台市提出打造`长岛国际零碳岛',组织专家团队进行了科学研究,规划成果在2023年联合国气候变化迪拜大会发布,目标是到2035年长岛全域实现净零排放。"
|
||||
year-month,长岛海洋生态文明展览馆用电量为electricity千瓦时,二氧化碳排放量为carbon吨。
|
||||
year-month,长岛海洋生态文明展览馆用电量为electricity千瓦时,二氧化碳排放量为carbon万吨。
|
||||
月份
|
||||
用电量(kWh)
|
||||
碳排放量(tCO2)
|
||||
碳排放量(万tCO2)
|
||||
备注
|
||||
1月
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,10 +1,10 @@
|
|||
长岛海洋生态文明展览馆
|
||||
碳排放统计报表
|
||||
2021年,烟台市提出打造`长岛国际零碳岛',组织专家团队进行了科学研究,规划成果在2023年联合国气候变化迪拜大会发布,目标是到2035年长岛全域实现净零排放。"
|
||||
year-month,长岛海洋生态文明展览馆用电量为electricity千瓦时,二氧化碳排放量为carbon吨。
|
||||
year-month,长岛海洋生态文明展览馆用电量为electricity千瓦时,二氧化碳排放量为carbon万吨。
|
||||
月份
|
||||
用电量(kWh)
|
||||
碳排放量(tCO2)
|
||||
碳排放量(万tCO2)
|
||||
备注
|
||||
1月
|
||||
|
||||
|
|
Loading…
Reference in New Issue