设备停机率
This commit is contained in:
parent
5a694f7288
commit
146747a1ed
@ -39,7 +39,7 @@ namespace DOAN.Service.MES.report
|
|||||||
public List<DevicePoweronRateModel> DevicePoweronRate(DateTime dateTime)
|
public List<DevicePoweronRateModel> DevicePoweronRate(DateTime dateTime)
|
||||||
{
|
{
|
||||||
List<DevicePoweronRateModel> list = new List<DevicePoweronRateModel>();
|
List<DevicePoweronRateModel> list = new List<DevicePoweronRateModel>();
|
||||||
var response = Context.Queryable<BaseWorkRoute>().ToList();
|
var response = Context.Queryable<BaseWorkRoute>().OrderBy(t => t.Id).ToList();
|
||||||
var dt = dateTime.ToString("yyyy-MM-dd");
|
var dt = dateTime.ToString("yyyy-MM-dd");
|
||||||
|
|
||||||
var shiftList = Context.Queryable<GroupSchedule>()
|
var shiftList = Context.Queryable<GroupSchedule>()
|
||||||
@ -113,15 +113,15 @@ namespace DOAN.Service.MES.report
|
|||||||
List<DeviceDowntimeRateModel> list = new List<DeviceDowntimeRateModel>();
|
List<DeviceDowntimeRateModel> list = new List<DeviceDowntimeRateModel>();
|
||||||
var dt = dateTime.ToString("yyyy-MM-dd");
|
var dt = dateTime.ToString("yyyy-MM-dd");
|
||||||
|
|
||||||
list = Context.Queryable<ProWorkorder>()
|
list = Context.Queryable<BaseWorkRoute>()
|
||||||
.InnerJoin<BaseWorkRoute>((a, b) => a.LineCode == b.Code)
|
.LeftJoin<ProWorkorder>((a, b) => a.Code == b.LineCode && b.WorkorderDate.Value.ToString("yyyy-MM-dd") == dt)
|
||||||
.Where((a, b) => a.WorkorderDate.Value.ToString("yyyy-MM-dd") == dt)
|
.OrderBy((a,b)=>a.Id)
|
||||||
.Select((a, b) =>
|
.Select((a, b) =>
|
||||||
new DeviceDowntimeRateModel
|
new DeviceDowntimeRateModel
|
||||||
{
|
{
|
||||||
LineCode = b.Code,
|
LineCode = a.Code,
|
||||||
LineName = b.Name,
|
LineName = a.Name,
|
||||||
PlanHours = SqlFunc.Round((a.Beat * a.DeliveryNum ?? 0) / 3600.0,2)
|
PlanHours = SqlFunc.Round((b.Beat * b.DeliveryNum ?? 0) / 3600.0, 2)
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
var response = Context.Queryable<AndonFaultRecord>()
|
var response = Context.Queryable<AndonFaultRecord>()
|
||||||
@ -148,16 +148,14 @@ namespace DOAN.Service.MES.report
|
|||||||
LineCode = l.LineCode,
|
LineCode = l.LineCode,
|
||||||
LineName = l.LineName,
|
LineName = l.LineName,
|
||||||
PlanHours = l.PlanHours,
|
PlanHours = l.PlanHours,
|
||||||
DowntimeHours = gList.FirstOrDefault()?.DowntimeHours ?? l.PlanHours, // 如果没有停机时间则为计划时间
|
DowntimeHours = gList.FirstOrDefault()?.DowntimeHours ?? 0, // 如果没有停机时间则为0
|
||||||
DowntimeRate= Math.Round((gList.FirstOrDefault()?.DowntimeHours ?? l.PlanHours) / l.PlanHours, 2)
|
DowntimeRate = l.PlanHours == 0 ? 0 : Math.Round((gList.FirstOrDefault()?.DowntimeHours ?? 0) / l.PlanHours, 2)
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ProductionCompletionRate> ProductionCompletionRate(DateTime dateTime)
|
public List<ProductionCompletionRate> ProductionCompletionRate(DateTime dateTime)
|
||||||
{
|
{
|
||||||
//dateTime = new DateTime(2025, 11, 2);
|
|
||||||
List<ProductionCompletionRate> list = new List<ProductionCompletionRate>();
|
List<ProductionCompletionRate> list = new List<ProductionCompletionRate>();
|
||||||
|
|
||||||
var dt = dateTime.ToString("yyyy-MM-dd");
|
var dt = dateTime.ToString("yyyy-MM-dd");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user