培训教育答题

岗位责任制 判断处理
This commit is contained in:
wyw 2025-11-25 21:43:16 +08:00
parent 815fc4ccae
commit 7aab9367ce

View File

@ -322,11 +322,48 @@ namespace APT.SC.WebApi.Controllers.Api.SE
} }
var pointIDS = pointS.Select(t => t.ID).ToList(); var pointIDS = pointS.Select(t => t.ID).ToList();
var allTests = GetEntities<T_SE_TEST>(st => st.Nav_Points.Any(pt => pointIDS.Contains((Guid)pt.POINT_ID)), testFilter).ToList(); var allTests = GetEntities<T_SE_TEST>(st => st.Nav_Points.Any(pt => pointIDS.Contains((Guid)pt.POINT_ID)), testFilter).ToList();
//var errorMsg = "";
//if (errorMsg != "")
//{
// throw new Exception("知识点 " + errorMsg + " 没有题目!");
//}
var errorMsg = ""; var errorMsg = "";
foreach (var testPoint in pointIDS)
{
var havepoint = allTests.Where(st => st.Nav_Points.Any(pt => pt.POINT_ID == testPoint));
if (havepoint.Count() < 1)
{
var noPoint = GetEntity<T_SE_TEST_ENUM_POINT>(testPoint);
errorMsg += noPoint.NAME + ",";
}
}
if (errorMsg != "") if (errorMsg != "")
{ {
throw new Exception("知识点 " + errorMsg + " 没有题目!"); throw new Exception("知识点 " + errorMsg + " 没有题目!");
} }
var SCurrentCount = allTests.Count(t => t.TYPE == SETestTypeEnum.);
var MCurrentCount = allTests.Count(t => t.TYPE == SETestTypeEnum.);
var CCurrentCount = allTests.Count(t => t.TYPE == SETestTypeEnum.);
errorMsg = "";
if (SCurrentCount < SCount)
{
errorMsg += "题库中题目数量不足!";
errorMsg += "单选题还需" + (SCount - SCurrentCount) + "题\n";
}
if (MCurrentCount < MCount)
{
errorMsg += "题库中题目数量不足!";
errorMsg += "多选题还需" + (MCount - MCurrentCount) + "题\n";
}
if (CCurrentCount < CCount)
{
errorMsg += "题库中题目数量不足!";
errorMsg += "是非题还需" + (CCount - CCurrentCount) + "题\n";
}
if (errorMsg != "")
{
throw new Exception(errorMsg);
}
CreateTestList(allTests, testidlist, pointIDS, (int)SETestTypeEnum., CCount); CreateTestList(allTests, testidlist, pointIDS, (int)SETestTypeEnum., CCount);
CreateTestList(allTests, testidlist, pointIDS, (int)SETestTypeEnum., SCount); CreateTestList(allTests, testidlist, pointIDS, (int)SETestTypeEnum., SCount);
CreateTestList(allTests, testidlist, pointIDS, (int)SETestTypeEnum., MCount); CreateTestList(allTests, testidlist, pointIDS, (int)SETestTypeEnum., MCount);
@ -548,9 +585,12 @@ namespace APT.SC.WebApi.Controllers.Api.SE
T_OG_SAFE_PDT_SIGNED signRecord = null; T_OG_SAFE_PDT_SIGNED signRecord = null;
T_OG_SAFE_PDT_SIGNED_POST signPost = null; T_OG_SAFE_PDT_SIGNED_POST signPost = null;
var currUser = GetEntity<T_FM_USER>(APT.Infrastructure.Api.AppContext.CurrentSession.UserID.Value); var currUser = GetEntity<T_FM_USER>(APT.Infrastructure.Api.AppContext.CurrentSession.UserID.Value);
if (currUser.DEPARTMENT_ID.HasValue)
{
var currPerson = GetEntity<T_FM_PERSON>(currUser.PERSON_ID.Value); var currPerson = GetEntity<T_FM_PERSON>(currUser.PERSON_ID.Value);
var departInfo = GetEntity<T_FM_DEPARTMENT>(currUser.DEPARTMENT_ID.Value); var departInfo = GetEntity<T_FM_DEPARTMENT>(currUser.DEPARTMENT_ID.Value);
GetOG001(entity.TaskID, currUser, currPerson, departInfo, ref signRecord, ref signPost, ref sendNotice); GetOG001(entity.TaskID, currUser, currPerson, departInfo, ref signRecord, ref signPost, ref sendNotice);
}
UnifiedCommit(() => UnifiedCommit(() =>
{ {