Commit 256d2755 authored by 黄奎's avatar 黄奎

页面修改

parent 485f9f44
......@@ -61,6 +61,11 @@ namespace Edu.Model.ViewModel.Reserve
/// </summary>
public string VisitorName { get; set; }
/// <summary>
/// 学员名称
/// </summary>
public string StuName { get; set; }
/// <summary>
/// 教师名称
/// </summary>
......
......@@ -3657,7 +3657,26 @@ namespace Edu.Module.Course
//试听课列表
var reserveList = new List<RB_Reserve_Class_Extend>();
GetClassPlanCommonModule(query, out list, out reserveList, ClassType);
var reserveQuery = new RB_Reserve_Class_Extend()
{
StartClassDate = query.StartTime,
EndClassDate = query.EndTime,
TeacherId = query.TeacherId,
ClassRoomId = query.ClassRoomId
};
if (ClassType == 0)
{
list = class_PlanRepository.GetClassPlanStatisticalRepository(query);
reserveList = reserve_ClassRepository.GetReserveClassListRepository(reserveQuery);
}
else if (ClassType == 1)
{
list = class_PlanRepository.GetClassPlanStatisticalRepository(query);
}
else if (ClassType == 2)
{
reserveList = reserve_ClassRepository.GetReserveClassListRepository(reserveQuery);
}
if (list != null || reserveList != null)
{
......@@ -3775,38 +3794,50 @@ namespace Edu.Module.Course
}
/// <summary>
/// 获取上课计划列表
/// 获取指定日期的试听课
/// </summary>
/// <param name="query"></param>
/// <param name="list"></param>
/// <param name="reserveList"></param>
/// <param name="ClassType"></param>
public void GetClassPlanCommonModule(RB_Class_Plan_ViewModel query, out List<RB_Class_Plan_ViewModel> list, out List<RB_Reserve_Class_Extend> reserveList, int ClassType = 0)
/// <param name="StartTime"></param>
/// <param name="EndTime"></param>
/// <returns></returns>
public object GetDateTrialLessonModule(string StartTime,string EndTime)
{
list = new List<RB_Class_Plan_ViewModel>();
reserveList = new List<RB_Reserve_Class_Extend>();
List<object> list = new List<object>();
var reserveQuery = new RB_Reserve_Class_Extend()
{
StartClassDate = query.StartTime,
EndClassDate = query.EndTime,
TeacherId = query.TeacherId,
ClassRoomId = query.ClassRoomId
StartClassDate = StartTime,
EndClassDate = EndTime,
};
if (ClassType == 0)
var reserveList = reserve_ClassRepository.GetReserveClassListRepository(reserveQuery);
var visitorList = new List<RB_Visitor_Reserve_Extend>();
if (reserveList != null && reserveList.Count > 0)
{
list = class_PlanRepository.GetClassPlanStatisticalRepository(query);
reserveList = reserve_ClassRepository.GetReserveClassListRepository(reserveQuery);
}
else if (ClassType == 1)
{
list = class_PlanRepository.GetClassPlanStatisticalRepository(query);
string reserveClassIds = string.Join(",", reserveList.Select(qitem => qitem.ReserveClassId));
visitorList = visitor_ReserveRepository.GetVisitorReserveListRepository(new Model.ViewModel.Reserve.RB_Visitor_Reserve_Extend()
{
Q_ReserveClassIds = reserveClassIds
});
}
else if (ClassType == 2)
foreach (var item in reserveList)
{
reserveList = reserve_ClassRepository.GetReserveClassListRepository(reserveQuery);
list.Add(new
{
ClassId = item.ReserveClassId,
ClassName = "试听课",
CourseName = item.ClassContent,
item.RoomName,
item.TeacherName,
ClassDate=Common.ConvertHelper.FormatDate(item.ClassDate),
TimeStr = Common.ConvertHelper.GetTimeStr(item.ClassDate),
StartTime = item.ClassTime,
item.EndTime,
GuestList = visitorList?.Where(qitem => qitem.ReserveClassId == item.ReserveClassId)?.Select(qitem => new { GuestName = qitem.VisitorName })
});
}
return list;
}
/// <summary>
/// 获取教师课时统计
/// </summary>
......
......@@ -294,6 +294,24 @@ namespace Edu.Module.Customer
public List<RB_Student_Visit_Extend> GetStudentVisitListModule(RB_Student_Visit_Extend query)
{
var list = student_VisitRepository.GetStudentVisitListRepository(query);
if (list != null && list.Count > 0)
{
string sids = string.Join(",", list.Select(qitem => qitem.School_Id));
string empIds = string.Join(",", list.Select(qitem => qitem.ReceptionPersion));
var schoolList = schoolRepository.GetSchoolListRepository(new Model.ViewModel.User.RB_School_ViewModel()
{
QSIds = sids
});
var empList = accountRepository.GetEmployeeListRepository(new Model.ViewModel.User.Employee_ViewModel()
{
QIds = empIds
});
foreach (var item in list)
{
item.SchoolName = schoolList?.FirstOrDefault(qitem => qitem.SId == item.School_Id)?.SName ?? "";
item.ReceptionPersionName = empList?.FirstOrDefault(qitem => qitem.Id == item.ReceptionPersion)?.EmployeeName ?? "";
}
}
return list;
}
......
......@@ -98,8 +98,8 @@ WHERE 1=1
StringBuilder builder = new StringBuilder();
var parameters = new DynamicParameters();
builder.Append(@"
SELECT A.*,IFNULL(B.`Name`,'') AS VisitorName,C.ClassDate,C.ClassTime,C.EndTime,C.ClassContent,IFNULL(D.TeacherName,'') AS TeacherName,IFNULL(E.RoomName,'') AS RoomName
FROM RB_Visitor_Reserve AS A LEFT JOIN rb_visitor AS B ON A.Visitor_Id=B.Id
SELECT A.*,IFNULL(B.StuName,'') AS VisitorName,C.ClassDate,C.ClassTime,C.EndTime,C.ClassContent,IFNULL(D.TeacherName,'') AS TeacherName,IFNULL(E.RoomName,'') AS RoomName
FROM RB_Visitor_Reserve AS A LEFT JOIN rb_student AS B ON A.Visitor_Id=B.StuId
LEFT JOIN rb_reserve_class AS C ON A.ReserveClassId=C.ReserveClassId
LEFT JOIN rb_teacher AS D ON C.TeacherId=D.TId
LEFT JOIN rb_class_room AS E ON C.ClassRoomId=E.RoomId
......@@ -133,10 +133,10 @@ WHERE 1=1
Int32.TryParse(query.Q_ReserveStatus, out int result);
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.ReserveStatus), result);
}
if (!string.IsNullOrEmpty(query.VisitorName))
if (!string.IsNullOrEmpty(query.StuName))
{
builder.AppendFormat(" AND B.{0} LIKE @VisitorName ", nameof(RB_Visitor.Name));
parameters.Add("VisitorName", "%" + query.VisitorName.Trim() + "%");
builder.AppendFormat(" AND B.{0} LIKE @StuName ", nameof(RB_Visitor_Reserve_Extend.StuName));
parameters.Add("StuName", "%" + query.StuName.Trim() + "%");
}
}
return Get<RB_Visitor_Reserve_Extend>(builder.ToString(), parameters).ToList();
......
......@@ -711,12 +711,34 @@ namespace Edu.WebApi.Controllers.Duty
var Id = base.ParmJObj.GetInt("Id");
var planModel = dutyPlanModule.GetDutyPlanModule(Id);
string planDate = Common.ConvertHelper.FormatDate(planModel.Date);
var list = customerStudentModule.GetStudentVisitListModule(new Model.ViewModel.Customer.RB_Student_Visit_Extend()
var data = customerStudentModule.GetStudentVisitListModule(new Model.ViewModel.Customer.RB_Student_Visit_Extend()
{
Group_Id = planModel.Group_Id,
School_Id = planModel.School_Id,
QueryDate = planDate
});
List<object> list = new List<object>();
if (data != null && data.Count > 0)
{
foreach (var item in data)
{
list.Add(new
{
item.Id,
item.StuId,
item.StuName,
Date = Common.ConvertHelper.FormatDate(item.Date),
item.VisitTime,
item.Remark,
item.Feedback,
item.School_Id,
item.SchoolName,
item.ReceptionPersion,
item.ReceptionPersionName,
CreateTimeStr =Common.ConvertHelper.FormatTime(item.CreateTime)
});
}
}
return ApiResult.Success(data: list);
}
......@@ -729,24 +751,8 @@ namespace Edu.WebApi.Controllers.Duty
var Id = base.ParmJObj.GetInt("Id");
var planModel = dutyPlanModule.GetDutyPlanModule(Id);
string planDate = Common.ConvertHelper.FormatDate(planModel.Date);
RB_Class_Plan_ViewModel query = new RB_Class_Plan_ViewModel()
{
StartTime = planDate,
EndTime = planDate,
Group_Id = base.UserInfo.Group_Id,
School_Id = -1,
};
//课程类型(0-全部,1-正常,2-试听课)
int ClassType = 2;
var list = new List<Model.ViewModel.Reserve.RB_Reserve_Class_Extend>();
classModule.GetClassPlanCommonModule(query, out _, out list, ClassType);
if (list != null && list.Count > 0)
{
}
var data = classModule.GetDateTrialLessonModule(planDate, planDate);
return ApiResult.Success(data: data);
}
}
}
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