Commit 463f067d authored by 黄奎's avatar 黄奎

页面修改

parent 8ab77fd5
...@@ -11,21 +11,16 @@ namespace Edu.Common.Enum.Question ...@@ -11,21 +11,16 @@ namespace Edu.Common.Enum.Question
public enum LevelTypeEnum public enum LevelTypeEnum
{ {
/// <summary> /// <summary>
/// 高考日语 ///N1
/// </summary> /// </summary>
[EnumField("高考日语")] [EnumField("N1")]
GaoKao = 6, N1 = 1,
/// <summary> /// <summary>
/// N5 ///N2
/// </summary>
[EnumField("N5")]
N5 = 5,
/// <summary>
///N4
/// </summary> /// </summary>
[EnumField("N4")] [EnumField("N2")]
N4 = 4, N2 = 2,
/// <summary> /// <summary>
///N3 ///N3
...@@ -34,15 +29,20 @@ namespace Edu.Common.Enum.Question ...@@ -34,15 +29,20 @@ namespace Edu.Common.Enum.Question
N3 = 3, N3 = 3,
/// <summary> /// <summary>
///N2 ///N4
/// </summary> /// </summary>
[EnumField("N2")] [EnumField("N4")]
N2 = 2, N4 = 4,
/// <summary> /// <summary>
///N1 /// N5
/// </summary> /// </summary>
[EnumField("N1")] [EnumField("N5")]
N1 = 1, N5 = 5,
/// <summary>
/// 高考日语
/// </summary>
[EnumField("高考日语")]
GaoKao = 6,
} }
} }
using Edu.AOP.CustomerAttribute; using Edu.AOP.CustomerAttribute;
using Edu.Common.Enum; using Edu.Common.Enum;
using Edu.Common.Enum.Question;
using Edu.Model.ViewModel.Question; using Edu.Model.ViewModel.Question;
using Edu.Repository.Question; using Edu.Repository.Question;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -181,6 +182,17 @@ namespace Edu.Module.Question ...@@ -181,6 +182,17 @@ namespace Edu.Module.Question
return flag; return flag;
} }
/// <summary>
/// 批量修改问题考级程度
/// </summary>
/// <param name="levelTypeEnum"></param>
/// <param name="questionIdList"></param>
/// <returns></returns>
public bool SetBatchQuestionLevelModule(LevelTypeEnum levelTypeEnum, List<int> questionIdList)
{
return questionRepository.SetBatchQuestionLevelRepository(levelTypeEnum, questionIdList);
}
/// <summary> /// <summary>
/// 批量添加问题 /// 批量添加问题
/// </summary> /// </summary>
......
using Edu.Common.Enum; using Edu.Common.Enum;
using Edu.Common.Enum.Question;
using Edu.Model.ViewModel.Question; using Edu.Model.ViewModel.Question;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -97,6 +98,19 @@ WHERE 1=1 "); ...@@ -97,6 +98,19 @@ WHERE 1=1 ");
return GetPage<RB_Question_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList(); return GetPage<RB_Question_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
} }
} }
/// <summary>
/// 批量更新问题考级程度
/// </summary>
/// <param name="levelTypeEnum"></param>
/// <param name="questionIdList"></param>
/// <returns></returns>
public bool SetBatchQuestionLevelRepository(LevelTypeEnum levelTypeEnum, List<int> questionIdList)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(" UPDATE RB_Question SET LevelType={0} WHERE QuestionId IN ({1}) ", (int)levelTypeEnum, string.Join(",", questionIdList));
return base.Execute(builder.ToString()) > 0;
}
} }
} }
\ No newline at end of file
...@@ -579,6 +579,19 @@ namespace Edu.WebApi.Controllers.Course ...@@ -579,6 +579,19 @@ namespace Edu.WebApi.Controllers.Course
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
/// <summary>
/// 批量修改问题考级程度
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetBatchQuestionLevel()
{
var LevelType = (LevelTypeEnum)base.ParmJObj.GetInt("LevelType");
List<int> questionIds = Common.Plugin.JsonHelper.DeserializeObject<List<int>>(base.ParmJObj.GetStringValue("questionIds"));
var flag = questionModule.SetBatchQuestionLevelModule(LevelType, questionIds);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary> /// <summary>
/// 选择题验证 /// 选择题验证
/// </summary> /// </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