Commit cce26af2 authored by 黄奎's avatar 黄奎

课程作业修改

parent 76e01cac
using System; using Edu.Common.Enum;
using System;
using VT.FW.DB; using VT.FW.DB;
namespace Edu.Model.Entity.Course namespace Edu.Model.Entity.Course
...@@ -194,5 +195,12 @@ namespace Edu.Model.Entity.Course ...@@ -194,5 +195,12 @@ namespace Edu.Model.Entity.Course
/// 多选题未选全给一半分(1-是) /// 多选题未选全给一半分(1-是)
/// </summary> /// </summary>
public int IsMultiHalfScore { get; set; } public int IsMultiHalfScore { get; set; }
/// <summary>
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
} }
} }
\ No newline at end of file
...@@ -60,6 +60,11 @@ namespace Edu.Module.Course ...@@ -60,6 +60,11 @@ namespace Edu.Module.Course
/// </summary> /// </summary>
private readonly RB_Course_JobRepository courseJobRepository = new RB_Course_JobRepository(); private readonly RB_Course_JobRepository courseJobRepository = new RB_Course_JobRepository();
/// <summary>
/// 课程作业详情仓储层对象
/// </summary>
private readonly RB_Course_JobDetailsRepository course_JobDetailsRepository = new RB_Course_JobDetailsRepository();
/// <summary> /// <summary>
/// 课程分类处理类 /// 课程分类处理类
/// </summary> /// </summary>
...@@ -835,7 +840,8 @@ namespace Edu.Module.Course ...@@ -835,7 +840,8 @@ namespace Edu.Module.Course
/// </summary> /// </summary>
/// <param name="model"></param> /// <param name="model"></param>
/// <returns></returns> /// <returns></returns>
public bool SetCourseJobModule(RB_Course_Job_ViewModel model) [TransactionCallHandler]
public virtual bool SetCourseJobModule(RB_Course_Job_ViewModel model)
{ {
bool flag; bool flag;
if (model.JobId > 0) if (model.JobId > 0)
...@@ -846,7 +852,6 @@ namespace Edu.Module.Course ...@@ -846,7 +852,6 @@ namespace Edu.Module.Course
{nameof(RB_Course_Job_ViewModel.JobType),model.JobType }, {nameof(RB_Course_Job_ViewModel.JobType),model.JobType },
{nameof(RB_Course_Job_ViewModel.ScoreType),model.ScoreType }, {nameof(RB_Course_Job_ViewModel.ScoreType),model.ScoreType },
{nameof(RB_Course_Job_ViewModel.TopicType),model.TopicType }, {nameof(RB_Course_Job_ViewModel.TopicType),model.TopicType },
}; };
flag = courseJobRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Job_ViewModel.JobId), model.JobId)); flag = courseJobRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Job_ViewModel.JobId), model.JobId));
} }
...@@ -893,6 +898,8 @@ namespace Edu.Module.Course ...@@ -893,6 +898,8 @@ namespace Edu.Module.Course
{nameof(RB_Course_Job_ViewModel.IsCompletionIngoreCase),model.IsCompletionIngoreCase }, {nameof(RB_Course_Job_ViewModel.IsCompletionIngoreCase),model.IsCompletionIngoreCase },
{nameof(RB_Course_Job_ViewModel.IsBlankIgnoreComma),model.IsBlankIgnoreComma }, {nameof(RB_Course_Job_ViewModel.IsBlankIgnoreComma),model.IsBlankIgnoreComma },
{nameof(RB_Course_Job_ViewModel.IsMultiHalfScore),model.IsMultiHalfScore }, {nameof(RB_Course_Job_ViewModel.IsMultiHalfScore),model.IsMultiHalfScore },
{nameof(RB_Course_Job_ViewModel.UpdateBy),model.UpdateBy },
{nameof(RB_Course_Job_ViewModel.UpdateTime),model.UpdateTime },
}; };
var flag = courseJobRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Job_ViewModel.JobId), model.JobId)); var flag = courseJobRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Job_ViewModel.JobId), model.JobId));
return flag; return flag;
...@@ -910,6 +917,22 @@ namespace Edu.Module.Course ...@@ -910,6 +917,22 @@ namespace Edu.Module.Course
{ {
return courseJobRepository.GetCourseJobPageListRepository(pageIndex, pageSize, out rowsCount, query); return courseJobRepository.GetCourseJobPageListRepository(pageIndex, pageSize, out rowsCount, query);
} }
/// <summary>
/// 删除课程作业
/// </summary>
/// <param name="JobId">作业编号</param>
/// <param name="Status">1-删除,0-恢复</param>
/// <returns></returns>
public bool RemoveCourseJobModule(int JobId, int Status)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Course_Job_ViewModel.Status),Status },
};
var flag = courseJobRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Job_ViewModel.JobId), JobId));
return flag;
}
#endregion #endregion
#region 课程优惠设置 #region 课程优惠设置
......
...@@ -804,18 +804,89 @@ namespace Edu.WebApi.Controllers.Course ...@@ -804,18 +804,89 @@ namespace Edu.WebApi.Controllers.Course
[HttpPost] [HttpPost]
public ApiResult SetCourseJob() public ApiResult SetCourseJob()
{ {
var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Course_Job_ViewModel>(RequestParm.Msg.ToString()); var extModel = new RB_Course_Job_ViewModel()
{
JobId=base.ParmJObj.GetInt("JobId"),
JobName=base.ParmJObj.GetStringValue("JobName"),
JobType=base.ParmJObj.GetInt("JobType"),
ScoreType=base.ParmJObj.GetInt("ScoreType"),
TopicType=base.ParmJObj.GetInt("TopicType")
};
try
{
extModel.JobDetailsList = Common.Plugin.JsonHelper.DeserializeObject<List<RB_Course_JobDetails_ViewModel>>(base.ParmJObj.GetStringValue("JobDetailsList"));
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "SetCourseJob");
}
extModel.CreateTime = DateTime.Now; extModel.CreateTime = DateTime.Now;
extModel.CreateBy = base.UserInfo.Id; extModel.CreateBy = base.UserInfo.Id;
extModel.UpdateBy = base.UserInfo.Id; extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now; extModel.UpdateTime = DateTime.Now;
extModel.Status = DateStateEnum.Normal;
bool flag = courseModule.SetCourseJobModule(extModel); bool flag = courseModule.SetCourseJobModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
/// <summary>
/// 修改作业其他设置
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetCourseJobOtherConfig()
{
var extModel = new RB_Course_Job_ViewModel()
{
JobId=base.ParmJObj.GetInt("JobId"),
ReciveClass = base.ParmJObj.GetStringValue("ReciveClass"),
StartTime = base.ParmJObj.GetDateTime("StartTime"),
EndTime = base.ParmJObj.GetDateTime("EndTime"),
IsAllowDelay = base.ParmJObj.GetInt("IsAllowDelay"),
PassBasicScore = base.ParmJObj.GetInt("PassBasicScore"),
IsAgain = base.ParmJObj.GetInt("IsAgain"),
AgainTimes = base.ParmJObj.GetInt("AgainTimes"),
IsGetHighScore = base.ParmJObj.GetInt("IsGetHighScore"),
IsLookAnswer = base.ParmJObj.GetInt("IsLookAnswer"),
LookAnswerType = base.ParmJObj.GetInt("LookAnswerType"),
IsLookScore = base.ParmJObj.GetInt("IsLookScore"),
IsLookQTypeScore=base.ParmJObj.GetInt("IsLookQTypeScore"),
IsPaste=base.ParmJObj.GetInt("IsPaste"),
IsAgainShowTrueFalse=base.ParmJObj.GetInt("IsAgainShowTrueFalse"),
IsOutOrder=base.ParmJObj.GetInt("IsOutOrder"),
IsRandom=base.ParmJObj.GetInt("IsRandom"),
RandomNum=base.ParmJObj.GetInt("RandomNum"),
IsSendMsg=base.ParmJObj.GetInt("IsSendMsg"),
SendMsgHour=base.ParmJObj.GetInt("SendMsgHour"),
IsWork=base.ParmJObj.GetInt("IsWork"),
WorkProcess=base.ParmJObj.GetInt("WorkProcess"),
IsBlankobj=base.ParmJObj.GetInt("IsBlankobj"),
IsCompletionIngoreCase=base.ParmJObj.GetInt("IsCompletionIngoreCase"),
IsBlankIgnoreComma=base.ParmJObj.GetInt("IsBlankIgnoreComma"),
IsMultiHalfScore=base.ParmJObj.GetInt("IsMultiHalfScore"),
};
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
bool flag = courseModule.SetCourseJobOtherConfigModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 删除课程作业
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveCourseJob()
{
int JobId = base.ParmJObj.GetInt("JobId");
int Status = base.ParmJObj.GetInt("Status");
bool flag = courseModule.RemoveCourseJobModule(JobId, Status);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion #endregion
#region 课程优惠价格设置 #region 课程优惠价格设置
/// <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