From 4abb69942e3b291c1ddd1f5ab70e86fd17a38ead Mon Sep 17 00:00:00 2001
From: 10191 <506754232@qq.com>
Date: Mon, 9 Oct 2023 11:13:43 +0800
Subject: [PATCH] 1009
---
SGGL/BLL/API/APIPersonService.cs | 81 +++++++++++++++++--
.../HSSE/Check/CheckSpecialEdit.aspx.cs | 2 +-
.../FineUIPro.Web/HSSE/EduTrain/TaskView.aspx | 6 ++
.../HSSE/EduTrain/TaskView.aspx.cs | 2 +-
4 files changed, 84 insertions(+), 7 deletions(-)
diff --git a/SGGL/BLL/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs
index d48495e9..d6020e5b 100644
--- a/SGGL/BLL/API/APIPersonService.cs
+++ b/SGGL/BLL/API/APIPersonService.cs
@@ -1,4 +1,5 @@
-using Model;
+using Microsoft.SqlServer.Dts.Runtime;
+using Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SgManager.AI;
@@ -535,8 +536,29 @@ namespace BLL
if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat == false))
{
- foreach (var item in getPersons)
- {
+ 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.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 == null && y.TrainTypeId == trainTypeId && x.CheckResult == true && x.PersonId == item.PersonId
@@ -554,9 +576,12 @@ namespace BLL
}
}
return getTrainPersonList;
- }
+ }
else
{
+
+
+
return getPersons.ToList();
}
}
@@ -635,17 +660,36 @@ namespace BLL
var getTrainType = TrainTypeService.GetTrainTypeById(trainTypeId);
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 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
+ 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)
{
@@ -681,6 +725,33 @@ namespace BLL
}
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();
diff --git a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecialEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecialEdit.aspx.cs
index 1ec25216..20046fe7 100644
--- a/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecialEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/Check/CheckSpecialEdit.aspx.cs
@@ -199,7 +199,7 @@ namespace FineUIPro.Web.HSSE.Check
if (e.CommandName == "attchUrl")
{
- PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CheckSpecial&menuId={1}&edit=1", itemId, BLL.Const.ProjectCheckSpecialMenuId)));
+ PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CheckSpecial&menuId={1}&type=0", itemId, BLL.Const.ProjectCheckSpecialMenuId)));
}
}
diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx b/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx
index 71e87765..5bfed5dd 100644
--- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx
@@ -38,6 +38,12 @@
<%--
--%>
+
+
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx.cs
index 51fcd7e1..47112101 100644
--- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx.cs
@@ -97,7 +97,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
private void BindGrid()
{
- string strSql = @"select TrainingItemId,d.TrainingCode,c.TrainingId,d.TrainingName, b.[TrainingItemCode],b.[TrainingItemName],b.[AttachUrl], c.TrainingItemCode,c.TrainingItemName from
+ string strSql = @"select TrainingItemId,d.TrainingCode,c.TrainingId,d.TrainingName, b.[TrainingItemCode],b.[TrainingItemName],b.LearnTime,b.VideoProgress,b.[AttachUrl], c.TrainingItemCode,c.TrainingItemName from
[dbo].[Training_Task] a
left join [dbo].[Training_TaskItem] b on a.[TaskId]=b.[TaskId]
left join Training_TrainingItem c on b.TrainingItemCode=c.TrainingItemCode