diff --git a/DataBase/版本日志/SGGLDB_WH_V2024-09-11-phf.sql b/DataBase/版本日志/SGGLDB_WH_V2024-09-11-phf.sql
new file mode 100644
index 00000000..5ef0d067
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_WH_V2024-09-11-phf.sql
@@ -0,0 +1,5 @@
+
+CREATE NONCLUSTERED INDEX [t_d_facerecord_Projectid_Index]
+ON [dbo].[t_d_facerecord] ([ProjectId])
+INCLUDE ([ID],[EmployName],[DepartmentID],[DepartName],[AreaID],[AreaName],[EmployNO],[CardID],[RoleID],[DateTimeRecord],[RecordDes],[FaceIP],[InOrOut],[Des1],[Des2],[Des3],[Des4])
+;
\ No newline at end of file
diff --git a/SGGL/BLL/ProjectData/ProjectService.cs b/SGGL/BLL/ProjectData/ProjectService.cs
index 5d01ccf9..fcf65cef 100644
--- a/SGGL/BLL/ProjectData/ProjectService.cs
+++ b/SGGL/BLL/ProjectData/ProjectService.cs
@@ -326,7 +326,7 @@
/// 获取userId参与项目下拉框
///
///
- public static List GetProjectByUserIdStateDropDownList(string userId, string state)
+ public static List GetProjectByUserIdStateDropDownList(string userId, string state,string urlType="")
{
if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId)
{
@@ -340,20 +340,42 @@
{
/// 获取角色类型
var getRoleP = Funs.DB.Sys_RolePower.FirstOrDefault(x => x.RoleId == getUser.RoleId && x.IsOffice == false);
- if (getRoleP != null)
+ //如果是项目级别,获取到他的类型后,并且还要单位是五环的
+ if (!string.IsNullOrEmpty(urlType))
{
- return (from x in Funs.DB.Base_Project
- where x.ProjectState == state
- orderby x.ProjectCode descending
- select x).ToList();
+ //五环的能看所有项目,否则只能看项目用户中有自己或者所属单位是自己单位的
+ if (getRoleP != null && getUser.UnitId== Const.UnitId_CWCEC)
+ {
+ return (from x in Funs.DB.Base_Project
+ where x.ProjectState == state
+ orderby x.ProjectCode descending
+ select x).ToList();
+ }
+ else
+ {
+ return (from x in Funs.DB.Base_Project
+ join y in Funs.DB.Project_ProjectUser on x.ProjectId equals y.ProjectId
+ where ( (y.UserId == userId && y.IsPost == true)|| x.UnitId== getUser.UnitId) && x.ProjectState == state
+ orderby x.ProjectCode descending
+ select x).Distinct().ToList();
+ }
}
- else
- {
- return (from x in Funs.DB.Base_Project
- join y in Funs.DB.Project_ProjectUser on x.ProjectId equals y.ProjectId
- where y.UserId == userId && y.IsPost == true && x.ProjectState == state
- orderby x.ProjectCode descending
- select x).Distinct().ToList();
+ else {
+ if (getRoleP != null)
+ {
+ return (from x in Funs.DB.Base_Project
+ where x.ProjectState == state
+ orderby x.ProjectCode descending
+ select x).ToList();
+ }
+ else
+ {
+ return (from x in Funs.DB.Base_Project
+ join y in Funs.DB.Project_ProjectUser on x.ProjectId equals y.ProjectId
+ where y.UserId == userId && y.IsPost == true && x.ProjectState == state
+ orderby x.ProjectCode descending
+ select x).Distinct().ToList();
+ }
}
}
else
@@ -459,11 +481,11 @@
///
///
///
- public static void InitProjectShortNameByStateDropDownList(FineUIPro.DropDownList dropName, string userId, string state, bool isShowPlease)
+ public static void InitProjectShortNameByStateDropDownList(FineUIPro.DropDownList dropName, string userId, string state, bool isShowPlease,string urlType="")
{
dropName.DataValueField = "ProjectId";
dropName.DataTextField = "ProjectName";
- var projectlist = GetProjectByUserIdStateDropDownList(userId, state);
+ var projectlist = GetProjectByUserIdStateDropDownList(userId, state, urlType);
dropName.DataSource = projectlist;
dropName.DataBind();
if (projectlist.Count() == 0)
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index 77eed5c7..826e4ed2 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -19256,7 +19256,7 @@
-
+