Merge branch 'master' of https://gitee.com/doan-tech/zhuangpei-mesbackend
This commit is contained in:
commit
e62daf0749
@ -224,9 +224,44 @@ namespace DOAN.Service.MES.bigScreen
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 本月工单达成率
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public EchartsOptions GetMoudle06()
|
||||
{
|
||||
return null;
|
||||
// 获取当前日期
|
||||
DateTime today = DateTime.Today;
|
||||
|
||||
// 获取当前月的第一天
|
||||
DateTime firstDayOfMonth = new DateTime(today.Year, today.Month, 1);
|
||||
|
||||
// 获取当前月的最后一天
|
||||
DateTime lastDayOfMonth = new DateTime(today.Year, today.Month, DateTime.DaysInMonth(today.Year, today.Month));
|
||||
|
||||
EchartsOptions echartsOptions = new EchartsOptions();
|
||||
EchartsTitle Title=new EchartsTitle("本月工单达成率","本月工单达成率");
|
||||
echartsOptions.Title = Title;
|
||||
EchartsSeries pieSeries = new EchartsSeries();
|
||||
pieSeries.Name = "本月工单达成率";
|
||||
pieSeries.Type = "bar";
|
||||
//达成
|
||||
int Reached= Context.Queryable<ProReportwork>()
|
||||
.Where(it => it.CreatedTime >= firstDayOfMonth && it.CreatedTime <= lastDayOfMonth)
|
||||
.Where(it => it.DispatchNum <= it.FinishedNum).Count();
|
||||
//不达成
|
||||
int UnReached= Context.Queryable<ProReportwork>()
|
||||
.Where(it => it.CreatedTime >= firstDayOfMonth && it.CreatedTime <= lastDayOfMonth)
|
||||
.Where(it => it.DispatchNum > it.FinishedNum).Count();
|
||||
List<EchartsSeriesData> Data = new List<EchartsSeriesData>()
|
||||
{
|
||||
new EchartsSeriesData() { Name = "达成", Value = Reached },
|
||||
new EchartsSeriesData() { Name = "不达成", Value = UnReached },
|
||||
};
|
||||
pieSeries.Data=Data;
|
||||
echartsOptions.Series = new List<EchartsSeries>() { pieSeries };
|
||||
return echartsOptions;
|
||||
}
|
||||
|
||||
public EchartsOptions GetMoudle07()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user