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

发布考试新增后台验证

parent c64d17fb
......@@ -61,7 +61,7 @@ namespace Edu.Model.Entity.Exam
/// <summary>
/// 删除状态
/// </summary>
public int Status { get; set; }
public Common.Enum.DateStateEnum Status { get; set; }
/// <summary>
/// 组卷类型(1-智能组卷,2-手动组卷,3-智能导入)
......
......@@ -121,7 +121,8 @@ WHERE 1=1
SELECT A.*
FROM RB_Examination_Paper AS A
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.Group_Id > 0)
......
......@@ -509,15 +509,28 @@ namespace Edu.WebApi.Controllers.Exam
IsHalfScore = base.ParmJObj.GetInt("IsHalfScore"),
PublishPic=base.ParmJObj.GetStringValue("PublishPic"),
};
if (model.ExamStartTime > model.ExamEndTime)
{
return ApiResult.ParamIsNull("考试开始时间不能大于结束时间!");
}
var studentStr = base.ParmJObj.GetStringValue("StudentList");
if (!string.IsNullOrEmpty(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.CreateTime = DateTime.Now;
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