Commit d9ccbba1 authored by 吴春's avatar 吴春

页面修改

parent c984b64b
...@@ -7,3 +7,4 @@ Edu.WebApi/Properties ...@@ -7,3 +7,4 @@ Edu.WebApi/Properties
Edu.WebApi/SearchIndex Edu.WebApi/SearchIndex
/Properties /Properties
*.user *.user
Edu.WebApi/RateLimitConfig.json
...@@ -5,7 +5,7 @@ using Edu.Model.Entity.Grade; ...@@ -5,7 +5,7 @@ using Edu.Model.Entity.Grade;
namespace Edu.Model.ViewModel.Grade namespace Edu.Model.ViewModel.Grade
{ {
public class RB_Class_FeedBack_ViewModel: RB_Class_FeedBack public class RB_Class_FeedBack_ViewModel : RB_Class_FeedBack
{ {
/// <summary> /// <summary>
/// ids /// ids
...@@ -21,5 +21,21 @@ namespace Edu.Model.ViewModel.Grade ...@@ -21,5 +21,21 @@ namespace Edu.Model.ViewModel.Grade
/// 老师名称 /// 老师名称
/// </summary> /// </summary>
public string TeacherName { get; set; } public string TeacherName { get; set; }
/// <summary>
/// 老师头像
/// </summary>
public string TeacherIcon { get; set; }
/// <summary>
/// 头像列表
/// </summary>
public List<string> PhotoList { get; set; }
/// <summary>
/// 学生id
/// </summary>
public int StuId { get; set; }
} }
} }
...@@ -186,6 +186,12 @@ namespace Edu.Module.Course ...@@ -186,6 +186,12 @@ namespace Edu.Module.Course
/// </summary> /// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository(); private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 账户仓储层
/// </summary>
private readonly RB_Class_FeedBackRepository class_FeedBackRepository = new RB_Class_FeedBackRepository();
/// <summary> /// <summary>
/// 获取班级列表 /// 获取班级列表
/// </summary> /// </summary>
...@@ -1485,7 +1491,7 @@ namespace Edu.Module.Course ...@@ -1485,7 +1491,7 @@ namespace Edu.Module.Course
} }
list.Add(new list.Add(new
{ {
IsEndDate = item.ClassDate <= today&&item.ClassDate>=today.AddDays(-7), IsEndDate = item.ClassDate <= today && item.ClassDate >= today.AddDays(-7),
item.ClassPlanId, item.ClassPlanId,
item.ClassId, item.ClassId,
item.ClassDate, item.ClassDate,
...@@ -4015,6 +4021,7 @@ namespace Edu.Module.Course ...@@ -4015,6 +4021,7 @@ namespace Edu.Module.Course
var timeList = new List<RB_Class_Time_ViewModel>(); var timeList = new List<RB_Class_Time_ViewModel>();
var guestList = new List<RB_Order_Guest_ViewModel>(); var guestList = new List<RB_Order_Guest_ViewModel>();
var tempGuestList = new List<RB_Order_Guest_ViewModel>();//2021-07-19 Add By:W临时上课邀请 var tempGuestList = new List<RB_Order_Guest_ViewModel>();//2021-07-19 Add By:W临时上课邀请
var feedBackList = new List<RB_Class_FeedBack_ViewModel>();//上课反馈
if (list != null && list.Count > 0) if (list != null && list.Count > 0)
{ {
string classIds = string.Join(",", list.Select(qitem => qitem.ClassId)); string classIds = string.Join(",", list.Select(qitem => qitem.ClassId));
...@@ -4022,6 +4029,7 @@ namespace Edu.Module.Course ...@@ -4022,6 +4029,7 @@ namespace Edu.Module.Course
timeList = class_TimeRepository.GetClassTimeListRepository(new RB_Class_Time_ViewModel() { QClassIds = classIds, QClassPlanIds = planIds }); timeList = class_TimeRepository.GetClassTimeListRepository(new RB_Class_Time_ViewModel() { QClassIds = classIds, QClassPlanIds = planIds });
guestList = order_GuestRepository.GetOrderGuestListRepository(new RB_Order_Guest_ViewModel() { ClassIds = classIds }); guestList = order_GuestRepository.GetOrderGuestListRepository(new RB_Order_Guest_ViewModel() { ClassIds = classIds });
tempGuestList = order_GuestRepository.GetTempInvitationGuest(new Model.ViewModel.EduTask.RB_Temporary_Invitation_ViewModel { ClassIds = classIds }); tempGuestList = order_GuestRepository.GetTempInvitationGuest(new Model.ViewModel.EduTask.RB_Temporary_Invitation_ViewModel { ClassIds = classIds });
feedBackList = class_FeedBackRepository.GetClassFeedBackList(new RB_Class_FeedBack_ViewModel() { Q_ClassIds = classIds });
} }
var visitorList = new List<RB_Visitor_Reserve_Extend>(); var visitorList = new List<RB_Visitor_Reserve_Extend>();
if (reserveList != null && reserveList.Count > 0) if (reserveList != null && reserveList.Count > 0)
...@@ -4048,6 +4056,20 @@ namespace Edu.Module.Course ...@@ -4048,6 +4056,20 @@ namespace Edu.Module.Course
var tempTimeGuestList = new List<RB_Order_Guest_ViewModel>(); var tempTimeGuestList = new List<RB_Order_Guest_ViewModel>();
tempTimeGuestList.AddRange(guestList.Where(qitem => qitem.ClassId == subItem.ClassId && (qitem.GuestState == GuestStateEnum.Normal || qitem.GuestState == GuestStateEnum.StopClassesApplyIng || ((qitem.GuestState == GuestStateEnum.StopClasses || qitem.GuestState == GuestStateEnum.Graduate) && qitem.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(qitem.ChangeEffectTime)) >= subItem.ClassDate)))); tempTimeGuestList.AddRange(guestList.Where(qitem => qitem.ClassId == subItem.ClassId && (qitem.GuestState == GuestStateEnum.Normal || qitem.GuestState == GuestStateEnum.StopClassesApplyIng || ((qitem.GuestState == GuestStateEnum.StopClasses || qitem.GuestState == GuestStateEnum.Graduate) && qitem.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(qitem.ChangeEffectTime)) >= subItem.ClassDate))));
tempTimeGuestList.AddRange(tempGuestList.Where(qitem => qitem.ClassId == subItem.ClassId && item.ClassTimeId == qitem.ClassTimeId && (qitem.GuestState == GuestStateEnum.Normal || qitem.GuestState == GuestStateEnum.StopClassesApplyIng || ((qitem.GuestState == GuestStateEnum.StopClasses || qitem.GuestState == GuestStateEnum.Graduate) && qitem.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(qitem.ChangeEffectTime)) >= subItem.ClassDate)))); tempTimeGuestList.AddRange(tempGuestList.Where(qitem => qitem.ClassId == subItem.ClassId && item.ClassTimeId == qitem.ClassTimeId && (qitem.GuestState == GuestStateEnum.Normal || qitem.GuestState == GuestStateEnum.StopClassesApplyIng || ((qitem.GuestState == GuestStateEnum.StopClasses || qitem.GuestState == GuestStateEnum.Graduate) && qitem.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(qitem.ChangeEffectTime)) >= subItem.ClassDate))));
int feedBackStatus = 0;//0-未反馈,1-部分,2-已反馈
var nowFeedBackList = feedBackList.Where(x => x.ClassTimeId == item.ClassTimeId && x.ClassId == item.ClassId);
if (tempTimeGuestList != null && tempTimeGuestList.Any())
{
if (tempTimeGuestList.Count() > nowFeedBackList.Count())
{
feedBackStatus = 1;
}
else if (tempTimeGuestList.Count() == nowFeedBackList.Count())
{
feedBackStatus = 2;
}
}
subList.Add(new subList.Add(new
{ {
Id = item?.ClassTimeId ?? 0, Id = item?.ClassTimeId ?? 0,
...@@ -4063,8 +4085,8 @@ namespace Edu.Module.Course ...@@ -4063,8 +4085,8 @@ namespace Edu.Module.Course
TimeStr = Common.ConvertHelper.GetTimeStr(currentDate), TimeStr = Common.ConvertHelper.GetTimeStr(currentDate),
StartTime = item?.StartTime ?? "", StartTime = item?.StartTime ?? "",
EndTime = item?.EndTime ?? "", EndTime = item?.EndTime ?? "",
FeedBackStatus = feedBackStatus,
GuestList = tempTimeGuestList?.Select(qitem => new { qitem.GuestName }) GuestList = tempTimeGuestList?.Select(qitem => new { qitem.GuestName })
}); });
} }
...@@ -4089,6 +4111,7 @@ namespace Edu.Module.Course ...@@ -4089,6 +4111,7 @@ namespace Edu.Module.Course
StartTime = subItem.ClassTime, StartTime = subItem.ClassTime,
subItem.EndTime, subItem.EndTime,
CompleteProgress = -1, CompleteProgress = -1,
FeedBackStatus = 0,
GuestList = visitorList?.Where(qitem => qitem.ReserveClassId == subItem.ReserveClassId)?.Select(qitem => new { GuestName = qitem.VisitorName }), GuestList = visitorList?.Where(qitem => qitem.ReserveClassId == subItem.ReserveClassId)?.Select(qitem => new { GuestName = qitem.VisitorName }),
}); });
...@@ -4146,12 +4169,14 @@ namespace Edu.Module.Course ...@@ -4146,12 +4169,14 @@ namespace Edu.Module.Course
{ {
var guestList = new List<RB_Order_Guest_ViewModel>(); var guestList = new List<RB_Order_Guest_ViewModel>();
var tempGuestList = new List<RB_Order_Guest_ViewModel>();//2021-07-19 Add By:W临时上课邀请 var tempGuestList = new List<RB_Order_Guest_ViewModel>();//2021-07-19 Add By:W临时上课邀请
var feedBackList = new List<RB_Class_FeedBack_ViewModel>();//上课反馈
var visitorList = new List<RB_Visitor_Reserve_Extend>(); var visitorList = new List<RB_Visitor_Reserve_Extend>();
if (list.Any(x => x.ClassType == 1)) if (list.Any(x => x.ClassType == 1))
{ {
string classIds = string.Join(",", list.Where(x => x.ClassType == 1).Select(qitem => qitem.ClassId)); string classIds = string.Join(",", list.Where(x => x.ClassType == 1).Select(qitem => qitem.ClassId));
guestList = order_GuestRepository.GetOrderGuestListRepository(new RB_Order_Guest_ViewModel() { ClassIds = classIds }); guestList = order_GuestRepository.GetOrderGuestListRepository(new RB_Order_Guest_ViewModel() { ClassIds = classIds });
tempGuestList = order_GuestRepository.GetTempInvitationGuest(new Model.ViewModel.EduTask.RB_Temporary_Invitation_ViewModel { ClassIds = classIds }); tempGuestList = order_GuestRepository.GetTempInvitationGuest(new Model.ViewModel.EduTask.RB_Temporary_Invitation_ViewModel { ClassIds = classIds });
feedBackList = class_FeedBackRepository.GetClassFeedBackList(new RB_Class_FeedBack_ViewModel() { Q_ClassIds = classIds });
} }
if (list.Any(x => x.ClassType == 2)) if (list.Any(x => x.ClassType == 2))
{ {
...@@ -4165,10 +4190,25 @@ namespace Edu.Module.Course ...@@ -4165,10 +4190,25 @@ namespace Edu.Module.Course
{ {
var currentDate = Common.ConvertHelper.FormatDate(item.ClassDate) + " " + (item.StartTime ?? ""); var currentDate = Common.ConvertHelper.FormatDate(item.ClassDate) + " " + (item.StartTime ?? "");
var tempTimeGuestList = new List<RB_Order_Guest_ViewModel>(); var tempTimeGuestList = new List<RB_Order_Guest_ViewModel>();
int feedBackStatus = 0;//0-未反馈,1-部分,2-已反馈
if (item.ClassType == 1) if (item.ClassType == 1)
{ {
tempTimeGuestList.AddRange(guestList.Where(qitem => qitem.ClassId == item.ClassId && (qitem.GuestState == GuestStateEnum.Normal || qitem.GuestState == GuestStateEnum.StopClassesApplyIng || ((qitem.GuestState == GuestStateEnum.StopClasses || qitem.GuestState == GuestStateEnum.Graduate) && qitem.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(qitem.ChangeEffectTime)) >= item.ClassDate)))); tempTimeGuestList.AddRange(guestList.Where(qitem => qitem.ClassId == item.ClassId && (qitem.GuestState == GuestStateEnum.Normal || qitem.GuestState == GuestStateEnum.StopClassesApplyIng || ((qitem.GuestState == GuestStateEnum.StopClasses || qitem.GuestState == GuestStateEnum.Graduate) && qitem.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(qitem.ChangeEffectTime)) >= item.ClassDate))));
tempTimeGuestList.AddRange(tempGuestList.Where(qitem => qitem.ClassId == item.ClassId && item.ClassTimeId == qitem.ClassTimeId && (qitem.GuestState == GuestStateEnum.Normal || qitem.GuestState == GuestStateEnum.StopClassesApplyIng || ((qitem.GuestState == GuestStateEnum.StopClasses || qitem.GuestState == GuestStateEnum.Graduate) && qitem.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(qitem.ChangeEffectTime)) >= item.ClassDate)))); tempTimeGuestList.AddRange(tempGuestList.Where(qitem => qitem.ClassId == item.ClassId && item.ClassTimeId == qitem.ClassTimeId && (qitem.GuestState == GuestStateEnum.Normal || qitem.GuestState == GuestStateEnum.StopClassesApplyIng || ((qitem.GuestState == GuestStateEnum.StopClasses || qitem.GuestState == GuestStateEnum.Graduate) && qitem.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(qitem.ChangeEffectTime)) >= item.ClassDate))));
var nowFeedBackList = feedBackList.Where(x => x.ClassTimeId == item.ClassTimeId && x.ClassId == item.ClassId);
if (tempTimeGuestList != null && tempTimeGuestList.Any())
{
if (tempTimeGuestList.Count() > nowFeedBackList.Count())
{
feedBackStatus = 1;
}
else if (tempTimeGuestList.Count() == nowFeedBackList.Count())
{
feedBackStatus = 2;
}
}
} }
result.Add(new result.Add(new
{ {
...@@ -4185,6 +4225,7 @@ namespace Edu.Module.Course ...@@ -4185,6 +4225,7 @@ namespace Edu.Module.Course
TimeStr = Common.ConvertHelper.GetTimeStr(currentDate), TimeStr = Common.ConvertHelper.GetTimeStr(currentDate),
StartTime = item?.StartTime ?? "", StartTime = item?.StartTime ?? "",
EndTime = item?.EndTime ?? "", EndTime = item?.EndTime ?? "",
FeedBackStatus = feedBackStatus,
GuestList = item.ClassType == 1 ? tempTimeGuestList?.Select(qitem => new { qitem.GuestName }) : visitorList?.Where(qitem => qitem.ReserveClassId == item.ClassTimeId)?.Select(qitem => new { GuestName = qitem.VisitorName }), GuestList = item.ClassType == 1 ? tempTimeGuestList?.Select(qitem => new { qitem.GuestName }) : visitorList?.Where(qitem => qitem.ReserveClassId == item.ClassTimeId)?.Select(qitem => new { GuestName = qitem.VisitorName }),
}); });
} }
...@@ -4647,6 +4688,64 @@ namespace Edu.Module.Course ...@@ -4647,6 +4688,64 @@ namespace Edu.Module.Course
return planList; return planList;
} }
#endregion #endregion
#region 上课反馈记录
/// <summary>
/// 反馈意见
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public bool SetFeedBack(List<RB_Class_FeedBack_ViewModel> list)
{
bool flag = false;
foreach (var item in list)
{
if (item.FeedBackId == 0)
{
flag = class_FeedBackRepository.Insert(item) > 0;
}
else
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Class_FeedBack_ViewModel.Score),item.Score },
{nameof(RB_Class_FeedBack_ViewModel.Comment),item.Comment },
{nameof(RB_Class_FeedBack_ViewModel.Photo),item.Photo }
};
flag = class_FeedBackRepository.Update(fileds, new WhereHelper(nameof(RB_Class_FeedBack_ViewModel.FeedBackId), item.FeedBackId));
}
}
return flag;
}
/// <summary>
/// 获取班级反馈列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_FeedBack_ViewModel> GetClassFeedBackList(RB_Class_FeedBack_ViewModel query)
{
return class_FeedBackRepository.GetClassFeedBackList(query);
}
/// <summary>
/// 获取班级反馈分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_FeedBack_ViewModel> GetClassFeedBackPageListRepository(int pageIndex, int pageSize, out long rowsCount, RB_Class_FeedBack_ViewModel query)
{
return class_FeedBackRepository.GetClassFeedBackPageListRepository(pageIndex, pageSize, out rowsCount, query);
}
#endregion
} }
} }
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
using Edu.Model.Entity.Grade; using Edu.Model.Entity.Grade;
using Edu.Model.ViewModel.Grade;
namespace Edu.Repository.Grade namespace Edu.Repository.Grade
{ {
public class RB_Class_FeedBackRepository:BaseRepository<RB_Class_FeedBack> /// <summary>
/// 上课反馈记录表
/// </summary>
public class RB_Class_FeedBackRepository : BaseRepository<RB_Class_FeedBack>
{ {
/// <summary>
/// 获取班级反馈列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_FeedBack_ViewModel> GetClassFeedBackList(RB_Class_FeedBack_ViewModel query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT A.*,b.TeacherName,b.TeacherHead as TeacherIcon FROM RB_Class_FeedBack AS A LEFT JOIN rb_teacher as b on a.CreateBy=b.TId WHERE 1=1 ");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_FeedBack_ViewModel.Group_Id), query.Group_Id);
}
if (query.ClassId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_FeedBack_ViewModel.ClassId), query.ClassId);
}
if (query.FeedBackId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_FeedBack_ViewModel.FeedBackId), query.FeedBackId);
}
if (query.OrderGuestId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_FeedBack_ViewModel.OrderGuestId), query.OrderGuestId);
}
if (!string.IsNullOrEmpty(query.Q_ClassIds))
{
builder.AppendFormat(" AND A.{0} in({1}) ", nameof(RB_Class_FeedBack_ViewModel.ClassId), query.Q_ClassIds);
}
if (!string.IsNullOrEmpty(query.Q_ClassTimeIds))
{
builder.AppendFormat(" AND A.{0} in({1}) ", nameof(RB_Class_FeedBack_ViewModel.ClassTimeId), query.Q_ClassTimeIds);
}
if (query.ClassTimeId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_FeedBack_ViewModel.ClassTimeId), query.ClassTimeId);
}
if (query.ClassPlanId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_FeedBack_ViewModel.ClassPlanId), query.ClassPlanId);
}
if (!string.IsNullOrWhiteSpace(query.Q_ClassTimeIds))
{
builder.AppendFormat(" AND A.{0} in ({1}) ", nameof(RB_Class_FeedBack_ViewModel.ClassTimeId), query.Q_ClassTimeIds);
}
}
return Get<RB_Class_FeedBack_ViewModel>(builder.ToString()).ToList();
}
/// <summary>
/// 获取班级反馈分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Class_FeedBack_ViewModel> GetClassFeedBackPageListRepository(int pageIndex, int pageSize, out long rowsCount, RB_Class_FeedBack_ViewModel query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT A.*,b.TeacherName,b.TeacherHead as TeacherIcon FROM RB_Class_FeedBack AS A LEFT JOIN rb_teacher as b on a.TeacherId=b.TId
LEFT JOIN rb_student_orderguest as sog on sog.GuestId=a.OrderGuestId
LEFT JOIN rb_student as s on s.StuId = sog.Student_Id where 1=1 and a.`Status`=0 and sog.`Status`=0 and s.`Status`=0");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Class_FeedBack_ViewModel.Group_Id), query.Group_Id);
}
if (query.ClassTimeId > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Class_FeedBack_ViewModel.ClassTimeId), query.ClassTimeId);
}
if (query.ClassId > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Class_FeedBack_ViewModel.ClassId), query.ClassId);
}
if (query.OrderGuestId > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Class_FeedBack_ViewModel.OrderGuestId), query.OrderGuestId);
}
if (query.StuId > 0)
{
builder.AppendFormat(" AND s.{0}={1} ", nameof(RB_Class_FeedBack_ViewModel.StuId), query.StuId);
}
}
builder.AppendFormat(" ORDER BY a.CreateTime desc ");
return GetPage<RB_Class_FeedBack_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
} }
} }
...@@ -131,7 +131,7 @@ namespace Edu.Repository.Sell ...@@ -131,7 +131,7 @@ namespace Edu.Repository.Sell
} }
string sql = $@" string sql = $@"
SELECT sog.Student_Id as StudentId,A.*,cs.ClassName,cs.ClassNo,IFNULL(B.JoinType,0) AS JoinType,IFNULL(B.TargetJoinType,0) AS TargetJoinType,IFNULL(B.StartClassHours,0) AS StartClassHours SELECT sog.Student_Id as StudentId,A.*,cs.ClassName,cs.Teacher_Id,cs.ClassNo,IFNULL(B.JoinType,0) AS JoinType,IFNULL(B.TargetJoinType,0) AS TargetJoinType,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,B.EnterID ,IFNULL(C.CourseName,'') AS CourseName,B.EffectStatus,B.EffectTime,B.UpOrderId,B.OrderType,B.CourseId,B.IsRenewOrder,B.RenewOrderId,B.EnterID
,sc.StopClassEffectTime,B.SourceOrderId,B.TargetOrderId,IFNULL(D.FirstClassHours,0)+IFNULL(D.SecondClassHours,0)+IFNULL(D.ThirdClassHours,0) AS ContractTotalHours ,sc.StopClassEffectTime,B.SourceOrderId,B.TargetOrderId,IFNULL(D.FirstClassHours,0)+IFNULL(D.SecondClassHours,0)+IFNULL(D.ThirdClassHours,0) AS ContractTotalHours
FROM RB_Order_Guest AS A LEFT JOIN rb_order AS B ON A.OrderId=B.OrderId FROM RB_Order_Guest AS A LEFT JOIN rb_order AS B ON A.OrderId=B.OrderId
......
...@@ -113,8 +113,8 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -113,8 +113,8 @@ namespace Edu.WebApi.Controllers.Applet
List<Model.ViewModel.Exam.RB_Examination_Publish_ViewModel> examinationPublishList = new List<Model.ViewModel.Exam.RB_Examination_Publish_ViewModel>(); List<Model.ViewModel.Exam.RB_Examination_Publish_ViewModel> examinationPublishList = new List<Model.ViewModel.Exam.RB_Examination_Publish_ViewModel>();
if (studentModel != null && studentModel.GuestId > 0) if (studentModel != null && studentModel.GuestId > 0)
{ {
examinationPublishList = paperModule.GetGuestExaminationPublishPage(1, 5, out long rowsCount, examinationPublishList = paperModule.GetGuestExaminationPublishPage(1, 5, out long rowsCount,
new RB_Examination_Publish_ViewModel { QAccountIds= appletUserInfo.Id.ToString(), Group_Id = studentModel.Group_Id }); new RB_Examination_Publish_ViewModel { QAccountIds = appletUserInfo.Id.ToString(), Group_Id = studentModel.Group_Id });
if (examinationPublishList == null) if (examinationPublishList == null)
{ {
examinationPublishList = new List<Model.ViewModel.Exam.RB_Examination_Publish_ViewModel>(); examinationPublishList = new List<Model.ViewModel.Exam.RB_Examination_Publish_ViewModel>();
...@@ -147,6 +147,16 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -147,6 +147,16 @@ namespace Edu.WebApi.Controllers.Applet
} }
#endregion #endregion
#region 获取最新一条上课反馈记录
long count = 0;
var feedBackList = classModule.GetClassFeedBackPageListRepository(1, 1, out count, new RB_Class_FeedBack_ViewModel { StuId = appletUserInfo.AccountId, Group_Id = appletUserInfo.Group_Id });
if (feedBackList != null && feedBackList.Any())
{
feedBackList.ForEach(x => x.PhotoList = (!string.IsNullOrWhiteSpace(x.Photo) ? JsonHelper.DeserializeObject<List<string>>(x.Photo) : new List<string>()));
}
#endregion
var result = new var result = new
{ {
studentModel.SName,//学区 studentModel.SName,//学区
...@@ -157,6 +167,7 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -157,6 +167,7 @@ namespace Edu.WebApi.Controllers.Applet
studentModel.ClassName, studentModel.ClassName,
studentModel.CourseId, studentModel.CourseId,
studentModel.GuestId, studentModel.GuestId,
FeedBackList = feedBackList,//上课反馈最新一条数据
EnterPhone = Cache.User.UserReidsCache.GetUserLoginInfo(studentModel.EnterID).UserMobile, EnterPhone = Cache.User.UserReidsCache.GetUserLoginInfo(studentModel.EnterID).UserMobile,
ContractNum = (((contractList != null && contractList.Any()) ? contractList.Count() : 0) + ((backClassList != null && backClassList.Any()) ? backClassList.Count() : 0)),//合同数 ContractNum = (((contractList != null && contractList.Any()) ? contractList.Count() : 0) + ((backClassList != null && backClassList.Any()) ? backClassList.Count() : 0)),//合同数
ClassPlan = new //我的课表最新一个数据 ClassPlan = new //我的课表最新一个数据
...@@ -533,7 +544,7 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -533,7 +544,7 @@ namespace Edu.WebApi.Controllers.Applet
} }
else if (item.ExamStartTime < System.DateTime.Now && item.ExamEndTime > System.DateTime.Now) else if (item.ExamStartTime < System.DateTime.Now && item.ExamEndTime > System.DateTime.Now)
{ {
if (item.ExamStatus != ExamTestStatusEnum.FinishTest &&item.ExamStatus!= ExamTestStatusEnum.FinishScoring ) if (item.ExamStatus != ExamTestStatusEnum.FinishTest && item.ExamStatus != ExamTestStatusEnum.FinishScoring)
{ {
item.ExamStatus = ExamTestStatusEnum.FinishStarted; item.ExamStatus = ExamTestStatusEnum.FinishStarted;
} }
...@@ -558,7 +569,7 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -558,7 +569,7 @@ namespace Edu.WebApi.Controllers.Applet
ExamEndTime = Common.ConvertHelper.FormatTime(x.ExamEndTime), ExamEndTime = Common.ConvertHelper.FormatTime(x.ExamEndTime),
x.ExamTimes, x.ExamTimes,
x.ExamStatus, x.ExamStatus,
ExamStatusStr=x.ExamStatus.ToName() ExamStatusStr = x.ExamStatus.ToName()
}); });
pageModel.Count = rowsCount; pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel); return ApiResult.Success(data: pageModel);
...@@ -693,9 +704,11 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -693,9 +704,11 @@ namespace Edu.WebApi.Controllers.Applet
item.Title, item.Title,
item.Content, item.Content,
item.Img, item.Img,
Ico = "",
item.Digest, item.Digest,
item.LinkUrl, item.LinkUrl,
CreateByName, CreateByName,
item.TypeId,
CreateTime = Common.Plugin.StringHelper.DateFormatToString(item.CreateDate) CreateTime = Common.Plugin.StringHelper.DateFormatToString(item.CreateDate)
}); });
} }
...@@ -731,11 +744,58 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -731,11 +744,58 @@ namespace Edu.WebApi.Controllers.Applet
extModel.Digest, extModel.Digest,
extModel.LinkUrl, extModel.LinkUrl,
CreateByName, CreateByName,
CreateTime = Common.Plugin.StringHelper.DateFormatToString(extModel.CreateDate) extModel.TypeId,
CreateTime = Common.Plugin.StringHelper.DateFormatToString(extModel.CreateDate),
Ico = UserReidsCache.GetUserLoginInfo(extModel.CreateBy)?.UserIcon ?? ""
}; };
} }
return ApiResult.Success(data: obj); return ApiResult.Success(data: obj);
} }
#endregion #endregion
#region 上课反馈记录
/// <summary>
/// 获取学习园地分页
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GeClassFeedBackPage()
{
var appletUserInfo = base.AppletUserInfo;
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Class_FeedBack_ViewModel()
{
Group_Id = appletUserInfo.Group_Id,
StuId = appletUserInfo.AccountId,
};
var list = classModule.GetClassFeedBackPageListRepository(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
if (list != null && list.Any())
{
list.ForEach(x => x.PhotoList = (!string.IsNullOrWhiteSpace(x.Photo) ? JsonHelper.DeserializeObject<List<string>>(x.Photo) : new List<string>()));
}
List<object> resultList = new List<object>();
foreach (var item in list)
{
resultList.Add(new
{
item.FeedBackId,
item.TeacherIcon,
item.TeacherName,
item.PhotoList,
item.Comment,
item.Score,
CreateTimeYear = item.CreateTime.ToString("yyyy"),
CreatetimeStr = item.CreateTime.ToString("MM-dd HH:mm:ss")
});
}
pageModel.Count = rowsCount;
pageModel.PageData = resultList;
return ApiResult.Success(data: pageModel);
}
#endregion
} }
} }
...@@ -16,6 +16,7 @@ using Edu.WebApi.Filter; ...@@ -16,6 +16,7 @@ using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
namespace Edu.WebApi.Controllers.Course namespace Edu.WebApi.Controllers.Course
{ {
...@@ -325,7 +326,141 @@ namespace Edu.WebApi.Controllers.Course ...@@ -325,7 +326,141 @@ namespace Edu.WebApi.Controllers.Course
#region 上课反馈 #region 上课反馈
/// <summary>
/// 获取上课详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetFeedBackDetails()
{
var ID = base.ParmJObj.GetInt("ID", 0);
var timeModel = classModule.GetClassTimeList_V2(new RB_Class_Time_ViewModel { ClassTimeId = ID, Group_Id = base.UserInfo.Group_Id }).FirstOrDefault();
if (timeModel == null || timeModel.ClassTimeId == 0)
{
return ApiResult.Failed("班级上课时间信息不存在");
}
var orderGuestList = classModule.GetOrderGuestListModule(new RB_Order_Guest_ViewModel { Group_Id = base.UserInfo.Group_Id, School_Id = 0, ClassId = timeModel.ClassId });
var tempOrderGuestList = classModule.GetTempInvitationGuest(new Model.ViewModel.EduTask.RB_Temporary_Invitation_ViewModel { ClassTimeId = ID, ClassId = timeModel.ClassId });
var allOrderGuestList = new List<RB_Order_Guest_ViewModel>();
allOrderGuestList.AddRange(orderGuestList.Where(x => x.GuestState == GuestStateEnum.Normal || x.GuestState == GuestStateEnum.StopClassesApplyIng || ((x.GuestState == GuestStateEnum.StopClasses || x.GuestState == GuestStateEnum.Graduate) && x.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(x.ChangeEffectTime)) >= Convert.ToDateTime(Common.ConvertHelper.FormatDate(timeModel.NewPlanDateTime)))));
var feedBackList = classModule.GetClassFeedBackList(new RB_Class_FeedBack_ViewModel { ClassTimeId = ID, Group_Id = base.UserInfo.Group_Id, ClassId = timeModel.ClassId });
if (tempOrderGuestList != null && tempOrderGuestList.Any())
{
allOrderGuestList.AddRange(tempOrderGuestList.Where(x => x.GuestState == GuestStateEnum.Normal || x.GuestState == GuestStateEnum.StopClassesApplyIng || ((x.GuestState == GuestStateEnum.StopClasses || x.GuestState == GuestStateEnum.Graduate) && x.ClassTimeId == ID && x.ClassId == timeModel.ClassId && x.ChangeEffectTime.HasValue && Convert.ToDateTime(Common.ConvertHelper.FormatDate(x.ChangeEffectTime)) >= Convert.ToDateTime(Common.ConvertHelper.FormatDate(timeModel.NewPlanDateTime)))));
}
List<object> result = new List<object>();
foreach (var item in allOrderGuestList)
{
var FeedBackModel = feedBackList.Where(y => y.OrderGuestId == item.Id).FirstOrDefault();
if (FeedBackModel != null && FeedBackModel.FeedBackId > 0)
{
if (!string.IsNullOrWhiteSpace(FeedBackModel.Photo))
{
FeedBackModel.PhotoList = JsonHelper.DeserializeObject<List<string>>(FeedBackModel.Photo);
}
else {
FeedBackModel.PhotoList = new List<string>();
}
}
var guest = new
{
timeModel.ClassPlanId,
timeModel.ClassId,
timeModel.ClassTimeId,
item.GuestName,
item.Mobile,
item.Teacher_Id,
item.School_Id,
OrderGuestId = item.Id,
Score = FeedBackModel?.Score ?? 0,
Comment = FeedBackModel?.Comment ?? "",
PhotoList = FeedBackModel?.PhotoList ?? new List<string>(),
FeedBackId = FeedBackModel?.FeedBackId ?? 0,
TeacherName = FeedBackModel?.TeacherName ?? "",
TeacherIcon = FeedBackModel?.TeacherIcon ?? "",
CreateTimeStr = (FeedBackModel != null && FeedBackModel.FeedBackId > 0) ? FeedBackModel.CreateTime.ToString("yyyy-MM-dd HH:mm") : ""
};
result.Add(guest);
}
return ApiResult.Success("", result);
}
/// <summary>
/// 老师上课反馈填写
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetFeedBack()
{
List<RB_Class_FeedBack_ViewModel> list = new List<RB_Class_FeedBack_ViewModel>();
JArray array = JArray.Parse(RequestParm.Msg.ToString());
if (array != null && array.Count > 0)
{
foreach (var jItem in array)
{
JObject obj = JObject.Parse(jItem.ToString());
var nowModel = new RB_Class_FeedBack_ViewModel()
{
OrderGuestId = obj.GetInt("OrderGuestId"),
ClassTimeId = obj.GetInt("ClassTimeId"),
ClassPlanId = obj.GetInt("ClassPlanId"),
School_Id = obj.GetInt("School_Id"),
Score = obj.GetInt("Score"),
TeacherId = obj.GetInt("TeacherId"),
ClassId = obj.GetInt("ClassId"),
Comment = obj.GetStringValue("Comment")
};
List<string> photoList = JsonHelper.DeserializeObject<List<string>>(obj.GetStringValue("PhotoList"));
if (photoList != null && photoList.Any())
{
nowModel.Photo = JsonHelper.Serialize(photoList);
}
else
{
nowModel.Photo = "";
}
list.Add(nowModel);
}
}
if (list == null || !list.Any())
{
return ApiResult.ParamIsNull(message: "请选择上课反馈学员!");
}
//判断当天是否有已签到数据
var classFeedBackList = classModule.GetClassFeedBackList(new RB_Class_FeedBack_ViewModel
{
Group_Id = base.UserInfo.Group_Id,
ClassId = list.FirstOrDefault().ClassId,
ClassTimeId = list.FirstOrDefault().ClassTimeId,
});
foreach (var item in list)
{
var signModel = classFeedBackList?.Where(qitem => qitem.ClassId == item.ClassId && qitem.OrderGuestId == item.OrderGuestId)?.FirstOrDefault();
if (signModel != null && signModel.FeedBackId > 0)
{
item.FeedBackId = signModel.FeedBackId;
item.Group_Id = signModel.Group_Id;
item.CreateTime = signModel.CreateTime;
item.CreateBy = base.UserInfo.Id;
item.Status = 0;
}
else
{
item.Group_Id = base.UserInfo.Group_Id;
item.CreateTime = System.DateTime.Now;
item.CreateBy = base.UserInfo.Id;
item.Status = 0;
}
}
bool result = classModule.SetFeedBack(list);
return result ? ApiResult.Success() : ApiResult.Failed("上课反馈失败");
}
#endregion #endregion
} }
} }
...@@ -143,7 +143,7 @@ namespace Edu.WebApi.Timers ...@@ -143,7 +143,7 @@ namespace Edu.WebApi.Timers
} }
/// <summary> /// <summary>
/// 处理值班数据 /// 定时处理考卷过期数据
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
......
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