集团主数据在建项目数据分析

This commit is contained in:
2026-06-10 21:07:27 +08:00
parent 855eec9965
commit ea1acf5f93
27 changed files with 2917 additions and 78 deletions
@@ -26,10 +26,10 @@ namespace BLL
public enum StateInt : int
{
= 0,
= 1,
= 2,
= 3,
= 0,
= 1,
= 2,
= 3,
}
#endregion Enums
@@ -51,6 +51,7 @@ namespace BLL
CheckDate = register.CheckDate,
CheckMainType = register.CheckMainType,
CheckType = register.CheckType,
InspectionUnit = register.InspectionUnit,
ProjectId = register.ProjectId,
CheckUnitId = register.CheckUnitId,
CheckTeam = register.CheckTeam,
@@ -59,7 +60,7 @@ namespace BLL
InsResponsibleUserId = register.InsResponsibleUserId,
EvaluationResult = register.EvaluationResult,
AttachUrl = register.AttachUrl,
States = register.States??0,
States = register.States ?? 0,
CompileMan = register.CompileMan,
CreateDate = DateTime.Now
};
@@ -102,6 +103,22 @@ namespace BLL
}
}
}
/// <summary>
/// 驳回企业级检查记录
/// </summary>
/// <param name="registerId">检查记录ID</param>
public static void RejectUnitHazardRegisterById(string registerId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var register = db.Supervise_UnitHazardRegister.FirstOrDefault(e => e.UnitHazardRegisterId == registerId);
if (register != null)
{
register.States = (int)StateInt.;
db.SubmitChanges();
}
}
}
/// <summary>
/// 根据项目和时间段获取检查数量
@@ -118,8 +135,8 @@ namespace BLL
}
public static int GetCount(string checkMainType)
{
return (from x in Funs.DB.Supervise_UnitHazardRegister
where x.CheckMainType ==checkMainType
return (from x in Funs.DB.Supervise_UnitHazardRegister
where x.CheckMainType == checkMainType
select x.UnitHazardRegisterId).Count();
}
/// <summary>
@@ -143,11 +160,27 @@ namespace BLL
if (register == null)
{
return false;
}
}
// 只有"待提交"状态可以删除,其他状态不能删除
return register.States <= (int)StateInt.;
}
/// <summary>
/// 判断是否可以驳回检查记录整改结果
/// </summary>
/// <param name="registerId">检查记录ID</param>
/// <returns>true=可以驳回,false=不能驳回</returns>
public static bool CanRejectRegister(string registerId)
{
var register = GetUnitHazardRegisterById(registerId);
if (register == null)
{
return false;
}
// 只有"已闭环"和"部分整改"状态可以撤回,其他状态不能撤回
return register.States == (int)StateInt. || register.States == (int)StateInt.;
}
/// <summary>
/// 获取企业级检查列表(使用input对象,返回总数)
/// </summary>
@@ -171,6 +204,9 @@ namespace BLL
on new { MainType = x.CheckMainType, TypeCode = x.CheckType }
equals new { MainType = ct.CheckMainType, TypeCode = ct.CheckTypeCode } into ctGroup
from ct in ctGroup.DefaultIfEmpty()
join inu in db.Base_Unit
on x.InspectionUnit equals inu.UnitId into inuGroup
from inu in inuGroup.DefaultIfEmpty()
join u in db.Base_Unit
on x.CheckUnitId equals u.UnitId into uGroup
from u in uGroup.DefaultIfEmpty()
@@ -185,7 +221,9 @@ namespace BLL
CheckMainTypeName = x.CheckMainType == "0" ? "安全" : "质量",
CheckType = x.CheckType,
CheckTypeName = ct.CheckTypeName,
InspectionUnitName = inu.UnitName,
CheckObjectText = p.ProjectName,
CheckUnitId = x.CheckUnitId,
CheckUnitName = u.UnitName,
CheckTeam = x.CheckTeam,
EvaluationResult = x.EvaluationResult,
@@ -219,6 +257,10 @@ namespace BLL
{
query = query.Where(x => x.ProjectId != null && x.ProjectId == input.ProjectId);
}
if (input != null && !string.IsNullOrEmpty(input.CheckUnitId) && input.CheckUnitId != CommonService.GetThisUnitId())
{
query = query.Where(x => x.CheckUnitId != null && x.CheckUnitId == input.CheckUnitId);
}
// 获取总数
totalCount = query.Count();
@@ -235,7 +277,7 @@ namespace BLL
.Skip(pageIndex * pageSize)
.Take(pageSize)
.ToList();
}
}
/// <summary>
/// 更新企业级检查记录
@@ -253,6 +295,7 @@ namespace BLL
newRegister.CheckDate = register.CheckDate;
newRegister.CheckMainType = register.CheckMainType;
newRegister.CheckType = register.CheckType;
newRegister.InspectionUnit = register.InspectionUnit;
newRegister.ProjectId = register.ProjectId;
newRegister.CheckUnitId = register.CheckUnitId;
newRegister.CheckTeam = register.CheckTeam;