Commit 54bb0803 authored by 黄奎's avatar 黄奎

页面修改

parent 3ab78970
...@@ -15,5 +15,11 @@ namespace Edu.Common.Enum.Finance ...@@ -15,5 +15,11 @@ namespace Edu.Common.Enum.Finance
/// </summary> /// </summary>
[EnumField("调课")] [EnumField("调课")]
ChangeClass = 1, ChangeClass = 1,
/// <summary>
/// 退课
/// </summary>
[EnumField("退课")]
BackClass = 2,
} }
} }
...@@ -3091,54 +3091,7 @@ namespace Edu.Module.Course ...@@ -3091,54 +3091,7 @@ namespace Edu.Module.Course
} }
#region 教师-我的班级
/// <summary>
/// 获取班级分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <param name="isGetStepPrice">是否查询阶梯价格</param>
/// <returns></returns>
public List<RB_Class_ViewModel> GetTeacherClassPageList(int pageIndex, int pageSize, out long rowsCount, RB_Class_ViewModel query, bool isGetStepPrice = false)
{
var list = classRepository.GetTeacherClassPageList(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
var classTimeList = new List<RB_Class_Time_ViewModel>();
// var classOrderList = new List<RB_Order_ViewModel>();
var stepPriceList = new List<RB_Class_StepPrice_ViewModel>();
var otherCourseList = new List<RB_Class_Course_Extend>();
string ids = string.Join(",", list.Select(qitem => qitem.ClassId));
if (!string.IsNullOrEmpty(ids))
{
classTimeList = class_TimeRepository.GetClassTimeListRepository(ids);
// classOrderList = orderRepository.GetClassOrderPeopleNumRepository(ids);
otherCourseList = GetClassCourseListModule(new RB_Class_Course_Extend() { QClassIds = ids });
}
if (isGetStepPrice)
{
stepPriceList = class_StepPriceRepository.GetClassStepPriceListRepository(new RB_Class_StepPrice_ViewModel() { QClassIds = ids })?.ToList() ?? new List<RB_Class_StepPrice_ViewModel>();
}
//课程计划上课日期
foreach (var item in list)
{
item.NewPlanDateTime = classTimeList?.Where(qitem => qitem.ClassId == item.ClassId)?.FirstOrDefault()?.NewPlanDateTime;
if (isGetStepPrice)
{
item.ClassStepPriceList = stepPriceList?.Where(qitem => qitem.ClassId == item.ClassId)?.ToList() ?? new List<RB_Class_StepPrice_ViewModel>();
}
item.OtherCourseList = otherCourseList?.Where(qitem => qitem.ClassId == item.ClassId)?.ToList() ?? new List<RB_Class_Course_Extend>();
}
}
return list;
}
#endregion
#region 教师-学员管理 #region 教师-学员管理
/// <summary> /// <summary>
......
...@@ -189,12 +189,14 @@ WHERE 1=1 ...@@ -189,12 +189,14 @@ WHERE 1=1
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT A.*,B.CourseName,C.AssistName,IFNULL(C.AssistIcon,'') AS AssistIcon,D.TeacherName,IFNULL(D.TeacherHead,'') AS TeacherHead SELECT A.*,B.CourseName,C.AssistName,IFNULL(C.AssistIcon,'') AS AssistIcon,D.TeacherName,IFNULL(D.TeacherHead,'') AS TeacherHead
,E.SName AS SchoolName,IFNULL(F.RoomName,'') AS RoomName ,E.SName AS SchoolName,IFNULL(F.RoomName,'') AS RoomName,plan.TotalPlanNum,ySplan.UsePlanNum
FROM rb_class AS A LEFT JOIN rb_course AS B ON A.CouseId=B.CourseId FROM rb_class AS A LEFT JOIN rb_course AS B ON A.CouseId=B.CourseId
LEFT JOIN rb_assist AS C ON A.Assist_Id=C.AId LEFT JOIN rb_assist AS C ON A.Assist_Id=C.AId
LEFT JOIN rb_teacher AS D ON A.Teacher_Id=D.TId LEFT JOIN rb_teacher AS D ON A.Teacher_Id=D.TId
LEFT JOIN rb_school AS E ON A.School_Id=E.SId LEFT JOIN rb_school AS E ON A.School_Id=E.SId
LEFT JOIN rb_class_room AS F ON A.ClassRoomId=F.RoomId LEFT JOIN rb_class_room AS F ON A.ClassRoomId=F.RoomId
LEFT JOIN ((SELECT ClassId,COUNT(*) AS TotalPlanNum FROM rb_class_plan where `Status`=0 GROUP BY ClassId)) as plan on plan.ClassId=a.ClassId
LEFT JOIN ((SELECT ClassId,COUNT(*) AS UsePlanNum FROM rb_class_plan where `Status`=0 and DATE_FORMAT(ClassDate,'%Y-%m-%d') <=DATE_FORMAT(NOW(),'%Y-%m-%d') GROUP BY ClassId)) as ySplan on ySplan.ClassId=a.ClassId
WHERE 1=1 WHERE 1=1
"); ");
if (query != null) if (query != null)
...@@ -509,87 +511,6 @@ where a.`Status`=0 and a.IsSubscribe=1 and ClassStatus in(1,2)"); ...@@ -509,87 +511,6 @@ where a.`Status`=0 and a.IsSubscribe=1 and ClassStatus in(1,2)");
} }
#region 教师-我的班级
/// <summary>
/// 获取班级分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_ViewModel> GetTeacherClassPageList(int pageIndex, int pageSize, out long rowsCount, RB_Class_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT plan.TotalPlanNum,ySplan.UsePlanNum,A.*,B.CourseName,C.AssistName,IFNULL(C.AssistIcon,'') AS AssistIcon,D.TeacherName,IFNULL(D.TeacherHead,'') AS TeacherHead
,E.SName AS SchoolName,IFNULL(F.RoomName,'') AS RoomName
FROM rb_class AS A LEFT JOIN rb_course AS B ON A.CouseId=B.CourseId
LEFT JOIN rb_assist AS C ON A.Assist_Id=C.AId
LEFT JOIN rb_teacher AS D ON A.Teacher_Id=D.TId
LEFT JOIN rb_school AS E ON A.School_Id=E.SId
LEFT JOIN rb_class_room AS F ON A.ClassRoomId=F.RoomId
LEFT JOIN ((SELECT ClassId,COUNT(*) as TotalPlanNum from rb_class_plan where `Status`=0 GROUP BY ClassId)) as plan on plan.ClassId=a.ClassId
LEFT JOIN ((SELECT ClassId,COUNT(*) as UsePlanNum from rb_class_plan where `Status`=0 and DATE_FORMAT(ClassDate,'%Y-%m-%d') <=DATE_FORMAT(NOW(),'%Y-%m-%d') GROUP BY ClassId)) as ySplan on ySplan.ClassId=a.ClassId
WHERE 1=1 ");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.School_Id), query.School_Id);
}
if (query.Status >= 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.Status), (int)query.Status);
}
if (query.ClassStatus > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.ClassStatus), (int)query.ClassStatus);
}
if (!string.IsNullOrWhiteSpace(query.ClassName))
{
builder.AppendFormat(" AND A.{0} LIKE @ClassName ", nameof(RB_Class_ViewModel.ClassName));
parameters.Add("ClassName", "%" + query.ClassName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.CourseName))
{
builder.AppendFormat(" AND B.{0} LIKE @CourseName ", nameof(RB_Course_ViewModel.CourseName));
parameters.Add("CourseName", "%" + query.CourseName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.AssistName))
{
builder.AppendFormat(" AND C.{0} LIKE @AssistName ", nameof(RB_Assist_ViewModel.AssistName));
parameters.Add("AssistName", "%" + query.AssistName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.TeacherName))
{
builder.AppendFormat(" AND D.{0} LIKE @TeacherName ", nameof(RB_Teacher_ViewModel.TeacherName));
parameters.Add("TeacherName", "%" + query.TeacherName.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.StartTime))
{
builder.AppendFormat(" AND A.{0}>='{1}' ", nameof(RB_Class_ViewModel.OpenTime), query.StartTime);
}
if (!string.IsNullOrEmpty(query.EndTime))
{
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Class_ViewModel.OpenTime), query.EndTime);
}
if (query.OldClassId > 0)
{
builder.AppendFormat(" AND A.{0}<>{1} ", nameof(RB_Class_ViewModel.ClassId), query.OldClassId);
}
if (query.Teacher_Id > 0)
{
builder.AppendFormat(" AND D.{0}={1} ", nameof(RB_Teacher_ViewModel.TId), query.Teacher_Id);
}
}
return GetPage<RB_Class_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
#endregion
} }
} }
\ No newline at end of file
...@@ -58,7 +58,7 @@ WHERE 1=1 ...@@ -58,7 +58,7 @@ WHERE 1=1
} }
if (!string.IsNullOrEmpty(query.StartTime)) if (!string.IsNullOrEmpty(query.StartTime))
{ {
builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m')>='{1}' ", nameof(RB_Class_Plan_ViewModel.ClassDate), query.StartTime); builder.AppendFormat(" AND A.{0}>='{1}' ", nameof(RB_Class_Plan_ViewModel.ClassDate), query.StartTime);
} }
if (!string.IsNullOrEmpty(query.EndTime)) if (!string.IsNullOrEmpty(query.EndTime))
{ {
......
...@@ -52,7 +52,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -52,7 +52,7 @@ namespace Edu.WebApi.Controllers.Course
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>(); List<object> result = new List<object>();
var list = classModule.GetTeacherClassPageList(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query); var list = classModule.GetClassPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list) foreach (var item in list)
{ {
if (item.CreateBy > 0) if (item.CreateBy > 0)
...@@ -81,7 +81,10 @@ namespace Edu.WebApi.Controllers.Course ...@@ -81,7 +81,10 @@ namespace Edu.WebApi.Controllers.Course
item.ClassStatus, item.ClassStatus,
item.Status, item.Status,
item.OtherCourseList, item.OtherCourseList,
item.ClassNo item.ClassNo,
item.CouseId,
item.FinishTimeStr,
EndClassDate= Common.ConvertHelper.FormatDate(item.EndClassDate),
}); });
} }
pageModel.Count = rowsCount; pageModel.Count = rowsCount;
......
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