This commit is contained in:
geh
2025-05-09 16:34:49 +08:00
parent 7a81d04d48
commit 09373c4a0e
3 changed files with 132 additions and 37 deletions
@@ -445,15 +445,30 @@ namespace WebAPI.Controllers
var person = Funs.DB.View_SitePerson_Person.FirstOrDefault(x => x.PersonId == personId);
if (person != null)
{
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
string testRecordId = string.Empty;
Model.Training_TestRecord testRecord = Funs.DB.Training_TestRecord
.Where(e => e.ProjectId == projectId && e.TestManId == personId && e.TestScores == null)
.OrderByDescending(e => e.TestStartTime)
.FirstOrDefault();
if (testRecord != null)
{
TestRecordId = SQLHelper.GetNewID(),
ProjectId = projectId,
TestManId = person.PersonId
};
TestRecordService.AddTestRecord(newTestRecord);
testRecordId = testRecord.TestRecordId;
}
else
{
Model.SUBQHSEDB db = Funs.DB;
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
{
TestRecordId = SQLHelper.GetNewID(),
ProjectId = projectId,
TestManId = personId,
Duration = 60,
};
db.Training_TestRecord.InsertOnSubmit(newTestRecord);
db.SubmitChanges();
testRecordId = CreateTestRecordItemNew(newTestRecord.TestRecordId, person);
}
var testRecordId = CreateTestRecordItemNew(newTestRecord.TestRecordId, person);
responeData.code = 1;
responeData.data = new { testRecordId };
}
@@ -473,7 +488,8 @@ namespace WebAPI.Controllers
using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString))
{
var getTestTrainingItemList = (from x in Funs.DB.Training_TestTrainingItem
where x.TrainingId == "99ccf4c8-6f8e-47da-a900-53b12a278f25" &&
join y in Funs.DB.Training_TestTraining on x.TrainingId equals y.TrainingId
where y.TrainingName.Contains("岗位人员试题") &&
x.WorkPostNames.Contains(person.WorkPostName)
orderby x.TestType, x.TrainingItemCode
select new