diff --git a/DataServer/DataServer.csproj b/DataServer/DataServer.csproj
index 187e38a..6a243d8 100644
--- a/DataServer/DataServer.csproj
+++ b/DataServer/DataServer.csproj
@@ -66,9 +66,13 @@
+
+
+
+
diff --git a/DataServer/api/get_carbon_intensity.cs b/DataServer/api/get_carbon_intensity.cs
new file mode 100644
index 0000000..2860a36
--- /dev/null
+++ b/DataServer/api/get_carbon_intensity.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.ConstrainedExecution;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DataServer.api
+{
+ public class get_carbon_intensity
+ {
+ ///
+ /// 返回码
+ ///
+ public int code { get; set; }
+
+ ///
+ /// 返回说明
+ ///
+ public string msg { get; set; }
+
+ ///
+ /// 数据
+ ///
+ public List data { get; set; }
+ }
+ public class carbon_intensityData
+ {
+ public string time { get; set; }
+ public decimal? CarbonPer { get; set; }
+ public decimal? ArealCarbon { get;set;}
+ }
+}
diff --git a/DataServer/api/get_carbon_offset.cs b/DataServer/api/get_carbon_offset.cs
new file mode 100644
index 0000000..340ee06
--- /dev/null
+++ b/DataServer/api/get_carbon_offset.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DataServer.api
+{
+ public class get_carbon_offset
+ {
+ ///
+ /// 返回码
+ ///
+ public int code { get; set; }
+
+ ///
+ /// 返回说明
+ ///
+ public string msg { get; set; }
+
+ ///
+ /// 数据
+ ///
+ public List data { get; set; }
+ }
+ public class carbon_offsetData
+ {
+ public decimal? CarbonOffse { get; set; }
+ }
+}
diff --git a/DataServer/api/get_carbon_reduction.cs b/DataServer/api/get_carbon_reduction.cs
new file mode 100644
index 0000000..ff35ec1
--- /dev/null
+++ b/DataServer/api/get_carbon_reduction.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DataServer.api
+{
+
+ public class get_carbon_reduction
+ {
+ ///
+ /// 返回码
+ ///
+ public int code { get; set; }
+
+ ///
+ /// 返回说明
+ ///
+ public string msg { get; set; }
+
+ ///
+ /// 数据
+ ///
+ public List data { get; set; }
+ }
+ public class carbon_reductionData
+ {
+ public decimal? Aount { get; set; }
+ public List list { get; set; }
+ }
+ public class carbon_reduction
+ {
+ public decimal? AirConditioner { get; set; }
+ public decimal? Illumination { get; set;}
+ public decimal? Other { get; set;}
+ }
+}
diff --git a/DataServer/api/get_daily_electricity.cs b/DataServer/api/get_daily_electricity.cs
new file mode 100644
index 0000000..d5f8530
--- /dev/null
+++ b/DataServer/api/get_daily_electricity.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DataServer.api
+{
+ public class get_daily_electricity
+ {
+ ///
+ /// 返回码
+ ///
+ public int code { get; set; }
+
+ ///
+ /// 返回说明
+ ///
+ public string msg { get; set; }
+
+ ///
+ /// 数据
+ ///
+ public List data { get; set; }
+ }
+ public class daily_electricityData
+ {
+ public decimal? CurrentDate { get; set; }
+ public decimal? YesterDay { get; set; }
+ }
+}
diff --git a/DataServer/bin/Debug/DataServer.pdb b/DataServer/bin/Debug/DataServer.pdb
index f158e98..8e5011b 100644
Binary files a/DataServer/bin/Debug/DataServer.pdb and b/DataServer/bin/Debug/DataServer.pdb differ
diff --git a/DataServer/obj/Debug/DataServer.csproj.CoreCompileInputs.cache b/DataServer/obj/Debug/DataServer.csproj.CoreCompileInputs.cache
index 4cc9e9b..6f8fa5a 100644
--- a/DataServer/obj/Debug/DataServer.csproj.CoreCompileInputs.cache
+++ b/DataServer/obj/Debug/DataServer.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-7fcd104ed931a93f81505ce377f5e1bfe52798a6
+4c49ecb8992ee253af38dc297bc68a59dc3931a1
diff --git a/DataServer/obj/Debug/DataServer.dll b/DataServer/obj/Debug/DataServer.dll
index 7054b5e..74bc917 100644
Binary files a/DataServer/obj/Debug/DataServer.dll and b/DataServer/obj/Debug/DataServer.dll differ
diff --git a/DataServer/obj/Debug/DataServer.pdb b/DataServer/obj/Debug/DataServer.pdb
index f158e98..8e5011b 100644
Binary files a/DataServer/obj/Debug/DataServer.pdb and b/DataServer/obj/Debug/DataServer.pdb differ
diff --git a/DongYingAPI/Controllers/api/GetCarbonIntensityController.cs b/DongYingAPI/Controllers/api/GetCarbonIntensityController.cs
new file mode 100644
index 0000000..4ac881a
--- /dev/null
+++ b/DongYingAPI/Controllers/api/GetCarbonIntensityController.cs
@@ -0,0 +1,65 @@
+using DataServer.api;
+using DataServer.Model;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Text;
+using System.Web.Http;
+
+namespace DongYingAPI.Controllers.api
+{
+ ///
+ /// 碳-排放强度
+ ///
+ public class GetCarbonIntensityController : ApiController
+ {
+ DataServer.BLL.electricity_data bll = new DataServer.BLL.electricity_data();
+ DataServer.BLL.device_info bll_info = new DataServer.BLL.device_info();
+ public HttpResponseMessage Get()
+ {
+ var res = new get_carbon_intensity();
+ try
+ {
+ var data =new List();
+ var time = DateTime.Now.ToString("yyyyMM");
+ for (int i = 0; i < 6; i++)
+ {
+ var model=new carbon_intensityData();
+ var atime = DateTime.Now.AddMonths(-i).ToString("MM月");
+ model.time = atime;
+ var now = DateTime.Now;
+ var sdate = Convert.ToDateTime(now.AddMonths(-i).ToString("yyyy-MM-01 00:00:00"));
+ var edate = Convert.ToDateTime(now.AddMonths(-i+1).ToString("yyyy-MM-01 00:00:00"));
+ var list = bll_info.GetModelList("");
+ decimal? num = 0;
+ foreach (var item in list)
+ {
+ var list1 = bll.GetModelListDate("", time).Where(x => x.EntireTime >= sdate && x.EntireTime < edate&&x.DeviceId==item.DeviceId).ToList();
+ foreach (var aitem in list1)
+ {
+ num += aitem.EH;
+ }
+ }
+ model.CarbonPer = (num / 1000 * Convert.ToDecimal(0.5703))/100000;
+ model.ArealCarbon = (num / 1000 * Convert.ToDecimal(0.5703)) / 59000;
+ 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;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DongYingAPI/Controllers/api/GetCarbonOffsetController.cs b/DongYingAPI/Controllers/api/GetCarbonOffsetController.cs
new file mode 100644
index 0000000..d5e965c
--- /dev/null
+++ b/DongYingAPI/Controllers/api/GetCarbonOffsetController.cs
@@ -0,0 +1,59 @@
+using DataServer.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 DongYingAPI.Controllers.api
+{
+ ///
+ /// 碳-碳抵消
+ ///
+ public class GetCarbonOffsetController : ApiController
+ {
+ public HttpResponseMessage Get(string date="")
+ {
+ var res = new get_carbon_offset();
+ try
+ {
+ if(!string.IsNullOrEmpty(date))
+ {
+ var data = new List();
+ if (date == "年")
+ {
+ var model =new carbon_offsetData();
+ model.CarbonOffse = 0;
+ data.Add(model);
+ }else if (date == "月")
+ {
+ var model = new carbon_offsetData();
+ model.CarbonOffse = 0;
+ 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;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DongYingAPI/Controllers/api/GetCarbonReductionController.cs b/DongYingAPI/Controllers/api/GetCarbonReductionController.cs
new file mode 100644
index 0000000..8af8c1c
--- /dev/null
+++ b/DongYingAPI/Controllers/api/GetCarbonReductionController.cs
@@ -0,0 +1,52 @@
+using DataServer.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 DongYingAPI.Controllers.api
+{
+ ///
+ /// 碳-碳减排量
+ ///
+ public class GetCarbonReductionController : ApiController
+ {
+ public HttpResponseMessage Get()
+ {
+ var res = new get_carbon_reduction();
+ try
+ {
+ var data = new List();
+ var model=new carbon_reductionData();
+ //总量
+ model.Aount = 333;
+ var blist=new List();
+ var bmodel=new carbon_reduction();
+ //空调
+ bmodel.AirConditioner = 111;
+ //照明
+ bmodel.Illumination = 111;
+ //其它
+ bmodel.Other = 111;
+ blist.Add(bmodel);
+ model.list = blist;
+ 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;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DongYingAPI/Controllers/api/GetDailyElectricityController.cs b/DongYingAPI/Controllers/api/GetDailyElectricityController.cs
new file mode 100644
index 0000000..86a18df
--- /dev/null
+++ b/DongYingAPI/Controllers/api/GetDailyElectricityController.cs
@@ -0,0 +1,72 @@
+using DataServer.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 DongYingAPI.Controllers.api
+{
+ ///
+ /// 空调-日用电量
+ ///
+ public class GetDailyElectricityController : ApiController
+ {
+ DataServer.BLL.electricity_data bll = new DataServer.BLL.electricity_data();
+ DataServer.BLL.device_info bll_info = new DataServer.BLL.device_info();
+ public HttpResponseMessage Get()
+ {
+ var res = new get_daily_electricity();
+ try
+ {
+ var data = new List();
+ var time = DateTime.Now.ToString("yyyyMM");
+ //今天
+ var sdate = DateTime.Now.ToString("yyyy-MM-dd HH:00:00");
+ //昨天
+ var edate = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd 00:00:00");
+ //前天
+ var qdate=DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd 00:00:00");
+ //今天列表
+ var list1=bll.GetModelListDate("",time).Where(x=>x.EntireTime==Convert.ToDateTime(sdate)).ToList();
+ decimal? num1 = 0;
+ foreach (var item in list1)
+ {
+ num1 += item.EH;
+ }
+ //明天列表
+ var list2 = bll.GetModelListDate("", time).Where(x => x.EntireTime == Convert.ToDateTime(sdate)).ToList();
+ decimal? num2 = 0;
+ foreach (var item in list1)
+ {
+ num2 += item.EH;
+ }
+ //昨天列表
+ var list3 = bll.GetModelListDate("", time).Where(x => x.EntireTime == Convert.ToDateTime(sdate)).ToList();
+ decimal? num3 = 0;
+ foreach (var item in list1)
+ {
+ num3 += item.EH;
+ }
+ var model = new daily_electricityData();
+ model.CurrentDate = num1 - num2;
+ model.YesterDay=num2- num3;
+ 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;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DongYingAPI/DongYingAPI.csproj b/DongYingAPI/DongYingAPI.csproj
index f2c6f77..8301d03 100644
--- a/DongYingAPI/DongYingAPI.csproj
+++ b/DongYingAPI/DongYingAPI.csproj
@@ -175,9 +175,13 @@
+
+
+
+
diff --git a/DongYingAPI/bin/DataServer.dll b/DongYingAPI/bin/DataServer.dll
index 7054b5e..74bc917 100644
Binary files a/DongYingAPI/bin/DataServer.dll and b/DongYingAPI/bin/DataServer.dll differ
diff --git a/DongYingAPI/bin/DataServer.pdb b/DongYingAPI/bin/DataServer.pdb
index f158e98..8e5011b 100644
Binary files a/DongYingAPI/bin/DataServer.pdb and b/DongYingAPI/bin/DataServer.pdb differ
diff --git a/DongYingAPI/bin/DongYingAPI.dll b/DongYingAPI/bin/DongYingAPI.dll
index 18fc26c..13980ee 100644
Binary files a/DongYingAPI/bin/DongYingAPI.dll and b/DongYingAPI/bin/DongYingAPI.dll differ
diff --git a/DongYingAPI/bin/DongYingAPI.pdb b/DongYingAPI/bin/DongYingAPI.pdb
index 92acb0c..1da3c1b 100644
Binary files a/DongYingAPI/bin/DongYingAPI.pdb and b/DongYingAPI/bin/DongYingAPI.pdb differ
diff --git a/DongYingAPI/obj/Debug/DongYingAPI.csproj.AssemblyReference.cache b/DongYingAPI/obj/Debug/DongYingAPI.csproj.AssemblyReference.cache
index 5833169..99cbc29 100644
Binary files a/DongYingAPI/obj/Debug/DongYingAPI.csproj.AssemblyReference.cache and b/DongYingAPI/obj/Debug/DongYingAPI.csproj.AssemblyReference.cache differ
diff --git a/DongYingAPI/obj/Debug/DongYingAPI.csproj.CoreCompileInputs.cache b/DongYingAPI/obj/Debug/DongYingAPI.csproj.CoreCompileInputs.cache
index 91f813e..ae7b09a 100644
--- a/DongYingAPI/obj/Debug/DongYingAPI.csproj.CoreCompileInputs.cache
+++ b/DongYingAPI/obj/Debug/DongYingAPI.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-abb0e93bff5eee475ebe2f4c7d86f766480d3a15
+468880470fff5b79419feffd9db81238259f3645
diff --git a/DongYingAPI/obj/Debug/DongYingAPI.dll b/DongYingAPI/obj/Debug/DongYingAPI.dll
index 18fc26c..13980ee 100644
Binary files a/DongYingAPI/obj/Debug/DongYingAPI.dll and b/DongYingAPI/obj/Debug/DongYingAPI.dll differ
diff --git a/DongYingAPI/obj/Debug/DongYingAPI.pdb b/DongYingAPI/obj/Debug/DongYingAPI.pdb
index 92acb0c..1da3c1b 100644
Binary files a/DongYingAPI/obj/Debug/DongYingAPI.pdb and b/DongYingAPI/obj/Debug/DongYingAPI.pdb differ
diff --git a/Security/bin/Debug/DataServer.dll b/Security/bin/Debug/DataServer.dll
index 7054b5e..74bc917 100644
Binary files a/Security/bin/Debug/DataServer.dll and b/Security/bin/Debug/DataServer.dll differ
diff --git a/Security/bin/Debug/DataServer.pdb b/Security/bin/Debug/DataServer.pdb
index f158e98..8e5011b 100644
Binary files a/Security/bin/Debug/DataServer.pdb and b/Security/bin/Debug/DataServer.pdb differ
diff --git a/Security/bin/Debug/ServiceSecurity.application b/Security/bin/Debug/ServiceSecurity.application
index 2eb9dd4..1f40c85 100644
--- a/Security/bin/Debug/ServiceSecurity.application
+++ b/Security/bin/Debug/ServiceSecurity.application
@@ -14,7 +14,7 @@
- XCGE4OqWR85JxWdl4SmtwTIMQ5nBl8ZkF7zpfQJxrjE=
+ DFDrtnOeo9dpim2EB6ODebG9pNDAOWi8cJsCQmPQWpo=
diff --git a/Security/bin/Debug/ServiceSecurity.exe.manifest b/Security/bin/Debug/ServiceSecurity.exe.manifest
index 3c0516d..3b60276 100644
--- a/Security/bin/Debug/ServiceSecurity.exe.manifest
+++ b/Security/bin/Debug/ServiceSecurity.exe.manifest
@@ -42,14 +42,14 @@
-
+
- mMU5DkMd36SSoV9C4OC7va8L9Q4t1oI5f8IWnzSUES0=
+ aWndXXAkdQBx2rtrRCdbWDqmcwtd1zO16Sk2hz+kv6w=
diff --git a/Security/obj/Debug/Security.csproj.AssemblyReference.cache b/Security/obj/Debug/Security.csproj.AssemblyReference.cache
index 8530a8e..78941d3 100644
Binary files a/Security/obj/Debug/Security.csproj.AssemblyReference.cache and b/Security/obj/Debug/Security.csproj.AssemblyReference.cache differ
diff --git a/Security/obj/Debug/ServiceSecurity.application b/Security/obj/Debug/ServiceSecurity.application
index 2eb9dd4..1f40c85 100644
--- a/Security/obj/Debug/ServiceSecurity.application
+++ b/Security/obj/Debug/ServiceSecurity.application
@@ -14,7 +14,7 @@
- XCGE4OqWR85JxWdl4SmtwTIMQ5nBl8ZkF7zpfQJxrjE=
+ DFDrtnOeo9dpim2EB6ODebG9pNDAOWi8cJsCQmPQWpo=
diff --git a/Security/obj/Debug/ServiceSecurity.exe.manifest b/Security/obj/Debug/ServiceSecurity.exe.manifest
index 3c0516d..3b60276 100644
--- a/Security/obj/Debug/ServiceSecurity.exe.manifest
+++ b/Security/obj/Debug/ServiceSecurity.exe.manifest
@@ -42,14 +42,14 @@
-
+
- mMU5DkMd36SSoV9C4OC7va8L9Q4t1oI5f8IWnzSUES0=
+ aWndXXAkdQBx2rtrRCdbWDqmcwtd1zO16Sk2hz+kv6w=