Commit 09f0e315 authored by 吴春's avatar 吴春

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 841d27d6 292445ad
...@@ -11,6 +11,7 @@ using Edu.Module.Question; ...@@ -11,6 +11,7 @@ using Edu.Module.Question;
using Edu.Repository.Question; using Edu.Repository.Question;
using Edu.Model.ViewModel.Question; using Edu.Model.ViewModel.Question;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Edu.Model.CacheModel;
namespace Edu.Module.Exam namespace Edu.Module.Exam
{ {
...@@ -524,7 +525,6 @@ namespace Edu.Module.Exam ...@@ -524,7 +525,6 @@ namespace Edu.Module.Exam
{ {
// 定义正则表达式用来匹配 img 标签 // 定义正则表达式用来匹配 img 标签
string str = @"<img\b[^<>]*?\bsrc[\s\t\r\n]*=[\s\t\r\n]*[""']?[\s\t\r\n]*(?<imgUrl>[^\s\t\r\n""'<>]*)[^<>]*?/?[\s\t\r\n]*>"; string str = @"<img\b[^<>]*?\bsrc[\s\t\r\n]*=[\s\t\r\n]*[""']?[\s\t\r\n]*(?<imgUrl>[^\s\t\r\n""'<>]*)[^<>]*?/?[\s\t\r\n]*>";
var extModel = examination_PaperRepository.GetEntity<RB_Examination_Paper_ViewModel>(PaperId); var extModel = examination_PaperRepository.GetEntity<RB_Examination_Paper_ViewModel>(PaperId);
if (extModel != null && extModel.PaperId > 0) if (extModel != null && extModel.PaperId > 0)
{ {
...@@ -532,7 +532,7 @@ namespace Edu.Module.Exam ...@@ -532,7 +532,7 @@ namespace Edu.Module.Exam
extModel.GroupList = GetExaminationGroupListModule(new RB_Examination_Group_ViewModel() extModel.GroupList = GetExaminationGroupListModule(new RB_Examination_Group_ViewModel()
{ {
PaperId = extModel.PaperId PaperId = extModel.PaperId
}); })?.OrderBy(qitem => qitem.GSortNum)?.ToList();
var detailsList = GetExaminationDetailsListModule(new RB_Examination_Details_ViewModel() var detailsList = GetExaminationDetailsListModule(new RB_Examination_Details_ViewModel()
{ {
PaperId = extModel.PaperId PaperId = extModel.PaperId
...@@ -541,7 +541,7 @@ namespace Edu.Module.Exam ...@@ -541,7 +541,7 @@ namespace Edu.Module.Exam
{ {
foreach (var gItem in extModel.GroupList) foreach (var gItem in extModel.GroupList)
{ {
gItem.DetailsList = detailsList?.Where(qitem => qitem.QuestionTypeId == gItem.QuestionTypeId)?.ToList() ?? new List<RB_Examination_Details_ViewModel>(); gItem.DetailsList = detailsList?.Where(qitem => qitem.QuestionTypeId == gItem.QuestionTypeId)?.OrderBy(qitem=>qitem.SortNum)?.ToList() ?? new List<RB_Examination_Details_ViewModel>();
if (gItem.DetailsList != null && gItem.DetailsList.Count > 0) if (gItem.DetailsList != null && gItem.DetailsList.Count > 0)
{ {
gItem.GScore = gItem?.DetailsList?.Sum(qitem => qitem.Score) ?? 0; gItem.GScore = gItem?.DetailsList?.Sum(qitem => qitem.Score) ?? 0;
...@@ -622,6 +622,7 @@ namespace Edu.Module.Exam ...@@ -622,6 +622,7 @@ namespace Edu.Module.Exam
{ {
flag = examination_DetailsRepository.DeleteOne(new WhereHelper(nameof(RB_Examination_Details_ViewModel.PaperId), PaperId)); flag = examination_DetailsRepository.DeleteOne(new WhereHelper(nameof(RB_Examination_Details_ViewModel.PaperId), PaperId));
} }
//删除所有的自己点信息
if (childList != null && childList.Count > 0) if (childList != null && childList.Count > 0)
{ {
foreach (var item in childList) foreach (var item in childList)
...@@ -638,9 +639,10 @@ namespace Edu.Module.Exam ...@@ -638,9 +639,10 @@ namespace Edu.Module.Exam
/// 根据试卷编号复制试卷 /// 根据试卷编号复制试卷
/// </summary> /// </summary>
/// <param name="PaperId"></param> /// <param name="PaperId"></param>
/// <param name="UserInfo">用户信息</param>
/// <returns></returns> /// <returns></returns>
[TransactionCallHandler] [TransactionCallHandler]
public bool CopyExamnationPaperModule(int PaperId) public bool CopyExamnationPaperModule(int PaperId, UserInfo UserInfo)
{ {
var flag = true; var flag = true;
var model = GetExaminationPaperModule(PaperId); var model = GetExaminationPaperModule(PaperId);
...@@ -650,6 +652,11 @@ namespace Edu.Module.Exam ...@@ -650,6 +652,11 @@ namespace Edu.Module.Exam
return flag; return flag;
} }
model.PaperId = 0; model.PaperId = 0;
model.CreateBy = UserInfo.Id;
model.Group_Id = UserInfo.Group_Id;
model.School_Id = UserInfo.School_Id;
model.CreateTime = DateTime.Now;
if (model.GroupList != null && model.GroupList.Count > 0) if (model.GroupList != null && model.GroupList.Count > 0)
{ {
foreach (var gItem in model.GroupList) foreach (var gItem in model.GroupList)
...@@ -666,7 +673,6 @@ namespace Edu.Module.Exam ...@@ -666,7 +673,6 @@ namespace Edu.Module.Exam
} }
} }
} }
var configureModel = new RB_Examination_Configure_ViewModel() var configureModel = new RB_Examination_Configure_ViewModel()
{ {
Group_Id = model.Group_Id, Group_Id = model.Group_Id,
...@@ -834,6 +840,7 @@ namespace Edu.Module.Exam ...@@ -834,6 +840,7 @@ namespace Edu.Module.Exam
model.Id = newId; model.Id = newId;
model.IsExamine = 1; model.IsExamine = 1;
flag = newId > 0; flag = newId > 0;
examination_PaperRepository.UpdateExaminationPaperPublishCountRepository(model.PaperId);
} }
if (flag && obj.IsOpenExamApply == 1 && model.IsExamine == 1) if (flag && obj.IsOpenExamApply == 1 && model.IsExamine == 1)
{ {
...@@ -843,7 +850,6 @@ namespace Edu.Module.Exam ...@@ -843,7 +850,6 @@ namespace Edu.Module.Exam
{nameof(RB_Examination_Publish_ViewModel.Reviewer),obj.ZuJuanReviewer } {nameof(RB_Examination_Publish_ViewModel.Reviewer),obj.ZuJuanReviewer }
}; };
flag = examination_PublishRepository.Update(fileds, new WhereHelper(nameof(RB_Examination_Publish_ViewModel.Id), model.Id)); flag = examination_PublishRepository.Update(fileds, new WhereHelper(nameof(RB_Examination_Publish_ViewModel.Id), model.Id));
var educationReceipt = new Model.Entity.EduTask.RB_Education_Receipt() var educationReceipt = new Model.Entity.EduTask.RB_Education_Receipt()
{ {
Id = 0, Id = 0,
...@@ -917,8 +923,6 @@ namespace Edu.Module.Exam ...@@ -917,8 +923,6 @@ namespace Edu.Module.Exam
return flag; return flag;
} }
#region 考试配置 #region 考试配置
/// <summary> /// <summary>
/// 获取配置列表 /// 获取配置列表
...@@ -969,6 +973,7 @@ namespace Edu.Module.Exam ...@@ -969,6 +973,7 @@ namespace Edu.Module.Exam
return flag; return flag;
} }
#endregion #endregion
/// <summary> /// <summary>
/// 根据编号获取考试发布详情 /// 根据编号获取考试发布详情
/// </summary> /// </summary>
......
...@@ -122,5 +122,17 @@ WHERE 1=1 ...@@ -122,5 +122,17 @@ WHERE 1=1
parameters.Add("QPaperIds", QPaperIds, direction: ParameterDirection.Input); parameters.Add("QPaperIds", QPaperIds, direction: ParameterDirection.Input);
return Get<RB_Examination_Paper_ViewModel>(procName, parameters, commandType: CommandType.StoredProcedure).ToList(); return Get<RB_Examination_Paper_ViewModel>(procName, parameters, commandType: CommandType.StoredProcedure).ToList();
} }
/// <summary>
/// 修改试卷发布次数
/// </summary>
/// <param name="PaperId"></param>
/// <returns></returns>
public int UpdateExaminationPaperPublishCountRepository(int PaperId)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(" UPDATE RB_Examination_Paper SET PublishCount=PublishCount+1 WHERE PaperId={0} ", PaperId);
return base.Execute(builder.ToString());
}
} }
} }
...@@ -380,7 +380,7 @@ namespace Edu.WebApi.Controllers.Exam ...@@ -380,7 +380,7 @@ namespace Edu.WebApi.Controllers.Exam
public ApiResult CopyPaper() public ApiResult CopyPaper()
{ {
var PaperId = base.ParmJObj.GetInt("PaperId"); var PaperId = base.ParmJObj.GetInt("PaperId");
var flag = paperModule.CopyExamnationPaperModule(PaperId); var flag = paperModule.CopyExamnationPaperModule(PaperId,base.UserInfo);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
......
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