Commit 33da1953 authored by 黄奎's avatar 黄奎

页面修改

parent 1e9c07c4
......@@ -54,6 +54,10 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public int QOrderBy { get; set; }
/// <summary>
/// 根据订单查询课程
/// </summary>
public int QOrderId { get; set; }
}
[Serializable]
......
......@@ -22,6 +22,7 @@ using Edu.Repository.Grade;
using Edu.Common.Enum.Question;
using System.Threading.Tasks;
using Edu.Model.Entity.Course;
using Edu.Repository.Sell;
namespace Edu.Module.Course
{
......@@ -125,6 +126,8 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Course_WordsRepository course_WordsRepository = new RB_Course_WordsRepository();
private readonly RB_Order_CourseRepository order_CourseRepository = new RB_Order_CourseRepository();
#region 课程管理
public List<RB_Course_ViewModel> GetAllCourseChapterCountModule(int groupId, int courseId)
......@@ -444,6 +447,26 @@ namespace Edu.Module.Course
return list;
}
/// <summary>
/// 获取课程章节列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Course_Chapter_ViewModel> GetChapterListModuleNew(RB_Course_Chapter_ViewModel query)
{
if (query.QOrderId > 0)
{
var tempList = order_CourseRepository.GetOrderCourseListRepository(new Model.ViewModel.Sell.RB_Order_Course_ViewModel() { OrderId = query.QOrderId });
if (tempList != null && tempList.Count > 0)
{
query.CourseIds = string.Join(",", tempList.Select(qitem => qitem.CourseId));
query.CourseId = 0;
}
}
var list = chapterRepository.GetChapterListRepository(query);
return list;
}
/// <summary>
/// 批量导入课程章节和单词
/// </summary>
......
......@@ -36,6 +36,7 @@ namespace Edu.Module.Course
private RB_CourseRepository courseRepository = new RB_CourseRepository();
private RB_Class_RoomRepository class_RoomRepository = new RB_Class_RoomRepository();
private RB_Scroll_AppointmentRepository appointmentRepository = new RB_Scroll_AppointmentRepository();
private RB_Order_CourseRepository order_CourseRepository = new RB_Order_CourseRepository();
/// <summary>
/// 排课计划表
......@@ -49,6 +50,12 @@ namespace Edu.Module.Course
{
List<int> IdList = new List<int>();
List<int> roomIdList = new List<int>();
List<RB_Order_Course_ViewModel> orderCourseList = new List<RB_Order_Course_ViewModel>();
string orderIds = string.Join(",", list.Select(qitem => qitem.OrderId));
if (!string.IsNullOrEmpty(orderIds))
{
orderCourseList= order_CourseRepository.GetOrderCourseListRepository(new RB_Order_Course_ViewModel() { QOrderIds = orderIds });
}
foreach (var item in list)
{
if (item.CourseItems != null && item.CourseItems.Count > 0)
......@@ -93,6 +100,15 @@ namespace Edu.Module.Course
foreach (var item in list)
{
var tempOrderCourse = orderCourseList?.Where(qitem => qitem.OrderId == item.OrderId)?.ToList();
if(tempOrderCourse!=null&& tempOrderCourse.Count > 0)
{
string NewCourseName = string.Join("、", tempOrderCourse.Select(qitem => qitem.CourseName));
if (!string.IsNullOrEmpty(NewCourseName))
{
item.CourseName = NewCourseName;
}
}
if (item.HeadMasterId > 0)
{
item.HeadMasterName = empList?.FirstOrDefault(qitem => qitem.Id == item.HeadMasterId)?.AccountName ?? "";
......
......@@ -2260,6 +2260,12 @@ namespace Edu.Module.Course
var list = student_OrderGuestRepository.GetCanAppointmentStuListRepository_V2(stuName, NextChapterGradeNo, CourseGradeId, SchoolId, group_Id);
if (list != null && list.Count > 0)
{
List<RB_Order_Course_ViewModel> orderCourseList = new List<RB_Order_Course_ViewModel>();
string orderIds = string.Join(",", list.Select(qitem => qitem.OrderId));
if (!string.IsNullOrEmpty(orderIds))
{
orderCourseList = order_CourseRepository.GetOrderCourseListRepository(new RB_Order_Course_ViewModel() { QOrderIds = orderIds });
}
string courseIds = string.Join(",", list.Select(qitem => qitem.CourseId).Distinct());
List<RB_Course_Chapter_ViewModel> courseChapterList = new List<RB_Course_Chapter_ViewModel>();
if (!string.IsNullOrEmpty(courseIds))
......@@ -2268,6 +2274,15 @@ namespace Edu.Module.Course
}
foreach (var item in list)
{
var tempOrderCourse = orderCourseList?.Where(qitem => qitem.OrderId == item.OrderId)?.ToList();
if (tempOrderCourse != null && tempOrderCourse.Count > 0)
{
string NewCourseName = string.Join("、", tempOrderCourse.Select(qitem => qitem.CourseName));
if (!string.IsNullOrEmpty(NewCourseName))
{
item.CourseName = NewCourseName;
}
}
var tempChapter = courseChapterList?.FirstOrDefault(qitem => qitem.CourseId == item.CourseId && qitem.ChapterNo == item.CourseChapterNo.ToString());
item.CourseChapterNoName = tempChapter?.ChapterName ?? "";
item.CourseRate = tempChapter?.CourseRate ?? Common.Enum.Course.CourseRateEnum.N5;
......
......@@ -23,22 +23,21 @@ namespace Edu.Repository.Sell
string where = $@" 1=1 ";
if (demodel.Group_Id > 0)
{
where += $@" AND {nameof(RB_Order_Course.Group_Id)} ={demodel.Group_Id}";
where += $@" AND A.{nameof(RB_Order_Course.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.OrderId > 0)
{
where += $@" AND {nameof(RB_Order_Course.OrderId)} ={demodel.OrderId}";
where += $@" AND A.{nameof(RB_Order_Course.OrderId)} ={demodel.OrderId}";
}
if (demodel.ClassId > 0)
{
where += $@" AND {nameof(RB_Order_Course.ClassId)} ={demodel.ClassId}";
where += $@" AND A.{nameof(RB_Order_Course.ClassId)} ={demodel.ClassId}";
}
if (!string.IsNullOrEmpty(demodel.QOrderIds))
{
where += $@" AND {nameof(RB_Order_Course.OrderId)} in({demodel.QOrderIds})";
where += $@" AND A.{nameof(RB_Order_Course.OrderId)} in({demodel.QOrderIds})";
}
string sql = $@" SELECT * FROM RB_Order_Course WHERE {where}";
string sql = $@" SELECT A.*,IFNULL(B.CourseName,'') AS CourseName FROM RB_Order_Course AS A LEFT JOIN rb_course AS B ON A.CourseId=B.CourseId WHERE {where}";
return Get<RB_Order_Course_ViewModel>(sql).ToList();
}
}
......
......@@ -705,13 +705,15 @@ namespace Edu.WebApi.Controllers.Course
{
CourseId = base.ParmJObj.GetInt("CourseId"),
IsQRoot = base.ParmJObj.GetInt("IsQRoot"),
QOrderId = base.ParmJObj.GetInt("OrderId"),
QOrderBy=1,
};
if (query.CourseId <= 0)
{
return ApiResult.ParamIsNull(message: "请传递课程编号!");
}
query.Group_Id = base.UserInfo.Group_Id;
var list = courseModule.GetChapterListModule(query).OrderBy(qitem => qitem.SortNum).ToList();
var list = courseModule.GetChapterListModuleNew(query).ToList();
return ApiResult.Success(data: list.Select(qitem => new
{
qitem.ChapterId,
......
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