三级安全教育在线考试

This commit is contained in:
wyw 2025-11-25 21:14:54 +08:00
parent 3bc9a80abd
commit 74fdf556ae
2 changed files with 85 additions and 81 deletions

View File

@ -221,9 +221,6 @@ namespace APT.PP.WebApi.Controllers.Api.PP
//金源培训 9 ~ 15 可以触发一次
if (currTime.Hour == 8 || currTime.Hour == 9)
{
return true;
}
var orgId = filter.GetOrgId();
var newUsers = GetEntities<T_SE_USER_TEMP>(t => t.IS_SEND == 0, new BaseFilter(orgId));
if (!newUsers.Any() || newUsers.Count() < 1)
@ -300,6 +297,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP
if (task != null)
UpdateEntity(task);
});
}
return true;
});
}

View File

@ -302,17 +302,23 @@ namespace APT.SC.WebApi.Controllers.Api.SE
testFilter.Include = new string[] { "Nav_Points" };
var currStatus = eduCard.TRAIN_STATUS;
IEnumerable<T_SE_TEST_ENUM_POINT> pointS = new List<T_SE_TEST_ENUM_POINT>();
string PointName = "";
if (eduCard.TRAIN_STATUS == SEThreeLevelSafeTrainType.)
{
pointS = GetEntities<T_SE_TEST_ENUM_POINT>(t => t.NAME == "三级安全教育-公司级", new BaseFilter(orgId));
PointName = "三级安全教育-公司级";
}
else if (eduCard.TRAIN_STATUS == SEThreeLevelSafeTrainType.)
{
pointS = GetEntities<T_SE_TEST_ENUM_POINT>(t => t.NAME == "三级安全教育-部门级", new BaseFilter(orgId));
PointName = "三级安全教育-部门级";
}
else if (eduCard.TRAIN_STATUS == SEThreeLevelSafeTrainType.)
{
pointS = GetEntities<T_SE_TEST_ENUM_POINT>(t => t.NAME == "三级安全教育-班组级", new BaseFilter(orgId));
PointName = "三级安全教育-班组级";
}
pointS = GetEntities<T_SE_TEST_ENUM_POINT>(t => t.NAME == PointName, new BaseFilter(orgId));
if (pointS == null || pointS.Count() < 1)
{
throw new Exception("未找到试题知识点【" + PointName + "】的配置信息,请沟通管理员完善知识点和题库!");
}
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();
@ -324,12 +330,12 @@ namespace APT.SC.WebApi.Controllers.Api.SE
CreateTestList(allTests, testidlist, pointIDS, (int)SETestTypeEnum., CCount);
CreateTestList(allTests, testidlist, pointIDS, (int)SETestTypeEnum., SCount);
CreateTestList(allTests, testidlist, pointIDS, (int)SETestTypeEnum., MCount);
if (testidlist.Count == 0)
if (testidlist.Count == 0 || testidlist.Count < (SCount + MCount + CCount))
{
throw new Exception("当前题库数据不足,未能正常生成试卷!");
throw new Exception("当前题库数据不足,未能正常生成试卷! 知识点:" + PointName + "是非题:" + CCount + "单选题:" + SCount + "多选题:" + MCount + "");
}
Nav_Papers = new List<T_SE_NEW_USER_DETAIL_PAPER>();
testidlist.ForEach(testid =>
{
var p = new T_SE_NEW_USER_DETAIL_PAPER