Commit f5aaf467 authored by 黄奎's avatar 黄奎

页面修改

parent 9d100207
......@@ -112,7 +112,7 @@ namespace Edu.Common
}
/// <summary>
/// 格式化时间【yyyy-MM-dd
/// 格式化时间【yyyy年MM月dd日
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
......
......@@ -254,5 +254,15 @@ namespace Edu.Model.ViewModel.Sell
/// 科目名称
/// </summary>
public string CourseSubjectName { get; set; }
/// <summary>
/// 班级开班状态
/// </summary>
public ClassStatusEnum ClassStatus { get; set; }
/// <summary>
/// 学生表_学员编号
/// </summary>
public int Q_StudentId { get; set; }
}
}
\ No newline at end of file
......@@ -36,5 +36,25 @@ namespace Edu.Model.ViewModel.User
/// 学员状态
/// </summary>
public GuestStateEnum StuGuestState { get; set; }
/// <summary>
/// 订单状态
/// </summary>
public OrderStateEnum OrderState { get; set; }
/// <summary>
/// 总课时
/// </summary>
public decimal TotalHours { get; set; }
/// <summary>
/// 完成课时
/// </summary>
public decimal CompleteHours { get; set; }
/// <summary>
/// 班级状态
/// </summary>
public ClassStatusEnum ClassStatus { get; set; }
}
}
......@@ -163,6 +163,11 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Student_MakeupRepository student_MakeupRepository = new RB_Student_MakeupRepository();
/// <summary>
/// 学员订单仓储层对象
/// </summary>
private readonly RB_Student_OrderGuestRepository student_OrderGuestRepository = new RB_Student_OrderGuestRepository();
/// <summary>
/// 日志仓储对象
/// </summary>
......@@ -1967,7 +1972,6 @@ namespace Edu.Module.Course
{
//基础课时分钟数
var BasicMinutes = 0;
//BasicMinutes = class_ConfigRepository.GetBasicMinutesRepository(list[0].Group_Id);
BasicMinutes = class_ConfigRepository.GetClassMinutesRepository(list[0].ClassId);
var timeModel = class_TimeRepository.GetClassTimeListRepository(new RB_Class_Time_ViewModel()
{
......@@ -2638,7 +2642,6 @@ namespace Edu.Module.Course
var makeUpHours = (guestModel?.MakeUpHours ?? 0) + (checkModel?.CurrentDeductionHours ?? 0);
Dictionary<string, object> guestFileds = new Dictionary<string, object>()
{
//{ nameof(RB_Order_Guest_ViewModel.GuestState), 1 },
{ nameof(RB_Order_Guest_ViewModel.MakeUpHours),makeUpHours }
};
flag = order_GuestRepository.Update(guestFileds, new WhereHelper(nameof(RB_Order_Guest_ViewModel.Id), GuestId));
......@@ -3397,18 +3400,10 @@ namespace Edu.Module.Course
timeList = class_TimeRepository.GetClassTimeListRepository(new RB_Class_Time_ViewModel() { QClassPlanIds = Ids });
}
string ClassIds = string.Join(",", planList.GroupBy(x => x.ClassId).Select(x => x.Key));
//var orderStudentList = order_GuestRepository.GetList(new RB_Order_Guest_ViewModel()
//{
// ClassIds = ClassIds,
// Group_Id = model.Group_Id,
// School_Id = model.School_Id
//}).Where(x => x.GuestState == 1).ToList();
foreach (var item in planList)
{
item.PlanTimeList = new List<RB_Class_Time_ViewModel>();
item.PlanTimeList = timeList.Where(x => x.ClassPlanId == item.ClassPlanId).ToList();
//item.GuestList = new List<RB_Order_Guest_ViewModel>();
//item.GuestList = orderStudentList.Where(x => x.ClassId == item.ClassId).ToList();
}
}
return planList;
......@@ -3559,37 +3554,6 @@ namespace Edu.Module.Course
}
#endregion
/// <summary>
/// 修改班级默认上课时间
/// </summary>
/// <param name="ClassId"></param>
/// <param name="DefaultTimeJson"></param>
/// <returns></returns>
public bool UpdateClassTimeModule(int ClassId, string DefaultTimeJson)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Class_ViewModel.DefaultTimeJson), DefaultTimeJson},
};
var flag = classRepository.Update(fileds, new WhereHelper(nameof(RB_Class_ViewModel.ClassId), ClassId));
return flag;
}
/// <summary>
/// 更新上课计划中的课时数
/// </summary>
/// <param name="ClassTimeId"></param>
/// <param name="TimeHour"></param>
/// <returns></returns>
public bool UpdateClassPlanTimeModule(int ClassTimeId, decimal TimeHour)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Class_Time.TimeHour), TimeHour},
};
var flag = class_TimeRepository.Update(fileds, new WhereHelper(nameof(RB_Class_Time.ClassTimeId), ClassTimeId));
return flag;
}
#region 班级课程关联管理
......@@ -4407,7 +4371,6 @@ namespace Edu.Module.Course
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>();
var maxPlanDateList = new List<RB_Class_Plan_ViewModel>();
......@@ -4415,7 +4378,6 @@ namespace Edu.Module.Course
if (!string.IsNullOrEmpty(ids))
{
classTimeList = class_TimeRepository.GetClassTimeListRepository(ids);
// classOrderList = orderRepository.GetClassOrderPeopleNumRepository(ids);
otherCourseList = GetClassCourseListModule(new RB_Class_Course_Extend() { QClassIds = ids });
maxPlanDateList = class_PlanRepository.GetClassPlanMaxDataRepository(new RB_Class_Plan_ViewModel()
{
......@@ -4778,8 +4740,6 @@ namespace Edu.Module.Course
#endregion
#region 上课反馈记录
/// <summary>
/// 反馈意见
......@@ -4835,5 +4795,51 @@ namespace Edu.Module.Course
return class_FeedBackRepository.GetClassFeedBackPageListRepository(pageIndex, pageSize, out rowsCount, query);
}
#endregion
/// <summary>
/// 同业小程序获取学习学习情况
/// </summary>
/// <param name="student_stuId"></param>
/// <returns></returns>
public List<object> AppCustomerGetClassPlan(int student_stuId)
{
List<object> result = new List<object>();
var stuOrderList= student_OrderGuestRepository.GetStrOrderGuestListRepository(new RB_Student_OrderGuest_ViewModel()
{
Student_Id = student_stuId
});
if (stuOrderList != null && stuOrderList.Count > 0)
{
var firstModel= stuOrderList.Where(qitem =>
qitem.OrderState == OrderStateEnum.Normal
&& qitem.ClassStatus != ClassStatusEnum.EndClass
&& (qitem.TotalHours - qitem.CompleteHours) > 0)
?.OrderBy(qitem => qitem.OrderId)
?.FirstOrDefault();
int classId = firstModel?.ClassId??0;
if (classId > 0)
{
var planList = class_PlanRepository.GetClassPlanListExtRepository(new RB_Class_Plan_ViewModel()
{
ClassId = classId,
StartTime = Common.ConvertHelper.FormatDate(DateTime.Now)
});
var disList = planList.GroupBy(qitem => new { qitem.ClassId, qitem.ClassDate }).Select(qitem => new { qitem.Key.ClassId, qitem.Key.ClassDate }).Take(10);
foreach (var item in disList)
{
var tempModel = planList.Where(qitem => qitem.ClassId == item.ClassId && qitem.ClassDate == item.ClassDate)?.OrderBy(qitem => qitem.StartTime)?.FirstOrDefault();
result.Add(new
{
tempModel?.CourseName,
tempModel?.RoomName,
tempModel?.TeacherName,
TeacherIcon=tempModel?.UserIcon,
ClassTime= Common.ConvertHelper.FormatDate2(tempModel?.ClassDate) +" "+tempModel?.StartTime
});
}
}
}
return result;
}
}
}
......@@ -85,6 +85,11 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Class_PlanRepository class_PlanRepository = new RB_Class_PlanRepository();
/// <summary>
/// 班级上课时间仓储层对象
/// </summary>
private readonly RB_Class_TimeRepository class_TimeRepository = new RB_Class_TimeRepository();
/// <summary>
/// 课程仓储层对象
/// </summary>
......@@ -2262,6 +2267,16 @@ namespace Edu.Module.Course
#region 销售中心
/// <summary>
/// 获取班级上课时间列表
/// </summary>
/// <param name="classIds"></param>
public List<RB_Class_Time_ViewModel> GetClassOpenTimeListModule(string classIds)
{
var classTimeList = class_TimeRepository.GetClassTimeListRepository(classIds);
return classTimeList;
}
/// <summary>
/// 获取我的订单列表
/// </summary>
......
......@@ -91,11 +91,12 @@ WHERE 1=1
SELECT A.*,IFNULL(B.RoomName,'') AS RoomName,IFNULL(T.TeacherName,'') AS TeacherName,IFNULL(T.TeacherHead,'') AS UserIcon
,Time.StartTime,time.EndTime,time.ClassTimeId
,TIMESTAMPDIFF(MINUTE, CONCAT('2020-12-16',' ',time.StartTime), CONCAT('2020-12-16',' ',time.EndTime)) AS ClassMinutes
,time.TimeHour,c.ClassName
,time.TimeHour,c.ClassName,IFNULL(course.CourseName,'') AS CourseName
FROM RB_Class_Plan AS A LEFT JOIN rb_class_room AS B ON A.ClassRoomId=B.RoomId
LEFT JOIN rb_teacher AS T ON A.TeacherId=T.TId
LEFT JOIN rb_class_time AS time ON A.ClassPlanId=Time.ClassPlanId
Left JOIN rb_class as c ON c.ClassId=A.ClassId
LEFT JOIN rb_class as c ON c.ClassId=A.ClassId
LEFT JOIN rb_course AS course ON c.CouseId=course.CourseId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.Status), (int)DateStateEnum.Normal);
......@@ -483,7 +484,8 @@ WHERE 1=1 and class.ClassStatus in(1,2) and t.`Status`=0 and a.`Status`=0 and
public List<RB_Class_Plan_ViewModel> GetStudentPlanListRepository(RB_Class_Plan_ViewModel query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat($@"SELECT a.*,c.ClassName,lp.LessonPlanNum,c.ClassHours,b.RoomName,IFNULL(T.TeacherHead,'') AS UserIcon,IFNULL(T.TeacherName,'') AS TeacherName FROM rb_class_plan as a LEFT JOIN rb_class as c on a.ClassId=c.ClassId
builder.AppendFormat($@"
SELECT a.*,c.ClassName,lp.LessonPlanNum,c.ClassHours,b.RoomName,IFNULL(T.TeacherHead,'') AS UserIcon,IFNULL(T.TeacherName,'') AS TeacherName FROM rb_class_plan as a LEFT JOIN rb_class as c on a.ClassId=c.ClassId
LEFT JOIN rb_class_room as b on a.ClassRoomId=b.RoomId
LEFT JOIN rb_teacher AS T ON c.Teacher_Id=T.TId
LEFT JOIN rb_student_orderguest as sog on sog.ClassId=c.ClassId
......
......@@ -219,6 +219,11 @@ ORDER BY {orderBy}
where += $@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')";
}
}
//学生表中学员编号
if (demodel.Q_StudentId > 0)
{
where += string.Format(" AND o.OrderId IN (SELECT OrderId FROM rb_student_orderguest WHERE Student_Id={0}) ", demodel.Q_StudentId);
}
if (demodel.CourseId > 0)
{
where += $@" and c.{nameof(RB_Class.CouseId)} ={demodel.CourseId}";
......@@ -268,12 +273,13 @@ ORDER BY {orderBy}
string sql = $@"
SELECT o.*,c.ClassName,c.ClassNo,c.School_Id as ClassSchoolId,t.TeacherName,t.TeacherIcon,IFNULL(course.CourseName,'') AS CourseName
,C.OpenTime,course.CourseSubject,IFNULL(csubject.SubjectName,'') AS CourseSubjectName
FROM RB_Order o
LEFT JOIN rb_class c on o.ClassId = c.ClassId
,C.OpenTime,course.CourseSubject,IFNULL(csubject.SubjectName,'') AS CourseSubjectName,IFNULL(school.SName,'') AS SchoolName
,IFNULL(c.ClassStatus,0) AS ClassStatus
FROM RB_Order o LEFT JOIN rb_class c on o.ClassId = c.ClassId
LEFT JOIN rb_teacher t on c.Teacher_Id = t.TId
LEFT JOIN rb_course AS course ON (o.CourseId=course.CourseId AND o.CourseId>0 AND o.OrderType=1)
LEFT JOIN rb_course_subject AS csubject ON course.CourseSubject=csubject.Id
LEFT JOIN rb_school AS school ON c.School_Id=school.SId
WHERE {where} ORDER BY {orderBy}
";
return GetPage<RB_Order_ViewModel>(pageIndex, pageSize, out rowsCount, sql).ToList();
......
......@@ -23,9 +23,10 @@ namespace Edu.Repository.User
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.ClassName,'') AS ClassName,IFNULL(B.ClassNo,'') AS ClassNo,IFNULL(C.JoinType,0) AS StuJoinType,IFNULL(D.GuestState,0) AS StuGuestState
,C.OrderState,IFNULL(D.TotalHours,0) AS TotalHours,IFNULL(D.CompleteHours,0) AS CompleteHours,IFNULL(B.ClassStatus,0) AS ClassStatus
FROM RB_Student_OrderGuest AS A LEFT JOIN rb_class AS B ON A.ClassId=B.ClassId
LEFT JOIN rb_order AS C ON A.OrderId=C.OrderId
LEFT JOIN rb_order_guest AS D ON A.GuestId=D.Id
LEFT JOIN rb_order_guest AS D ON A.GuestId=D.Id
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.Status), (int)DateStateEnum.Normal);
......
......@@ -141,11 +141,9 @@ namespace Edu.WebApi.Controllers.APP
/// <returns></returns>
public ApiResult GetStudentPlan()
{
var query = new RB_Class_Plan_ViewModel()
{
Group_Id = base.AppUserInfo.Group_Id,
StuId = base.AppUserInfo.Id,
StartTime = base.ParmJObj.GetStringValue("StartTime"),
EndTime = base.ParmJObj.GetStringValue("EndTime"),
......
using Edu.Common.API;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Grade;
using Edu.Model.ViewModel.Sell;
using Edu.Module.Course;
using Edu.WebApi.Filter;
......@@ -27,12 +28,17 @@ namespace Edu.WebApi.Controllers.B2BApp
/// </summary>
private readonly OrderModule orderModule = new OrderModule();
/// <summary>
/// 班级处理类对象
/// </summary>
private readonly ClassModule classModule = new ClassModule();
/// <summary>
/// 同行获取学员订单分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCustomerGetStudentOrderPage()
public ApiResult CustomerGetStudentOrderPage()
{
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var customer = base.AppletCustomerInfo;
......@@ -40,12 +46,59 @@ namespace Edu.WebApi.Controllers.B2BApp
{
Group_Id=customer.GroupId,
CustomerId=customer.CustomerId,
GuestName=base.ParmJObj.GetStringValue("GuestName"),
Q_StudentId=base.ParmJObj.GetInt("Q_StudentId"),
};
var list = orderModule.GetMyOrderPageList(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.PageData = list;
List<RB_Class_Time_ViewModel> timeList = new List<RB_Class_Time_ViewModel>();
if (list != null && list.Count > 0)
{
string classIds = string.Join(",", list.Select(qitem => qitem.ClassId));
timeList= orderModule.GetClassOpenTimeListModule(classIds);
}
List<object> result = new List<object>();
foreach (var item in list)
{
var timeModel = timeList.Where(qitem => qitem.ClassId == item.ClassId)?.FirstOrDefault();
result.Add(new
{
item.CourseId,
item.CourseName,
item.ClassId,
item.ClassName,
item.ClassNo,
OpenTime= timeModel?.NewPlanDateTime??"",
item.ClassSchoolId,
item.SchoolName,
item.OrderState,
OrderStateName = item.OrderState.ToName(),
CreateTimeStr = Common.ConvertHelper.FormatTime(item.CreateTime),
item.GuestNum,
GuestList = item.GuestList.Select(qitem => new { qitem.GuestName }),
item.Income,
item.ClassStatus,
ClassStatusName = item.ClassStatus.ToName(),
RebateMoney = 0,
DepositbookMoney = 0,
});
}
pageModel.PageData = result;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 同行获取学员上课计划
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult CustomerGetStudentPlan()
{
var customer = base.AppletCustomerInfo;
int StuId = base.ParmJObj.GetInt("StuId");
var obj = classModule.AppCustomerGetClassPlan(StuId);
return ApiResult.Success(data: obj);
}
}
}
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