Commit 0f4f367d authored by 黄奎's avatar 黄奎

页面修改

parent 48ef0d6c
......@@ -92,7 +92,10 @@ namespace Edu.Model.Entity.Exam
/// 审核人
/// </summary>
public int Reviewer { get; set; }
/// <summary>
/// 是否开放(1-私有,2-公开)
/// </summary>
public int IsOpen { get; set; }
}
}
......@@ -95,6 +95,9 @@ namespace Edu.Model.ViewModel.Exam
/// </summary>
public string ReviewerName { get; set; }
/// <summary>
/// 是否开发(1-私有,2-公开)
/// </summary>
public int IsOpen { get; set; }
}
}
......@@ -24,5 +24,10 @@ namespace Edu.Model.ViewModel.Exam
/// 父节点编号
/// </summary>
public int ParentId { get; set; }
/// <summary>
/// 是否开放(1-私有,2-公开)
/// </summary>
public int IsOpen { get; set; }
}
}
......@@ -137,6 +137,7 @@ namespace Edu.Module.Exam
ChildList = new List<ExaminationPaperTreeModel>(),
ExamineStatus = item.ExamineStatus,
Reviewer = item.Reviewer,
IsOpen=item.IsOpen,
ReviewerName = item.Reviewer > 0 ? (UserReidsCache.GetUserLoginInfo(item.Reviewer)?.AccountName ?? "") : ""
};
//model.ChildList = GetPaperChild(childList, detailsList, item.PaperId);
......@@ -406,19 +407,16 @@ namespace Edu.Module.Exam
CreateNum = model.TemplateNum,
PaperType = 1,
ParentId = model.ParentId,
IsOpen=model.IsOpen,
};
var newPaperId = examination_PaperRepository.Insert(paperModel);
paperModel.PaperId = newPaperId;
flag = newPaperId > 0;
var configureModel = new RB_Examination_Configure_ViewModel()
{
Group_Id = model.Group_Id,
};
var obj = GetExaminationConfigureModel(configureModel);
if (paperModel.CreateNum > 0)
{
for (var i = 0; i < paperModel.CreateNum; i++)
......@@ -438,6 +436,7 @@ namespace Edu.Module.Exam
CreateNum = model.TemplateNum,
PaperType = 2,
ParentId = newPaperId,
IsOpen=model.IsOpen,
};
if (obj.IsOpenZuJuan == 0)
{
......@@ -587,7 +586,8 @@ namespace Edu.Module.Exam
{nameof(RB_Examination_Paper_ViewModel.CreateNum),model.CreateNum },
{nameof(RB_Examination_Paper_ViewModel.PaperType),model.PaperType },
{nameof(RB_Examination_Paper_ViewModel.ParentId),model.ParentId },
{nameof(RB_Examination_Paper_ViewModel.ExamineStatus),model.ExamineStatus }
{nameof(RB_Examination_Paper_ViewModel.ExamineStatus),model.ExamineStatus },
{nameof(RB_Examination_Paper_ViewModel.IsOpen),model.IsOpen }
};
flag = examination_PaperRepository.Update(fileds, new WhereHelper(nameof(RB_Examination_Paper_ViewModel.PaperId), model.PaperId));
}
......@@ -1178,6 +1178,17 @@ namespace Edu.Module.Exam
return extModel;
}
/// <summary>
/// 批量更新是否开放
/// </summary>
/// <param name="paperIds"></param>
/// <param name="IsOpen"></param>
/// <returns></returns>
public bool BatchSetIsOpenModule(List<int> paperIds,int IsOpen)
{
return examination_PaperRepository.BatchSetIsOpenRepository(paperIds, IsOpen)>0;
}
#region 学生管理
/// <summary>
/// 获取考试学生分页列表
......
......@@ -149,5 +149,19 @@ WHERE 1=1
builder.AppendFormat(" UPDATE RB_Examination_Paper SET PublishCount=PublishCount+1 WHERE PaperId={0} ", PaperId);
return base.Execute(builder.ToString());
}
/// <summary>
/// 批量修改试卷【开放/私有】状态
/// </summary>
/// <param name="paperIds"></param>
/// <param name="IsOpen"></param>
/// <returns></returns>
public int BatchSetIsOpenRepository(List<int> paperIds, int IsOpen)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(" UPDATE RB_Examination_Paper SET IsOpen={0} WHERE PaperId IN({1}) ", IsOpen,string.Join(",",paperIds));
return base.Execute(builder.ToString());
}
}
}
......@@ -76,16 +76,16 @@ namespace Edu.WebApi.Controllers.Exam
item.ChildList,
item.ReviewerName,
item.Reviewer,
item.IsOpen,
OpenStr = item.IsOpen == 1 ? "私有" : "公开",
ExamineStatusStr = item.PaperType == 2 ? EnumHelper.ToName(item.ExamineStatus) : ""
});
}
pageModel.Count = rowsCount;
pageModel.PageData = result;
return ApiResult.Success(data: new { pageModel , navList });
return ApiResult.Success(data: new { pageModel, navList });
}
/// <summary>
/// 添加修改试卷
/// </summary>
......@@ -107,6 +107,7 @@ namespace Edu.WebApi.Controllers.Exam
PaperType = base.ParmJObj.GetInt("PaperType"),
ParentId = base.ParmJObj.GetInt("ParentId"),
IsExamine = base.ParmJObj.GetInt("IsExamine"),
IsOpen = base.ParmJObj.GetInt("IsOpen"),
};
extModel.GroupList = new List<RB_Examination_Group_ViewModel>();
string groups = base.ParmJObj.GetStringValue("GroupList");
......@@ -213,7 +214,8 @@ namespace Edu.WebApi.Controllers.Exam
School_Id = base.UserInfo.School_Id,
Status = Common.Enum.DateStateEnum.Normal,
IsSaveTemplate = base.ParmJObj.GetBoolValue("IsSaveTemplate"),
ParentId=base.ParmJObj.GetInt("ParentId"),
ParentId = base.ParmJObj.GetInt("ParentId"),
IsOpen = base.ParmJObj.GetInt("IsOpen"),
};
string TemplateData = base.ParmJObj.GetStringValue("TemplateData");
if (!string.IsNullOrEmpty(TemplateData))
......@@ -242,6 +244,7 @@ namespace Edu.WebApi.Controllers.Exam
TemplateName = base.ParmJObj.GetStringValue("TemplateName"),
CreateBy = base.UserInfo.Id,
};
query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>();
var list = paperModule.GetExaminationTemplatePageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
......@@ -538,6 +541,19 @@ namespace Edu.WebApi.Controllers.Exam
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 批量更新试卷开放状态
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult BatchSetIsOpen()
{
int IsOpen = base.ParmJObj.GetInt("IsOpen");
List<int> paperIds = Common.Plugin.JsonHelper.DeserializeObject<List<int>>(base.ParmJObj.GetStringValue("PaperIds"));
var flag = paperModule.BatchSetIsOpenModule(paperIds, IsOpen);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#region 考试配置
/// <summary>
......
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