发现BUG

This commit is contained in:
何美荣 2026-04-24 15:39:19 +08:00
parent 1bc2b649b3
commit 59d564d6d1
10 changed files with 27 additions and 25 deletions

View File

@ -227,7 +227,7 @@ namespace APT.FO.WebApi.Controllers.Api.FO
var result = new PagedActionResult<T_FO_CHANGE_SHIFT_RECORD>();
var loginDepartmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = APT.Infrastructure.Api.AppContext.CurrentSession.UserCode;
var loginUserCode = this.GetEntity<T_FM_USER>(t => t.ID == loginUserId && t.ENABLE_STATUS == 0)?.CODE;
pageFilter.IgnoreDataRule = true;
pageFilter.Include.Add("Nav_PreUsers");
pageFilter.Include.Add("Nav_AfterUsers");
@ -237,7 +237,7 @@ namespace APT.FO.WebApi.Controllers.Api.FO
var tempDeps = GetEntities<T_FM_DEPARTMENT>(t => t.ENABLE_STATUS == 0, new BaseFilter(pageFilter.OrgId));
var departStatus = tempDeps.FirstOrDefault(t => t.ID == loginDepartmentId && t.ENABLE_STATUS == 0)?.DEPARTMENT_STATUS;
var ahRole = this.GetEntity<T_FM_USER_BELONG_ROLE>(t => t.Nav_BelongRole != null && t.Nav_BelongRole.NAME.Contains("安环") && t.USER_ID == loginUserId);
if (loginUserCode.Contains("admin") || departStatus != (int)FMDepartmentStatus. || ahRole != null)
if ((!string.IsNullOrEmpty(loginUserCode) && loginUserCode.Contains("admin")) || departStatus != (int)FMDepartmentStatus. || ahRole != null)
{
result = this.GetOrderPageEntities<T_FO_CHANGE_SHIFT_RECORD>(null, pageFilter);
}

View File

@ -1756,12 +1756,12 @@ namespace APT.FO.WebApi.Controllers
if (filter != null && !string.IsNullOrEmpty(filter.Value.ToString()))
pageFilter.FilterGroup.Rules.Remove(filter);
var loginDepartmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = APT.Infrastructure.Api.AppContext.CurrentSession.UserCode;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = this.GetEntity<T_FM_USER>(t => t.ID == loginUserId && t.ENABLE_STATUS == 0)?.CODE;
//安环部负责人departmentID
var departStatus = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == loginDepartmentId && t.ENABLE_STATUS == 0)?.DEPARTMENT_STATUS;
var ahRole = this.GetEntity<T_FM_USER_BELONG_ROLE>(t => t.Nav_BelongRole != null && t.Nav_BelongRole.NAME.Contains("安环") && t.USER_ID == loginUserId);
if (loginUserCode.Contains("admin") || departStatus != (int)FMDepartmentStatus. || ahRole != null)
if ((!string.IsNullOrEmpty(loginUserCode) && loginUserCode.Contains("admin")) || departStatus != (int)FMDepartmentStatus. || ahRole != null)
{
result = this.GetOrderPageEntities<T_FO_CRUCIAL_LICENSE_JOB>(null, pageFilter);
}

View File

@ -1061,12 +1061,12 @@ namespace APT.FO.WebApi.Controllers
if (filter != null && !string.IsNullOrEmpty(filter.Value.ToString()))
pageFilter.FilterGroup.Rules.Remove(filter);
var loginDepartmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = APT.Infrastructure.Api.AppContext.CurrentSession.UserCode;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = this.GetEntity<T_FM_USER>(t => t.ID == loginUserId && t.ENABLE_STATUS == 0)?.CODE;
//安环部负责人departmentID
var departStatus = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == loginDepartmentId && t.ENABLE_STATUS == 0)?.DEPARTMENT_STATUS;
var ahRole = this.GetEntity<T_FM_USER_BELONG_ROLE>(t => t.Nav_BelongRole != null && t.Nav_BelongRole.NAME.Contains("安环") && t.USER_ID == loginUserId);
if (loginUserCode.Contains("admin") || departStatus != (int)FMDepartmentStatus. || ahRole != null)
if ((!string.IsNullOrEmpty(loginUserCode) && loginUserCode.Contains("admin")) || departStatus != (int)FMDepartmentStatus. || ahRole != null)
{
result = this.GetOrderPageEntities<T_FO_CRUCIAL_LICENSE_JOB_OUTSOURCE>(null, pageFilter);
}

View File

@ -620,11 +620,11 @@ namespace APT.FO.WebApi.Controllers.Api.FO
var result = new PagedActionResult<T_FO_CURRENT_CLASS_RECORD>();
var loginDepartmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = APT.Infrastructure.Api.AppContext.CurrentSession.UserCode;
var loginUserCode = this.GetEntity<T_FM_USER>(t => t.ID == loginUserId && t.ENABLE_STATUS == 0)?.CODE;
//安环部负责人departmentID
var departStatus = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == loginDepartmentId && t.ENABLE_STATUS == 0)?.DEPARTMENT_STATUS;
var ahRole = this.GetEntity<T_FM_USER_BELONG_ROLE>(t => t.Nav_BelongRole != null && t.Nav_BelongRole.NAME.Contains("安环") && t.USER_ID == loginUserId);
if (loginUserCode.Contains("admin") || departStatus != (int)FMDepartmentStatus. || ahRole != null)
if ((!string.IsNullOrEmpty(loginUserCode) && loginUserCode.Contains("admin")) || departStatus != (int)FMDepartmentStatus. || ahRole != null)
{
result = this.GetOrderPageEntities<T_FO_CURRENT_CLASS_RECORD>(null, pageFilter);
}

View File

@ -791,11 +791,11 @@ namespace APT.FO.WebApi.Controllers
pageFilter.FilterGroup.Rules.Remove(filter);
var loginDepartmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = APT.Infrastructure.Api.AppContext.CurrentSession.UserCode;
var loginUserCode = this.GetEntity<T_FM_USER>(t => t.ID == loginUserId && t.ENABLE_STATUS == 0)?.CODE;
//安环部负责人departmentID
var departStatus = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == loginDepartmentId && t.ENABLE_STATUS == 0)?.DEPARTMENT_STATUS;
var ahRole = this.GetEntity<T_FM_USER_BELONG_ROLE>(t => t.Nav_BelongRole != null && t.Nav_BelongRole.NAME.Contains("安环") && t.USER_ID == loginUserId);
if (loginUserCode.Contains("admin") || departStatus != (int)FMDepartmentStatus. || ahRole != null)
if ((!string.IsNullOrEmpty(loginUserCode) && loginUserCode.Contains("admin")) || departStatus != (int)FMDepartmentStatus. || ahRole != null)
{
result = this.GetOrderPageEntities<T_FO_JOB_ACTIVITY_RECORD>(null, pageFilter);
}

View File

@ -752,11 +752,11 @@ namespace APT.FO.WebApi.Controllers
pageFilter.FilterGroup.Rules.Remove(filter);
var loginDepartmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = APT.Infrastructure.Api.AppContext.CurrentSession.UserCode;
var loginUserCode = this.GetEntity<T_FM_USER>(t => t.ID == loginUserId && t.ENABLE_STATUS == 0)?.CODE;
//安环部负责人departmentID
var departStatus = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == loginDepartmentId && t.ENABLE_STATUS == 0)?.DEPARTMENT_STATUS;
var ahRole = this.GetEntity<T_FM_USER_BELONG_ROLE>(t => t.Nav_BelongRole != null && t.Nav_BelongRole.NAME.Contains("安环") && t.USER_ID == loginUserId);
if (loginUserCode.Contains("admin") || departStatus != (int)FMDepartmentStatus. || ahRole != null)
if ((!string.IsNullOrEmpty(loginUserCode) && loginUserCode.Contains("admin")) || departStatus != (int)FMDepartmentStatus. || ahRole != null)
{
result = this.GetOrderPageEntities<T_FO_JOB_EVENT_RECORD>(null, pageFilter, "Nav_CreateUser", "Nav_JobEventPerson.Nav_User");
}

View File

@ -9,6 +9,7 @@ using APT.MS.Domain.Entities.FO;
using APT.MS.Domain.Enums;
using APT.Utility;
using Microsoft.AspNetCore.Mvc;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
@ -280,10 +281,11 @@ namespace APT.FM.WebApi.Controllers.Api.FO
var result = new PagedActionResult<T_FO_PRE_OPER_SCH>();
var loginDepartmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = APT.Infrastructure.Api.AppContext.CurrentSession.UserCode;
//安环部负责人departmentID
var manageDepartId = this.GetEntity<T_FM_USER>(t => t.Nav_ApproveRole != null && t.Nav_ApproveRole.NAME == "安环部负责人" && t.ENABLE_STATUS == 0)?.DEPARTMENT_ID;
if (loginUserCode == "admin" || loginDepartmentId == manageDepartId)
var loginUserCode = this.GetEntity<T_FM_USER>(t => t.ID == loginUserId && t.ENABLE_STATUS == 0)?.CODE;
//安环部负责人departmentID
var departStatus = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == loginDepartmentId && t.ENABLE_STATUS == 0)?.DEPARTMENT_STATUS;
var ahRole = this.GetEntity<T_FM_USER_BELONG_ROLE>(t => t.Nav_BelongRole != null && t.Nav_BelongRole.NAME.Contains("安环") && t.USER_ID == loginUserId);
if ((!string.IsNullOrEmpty(loginUserCode) && loginUserCode.Contains("admin")) || departStatus != (int)FMDepartmentStatus. || ahRole != null)
{
result = this.GetOrderPageEntities<T_FO_PRE_OPER_SCH>(null, pageFilter);
}

View File

@ -793,11 +793,11 @@ namespace APT.FO.WebApi.Controllers.Api.FO
}
var loginDepartmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = APT.Infrastructure.Api.AppContext.CurrentSession.UserCode;
var loginUserCode = this.GetEntity<T_FM_USER>(t => t.ID == loginUserId && t.ENABLE_STATUS == 0)?.CODE;
//安环部负责人departmentID
var departStatus = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == loginDepartmentId && t.ENABLE_STATUS == 0)?.DEPARTMENT_STATUS;
var ahRole = this.GetEntity<T_FM_USER_BELONG_ROLE>(t => t.Nav_BelongRole != null && t.Nav_BelongRole.NAME.Contains("安环") && t.USER_ID == loginUserId);
if (loginUserCode.Contains("admin") || departStatus != (int)FMDepartmentStatus. || ahRole != null)
if ((!string.IsNullOrEmpty(loginUserCode) && loginUserCode.Contains("admin")) || departStatus != (int)FMDepartmentStatus. || ahRole != null)
{
result = this.GetOrderPageEntities<T_FO_PRE_SHIFT_MEETING_RECORD>(express, pageFilter);
}

View File

@ -258,12 +258,12 @@ namespace APT.FO.WebApi.Controllers.Api.FO
pageFilter.Include.Add("Nav_Taem");
var result = new PagedActionResult<T_FO_TEAM_ACTIVITY>();
var loginDepartmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = APT.Infrastructure.Api.AppContext.CurrentSession.UserCode;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = this.GetEntity<T_FM_USER>(t => t.ID == loginUserId && t.ENABLE_STATUS == 0)?.CODE;
//安环部负责人departmentID
var departStatus = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == loginDepartmentId && t.ENABLE_STATUS == 0)?.DEPARTMENT_STATUS;
var ahRole = this.GetEntity<T_FM_USER_BELONG_ROLE>(t => t.Nav_BelongRole != null && t.Nav_BelongRole.NAME.Contains("安环") && t.USER_ID == loginUserId);
if (loginUserCode.Contains("admin") || departStatus != (int)FMDepartmentStatus. || ahRole != null)
if ((!string.IsNullOrEmpty(loginUserCode) && loginUserCode.Contains("admin")) || departStatus != (int)FMDepartmentStatus. || ahRole != null)
{
result = this.GetOrderPageEntities<T_FO_TEAM_ACTIVITY>(null, pageFilter);
}

View File

@ -786,11 +786,11 @@ namespace APT.FO.WebApi.Controllers
var result = new PagedActionResult<T_FO_TECH_DISCLOSURE_FROM>();
var loginDepartmentId = APT.Infrastructure.Api.AppContext.CurrentSession.DepartmentID;
var loginUserId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;
var loginUserCode = APT.Infrastructure.Api.AppContext.CurrentSession.UserCode;
var loginUserCode = this.GetEntity<T_FM_USER>(t => t.ID == loginUserId && t.ENABLE_STATUS == 0)?.CODE;
//安环部负责人departmentID
var departStatus = this.GetEntity<T_FM_DEPARTMENT>(t => t.ID == loginDepartmentId && t.ENABLE_STATUS == 0)?.DEPARTMENT_STATUS;
var ahRole = this.GetEntity<T_FM_USER_BELONG_ROLE>(t => t.Nav_BelongRole != null && t.Nav_BelongRole.NAME.Contains("安环") && t.USER_ID == loginUserId);
if (loginUserCode.Contains("admin") || departStatus != (int)FMDepartmentStatus. || ahRole != null)
if ((!string.IsNullOrEmpty(loginUserCode) && loginUserCode.Contains("admin")) || departStatus != (int)FMDepartmentStatus. || ahRole != null)
{
result = this.GetOrderPageEntities<T_FO_TECH_DISCLOSURE_FROM>(null, pageFilter);
}