|
|
|
@ -238,7 +238,6 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
using (var context = new EFContext())
|
|
|
|
|
{
|
|
|
|
|
var query = context.EquipmentRecords.Where(f => (f.StartTime >= begDate && f.StartTime <= endDate)).ToList();
|
|
|
|
|
//过滤跨天的数据部分
|
|
|
|
|
|
|
|
|
|
//获取状态统计时间
|
|
|
|
|
var total = query.GroupBy(f => new { f.EquipmentId, f.State })
|
|
|
|
@ -271,10 +270,8 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
//获取配置的设备的阈值
|
|
|
|
|
var homegrownConfig = _configRepository.GetSysConfigDetailNameOrKey("", EquipmentType.Homegrown).Content;
|
|
|
|
|
var importConfig = _configRepository.GetSysConfigDetailNameOrKey("", EquipmentType.Import).Content;
|
|
|
|
|
//var ionbondConfig = _configRepository.GetSysConfigDetailNameOrKey("", EquipmentType.Ionbond).Content;
|
|
|
|
|
var homegrown = 200;
|
|
|
|
|
var import = 300;
|
|
|
|
|
//var ionbond = 200;
|
|
|
|
|
var homegrown = 1360;
|
|
|
|
|
var import = 1360;
|
|
|
|
|
if (homegrownConfig != null && !homegrownConfig.ConfigValue.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
int.TryParse(homegrownConfig.ConfigValue, out homegrown);
|
|
|
|
@ -283,11 +280,6 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
{
|
|
|
|
|
int.TryParse(importConfig.ConfigValue, out import);
|
|
|
|
|
}
|
|
|
|
|
//if (ionbondConfig != null && !ionbondConfig.ConfigValue.IsNullOrEmpty())
|
|
|
|
|
//{
|
|
|
|
|
// int.TryParse(ionbondConfig.ConfigValue, out ionbond);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var dayTotals = context.EquipmentRecordDayTotals.Where(f => f.TotalDay >= begDate && f.TotalDay <= endDate).ToList();
|
|
|
|
|
foreach (var item in total.Select(f => new { f.EquipmentId, f.Date }).Distinct())
|
|
|
|
@ -346,12 +338,6 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
value.FurnaceNum++;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
//case EquipmentType.CemeCon:
|
|
|
|
|
// if (minutes >= import)
|
|
|
|
|
// {
|
|
|
|
|
// value.FurnaceNum++;
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -518,7 +504,6 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
{
|
|
|
|
|
query = query.Where(f => f.TotalDay <= endTime);
|
|
|
|
|
}
|
|
|
|
|
// query = query.Where(f => f.TotalDay >= begTime && f.TotalDay <= endTime);
|
|
|
|
|
|
|
|
|
|
return query;
|
|
|
|
|
}
|
|
|
|
@ -716,10 +701,8 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
//获取配置的设备的初尝值
|
|
|
|
|
var homegrownConfig = _configRepository.GetSysConfigDetailNameOrKey("", EquipmentTypeOffset.HomegrownOffset).Content;
|
|
|
|
|
var importConfig = _configRepository.GetSysConfigDetailNameOrKey("", EquipmentTypeOffset.ImportOffset).Content;
|
|
|
|
|
//var ionbondConfig = _configRepository.GetSysConfigDetailNameOrKey("", EquipmentTypeOffset.IonbondOffset).Content;
|
|
|
|
|
var homegrown = 0m;
|
|
|
|
|
var import = 0m;
|
|
|
|
|
//var ionbond = 0m;
|
|
|
|
|
if (homegrownConfig != null && !homegrownConfig.ConfigValue.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
decimal.TryParse(homegrownConfig.ConfigValue, out homegrown);
|
|
|
|
@ -728,10 +711,6 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
{
|
|
|
|
|
decimal.TryParse(importConfig.ConfigValue, out import);
|
|
|
|
|
}
|
|
|
|
|
//if (ionbondConfig != null && !ionbondConfig.ConfigValue.IsNullOrEmpty())
|
|
|
|
|
//{
|
|
|
|
|
// decimal.TryParse(ionbondConfig.ConfigValue, out ionbond);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
@ -744,7 +723,7 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
//初尝值不包括今天
|
|
|
|
|
days = now.Day - 1;
|
|
|
|
|
//获取当月到当前的分钟
|
|
|
|
|
minutes = days * 60 * 24 + (now.Hour - 1) * 60 + now.Minute;
|
|
|
|
|
minutes = days * 24 * 60 + now.Hour * 60 + now.Minute;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -752,7 +731,7 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
if (sptr.Length == 2)
|
|
|
|
|
{
|
|
|
|
|
days = DateTime.DaysInMonth(int.Parse(sptr[0]), int.Parse(sptr[1]));
|
|
|
|
|
minutes = days * 60 * 24;
|
|
|
|
|
minutes = days * 24 * 60;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -765,9 +744,6 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
case EquipmentType.Import:
|
|
|
|
|
value = days * import;
|
|
|
|
|
break;
|
|
|
|
|
//case EquipmentType.CemeCon:
|
|
|
|
|
// value = days * cemecon;
|
|
|
|
|
// break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -830,10 +806,8 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
//获取配置的设备的初尝值
|
|
|
|
|
var homegrownConfig = _configRepository.GetSysConfigDetailNameOrKey("", EquipmentTypeOffset.HomegrownOffset).Content;
|
|
|
|
|
var importConfig = _configRepository.GetSysConfigDetailNameOrKey("", EquipmentTypeOffset.ImportOffset).Content;
|
|
|
|
|
//var ionbondConfig = _configRepository.GetSysConfigDetailNameOrKey("", EquipmentTypeOffset.IonbondOffset).Content;
|
|
|
|
|
var homegrown = 0m;
|
|
|
|
|
var import = 0m;
|
|
|
|
|
//var ionbond = 0m;
|
|
|
|
|
if (homegrownConfig != null && !homegrownConfig.ConfigValue.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
decimal.TryParse(homegrownConfig.ConfigValue, out homegrown);
|
|
|
|
@ -842,10 +816,6 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
{
|
|
|
|
|
decimal.TryParse(importConfig.ConfigValue, out import);
|
|
|
|
|
}
|
|
|
|
|
//if (ionbondConfig != null && !ionbondConfig.ConfigValue.IsNullOrEmpty())
|
|
|
|
|
//{
|
|
|
|
|
// decimal.TryParse(ionbondConfig.ConfigValue, out ionbond);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
var now = DateTime.Now;
|
|
|
|
|
var minutes = 0m;
|
|
|
|
@ -860,7 +830,7 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
}
|
|
|
|
|
if (endDate.ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
|
|
|
|
|
{
|
|
|
|
|
minutes = days * 60 * 24 + (now.Hour - 1) * 60 + now.Minute;
|
|
|
|
|
minutes = days * 60 * 24 + now.Hour * 60 + now.Minute;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -876,9 +846,6 @@ namespace CVDEMCS.Services.Repositories.Impl
|
|
|
|
|
case EquipmentType.Import:
|
|
|
|
|
value = days * import;
|
|
|
|
|
break;
|
|
|
|
|
//case EquipmentType.CemeCon:
|
|
|
|
|
// value = days * import;
|
|
|
|
|
// break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|