Commit d3201505 authored by 黄奎's avatar 黄奎

页面修改

parent 11e6d98c
using Edu.Common.Enum;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Exam
{
/// <summary>
/// 单词测试实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_StuWords_Exam
{
/// <summary>
/// 学员单词考试主键编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 班级编号
/// </summary>
public int ClassId { get; set; }
/// <summary>
/// 课程编号
/// </summary>
public int CourseId { get; set; }
/// <summary>
/// Account表(Id字段)学员账号
/// </summary>
public int Stu_Account_Id { get; set; }
/// <summary>
/// 章节编号
/// </summary>
public int ChapterId { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 学校Id
/// </summary>
public int? School_Id { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int? Group_Id { get; set; }
/// <summary>
/// 状态
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 得分
/// </summary>
public decimal Score { get; set; }
/// <summary>
/// 考试开始时间
/// </summary>
public DateTime? ExamStartTime { get; set; }
/// <summary>
/// 考试结束时间
/// </summary>
public DateTime? ExamEndTime { get; set; }
}
}
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Exam
{
/// <summary>
/// 单词测试详情实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_StuWords_ExamDetail
{
/// <summary>
/// 单词考试详情主键编号
/// </summary>
public int DetailId { get; set; }
/// <summary>
/// 单词考试编号
/// </summary>
public int ExamId { get; set; }
/// <summary>
/// 单词编号
/// </summary>
public int WordId { get; set; }
/// <summary>
/// 问题标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 问题内容
/// </summary>
public string QuestionContent { get; set; }
/// <summary>
/// 问题类型编号
/// </summary>
public int? QuestionTypeId { get; set; }
/// <summary>
/// 问题类型Key
/// </summary>
public string QuestionTypeKey { get; set; }
/// <summary>
/// 题目分数
/// </summary>
public decimal Score { get; set; }
}
}
using Edu.Model.Entity.Exam;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Exam
{
/// <summary>
/// 单词测试详情扩展实体类
/// </summary>
public class RB_StuWords_ExamDetail_Extend: RB_StuWords_ExamDetail
{
}
}
using Edu.Model.Entity.Exam;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Exam
{
/// <summary>
/// 单词测试扩展实体类
/// </summary>
public class RB_StuWords_Exam_Extend : RB_StuWords_Exam
{
}
}
...@@ -4919,7 +4919,8 @@ namespace Edu.Module.Course ...@@ -4919,7 +4919,8 @@ namespace Edu.Module.Course
public List<RB_Class_Plan_ViewModel> GetMyStudyCourseList(int classId, int group_Id) public List<RB_Class_Plan_ViewModel> GetMyStudyCourseList(int classId, int group_Id)
{ {
var planList = class_PlanRepository.GetStudyClassPlanList(classId, group_Id); var planList = class_PlanRepository.GetStudyClassPlanList(classId, group_Id);
if (planList.Any()) { if (planList.Any())
{
string planIds = string.Join(",", planList.Select(x => x.ClassPlanId)); string planIds = string.Join(",", planList.Select(x => x.ClassPlanId));
var timeList = class_TimeRepository.GetClassTimeListRepository(new RB_Class_Time_ViewModel() { Group_Id = group_Id, QClassPlanIds = planIds }); var timeList = class_TimeRepository.GetClassTimeListRepository(new RB_Class_Time_ViewModel() { Group_Id = group_Id, QClassPlanIds = planIds });
var MaxPlan = planList.OrderByDescending(x => x.ClassDate).FirstOrDefault(); var MaxPlan = planList.OrderByDescending(x => x.ClassDate).FirstOrDefault();
...@@ -4935,7 +4936,8 @@ namespace Edu.Module.Course ...@@ -4935,7 +4936,8 @@ namespace Edu.Module.Course
} }
} }
planList = planList.OrderByDescending(x => x.ClassDate).ToList(); planList = planList.OrderByDescending(x => x.ClassDate).ToList();
foreach (var item in planList) { foreach (var item in planList)
{
item.PlanTimeList = timeList.Where(x => x.ClassPlanId == item.ClassPlanId).ToList(); item.PlanTimeList = timeList.Where(x => x.ClassPlanId == item.ClassPlanId).ToList();
} }
} }
......
This diff is collapsed.
...@@ -423,7 +423,6 @@ namespace Edu.Module.Course ...@@ -423,7 +423,6 @@ namespace Edu.Module.Course
{ {
Id = 0, Id = 0,
OrderId = orderModel.OrderId, OrderId = orderModel.OrderId,
ClassId = orderModel.ClassId,
GuestName = item.StuName, GuestName = item.StuName,
GuestState = GuestStateEnum.Normal, GuestState = GuestStateEnum.Normal,
Profession = item?.StuProfession ?? "", Profession = item?.StuProfession ?? "",
...@@ -456,9 +455,20 @@ namespace Edu.Module.Course ...@@ -456,9 +455,20 @@ namespace Edu.Module.Course
CompleteHours = 0, CompleteHours = 0,
MakeUpHours = 0, MakeUpHours = 0,
StuIcon = item.StuIcon, StuIcon = item.StuIcon,
TotalHours = Convert.ToInt32(courseModel.ClassHours),
RenewState = 1 RenewState = 1
}; };
if (orderModel.OrderType == OrderTypeEnum.CourseOrder)
{
guestModel.ClassId = orderModel.ClassId;
guestModel.SourceId = 0;
guestModel.TotalHours = Convert.ToInt32(courseModel?.ClassHours ?? 0);
}
else if (orderModel.OrderType == OrderTypeEnum.StudyabroadOrder)
{
guestModel.ClassId = 0;
guestModel.CourseId = 0;
guestModel.SourceId = orderModel.SourceId;
}
SetOrderGuestInfo(guestModel, out string Nmessage); SetOrderGuestInfo(guestModel, out string Nmessage);
} }
return ""; return "";
......
...@@ -344,6 +344,17 @@ namespace Edu.Module.Exam ...@@ -344,6 +344,17 @@ namespace Edu.Module.Exam
return list; return list;
} }
/// <summary>
/// 获取单词预习列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_StuWords_Prep_Extend> GetStuWordsPrepListModule(RB_StuWords_Prep_Extend query)
{
var list = stuWords_PrepRepository.GetStuWordsPrepListRepository(query);
return list;
}
/// <summary> /// <summary>
/// 新增修改学员单词学习 /// 新增修改学员单词学习
/// </summary> /// </summary>
...@@ -357,7 +368,7 @@ namespace Edu.Module.Exam ...@@ -357,7 +368,7 @@ namespace Edu.Module.Exam
CourseId = model.CourseId, CourseId = model.CourseId,
ChapterId = model.ChapterId ChapterId = model.ChapterId
}); });
var oldModel = stuWords_PrepRepository.GetStuWordsPrepListRepository(new RB_StuWords_Prep_Extend() var oldModel = GetStuWordsPrepListModule(new RB_StuWords_Prep_Extend()
{ {
Stu_Account_Id = model.Stu_Account_Id, Stu_Account_Id = model.Stu_Account_Id,
CourseId = model.CourseId, CourseId = model.CourseId,
...@@ -367,16 +378,19 @@ namespace Edu.Module.Exam ...@@ -367,16 +378,19 @@ namespace Edu.Module.Exam
model.Id = oldModel?.Id ?? 0; model.Id = oldModel?.Id ?? 0;
if (model.Id > 0) if (model.Id > 0)
{ {
model.TotalNum = oldModel?.TotalNum ?? (wordsList?.Count ?? 0);
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{nameof(RB_StuWords_Prep_Extend.StudyNum),model.StudyNum }, {nameof(RB_StuWords_Prep_Extend.StudyNum),model.StudyNum },
}; };
fileds.Add(nameof(RB_StuWords_Prep_Extend.Score), GetScoreModule(model.StudyNum, (wordsList?.Count ?? 0))); model.Score = GetScoreModule(model.StudyNum, model.TotalNum);
fileds.Add(nameof(RB_StuWords_Prep_Extend.Score), model.Score);
if (model.StudyNum == (wordsList?.Count ?? 0)) if (model.StudyNum == (wordsList?.Count ?? 0))
{ {
model.EndTime = DateTime.Now;
fileds.Add(nameof(RB_StuWords_Prep_Extend.EndTime), DateTime.Now); fileds.Add(nameof(RB_StuWords_Prep_Extend.EndTime), DateTime.Now);
} }
flag = stuWords_PrepRepository.Update(fileds, new WhereHelper(nameof(RB_StuWords_Prep_Extend.Id),model.Id)); flag = stuWords_PrepRepository.Update(fileds, new WhereHelper(nameof(RB_StuWords_Prep_Extend.Id), model.Id));
} }
else else
{ {
......
using Edu.Model.Entity.Exam;
using Edu.Model.ViewModel.Exam;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Exam
{
/// <summary>
/// 单词测试详情仓储层
/// </summary>
public class RB_StuWords_ExamDetailRepository : BaseRepository<RB_StuWords_ExamDetail>
{
/// <summary>
/// 获取学员单词测试详情列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_StuWords_ExamDetail_Extend> GetStuWordsExamDetailListRepository(RB_StuWords_ExamDetail_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_StuWords_ExamDetail AS A
WHERE 1=1
");
if (query != null)
{
if (query.ExamId > 0)
{
builder.AppendFormat(" A.{0}={1} ", nameof(RB_StuWords_ExamDetail_Extend.ExamId), query.ExamId);
}
}
return Get<RB_StuWords_ExamDetail_Extend>(builder.ToString()).ToList();
}
}
}
using Edu.Model.Entity.Exam;
using Edu.Model.ViewModel.Exam;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Exam
{
/// <summary>
/// 单词测试仓储层
/// </summary>
public class RB_StuWords_ExamRepository : BaseRepository<RB_StuWords_Exam>
{
/// <summary>
/// 获取学员单词考试分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_StuWords_Exam_Extend> GetStuWordsExamPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_StuWords_Exam_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_StuWords_Exam AS A
WHERE 1=1
");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_StuWords_Exam_Extend.Group_Id), query.Group_Id);
}
}
return GetPage<RB_StuWords_Exam_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
}
}
...@@ -14,6 +14,7 @@ using Edu.Model.ViewModel.LearningGarden; ...@@ -14,6 +14,7 @@ using Edu.Model.ViewModel.LearningGarden;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
using Edu.Module.Course; using Edu.Module.Course;
using Edu.Module.EduTask; using Edu.Module.EduTask;
using Edu.Module.Exam;
using Edu.Module.Public; using Edu.Module.Public;
using Edu.Module.User; using Edu.Module.User;
using Edu.WebApi.Filter; using Edu.WebApi.Filter;
...@@ -58,10 +59,11 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -58,10 +59,11 @@ namespace Edu.WebApi.Controllers.Applet
/// 学习园地处理类对象 /// 学习园地处理类对象
/// </summary> /// </summary>
private readonly LearningGardenModule learningGardenModule = AOP.AOPHelper.CreateAOPObject<LearningGardenModule>(); private readonly LearningGardenModule learningGardenModule = AOP.AOPHelper.CreateAOPObject<LearningGardenModule>();
/// <summary> /// <summary>
/// 课程单词 /// 课程单词学习、测试处理类对象
/// </summary> /// </summary>
private readonly CourseWordsModule courseWordsModule = new CourseWordsModule(); private readonly CourseExamModule courseExamModule = new CourseExamModule();
#region 小程序首页 #region 小程序首页
...@@ -507,7 +509,8 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -507,7 +509,8 @@ namespace Edu.WebApi.Controllers.Applet
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult GetMyStudyCourseChapterList() { public ApiResult GetMyStudyCourseChapterList()
{
var appletUserInfo = base.AppletUserInfo; var appletUserInfo = base.AppletUserInfo;
JObject parms = JObject.Parse(base.RequestParm.Msg.ToString()); JObject parms = JObject.Parse(base.RequestParm.Msg.ToString());
int ClassId = parms.GetInt("ClassId", 0);//班级ID int ClassId = parms.GetInt("ClassId", 0);//班级ID
...@@ -516,7 +519,8 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -516,7 +519,8 @@ namespace Edu.WebApi.Controllers.Applet
{ {
return ApiResult.ParamIsNull("请传递班级ID"); return ApiResult.ParamIsNull("请传递班级ID");
} }
if (CourseId <= 0) { if (CourseId <= 0)
{
return ApiResult.ParamIsNull("请传递课程ID"); return ApiResult.ParamIsNull("请传递课程ID");
} }
...@@ -528,13 +532,24 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -528,13 +532,24 @@ namespace Edu.WebApi.Controllers.Applet
var chapterTreeList = courseModule.GetChapterTreeListModule_V2(new Model.ViewModel.Course.RB_Course_Chapter_ViewModel() { Group_Id = appletUserInfo.Group_Id, CourseId = CourseId }); var chapterTreeList = courseModule.GetChapterTreeListModule_V2(new Model.ViewModel.Course.RB_Course_Chapter_ViewModel() { Group_Id = appletUserInfo.Group_Id, CourseId = CourseId });
var ctList = chapterTreeList.Where(x => Convert.ToInt32(x.ChapterNo) <= MaxChapterNo).ToList(); var ctList = chapterTreeList.Where(x => Convert.ToInt32(x.ChapterNo) <= MaxChapterNo).ToList();
//章节单词得分 //章节单词得分
var prepWordsList = courseExamModule.GetStuWordsPrepListModule(new RB_StuWords_Prep_Extend()
{
CourseId = CourseId,
Group_Id = appletUserInfo.Group_Id,
Stu_Account_Id = appletUserInfo.Id
});
//组装数据 //组装数据
var RList = new List<object>(); var RList = new List<object>();
foreach (var item in ctList) foreach (var item in ctList)
{ {
//判断是否已经学习 //判断是否已经学习
var planModel = planList.Where(x => item.ChapterNo == x.LessonPlanNum.ToString()).FirstOrDefault(); var planModel = planList.Where(x => item.ChapterNo == x.LessonPlanNum.ToString()).FirstOrDefault();
var tempPrepWords = prepWordsList?.Where(qitem => qitem.ChapterId.ToString() == item.ChapterNo)?.FirstOrDefault();
decimal StudyProgress = 0;
if (tempPrepWords != null && tempPrepWords.TotalNum > 0)
{
StudyProgress = Math.Round(Convert.ToDecimal(tempPrepWords.StudyNum) / Convert.ToDecimal(tempPrepWords.TotalNum) * 100, 2); ;
}
int Num = 1; int Num = 1;
RList.Add(new RList.Add(new
{ {
...@@ -548,6 +563,8 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -548,6 +563,8 @@ namespace Edu.WebApi.Controllers.Applet
x.VideoUrl x.VideoUrl
}), }),
ChapterTree = item, ChapterTree = item,
Score=tempPrepWords?.Score??0,
StudyProgress,
NextChapterNo = chapterTreeList.Where(x => Convert.ToInt32(x.ChapterNo) > Convert.ToInt32(item.ChapterNo)).OrderBy(x => Convert.ToInt32(x.ChapterNo)).FirstOrDefault()?.ChapterNo ?? "" NextChapterNo = chapterTreeList.Where(x => Convert.ToInt32(x.ChapterNo) > Convert.ToInt32(item.ChapterNo)).OrderBy(x => Convert.ToInt32(x.ChapterNo)).FirstOrDefault()?.ChapterNo ?? ""
}); });
} }
......
...@@ -1250,7 +1250,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1250,7 +1250,7 @@ namespace Edu.WebApi.Controllers.Course
dmodel.CreateTime = DateTime.Now; dmodel.CreateTime = DateTime.Now;
dmodel.UpdateBy = userInfo.Id; dmodel.UpdateBy = userInfo.Id;
dmodel.UpdateTime = DateTime.Now; dmodel.UpdateTime = DateTime.Now;
bool flag = orderModule.SetOrderGuestInfo(dmodel, out string message); bool flag = orderModule.SetOrderGuestInfo_V2(dmodel, out string message);
return flag ? ApiResult.Success() : ApiResult.Failed(message); return flag ? ApiResult.Success() : ApiResult.Failed(message);
} }
......
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