Commit 6e3e9111 authored by 吴春's avatar 吴春

解决冲突

parents 4f386cbf 4a580514
......@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Scroll;
using Edu.Model.ViewModel.Sell;
namespace Edu.Model.ViewModel.Scroll
{
......@@ -141,6 +142,16 @@ namespace Edu.Model.ViewModel.Scroll
/// </summary>
public int CourseChapterNo { get; set; }
/// <summary>
/// 学员订单Id
/// </summary>
public int OrderId { get; set; }
/// <summary>
/// 订单课程Id
/// </summary>
public List<RB_Order_Course_ViewModel> OrderCourseList { get; set; }
/// <summary>
/// 学生列表
/// </summary>
......
......@@ -221,6 +221,11 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Class_CheckRepository class_CheckRepository = new RB_Class_CheckRepository();
/// <summary>
/// 订单课程仓储层
/// </summary>
private readonly RB_Order_CourseRepository order_CourseRepository = new RB_Order_CourseRepository();
/// <summary>
/// 获取班级列表
......@@ -4083,11 +4088,20 @@ namespace Edu.Module.Course
});
}
List<RB_Course_Chapter_ViewModel> chatperList = new List<RB_Course_Chapter_ViewModel>();
List<RB_Order_Course_ViewModel> orderCourseList = new List<RB_Order_Course_ViewModel>();
if (appointList != null && appointList.Count > 0)
{
string learnIds = string.Join(",", appointList.Select(qitem => qitem.LearnCourseId).Distinct());
List<int> learnList = Common.ConvertHelper.StringToList(learnIds);
string courseIds = string.Join(",", appointList.Select(qitem => qitem.CourseId).Distinct());
string orderIds = string.Join(",", appointList.Select(qitem => qitem.OrderId));
if (!string.IsNullOrEmpty(orderIds))
{
orderCourseList = order_CourseRepository.GetOrderCourseListRepository(new RB_Order_Course_ViewModel() { QOrderIds = orderIds });
}
List<int> courseList = Common.ConvertHelper.StringToList(courseIds);
List<int> newList = new List<int>();
if (learnList != null)
......@@ -4207,6 +4221,18 @@ namespace Edu.Module.Course
qitem.ShiftSort == item.Key.ShiftSort &&
qitem.CourseSTime == item.Key.CourseSTime
).ToList();
foreach (var sItem in subAppointList)
{
var tempOrderCourse = orderCourseList?.Where(qitem => qitem.OrderId == sItem.OrderId)?.ToList();
if (tempOrderCourse != null && tempOrderCourse.Count > 0)
{
string NewCourseName = string.Join("、", tempOrderCourse.Select(qitem => qitem.CourseName));
if (!string.IsNullOrEmpty(NewCourseName))
{
sItem.LearnCourseName = NewCourseName;
}
}
}
var tempChatper = chatperList?.Where(qitem => qitem.CourseId == item.Key.CourseId && qitem.ChapterNo == item.Key.ChapterNo.ToString())?.FirstOrDefault();
int CourseGradeId = 0;
......@@ -4384,6 +4410,22 @@ namespace Edu.Module.Course
string learnIds = string.Join(",", appointList.Select(qitem => qitem.LearnCourseId).Distinct());
List<int> learnList = Common.ConvertHelper.StringToList(learnIds);
string courseIds = string.Join(",", appointList.Select(qitem => qitem.CourseId).Distinct());
List<RB_Order_Course_ViewModel> orderCourseList = new List<RB_Order_Course_ViewModel>();
string orderIds = string.Join(",", appointList.Select(qitem => qitem.OrderId));
List<int> orderCourseIdList = new List<int>();
if (!string.IsNullOrEmpty(orderIds))
{
orderCourseList = order_CourseRepository.GetOrderCourseListRepository(new RB_Order_Course_ViewModel() { QOrderIds = orderIds });
if (orderCourseList != null && orderCourseList.Count > 0)
{
orderCourseIdList = orderCourseList.Select(qitem => qitem.CourseId).Distinct().ToList();
}
}
foreach (var item in appointList)
{
item.OrderCourseList = orderCourseList?.Where(qitem => qitem.OrderId == item.OrderId)?.ToList() ?? new List<RB_Order_Course_ViewModel>();
}
List<int> courseList = Common.ConvertHelper.StringToList(courseIds);
List<int> newList = new List<int>();
if (learnList != null)
......@@ -4394,12 +4436,16 @@ namespace Edu.Module.Course
{
newList.AddRange(courseList);
}
if (orderCourseIdList != null && orderCourseIdList.Count > 0)
{
newList.AddRange(orderCourseIdList);
}
if (newList != null && newList.Count > 0)
{
chatperList = course_ChapterRepository.GetChapterListRepository(new RB_Course_Chapter_ViewModel()
{
CourseIds = string.Join(",", newList)
CourseIds = string.Join(",", newList.Distinct())
}); ;
}
}
......
......@@ -286,7 +286,7 @@ ORDER BY r.Id desc ";
string sql = $@"
SELECT r.*,c.AccountId as TeacherId,c.WorkUserId,t.TeacherName,t.TeacherHead,s.StuName,sch.OpenId as StuOpenId,cou.CourseName,cou.ScrollMinNum,cou.ScrollMaxNum,cou.CourseTimeId,cr.RoomName
,cr.School_Id as RoomSchoolId,sc.SName as RoomSchoolName ,og.TotalChapterNo,IFNULL(c2.CourseName,'') AS LearnCourseName,og.CourseChapterNo
,cr.School_Id as RoomSchoolId,sc.SName as RoomSchoolName ,og.TotalChapterNo,IFNULL(c2.CourseName,'') AS LearnCourseName,og.CourseChapterNo,og.OrderId
FROM RB_Scroll_Appointment r
INNER JOIN rb_order_guest og on r.GuestId = og.Id
INNER JOIN rb_account c on r.AccountId = c.Id
......
......@@ -707,6 +707,7 @@ namespace Edu.WebApi.Controllers.Course
IsQRoot = base.ParmJObj.GetInt("IsQRoot"),
QOrderId = base.ParmJObj.GetInt("OrderId"),
QOrderBy = 1,
CourseRate = (CourseRateEnum)base.ParmJObj.GetInt("CourseGradeId"),
};
if (query.CourseId <= 0)
{
......@@ -1649,45 +1650,5 @@ namespace Edu.WebApi.Controllers.Course
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
#region 测试
[HttpPost]
public ApiResult EduCreateScrollChapterTimer()
{
try
{
LogHelper.Write("滚动开班预约课程生成");
scrollClassCommon.CreateScrollAppointment(100000);
}
catch (Exception ex)
{
LogHelper.Write(ex, "CreateScrollAppointment");
}
try
{
LogHelper.Write("滚动开班预约课程即将取消通知");
scrollClassCommon.RemindScrollAppointment(100000);
}
catch (Exception ex)
{
LogHelper.Write(ex, "RemindScrollAppointment");
}
try
{
LogHelper.Write("滚动开班学生签到");
ScrollClassCommonModule scrollClassModule = new ScrollClassCommonModule();
scrollClassModule.CreateScrollChapter(100000);
}
catch (Exception ex)
{
LogHelper.Write(ex, "CreateScrollChapter");
}
return ApiResult.Success();
}
#endregion
}
}
\ No newline at end of file
......@@ -809,8 +809,8 @@ namespace Edu.WebApi.Controllers.Course
new ExcelColumn(value:"日期"){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"星期"){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"时间"){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"课程"){CellWidth=50,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"上课地点"){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:"章节"){CellWidth=50,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
//new ExcelColumn(value:"上课地点"){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
}
};
slist.Add(headerTimeLast);
......@@ -819,17 +819,35 @@ namespace Edu.WebApi.Controllers.Course
var guestAppointList = appointList.Where(x => x.GuestId == item.Key).OrderBy(x => x.Date);
foreach (var itemGuest in guestAppointList)
{
List<ExcelColumn> excelColumns = new List<ExcelColumn>();
excelColumns.Add(new ExcelColumn(value: itemGuest.StuName) { CellWidth = 24, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER });
excelColumns.Add(new ExcelColumn(value: itemGuest.Date.ToString("MM月dd日")) { CellWidth = 24, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER });
excelColumns.Add(new ExcelColumn(value: Common.ConvertHelper.GetWeekDay(itemGuest.Date)) { CellWidth = 24, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER });
excelColumns.Add(new ExcelColumn(value: (itemGuest.CourseSTime ?? "") + "-" + (itemGuest.CourseETime ?? "")) { CellWidth = 24, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER });
var tempChapter =new RB_Course_Chapter_ViewModel();
if (itemGuest.OrderCourseList != null && itemGuest.OrderCourseList.Count > 0)
{
tempChapter = chatperList.FirstOrDefault(qitem => itemGuest.OrderCourseList.Any(sItem => sItem.CourseId == qitem.CourseId) && qitem.CourseRate == itemGuest.CourseGradeId && qitem.ChapterId == itemGuest.CourseGradeNo) ?? new RB_Course_Chapter_ViewModel();
}
else
{
tempChapter = chatperList.FirstOrDefault(qitem => qitem.CourseId == itemGuest.LearnCourseId && qitem.CourseRate == itemGuest.CourseGradeId && qitem.ChapterId == itemGuest.CourseGradeNo) ?? new RB_Course_Chapter_ViewModel();
}
string chapterName = itemGuest.CourseName + "-" + itemGuest.CourseGradeNo;
if (tempChapter != null && tempChapter.ChapterId > 0)
{
chapterName = tempChapter.CourseRate.ToName() + "-" + tempChapter.ChapterName;
}
else
{
string XX = "";
}
excelColumns.Add(new ExcelColumn(value: chapterName) { CellWidth = 50, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER });
ExcelDataSource rowGuest = new ExcelDataSource()
{
ExcelRows = new List<ExcelColumn>(30)
{
new ExcelColumn(value:itemGuest.StuName){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:itemGuest.Date.ToString("MM月dd日")){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:Common.ConvertHelper.GetWeekDay(itemGuest.Date)){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:(itemGuest.CourseSTime??"")+"-"+(itemGuest.CourseETime??"")){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:itemGuest.CourseName+"-"+itemGuest.ChapterNo){CellWidth=50,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:itemGuest.RoomName){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
}
ExcelRows = excelColumns
};
slist.Add(rowGuest);
}
......@@ -842,7 +860,7 @@ namespace Edu.WebApi.Controllers.Course
new ExcelColumn(value:""){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:""){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:""){CellWidth=50,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
new ExcelColumn(value:""){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
//new ExcelColumn(value:""){CellWidth=24,HAlignmentEnum= HAlignmentEnum.CENTER,VAlignmentEnum= VAlignmentEnum.CENTER },
}
};
slist.Add(rowKGuest);
......
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