2023-10-12
This commit is contained in:
@@ -882,12 +882,12 @@ namespace FineUIPro.Web.CQMS.ManageReport
|
||||
//当期集合
|
||||
List<Model.Comprehensive_NCRManagement> managementList = BLL.NCRManagementService.GetNCRManagementListByUnitNameAndDate(this.CurrUser.LoginProjectId, item, startDate, endDate);
|
||||
//累计集合
|
||||
List<Model.Comprehensive_NCRManagement> sumManagementList = BLL.NCRManagementService.GetNCRManagementListByUnitNameAndDate(this.CurrUser.LoginProjectId, item, projectStartDate, endDate);
|
||||
List<Model.Comprehensive_NCRManagement> sumManagementList = BLL.NCRManagementService.GetNCRManagementListByUnitNameAndDate(this.CurrUser.LoginProjectId, item, projectStartDate, DateTime.Now);
|
||||
Model.NCRReportStatisc NCRStatisc = new Model.NCRReportStatisc();
|
||||
NCRStatisc.Num = i;
|
||||
NCRStatisc.WorkName = BLL.UnitService.getUnitNamesUnitIds(item);
|
||||
NCRStatisc.CurrentPeriodOkNum = managementList.Count(x => x.CompleteDate != null);
|
||||
NCRStatisc.OKNum = sumManagementList.Count(x => x.CompleteDate != null);
|
||||
NCRStatisc.CurrentPeriodOkNum = managementList.Count(x => x.Status == "3");
|
||||
NCRStatisc.OKNum = sumManagementList.Count(x => x.Status == "3");
|
||||
NCRStatisc.CheckNum = sumManagementList.Count;
|
||||
if (NCRStatisc.CheckNum != 0)//被除数不能为零
|
||||
{
|
||||
@@ -921,6 +921,18 @@ namespace FineUIPro.Web.CQMS.ManageReport
|
||||
}
|
||||
StatisticsList.Add(StatisticsLast);
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.NCRReportStatisc StatisticsLast = new Model.NCRReportStatisc();
|
||||
StatisticsLast.Num = 0;
|
||||
StatisticsLast.WorkName = "合计";
|
||||
StatisticsLast.CurrentPeriodOkNum = 0;
|
||||
StatisticsLast.OKNum = 0;
|
||||
StatisticsLast.CheckNum = 0;
|
||||
StatisticsLast.OKRate = "0%";
|
||||
StatisticsList.Add(StatisticsLast);
|
||||
|
||||
}
|
||||
this.gvNCRStatisc.DataSource = StatisticsList;
|
||||
this.gvNCRStatisc.DataBind();
|
||||
}
|
||||
@@ -967,7 +979,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
|
||||
foreach (var item in cNProfessionals)
|
||||
{
|
||||
//专业下所有集合
|
||||
List<Model.Comprehensive_DesignChangeOrder> totalManagementList = BLL.DesignChangeOrderService.GetDesignChangeOrderListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, item.CNProfessionalId, projectStartDate, endDate);
|
||||
List<Model.Comprehensive_DesignChangeOrder> totalManagementList = BLL.DesignChangeOrderService.GetDesignChangeOrderListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, item.CNProfessionalId, projectStartDate, DateTime.Now);
|
||||
//专业下当期集合
|
||||
List<Model.Comprehensive_DesignChangeOrder> managementList = BLL.DesignChangeOrderService.GetDesignChangeOrderListByCNProfessionalIdAndDate(this.CurrUser.LoginProjectId, item.CNProfessionalId, startDate, endDate);
|
||||
Model.CheckStatisc checkStatisc = new Model.CheckStatisc();
|
||||
@@ -977,8 +989,8 @@ namespace FineUIPro.Web.CQMS.ManageReport
|
||||
checkStatisc.TotalCheckNum = totalManagementList.Count();
|
||||
checkStatisc.OKNum = managementList.Count(x => x.ApprovalDate != null);
|
||||
checkStatisc.TotalOKNum = totalManagementList.Count(x => x.ApprovalDate != null);
|
||||
checkStatisc.OneOKRate = managementList.Count(x => x.HandleState == "3").ToString(); //当期完成数
|
||||
checkStatisc.TotalOneOKRate = totalManagementList.Count(x => x.HandleState == "3").ToString(); //累计完成数
|
||||
checkStatisc.OneOKRate = managementList.Count(x => x.Status == "3").ToString(); //当期完成数
|
||||
checkStatisc.TotalOneOKRate = totalManagementList.Count(x => x.Status == "3").ToString(); //累计完成数
|
||||
if (checkStatisc.CheckNum > 0 || checkStatisc.TotalCheckNum > 0 || checkStatisc.OKNum > 0 || checkStatisc.TotalOKNum > 0)
|
||||
{
|
||||
StatisticsList.Add(checkStatisc);
|
||||
@@ -1163,24 +1175,36 @@ namespace FineUIPro.Web.CQMS.ManageReport
|
||||
UnitName=BLL.UnitService.GetUnitNameByUnitId(g.Key.UnitId),
|
||||
Count = g.Key.UnitId.Count(),
|
||||
};
|
||||
|
||||
var total = from x in db.Solution_CQMSConstructSolution
|
||||
where x.CompileDate >= projectStartDate && x.CompileDate <= DateTime.Now
|
||||
group x by new { x.UnitId, ProjectId = x.ProjectId == project.ProjectId }
|
||||
into g
|
||||
select new
|
||||
{
|
||||
UnitName = BLL.UnitService.GetUnitNameByUnitId(g.Key.UnitId),
|
||||
Count = g.Key.UnitId.Count(),
|
||||
};
|
||||
var result = q.ToList().Select((item, index) => new
|
||||
{
|
||||
Index = index + 1,
|
||||
item.UnitName,
|
||||
item.Count
|
||||
item.Count,
|
||||
AllCount= (int)total.ToList().Where(x => x.UnitName == item.UnitName).Select(x=>x.Count).FirstOrDefault()
|
||||
|
||||
});
|
||||
if (result.Count()>0) //增加总计
|
||||
{
|
||||
int totalCount = result.Sum(item => item.Count);
|
||||
int totalAllCount = result.Sum(item => item.AllCount);
|
||||
result = result.Concat(new[]
|
||||
{
|
||||
new
|
||||
{
|
||||
Index = result.Count() + 1,
|
||||
UnitName = "合计",
|
||||
Count = totalCount
|
||||
|
||||
Count = totalCount,
|
||||
AllCount= totalAllCount
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1194,7 +1218,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.Header)
|
||||
{
|
||||
string headerStr = "序号#报审单位#完成数量";
|
||||
string headerStr = "序号#报审单位#审批完成数量#总数量";
|
||||
DynamicTHeaderHepler dHelper = new DynamicTHeaderHepler();
|
||||
dHelper.SplitTableHeader(e.Row, headerStr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user