Commit 733c02d8 authored by liudong1993's avatar liudong1993

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

parents bbdd75b8 b5e9eae8
......@@ -14,5 +14,10 @@ namespace Edu.Model.ViewModel.Course
/// 课程编号
/// </summary>
public string QCourseIds { get; set; }
/// <summary>
/// 章节编号
/// </summary>
public string QChapterIds { get; set; }
}
}
......@@ -4155,9 +4155,10 @@ namespace Edu.Module.Course
foreach (var subItem in tempList)
{
var tempTimeList = timeList?.Where(qitem => qitem.ClassPlanId == subItem.ClassPlanId)?.ToList()?.OrderBy(qitem => qitem.StartTime);
var currentDate = Common.ConvertHelper.FormatDate(ClassDate) + " " + (tempTimeList?.FirstOrDefault()?.StartTime ?? "");
foreach (var item in tempTimeList)
{
var currentDate = Common.ConvertHelper.FormatDate(ClassDate) + " " + (item?.StartTime ?? "");
var tempTimeGuestList = new List<RB_Order_Guest_ViewModel>();
tempTimeGuestList.AddRange(guestList.Where(qitem => qitem.ClassId == subItem.ClassId && (qitem.GuestState == GuestStateEnum.Normal || qitem.GuestState == GuestStateEnum.StopClassesApplyIng || ((qitem.GuestState == GuestStateEnum.StopClasses || qitem.GuestState == GuestStateEnum.Graduate) && qitem.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(qitem.ChangeEffectTime)) >= subItem.ClassDate))));
tempTimeGuestList.AddRange(tempGuestList.Where(qitem => qitem.ClassId == subItem.ClassId && item.ClassTimeId == qitem.ClassTimeId && (qitem.GuestState == GuestStateEnum.Normal || qitem.GuestState == GuestStateEnum.StopClassesApplyIng || ((qitem.GuestState == GuestStateEnum.StopClasses || qitem.GuestState == GuestStateEnum.Graduate) && qitem.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(qitem.ChangeEffectTime)) >= subItem.ClassDate))));
......
......@@ -333,7 +333,7 @@ namespace Edu.Module.Duty
#endregion
#region 验证教室
if (CheckClassRoomModule( chooseDateTime, chooseEndTime, model,out string roomMessage))
if (CheckClassRoomModule(chooseDateTime, chooseEndTime, model,out string roomMessage))
{
message = roomMessage;
return false;
......@@ -455,7 +455,7 @@ namespace Edu.Module.Duty
var endTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(item.ClassDate) + " " + item.EndTime);
if (chooseDateTime < endTime && chooseEndTime > startTime)
{
message = string.Format("此教师已有{0}的正常上课计划!请重新选择时间", Common.ConvertHelper.FormatDate(chooseDateTime));
message = string.Format("此教师已有 {0} {1}-{2}【{3}】正常上课计划!请重新选择时间", Common.ConvertHelper.FormatDate(model.ClassDate), item.StartTime, item.EndTime, item.ClassName);
return true;
}
}
......@@ -470,7 +470,7 @@ namespace Edu.Module.Duty
};
if (CheckReserveClassExistsModule(checkModel))
{
message = string.Format("此教师已有{0}的试听课计划!请重新选择时间", Common.ConvertHelper.FormatDate(chooseDateTime));
message = string.Format("此教师已有 {0} {1}-{2} 试听课计划!请重新选择时间", Common.ConvertHelper.FormatDate(model.ClassDate), model.ClassTime, model.EndTime);
return true;
}
return false;
......@@ -502,7 +502,7 @@ namespace Edu.Module.Duty
var endTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(item.ClassDate) + " " + item.EndTime);
if (chooseDateTime < endTime && chooseEndTime > startTime)
{
RoomMessage = string.Format("此教室已有{0}的正常上课计划!请重新选择时间", Common.ConvertHelper.FormatDate(chooseDateTime));
RoomMessage = string.Format("此教室已有 {0} {1}-{2}【{3}】正常上课计划!请重新选择时间", Common.ConvertHelper.FormatDate(model.ClassDate), item.StartTime, item.EndTime, item.ClassName);
return true;
}
}
......@@ -517,7 +517,7 @@ namespace Edu.Module.Duty
};
if (CheckReserveClassExistsModule(checkModel))
{
RoomMessage = string.Format("此教室已有{0}的试听课计划!请重新选择时间", Common.ConvertHelper.FormatDate(chooseDateTime));
RoomMessage = string.Format("此教室已有 {0} {1}-{2} 试听课计划!请重新选择时间", Common.ConvertHelper.FormatDate(model.ClassDate), model.ClassTime, model.EndTime);
return true;
}
return false;
......
using Edu.Model.ViewModel.Course;
using Edu.Repository.Course;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
namespace Edu.Module.Exam
{
/// <summary>
/// 课程预习测试处理类
/// </summary>
public class CourseExamModule
{
/// <summary>
/// 课程章节单词处理类对象
/// </summary>
private readonly RB_Course_WordsRepository course_WordsRepository = new RB_Course_WordsRepository();
/// <summary>
/// 生成课程复习和预习单词
/// </summary>
/// <param name="CourseId"></param>
/// <param name="ChapterId"></param>
/// <param name="NextChapterId"></param>
/// <returns></returns>
public object CreateCourseExam(int CourseId,int ChapterId,int NextChapterId)
{
object result = new object();
var list = course_WordsRepository.GetCourseWordsListRepository(new RB_Course_Words_Extend()
{
CourseId = CourseId,
QChapterIds = ChapterId + "," + NextChapterId
});
var reviewList = list?.Where(qitem => qitem.ChapterId == ChapterId)?.OrderBy(qitem => Guid.NewGuid())?.ToList();
var prepList = list?.Where(qitem => qitem.ChapterId == NextChapterId)?.OrderBy(qitem => Guid.NewGuid())?.ToList();
if (reviewList != null && reviewList.Count > 0)
{
for (var i = 0; i < reviewList.Count; i++)
{
//选择题
if (i % 2 == 0)
{
}
}
}
if (prepList != null && prepList.Count > 0)
{
}
return result;
}
}
}
......@@ -78,6 +78,14 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Course_Words_Extend.CourseId), query.QCourseIds);
}
if (query.ChapterId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_Words_Extend.ChapterId), query.ChapterId);
}
if (!string.IsNullOrEmpty(query.QChapterIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Course_Words_Extend.ChapterId), query.QChapterIds);
}
}
return Get<RB_Course_Words_Extend>(builder.ToString()).ToList();
}
......
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