Commit 9fd29b56 authored by 黄奎's avatar 黄奎

11111

parent de57c078
......@@ -35,5 +35,11 @@
/// app学生用户TokenKey
/// </summary>
public const string JWT_App_Student_Key = "App_Student";
/// <summary>
/// 学员约课截止日期Key
/// </summary>
public const string PlanAppointmentKey = "STUDENT_APPOINTMENT_Expiration_Date";
}
}
......@@ -33,6 +33,9 @@ namespace Edu.Model.ViewModel.EduTask
public RB_Order_Guest_ViewModel Order_Guest_ViewModel { get; set; }
}
/// <summary>
/// 请假时间信息
/// </summary>
public class LeaveInfoModel
{
......
......@@ -92,14 +92,19 @@ namespace Edu.Module.Course
message = "未找到对应的班级信息!";
return false;
}
//获取教师实体信息
var teacherModel = accountRepository.GetAccountListExtRepository(new Model.ViewModel.User.RB_Account_ViewModel()
var teacherId = 0;
if (classModel.Teacher_Id > 0)
{
AccountId = classModel.Teacher_Id,
AccountType = Common.Enum.User.AccountTypeEnum.Teacher
})?.FirstOrDefault();
var teacherId = teacherModel?.Id ?? 0;
//获取教师实体信息
var teacherModel = accountRepository.GetAccountListExtRepository(new Model.ViewModel.User.RB_Account_ViewModel()
{
AccountId = classModel.Teacher_Id,
AccountType = Common.Enum.User.AccountTypeEnum.Teacher
})?.FirstOrDefault();
teacherId = teacherModel?.Id ?? 0;
}
var saleMan = accountRepository.GetAccountListExtRepository(new Model.ViewModel.User.RB_Account_ViewModel()
{
Id = orderModel.EnterID
......
......@@ -30,10 +30,6 @@ namespace Edu.Module.Course
/// </summary>
private readonly Rb_dictvalueRepository dictvalueRepository = new Rb_dictvalueRepository();
/// <summary>
/// 学员约课截止日期Key
/// </summary>
private static string PlanAppointmentKey = "STUDENT_APPOINTMENT_Expiration_Date";
/// <summary>
/// 获取学员预约列表
......@@ -60,30 +56,33 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="Group_Id"></param>
/// <returns></returns>
public RB_Dictvalue_Extend GetPlanAppointmentConfigModule(int Group_Id)
public RB_Dictvalue_Extend GetPlanAppointmentConfigModule(RB_Dictvalue_Extend query)
{
var model = dictvalueRepository.GetList(new RB_Dictvalue_Extend()
{
RB_Group_id = Group_Id,
DictKey = PlanAppointmentKey
})?.FirstOrDefault();
var model = dictvalueRepository.GetList(query)?.FirstOrDefault();
return model;
}
public bool SetPlanAppointmentConfigModule(int Group_Id, string WeekStr)
/// <summary>
/// 新增修改学员预约配置
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetPlanAppointmentConfigModule(RB_Dictvalue_Extend model)
{
bool flag = false;
RB_Dictvalue_Extend model = new RB_Dictvalue_Extend()
{
};
if (model.ID > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Dictvalue_Extend.Code),model.Code }
};
flag = dictvalueRepository.Update(fileds, new WhereHelper(nameof(RB_Dictvalue_Extend.ID), model.ID));
}
else
{
{
var newId = dictvalueRepository.Insert(model);
model.ID = newId;
flag = newId > 0;
}
return flag;
}
......@@ -117,7 +116,7 @@ namespace Edu.Module.Course
}
var oldList = GetPlanAppointmentDetailsListModule(new RB_Plan_Appointment_Details_ViewModel()
{
PlanAppointmentId=model.Id
PlanAppointmentId = model.Id
});
if (model.DetailsList != null && model.DetailsList.Count > 0)
{
......@@ -138,6 +137,19 @@ namespace Edu.Module.Course
return flag;
}
/// <summary>
/// 学员根据编号删除预约信息
/// </summary>
/// <param name="DetailsId"></param>
/// <returns></returns>
public bool RemovePlanAppointmentModule(int DetailsId)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Plan_Appointment_Details_ViewModel.Status),1 }
};
bool flag = plan_Appointment_DetailsRepository.Update(fileds, new WhereHelper(nameof(RB_Plan_Appointment_Details_ViewModel.DetailsId), DetailsId));
return flag;
}
}
}
......@@ -96,14 +96,5 @@ namespace Edu.Module.EduTask
}
return flag;
}
public bool UpdateChangeClassPlan(int id)
{
return RB_Student_LeaveRepository.UpdateStundetLeave(id,1);
}
}
}
......@@ -112,9 +112,6 @@ namespace Edu.Repository.EduTask
}
else //更新学生的信息
{
/// <summary>
/// 请假时间信息
/// </summary>
List<LeaveInfoModel> LeaveInfoList = new List<LeaveInfoModel>();
if (!string.IsNullOrWhiteSpace(model.LeaveInfo))
{
......@@ -163,10 +160,8 @@ namespace Edu.Repository.EduTask
Q_ClassTimeIds = model.ClassTimeIds,
});
foreach (var item in timeList)
{
DateTime? dateTime = planList.Where(x => x.ClassPlanId == item.ClassPlanId).FirstOrDefault()?.ClassDate;
if (!dateTime.HasValue)
{
......
......@@ -3,6 +3,7 @@ using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.EduTask;
using Edu.Model.ViewModel.Scroll;
using Edu.Module.Course;
using Edu.Module.EduTask;
using Edu.WebApi.Filter;
......@@ -33,6 +34,12 @@ namespace Edu.WebApi.Controllers.Applet
/// 班级处理类对象
/// </summary>
private readonly ClassModule classModule = AOP.AOPHelper.CreateAOPObject<ClassModule>();
/// <summary>
/// 学员预约处理类对象
/// </summary>
private readonly PlanAppoimentModule planAppoiment = new PlanAppoimentModule();
/// <summary>
/// 新增修改学生请假
/// </summary>
......@@ -64,12 +71,10 @@ namespace Edu.WebApi.Controllers.Applet
model.LeaveInfo = JsonHelper.Serialize(LeaveInfoList);
model.ClassTimeIds = string.Join(",", LeaveInfoList.Select(x => x.ClassTimeId));
}
List<string> receiptFileList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(base.ParmJObj.GetStringValue("ReceiptFileList"));
if (receiptFileList == null || !receiptFileList.Any())
{
receiptFile = "";
// return ApiResult.Failed("附件必须上传");
}
else
{
......@@ -80,8 +85,6 @@ namespace Edu.WebApi.Controllers.Applet
{
Common.Plugin.LogHelper.Write(ex, "SetStudentLeave");
}
if (model.Id == 0)
{
model.CreateBy = base.AppletUserInfo.Id;
......@@ -95,15 +98,65 @@ namespace Edu.WebApi.Controllers.Applet
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取课预约时间范围
/// </summary>
/// <returns></returns>
public ApiResult GetPlanTime()
{
return ApiResult.Failed();
}
/// <summary>
/// 新增修改学员预约信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetPlanAppointment()
{
var model = new RB_Plan_Appointment_ViewModel()
{
Id = base.ParmJObj.GetInt("Id"),
Date = base.ParmJObj.GetDateTime("Date"),
StartTime = base.ParmJObj.GetStringValue("StartTime"),
EndTime = base.ParmJObj.GetStringValue("EndTime"),
Group_Id = base.AppletUserInfo.Group_Id,
CreateTime = DateTime.Now
};
model.DetailsList = new List<RB_Plan_Appointment_Details_ViewModel>();
model.DetailsList.Add(new RB_Plan_Appointment_Details_ViewModel()
{
DetailsId = base.ParmJObj.GetInt("DetailsId"),
PlanAppointmentId = 0,
StuId = base.AppletUserInfo.AccountId,
Account_Id = base.AppletUserInfo.Id,
Status = 0,
CreateTime = DateTime.Now
});
bool flag = planAppoiment.SetPlanAppointmentModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
public ApiResult TestUpdateClassPlan()
/// <summary>
/// 学员删除预约信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemovePlanAppointment()
{
int DetailsId = base.ParmJObj.GetInt("DetailsId");
bool flag = planAppoiment.RemovePlanAppointmentModule(DetailsId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
int id = base.ParmJObj.GetInt("Id");
var result = leaveStudentModule.UpdateChangeClassPlan(id);
return ApiResult.Success("");
/// <summary>
/// 获取学员预约信息列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetPlanAppointment()
{
return ApiResult.Failed();
}
}
}
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