修改概况的接口、新增设备运行状态接口、获取空调数据接口

This commit is contained in:
曾艳 2024-09-27 16:44:21 +08:00
parent 3b9eb8f633
commit 301f8bcdf1
52 changed files with 154 additions and 54 deletions

View File

@ -51,6 +51,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="api\export_carbon_trendData.cs" /> <Compile Include="api\export_carbon_trendData.cs" />
<Compile Include="api\get_aircondition.cs" />
<Compile Include="api\get_airconditioning_load.cs" /> <Compile Include="api\get_airconditioning_load.cs" />
<Compile Include="api\get_big_screen.cs" /> <Compile Include="api\get_big_screen.cs" />
<Compile Include="api\get_boot_strategy.cs" /> <Compile Include="api\get_boot_strategy.cs" />

View File

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

View File

@ -15,6 +15,6 @@ namespace DataService.api
public class maintenance_reminderData public class maintenance_reminderData
{ {
public string DeviceName { get; set; } public string DeviceName { get; set; }
public int OverDue { get; set; } public int Status { get; set; }
} }
} }

View File

@ -1 +1 @@
286deb3289b3eb7591e1ddc005111f370b30c3f0 4b05a6d94d12df35361561ab0d2b7a78865ca502

View File

@ -1 +1 @@
5388fa28f712e2fbeafc21c7f14644c5c539a691 9b2a89855493356785272983b4e0b1309a3ab529

View File

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

View File

@ -23,12 +23,22 @@ namespace LonglslandExhibitionCenter.Controllers.api
try try
{ {
var data = new List<general_situationData>(); var data = new List<general_situationData>();
var list = bll.GetModelList(""); var list = bll.GetModelList(" Type='机组' ");
var total = list.GroupBy(a => a.UnitName).Count(); 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() var model = new general_situationData()
{ {
Operation = total, Operation = index,
Stop = 0, Stop = total - index,
Area = Convert.ToDecimal(2.601), Area = Convert.ToDecimal(2.601),
Amount = total Amount = total
}; };

View File

@ -12,55 +12,30 @@ using System.Web.Http;
namespace LonglslandExhibitionCenter.Controllers.api namespace LonglslandExhibitionCenter.Controllers.api
{ {
/// <summary> /// <summary>
/// 空调-维护提醒 /// 空调-设备运行状态
/// </summary> /// </summary>
public class GetMaintenanceReminderController : ApiController 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(); var res = new get_maintenance_reminder();
try try
{ {
var data = new List<maintenance_reminderData>(); var data = new List<maintenance_reminderData>();
var now = DateTime.Now; var list = bll.GetModelList(" DeviceName='开机命令' or Type='循环泵' order by UnitName asc ");
if (!string.IsNullOrEmpty(name)) foreach (var item in list)
{ {
if (name == "已超期") var model = new maintenance_reminderData();
{ model.DeviceName = item.UnitName;
for (int i = 0; i < 10; i++) model.Status = (int)decimal.Parse(item.Status);
{
var model = new maintenance_reminderData()
{
DeviceName = i+1+"号主机",
OverDue = 1
};
data.Add(model); 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.code = 200;
res.msg = "成功"; res.msg = "成功";
res.data = data; res.data = data;
} }
else
{
res.code = 201;
res.msg = "参数不能为空";
}
}
catch (Exception ex) catch (Exception ex)
{ {
res.code = 500; res.code = 500;

View File

@ -71,7 +71,6 @@ namespace LonglslandExhibitionCenter.Controllers.api
} }
catch (Exception ex) catch (Exception ex)
{ {
res.code = 500; res.code = 500;
res.msg = ex.Message; res.msg = ex.Message;
} }

View File

@ -11,6 +11,9 @@ using System.Web.Http;
namespace LonglslandExhibitionCenter.Controllers.api namespace LonglslandExhibitionCenter.Controllers.api
{ {
/// <summary>
/// 空调-策略控制开关接口
/// </summary>
public class SetAirconditionController : ApiController public class SetAirconditionController : ApiController
{ {
DataService.BLL.unit_list unit_bll = new DataService.BLL.unit_list(); DataService.BLL.unit_list unit_bll = new DataService.BLL.unit_list();

View File

@ -11,6 +11,9 @@ using System.Web.Http;
namespace LonglslandExhibitionCenter.Controllers.api namespace LonglslandExhibitionCenter.Controllers.api
{ {
/// <summary>
/// 显示屏-控制大屏全开全关接口
/// </summary>
public class SetScreenStateController : ApiController public class SetScreenStateController : ApiController
{ {
DataService.BLL.viewing_screen bll = new DataService.BLL.viewing_screen(); DataService.BLL.viewing_screen bll = new DataService.BLL.viewing_screen();

View File

@ -234,6 +234,7 @@
<Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" /> <Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" />
<Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" /> <Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
<Compile Include="Controllers\api\ExportCarbonTrendController.cs" /> <Compile Include="Controllers\api\ExportCarbonTrendController.cs" />
<Compile Include="Controllers\api\GetAirconditionController.cs" />
<Compile Include="Controllers\api\GetAirconditioningLoadController.cs" /> <Compile Include="Controllers\api\GetAirconditioningLoadController.cs" />
<Compile Include="Controllers\api\GetBigScreenController.cs" /> <Compile Include="Controllers\api\GetBigScreenController.cs" />
<Compile Include="Controllers\api\GetBootStrategyController.cs" /> <Compile Include="Controllers\api\GetBootStrategyController.cs" />

View File

@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication /> <IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode /> <IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile /> <UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<NameOfLastUsedPublishProfile>F:\项目\长岛展览馆\项目\LonglslandExhibitionCenter\LonglslandExhibitionCenter\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>F:\项目\长岛展览馆\项目\LonglslandExhibitionCenter\LonglslandExhibitionCenter\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID> <Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/Web API</Controller_SelectedScaffolderCategoryPath> <Controller_SelectedScaffolderCategoryPath>root/Common/Web API</Controller_SelectedScaffolderCategoryPath>

View File

@ -82,10 +82,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<publishTime>05/08/2024 00:05:28</publishTime> <publishTime>05/08/2024 00:05:28</publishTime>
</File> </File>
<File Include="bin/DataService.dll"> <File Include="bin/DataService.dll">
<publishTime>09/24/2024 15:22:42</publishTime> <publishTime>09/27/2024 15:24:04</publishTime>
</File> </File>
<File Include="bin/DataService.pdb"> <File Include="bin/DataService.pdb">
<publishTime>09/24/2024 15:22:42</publishTime> <publishTime>09/27/2024 15:24:04</publishTime>
</File> </File>
<File Include="bin/Enums.NET.dll"> <File Include="bin/Enums.NET.dll">
<publishTime>11/19/2022 06:40:50</publishTime> <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> <publishTime>08/13/2024 17:44:43</publishTime>
</File> </File>
<File Include="bin/LonglslandExhibitionCenter.dll"> <File Include="bin/LonglslandExhibitionCenter.dll">
<publishTime>09/24/2024 15:22:43</publishTime> <publishTime>09/27/2024 15:24:05</publishTime>
</File> </File>
<File Include="bin/LonglslandExhibitionCenter.pdb"> <File Include="bin/LonglslandExhibitionCenter.pdb">
<publishTime>09/24/2024 15:22:43</publishTime> <publishTime>09/27/2024 15:24:05</publishTime>
</File> </File>
<File Include="bin/MathNet.Numerics.dll"> <File Include="bin/MathNet.Numerics.dll">
<publishTime>04/03/2022 22:02:06</publishTime> <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> <publishTime>08/13/2024 17:44:44</publishTime>
</File> </File>
<File Include="bin/Upload/长岛海洋生态文明展览馆碳排放统计报表.docx"> <File Include="bin/Upload/长岛海洋生态文明展览馆碳排放统计报表.docx">
<publishTime>08/27/2024 17:56:50</publishTime> <publishTime>09/25/2024 14:05:17</publishTime>
</File> </File>
<File Include="bin/WebGrease.dll"> <File Include="bin/WebGrease.dll">
<publishTime>08/13/2024 17:44:45</publishTime> <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> <publishTime>08/13/2024 17:44:43</publishTime>
</File> </File>
<File Include="Upload/长岛海洋生态文明展览馆碳排放统计报表.docx"> <File Include="Upload/长岛海洋生态文明展览馆碳排放统计报表.docx">
<publishTime>08/27/2024 17:56:50</publishTime> <publishTime>09/25/2024 14:05:17</publishTime>
</File> </File>
<File Include="Util/MqttClientService.cs"> <File Include="Util/MqttClientService.cs">
<publishTime>02/23/2024 18:15:19</publishTime> <publishTime>02/23/2024 18:15:19</publishTime>

View File

@ -1,10 +1,10 @@
长岛海洋生态文明展览馆 长岛海洋生态文明展览馆
碳排放统计报表 碳排放统计报表
2021年烟台市提出打造`长岛国际零碳岛'组织专家团队进行了科学研究规划成果在2023年联合国气候变化迪拜大会发布目标是到2035年长岛全域实现净零排放。" 2021年烟台市提出打造`长岛国际零碳岛'组织专家团队进行了科学研究规划成果在2023年联合国气候变化迪拜大会发布目标是到2035年长岛全域实现净零排放。"
year-month长岛海洋生态文明展览馆用电量为electricity千瓦时二氧化碳排放量为carbon吨。 year-month长岛海洋生态文明展览馆用电量为electricity千瓦时二氧化碳排放量为carbon吨。
月份 月份
用电量kWh 用电量kWh
碳排放量tCO2 碳排放量(tCO2
备注 备注
1月 1月

View File

@ -1,10 +1,10 @@
长岛海洋生态文明展览馆 长岛海洋生态文明展览馆
碳排放统计报表 碳排放统计报表
2021年烟台市提出打造`长岛国际零碳岛'组织专家团队进行了科学研究规划成果在2023年联合国气候变化迪拜大会发布目标是到2035年长岛全域实现净零排放。" 2021年烟台市提出打造`长岛国际零碳岛'组织专家团队进行了科学研究规划成果在2023年联合国气候变化迪拜大会发布目标是到2035年长岛全域实现净零排放。"
year-month长岛海洋生态文明展览馆用电量为electricity千瓦时二氧化碳排放量为carbon吨。 year-month长岛海洋生态文明展览馆用电量为electricity千瓦时二氧化碳排放量为carbon吨。
月份 月份
用电量kWh 用电量kWh
碳排放量tCO2 碳排放量(tCO2
备注 备注
1月 1月

View File

@ -1 +1 @@
694063c687b50a6323e8f1095134d7b46e41465b ddd0bc2fdf9b9c94f86bfebdfc81b81b8a84af99

View File

@ -1 +1 @@
8de8f8e4bd6e51dcab02983f89d0877a0e68851f d9f2f0651070f4225fe43415422937cea96eecbb

View File

@ -1,10 +1,10 @@
长岛海洋生态文明展览馆 长岛海洋生态文明展览馆
碳排放统计报表 碳排放统计报表
2021年烟台市提出打造`长岛国际零碳岛'组织专家团队进行了科学研究规划成果在2023年联合国气候变化迪拜大会发布目标是到2035年长岛全域实现净零排放。" 2021年烟台市提出打造`长岛国际零碳岛'组织专家团队进行了科学研究规划成果在2023年联合国气候变化迪拜大会发布目标是到2035年长岛全域实现净零排放。"
year-month长岛海洋生态文明展览馆用电量为electricity千瓦时二氧化碳排放量为carbon吨。 year-month长岛海洋生态文明展览馆用电量为electricity千瓦时二氧化碳排放量为carbon吨。
月份 月份
用电量kWh 用电量kWh
碳排放量tCO2 碳排放量(tCO2
备注 备注
1月 1月

View File

@ -1,10 +1,10 @@
长岛海洋生态文明展览馆 长岛海洋生态文明展览馆
碳排放统计报表 碳排放统计报表
2021年烟台市提出打造`长岛国际零碳岛'组织专家团队进行了科学研究规划成果在2023年联合国气候变化迪拜大会发布目标是到2035年长岛全域实现净零排放。" 2021年烟台市提出打造`长岛国际零碳岛'组织专家团队进行了科学研究规划成果在2023年联合国气候变化迪拜大会发布目标是到2035年长岛全域实现净零排放。"
year-month长岛海洋生态文明展览馆用电量为electricity千瓦时二氧化碳排放量为carbon吨。 year-month长岛海洋生态文明展览馆用电量为electricity千瓦时二氧化碳排放量为carbon吨。
月份 月份
用电量kWh 用电量kWh
碳排放量tCO2 碳排放量(tCO2
备注 备注
1月 1月