Commit 99b8e8c2 authored by 黄奎's avatar 黄奎

发布考试新增后台验证

parent c64d17fb
...@@ -61,7 +61,7 @@ namespace Edu.Model.Entity.Exam ...@@ -61,7 +61,7 @@ namespace Edu.Model.Entity.Exam
/// <summary> /// <summary>
/// 删除状态 /// 删除状态
/// </summary> /// </summary>
public int Status { get; set; } public Common.Enum.DateStateEnum Status { get; set; }
/// <summary> /// <summary>
/// 组卷类型(1-智能组卷,2-手动组卷,3-智能导入) /// 组卷类型(1-智能组卷,2-手动组卷,3-智能导入)
......
...@@ -121,7 +121,8 @@ WHERE 1=1 ...@@ -121,7 +121,8 @@ WHERE 1=1
SELECT A.* SELECT A.*
FROM RB_Examination_Paper AS A FROM RB_Examination_Paper AS A
WHERE 1=1 WHERE 1=1
"); ");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Examination_Paper_ViewModel.Status), (int)Common.Enum.DateStateEnum.Normal);
if (query != null) if (query != null)
{ {
if (query.Group_Id > 0) if (query.Group_Id > 0)
......
...@@ -509,15 +509,28 @@ namespace Edu.WebApi.Controllers.Exam ...@@ -509,15 +509,28 @@ namespace Edu.WebApi.Controllers.Exam
IsHalfScore = base.ParmJObj.GetInt("IsHalfScore"), IsHalfScore = base.ParmJObj.GetInt("IsHalfScore"),
PublishPic=base.ParmJObj.GetStringValue("PublishPic"), PublishPic=base.ParmJObj.GetStringValue("PublishPic"),
}; };
if (model.ExamStartTime > model.ExamEndTime)
{
return ApiResult.ParamIsNull("考试开始时间不能大于结束时间!");
}
var studentStr = base.ParmJObj.GetStringValue("StudentList"); var studentStr = base.ParmJObj.GetStringValue("StudentList");
if (!string.IsNullOrEmpty(studentStr)) if (!string.IsNullOrEmpty(studentStr))
{ {
model.StudentList = Common.Plugin.JsonHelper.DeserializeObject<List<RB_Examination_Student_ViewModel>>(studentStr); model.StudentList = Common.Plugin.JsonHelper.DeserializeObject<List<RB_Examination_Student_ViewModel>>(studentStr);
} }
if (model.StudentList == null || (model.StudentList != null && model.StudentList.Count == 0))
{
return ApiResult.ParamIsNull("请选择考试学员!");
}
if (string.IsNullOrEmpty(base.ParmJObj.GetStringValue("ExamStartTime")))
{
return ApiResult.ParamIsNull("请选择考试开始时间!");
}
if (string.IsNullOrEmpty(base.ParmJObj.GetStringValue("ExamEndTime")))
{
return ApiResult.ParamIsNull("请选择考试结束时间!");
}
if (model.ExamStartTime > model.ExamEndTime)
{
return ApiResult.ParamIsNull("考试开始时间不能大于结束时间!");
}
model.CreateBy = base.UserInfo.Id; model.CreateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now; model.CreateTime = DateTime.Now;
model.Group_Id = base.UserInfo.Group_Id; model.Group_Id = base.UserInfo.Group_Id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment