2023-10-26
This commit is contained in:
parent
5fb9c49964
commit
a2acdd4259
Binary file not shown.
|
@ -3,11 +3,14 @@ using System.Collections.Generic;
|
|||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Runtime.Remoting.Metadata.W3cXsd2001;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using BLL;
|
||||
using FineUIPro.Web.DataShow;
|
||||
using Model;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using SgManager.AI;
|
||||
using AspNet = System.Web.UI.WebControls;
|
||||
namespace FineUIPro.Web.CQMS.ManageReport
|
||||
|
@ -895,21 +898,42 @@ namespace FineUIPro.Web.CQMS.ManageReport
|
|||
{
|
||||
projectStartDate = project.StartDate.Value;
|
||||
}
|
||||
//所有集合
|
||||
List<Model.Comprehensive_NCRManagement> totalManagementList = BLL.NCRManagementService.GetNCRManagementListByDate(this.CurrUser.LoginProjectId, startDate, endDate);
|
||||
List<string> unitNames = (from x in totalManagementList select x.ReceiveUnit).Distinct().ToList();
|
||||
foreach (var item in unitNames)
|
||||
var units = from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitType == BLL.Const.ProjectUnitType_2
|
||||
orderby y.UnitCode
|
||||
select new { x.UnitId, y.UnitName };
|
||||
var db = Funs.DB;
|
||||
foreach (var item in units)
|
||||
{
|
||||
//当期集合
|
||||
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, DateTime.Now);
|
||||
|
||||
var query = from c in db.Comprehensive_NCRManagement
|
||||
|
||||
join u in db.Base_Unit on c.ReceiveUnit equals u.UnitId into unitJoin
|
||||
|
||||
from u in unitJoin.DefaultIfEmpty()
|
||||
where c.ProjectId == this.CurrUser.LoginProjectId && c.ReceiveUnit == item.UnitId
|
||||
select new
|
||||
|
||||
{
|
||||
c.NCRManagementId,
|
||||
c.ProjectId,
|
||||
u.UnitId,
|
||||
u.UnitName,
|
||||
c.IssuedDate,
|
||||
c.Status
|
||||
|
||||
};
|
||||
|
||||
var AllList = query.ToList();
|
||||
var unitNCRStatic = query
|
||||
.Where(x => (x.IssuedDate >= Convert.ToDateTime(startDate) && x.IssuedDate <= Convert.ToDateTime(endDate)));
|
||||
Model.NCRReportStatisc NCRStatisc = new Model.NCRReportStatisc();
|
||||
NCRStatisc.Num = i;
|
||||
NCRStatisc.WorkName = BLL.UnitService.getUnitNamesUnitIds(item);
|
||||
NCRStatisc.CurrentPeriodOkNum = managementList.Count(x => x.Status == "3");
|
||||
NCRStatisc.OKNum = sumManagementList.Count(x => x.Status == "3");
|
||||
NCRStatisc.CheckNum = sumManagementList.Count;
|
||||
NCRStatisc.WorkName = item.UnitName;
|
||||
NCRStatisc.CurrentPeriodOkNum = unitNCRStatic.Count(x => x.Status == "3" );
|
||||
NCRStatisc.OKNum = AllList.Count(x => x.Status == "3");
|
||||
NCRStatisc.CheckNum = AllList.Count();
|
||||
if (NCRStatisc.CheckNum != 0)//被除数不能为零
|
||||
{
|
||||
NCRStatisc.OKRate = Math.Round((double)NCRStatisc.OKNum / (double)NCRStatisc.CheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
|
@ -1179,7 +1203,8 @@ namespace FineUIPro.Web.CQMS.ManageReport
|
|||
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
||||
DateTime projectStartDate = Convert.ToDateTime("2015-01-01");
|
||||
Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
|
||||
var unitList= UnitService.GetUnitListByProjectId(this.CurrUser.LoginProjectId).Select(x=>x.UnitId).ToList();
|
||||
List<Model.CQMSConstructSolutionStatisc> StatisticsList = new List<Model.CQMSConstructSolutionStatisc>();
|
||||
var unitList= UnitService.GetUnitListByProjectId(this.CurrUser.LoginProjectId).Select(x=>x.UnitId).ToList();
|
||||
if (project != null)
|
||||
{
|
||||
if (project.StartDate != null)
|
||||
|
@ -1187,51 +1212,129 @@ namespace FineUIPro.Web.CQMS.ManageReport
|
|||
projectStartDate = Convert.ToDateTime(project.StartDate);
|
||||
}
|
||||
}
|
||||
int i = 1;
|
||||
var q = from x in db.Solution_CQMSConstructSolution
|
||||
where x.CompileDate >= Convert.ToDateTime(startDate) && x.CompileDate <= Convert.ToDateTime(endDate) && unitList.Contains(x.UnitId) &&x.ProjectId==this.CurrUser.LoginProjectId
|
||||
group x by new { x.UnitId, State = x.State == "3", ProjectId = x.ProjectId == project.ProjectId }
|
||||
into g
|
||||
select new
|
||||
{
|
||||
UnitName=BLL.UnitService.GetUnitNameByUnitId(g.Key.UnitId),
|
||||
Count = g.Key.UnitId.Count(),
|
||||
};
|
||||
int i = 1;
|
||||
var units = from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitType == BLL.Const.ProjectUnitType_2
|
||||
orderby y.UnitCode
|
||||
select new { x.UnitId, y.UnitName };
|
||||
|
||||
var total = from x in db.Solution_CQMSConstructSolution
|
||||
where x.CompileDate >= projectStartDate && x.CompileDate <= DateTime.Now && unitList.Contains(x.UnitId) && x.ProjectId == this.CurrUser.LoginProjectId
|
||||
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
|
||||
foreach (var item in units)
|
||||
{
|
||||
Index = index + 1,
|
||||
item.UnitName,
|
||||
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
|
||||
var query = from c in db.Solution_CQMSConstructSolution
|
||||
|
||||
join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
||||
|
||||
from u in unitJoin.DefaultIfEmpty()
|
||||
|
||||
where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
|
||||
select new
|
||||
|
||||
{
|
||||
Index = result.Count() + 1,
|
||||
UnitName = "合计",
|
||||
Count = totalCount,
|
||||
AllCount= totalAllCount
|
||||
}
|
||||
});
|
||||
c.ConstructSolutionId,
|
||||
c.ProjectId,
|
||||
u.UnitId,
|
||||
u.UnitName,
|
||||
c.State,
|
||||
c.CompileDate
|
||||
|
||||
};
|
||||
|
||||
var AllList = query.ToList();
|
||||
var unitNCRStatic = query
|
||||
.Where(x => (x.CompileDate >= Convert.ToDateTime(startDate) && x.CompileDate <= Convert.ToDateTime(endDate)));
|
||||
Model.CQMSConstructSolutionStatisc NCRStatisc = new Model.CQMSConstructSolutionStatisc();
|
||||
NCRStatisc.Num = i;
|
||||
NCRStatisc.UnitName = item.UnitName;
|
||||
NCRStatisc.CheckNum = unitNCRStatic.Count(x => x.State == "3");
|
||||
NCRStatisc.AllNum = AllList.Count();
|
||||
|
||||
StatisticsList.Add(NCRStatisc);
|
||||
i++;
|
||||
}
|
||||
if (StatisticsList.Count() > 0) //增加总计
|
||||
{
|
||||
Model.CQMSConstructSolutionStatisc StatisticsLast = new Model.CQMSConstructSolutionStatisc();
|
||||
StatisticsLast.Num = StatisticsList.Count() + 1;
|
||||
StatisticsLast.UnitName = "合计";
|
||||
foreach (Model.CQMSConstructSolutionStatisc item in StatisticsList)
|
||||
{
|
||||
StatisticsLast.CheckNum += item.CheckNum;
|
||||
StatisticsLast.AllNum += item.AllNum;
|
||||
}
|
||||
|
||||
StatisticsList.Add(StatisticsLast);
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.CQMSConstructSolutionStatisc StatisticsLast = new Model.CQMSConstructSolutionStatisc();
|
||||
StatisticsLast.Num = 0;
|
||||
StatisticsLast.UnitName = "合计";
|
||||
StatisticsLast.CheckNum = 0;
|
||||
StatisticsLast.AllNum = 0;
|
||||
StatisticsList.Add(StatisticsLast);
|
||||
|
||||
}
|
||||
|
||||
this.gvConstructionStatistics.DataSource = result;
|
||||
//var q = from x in db.Solution_CQMSConstructSolution
|
||||
// join y in units on x.UnitId equals y.UnitId
|
||||
// where x.CompileDate >= Convert.ToDateTime(startDate) && x.CompileDate <= Convert.ToDateTime(endDate) && unitList.Contains(x.UnitId) &&x.ProjectId==this.CurrUser.LoginProjectId
|
||||
// group x by new { x.UnitId, State = x.State == "3", ProjectId = x.ProjectId == project.ProjectId }
|
||||
// into g
|
||||
// select new
|
||||
// {
|
||||
// UnitName=BLL.UnitService.GetUnitNameByUnitId(g.Key.UnitId),
|
||||
// Count = g.Key.UnitId.Count(),
|
||||
// };
|
||||
|
||||
//var total = from x in db.Solution_CQMSConstructSolution
|
||||
// join y in units on x.UnitId equals y.UnitId
|
||||
// where x.CompileDate >= projectStartDate && x.CompileDate <= DateTime.Now && unitList.Contains(x.UnitId) && x.ProjectId == this.CurrUser.LoginProjectId
|
||||
// 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 total = from x in units
|
||||
// join y in db.Solution_CQMSConstructSolution on x.UnitId equals y.UnitId into unitJoin
|
||||
// from u in unitJoin.DefaultIfEmpty()
|
||||
// where u.ProjectId == this.CurrUser.LoginProjectId
|
||||
// select new
|
||||
// {
|
||||
// UnitName= x.UnitName,
|
||||
// u.ConstructSolutionId,
|
||||
// u.CompileDate
|
||||
|
||||
// };
|
||||
//var result = total.ToList().Select((item, index) => new
|
||||
//{
|
||||
// Index = index + 1,
|
||||
// item.UnitName,
|
||||
// Count = (int)total.ToList().Where(x => x.UnitName == item.UnitName && x.CompileDate >= Convert.ToDateTime(startDate) && x.CompileDate <= Convert.ToDateTime(endDate)).Count(),
|
||||
// AllCount = (int)total.ToList().Where(x => x.UnitName == item.UnitName).Count()
|
||||
|
||||
//});
|
||||
//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,
|
||||
// AllCount= totalAllCount
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
|
||||
this.gvConstructionStatistics.DataSource = StatisticsList;
|
||||
this.gvConstructionStatistics.DataBind();
|
||||
|
||||
}
|
||||
|
|
|
@ -893,21 +893,42 @@ namespace FineUIPro.Web.CQMS.ManageReport
|
|||
{
|
||||
projectStartDate = project.StartDate.Value;
|
||||
}
|
||||
//所有集合
|
||||
List<Model.Comprehensive_NCRManagement> totalManagementList = BLL.NCRManagementService.GetNCRManagementListByDate(this.CurrUser.LoginProjectId, startDate, endDate);
|
||||
List<string> unitNames = (from x in totalManagementList select x.ReceiveUnit).Distinct().ToList();
|
||||
foreach (var item in unitNames)
|
||||
var units = from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitType == BLL.Const.ProjectUnitType_2
|
||||
orderby y.UnitCode
|
||||
select new { x.UnitId, y.UnitName };
|
||||
var db = Funs.DB;
|
||||
foreach (var item in units)
|
||||
{
|
||||
//当期集合
|
||||
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, DateTime.Now);
|
||||
|
||||
var query = from c in db.Comprehensive_NCRManagement
|
||||
|
||||
join u in db.Base_Unit on c.ReceiveUnit equals u.UnitId into unitJoin
|
||||
|
||||
from u in unitJoin.DefaultIfEmpty()
|
||||
where c.ProjectId == this.CurrUser.LoginProjectId && c.ReceiveUnit == item.UnitId
|
||||
select new
|
||||
|
||||
{
|
||||
c.NCRManagementId,
|
||||
c.ProjectId,
|
||||
u.UnitId,
|
||||
u.UnitName,
|
||||
c.IssuedDate,
|
||||
c.Status
|
||||
|
||||
};
|
||||
|
||||
var AllList = query.ToList();
|
||||
var unitNCRStatic = query
|
||||
.Where(x => (x.IssuedDate >= Convert.ToDateTime(startDate) && x.IssuedDate <= Convert.ToDateTime(endDate)));
|
||||
Model.NCRReportStatisc NCRStatisc = new Model.NCRReportStatisc();
|
||||
NCRStatisc.Num = i;
|
||||
NCRStatisc.WorkName = BLL.UnitService.getUnitNamesUnitIds(item);
|
||||
NCRStatisc.CurrentPeriodOkNum = managementList.Count(x => x.Status == "3");
|
||||
NCRStatisc.OKNum = sumManagementList.Count(x => x.Status == "3");
|
||||
NCRStatisc.CheckNum = sumManagementList.Count;
|
||||
NCRStatisc.WorkName = item.UnitName;
|
||||
NCRStatisc.CurrentPeriodOkNum = unitNCRStatic.Count(x => x.Status == "3");
|
||||
NCRStatisc.OKNum = AllList.Count(x => x.Status == "3");
|
||||
NCRStatisc.CheckNum = AllList.Count();
|
||||
if (NCRStatisc.CheckNum != 0)//被除数不能为零
|
||||
{
|
||||
NCRStatisc.OKRate = Math.Round((double)NCRStatisc.OKNum / (double)NCRStatisc.CheckNum * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
|
@ -1177,6 +1198,7 @@ namespace FineUIPro.Web.CQMS.ManageReport
|
|||
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
||||
DateTime projectStartDate = Convert.ToDateTime("2015-01-01");
|
||||
Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
|
||||
List<Model.CQMSConstructSolutionStatisc> StatisticsList = new List<Model.CQMSConstructSolutionStatisc>();
|
||||
var unitList = UnitService.GetUnitListByProjectId(this.CurrUser.LoginProjectId).Select(x => x.UnitId).ToList();
|
||||
if (project != null)
|
||||
{
|
||||
|
@ -1186,50 +1208,128 @@ namespace FineUIPro.Web.CQMS.ManageReport
|
|||
}
|
||||
}
|
||||
int i = 1;
|
||||
var q = from x in db.Solution_CQMSConstructSolution
|
||||
where x.CompileDate >= Convert.ToDateTime(startDate) && x.CompileDate <= Convert.ToDateTime(endDate) && unitList.Contains(x.UnitId) && x.ProjectId == this.CurrUser.LoginProjectId
|
||||
group x by new { x.UnitId, State = x.State == "3", ProjectId = x.ProjectId == project.ProjectId }
|
||||
into g
|
||||
select new
|
||||
{
|
||||
UnitName = BLL.UnitService.GetUnitNameByUnitId(g.Key.UnitId),
|
||||
Count = g.Key.UnitId.Count(),
|
||||
};
|
||||
var units = from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitType == BLL.Const.ProjectUnitType_2
|
||||
orderby y.UnitCode
|
||||
select new { x.UnitId, y.UnitName };
|
||||
|
||||
var total = from x in db.Solution_CQMSConstructSolution
|
||||
where x.CompileDate >= projectStartDate && x.CompileDate <= DateTime.Now && unitList.Contains(x.UnitId) && x.ProjectId == this.CurrUser.LoginProjectId
|
||||
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
|
||||
foreach (var item in units)
|
||||
{
|
||||
Index = index + 1,
|
||||
item.UnitName,
|
||||
item.Count,
|
||||
AllCount = (int)total.ToList().Where(x => x.UnitName == item.UnitName).Select(x => x.Count).FirstOrDefault()
|
||||
|
||||
});
|
||||
if (result.Count() > 0) //增加总计
|
||||
var query = from c in db.Solution_CQMSConstructSolution
|
||||
|
||||
join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
||||
|
||||
from u in unitJoin.DefaultIfEmpty()
|
||||
|
||||
where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
|
||||
select new
|
||||
|
||||
{
|
||||
c.ConstructSolutionId,
|
||||
c.ProjectId,
|
||||
u.UnitId,
|
||||
u.UnitName,
|
||||
c.State,
|
||||
c.CompileDate
|
||||
|
||||
};
|
||||
|
||||
var AllList = query.ToList();
|
||||
var unitNCRStatic = query
|
||||
.Where(x => (x.CompileDate >= Convert.ToDateTime(startDate) && x.CompileDate <= Convert.ToDateTime(endDate)));
|
||||
Model.CQMSConstructSolutionStatisc NCRStatisc = new Model.CQMSConstructSolutionStatisc();
|
||||
NCRStatisc.Num = i;
|
||||
NCRStatisc.UnitName = item.UnitName;
|
||||
NCRStatisc.CheckNum = unitNCRStatic.Count(x => x.State == "3");
|
||||
NCRStatisc.AllNum = AllList.Count();
|
||||
|
||||
StatisticsList.Add(NCRStatisc);
|
||||
i++;
|
||||
}
|
||||
if (StatisticsList.Count() > 0) //增加总计
|
||||
{
|
||||
int totalCount = result.Sum(item => item.Count);
|
||||
int totalAllCount = result.Sum(item => item.AllCount);
|
||||
result = result.Concat(new[]
|
||||
Model.CQMSConstructSolutionStatisc StatisticsLast = new Model.CQMSConstructSolutionStatisc();
|
||||
StatisticsLast.Num = StatisticsList.Count() + 1;
|
||||
StatisticsLast.UnitName = "合计";
|
||||
foreach (Model.CQMSConstructSolutionStatisc item in StatisticsList)
|
||||
{
|
||||
new
|
||||
{
|
||||
Index = result.Count() + 1,
|
||||
UnitName = "合计",
|
||||
Count = totalCount,
|
||||
AllCount= totalAllCount
|
||||
}
|
||||
});
|
||||
StatisticsLast.CheckNum += item.CheckNum;
|
||||
StatisticsLast.AllNum += item.AllNum;
|
||||
}
|
||||
|
||||
StatisticsList.Add(StatisticsLast);
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.CQMSConstructSolutionStatisc StatisticsLast = new Model.CQMSConstructSolutionStatisc();
|
||||
StatisticsLast.Num = 0;
|
||||
StatisticsLast.UnitName = "合计";
|
||||
StatisticsLast.CheckNum = 0;
|
||||
StatisticsLast.AllNum = 0;
|
||||
StatisticsList.Add(StatisticsLast);
|
||||
|
||||
}
|
||||
|
||||
this.gvConstructionStatistics.DataSource = result;
|
||||
//var q = from x in db.Solution_CQMSConstructSolution
|
||||
// join y in units on x.UnitId equals y.UnitId
|
||||
// where x.CompileDate >= Convert.ToDateTime(startDate) && x.CompileDate <= Convert.ToDateTime(endDate) && unitList.Contains(x.UnitId) &&x.ProjectId==this.CurrUser.LoginProjectId
|
||||
// group x by new { x.UnitId, State = x.State == "3", ProjectId = x.ProjectId == project.ProjectId }
|
||||
// into g
|
||||
// select new
|
||||
// {
|
||||
// UnitName=BLL.UnitService.GetUnitNameByUnitId(g.Key.UnitId),
|
||||
// Count = g.Key.UnitId.Count(),
|
||||
// };
|
||||
|
||||
//var total = from x in db.Solution_CQMSConstructSolution
|
||||
// join y in units on x.UnitId equals y.UnitId
|
||||
// where x.CompileDate >= projectStartDate && x.CompileDate <= DateTime.Now && unitList.Contains(x.UnitId) && x.ProjectId == this.CurrUser.LoginProjectId
|
||||
// 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 total = from x in units
|
||||
// join y in db.Solution_CQMSConstructSolution on x.UnitId equals y.UnitId into unitJoin
|
||||
// from u in unitJoin.DefaultIfEmpty()
|
||||
// where u.ProjectId == this.CurrUser.LoginProjectId
|
||||
// select new
|
||||
// {
|
||||
// UnitName= x.UnitName,
|
||||
// u.ConstructSolutionId,
|
||||
// u.CompileDate
|
||||
|
||||
// };
|
||||
//var result = total.ToList().Select((item, index) => new
|
||||
//{
|
||||
// Index = index + 1,
|
||||
// item.UnitName,
|
||||
// Count = (int)total.ToList().Where(x => x.UnitName == item.UnitName && x.CompileDate >= Convert.ToDateTime(startDate) && x.CompileDate <= Convert.ToDateTime(endDate)).Count(),
|
||||
// AllCount = (int)total.ToList().Where(x => x.UnitName == item.UnitName).Count()
|
||||
|
||||
//});
|
||||
//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,
|
||||
// AllCount= totalAllCount
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
|
||||
this.gvConstructionStatistics.DataSource = StatisticsList;
|
||||
this.gvConstructionStatistics.DataBind();
|
||||
|
||||
}
|
||||
|
|
|
@ -15092,12 +15092,14 @@
|
|||
</Compile>
|
||||
<Compile Include="TestRun\BeforeTestRun\TailTermHandle.aspx.cs">
|
||||
<DependentUpon>TailTermHandle.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TestRun\BeforeTestRun\TailTermHandle.aspx.designer.cs">
|
||||
<DependentUpon>TailTermHandle.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TestRun\BeforeTestRun\TailTermHandleList.aspx.cs">
|
||||
<DependentUpon>TailTermHandleList.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TestRun\BeforeTestRun\TailTermHandleList.aspx.designer.cs">
|
||||
<DependentUpon>TailTermHandleList.aspx</DependentUpon>
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
namespace Model
|
||||
{
|
||||
public class CQMSConstructSolutionStatisc
|
||||
{
|
||||
private int num;
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
public int Num
|
||||
{
|
||||
get { return num; }
|
||||
set { num = value; }
|
||||
}
|
||||
|
||||
private string unitName;
|
||||
/// <summary>
|
||||
/// 接收单位
|
||||
/// </summary>
|
||||
public string UnitName
|
||||
{
|
||||
get { return unitName; }
|
||||
set { unitName = value; }
|
||||
}
|
||||
|
||||
private int checkNum;
|
||||
/// <summary>
|
||||
/// 审批完成数
|
||||
/// </summary>
|
||||
public int CheckNum
|
||||
{
|
||||
get { return checkNum; }
|
||||
set { checkNum = value; }
|
||||
}
|
||||
|
||||
private int allNum;
|
||||
/// <summary>
|
||||
/// 已完成
|
||||
/// </summary>
|
||||
public int AllNum
|
||||
{
|
||||
get { return allNum; }
|
||||
set { allNum = value; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -170,6 +170,7 @@
|
|||
<Compile Include="CostControlDetailItem.cs" />
|
||||
<Compile Include="CQMS\CheckItem.cs" />
|
||||
<Compile Include="CQMS\CheckStatisc.cs" />
|
||||
<Compile Include="CQMS\CQMSConstructSolutionStatisc.cs" />
|
||||
<Compile Include="CQMS\FileCabinetItem.cs" />
|
||||
<Compile Include="CQMS\InspectionManagementStatistics.cs" />
|
||||
<Compile Include="CQMS\NCRReportStatisc.cs" />
|
||||
|
|
Loading…
Reference in New Issue