培训教育答题
岗位责任制 判断处理
This commit is contained in:
parent
815fc4ccae
commit
7aab9367ce
@ -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);
|
||||||
var currPerson = GetEntity<T_FM_PERSON>(currUser.PERSON_ID.Value);
|
if (currUser.DEPARTMENT_ID.HasValue)
|
||||||
var departInfo = GetEntity<T_FM_DEPARTMENT>(currUser.DEPARTMENT_ID.Value);
|
{
|
||||||
GetOG001(entity.TaskID, currUser, currPerson, departInfo, ref signRecord, ref signPost, ref sendNotice);
|
var currPerson = GetEntity<T_FM_PERSON>(currUser.PERSON_ID.Value);
|
||||||
|
var departInfo = GetEntity<T_FM_DEPARTMENT>(currUser.DEPARTMENT_ID.Value);
|
||||||
|
GetOG001(entity.TaskID, currUser, currPerson, departInfo, ref signRecord, ref signPost, ref sendNotice);
|
||||||
|
}
|
||||||
|
|
||||||
UnifiedCommit(() =>
|
UnifiedCommit(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user