本月 报工不满原因 top10
This commit is contained in:
parent
cf5da7b057
commit
d9d3c0b861
@ -126,6 +126,17 @@ namespace DOAN.WebApi.Controllers.MES.BigScreen
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 本月 报工不满原因 top10
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getMoudle77")]
|
||||
public IActionResult GetMoudle77()
|
||||
{
|
||||
var response = productBigScreenService.GetMoudle77();
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("getMoudle08")]
|
||||
public IActionResult GetMoudle08()
|
||||
|
||||
@ -16,5 +16,7 @@ public interface IProduct2BigScreenService : IBaseService<ProWorkorder>
|
||||
List<TodayExceptionWorkOrder> GetMoudle05();
|
||||
EchartsOptions GetMoudle06();
|
||||
EchartsOptions GetMoudle07();
|
||||
EchartsOptions GetMoudle77();
|
||||
|
||||
EchartsOptions GetMoudle08();
|
||||
}
|
||||
@ -387,6 +387,50 @@ namespace DOAN.Service.MES.bigScreen
|
||||
return echartsOptions;
|
||||
}
|
||||
|
||||
//本月 报工不满原因 top10
|
||||
public EchartsOptions GetMoudle77()
|
||||
{
|
||||
// 获取当前日期
|
||||
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("本月 报工不满原因 top10", "本月 报工不满原因 top10");
|
||||
echartsOptions.Title = Title;
|
||||
|
||||
EchartsSeries LineSeries = new EchartsSeries();
|
||||
LineSeries.Name = "本月报工不满原因top10";
|
||||
LineSeries.Type = "bar";
|
||||
|
||||
LineSeries.Data = Context.Queryable<ProWorkorder>()
|
||||
.LeftJoin<ProReportwork>((it, wr) => it.Workorder == wr.FkWorkorder)
|
||||
.Where((it, wr) => it.WorkorderDate >= firstDayOfMonth && it.WorkorderDate <= lastDayOfMonth.AddDays(1))
|
||||
.GroupBy((it, wr) => wr.UnfinishedReanson)
|
||||
.Select((it, wr) => new EchartsSeriesData()
|
||||
{
|
||||
Name = wr.UnfinishedReanson,
|
||||
Value = SqlFunc.AggregateCount(wr.UnfinishedReanson)
|
||||
})
|
||||
.MergeTable()
|
||||
.OrderByDescending(it => it.Value)
|
||||
.Take(10).ToList();
|
||||
;
|
||||
|
||||
|
||||
echartsOptions.Series = new List<EchartsSeries>() { LineSeries };
|
||||
|
||||
EchartsYAxis YAxis = new EchartsYAxis();
|
||||
YAxis.Data = LineSeries.Data.Select(it => it.Name).ToList();
|
||||
echartsOptions.YAxis = YAxis;
|
||||
|
||||
return echartsOptions;
|
||||
}
|
||||
|
||||
public EchartsOptions GetMoudle08()
|
||||
{
|
||||
// 获取当前日期
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user