三级安全教育在线考试
This commit is contained in:
parent
3bc9a80abd
commit
74fdf556ae
@ -221,9 +221,6 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
|||||||
//金源培训 9 ~ 15 可以触发一次
|
//金源培训 9 ~ 15 可以触发一次
|
||||||
if (currTime.Hour == 8 || currTime.Hour == 9)
|
if (currTime.Hour == 8 || currTime.Hour == 9)
|
||||||
{
|
{
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var orgId = filter.GetOrgId();
|
var orgId = filter.GetOrgId();
|
||||||
var newUsers = GetEntities<T_SE_USER_TEMP>(t => t.IS_SEND == 0, new BaseFilter(orgId));
|
var newUsers = GetEntities<T_SE_USER_TEMP>(t => t.IS_SEND == 0, new BaseFilter(orgId));
|
||||||
if (!newUsers.Any() || newUsers.Count() < 1)
|
if (!newUsers.Any() || newUsers.Count() < 1)
|
||||||
@ -300,6 +297,7 @@ namespace APT.PP.WebApi.Controllers.Api.PP
|
|||||||
if (task != null)
|
if (task != null)
|
||||||
UpdateEntity(task);
|
UpdateEntity(task);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -302,17 +302,23 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
testFilter.Include = new string[] { "Nav_Points" };
|
testFilter.Include = new string[] { "Nav_Points" };
|
||||||
var currStatus = eduCard.TRAIN_STATUS;
|
var currStatus = eduCard.TRAIN_STATUS;
|
||||||
IEnumerable<T_SE_TEST_ENUM_POINT> pointS = new List<T_SE_TEST_ENUM_POINT>();
|
IEnumerable<T_SE_TEST_ENUM_POINT> pointS = new List<T_SE_TEST_ENUM_POINT>();
|
||||||
|
string PointName = "";
|
||||||
if (eduCard.TRAIN_STATUS == SEThreeLevelSafeTrainType.公司级)
|
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.部门级)
|
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.班组级)
|
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 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();
|
||||||
@ -324,12 +330,12 @@ namespace APT.SC.WebApi.Controllers.Api.SE
|
|||||||
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);
|
||||||
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>();
|
Nav_Papers = new List<T_SE_NEW_USER_DETAIL_PAPER>();
|
||||||
|
|
||||||
testidlist.ForEach(testid =>
|
testidlist.ForEach(testid =>
|
||||||
{
|
{
|
||||||
var p = new T_SE_NEW_USER_DETAIL_PAPER
|
var p = new T_SE_NEW_USER_DETAIL_PAPER
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user