Commit 13ea5b90 authored by 黄奎's avatar 黄奎

约课调整

parent 7c389634
...@@ -3929,8 +3929,8 @@ namespace Edu.Module.Course ...@@ -3929,8 +3929,8 @@ namespace Edu.Module.Course
//约课 //约课
appointList.Where(x => x.Date == ClassDate).GroupBy(x => new { x.Date, x.TeacherId, x.TeacherName, x.RoomId, x.RoomName, x.CourseName, x.CourseGradeNo, x.CourseGradeId, x.CourseSTime }).OrderBy(x => x.Key.CourseSTime).ToList().ForEach(item => appointList.Where(x => x.Date == ClassDate).GroupBy(x => new { x.Date, x.TeacherId, x.TeacherName, x.RoomId, x.RoomName, x.CourseName, x.CourseGradeNo, x.CourseGradeId, x.CourseSTime }).OrderBy(x => x.Key.CourseSTime).ToList().ForEach(item =>
{ {
//上课时段 //上课时段
string STime = item.FirstOrDefault().CourseSTime ?? "", ETime = item.FirstOrDefault().CourseETime ?? ""; string STime = item.FirstOrDefault().CourseSTime ?? "", ETime = item.FirstOrDefault().CourseETime ?? "";
var currentDate = Common.ConvertHelper.FormatDate(ClassDate) + " " + STime; var currentDate = Common.ConvertHelper.FormatDate(ClassDate) + " " + STime;
subList.Add(new subList.Add(new
...@@ -4111,11 +4111,11 @@ namespace Edu.Module.Course ...@@ -4111,11 +4111,11 @@ namespace Edu.Module.Course
} }
} }
if (learnList != null&& learnList.Count>0) if (learnList != null && learnList.Count > 0)
{ {
courseIdList.AddRange(learnList); courseIdList.AddRange(learnList);
} }
if (tempCourseIdList != null&& tempCourseIdList.Count>0) if (tempCourseIdList != null && tempCourseIdList.Count > 0)
{ {
courseIdList.AddRange(tempCourseIdList); courseIdList.AddRange(tempCourseIdList);
} }
...@@ -4126,7 +4126,7 @@ namespace Edu.Module.Course ...@@ -4126,7 +4126,7 @@ namespace Edu.Module.Course
{ {
CourseIds = string.Join(",", courseIdList.Distinct()) CourseIds = string.Join(",", courseIdList.Distinct())
}); ; }); ;
courseList= courseRepository.GetCourseListRepository(new RB_Course_ViewModel() { QCourseIds = string.Join(",", courseIdList.Distinct()) }); courseList = courseRepository.GetCourseListRepository(new RB_Course_ViewModel() { QCourseIds = string.Join(",", courseIdList.Distinct()) });
} }
} }
...@@ -4210,7 +4210,6 @@ namespace Edu.Module.Course ...@@ -4210,7 +4210,6 @@ namespace Edu.Module.Course
x.CourseSTime, x.CourseSTime,
x.ChapterNo, x.ChapterNo,
x.State, x.State,
//x.CourseGradeNo,
}) })
.OrderBy(x => x.Key.CourseSTime).ToList(); .OrderBy(x => x.Key.CourseSTime).ToList();
foreach (var item in tempAppointList) foreach (var item in tempAppointList)
...@@ -4219,7 +4218,7 @@ namespace Edu.Module.Course ...@@ -4219,7 +4218,7 @@ namespace Edu.Module.Course
string STime = item.FirstOrDefault().CourseSTime ?? "", ETime = item.FirstOrDefault().CourseETime ?? ""; string STime = item.FirstOrDefault().CourseSTime ?? "", ETime = item.FirstOrDefault().CourseETime ?? "";
var subAppointList = appointList.Where(qitem => var subAppointList = appointList.Where(qitem =>
qitem.Date == item.Key.Date && qitem.Date == item.Key.Date &&
qitem.AccountId==item.Key.AccountId&& qitem.AccountId == item.Key.AccountId &&
qitem.TeacherId == item.Key.TeacherId && qitem.TeacherId == item.Key.TeacherId &&
qitem.TeacherName == item.Key.TeacherName && qitem.TeacherName == item.Key.TeacherName &&
qitem.RoomId == item.Key.RoomId && qitem.RoomId == item.Key.RoomId &&
...@@ -4250,24 +4249,58 @@ namespace Edu.Module.Course ...@@ -4250,24 +4249,58 @@ namespace Edu.Module.Course
{ {
if (sItem.CourseChapterNo > 0) if (sItem.CourseChapterNo > 0)
{ {
FinishChapterNoName = string.Format("第{0}次课", sItem.CourseChapterNo); FinishChapterNoName = string.Format("{0}-第{1}次课", sItem.CourseGradeId.ToName(), sItem.CourseChapterNo);
} }
else else
{ {
FinishChapterNoName = "暂无"; FinishChapterNoName = "暂无";
} }
CourseChapterNoName = string.Format("第{0}次课", sItem.CourseGradeNo); CourseChapterNoName = string.Format("{0}-第{1}次课", sItem.CourseGradeId.ToName(), sItem.CourseGradeNo);
} }
else else
{ {
FinishChapterNoName = chatperList?.FirstOrDefault(qitem => qitem.CourseId == sItem.LearnCourseId && qitem.CourseRate == sItem.CourseGradeId && qitem.ChapterNo == sItem.CourseChapterNo.ToString())?.ChapterName; var chapterFinish = new RB_Course_Chapter_ViewModel();
CourseChapterNoName = chatperList?.FirstOrDefault(qitem => qitem.CourseId == sItem.LearnCourseId && qitem.CourseRate == sItem.CourseGradeId && qitem.ChapterNo == sItem.CourseGradeNo.ToString())?.ChapterName; var chapterCurrent = new RB_Course_Chapter_ViewModel();
//新订单
if (tempOrderCourse != null && tempOrderCourse.Count > 0)
{
chapterFinish = chatperList?.FirstOrDefault(qitem => qitem.CourseId == sItem.LearnCourseId && qitem.CourseRate == sItem.CourseGradeId && qitem.ChapterNo == sItem.CourseChapterNo.ToString());
chapterCurrent = chatperList?.FirstOrDefault(qitem => qitem.CourseId == sItem.LearnCourseId && qitem.CourseRate == sItem.CourseGradeId && qitem.ChapterNo == sItem.CourseGradeNo.ToString());
}
//老订单
else
{
chapterFinish = chatperList?.FirstOrDefault(qitem => qitem.CourseId == sItem.LearnCourseId && qitem.ChapterNo == sItem.CourseChapterNo.ToString());
chapterCurrent = chatperList?.FirstOrDefault(qitem => qitem.CourseId == sItem.LearnCourseId && qitem.ChapterNo == sItem.CourseGradeNo.ToString());
}
if (chapterFinish != null && chapterFinish.ChapterId > 0)
{
if (chapterFinish.ChapterName.Contains(chapterFinish.CourseRate.ToName().Replace("课程","")))
{
FinishChapterNoName = chapterFinish.ChapterName;
}
else
{
FinishChapterNoName = chapterFinish?.CourseRate.ToName().Replace("课程","") + "-" + chapterFinish.ChapterName;
}
}
if (chapterCurrent != null && chapterCurrent.ChapterId > 0)
{
if (chapterCurrent.ChapterName.Contains(chapterCurrent.CourseRate.ToName().Replace("课程","")))
{
CourseChapterNoName = chapterCurrent?.ChapterName;
}
else
{
CourseChapterNoName = chapterCurrent?.CourseRate.ToName().Replace("课程","") + "-" + chapterCurrent?.ChapterName;
}
}
} }
if (sItem.StuName == "曹时锟") if (sItem.StuName == "韩梦逸")
{ {
string str = ""; string str = "";
} }
appointGuestList.Add(new appointGuestList.Add(new
{ {
GuestName = sItem.StuName, GuestName = sItem.StuName,
...@@ -4290,7 +4323,7 @@ namespace Edu.Module.Course ...@@ -4290,7 +4323,7 @@ namespace Edu.Module.Course
} }
var tempChatper = chatperList?.Where(qitem => qitem.CourseId == item.Key.CourseId && qitem.ChapterNo == item.Key.ChapterNo.ToString())?.FirstOrDefault(); var tempChatper = chatperList?.Where(qitem => qitem.CourseId == item.Key.CourseId && qitem.ChapterNo == item.Key.ChapterNo.ToString())?.FirstOrDefault();
string ChapterName = ""; string ChapterName = "";
int CourseGradeId = 0; int CourseGradeId = 0;
if (tempChatper != null) if (tempChatper != null)
{ {
...@@ -4327,7 +4360,7 @@ namespace Edu.Module.Course ...@@ -4327,7 +4360,7 @@ namespace Edu.Module.Course
StartTime = STime, StartTime = STime,
EndTime = ETime, EndTime = ETime,
CompleteProgress = -1, CompleteProgress = -1,
GuestList= appointGuestList, GuestList = appointGuestList,
AppointState = item.Where(x => x.State == CourseAppointStateEnum.WaitSure).Any() ? 1 : 2, AppointState = item.Where(x => x.State == CourseAppointStateEnum.WaitSure).Any() ? 1 : 2,
item.Key.ShiftSort, item.Key.ShiftSort,
EnrollNum = item.Count(), EnrollNum = item.Count(),
......
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