This commit is contained in:
李超 2023-10-09 11:13:43 +08:00
parent aee661bdd1
commit 4abb69942e
4 changed files with 84 additions and 7 deletions

View File

@ -1,4 +1,5 @@
using Model; using Microsoft.SqlServer.Dts.Runtime;
using Model;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using SgManager.AI; using SgManager.AI;
@ -535,8 +536,29 @@ namespace BLL
if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat == false)) 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) 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 var getTrainPersonIdList1 = (from x in db.EduTrain_TrainRecordDetail
join y in db.EduTrain_TrainRecord on x.TrainingId equals y.TrainingId 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 where y.ProjectId == null && y.TrainTypeId == trainTypeId && x.CheckResult == true && x.PersonId == item.PersonId
@ -557,6 +579,9 @@ namespace BLL
} }
else else
{ {
return getPersons.ToList(); return getPersons.ToList();
} }
} }
@ -635,8 +660,26 @@ namespace BLL
var getTrainType = TrainTypeService.GetTrainTypeById(trainTypeId); var getTrainType = TrainTypeService.GetTrainTypeById(trainTypeId);
if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat == false)) 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) 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 var getTrainPersonIdList1 = (from x in db.EduTrain_TrainRecordDetail
join y in db.EduTrain_TrainRecord on x.TrainingId equals y.TrainingId 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
@ -646,6 +689,7 @@ namespace BLL
var getTrainPersonIdList2 = (from x in db.Training_Task var getTrainPersonIdList2 = (from x in db.Training_Task
join y in db.Training_Plan on x.PlanId equals y.PlanId 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 where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.UserId == item.PersonId
select x).FirstOrDefault(); select x).FirstOrDefault();
if (getTrainPersonIdList2 == null) if (getTrainPersonIdList2 == null)
{ {
@ -681,6 +725,33 @@ namespace BLL
} }
return getTrainPersonList; 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 else
{ {
return getPersons.ToList(); return getPersons.ToList();

View File

@ -199,7 +199,7 @@ namespace FineUIPro.Web.HSSE.Check
if (e.CommandName == "attchUrl") 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)));
} }
} }

View File

@ -38,6 +38,12 @@
<%--<f:RenderField Width="350px" ColumnID="Summary" DataField="Summary" FieldType="String" <%--<f:RenderField Width="350px" ColumnID="Summary" DataField="Summary" FieldType="String"
HeaderText="教材内容" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true"> HeaderText="教材内容" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true">
</f:RenderField>--%> </f:RenderField>--%>
<f:RenderField Width="200px" ColumnID="LearnTime" DataField="LearnTime" FieldType="String"
HeaderText="教材时长(分钟)" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="VideoProgress" DataField="VideoProgress" FieldType="String"
HeaderText="学习时长(分钟)" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
</Columns> </Columns>
<Listeners> <Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" /> <f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />

View File

@ -97,7 +97,7 @@ namespace FineUIPro.Web.HSSE.EduTrain
private void BindGrid() 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 [dbo].[Training_Task] a
left join [dbo].[Training_TaskItem] b on a.[TaskId]=b.[TaskId] left join [dbo].[Training_TaskItem] b on a.[TaskId]=b.[TaskId]
left join Training_TrainingItem c on b.TrainingItemCode=c.TrainingItemCode left join Training_TrainingItem c on b.TrainingItemCode=c.TrainingItemCode