This commit is contained in:
2025-10-24 18:27:46 +08:00
parent 47172cd0b3
commit 78a2b0f525
47 changed files with 678 additions and 277 deletions
@@ -1454,7 +1454,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
string UnitWorkName = checkLotBindStatiscData.Rows[i]["UnitWorkName"].ToString();
string cNProfessionalCode = checkLotBindStatiscData.Rows[i]["cNProfessionalCode"].ToString();
string IsOnceQualified = checkLotBindStatiscData.Rows[i]["IsOnceQualified"].ToString();
DateTime? InspectionDate = Funs.GetNewDateTime(checkLotBindStatiscData.Rows[i]["InspectionDate"].ToString());
DateTime? CompileDate = Funs.GetNewDateTime(checkLotBindStatiscData.Rows[i]["CompileDate"].ToString());
//DateTime? InspectionDate = Funs.GetNewDateTime(checkLotBindStatiscData.Rows[i]["InspectionDate"].ToString());
if (tempCV != cNProfessionalCode || tempArea != UnitWorkName)
{
@@ -1477,7 +1478,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
}
}
if (InspectionDate.HasValue && InspectionDate.Value >= startDate && InspectionDate.Value <= endDate)
if (CompileDate.HasValue && CompileDate.Value >= startDate && CompileDate.Value <= endDate)
{
checkStatisc.CheckNum += 1;
if (IsOnceQualified == "1" || IsOnceQualified == "True" || IsOnceQualified == "true")
@@ -1485,6 +1486,14 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
checkStatisc.OKNum += 1;
}
}
//if (InspectionDate.HasValue && InspectionDate.Value >= startDate && InspectionDate.Value <= endDate)
//{
// checkStatisc.CheckNum += 1;
// if (IsOnceQualified == "1" || IsOnceQualified == "True" || IsOnceQualified == "true")
// {
// checkStatisc.OKNum += 1;
// }
//}
checkStatisc.TotalCheckNum += 1;
//if (IsOnceQualified == "1")
@@ -1925,7 +1934,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{
string UnitId = row["UnitId"].ToString();
string IsOnceQualified = row["IsOnceQualified"].ToString();
DateTime? InspectionDate = Funs.GetNewDateTime(row["InspectionDate"].ToString());
//DateTime? InspectionDate = Funs.GetNewDateTime(row["InspectionDate"].ToString());
DateTime? CompileDate = Funs.GetNewDateTime(row["CompileDate"].ToString());
if (!Quantity1Dic.ContainsKey(UnitId))
{
Quantity1Dic.Add(UnitId, 0);
@@ -1942,7 +1952,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{
Quantity4Dic.Add(UnitId, 0);
}
if (InspectionDate.HasValue && InspectionDate.Value >= startDate && InspectionDate.Value <= endDate)
if (CompileDate.HasValue && CompileDate.Value >= startDate && CompileDate.Value <= endDate)
{
Quantity1Dic[UnitId] = Quantity1Dic[UnitId] + 1;
if (IsOnceQualified == "1")
@@ -1950,6 +1960,14 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
Quantity3Dic[UnitId] = Quantity3Dic[UnitId] + 1;
}
}
//if (InspectionDate.HasValue && InspectionDate.Value >= startDate && InspectionDate.Value <= endDate)
//{
// Quantity1Dic[UnitId] = Quantity1Dic[UnitId] + 1;
// if (IsOnceQualified == "1")
// {
// Quantity3Dic[UnitId] = Quantity3Dic[UnitId] + 1;
// }
//}
Quantity2Dic[UnitId] = Quantity2Dic[UnitId] + 1;
if (IsOnceQualified == "1")
{
@@ -2499,22 +2517,22 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{
string CheckType = row["CheckType"].ToString();
DateTime? CheckDate = Funs.GetNewDateTime(row["CheckDate"].ToString());
if (!Quantity1Dic.ContainsKey(CheckType))
string CheckTypeName = ConvertJointCheckType(CheckType);
if (!Quantity1Dic.ContainsKey(CheckTypeName))
{
Quantity1Dic.Add(CheckType, 0);
Quantity1Dic.Add(CheckTypeName, 0);
}
if (!Quantity2Dic.ContainsKey(CheckType))
if (!Quantity2Dic.ContainsKey(CheckTypeName))
{
Quantity2Dic.Add(CheckType, 0);
Quantity2Dic.Add(CheckTypeName, 0);
}
if (CheckDate.HasValue && CheckDate.Value >= startDate && CheckDate.Value <= endDate)
{
Quantity1Dic[CheckType] = Quantity1Dic[CheckType] + 1;
Quantity1Dic[CheckTypeName] = Quantity1Dic[CheckTypeName] + 1;
}
Quantity2Dic[CheckType] = Quantity2Dic[CheckType] + 1;
Quantity2Dic[CheckTypeName] = Quantity2Dic[CheckTypeName] + 1;
}
@@ -4138,6 +4156,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
select new
{
c.InspectionDate,
c.CompileDate,
c.ProjectId,
u.UnitId,
u.UnitName,
@@ -4150,14 +4169,17 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
select new
{
x.InspectionDate,
x.CompileDate,
x.ProjectId,
x.UnitId,
x.UnitName,
x.IsOnceQualified
};
var AllList = query.ToList();
//var monethCount = query
// .Where(x => (x.InspectionDate >= Convert.ToDateTime(startDate) && x.InspectionDate <= Convert.ToDateTime(endDate)));
var monethCount = query
.Where(x => (x.InspectionDate >= Convert.ToDateTime(startDate) && x.InspectionDate <= Convert.ToDateTime(endDate)));
.Where(x => (x.CompileDate >= Convert.ToDateTime(startDate) && x.CompileDate <= Convert.ToDateTime(endDate)));
Model.CheckStatisc checkStatisc = new Model.CheckStatisc();
@@ -4166,8 +4188,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
checkStatisc.WorkName = item.UnitName;
checkStatisc.CheckNum = monethCount.Count();
checkStatisc.TotalCheckNum = AllList.Count();
checkStatisc.OKNum = monethCount.Count(x => x.IsOnceQualified == null || x.IsOnceQualified == true);
checkStatisc.TotalOKNum = AllList.Count(x => x.IsOnceQualified == null || x.IsOnceQualified == true);
checkStatisc.OKNum = monethCount.Count(x => x.IsOnceQualified == true);
checkStatisc.TotalOKNum = AllList.Count(x => x.IsOnceQualified == true);
if (checkStatisc.CheckNum != 0)//被除数不能为零
{
@@ -4244,7 +4266,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
return await Task.Run(() =>
{
string strSql = @"select UnitId,IsOnceQualified, InspectionDate from View_CQMS_InspectionManagementDetail
string strSql = @"select UnitId,IsOnceQualified, InspectionDate, CompileDate from View_MonthReport_InspectionManagement
where ProjectId='" + this.CurrUser.LoginProjectId + "' ";
DataTable dt = SQLHelper.GetDataTableRunText(strSql, null);
return dt;
@@ -4298,8 +4320,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
checkStatisc.CheckNum = managementList.Count(x => x.UnitWorkId == item);
checkStatisc.TotalCheckNum = totalManagementList.Count(x => x.UnitWorkId == item);
checkStatisc.OKNum = managementList.Count(x => x.UnitWorkId == item && (x.IsOnceQualified == null || x.IsOnceQualified == true));
checkStatisc.TotalOKNum = totalManagementList.Count(x => x.UnitWorkId == item && (x.IsOnceQualified == null || x.IsOnceQualified == true));
checkStatisc.OKNum = managementList.Count(x => x.UnitWorkId == item && x.IsOnceQualified == true);
checkStatisc.TotalOKNum = totalManagementList.Count(x => x.UnitWorkId == item && x.IsOnceQualified == true);
if (checkStatisc.CheckNum != 0)//被除数不能为零
{
@@ -4491,7 +4513,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
return await Task.Run(() =>
{
string strSql = @"select a.UnitWorkId,UnitWorkName,cNProfessionalCode,IsOnceQualified,InspectionDate from View_MonthReport_InspectionManagement a
string strSql = @"select a.UnitWorkId,UnitWorkName,cNProfessionalCode,IsOnceQualified,InspectionDate,CompileDate from View_MonthReport_InspectionManagement a
left join WBS_UnitWork b on a.UnitWorkId =b.UnitWorkId
left join Base_CNProfessional c on a.CNProfessionalId= c.CNProfessionalId
where a.ProjectId='" + this.CurrUser.LoginProjectId + "' order by cNProfessionalCode,UnitWorkName";
@@ -7163,5 +7185,37 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
{
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
//<summary>
//获取检查类别
//</summary>
//<param name="state"></param>
//<returns></returns>
protected string ConvertJointCheckType(string CheckType)
{
if (!string.IsNullOrWhiteSpace(CheckType))
{
string checkType = CheckType.ToString();
if (checkType == "1")
{
return "周检查";
}
else if (checkType == "2")
{
return "月检查";
}
else if (checkType == "3")
{
return "不定期检查";
}
else if (checkType == "4")
{
return "专业检查";
}
}
return CheckType;
}
}
}