This commit is contained in:
2026-03-23 14:33:54 +08:00
parent 1454442fd8
commit 58f23e59d1
68 changed files with 5316 additions and 432 deletions
@@ -214,10 +214,10 @@ namespace BLL
ProjectId = r.ProjectId,
CheckUnitName = u.UnitName,
States = r.States,
ProblemStatesName = i.CompleteStatus==1 ? "已整改":"未整改",
ProblemStatesName = i.CompleteStatus == 1 ? "已整改" : "未整改",
ProblemStates = i.CompleteStatus,
InsResponsibleUserId = r.InsResponsibleUserId,
InsResponsibleUserName= user.PersonName
InsResponsibleUserName = user.PersonName
};
// 应用检查大类过滤
@@ -281,17 +281,24 @@ namespace BLL
var thisUnit = BLL.CommonService.GetIsThisUnit();
if (thisUnit.UnitId != input.UnitId)
{
// 先获取用户有权限的项目ID列表
var projectIds = (from p in Funs.DB.Base_Project
where p.UnitId == input.UnitId
select p.ProjectId).ToList();
//// 先获取用户有权限的项目ID列表
//var projectIds = (from p in Funs.DB.Base_Project
// where p.UnitId == input.UnitId
// select p.ProjectId).ToList();
//// 过滤查询结果
//query = query.Where(x => Funs.DB.Supervise_UnitHazardRegister
// .Any(r => Funs.DB.Supervise_UnitHazardRegisterItem
// .Any(i => i.UnitHazardRegisterItemId == x.UnitHazardRegisterItemId &&
// i.UnitHazardRegisterId == r.UnitHazardRegisterId &&
// projectIds.Contains(r.ProjectId))));
// 过滤查询结果
query = query.Where(x => Funs.DB.Supervise_UnitHazardRegister
.Any(r => Funs.DB.Supervise_UnitHazardRegisterItem
.Any(i => i.UnitHazardRegisterItemId == x.UnitHazardRegisterItemId &&
i.UnitHazardRegisterId == r.UnitHazardRegisterId &&
projectIds.Contains(r.ProjectId))));
input.UnitId == r.CheckUnitId)));
}
}
@@ -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
};
@@ -118,8 +119,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,7 +144,7 @@ namespace BLL
if (register == null)
{
return false;
}
}
// 只有"待提交"状态可以删除,其他状态不能删除
return register.States <= (int)StateInt.;
}
@@ -171,6 +172,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 +189,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 +225,10 @@ namespace BLL
{
query = query.Where(x => x.ProjectId != null && x.ProjectId == input.ProjectId);
}
if (input != null && !string.IsNullOrEmpty(input.CheckUnitId) && input.CheckUnitId != BLL.Const.UnitId_SEDIN)
{
query = query.Where(x => x.CheckUnitId != null && x.CheckUnitId == input.CheckUnitId);
}
// 获取总数
totalCount = query.Count();
@@ -235,7 +245,7 @@ namespace BLL
.Skip(pageIndex * pageSize)
.Take(pageSize)
.ToList();
}
}
/// <summary>
/// 更新企业级检查记录
@@ -253,6 +263,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;