20241028 共检通知单专业

This commit is contained in:
2024-10-28 15:19:46 +08:00
parent 9cc1ef7faa
commit 21a099cc01
6 changed files with 334 additions and 154 deletions
+126 -69
View File
@@ -141,7 +141,7 @@ namespace FineUIPro.Web.common
/// 获取项目部人数
/// </summary>
/// <returns></returns>
public int GetProjectPersonNum()
public int GetProjectPersonNum()
{
if (pids == null)
{
@@ -154,18 +154,18 @@ namespace FineUIPro.Web.common
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)
where y.IsCQMS == true && x.IsUsed == true && pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
/// <summary>
/// 获取在用计量器具数
/// </summary>
/// <returns></returns>
public int GetUseNum()
public int GetUseNum()
{
if (pids == null)
{
@@ -180,13 +180,13 @@ namespace FineUIPro.Web.common
select x).Count();
return result;
}
}
/// <summary>
/// 获取校准合格数
/// </summary>
/// <returns></returns>
public int GetOKNum()
public int GetOKNum()
{
if (pids == null)
{
@@ -207,7 +207,7 @@ namespace FineUIPro.Web.common
/// 机械预警
/// </summary>
/// <returns></returns>
public int GetJxyjNum()
public int GetJxyjNum()
{
if (pids == null)
{
@@ -237,7 +237,7 @@ namespace FineUIPro.Web.common
/// 获取质量培训人次数
/// </summary>
/// <returns></returns>
public int GetTrainPersonNum()
public int GetTrainPersonNum()
{
if (pids == null)
{
@@ -258,7 +258,7 @@ namespace FineUIPro.Web.common
/// 获取技术交底人次数
/// </summary>
/// <returns></returns>
public int GetTechnicalDisclosePersonNum()
public int GetTechnicalDisclosePersonNum()
{
if (pids == null)
{
@@ -269,7 +269,7 @@ namespace FineUIPro.Web.common
}
else {
var result = (from x in Funs.DB.Comprehensive_DesignDetails
where pids.Contains(x.ProjectId)
where pids.Contains(x.ProjectId)
select x.JoinPersonNum ?? 0).ToList().Sum();
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
@@ -308,7 +308,7 @@ namespace FineUIPro.Web.common
/// 共检总数
/// </summary>
/// <returns></returns>
public int getAllInspectionManagement()
public int getAllInspectionManagement()
{
if (pids == null)
{
@@ -328,10 +328,10 @@ namespace FineUIPro.Web.common
else {
int result = 0;
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where pids.Contains(x.ProjectId)
where pids.Contains(x.ProjectId)
select x).Count();
result = num1;
return result;
}
}
@@ -339,7 +339,7 @@ namespace FineUIPro.Web.common
/// 次合格数量
/// </summary>
/// <returns></returns>
public int getIsOnceInspectionManagement()
public int getIsOnceInspectionManagement()
{
if (pids == null)
{
@@ -360,13 +360,13 @@ namespace FineUIPro.Web.common
}
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;
}
}
@@ -374,7 +374,7 @@ namespace FineUIPro.Web.common
/// 整改率
/// </summary>
/// <returns></returns>
public string GetInspectionManagementZgl()
public string GetInspectionManagementZgl()
{
string zgl = String.Format("{0:N2}", 100.0 * getIsOnceInspectionManagement() / getAllInspectionManagement());
return zgl + "%";
@@ -388,7 +388,7 @@ namespace FineUIPro.Web.common
/// 获取整改完成数
/// </summary>
/// <returns></returns>
public int GetProblemCompletedNum()
public int GetProblemCompletedNum()
{
if (pids == null)
{
@@ -408,7 +408,7 @@ namespace FineUIPro.Web.common
/// 获取未整改数
/// </summary>
/// <returns></returns>
public int GetProblemNotCompletedNum()
public int GetProblemNotCompletedNum()
{
if (pids == null)
{
@@ -429,7 +429,7 @@ namespace FineUIPro.Web.common
/// 整改率
/// </summary>
/// <returns></returns>
public string GetProblemZgl()
public string GetProblemZgl()
{
string zgl = String.Format("{0:N2}", 100.0 * GetProblemCompletedNum() / (GetProblemCompletedNum() + GetProblemNotCompletedNum()));
return zgl + "%";
@@ -453,7 +453,7 @@ namespace FineUIPro.Web.common
/// 获取问题个数
/// </summary>
/// <returns></returns>
public int GetProblemNum()
public int GetProblemNum()
{
if (pids == null)
{
@@ -475,7 +475,7 @@ namespace FineUIPro.Web.common
/// 获取焊工总数
/// </summary>
/// <returns></returns>
public int GetWelderNum()
public int GetWelderNum()
{
if (pids == null)
{
@@ -496,7 +496,7 @@ namespace FineUIPro.Web.common
/// 获取总达因数
/// </summary>
/// <returns></returns>
public int GetTotalDineNum()
public int GetTotalDineNum()
{
if (pids == null)
{
@@ -553,7 +553,7 @@ namespace FineUIPro.Web.common
/// 获取完成达因数
/// </summary>
/// <returns></returns>
public int GetCompleteDineNum()
public int GetCompleteDineNum()
{
if (pids == null)
{
@@ -651,7 +651,7 @@ namespace FineUIPro.Web.common
/// 获取合格片数
/// </summary>
/// <returns></returns>
public int GetOKFilmNum()
public int GetOKFilmNum()
{
if (pids == null)
{
@@ -684,7 +684,7 @@ namespace FineUIPro.Web.common
/// 一次拍片合格率
/// </summary>
/// <returns></returns>
public string GetOKFilmHgl()
public string GetOKFilmHgl()
{
string zgl = "0";
if (GetOKFilmNum() > 0)
@@ -707,57 +707,114 @@ 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.Control_PointCropping where x.ParentId == null || x.ParentId == "" orderby x.OperateTime select x).ToList();
foreach (var item in q)
if (this.CurrUser.UserId == BLL.Const.hfnbdId)
{
//获取专业
InspectionManagementZy += "'" + item.DetectionItems + "',";
//根据专业获取总计
//var num1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
// where y.CNProfessionalId == item.CNProfessionalId
// select x).ToList().Count;
var num1 = 0;
var num2 = 0;
if (pids == null)
//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.Control_PointCropping where x.ParentId == null || x.ParentId == "" orderby x.OperateTime select x).ToList();
foreach (var item in q)
{
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId
select x).Count();
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
//获取专业
InspectionManagementZy += "'" + item.DetectionItems + "',";
//根据专业获取总计
//var num1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
// where y.CNProfessionalId == item.CNProfessionalId
// select x).ToList().Count;
var num1 = 0;
var num2 = 0;
if (pids == null)
{
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId
select x).Count();
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId && x.IsOnceQualified == true
select x).Count();
}
else {
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId && pids.Contains(x.ProjectId)
select x).Count();
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId && x.IsOnceQualified == true && pids.Contains(x.ProjectId)
select x).Count();
}
InspectionManagementSumCount += "'" + num1 + "',";
}
else
{
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId && pids.Contains(x.ProjectId)
select x).Count();
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId && x.IsOnceQualified == true && pids.Contains(x.ProjectId)
select x).Count();
}
//根据专业获取合格数
//var num2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
// 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;
InspectionManagementSumCount += "'" + num1 + "',";
//根据专业获取合格数
//var num2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
// 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;
InspectionManagementOkCount += "'" + num2 + "',";
//一次验收合格率
var hgl = "0";
if (num1 > 0)
{
hgl += String.Format("{0:N2}", 100.0 * num2 / num1);
}
InspectionManagementOneOkCount += "'" + hgl + "',";
}
}
else
{
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();
InspectionManagementOkCount += "'" + num2 + "',";
//一次验收合格率
var hgl = "0";
if (num1 > 0)
foreach (var item in q)
{
hgl += String.Format("{0:N2}", 100.0 * num2 / num1);
//获取专业
InspectionManagementZy += "'" + item.ProfessionalName + "',";
//根据专业获取总计
//var num1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
// where y.CNProfessionalId == item.CNProfessionalId
// select x).ToList().Count;
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 + "',";
//根据专业获取合格数
//var num2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
// 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;
InspectionManagementOkCount += "'" + num2 + "',";
//一次验收合格率
var hgl = "0";
if (num1 > 0)
{
hgl += String.Format("{0:N2}", 100.0 * num2 / num1);
}
InspectionManagementOneOkCount += "'" + hgl + "',";
}
InspectionManagementOneOkCount += "'" + hgl + "',";
}
InspectionManagementZy = InspectionManagementZy.TrimEnd(',');
InspectionManagementSumCount = InspectionManagementSumCount.TrimEnd(',');