Commit bd91a5c0 authored by 黄奎's avatar 黄奎

页面修改

parent df421e0d
......@@ -63,6 +63,16 @@ namespace Edu.Model.Entity.Exam
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 当前章节单词学习数量
/// </summary>
public int PrepNum { get; set; }
/// <summary>
/// 上一章节复习单词数量
/// </summary>
public int ReviewNum { get; set; }
/// <summary>
/// 学习单词数量
/// </summary>
......
......@@ -11,6 +11,16 @@ namespace Edu.Model.ViewModel.Exam
/// </summary>
public class RB_StuWords_Prep_Extend: RB_StuWords_Prep
{
/// <summary>
/// 复习章节编号
/// </summary>
public int ReviewCourseChapterId { get; set; }
/// <summary>
/// 学习类型(1-预习,2-复习)
/// </summary>
public int StudyType { get; set; }
/// <summary>
/// 学习分钟数
/// </summary>
......
......@@ -10,6 +10,20 @@ namespace Edu.Model.ViewModel.Exam
/// </summary>
public class RB_StuWords_Review_Extend : RB_StuWords_Review
{
/// <summary>
/// 学习分钟数
/// </summary>
public string StartMinutes
{
get
{
string str = "";
if (this.StartTime != null && this.EndTime != null)
{
str = Common.ConvertHelper.CalcMinutes(Convert.ToDateTime(this.StartTime), Convert.ToDateTime(this.EndTime)).ToString();
}
return str;
}
}
}
}
......@@ -366,7 +366,7 @@ namespace Edu.Module.Exam
var wordsList = course_WordsRepository.GetCourseWordsListRepository(new RB_Course_Words_Extend()
{
CourseId = model.CourseId,
ChapterId = model.ChapterId
QChapterIds = model.ChapterId+","+model.ReviewCourseChapterId
});
var oldModel = GetStuWordsPrepListModule(new RB_StuWords_Prep_Extend()
{
......@@ -464,10 +464,11 @@ namespace Edu.Module.Exam
{
{nameof(RB_StuWords_Review_Extend.ReviewNum),model.ReviewNum },
};
model.TotalNum = oldModel?.TotalNum ?? (wordsList?.Count ?? 0);
if (model.ReviewNum == (wordsList?.Count ?? 0))
{
fileds.Add(nameof(RB_StuWords_Prep_Extend.EndTime), DateTime.Now);
model.EndTime = DateTime.Now;
fileds.Add(nameof(RB_StuWords_Review_Extend.EndTime), DateTime.Now);
}
flag = stuWords_ReviewRepository.Update(fileds, new WhereHelper(nameof(RB_StuWords_Review_Extend.Id), model.Id));
}
......
......@@ -20,7 +20,7 @@ namespace Edu.Repository.Exam
public List<RB_StuWords_Review_Extend> GetStuWordsReviewListRepository(RB_StuWords_Review_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT A.* FROM RB_StuWords_Prep AS A WHERE 1=1 ");
builder.AppendFormat(@" SELECT A.* FROM RB_StuWords_Review AS A WHERE 1=1 ");
if (query != null)
{
if (query.Group_Id > 0)
......
......@@ -49,7 +49,10 @@ namespace Edu.WebApi.Controllers.Applet
CourseId = base.ParmJObj.GetInt("CourseId"),
Stu_Account_Id = base.ParmJObj.GetInt("Stu_Account_Id"),
ChapterId=base.ParmJObj.GetInt("ChapterId"),
PrepNum=base.ParmJObj.GetInt("PrepNum"),
ReviewNum=base.ParmJObj.GetInt("ReviewNum"),
StudyNum=base.ParmJObj.GetInt("StudyNum"),
ReviewCourseChapterId=base.ParmJObj.GetInt("ReviewCourseChapterId"),
};
model.CreateBy = base.AppletUserInfo.Id;
model.CreateTime = DateTime.Now;
......@@ -82,7 +85,7 @@ namespace Edu.WebApi.Controllers.Applet
model.Group_Id = base.AppletUserInfo.Group_Id;
model.Status = Common.Enum.DateStateEnum.Normal;
bool flag = courseExamModule.SetStuWordsReviewModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
return flag ? ApiResult.Success(data:model) : ApiResult.Failed();
}
/// <summary>
......
......@@ -13,6 +13,7 @@ using Edu.Common.API;
using Edu.Cache.User;
using Edu.WebApi.Helper;
using System.Reflection;
using System.Collections.Generic;
namespace Edu.WebApi.Filter
{
......@@ -58,9 +59,15 @@ namespace Edu.WebApi.Filter
string cachedKey = SecurityHelper.MD5(string.Format("cmd={0}&token={1}", actionUrl, token));
try
{
//不验证重复提交的方法名称
List<string> notValidateList = new List<string>()
{
"course/setchapter",
"appletwords/setstuwordsprep",
};
if (UserReidsCache.Exists(cachedKey))//判断表单是否重复提交
{
if (actionUrl != "course/setchapter")
if (!notValidateList.Contains(actionUrl))
{
actionContext.Result = new Microsoft.AspNetCore.Mvc.JsonResult(new ApiResult
{
......
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