修改气表
This commit is contained in:
parent
d41bafe584
commit
5cc0e9bbf0
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -67,7 +67,7 @@ namespace DongYingAPI.Controllers.api
|
|||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
var model = new air_conditionerData();
|
||||
var model = new power_loadData();
|
||||
var atime = DateTime.Now.AddMonths(-i).ToString("MM月");
|
||||
model.time = atime;
|
||||
var now = DateTime.Now.AddMonths(-i);
|
||||
|
@ -93,7 +93,7 @@ namespace DongYingAPI.Controllers.api
|
|||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
var model = new air_conditionerData();
|
||||
var model = new power_loadData();
|
||||
var atime = DateTime.Now.AddYears(-i).ToString("yyyy年");
|
||||
model.time = atime;
|
||||
var now = DateTime.Now.AddYears(-i);
|
||||
|
@ -118,180 +118,180 @@ namespace DongYingAPI.Controllers.api
|
|||
res.msg = "成功";
|
||||
res.data = data;
|
||||
}
|
||||
else if (type == "配电室2")
|
||||
{
|
||||
var data = new List<power_loadData>();
|
||||
var list = bll.GetModelList("").Where(x => x.FloorName == "科技馆负一层地源热泵").ToList();
|
||||
if (date == "日")
|
||||
{
|
||||
//else if (type == "配电室2")
|
||||
//{
|
||||
// var data = new List<power_loadData>();
|
||||
// var list = bll.GetModelList("").Where(x => x.FloorName == "科技馆负一层地源热泵").ToList();
|
||||
// if (date == "日")
|
||||
// {
|
||||
|
||||
var a = DateTime.Now.ToString("mm");
|
||||
var b = 0;
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
var model = new power_loadData();
|
||||
// var a = DateTime.Now.ToString("mm");
|
||||
// var b = 0;
|
||||
// for (int i = 0; i < 6; i++)
|
||||
// {
|
||||
// var model = new power_loadData();
|
||||
|
||||
var j = i * 150;
|
||||
b = Convert.ToInt32(a);
|
||||
string now = "";
|
||||
if (b < 30)
|
||||
{
|
||||
model.time = DateTime.Now.AddMinutes(-j).ToString("HH:00");
|
||||
now = DateTime.Now.ToString("yyyy-MM-dd HH:00:00");
|
||||
//b =Convert.ToInt32(DateTime.Now.AddMinutes(-30).ToString("mm"));
|
||||
a = "31";
|
||||
}
|
||||
else
|
||||
{
|
||||
model.time = DateTime.Now.AddMinutes(-j).ToString("HH:30");
|
||||
now = DateTime.Now.ToString("yyyy-MM-dd HH:31:00");
|
||||
a = "29";
|
||||
}
|
||||
var datetime = Convert.ToDateTime(now);
|
||||
var sdate = datetime.AddMinutes(-(i + 1) * 150);
|
||||
var edate = datetime.AddMinutes(-j);
|
||||
var list1 = bll.GetModelList("").Where(x => x.FloorName == "科技馆负一层地源热泵" && x.CreateTime >= sdate && x.CreateTime < edate).ToList();
|
||||
decimal? num1 = 0;
|
||||
foreach (var item in list1)
|
||||
{
|
||||
num1 += item.P;
|
||||
}
|
||||
model.P = num1;
|
||||
data.Add(model);
|
||||
// var j = i * 150;
|
||||
// b = Convert.ToInt32(a);
|
||||
// string now = "";
|
||||
// if (b < 30)
|
||||
// {
|
||||
// model.time = DateTime.Now.AddMinutes(-j).ToString("HH:00");
|
||||
// now = DateTime.Now.ToString("yyyy-MM-dd HH:00:00");
|
||||
// //b =Convert.ToInt32(DateTime.Now.AddMinutes(-30).ToString("mm"));
|
||||
// a = "31";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// model.time = DateTime.Now.AddMinutes(-j).ToString("HH:30");
|
||||
// now = DateTime.Now.ToString("yyyy-MM-dd HH:31:00");
|
||||
// a = "29";
|
||||
// }
|
||||
// var datetime = Convert.ToDateTime(now);
|
||||
// var sdate = datetime.AddMinutes(-(i + 1) * 150);
|
||||
// var edate = datetime.AddMinutes(-j);
|
||||
// var list1 = bll.GetModelList("").Where(x => x.FloorName == "科技馆负一层地源热泵" && x.CreateTime >= sdate && x.CreateTime < edate).ToList();
|
||||
// decimal? num1 = 0;
|
||||
// foreach (var item in list1)
|
||||
// {
|
||||
// num1 += item.P;
|
||||
// }
|
||||
// model.P = num1;
|
||||
// data.Add(model);
|
||||
|
||||
}
|
||||
}
|
||||
else if (date == "月")
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
var model = new power_loadData();
|
||||
var time = DateTime.Now.AddMonths(-i).ToString("MM月");
|
||||
model.time = time;
|
||||
var now = DateTime.Now.AddMonths(-i);
|
||||
var sdate = now.ToString("yyyy-MM") + "-01 00:00:00";
|
||||
var edate = now.AddMonths(+1).ToString("yyyy-MM") + "-01 00:00:00";
|
||||
var alist = list.Where(x => x.CreateTime >= Convert.ToDateTime(sdate) && x.CreateTime < Convert.ToDateTime(edate)).ToList();
|
||||
decimal? num = 0;
|
||||
foreach (var item in alist)
|
||||
{
|
||||
num += item.P;
|
||||
}
|
||||
model.P = num;
|
||||
data.Add(model);
|
||||
}
|
||||
}
|
||||
else if (date == "年")
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
var model = new power_loadData();
|
||||
var time = DateTime.Now.AddYears(-i).ToString("yyyy年");
|
||||
model.time = time;
|
||||
var now = DateTime.Now.AddYears(-i);
|
||||
var sdate = now.ToString("yyyy") + "-01-01 00:00:00";
|
||||
var edate = now.AddYears(+1).ToString("yyyy") + "-01-01 00:00:00";
|
||||
var alist = list.Where(x => x.CreateTime >= Convert.ToDateTime(sdate) && x.CreateTime < Convert.ToDateTime(edate)).ToList();
|
||||
decimal? num = 0;
|
||||
foreach (var item in alist)
|
||||
{
|
||||
num += item.P;
|
||||
}
|
||||
model.P = num;
|
||||
data.Add(model);
|
||||
}
|
||||
}
|
||||
res.code = 200;
|
||||
res.msg = "成功";
|
||||
res.data = data;
|
||||
}
|
||||
else if (type == "配电室3")
|
||||
{
|
||||
var data = new List<power_loadData>();
|
||||
var list = bll.GetModelList("").Where(x => x.FloorName == "图书馆一楼").ToList();
|
||||
if (date == "日")
|
||||
{
|
||||
// }
|
||||
// }
|
||||
// else if (date == "月")
|
||||
// {
|
||||
// for (int i = 0; i < 6; i++)
|
||||
// {
|
||||
// var model = new power_loadData();
|
||||
// var time = DateTime.Now.AddMonths(-i).ToString("MM月");
|
||||
// model.time = time;
|
||||
// var now = DateTime.Now.AddMonths(-i);
|
||||
// var sdate = now.ToString("yyyy-MM") + "-01 00:00:00";
|
||||
// var edate = now.AddMonths(+1).ToString("yyyy-MM") + "-01 00:00:00";
|
||||
// var alist = list.Where(x => x.CreateTime >= Convert.ToDateTime(sdate) && x.CreateTime < Convert.ToDateTime(edate)).ToList();
|
||||
// decimal? num = 0;
|
||||
// foreach (var item in alist)
|
||||
// {
|
||||
// num += item.P;
|
||||
// }
|
||||
// model.P = num;
|
||||
// data.Add(model);
|
||||
// }
|
||||
// }
|
||||
// else if (date == "年")
|
||||
// {
|
||||
// for (int i = 0; i < 6; i++)
|
||||
// {
|
||||
// var model = new power_loadData();
|
||||
// var time = DateTime.Now.AddYears(-i).ToString("yyyy年");
|
||||
// model.time = time;
|
||||
// var now = DateTime.Now.AddYears(-i);
|
||||
// var sdate = now.ToString("yyyy") + "-01-01 00:00:00";
|
||||
// var edate = now.AddYears(+1).ToString("yyyy") + "-01-01 00:00:00";
|
||||
// var alist = list.Where(x => x.CreateTime >= Convert.ToDateTime(sdate) && x.CreateTime < Convert.ToDateTime(edate)).ToList();
|
||||
// decimal? num = 0;
|
||||
// foreach (var item in alist)
|
||||
// {
|
||||
// num += item.P;
|
||||
// }
|
||||
// model.P = num;
|
||||
// data.Add(model);
|
||||
// }
|
||||
// }
|
||||
// res.code = 200;
|
||||
// res.msg = "成功";
|
||||
// res.data = data;
|
||||
//}
|
||||
//else if (type == "配电室3")
|
||||
//{
|
||||
// var data = new List<power_loadData>();
|
||||
// var list = bll.GetModelList("").Where(x => x.FloorName == "图书馆一楼").ToList();
|
||||
// if (date == "日")
|
||||
// {
|
||||
|
||||
var a = DateTime.Now.ToString("mm");
|
||||
var b = 0;
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
var model = new power_loadData();
|
||||
// var a = DateTime.Now.ToString("mm");
|
||||
// var b = 0;
|
||||
// for (int i = 0; i < 6; i++)
|
||||
// {
|
||||
// var model = new power_loadData();
|
||||
|
||||
var j = i * 150;
|
||||
b = Convert.ToInt32(a);
|
||||
string now = "";
|
||||
if (b < 30)
|
||||
{
|
||||
model.time = DateTime.Now.AddMinutes(-j).ToString("HH:00");
|
||||
now = DateTime.Now.ToString("yyyy-MM-dd HH:00:00");
|
||||
//b =Convert.ToInt32(DateTime.Now.AddMinutes(-30).ToString("mm"));
|
||||
a = "31";
|
||||
}
|
||||
else
|
||||
{
|
||||
model.time = DateTime.Now.AddMinutes(-j).ToString("HH:30");
|
||||
now = DateTime.Now.ToString("yyyy-MM-dd HH:31:00");
|
||||
a = "29";
|
||||
}
|
||||
var datetime = Convert.ToDateTime(now);
|
||||
var sdate = datetime.AddMinutes(-(i + 1) * 150);
|
||||
var edate = datetime.AddMinutes(-j);
|
||||
var list1 = bll.GetModelList("").Where(x => x.FloorName == "图书馆一楼" && x.CreateTime >= sdate && x.CreateTime < edate).ToList();
|
||||
decimal? num1 = 0;
|
||||
foreach (var item in list1)
|
||||
{
|
||||
num1 += item.P;
|
||||
}
|
||||
model.P = num1;
|
||||
data.Add(model);
|
||||
// var j = i * 150;
|
||||
// b = Convert.ToInt32(a);
|
||||
// string now = "";
|
||||
// if (b < 30)
|
||||
// {
|
||||
// model.time = DateTime.Now.AddMinutes(-j).ToString("HH:00");
|
||||
// now = DateTime.Now.ToString("yyyy-MM-dd HH:00:00");
|
||||
// //b =Convert.ToInt32(DateTime.Now.AddMinutes(-30).ToString("mm"));
|
||||
// a = "31";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// model.time = DateTime.Now.AddMinutes(-j).ToString("HH:30");
|
||||
// now = DateTime.Now.ToString("yyyy-MM-dd HH:31:00");
|
||||
// a = "29";
|
||||
// }
|
||||
// var datetime = Convert.ToDateTime(now);
|
||||
// var sdate = datetime.AddMinutes(-(i + 1) * 150);
|
||||
// var edate = datetime.AddMinutes(-j);
|
||||
// var list1 = bll.GetModelList("").Where(x => x.FloorName == "图书馆一楼" && x.CreateTime >= sdate && x.CreateTime < edate).ToList();
|
||||
// decimal? num1 = 0;
|
||||
// foreach (var item in list1)
|
||||
// {
|
||||
// num1 += item.P;
|
||||
// }
|
||||
// model.P = num1;
|
||||
// data.Add(model);
|
||||
|
||||
}
|
||||
}
|
||||
else if (date == "月")
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
var model = new power_loadData();
|
||||
var time = DateTime.Now.AddMonths(-i).ToString("MM月");
|
||||
model.time = time;
|
||||
var now = DateTime.Now.AddMonths(-i);
|
||||
var sdate = now.ToString("yyyy-MM") + "-01 00:00:00";
|
||||
var edate = now.AddMonths(+1).ToString("yyyy-MM") + "-01 00:00:00";
|
||||
var alist = list.Where(x => x.CreateTime >= Convert.ToDateTime(sdate) && x.CreateTime < Convert.ToDateTime(edate)).ToList();
|
||||
decimal? num = 0;
|
||||
foreach (var item in alist)
|
||||
{
|
||||
num += item.P;
|
||||
}
|
||||
model.P = num;
|
||||
data.Add(model);
|
||||
}
|
||||
}
|
||||
else if (date == "年")
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
var model = new power_loadData();
|
||||
var time = DateTime.Now.AddYears(-i).ToString("yyyy年");
|
||||
model.time = time;
|
||||
var now = DateTime.Now.AddYears(-i);
|
||||
var sdate = now.ToString("yyyy") + "-01-01 00:00:00";
|
||||
var edate = now.AddYears(+1).ToString("yyyy") + "-01-01 00:00:00";
|
||||
var alist = list.Where(x => x.CreateTime >= Convert.ToDateTime(sdate) && x.CreateTime < Convert.ToDateTime(edate)).ToList();
|
||||
decimal? num = 0;
|
||||
foreach (var item in alist)
|
||||
{
|
||||
num += item.P;
|
||||
}
|
||||
model.P = num;
|
||||
data.Add(model);
|
||||
}
|
||||
}
|
||||
res.code = 200;
|
||||
res.msg = "成功";
|
||||
res.data = data;
|
||||
}
|
||||
// }
|
||||
// }
|
||||
// else if (date == "月")
|
||||
// {
|
||||
// for (int i = 0; i < 6; i++)
|
||||
// {
|
||||
// var model = new power_loadData();
|
||||
// var time = DateTime.Now.AddMonths(-i).ToString("MM月");
|
||||
// model.time = time;
|
||||
// var now = DateTime.Now.AddMonths(-i);
|
||||
// var sdate = now.ToString("yyyy-MM") + "-01 00:00:00";
|
||||
// var edate = now.AddMonths(+1).ToString("yyyy-MM") + "-01 00:00:00";
|
||||
// var alist = list.Where(x => x.CreateTime >= Convert.ToDateTime(sdate) && x.CreateTime < Convert.ToDateTime(edate)).ToList();
|
||||
// decimal? num = 0;
|
||||
// foreach (var item in alist)
|
||||
// {
|
||||
// num += item.P;
|
||||
// }
|
||||
// model.P = num;
|
||||
// data.Add(model);
|
||||
// }
|
||||
// }
|
||||
// else if (date == "年")
|
||||
// {
|
||||
// for (int i = 0; i < 6; i++)
|
||||
// {
|
||||
// var model = new power_loadData();
|
||||
// var time = DateTime.Now.AddYears(-i).ToString("yyyy年");
|
||||
// model.time = time;
|
||||
// var now = DateTime.Now.AddYears(-i);
|
||||
// var sdate = now.ToString("yyyy") + "-01-01 00:00:00";
|
||||
// var edate = now.AddYears(+1).ToString("yyyy") + "-01-01 00:00:00";
|
||||
// var alist = list.Where(x => x.CreateTime >= Convert.ToDateTime(sdate) && x.CreateTime < Convert.ToDateTime(edate)).ToList();
|
||||
// decimal? num = 0;
|
||||
// foreach (var item in alist)
|
||||
// {
|
||||
// num += item.P;
|
||||
// }
|
||||
// model.P = num;
|
||||
// data.Add(model);
|
||||
// }
|
||||
// }
|
||||
// res.code = 200;
|
||||
// res.msg = "成功";
|
||||
// res.data = data;
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
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.
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>FjB8i0VJ4mh8t9gJB+0cKYgMW6Scj9Z6PRzCcn/iHHo=</dsig:DigestValue>
|
||||
<dsig:DigestValue>MaSB9zKFQS+iDnEjY5O32c/t1YAFFfG/1BnLDJ8aat8=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
@ -49,7 +49,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>cH7kM2pqIw9EpcKsmqER8/KRZ34vzyrkc9Dx/tsNUvc=</dsig:DigestValue>
|
||||
<dsig:DigestValue>8aAyf2+5JgbZz56G6PmGmTJqLWjHrxqhVhKhq6BJugE=</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>FjB8i0VJ4mh8t9gJB+0cKYgMW6Scj9Z6PRzCcn/iHHo=</dsig:DigestValue>
|
||||
<dsig:DigestValue>MaSB9zKFQS+iDnEjY5O32c/t1YAFFfG/1BnLDJ8aat8=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
|
@ -49,7 +49,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>cH7kM2pqIw9EpcKsmqER8/KRZ34vzyrkc9Dx/tsNUvc=</dsig:DigestValue>
|
||||
<dsig:DigestValue>8aAyf2+5JgbZz56G6PmGmTJqLWjHrxqhVhKhq6BJugE=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
|
Loading…
Reference in New Issue