Commit a7ebab08 authored by 吴春's avatar 吴春

提交代码

parent 863d9b63
......@@ -61,5 +61,11 @@ namespace Edu.Model.Entity.Course
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 班级上课的时间
/// </summary>
public DateTime? ClassDate { get; set; }
}
}
......@@ -104,5 +104,10 @@ namespace Edu.Model.Entity.Course
/// 教案图片
/// </summary>
public string ProjectPic { get; set; }
/// <summary>
/// 上课时间
/// </summary>
public DateTime? ClassDate { get; set; }
}
}
......@@ -61,5 +61,10 @@ namespace Edu.Model.Entity.Course
/// 0-未反馈,1-已反馈
/// </summary>
public int FanKuiStatus { get; set; }
/// <summary>
/// 0-未反馈,1-已反馈
/// </summary>
public int ParentFanKuiStatus { get; set; }
}
}
\ No newline at end of file
......@@ -32,7 +32,7 @@ namespace Edu.Model.Entity.Course
public string GuestName { get; set; }
/// <summary>
/// 状态 1正常 2退学 3-申请中,4-驳回申请,5-停课,6-停课申请中
/// 状态 1正常 2退学 3-申请中,4-驳回申请,5-停课,6-停课申请中,7-完结的订单
/// </summary>
public int GuestState { get; set; }
......@@ -195,5 +195,10 @@ namespace Edu.Model.Entity.Course
/// 学生头像
/// </summary>
public string StuIcon { get; set; }
/// <summary>
/// 变更生效时间
/// </summary>
public DateTime? ChangeEffectTime { get; set; }
}
}
......@@ -96,6 +96,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public int FanKuiStatus { get; set; }
/// <summary>
/// 0-未反馈,1-已反馈
/// </summary>
public int ParentFanKuiStatus { get; set; }
/// <summary>
/// 总评分
/// </summary>
......
This diff is collapsed.
......@@ -47,14 +47,14 @@ namespace Edu.Module.EduTask
/// <returns></returns>
public bool UpdateAuditThroughStudent()
{
var list = order_GuestRepository.GetOrderGuestListRepository(new Model.ViewModel.Course.RB_Order_Guest_ViewModel { GuestState = 6 });
var list = order_GuestRepository.GetOrderStopClassing(new Model.ViewModel.Course.RB_Order_Guest_ViewModel { GuestState = 6 });
foreach (var item in list.Where(x => x.StopClassEffectTime.HasValue && x.StopClassEffectTime < System.DateTime.Now))
{
//将学员的学习状态变成停课申请中
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Order_Guest.GuestState),5},
{nameof(RB_Order_Guest.ChangeEffectTime),item.StopClassEffectTime},
{nameof(RB_Order_Guest.UpdateTime),System.DateTime.Now},
};
order_GuestRepository.Update(fileds, new WhereHelper(nameof(RB_Order_Guest.Id), item.Id));
......
......@@ -38,7 +38,11 @@ namespace Edu.Repository.Course
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Class_LessonComment_ViewModel.ClassId), query.ClassId);
}
if (query.ClassPlanId > 0)
if (query.ClassPlanId > 0 && query.ClassDate.HasValue)
{
builder.AppendFormat(" AND ({0}={1} or DATE_FORMAT({2},'%y/%m/%d')= DATE_FORMAT('{3}','%y/%m/%d'))", nameof(RB_Class_LessonComment_ViewModel.ClassPlanId), query.ClassPlanId, nameof(RB_Class_LessonComment_ViewModel.ClassDate), query.ClassDate.Value);
}
else if (query.ClassPlanId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Class_LessonComment_ViewModel.ClassPlanId), query.ClassPlanId);
}
......@@ -46,6 +50,10 @@ namespace Edu.Repository.Course
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Class_LessonComment_ViewModel.LessonPlanId), query.LessonPlanId);
}
if (query.LessonCommentId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Class_LessonComment_ViewModel.LessonCommentId), query.LessonCommentId);
}
if (query.CreateBy > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Class_LessonComment_ViewModel.CreateBy), query.CreateBy);
......
......@@ -81,10 +81,15 @@ namespace Edu.Repository.Course
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Class_LessonPlan.ClassId), query.ClassId);
}
if (query.ClassPlanId > 0)
if (query.ClassPlanId > 0 && query.ClassDate.HasValue)
{
builder.AppendFormat(" AND ({0}={1} or DATE_FORMAT({2},'%y/%m/%d')= DATE_FORMAT('{3}','%y/%m/%d'))", nameof(RB_Class_LessonPlan.ClassPlanId), query.ClassPlanId, nameof(RB_Class_LessonPlan.ClassDate), query.ClassDate.Value);
}
else if (query.ClassPlanId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Class_LessonPlan.ClassPlanId), query.ClassPlanId);
}
if (query.IsTemplate > -1)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Class_LessonPlan.IsTemplate), query.IsTemplate);
......
......@@ -73,7 +73,7 @@ WHERE 1=1
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT B.*,CONCAT( DATE_FORMAT(A.ClassDate,'%Y-%m-%d') ,' ',B.StartTime,':00') AS NewPlanDateTime,
CONCAT( DATE_FORMAT(A.ClassDate,'%Y-%m-%d') ,' ',B.EndTime,':00') AS NewEndPlanDateTime
CONCAT( DATE_FORMAT(A.ClassDate,'%Y-%m-%d') ,' ',B.EndTime,':00') AS NewEndPlanDateTime,TIMESTAMPDIFF(MINUTE,(DATE_FORMAT(CONCAT('2021-01-01 ',B.StartTime,':00'),'%Y-%m-%d %H:%i')),(DATE_FORMAT(CONCAT('2021-01-01 ',B.EndTime,':00'), '%Y-%m-%d %H:%i'))) AS TimeMinute
FROM rb_class_time AS B INNER JOIN rb_class_plan AS A ON A.ClassPlanId=B.ClassPlanId WHERE 1=1
");
if (query != null)
......
......@@ -26,10 +26,6 @@ namespace Edu.Repository.Course
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
//if (demodel.School_Id > 0)
//{
// where += $@" and A.{nameof(RB_Order_Guest_ViewModel.School_Id)} ={demodel.School_Id}";
//}
if (demodel.Id > 0)
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.Id)} ={demodel.Id}";
......@@ -65,11 +61,9 @@ namespace Edu.Repository.Course
string sql = $@"
SELECT A.*,IFNULL(B.IsChaBan,0) AS IsChaBan,IFNULL(B.StartClassHours,0) AS StartClassHours,IFNULL(C.CourseName,'') AS CourseName
,B.EffectStatus,B.EffectTime,B.UpOrderId,B.OrderType,B.CourseId,B.IsRenewOrder,B.RenewOrderId,sc.StopClassEffectTime
,B.EffectStatus,B.EffectTime,B.UpOrderId,B.OrderType,B.CourseId,B.IsRenewOrder,B.RenewOrderId
FROM RB_Order_Guest AS A LEFT JOIN rb_order AS B ON A.OrderId=B.OrderId
LEFT JOIN rb_course AS C ON (B.CourseId=C.CourseId AND B.CourseId>0 AND B.OrderType=1)
LEFT JOIN (SELECT OrderGuestId,MAX(TakeEffectTime) as StopClassEffectTime from rb_student_stopclass where IsAuditThrough=1 GROUP BY OrderGuestId) as sc on sc.OrderGuestId=a.Id
WHERE {where}";
LEFT JOIN rb_course AS C ON (B.CourseId=C.CourseId AND B.CourseId>0 AND B.OrderType=1) WHERE {where}";
return Get<RB_Order_Guest_ViewModel>(sql).ToList();
}
......@@ -321,7 +315,7 @@ WHERE 1=1 and A.Status=0 and class.Status=0 and b.OrderState<>3
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public List<RB_Order_Guest_ViewModel> GetStopingStudentPage( RB_Order_Guest_ViewModel demodel)
public List<RB_Order_Guest_ViewModel> GetStopingStudentPage(RB_Order_Guest_ViewModel demodel)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
......@@ -383,5 +377,138 @@ WHERE 1=1 and A.Status=0 and class.Status=0 and b.OrderState<>3 ");
builder.AppendFormat($@" order by A.{nameof(RB_Order_Guest_ViewModel.Id)} desc");
return Get<RB_Order_Guest_ViewModel>(builder.ToString()).ToList();
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public List<RB_Order_Guest_ViewModel> GetNotClassStudentList(RB_Order_Guest_ViewModel demodel)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.IsChaBan,0) AS IsChaBan,IFNULL(B.StartClassHours,0) AS StartClassHours,school.SName as SchoolName,teacher.TeacherName,IFNULL(C.CourseName,'') AS CourseName,class.ClassNo,class.ClassName,b.EnterID
,plan.TotalPlanNum,planr.Ranks ,B.EffectStatus,B.EffectTime,B.UpOrderId,B.OrderType,B.CourseId,B.IsRenewOrder,B.RenewOrderId
FROM RB_Order_Guest AS A LEFT JOIN rb_order AS B ON A.OrderId=B.OrderId
LEFT JOIN rb_class as class on class.ClassId=a.ClassId
LEFT JOIN rb_course AS C ON (B.CourseId=C.CourseId AND B.CourseId>0 AND B.OrderType=1)
LEFT JOIN (SELECT ClassId,COUNT(*) TotalPlanNum from rb_class_plan where `Status`=0 GROUP BY ClassId) as plan on plan.ClassId=class.ClassId
LEFT JOIN (SELECT ClassId,COUNT(*) Ranks from rb_class_plan where `Status`=0 and DATE_FORMAT(ClassDate,'%Y-%m-%d') <=DATE_FORMAT(NOW(),'%Y-%m-%d') GROUP BY ClassId) as planr on planr.ClassId=class.ClassId
LEFT JOIN rb_teacher as teacher on teacher.TId=class.Teacher_Id
LEFT JOIN rb_school as school on school.SId=class.School_Id
WHERE 1=1 and A.Status=0 and class.Status=0 and b.OrderState<>3 and a.GuestState in(1,6) ");
if (demodel.Group_Id > 0)
{
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_ViewModel.Group_Id)} ={demodel.Group_Id}");
}
if (demodel.School_Id > 0)
{
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_ViewModel.School_Id)} ={demodel.School_Id}");
}
if (demodel.OrderId > 0)
{
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_ViewModel.OrderId)} ={demodel.OrderId}");
}
if (demodel.Teacher_Id > 0)
{
builder.AppendFormat($@" and class.Teacher_Id ={demodel.Teacher_Id}");
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_ViewModel.GuestName)} like '%{demodel.GuestName}%'");
}
if (demodel.ClassId > 0)
{
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_ViewModel.ClassId)} !={demodel.ClassId}");
}
if (demodel.CourseId > 0)
{
builder.AppendFormat($@" AND B.{nameof(RB_Order_Guest_ViewModel.CourseId)} ={demodel.CourseId}");
}
if (demodel.EnterID > 0)
{
builder.AppendFormat($@" AND B.{nameof(RB_Order_Guest_ViewModel.EnterID)} ={demodel.EnterID}");
}
if (demodel.SourceId > 0)
{
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_ViewModel.SourceId)} ={demodel.SourceId}");
}
if (!string.IsNullOrWhiteSpace(demodel.OrderGuestIds))
{
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_ViewModel.Id)} in ({demodel.OrderGuestIds})");
}
if (demodel.GuestState > 0)
{
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_ViewModel.GuestState)} ={demodel.GuestState}");
}
builder.AppendFormat($@" order by A.{nameof(RB_Order_Guest_ViewModel.Id)} desc");
return Get<RB_Order_Guest_ViewModel>(builder.ToString()).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public List<RB_Order_Guest_ViewModel> GetOrderStopClassing(RB_Order_Guest_ViewModel demodel)
{
string where = $@" 1=1 and A.Status=0 ";
if (demodel.Group_Id > 0)
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.Id > 0)
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.Id)} ={demodel.Id}";
}
if (demodel.OrderId > 0)
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.OrderId)} ={demodel.OrderId}";
}
if (demodel.ClassId > 0)
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.ClassId)} ={demodel.ClassId}";
}
if (!string.IsNullOrEmpty(demodel.OrderIds))
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.OrderId)} in({demodel.OrderIds})";
}
if (!string.IsNullOrEmpty(demodel.ClassIds))
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.ClassId)} in({demodel.ClassIds})";
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.GuestName)} like '%{demodel.GuestName}%'";
}
if (demodel.GuestState > 0)
{
where += $@" and A.{nameof(RB_Order_Guest_ViewModel.GuestState)} ={demodel.GuestState}";
}
if (demodel.QEffectStatus == 1)
{
where += $@" AND (B.IsChaBan=0 OR (B.IsChaBan=1 AND B.EffectStatus IN(1) )) ";
}
string sql = $@"
SELECT A.*,IFNULL(B.IsChaBan,0) AS IsChaBan,IFNULL(B.StartClassHours,0) AS StartClassHours,IFNULL(C.CourseName,'') AS CourseName
,B.EffectStatus,B.EffectTime,B.UpOrderId,B.OrderType,B.CourseId,B.IsRenewOrder,B.RenewOrderId,sc.StopClassEffectTime
FROM RB_Order_Guest AS A LEFT JOIN rb_order AS B ON A.OrderId=B.OrderId
LEFT JOIN rb_course AS C ON (B.CourseId=C.CourseId AND B.CourseId>0 AND B.OrderType=1)
LEFT JOIN (SELECT OrderGuestId,MAX(TakeEffectTime) as StopClassEffectTime from rb_student_stopclass where IsAuditThrough=1 GROUP BY OrderGuestId) as sc on sc.OrderGuestId=a.Id
WHERE {where}";
return Get<RB_Order_Guest_ViewModel>(sql).ToList();
}
}
}
......@@ -501,7 +501,7 @@ namespace Edu.WebApi.Controllers.Course
var orderGuestList = classModule.GetOrderGuestListModule(new RB_Order_Guest_ViewModel { Group_Id = base.UserInfo.Group_Id, School_Id = 0, ClassId = classModel.ClassId });
var checkLogList = classModule.GetClassCheckList(new RB_Class_Check_ViewModel { Group_Id = base.UserInfo.Group_Id, School_Id = -1, ClassId = classModel.ClassId, StartDate = timeModel.NewPlanDateTime, EndDate = timeModel.NewPlanDateTime });
foreach (var item in orderGuestList.Where(x => x.GuestState == 1 || x.GuestState == 6 || (x.GuestState == 5 && x.StopClassEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(x.StopClassEffectTime)) >= Convert.ToDateTime(Common.ConvertHelper.FormatDate(timeModel.NewPlanDateTime)))))
foreach (var item in orderGuestList.Where(x => x.GuestState == 1 || x.GuestState == 6 || ((x.GuestState == 5||x.GuestState==7) && x.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(x.ChangeEffectTime)) >= Convert.ToDateTime(Common.ConvertHelper.FormatDate(timeModel.NewPlanDateTime)))))
{
item.IsCheck = (checkLogList != null && checkLogList.Any()) ? checkLogList.Where(y => y.OrderGuestId == item.Id).FirstOrDefault()?.CheckStatus ?? 2 : 2;
}
......
......@@ -263,6 +263,57 @@ namespace Edu.WebApi.Controllers.Course
pageModel.PageData = result;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 获取学员列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetNotClassStudentList()
{
var model = new RB_Order_Guest_ViewModel
{
Teacher_Id = base.ParmJObj.GetInt("Teacher_Id", 0),
GuestName = base.ParmJObj.GetStringValue("GuestName"),
ClassId = base.ParmJObj.GetInt("ClassId", 0),
CourseId = base.ParmJObj.GetInt("CourseId", 0),
EnterID = base.ParmJObj.GetInt("EnterID", 0),
};
model.Group_Id = base.UserInfo.Group_Id;
var list = classModule.GetNotClassStudentList(model);
List<object> result = new List<object>();
foreach (var item in list)
{
if (item.EnterID > 0)
{
item.EnterName = UserReidsCache.GetUserLoginInfo(item.EnterID)?.AccountName ?? "";
}
result.Add(new
{
item.Id,
item.GuestName,
item.Mobile,
item.ClassId,
item.ClassName,
item.CourseId,
item.CourseName,
item.GuestState,
item.GuestStateStr,
item.School_Id,
item.Teacher_Id,
item.TotalPlanNum,
item.Ranks,
item.EnterName,
item.EnterID,
item.IsRenewOrder,
item.RenewOrderId
});
}
return ApiResult.Success(data: result);
}
#endregion
}
}
......@@ -49,6 +49,20 @@ namespace Edu.WebApi.Controllers.EduTask
OrderGuestIds = base.ParmJObj.GetStringValue("OrderGuestIds"),
Remarks = base.ParmJObj.GetStringValue("Remarks")
};
if (string.IsNullOrWhiteSpace(model.OrderGuestIds))
{
return ApiResult.Failed("请选择您要邀请的学生");
}
if (model.ClassId == 0)
{
return ApiResult.Failed("请选择您要邀请上课的班级");
}
if (model.ClassPlanId == 0 || model.ClassTimeId == 0)
{
return ApiResult.Failed("请选择您要邀请的时间");
}
var classModel = classModule.GetClassModule(model.ClassId);
model.CourseId = classModel.CouseId;
model.TeacherId = classModel.Teacher_Id;
......
......@@ -61,7 +61,7 @@ namespace Edu.WebApi.Timers
timer4 = new System.Timers.Timer()
{
Interval = (1000 * 60) * (1 * 60 ) //1小时执行一次
Interval = (1000 * 60) * (1 * 10 ) //1小时执行一次
};
timer4.Elapsed += new System.Timers.ElapsedEventHandler(UpdateAuditThroughStudent);
timer4.Enabled = true;
......
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