公司级增加项目筛选,开车看板修改

This commit is contained in:
2024-09-11 10:36:09 +08:00
parent d8567707cd
commit bedf5d3bdf
14 changed files with 2268 additions and 710 deletions
+459 -175
View File
@@ -18,6 +18,12 @@ namespace FineUIPro.Web.common
protected string hjallNumber = "0";
protected string hjfinishNumber = "0";
protected string hjzgl = "0";
/// <summary>
/// 公司级项目筛选
/// </summary>
public string[] pids { get; set; }
/// <summary>
/// 页面加载
/// </summary>
@@ -27,6 +33,10 @@ namespace FineUIPro.Web.common
{
if (!IsPostBack)
{
if (!string.IsNullOrEmpty(CurrUser.CompanyProjectId))
{
pids = CurrUser.CompanyProjectId.Split(',');
}
ProjectService.InitProjectShortNameByStateDropDownList(this.drpProject, this.CurrUser.UserId, BLL.Const.ProjectState_1, false);
if (this.drpProject.Items.Count > 0)
{
@@ -121,78 +131,139 @@ namespace FineUIPro.Web.common
/// 获取项目部人数
/// </summary>
/// <returns></returns>
public static int GetProjectPersonNum()
public int GetProjectPersonNum()
{
int result = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where y.IsCQMS == true && x.IsUsed == true
select x).Count();
return result;
if (pids == null)
{
int result = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where y.IsCQMS == true && x.IsUsed == true
select x).Count();
return result;
}
else {
int result = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where y.IsCQMS == true && x.IsUsed == true && pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
/// <summary>
/// 获取在用计量器具数
/// </summary>
/// <returns></returns>
public static int GetUseNum()
public int GetUseNum()
{
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
where x.IsOnSite == true && x.InspectionType.Contains("计量")
select x).Count();
return result;
if (pids == null)
{
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
where x.IsOnSite == true && x.InspectionType.Contains("计量")
select x).Count();
return result;
}
else {
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
where x.IsOnSite == true && x.InspectionType.Contains("计量") && pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
/// <summary>
/// 获取校准合格数
/// </summary>
/// <returns></returns>
public static int GetOKNum()
public int GetOKNum()
{
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
where x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true
select x).Count();
return result;
if (pids == null)
{
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
where x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true
select x).Count();
return result;
}
else {
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
where x.IsOnSite == true && x.InspectionType.Contains("计量") && x.IsCheckOK == true && pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
/// <summary>
/// 机械预警
/// </summary>
/// <returns></returns>
public static int GetJxyjNum()
public int GetJxyjNum()
{
int result = 0;
//机具报验的到期提醒和过期提醒记录数加一起
//机具报验的到期提醒数
//var num1 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && DateTime.Now < x.NextTestDate
// && ((DateTime)x.NextTestDate).AddDays(-15) < DateTime.Now).Count();
//过期提醒记录数
var num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate < DateTime.Now).Count();
//result = num1 + num2;
result = num2;
return result;
if (pids == null)
{
int result = 0;
//机具报验的到期提醒和过期提醒记录数加一起
//机具报验的到期提醒数
//var num1 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && DateTime.Now < x.NextTestDate
// && ((DateTime)x.NextTestDate).AddDays(-15) < DateTime.Now).Count();
//过期提醒记录数
var num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate < DateTime.Now).Count();
//result = num1 + num2;
result = num2;
return result;
}
else {
int result = 0;
//过期提醒记录数
var num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate < DateTime.Now
&& pids.Contains(x.ProjectId)).Count();
//result = num1 + num2;
result = num2;
return result;
}
}
/// <summary>
/// 获取质量培训人次数
/// </summary>
/// <returns></returns>
public static int GetTrainPersonNum()
public int GetTrainPersonNum()
{
int result = (from x in Funs.DB.Comprehensive_InspectionPerson
where x.IsTrain == true
select x).Count();
return result;
if (pids == null)
{
int result = (from x in Funs.DB.Comprehensive_InspectionPerson
where x.IsTrain == true
select x).Count();
return result;
}
else {
int result = (from x in Funs.DB.Comprehensive_InspectionPerson
where x.IsTrain == true && pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
/// <summary>
/// 获取技术交底人次数
/// </summary>
/// <returns></returns>
public static int GetTechnicalDisclosePersonNum()
public int GetTechnicalDisclosePersonNum()
{
var result = (from x in Funs.DB.Comprehensive_DesignDetails
select x.JoinPersonNum ?? 0).ToList().Sum();
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
if (pids == null)
{
var result = (from x in Funs.DB.Comprehensive_DesignDetails
select x.JoinPersonNum ?? 0).ToList().Sum();
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
}
else {
var result = (from x in Funs.DB.Comprehensive_DesignDetails
where pids.Contains(x.ProjectId)
select x.JoinPersonNum ?? 0).ToList().Sum();
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
}
}
/// <summary>
@@ -200,13 +271,26 @@ namespace FineUIPro.Web.common
/// </summary>
private void getEarlyWarningCounts()
{
int allCount = 0;
var getPersonQualitys = from x in Funs.DB.Comprehensive_InspectionPerson
where x.ValidityDate.HasValue && x.ValidityDate < DateTime.Now && x.IsOnSite == true
select x;
//// 预警人数
allCount = getPersonQualitys.Count();
this.spanQualityChartAnalysis.InnerHtml = allCount.ToString();
if (pids == null)
{
int allCount = 0;
var getPersonQualitys = from x in Funs.DB.Comprehensive_InspectionPerson
where x.ValidityDate.HasValue && x.ValidityDate < DateTime.Now && x.IsOnSite == true
select x;
//// 预警人数
allCount = getPersonQualitys.Count();
this.spanQualityChartAnalysis.InnerHtml = allCount.ToString();
}
else {
int allCount = 0;
var getPersonQualitys = from x in Funs.DB.Comprehensive_InspectionPerson
where x.ValidityDate.HasValue && x.ValidityDate < DateTime.Now && x.IsOnSite == true && pids.Contains(x.ProjectId)
select x;
//// 预警人数
allCount = getPersonQualitys.Count();
this.spanQualityChartAnalysis.InnerHtml = allCount.ToString();
}
}
#region
@@ -214,48 +298,73 @@ namespace FineUIPro.Web.common
/// 共检总数
/// </summary>
/// <returns></returns>
public static int getAllInspectionManagement()
public int getAllInspectionManagement()
{
int result = 0;
;
//统计所给时间段的全部数量
//List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber =
// BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(
// null, null, DateTime.Parse("2001-01-01"), DateTime.Now, false);
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
select x).Count();
result = num1;
//int result = (from x in Funs.DB.Check_CheckControl
// where x.CheckDate <= DateTime.Now && x.State == "7"
// select x).Count();
return result;
if (pids == null)
{
int result = 0;
//统计所给时间段的全部数量
//List<Model.View_CQMS_InspectionManagementDetail> managementListSunNumber =
// BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(
// null, null, DateTime.Parse("2001-01-01"), DateTime.Now, false);
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
select x).Count();
result = num1;
//int result = (from x in Funs.DB.Check_CheckControl
// where x.CheckDate <= DateTime.Now && x.State == "7"
// select x).Count();
return result;
}
else {
int result = 0;
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where pids.Contains(x.ProjectId)
select x).Count();
result = num1;
return result;
}
}
/// <summary>
/// 次合格数量
/// </summary>
/// <returns></returns>
public static int getIsOnceInspectionManagement()
public int getIsOnceInspectionManagement()
{
int result = 0;
//统计所给时间段的合格数量
//List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber =
// BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(
// null, null, DateTime.Parse("2001-01-01"), DateTime.Now, true);
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.IsOnceQualified == true
select x).Count();
result = num2;
if (pids == null)
{
int result = 0;
//统计所给时间段的合格数量
//List<Model.View_CQMS_InspectionManagementDetail> managementListOneNumber =
// BLL.InspectionManagementService.getInspectionManagementDetailListByCNProfessionalIdAndDate(
// null, null, DateTime.Parse("2001-01-01"), DateTime.Now, true);
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.IsOnceQualified == true
select x).Count();
result = num2;
//int result = (from x in Funs.DB.Check_CheckControl
// where x.CheckDate <= DateTime.Now && x.State != "7"
// select x).Count();
return result;
//int result = (from x in Funs.DB.Check_CheckControl
// where x.CheckDate <= DateTime.Now && x.State != "7"
// select x).Count();
return result;
}
else {
int result = 0;
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.IsOnceQualified == true && pids.Contains(x.ProjectId)
select x).Count();
result = num2;
return result;
}
}
/// <summary>
/// 整改率
/// </summary>
/// <returns></returns>
public static string GetInspectionManagementZgl()
public string GetInspectionManagementZgl()
{
string zgl = String.Format("{0:N2}", 100.0 * getIsOnceInspectionManagement() / getAllInspectionManagement());
return zgl + "%";
@@ -269,30 +378,48 @@ namespace FineUIPro.Web.common
/// 获取整改完成数
/// </summary>
/// <returns></returns>
public static int GetProblemCompletedNum()
public int GetProblemCompletedNum()
{
int result = (from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now && x.State == "7"
select x).Count();
return result;
if (pids == null)
{
int result = (from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now && x.State == "7"
select x).Count();
return result;
}
else {
int result = (from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now && x.State == "7" && pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
/// <summary>
/// 获取未整改数
/// </summary>
/// <returns></returns>
public static int GetProblemNotCompletedNum()
public int GetProblemNotCompletedNum()
{
int result = (from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now && x.State != "7"
select x).Count();
return result;
if (pids == null)
{
int result = (from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now && x.State != "7"
select x).Count();
return result;
}
else {
int result = (from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now && x.State != "7" && pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
/// <summary>
/// 整改率
/// </summary>
/// <returns></returns>
public static string GetProblemZgl()
public string GetProblemZgl()
{
string zgl = String.Format("{0:N2}", 100.0 * GetProblemCompletedNum() / (GetProblemCompletedNum() + GetProblemNotCompletedNum()));
return zgl + "%";
@@ -316,12 +443,21 @@ namespace FineUIPro.Web.common
/// 获取问题个数
/// </summary>
/// <returns></returns>
public static int GetProblemNum()
public int GetProblemNum()
{
int result = (from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now
select x).Count();
return result;
if (pids == null)
{
int result = (from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now
select x).Count();
return result;
}
else {
int result = (from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now && pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
#endregion
@@ -329,114 +465,216 @@ namespace FineUIPro.Web.common
/// 获取焊工总数
/// </summary>
/// <returns></returns>
public static int GetWelderNum()
public int GetWelderNum()
{
int result = (from x in Funs.DB.BS_Welder
where x.WED_IfOnGuard == true
select x).Count();
return result;
if (pids == null)
{
int result = (from x in Funs.DB.BS_Welder
where x.WED_IfOnGuard == true
select x).Count();
return result;
}
else
{
int result = (from x in Funs.DB.BS_Welder
where x.WED_IfOnGuard == true && pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
/// <summary>
/// 获取总达因数
/// </summary>
/// <returns></returns>
public static int GetTotalDineNum()
public int GetTotalDineNum()
{
int result = 0;
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
select x;
if (getD1.Count() > 0)
if (pids == null)
{
foreach (var item in getD1)
int result = 0;
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
select x;
if (getD1.Count() > 0)
{
result += Funs.GetNewIntOrZero(item.TotalWeldQuantity.Split('.')[0]);
foreach (var item in getD1)
{
result += Funs.GetNewIntOrZero(item.TotalWeldQuantity.Split('.')[0]);
}
}
else
{
var getD2 = (from x in Funs.DB.HJGL_FL_Data
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.TotalWeldQuantity.Split('.')[0]);
}
}
return result;
}
else
{
var getD2 = (from x in Funs.DB.HJGL_FL_Data
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
int result = 0;
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
where pids.Contains(x.ProjectId)
select x;
if (getD1.Count() > 0)
{
result = Funs.GetNewIntOrZero(getD2.TotalWeldQuantity.Split('.')[0]);
foreach (var item in getD1)
{
result += Funs.GetNewIntOrZero(item.TotalWeldQuantity.Split('.')[0]);
}
}
else
{
var getD2 = (from x in Funs.DB.HJGL_FL_Data
where pids.Contains(x.ProjectId)
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.TotalWeldQuantity.Split('.')[0]);
}
}
return result;
}
return result;
}
/// <summary>
/// 获取完成达因数
/// </summary>
/// <returns></returns>
public static int GetCompleteDineNum()
public int GetCompleteDineNum()
{
int result = 0;
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
select x;
if (getD1.Count() > 0)
if (pids == null)
{
foreach (var item in getD1)
{
result += Funs.GetNewIntOrZero(item.TotalCompleted.Split('.')[0]);
}
}
else
{
var getD2 = (from x in Funs.DB.HJGL_FL_Data
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.TotalCompleted.Split('.')[0]);
}
int result = 0;
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
select x;
if (getD1.Count() > 0)
{
foreach (var item in getD1)
{
result += Funs.GetNewIntOrZero(item.TotalCompleted.Split('.')[0]);
}
}
else
{
var getD2 = (from x in Funs.DB.HJGL_FL_Data
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.TotalCompleted.Split('.')[0]);
}
}
return result;
}
else {
int result = 0;
var getD1 = from x in Funs.DB.HJGL_FL_TotalQuantity
where pids.Contains(x.ProjectId)
select x;
if (getD1.Count() > 0)
{
foreach (var item in getD1)
{
result += Funs.GetNewIntOrZero(item.TotalCompleted.Split('.')[0]);
}
}
else
{
var getD2 = (from x in Funs.DB.HJGL_FL_Data
where pids.Contains(x.ProjectId)
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.TotalCompleted.Split('.')[0]);
}
}
return result;
}
return result;
}
/// <summary>
/// 获取总片数
/// </summary>
/// <returns></returns>
public static int GetTotalFilmNum()
public int GetTotalFilmNum()
{
//int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
// join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
// select x.CHT_TotalFilm).ToList().Sum());
int result = 0;
var getD2 = (from x in Funs.DB.HJGL_FL_Data
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
if (pids == null)
{
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmAmount.Split('.')[0]);
//int result = Convert.ToInt32((from x in Funs.DB.CH_CheckItem
// join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
// select x.CHT_TotalFilm).ToList().Sum());
int result = 0;
var getD2 = (from x in Funs.DB.HJGL_FL_Data
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmAmount.Split('.')[0]);
}
return result;
}
else
{
int result = 0;
var getD2 = (from x in Funs.DB.HJGL_FL_Data
where pids.Contains(x.ProjectId)
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmAmount.Split('.')[0]);
}
return result;
}
return result;
}
/// <summary>
/// 获取合格片数
/// </summary>
/// <returns></returns>
public static int GetOKFilmNum()
public int GetOKFilmNum()
{
int result = 0;
var getD2 = (from x in Funs.DB.HJGL_FL_Data
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
if (pids == null)
{
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmQualifiedAmount.Split('.')[0]);
int result = 0;
var getD2 = (from x in Funs.DB.HJGL_FL_Data
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmQualifiedAmount.Split('.')[0]);
}
return result;
}
else
{
int result = 0;
var getD2 = (from x in Funs.DB.HJGL_FL_Data
where pids.Contains(x.ProjectId)
orderby x.CompileDate descending
select x).FirstOrDefault();
if (getD2 != null)
{
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmQualifiedAmount.Split('.')[0]);
}
return result;
}
return result;
}
/// <summary>
/// 一次拍片合格率
/// </summary>
/// <returns></returns>
public static string GetOKFilmHgl()
public string GetOKFilmHgl()
{
string zgl = "0";
if (GetOKFilmNum() > 0)
@@ -459,7 +697,10 @@ namespace FineUIPro.Web.common
private void getInspectionManagementInfo()
{
var q = (from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId != BLL.Const.CNProfessionalHSEId orderby x.SortIndex select x).ToList();
var q=(from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId != BLL.Const.CNProfessionalHSEId orderby x.SortIndex select x).ToList();
foreach (var item in q)
{
//获取专业
@@ -469,9 +710,27 @@ namespace FineUIPro.Web.common
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
// where y.CNProfessionalId == item.CNProfessionalId
// select x).ToList().Count;
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
var num1 = 0;
var num2 = 0;
if (pids == null)
{
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.CNProfessionalId
select x).Count();
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.CNProfessionalId && x.IsOnceQualified == true
select x).Count();
}
else {
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.CNProfessionalId && pids.Contains(x.ProjectId)
select x).Count();
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.CNProfessionalId && x.IsOnceQualified == true && pids.Contains(x.ProjectId)
select x).Count();
}
InspectionManagementSumCount += "'" + num1 + "',";
//根据专业获取合格数
@@ -479,9 +738,7 @@ namespace FineUIPro.Web.common
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
// where y.CNProfessionalId == item.CNProfessionalId && y.IsOnceQualified==true
// select x).ToList().Count;
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.CNProfessionalId && x.IsOnceQualified == true
select x).Count();
InspectionManagementOkCount += "'" + num2 + "',";
//一次验收合格率
@@ -514,29 +771,56 @@ namespace FineUIPro.Web.common
protected string ncrCount;
private void getNcrInfo()
{
//闭环项 有完成日期的
//var num1 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CompleteDate != null).Count();
//var num2 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CompleteDate == null).Count();
var num1 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.ImplementationFrontState == "已闭合").Count();
var num2 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.ImplementationFrontState == "整改中").Count();
ncrZgbhx = num1.ToString();
ncrwZgbhx = num2.ToString();
if ((num1 + num2) > 0)
if (pids==null)
{
ncrZgl = String.Format("{0:N2}", 100.0 * num1 / (num1 + num2)) + "%";
}
//闭环项 有完成日期的
//var num1 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CompleteDate != null).Count();
//var num2 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CompleteDate == null).Count();
var num1 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.ImplementationFrontState == "已闭合").Count();
var num2 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.ImplementationFrontState == "整改中").Count();
ncrZgbhx = num1.ToString();
ncrwZgbhx = num2.ToString();
if ((num1 + num2) > 0)
{
ncrZgl = String.Format("{0:N2}", 100.0 * num1 / (num1 + num2)) + "%";
}
//加载专业
var list = (from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId!=BLL.Const.CNProfessionalHSEId orderby x.SortIndex select x).ToList();
foreach (var item in list)
{
ncrZy += "'" + item.ProfessionalName + "',";
//根据专业加载数据量
var num3 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CNProfessionalId == item.CNProfessionalId).Count();
ncrCount += "'" + num3 + "',";
//加载专业
var list = (from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId != BLL.Const.CNProfessionalHSEId orderby x.SortIndex select x).ToList();
foreach (var item in list)
{
ncrZy += "'" + item.ProfessionalName + "',";
//根据专业加载数据量
var num3 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CNProfessionalId == item.CNProfessionalId).Count();
ncrCount += "'" + num3 + "',";
}
ncrZy = ncrZy.TrimEnd(',');
ncrCount = ncrCount.TrimEnd(',');
}
ncrZy = ncrZy.TrimEnd(',');
ncrCount = ncrCount.TrimEnd(',');
else
{
var num1 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.ImplementationFrontState == "已闭合" && pids.Contains(x.ProjectId)).Count();
var num2 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.ImplementationFrontState == "整改中" && pids.Contains(x.ProjectId)).Count();
ncrZgbhx = num1.ToString();
ncrwZgbhx = num2.ToString();
if ((num1 + num2) > 0)
{
ncrZgl = String.Format("{0:N2}", 100.0 * num1 / (num1 + num2)) + "%";
}
//加载专业
var list = (from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId != BLL.Const.CNProfessionalHSEId orderby x.SortIndex select x).ToList();
foreach (var item in list)
{
ncrZy += "'" + item.ProfessionalName + "',";
//根据专业加载数据量
var num3 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CNProfessionalId == item.CNProfessionalId && pids.Contains(x.ProjectId)).Count();
ncrCount += "'" + num3 + "',";
}
ncrZy = ncrZy.TrimEnd(',');
ncrCount = ncrCount.TrimEnd(',');
}
}
#endregion