1212
This commit is contained in:
@@ -58,11 +58,34 @@ namespace FineUIPro.Web.Transfer.Chart
|
||||
rowTime["日期"] = QueryTime.ToString("yyyy/MM/dd");
|
||||
DateTime startTime = Convert.ToDateTime(QueryTime.ToString("yyyy-MM-dd") + " 00:00:00");
|
||||
DateTime endTime = Convert.ToDateTime(QueryTime.ToString("yyyy-MM-dd") + " 23:59:59");
|
||||
rowTime["计划完成数量"] = forms.Where(x => x.Required_Date >= startTime && x.Required_Date <= endTime).Count();
|
||||
rowTime["实际完成数量"] = forms.Where(x => x.Actual_Date >= startTime && x.Actual_Date <= endTime).Count();
|
||||
//rowTime["计划完成数量"] = forms.Where(x => x.Required_Date >= startTime && x.Required_Date <= endTime).Count();
|
||||
//rowTime["实际完成数量"] = forms.Where(x => x.Actual_Date >= startTime && x.Actual_Date <= endTime).Count();
|
||||
rowTime["计划完成数量"] = forms.Where(x => x.Required_Date <= endTime).Count();
|
||||
rowTime["实际完成数量"] = forms.Where(x => x.Actual_Date <= endTime).Count();
|
||||
dtTime.Rows.Add(rowTime);
|
||||
}
|
||||
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "尾项完成统计分析", this.drpChartType.SelectedValue, 1300, 550, false));
|
||||
|
||||
///按单位统计
|
||||
DataTable dtTime1 = new DataTable();
|
||||
dtTime1.Columns.Add("日期", typeof(string));
|
||||
dtTime1.Columns.Add("计划完成百分比(%)", typeof(string));
|
||||
dtTime1.Columns.Add("实际完成百分比(%)", typeof(string));
|
||||
for (int i = 6; i >= 0; i--)
|
||||
{
|
||||
DataRow rowTime = dtTime1.NewRow();
|
||||
DateTime QueryTime = DateTime.Now.AddDays(i * -1);
|
||||
rowTime["日期"] = QueryTime.ToString("yyyy/MM/dd");
|
||||
DateTime startTime = Convert.ToDateTime(QueryTime.ToString("yyyy-MM-dd") + " 00:00:00");
|
||||
DateTime endTime = Convert.ToDateTime(QueryTime.ToString("yyyy-MM-dd") + " 23:59:59");
|
||||
double jhCount = forms.Where(x => x.Required_Date <= endTime).Count();
|
||||
double sjCount = forms.Where(x => x.Actual_Date <= endTime).Count();
|
||||
double allCount = forms.Count();
|
||||
rowTime["计划完成百分比(%)"] = allCount == 0 ? "0.00" : (jhCount / allCount * 100).ToString("0.00");
|
||||
rowTime["实际完成百分比(%)"] = allCount == 0 ? "0.00" : (sjCount / allCount * 100).ToString("0.00");
|
||||
dtTime1.Rows.Add(rowTime);
|
||||
}
|
||||
this.ChartAccidentTime1.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime1, "尾项完成统计分析", this.drpChartType.SelectedValue, 1300, 550, false));
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -81,11 +104,34 @@ namespace FineUIPro.Web.Transfer.Chart
|
||||
rowTime["月份"] = QueryTime.ToString("yyyy/MM");
|
||||
DateTime startTime = QueryTime;
|
||||
DateTime endTime = Convert.ToDateTime(QueryTime.AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd") + " 23:59:59");
|
||||
rowTime["计划完成数量"] = forms.Where(x => x.Required_Date >= startTime && x.Required_Date <= endTime).Count();
|
||||
rowTime["实际完成数量"] = forms.Where(x => x.Actual_Date >= startTime && x.Actual_Date <= endTime).Count();
|
||||
//rowTime["计划完成数量"] = forms.Where(x => x.Required_Date >= startTime && x.Required_Date <= endTime).Count();
|
||||
//rowTime["实际完成数量"] = forms.Where(x => x.Actual_Date >= startTime && x.Actual_Date <= endTime).Count();
|
||||
rowTime["计划完成数量"] = forms.Where(x => x.Required_Date <= endTime).Count();
|
||||
rowTime["实际完成数量"] = forms.Where(x => x.Actual_Date <= endTime).Count();
|
||||
dtTime.Rows.Add(rowTime);
|
||||
}
|
||||
this.ChartAccidentTime.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime, "尾项完成统计分析", this.drpChartType.SelectedValue, 1300, 550, false));
|
||||
|
||||
///按单位统计
|
||||
DataTable dtTime1 = new DataTable();
|
||||
dtTime1.Columns.Add("月份", typeof(string));
|
||||
dtTime1.Columns.Add("计划完成百分比(%)", typeof(string));
|
||||
dtTime1.Columns.Add("实际完成百分比(%)", typeof(string));
|
||||
for (int i = 1; i <= DateTime.Now.Month; i++)
|
||||
{
|
||||
DataRow rowTime = dtTime1.NewRow();
|
||||
DateTime QueryTime = Convert.ToDateTime($"{DateTime.Now.Year.ToString()}-{i}-1 00:00:00");
|
||||
rowTime["月份"] = QueryTime.ToString("yyyy/MM");
|
||||
DateTime startTime = QueryTime;
|
||||
DateTime endTime = Convert.ToDateTime(QueryTime.AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd") + " 23:59:59");
|
||||
double jhCount = forms.Where(x => x.Required_Date <= endTime).Count();
|
||||
double sjCount = forms.Where(x => x.Actual_Date <= endTime).Count();
|
||||
double allCount = forms.Count();
|
||||
rowTime["计划完成百分比(%)"] = allCount == 0 ? "0.00" : (jhCount / allCount * 100).ToString("0.00");
|
||||
rowTime["实际完成百分比(%)"] = allCount == 0 ? "0.00" : (sjCount / allCount * 100).ToString("0.00");
|
||||
dtTime1.Rows.Add(rowTime);
|
||||
}
|
||||
this.ChartAccidentTime1.CreateChart(BLL.ChartControlService.GetDataSourceChart(dtTime1, "尾项完成统计分析", this.drpChartType.SelectedValue, 1300, 550, false));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user