From 8f471923bf316ef4cfa5d585d0e1e134905ba0c0 Mon Sep 17 00:00:00 2001
From: geh <1923421292@qq.com>
Date: Tue, 18 Feb 2025 15:05:47 +0800
Subject: [PATCH 1/4] =?UTF-8?q?fix:=E7=A7=BB=E6=88=90=E8=BE=BE=E5=9F=B9?=
=?UTF-8?q?=E8=AE=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
DataBase/版本日志/SGGLDB_V2025-02-17-geh.sql | 38 +++
SGGL/BLL/API/APIPersonService.cs | 196 ++++++++++-----
SGGL/BLL/Common/Const.cs | 4 +
SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 5 +-
.../HSSE/EduTrain/CompanyTraining.aspx | 4 +-
.../EduTrain/CompanyTrainingItemSave.aspx | 61 +++++
.../EduTrain/CompanyTrainingItemSave.aspx.cs | 70 +++++-
.../CompanyTrainingItemSave.aspx.designer.cs | 67 ++++--
.../FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx | 23 +-
.../HSSE/EduTrain/PlanEdit.aspx.cs | 26 +-
.../HSSE/EduTrain/PlanEdit.aspx.designer.cs | 9 +
SGGL/FineUIPro.Web/HSSE/EduTrain/Task.aspx.cs | 10 +-
.../FineUIPro.Web/HSSE/EduTrain/TaskView.aspx | 25 +-
.../HSSE/EduTrain/TaskView.aspx.cs | 68 +++---
.../HSSE/EduTrain/TaskView.aspx.designer.cs | 48 ++--
.../HSSE/EduTrain/TestRecord.aspx | 8 +-
.../HSSE/EduTrain/TestRecord.aspx.cs | 22 +-
.../HSSE/EduTrain/TestRecord.aspx.designer.cs | 65 ++---
.../HSSE/EduTrain/TestStatistics.aspx | 6 +-
.../HSSE/EduTrain/TestStatistics.aspx.cs | 21 +-
.../EduTrain/TestStatistics.aspx.designer.cs | 48 ++--
.../HSSE/EduTrain/TrainRecord.aspx | 208 ++++++++--------
.../HSSE/EduTrain/TrainRecord.aspx.cs | 227 ++++++++++++++++--
.../EduTrain/TrainRecord.aspx.designer.cs | 111 ++++++---
.../HSSE/EduTrain/TrainRecordEdit.aspx.cs | 5 +
.../HSSE/EduTrain/Trainingrecords.aspx | 137 +++++++++++
.../HSSE/EduTrain/Trainingrecords.aspx.cs | 216 +++++++++++++++++
.../EduTrain/Trainingrecords.aspx.designer.cs | 179 ++++++++++++++
SGGL/Model/Model.cs | 120 +++++++++
SGGL/WebAPI/Controllers/PersonController.cs | 4 +-
30 files changed, 1678 insertions(+), 353 deletions(-)
create mode 100644 DataBase/版本日志/SGGLDB_V2025-02-17-geh.sql
create mode 100644 SGGL/FineUIPro.Web/HSSE/EduTrain/Trainingrecords.aspx
create mode 100644 SGGL/FineUIPro.Web/HSSE/EduTrain/Trainingrecords.aspx.cs
create mode 100644 SGGL/FineUIPro.Web/HSSE/EduTrain/Trainingrecords.aspx.designer.cs
diff --git a/DataBase/版本日志/SGGLDB_V2025-02-17-geh.sql b/DataBase/版本日志/SGGLDB_V2025-02-17-geh.sql
new file mode 100644
index 0000000..fae4d11
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2025-02-17-geh.sql
@@ -0,0 +1,38 @@
+alter table dbo.Training_TestPlan add TrainTypeId nvarchar(50);
+go
+
+
+alter TABLE [dbo].[Training_CompanyTrainingItem]add
+ [TestTrainingIds] [nvarchar](max) NULL ;
+
+alter TABLE [dbo].[Training_CompanyTrainingItem]add
+ [LearningTime] [int] NULL ;
+
+alter TABLE [dbo].[Training_CompanyTrainingItem]add
+ [Durations] [float](53) NULL ;
+
+alter TABLE [dbo].[Training_TestRecord]add
+ [CompanyTrainingItemId] [nvarchar](50) NULL ;
+
+update sys_menu set IsUsed=0 where menuid='EF99E038-5A12-4E02-B925-6671F9AE16CA';
+update sys_menu set IsUsed=0 where menuid='10736CAC-A343-4D73-9D03-E6A3D1909A7B';
+update sys_menu set IsUsed=0 where menuid='6C314522-AF62-4476-893E-5F42C09C3077';
+update sys_menu set menuname='ѵ¼' where menuid='1182E353-FAB9-4DB1-A1EC-F41A00892128';
+insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
+values('ACF2CAB1-CE56-4CED-B252-692558F9E36F','ѵ¼','HSSE/EduTrain/Trainingrecords.aspx',50,'6A0506EB-05CE-4BB3-9BA9-866389F01E1C','Menu_HSSE',0,1,1);
+go
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SGGL/BLL/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs
index 6ad72c7..971e790 100644
--- a/SGGL/BLL/API/APIPersonService.cs
+++ b/SGGL/BLL/API/APIPersonService.cs
@@ -476,73 +476,159 @@ namespace BLL
/// 培训岗位ID
/// 培训类型ID
///
- public static List getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId)
+ public static List getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId,string InTime,string strParam)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
+ DateTime inDateTime=DateTime.Now;
+ if (!string.IsNullOrEmpty(InTime)&&!"null".Equals(InTime))
+ {
+ inDateTime = DateTime.Parse(InTime);
+ }
+
List unitIdList = Funs.GetStrListByStr(unitIds, ',');
- var getPersons = from x in db.View_SitePerson_Person
- where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == true
+ var getPersons = (from x in db.View_SitePerson_Person
+ where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == true &&(string.IsNullOrEmpty(strParam)||x.PersonName.Contains(strParam)) && (string.IsNullOrEmpty(InTime) || x.InTime < inDateTime)
&& x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now)
select new Model.PersonItem
- {
- PersonId = x.PersonId,
- CardNo = x.CardNo,
- PersonName = x.PersonName,
- SexName = x.SexName,
- IdentityCard = x.IdentityCard,
- Address = x.Address,
- ProjectId = x.ProjectId,
- ProjectCode = x.ProjectCode,
- ProjectName = x.ProjectName,
- UnitId = x.UnitId,
- UnitCode = x.UnitCode,
- UnitName = x.UnitName,
- TeamGroupId = x.TeamGroupId,
- TeamGroupName = x.TeamGroupName,
- WorkPostId = x.WorkPostId,
- WorkPostName = x.WorkPostName,
- InTime = string.Format("{0:yyyy-MM-dd}", x.InTime),
- OutTime = string.Format("{0:yyyy-MM-dd}", x.OutTime),
- OutResult = x.OutResult,
- Telephone = x.Telephone,
- PhotoUrl = x.PhotoUrl,
- DepartName = x.DepartName,
- };
+ {
+ PersonId = x.PersonId,
+ CardNo = x.CardNo,
+ PersonName = x.PersonName,
+ SexName = x.SexName,
+ IdentityCard = x.IdentityCard,
+ Address = x.Address,
+ ProjectId = x.ProjectId,
+ ProjectCode = x.ProjectCode,
+ ProjectName = x.ProjectName,
+ UnitId = x.UnitId,
+ UnitCode = x.UnitCode,
+ UnitName = x.UnitName,
+ TeamGroupId = x.TeamGroupId,
+ TeamGroupName = x.TeamGroupName,
+ WorkPostId = x.WorkPostId,
+ WorkPostName = x.WorkPostName,
+ InTime = string.Format("{0:yyyy-MM-dd}", x.InTime),
+ OutTime = string.Format("{0:yyyy-MM-dd}", x.OutTime),
+ OutResult = x.OutResult,
+ Telephone = x.Telephone,
+ PhotoUrl = x.PhotoUrl,
+ DepartName = x.DepartName,
+ }).ToList();
+
+
+
+
if (!string.IsNullOrEmpty(workPostIds))
{
List workPostIdList = Funs.GetStrListByStr(workPostIds, ',');
- getPersons = getPersons.Where(x => workPostIdList.Contains(x.WorkPostId));
+ getPersons = getPersons.Where(x => workPostIdList.Contains(x.WorkPostId)).ToList();
+ }
+ if (!string.IsNullOrEmpty(trainTypeId) &&trainTypeId == Const.SpecialSafeTrainId)//专项安全培训
+ {
+ var ids = db.Base_WorkPost.Where(x => x.PostType == "2").Select(x => x.WorkPostId).ToList();
+ getPersons = getPersons.Where(x => ids.Contains(x.WorkPostId)).ToList();
}
-
List getTrainPersonList = new List();
var getTrainType = TrainTypeService.GetTrainTypeById(trainTypeId);
- if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat == false))
- {
- foreach (var item in getPersons)
- {
- var getTrainPersonIdList1 = (from x in db.EduTrain_TrainRecordDetail
- join y in db.EduTrain_TrainRecord on x.TrainingId equals y.TrainingId
- where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && x.CheckResult == true && x.PersonId == item.PersonId
- select x).FirstOrDefault();
- if (getTrainPersonIdList1 == null)
- {
- var getTrainPersonIdList2 = (from x in db.Training_Task
- join y in db.Training_Plan on x.PlanId equals y.PlanId
- where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.UserId == item.PersonId
- select x).FirstOrDefault();
- if (getTrainPersonIdList2 == null)
- {
- getTrainPersonList.Add(item);
- }
- }
- }
- return getTrainPersonList;
- }
- else
- {
- return getPersons.ToList();
- }
+ if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat.Value == false))
+ {
+ int score = 80;
+ var sysTestRule = db.Sys_TestRule.FirstOrDefault();
+ if (sysTestRule != null)
+ {
+ if (sysTestRule.PassingScore > 0)
+ {
+ score = sysTestRule.PassingScore;
+ }
+ }
+ foreach (var item in getPersons)
+ {
+ var getTrainPersonIdList3 = (from x in db.Training_TestRecord
+ join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
+ where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.TestManId == item.PersonId
+ where x.TestScores > score
+ select x).FirstOrDefault();
+ if (getTrainPersonIdList3 != null)
+ {
+ continue;
+ }
+ var getTrainPersonIdList1 = (from x in db.EduTrain_TrainRecordDetail
+ join y in db.EduTrain_TrainRecord on x.TrainingId equals y.TrainingId
+ where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && x.CheckResult == true && x.PersonId == item.PersonId
+ select x).FirstOrDefault();
+ if (getTrainPersonIdList1 == null)
+ {
+ var getTrainPersonIdList2 = (from x in db.Training_Task
+ join y in db.Training_Plan on x.PlanId equals y.PlanId
+ where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.UserId == item.PersonId
+
+ select x).FirstOrDefault();
+ if (getTrainPersonIdList2 == null)
+ {
+ getTrainPersonList.Add(item);
+ }
+ }
+ }
+ return getTrainPersonList;
+ }
+ else if (getTrainType != null && getTrainType.IsRepeat.HasValue && getTrainType.IsRepeat.Value == true)//重复的 过滤人员
+ {
+ foreach (var item in getPersons)
+ {
+ //int score = 80;
+ //var sysTestRule = db.Sys_TestRule.FirstOrDefault();
+ //if (sysTestRule != null)
+ //{
+ // if (sysTestRule.PassingScore > 0)
+ // {
+ // score = sysTestRule.PassingScore;
+ // }
+ //}
+ //var getTrainPersonIdList2 = (from x in db.Training_TestRecord
+ // join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
+ // where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.TestManId == item.PersonId
+ // where x.TestScores > score
+ // select x).FirstOrDefault();
+ //if (getTrainPersonIdList2 != null)
+ //{
+ // continue;
+ //}
+ getTrainPersonList.Add(item);
+ }
+ return getTrainPersonList;
+ }
+ //else if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat == false))//重复的 过滤人员
+ //{
+ // int score = 80;
+ // var sysTestRule = db.Sys_TestRule.FirstOrDefault();
+ // if (sysTestRule != null)
+ // {
+ // if (sysTestRule.PassingScore > 0)
+ // {
+ // score = sysTestRule.PassingScore;
+ // }
+ // }
+ // foreach (var item in getPersons)
+ // {
+
+ // var getTrainPersonIdList2 = (from x in db.Training_TestRecord
+ // join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
+ // where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.TestManId == item.PersonId
+ // where x.TestScores > score
+ // select x).FirstOrDefault();
+ // if (getTrainPersonIdList2 != null)
+ // {
+ // continue;
+ // }
+ // getTrainPersonList.Add(item);
+ // }
+ // return getTrainPersonList;
+ //}
+ else
+ {
+ return getPersons.ToList();
+ }
}
}
#endregion
diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs
index 5175135..8504eaf 100644
--- a/SGGL/BLL/Common/Const.cs
+++ b/SGGL/BLL/Common/Const.cs
@@ -6233,6 +6233,10 @@ namespace BLL
public const string InterFaceSetMenuId = "FFD221D7-AE05-447F-8727-80058A04F401";
public const string InterFaceTaskMenuId = "FFD221D7-AE05-447F-8727-80058A04F402";
public const string IFLogListMenuId = "FFD221D7-AE05-447F-8727-80058A04F404";
+ ///
+ /// 专项安全培训 id
+ ///
+ public static string SpecialSafeTrainId = "0e7fdf78-eaa0-4d00-a60b-490040bbea18";
#endregion
#region 数据同步状态
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index 6477a1e..f4b84e4 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -1875,6 +1875,7 @@
+
@@ -12733,6 +12734,8 @@
TaskNoticeEdit.aspx
+
+
TrainTestRecordEdit.aspx
ASPXCodeBehind
@@ -19573,7 +19576,7 @@
-
+