|
@@ -34,7 +34,7 @@ namespace SCADA_DAQ.Customer.Service
|
|
|
/// <summary>
|
|
|
///
|
|
|
/// </summary>
|
|
|
- [DisplayName("折弯机记录查询服务")]
|
|
|
+ [DisplayName("获取设备稼动率跟产能服务")]
|
|
|
public class CustomerService : BaseService
|
|
|
{
|
|
|
private static CustomerService _instance;
|
|
@@ -325,9 +325,10 @@ namespace SCADA_DAQ.Customer.Service
|
|
|
{
|
|
|
var startDayTime = DateTime.Parse(DateTime.Now.ToString("00:00:00"));
|
|
|
var endDayTime = DateTime.Parse(DateTime.Now.ToString("23:59:59"));
|
|
|
- OeeData = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>().Where(t => t.CreateTime >= startDayTime & t.CreateTime <= endDayTime);
|
|
|
- DailyOeeData = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>().Where(t => t.CreateTime >= startDayTime & t.CreateTime <= endDayTime);
|
|
|
+ OeeData = Env.SqlDAL.App_Vertiv_MachineInfo.GetData<MachineInfoModel>(t => t.CreateTime >= startDayTime && t.CreateTime <= endDayTime);
|
|
|
+
|
|
|
LastDeviceName = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>();
|
|
|
+ DailyOeeData = Env.SqlDAL.App_Vertiv_MachineInfoOeeData.GetData<OEEDataModel>(t => t.CreateTime >= startDayTime && t.CreateTime <= endDayTime);
|
|
|
}
|
|
|
|
|
|
public string OeeValue { get; set; }
|
|
@@ -340,6 +341,8 @@ namespace SCADA_DAQ.Customer.Service
|
|
|
{
|
|
|
var device = deviceName[i];
|
|
|
var deviceDayTIme = OeeData.ToLookup(t => t.Device)[deviceName[i]].Sum(t => t.DurationSec);
|
|
|
+ var deviceStopTime = OeeData.ToLookup(t => t.Device)[deviceName[i]].ToLookup(t => t.StateCode)["计划停止时间"].Sum(t => t.DurationSec);
|
|
|
+ var deviceallTime = deviceDayTIme - deviceStopTime;
|
|
|
var deviceRunDayTIme = OeeData.ToLookup(t => t.Device)[deviceName[i]].ToLookup(t => t.StateCode)["运行标志位"].Sum(t => t.DurationSec);
|
|
|
var deviceNameList = LastDeviceName.ToLookup(t => t.DeviceName)[deviceName[i]].LastOrDefault();
|
|
|
if (deviceDayTIme == 0)
|
|
@@ -348,7 +351,7 @@ namespace SCADA_DAQ.Customer.Service
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- OeeValue = Math.Round(Convert.ToDouble(deviceRunDayTIme) / deviceDayTIme, 4).ToString();
|
|
|
+ OeeValue = Math.Round(Convert.ToDouble(deviceRunDayTIme) / deviceallTime, 4).ToString();
|
|
|
|
|
|
}
|
|
|
if (DailyOeeData.Count() != 0)
|