1009
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user