Commit 4cd22128 authored by 黄奎's avatar 黄奎

页面修改

parent 852f5e03
...@@ -268,5 +268,10 @@ namespace Edu.Model.Entity.Course ...@@ -268,5 +268,10 @@ namespace Edu.Model.Entity.Course
/// 前置订单编号 /// 前置订单编号
/// </summary> /// </summary>
public int UpOrderId { get; set; } public int UpOrderId { get; set; }
/// <summary>
/// 预约单号
/// </summary>
public int VisitorReserveId { get; set; }
} }
} }
...@@ -76,5 +76,9 @@ namespace Edu.Model.Entity.Reserve ...@@ -76,5 +76,9 @@ namespace Edu.Model.Entity.Reserve
/// </summary> /// </summary>
public DateStateEnum Status { get; set; } public DateStateEnum Status { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public string EndTime { get; set; }
} }
} }
...@@ -192,6 +192,20 @@ namespace Edu.Model.ViewModel.Course ...@@ -192,6 +192,20 @@ namespace Edu.Model.ViewModel.Course
/// 关联其他课程列表 /// 关联其他课程列表
/// </summary> /// </summary>
public List<RB_Class_Course_Extend> OtherCourseList { get; set; } public List<RB_Class_Course_Extend> OtherCourseList { get; set; }
/// <summary>
/// 班级状态字符串
/// </summary>
public string ClassStatusStr
{
get
{
string str = "";
str = Common.Plugin.EnumHelper.ToName(this.ClassStatus);
return str;
}
}
} }
/// <summary> /// <summary>
......
...@@ -27,6 +27,11 @@ namespace Edu.Model.ViewModel.Reserve ...@@ -27,6 +27,11 @@ namespace Edu.Model.ViewModel.Reserve
/// </summary> /// </summary>
public string ClassTime { get; set; } public string ClassTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public string EndTime { get; set; }
/// <summary> /// <summary>
/// 教师编号 /// 教师编号
/// </summary> /// </summary>
...@@ -72,6 +77,11 @@ namespace Edu.Model.ViewModel.Reserve ...@@ -72,6 +77,11 @@ namespace Edu.Model.ViewModel.Reserve
/// </summary> /// </summary>
public string Q_ReserveClassIds { get; set; } public string Q_ReserveClassIds { get; set; }
/// <summary>
/// 预约状态(0-跟进中,1-成交,2-流单,3-取消)
/// </summary>
public string Q_ReserveStatus { get; set; }
/// <summary> /// <summary>
/// 报名人数 /// 报名人数
/// </summary> /// </summary>
...@@ -95,5 +105,15 @@ namespace Edu.Model.ViewModel.Reserve ...@@ -95,5 +105,15 @@ namespace Edu.Model.ViewModel.Reserve
return str; return str;
} }
} }
/// <summary>
/// 开始日期
/// </summary>
public string StartClassDate { get; set; }
/// <summary>
/// 结束日期
/// </summary>
public string EndClassDate { get; set; }
} }
} }
...@@ -4,9 +4,11 @@ using Edu.Common.Enum.Course; ...@@ -4,9 +4,11 @@ using Edu.Common.Enum.Course;
using Edu.Model.CacheModel; using Edu.Model.CacheModel;
using Edu.Model.Entity.Course; using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course; using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.Reserve;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
using Edu.Repository.Course; using Edu.Repository.Course;
using Edu.Repository.Log; using Edu.Repository.Log;
using Edu.Repository.Reserve;
using Edu.Repository.User; using Edu.Repository.User;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -114,6 +116,16 @@ namespace Edu.Module.Course ...@@ -114,6 +116,16 @@ namespace Edu.Module.Course
/// </summary> /// </summary>
private readonly RB_Class_CourseRepository class_CourseRepository = new RB_Class_CourseRepository(); private readonly RB_Class_CourseRepository class_CourseRepository = new RB_Class_CourseRepository();
/// <summary>
/// 约课仓储层对象
/// </summary>
private readonly RB_Reserve_ClassRepository reserve_ClassRepository = new RB_Reserve_ClassRepository();
/// <summary>
/// 访客预约仓储层对象
/// </summary>
private readonly RB_Visitor_ReserveRepository visitor_ReserveRepository = new RB_Visitor_ReserveRepository();
/// <summary> /// <summary>
/// 获取班级列表 /// 获取班级列表
/// </summary> /// </summary>
...@@ -713,6 +725,14 @@ namespace Edu.Module.Course ...@@ -713,6 +725,14 @@ namespace Edu.Module.Course
var extModel = classRepository.GetEntity<RB_Class_ViewModel>(ClassId); var extModel = classRepository.GetEntity<RB_Class_ViewModel>(ClassId);
if (extModel != null && extModel.ClassId > 0) if (extModel != null && extModel.ClassId > 0)
{ {
if (extModel.CouseId > 0)
{
extModel.CourseName = courseRepository.GetEntity(extModel.CouseId)?.CourseName ?? "";
}
if (extModel.Teacher_Id > 0)
{
extModel.TeacherName = teacherRepository.GetEntity(extModel.Teacher_Id)?.TeacherName ?? "";
}
//课程梯度价格 //课程梯度价格
extModel.ClassStepPriceList = class_StepPriceRepository.GetClassStepPriceListRepository(new RB_Class_StepPrice_ViewModel() { ClassId = extModel.ClassId })?.ToList() ?? new List<RB_Class_StepPrice_ViewModel>(); extModel.ClassStepPriceList = class_StepPriceRepository.GetClassStepPriceListRepository(new RB_Class_StepPrice_ViewModel() { ClassId = extModel.ClassId })?.ToList() ?? new List<RB_Class_StepPrice_ViewModel>();
//课程计划上课日期 //课程计划上课日期
...@@ -2147,12 +2167,36 @@ namespace Edu.Module.Course ...@@ -2147,12 +2167,36 @@ namespace Edu.Module.Course
TimeSpan sp = endTime.Subtract(startTime); TimeSpan sp = endTime.Subtract(startTime);
var days = sp.Days + 1; var days = sp.Days + 1;
var list = class_PlanRepository.GetClassPlanStatisticalRepository(query); var list = class_PlanRepository.GetClassPlanStatisticalRepository(query);
if (list != null) //约课列表
var reserveList = reserve_ClassRepository.GetReserveClassListRepository(new Model.ViewModel.Reserve.RB_Reserve_Class_Extend()
{ {
string classIds = string.Join(",", list.Select(qitem => qitem.ClassId)); StartClassDate = query.StartTime,
string planIds = string.Join(",", list.Select(qitem => qitem.ClassPlanId)); EndClassDate = query.EndTime,
var timeList = class_TimeRepository.GetClassTimeListRepository(new RB_Class_Time_ViewModel() { QClassIds = classIds, QClassPlanIds = planIds }); TeacherId = query.TeacherId,
var guestList = order_GuestRepository.GetOrderGuestListRepository(new RB_Order_Guest_ViewModel() { ClassIds = classIds }); ClassRoomId = query.ClassRoomId
});
if (list != null || reserveList!=null)
{
var timeList = new List<RB_Class_Time_ViewModel>();
var guestList = new List<RB_Order_Guest_ViewModel>();
if (list != null&& list.Count>0)
{
string classIds = string.Join(",", list.Select(qitem => qitem.ClassId));
string planIds = string.Join(",", list.Select(qitem => qitem.ClassPlanId));
timeList = class_TimeRepository.GetClassTimeListRepository(new RB_Class_Time_ViewModel() { QClassIds = classIds, QClassPlanIds = planIds });
guestList = order_GuestRepository.GetOrderGuestListRepository(new RB_Order_Guest_ViewModel() { ClassIds = classIds });
}
var visitorList = new List<RB_Visitor_Reserve_Extend>();
if (reserveList != null && reserveList.Count > 0)
{
string reserveClassIds = string.Join(",", reserveList.Select(qitem => qitem.ReserveClassId));
visitorList = visitor_ReserveRepository.GetVisitorReserveListRepository(new Model.ViewModel.Reserve.RB_Visitor_Reserve_Extend()
{
Q_ReserveClassIds = reserveClassIds
});
}
for (var i = 0; i < days; i++) for (var i = 0; i < days; i++)
{ {
var ClassDate = startTime.AddDays(i); var ClassDate = startTime.AddDays(i);
...@@ -2164,6 +2208,7 @@ namespace Edu.Module.Course ...@@ -2164,6 +2208,7 @@ namespace Edu.Module.Course
var currentDate = Common.ConvertHelper.FormatDate(ClassDate) + " " + (tempTimeList?.FirstOrDefault()?.StartTime ?? ""); var currentDate = Common.ConvertHelper.FormatDate(ClassDate) + " " + (tempTimeList?.FirstOrDefault()?.StartTime ?? "");
subList.Add(new subList.Add(new
{ {
ClassType = 1,
subItem.ClassId, subItem.ClassId,
subItem.ClassName, subItem.ClassName,
subItem.CourseName, subItem.CourseName,
...@@ -2176,6 +2221,26 @@ namespace Edu.Module.Course ...@@ -2176,6 +2221,26 @@ namespace Edu.Module.Course
GuestList = guestList.Where(qitem => qitem.ClassId == subItem.ClassId)?.Select(qitem => new { qitem.GuestName }) GuestList = guestList.Where(qitem => qitem.ClassId == subItem.ClassId)?.Select(qitem => new { qitem.GuestName })
}); });
} }
var tempReserveList = reserveList.Where(qitem => qitem.ClassDate == ClassDate).OrderBy(qitem => qitem.ClassTime);
foreach (var subItem in tempReserveList)
{
var currentDate = Common.ConvertHelper.FormatDate(ClassDate) + " " + (subItem?.ClassTime ?? "");
subList.Add(new
{
ClassType=2,
ClassId= subItem.ReserveClassId,
ClassName= "试听课",
CourseName= subItem.ClassContent,
subItem.RoomName,
subItem.TeacherName,
TimeStr = Common.ConvertHelper.GetTimeStr(currentDate),
StartTime = subItem.ClassTime,
EndTime =subItem.EndTime,
CompleteProgress=-1,
GuestList = visitorList?.Where(qitem => qitem.ReserveClassId == subItem.ReserveClassId)?.Select(qitem => new { GuestName=qitem.VisitorName })
});
}
var obj = new var obj = new
{ {
ClassDate = Common.ConvertHelper.FormatDate(ClassDate), ClassDate = Common.ConvertHelper.FormatDate(ClassDate),
......
This diff is collapsed.
...@@ -7,6 +7,7 @@ using System.Text; ...@@ -7,6 +7,7 @@ using System.Text;
using VT.FW.AOP.CustomerAttribute; using VT.FW.AOP.CustomerAttribute;
using VT.FW.DB; using VT.FW.DB;
using System.Linq; using System.Linq;
using Edu.Repository.Course;
namespace Edu.Module.Duty namespace Edu.Module.Duty
{ {
...@@ -25,6 +26,13 @@ namespace Edu.Module.Duty ...@@ -25,6 +26,13 @@ namespace Edu.Module.Duty
/// </summary> /// </summary>
private readonly RB_Reserve_ClassRepository reserve_ClassRepository = new RB_Reserve_ClassRepository(); private readonly RB_Reserve_ClassRepository reserve_ClassRepository = new RB_Reserve_ClassRepository();
/// <summary>
/// 上课计划仓储层对象
/// </summary>
private readonly RB_Class_PlanRepository class_PlanRepository = new RB_Class_PlanRepository();
/// <summary> /// <summary>
/// 获取访客约课分页列表 /// 获取访客约课分页列表
/// </summary> /// </summary>
...@@ -54,8 +62,9 @@ namespace Edu.Module.Duty ...@@ -54,8 +62,9 @@ namespace Edu.Module.Duty
/// <param name="model"></param> /// <param name="model"></param>
/// <returns></returns> /// <returns></returns>
[TransactionCallHandler] [TransactionCallHandler]
public virtual bool SetVisitorReserveModule(RB_Visitor_Reserve_Extend model) public virtual bool SetVisitorReserveModule(RB_Visitor_Reserve_Extend model,out string message)
{ {
message = "";
bool flag; bool flag;
var reserveClass = new RB_Reserve_Class_Extend() var reserveClass = new RB_Reserve_Class_Extend()
{ {
...@@ -71,11 +80,17 @@ namespace Edu.Module.Duty ...@@ -71,11 +80,17 @@ namespace Edu.Module.Duty
Status = DateStateEnum.Normal, Status = DateStateEnum.Normal,
TeacherId = model.TeacherId, TeacherId = model.TeacherId,
UpdateBy = model.UpdateBy, UpdateBy = model.UpdateBy,
UpdateTime = model.UpdateTime UpdateTime = model.UpdateTime,
EndTime=model.EndTime,
}; };
if (model.ReserveClassId <= 0) if (model.ReserveClassId <= 0)
{ {
SetReserveClassModule(reserveClass); var newFlag = SetReserveClassModule(reserveClass, out string newMsg);
if (!newFlag)
{
message = newMsg;
return false;
}
model.ReserveClassId = reserveClass.ReserveClassId; model.ReserveClassId = reserveClass.ReserveClassId;
} }
if (model.Id > 0) if (model.Id > 0)
...@@ -189,16 +204,32 @@ namespace Edu.Module.Duty ...@@ -189,16 +204,32 @@ namespace Edu.Module.Duty
/// </summary> /// </summary>
/// <param name="model"></param> /// <param name="model"></param>
/// <returns></returns> /// <returns></returns>
public bool SetReserveClassModule(RB_Reserve_Class_Extend model) public bool SetReserveClassModule(RB_Reserve_Class_Extend model,out string message)
{ {
bool flag; bool flag;
message = "";
var chooseDateTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(model.ClassDate) + " " + model.ClassTime);
var chooseEndTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(model.ClassDate) + " " + model.EndTime);
var isExists = CheckClassModule(model.TeacherId, model.Group_Id, model.ClassDate, chooseDateTime, chooseEndTime, out string newMsg);
if (!isExists)
{
message = newMsg;
return false;
}
if (CheckReserveClassExistsModule(model))
{
message = message = string.Format("此教师已有{0}的约课计划!请重新选择时间", Common.ConvertHelper.FormatDate(chooseDateTime));
return false;
}
if (model.ReserveClassId > 0) if (model.ReserveClassId > 0)
{ {
var oldModel = GetReserveClassModule(model.ReserveClassId);
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{nameof(RB_Reserve_Class_Extend.TeacherId),model.TeacherId }, {nameof(RB_Reserve_Class_Extend.TeacherId),model.TeacherId },
{nameof(RB_Reserve_Class_Extend.ClassDate),model.ClassDate }, {nameof(RB_Reserve_Class_Extend.ClassDate),model.ClassDate },
{nameof(RB_Reserve_Class_Extend.ClassTime),model.ClassTime }, {nameof(RB_Reserve_Class_Extend.ClassTime),model.ClassTime },
{nameof(RB_Reserve_Class_Extend.EndTime),model.EndTime },
{nameof(RB_Reserve_Class_Extend.ClassRoomId),model.ClassRoomId }, {nameof(RB_Reserve_Class_Extend.ClassRoomId),model.ClassRoomId },
{nameof(RB_Reserve_Class_Extend.ClassContent),model.ClassContent }, {nameof(RB_Reserve_Class_Extend.ClassContent),model.ClassContent },
{nameof(RB_Reserve_Class_Extend.UpdateBy),model.UpdateBy }, {nameof(RB_Reserve_Class_Extend.UpdateBy),model.UpdateBy },
...@@ -215,6 +246,62 @@ namespace Edu.Module.Duty ...@@ -215,6 +246,62 @@ namespace Edu.Module.Duty
return flag; return flag;
} }
/// <summary>
/// 检查预约课程是否存在
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool CheckReserveClassExistsModule(RB_Reserve_Class_Extend model)
{
List<WhereHelper> whereHelpers = new List<WhereHelper>();
whereHelpers.Add(new WhereHelper(nameof(RB_Reserve_Class_Extend.ClassDate), model.ClassDate));
whereHelpers.Add(new WhereHelper(nameof(RB_Reserve_Class_Extend.TeacherId), model.TeacherId));
if (model.ReserveClassId > 0)
{
whereHelpers.Add(new WhereHelper()
{
FiledName = nameof(RB_Reserve_Class_Extend.TeacherId),
FiledValue = model.TeacherId,
OperatorEnum = OperatorEnum.NotEqual
});
}
return reserve_ClassRepository.Exists(whereHelpers);
}
/// <summary>
/// 检查老师是否有上课安排
/// </summary>
/// <param name="TeacherId"></param>
/// <param name="Group_Id"></param>
/// <param name="ClassDate"></param>
/// <param name="chooseDateTime"></param>
/// <param name="message"></param>
/// <returns></returns>
public bool CheckClassModule(int TeacherId,int Group_Id,DateTime ClassDate,DateTime chooseDateTime,DateTime chooseEndTime, out string message)
{
message = "";
var planList = class_PlanRepository.GetClassPlanListExtRepository(new Model.ViewModel.Course.RB_Class_Plan_ViewModel()
{
TeacherId = TeacherId,
QClassDateStr = Common.ConvertHelper.FormatDate(ClassDate),
Group_Id = Group_Id
});
if (planList != null && planList.Count > 0)
{
foreach (var item in planList)
{
var startTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(item.ClassDate) + " " + item.StartTime);
var endTime = Convert.ToDateTime(Common.ConvertHelper.FormatDate(item.ClassDate) + " " + item.EndTime);
if (chooseDateTime<endTime&& chooseEndTime>startTime)
{
message =string.Format( "此教师已有{0}的上课计划!请重新选择时间",Common.ConvertHelper.FormatDate(chooseDateTime));
return false;
}
}
}
return true;
}
/// <summary> /// <summary>
/// 根据编号获取约课班级 /// 根据编号获取约课班级
/// </summary> /// </summary>
...@@ -230,9 +317,20 @@ namespace Edu.Module.Duty ...@@ -230,9 +317,20 @@ namespace Edu.Module.Duty
/// 根据编号删除约课班级 /// 根据编号删除约课班级
/// </summary> /// </summary>
/// <param name="ReserveClassId"></param> /// <param name="ReserveClassId"></param>
/// <param name="message"></param>
/// <returns></returns> /// <returns></returns>
public bool RemoveReserveClassModule(int ReserveClassId) public bool RemoveReserveClassModule(int ReserveClassId, out string message)
{ {
message = "";
var visitorReserve = visitor_ReserveRepository.GetVisitorReserveStaticsListRepository(new RB_Visitor_Reserve_Extend()
{
Q_ReserveClassIds = ReserveClassId.ToString()
})?.FirstOrDefault();
if ((visitorReserve?.JoinNum ?? 0) > 0)
{
message = "此试听课存在客户报名信息,不能删除!";
return false;
}
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{nameof(RB_Visitor_Reserve_Extend.Status),(int)DateStateEnum.Delete }, {nameof(RB_Visitor_Reserve_Extend.Status),(int)DateStateEnum.Delete },
......
...@@ -100,6 +100,10 @@ WHERE 1=1 ...@@ -100,6 +100,10 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.Group_Id), query.Group_Id); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.Group_Id), query.Group_Id);
} }
if (query.TeacherId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.TeacherId), query.TeacherId);
}
if (query.School_Id > 0) if (query.School_Id > 0)
{ {
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.School_Id), query.School_Id); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.School_Id), query.School_Id);
...@@ -124,6 +128,10 @@ WHERE 1=1 ...@@ -124,6 +128,10 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Class_Plan_ViewModel.ClassDate), query.EndTime); builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Class_Plan_ViewModel.ClassDate), query.EndTime);
} }
if (!string.IsNullOrEmpty(query.QClassDateStr))
{
builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Class_Plan_ViewModel.ClassDate), query.QClassDateStr);
}
} }
return Get<RB_Class_Plan_ViewModel>(builder.ToString()).ToList(); return Get<RB_Class_Plan_ViewModel>(builder.ToString()).ToList();
} }
......
using Edu.Model.Entity.Reserve; using Edu.Common.Enum;
using Edu.Model.Entity.Reserve;
using Edu.Model.ViewModel.Reserve; using Edu.Model.ViewModel.Reserve;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -31,6 +32,7 @@ FROM RB_Reserve_Class AS A LEFT JOIN rb_teacher AS D ON A.TeacherId=D.TId ...@@ -31,6 +32,7 @@ FROM RB_Reserve_Class AS A LEFT JOIN rb_teacher AS D ON A.TeacherId=D.TId
LEFT JOIN rb_class_room AS E ON A.ClassRoomId=E.RoomId LEFT JOIN rb_class_room AS E ON A.ClassRoomId=E.RoomId
WHERE 1=1 WHERE 1=1
"); ");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Reserve_Class_Extend.Status), (int)DateStateEnum.Normal);
if (query != null) if (query != null)
{ {
if (query.Group_Id > 0) if (query.Group_Id > 0)
...@@ -54,6 +56,7 @@ WHERE 1=1 ...@@ -54,6 +56,7 @@ WHERE 1=1
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Reserve_Class_Extend.ClassRoomId), query.ClassRoomId); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Reserve_Class_Extend.ClassRoomId), query.ClassRoomId);
} }
} }
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Reserve_Class_Extend.ClassDate));
return GetPage<RB_Reserve_Class_Extend>(pageIndex,pageSize,out rowsCount, builder.ToString(),parameters).ToList(); return GetPage<RB_Reserve_Class_Extend>(pageIndex,pageSize,out rowsCount, builder.ToString(),parameters).ToList();
} }
...@@ -72,6 +75,7 @@ FROM RB_Reserve_Class AS A LEFT JOIN rb_teacher AS D ON A.TeacherId=D.TId ...@@ -72,6 +75,7 @@ FROM RB_Reserve_Class AS A LEFT JOIN rb_teacher AS D ON A.TeacherId=D.TId
LEFT JOIN rb_class_room AS E ON A.ClassRoomId=E.RoomId LEFT JOIN rb_class_room AS E ON A.ClassRoomId=E.RoomId
WHERE 1=1 WHERE 1=1
"); ");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Reserve_Class_Extend.Status), (int)DateStateEnum.Normal);
if (query != null) if (query != null)
{ {
if (query.Group_Id > 0) if (query.Group_Id > 0)
......
using Edu.Model.Entity.Reserve; using Edu.Model.Entity.Duty;
using Edu.Model.Entity.Reserve;
using Edu.Model.ViewModel.Reserve; using Edu.Model.ViewModel.Reserve;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -11,7 +12,7 @@ namespace Edu.Repository.Reserve ...@@ -11,7 +12,7 @@ namespace Edu.Repository.Reserve
/// <summary> /// <summary>
/// 访客约课仓储层 /// 访客约课仓储层
/// </summary> /// </summary>
public class RB_Visitor_ReserveRepository:BaseRepository<RB_Visitor_Reserve> public class RB_Visitor_ReserveRepository : BaseRepository<RB_Visitor_Reserve>
{ {
/// <summary> /// <summary>
/// 获取访客约课分页列表 /// 获取访客约课分页列表
...@@ -33,6 +34,39 @@ FROM RB_Visitor_Reserve AS A LEFT JOIN rb_visitor AS B ON A.Visitor_Id=B.Id ...@@ -33,6 +34,39 @@ FROM RB_Visitor_Reserve AS A LEFT JOIN rb_visitor AS B ON A.Visitor_Id=B.Id
LEFT JOIN rb_class_room AS E ON C.ClassRoomId=E.RoomId LEFT JOIN rb_class_room AS E ON C.ClassRoomId=E.RoomId
WHERE 1=1 WHERE 1=1
"); ");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.StartClassDate))
{
builder.AppendFormat(" AND C.{0}>='{1}' ", nameof(RB_Visitor_Reserve_Extend.ClassDate), query.StartClassDate);
}
if (!string.IsNullOrEmpty(query.EndClassDate))
{
builder.AppendFormat(" AND C.{0}<='{1} 23:59:59' ", nameof(RB_Visitor_Reserve_Extend.ClassDate), query.EndClassDate);
}
if (query.TeacherId > 0)
{
builder.AppendFormat(" AND C.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.TeacherId), query.TeacherId);
}
if (query.ClassRoomId > 0)
{
builder.AppendFormat(" AND C.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.ClassRoomId), query.ClassRoomId);
}
if (!string.IsNullOrEmpty(query.Q_ReserveStatus))
{
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))
{
builder.AppendFormat(" AND B.{0} LIKE @VisitorName ", nameof(RB_Visitor.Name));
parameters.Add("VisitorName", "%" + query.VisitorName.Trim() + "%");
}
}
return GetPage<RB_Visitor_Reserve_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList(); return GetPage<RB_Visitor_Reserve_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
} }
...@@ -46,10 +80,45 @@ WHERE 1=1 ...@@ -46,10 +80,45 @@ WHERE 1=1
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
var parameters = new DynamicParameters(); var parameters = new DynamicParameters();
builder.Append(@" builder.Append(@"
SELECT A.* SELECT A.*,IFNULL(B.`Name`,'') AS VisitorName,C.ClassDate,C.ClassTime,C.ClassContent,IFNULL(D.TeacherName,'') AS TeacherName,IFNULL(E.RoomName,'') AS RoomName
FROM RB_Visitor_Reserve AS A FROM RB_Visitor_Reserve AS A LEFT JOIN rb_visitor AS B ON A.Visitor_Id=B.Id
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
WHERE 1=1 WHERE 1=1
"); "); if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.StartClassDate))
{
builder.AppendFormat(" AND C.{0}>='{1}' ", nameof(RB_Visitor_Reserve_Extend.ClassDate), query.StartClassDate);
}
if (!string.IsNullOrEmpty(query.EndClassDate))
{
builder.AppendFormat(" AND C.{0}<='{1} 23:59:59' ", nameof(RB_Visitor_Reserve_Extend.ClassDate), query.EndClassDate);
}
if (query.TeacherId > 0)
{
builder.AppendFormat(" AND C.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.TeacherId), query.TeacherId);
}
if (query.ClassRoomId > 0)
{
builder.AppendFormat(" AND C.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.ClassRoomId), query.ClassRoomId);
}
if (!string.IsNullOrEmpty(query.Q_ReserveStatus))
{
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))
{
builder.AppendFormat(" AND B.{0} LIKE @VisitorName ", nameof(RB_Visitor.Name));
parameters.Add("VisitorName", "%" + query.VisitorName.Trim() + "%");
}
}
return Get<RB_Visitor_Reserve_Extend>(builder.ToString(), parameters).ToList(); return Get<RB_Visitor_Reserve_Extend>(builder.ToString(), parameters).ToList();
} }
......
...@@ -72,7 +72,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -72,7 +72,7 @@ namespace Edu.WebApi.Controllers.Course
item.OrderStudentCount, item.OrderStudentCount,
OpenTime = Common.ConvertHelper.FormatDate(item.OpenTime), OpenTime = Common.ConvertHelper.FormatDate(item.OpenTime),
item.CompleteProgress, item.CompleteProgress,
ClassStatusStr = item.ClassStatus.ToName(), item.ClassStatusStr,
item.NewPlanDateTime, item.NewPlanDateTime,
item.ClassStatus, item.ClassStatus,
item.Status, item.Status,
...@@ -423,6 +423,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -423,6 +423,7 @@ namespace Edu.WebApi.Controllers.Course
CommissionType = extModel?.CommissionType ?? 1, CommissionType = extModel?.CommissionType ?? 1,
CommissionValue = extModel?.CommissionValue ?? 0, CommissionValue = extModel?.CommissionValue ?? 0,
CouseId = extModel?.CouseId ?? 0, CouseId = extModel?.CouseId ?? 0,
CourseName = extModel?.CourseName??"",
DateJson = extModel?.DateJson ?? "", DateJson = extModel?.DateJson ?? "",
DefaultTimeJson = extModel?.DefaultTimeJson ?? "", DefaultTimeJson = extModel?.DefaultTimeJson ?? "",
DefaultPlanTimeList = extModel?.DefaultTimeList ?? new List<ClassTimeItem>(), DefaultPlanTimeList = extModel?.DefaultTimeList ?? new List<ClassTimeItem>(),
...@@ -440,9 +441,12 @@ namespace Edu.WebApi.Controllers.Course ...@@ -440,9 +441,12 @@ namespace Edu.WebApi.Controllers.Course
OutRemark = extModel?.OutRemark ?? "", OutRemark = extModel?.OutRemark ?? "",
SellPrice = extModel?.SellPrice ?? 0, SellPrice = extModel?.SellPrice ?? 0,
Teacher_Id = extModel?.Teacher_Id ?? 0, Teacher_Id = extModel?.Teacher_Id ?? 0,
TeacherName= extModel?.TeacherName??"",
School_Id = extModel?.School_Id ?? 0, School_Id = extModel?.School_Id ?? 0,
ClassStepPriceList = extModel?.ClassStepPriceList ?? new List<RB_Class_StepPrice_ViewModel>(), ClassStepPriceList = extModel?.ClassStepPriceList ?? new List<RB_Class_StepPrice_ViewModel>(),
WeekDayList = extModel?.WeekDayList ?? new List<string>(), WeekDayList = extModel?.WeekDayList ?? new List<string>(),
CompleteProgress = extModel?.CompleteProgress ?? 0,
ClassStatusStr = extModel?.ClassStatusStr ?? "",
}; };
return ApiResult.Success(data: obj); return ApiResult.Success(data: obj);
} }
......
...@@ -227,6 +227,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -227,6 +227,7 @@ namespace Edu.WebApi.Controllers.Course
x.EffectStatusStr, x.EffectStatusStr,
EffectTime = Common.ConvertHelper.FormatDate(x.EffectTime), EffectTime = Common.ConvertHelper.FormatDate(x.EffectTime),
x.UpOrderId, x.UpOrderId,
x.VisitorReserveId,
SaleRemarkList = x.SaleRemarkList.Select(z => new SaleRemarkList = x.SaleRemarkList.Select(z => new
{ {
z.Id, z.Id,
...@@ -445,6 +446,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -445,6 +446,7 @@ namespace Edu.WebApi.Controllers.Course
IsChaBan=base.ParmJObj.GetInt("IsChaBan"), IsChaBan=base.ParmJObj.GetInt("IsChaBan"),
EffectTime=base.ParmJObj.GetDateTime("EffectTime"), EffectTime=base.ParmJObj.GetDateTime("EffectTime"),
UpOrderId=base.ParmJObj.GetInt("UpOrderId"), UpOrderId=base.ParmJObj.GetInt("UpOrderId"),
VisitorReserveId=base.ParmJObj.GetInt("VisitorReserveId"),
}; };
if (demodel.OrderType == OrderTypeEnum.CourseOrder && demodel.ClassId <= 0) if (demodel.OrderType == OrderTypeEnum.CourseOrder && demodel.ClassId <= 0)
...@@ -581,6 +583,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -581,6 +583,7 @@ namespace Edu.WebApi.Controllers.Course
model.StartClassHours, model.StartClassHours,
EffectTime = Common.ConvertHelper.FormatDate(model.EffectTime), EffectTime = Common.ConvertHelper.FormatDate(model.EffectTime),
model.UpOrderId, model.UpOrderId,
model.VisitorReserveId,
}, },
StepPriceList = list.Select(x => new StepPriceList = list.Select(x => new
{ {
...@@ -1217,6 +1220,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1217,6 +1220,7 @@ namespace Edu.WebApi.Controllers.Course
EffectTime=Common.ConvertHelper.FormatDate(x.EffectTime), EffectTime=Common.ConvertHelper.FormatDate(x.EffectTime),
x.UpOrderId, x.UpOrderId,
OpenTime = Common.ConvertHelper.FormatDate(x.OpenTime), OpenTime = Common.ConvertHelper.FormatDate(x.OpenTime),
x.VisitorReserveId,
SaleRemarkList = x?.SaleRemarkList.Select(z => new SaleRemarkList = x?.SaleRemarkList.Select(z => new
{ {
z.Id, z.Id,
...@@ -1366,6 +1370,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1366,6 +1370,7 @@ namespace Edu.WebApi.Controllers.Course
x.EffectStatusStr, x.EffectStatusStr,
EffectTime = Common.ConvertHelper.FormatDate(x.EffectTime), EffectTime = Common.ConvertHelper.FormatDate(x.EffectTime),
x.UpOrderId, x.UpOrderId,
x.VisitorReserveId,
SaleRemarkList = x?.SaleRemarkList.Select(z => new SaleRemarkList = x?.SaleRemarkList.Select(z => new
{ {
z.Id, z.Id,
......
...@@ -40,6 +40,12 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -40,6 +40,12 @@ namespace Edu.WebApi.Controllers.Duty
var query = new RB_Visitor_Reserve_Extend() var query = new RB_Visitor_Reserve_Extend()
{ {
Group_Id = base.UserInfo.Group_Id, Group_Id = base.UserInfo.Group_Id,
StartClassDate=base.ParmJObj.GetStringValue("StartClassDate"),
EndClassDate=base.ParmJObj.GetStringValue("EndClassDate"),
TeacherId=base.ParmJObj.GetInt("TeacherId"),
ClassRoomId=base.ParmJObj.GetInt("ClassRoomId"),
Q_ReserveStatus=base.ParmJObj.GetStringValue("Q_ReserveStatus"),
VisitorName=base.ParmJObj.GetStringValue("VisitorName"),
}; };
var list = visitorReserveModule.GetVisitorReservePageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query); var list = visitorReserveModule.GetVisitorReservePageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list) foreach (var item in list)
...@@ -92,7 +98,12 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -92,7 +98,12 @@ namespace Edu.WebApi.Controllers.Duty
TeacherId=base.ParmJObj.GetInt("TeacherId"), TeacherId=base.ParmJObj.GetInt("TeacherId"),
ClassRoomId=base.ParmJObj.GetInt("ClassRoomId"), ClassRoomId=base.ParmJObj.GetInt("ClassRoomId"),
ClassContent = base.ParmJObj.GetStringValue("ClassContent"), ClassContent = base.ParmJObj.GetStringValue("ClassContent"),
EndTime=base.ParmJObj.GetStringValue("EndTime"),
}; };
if (string.IsNullOrEmpty(model.ClassTime))
{
return ApiResult.ParamIsNull("请选择预约时间段!");
}
model.ReserveStatus = 0; model.ReserveStatus = 0;
model.Group_Id = base.UserInfo.Group_Id; model.Group_Id = base.UserInfo.Group_Id;
model.School_Id = base.UserInfo.School_Id; model.School_Id = base.UserInfo.School_Id;
...@@ -101,8 +112,8 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -101,8 +112,8 @@ namespace Edu.WebApi.Controllers.Duty
model.UpdateBy = base.UserInfo.Id; model.UpdateBy = base.UserInfo.Id;
model.UpdateTime = System.DateTime.Now; model.UpdateTime = System.DateTime.Now;
model.Status = Common.Enum.DateStateEnum.Normal; model.Status = Common.Enum.DateStateEnum.Normal;
bool retult = visitorReserveModule.SetVisitorReserveModule(model); bool retult = visitorReserveModule.SetVisitorReserveModule(model,out string message);
return retult ? ApiResult.Success() : ApiResult.Failed(); return retult ? ApiResult.Success() : ApiResult.Failed(message: message);
} }
/// <summary> /// <summary>
...@@ -211,7 +222,12 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -211,7 +222,12 @@ namespace Edu.WebApi.Controllers.Duty
ClassTime = base.ParmJObj.GetStringValue("ClassTime"), ClassTime = base.ParmJObj.GetStringValue("ClassTime"),
ClassRoomId = base.ParmJObj.GetInt("ClassRoomId"), ClassRoomId = base.ParmJObj.GetInt("ClassRoomId"),
ClassContent = base.ParmJObj.GetStringValue("ClassContent"), ClassContent = base.ParmJObj.GetStringValue("ClassContent"),
EndTime=base.ParmJObj.GetStringValue("EndTime"),
}; };
if (string.IsNullOrEmpty(model.ClassTime))
{
return ApiResult.ParamIsNull("请选择预约时间!");
}
model.Group_Id = base.UserInfo.Group_Id; model.Group_Id = base.UserInfo.Group_Id;
model.School_Id = base.UserInfo.School_Id; model.School_Id = base.UserInfo.School_Id;
model.CreateBy = base.UserInfo.Id; model.CreateBy = base.UserInfo.Id;
...@@ -219,8 +235,8 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -219,8 +235,8 @@ namespace Edu.WebApi.Controllers.Duty
model.UpdateBy = base.UserInfo.Id; model.UpdateBy = base.UserInfo.Id;
model.UpdateTime = System.DateTime.Now; model.UpdateTime = System.DateTime.Now;
model.Status = Common.Enum.DateStateEnum.Normal; model.Status = Common.Enum.DateStateEnum.Normal;
bool retult = visitorReserveModule.SetReserveClassModule(model); bool retult = visitorReserveModule.SetReserveClassModule(model,out string message);
return retult ? ApiResult.Success() : ApiResult.Failed(); return retult ? ApiResult.Success() : ApiResult.Failed(message: message);
} }
/// <summary> /// <summary>
...@@ -243,8 +259,8 @@ namespace Edu.WebApi.Controllers.Duty ...@@ -243,8 +259,8 @@ namespace Edu.WebApi.Controllers.Duty
public ApiResult RemoveReserveClass() public ApiResult RemoveReserveClass()
{ {
var ReserveClassId = base.ParmJObj.GetInt("ReserveClassId", 0); var ReserveClassId = base.ParmJObj.GetInt("ReserveClassId", 0);
var flag = visitorReserveModule.RemoveReserveClassModule(ReserveClassId); var flag = visitorReserveModule.RemoveReserveClassModule(ReserveClassId,out string message);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed(message: message);
} }
#endregion #endregion
} }
......
...@@ -60,7 +60,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.StudyAbroad", "E ...@@ -60,7 +60,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.StudyAbroad", "E
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.Web", "Edu.Module.Web\Edu.Module.Web.csproj", "{380ACD87-3D6C-474C-A0ED-A91BD8E26081}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.Web", "Edu.Module.Web\Edu.Module.Web.csproj", "{380ACD87-3D6C-474C-A0ED-A91BD8E26081}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edu.Module.Duty", "Edu.Module.Duty\Edu.Module.Duty.csproj", "{3C354B2B-8706-49A6-A12A-5A64F28E7CDC}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.Duty", "Edu.Module.Duty\Edu.Module.Duty.csproj", "{3C354B2B-8706-49A6-A12A-5A64F28E7CDC}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
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