Commit 63ab6877 authored by 吴春's avatar 吴春

提交代码

parent 5a8b0f44
......@@ -112,5 +112,10 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public int ClassStatus { get; set; }
/// <summary>
/// 课堂视频
/// </summary>
public string VideoUrl { get; set; }
}
}
......@@ -357,7 +357,7 @@ FROM RB_Class_Plan AS A LEFT JOIN rb_class_room AS B ON A.ClassRoomId=B.RoomId
LEFT JOIN rb_class as class on a.ClassId=class.ClassId
LEFT JOIN rb_teacher AS T ON A.TeacherId=T.TId
LEFT JOIN (SELECT ClassPlanId,COUNT(*) as LessonPlanNum from rb_class_lessonplan where `Status`=0 GROUP BY ClassPlanId)as lp on a.ClassPlanId=lp.ClassPlanId
WHERE 1=1
WHERE 1=1 and class.ClassStatus=2 and t.`Status`=0
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
......
......@@ -209,7 +209,7 @@ where b.`Status`=0 and DATE_FORMAT(b.ClassDate,'%y/%m/%d')=DATE_FORMAT(NOW(),'%y
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat($@"SELECT t.TeacherName,t.TeacherHead,c.ClassHours,c.ClassName,cou.CourseName,lp.LessonPlanId,A.ClassPlanId,A.ClassId,A.`Status`,A.ClassRoomId,A.Group_Id,A.School_Id,A.TeacherId,B.ClassTimeId,CONCAT( DATE_FORMAT(A.ClassDate,'%Y-%m-%d') ,' ',B.StartTime,':00') AS NewPlanDateTime,
B.EndTime,B.StartTime,B.SuiPai,B.ClassStatus,CONCAT( DATE_FORMAT(A.ClassDate,'%Y-%m-%d') ,' ',B.EndTime,':00') AS NewEndPlanDateTime
B.EndTime,B.StartTime,B.SuiPai,B.VideoUrl,B.ClassStatus,CONCAT( DATE_FORMAT(A.ClassDate,'%Y-%m-%d') ,' ',B.EndTime,':00') AS NewEndPlanDateTime
FROM rb_class_plan AS A INNER JOIN rb_class_time AS B ON A.ClassPlanId=B.ClassPlanId
LEFT JOIN rb_teacher as t on a.TeacherId=t.TId
LEFT JOIN rb_class as c on c.ClassId=a.ClassId
......
......@@ -1473,10 +1473,38 @@ namespace Edu.WebApi.Controllers.Course
string DayTime = string.Empty;
foreach (var item in plan)
{
if (plan.Where(x => x.LessonPlanNum > 0).Count() < plan.Count() && plan.Where(x => x.LessonPlanNum > 0).Count() > 0)
{
IsLessonStatus = 1;
}
else if (plan.Where(x => x.LessonPlanNum > 0).Count() == plan.Count())
{
IsLessonStatus = 2;
}
else
{
IsLessonStatus = 0;
}
foreach (var itemTime in item.PlanTimeList)
{
int IsPlanLessonStatus = 0;//0-未备课,1-部分,2-全部
if (plan.Where(x => x.LessonPlanNum > 0&&x.ClassPlanId==itemTime.ClassPlanId).Count() < plan.Where(x=> x.ClassPlanId == itemTime.ClassPlanId).Count() && plan.Where(x => x.LessonPlanNum > 0 && x.ClassPlanId == itemTime.ClassPlanId).Count() > 0)
{
IsPlanLessonStatus = 1;
}
else if (plan.Where(x => x.LessonPlanNum > 0 && x.ClassPlanId == itemTime.ClassPlanId).Count() == plan.Where(x=> x.ClassPlanId == itemTime.ClassPlanId).Count())
{
IsPlanLessonStatus = 2;
}
else
{
IsPlanLessonStatus = 0;
}
planList.Add(new
{
IsPlanLessonStatus,
item.ClassPlanId,
item.ClassId,
item.TeacherId,
......@@ -1490,18 +1518,7 @@ namespace Edu.WebApi.Controllers.Course
GuestStr = (item.GuestList != null && item.GuestList.Any()) ? string.Join(",", item.GuestList.Select(x => x.GuestName)) : ""
});
}
if (plan.Where(x => x.LessonPlanNum > 0).Count() < plan.Count() && plan.Where(x => x.LessonPlanNum > 0).Count() > 0)
{
IsLessonStatus = 1;
}
else if (plan.Where(x => x.LessonPlanNum > 0).Count() == plan.Count())
{
IsLessonStatus = 2;
}
else
{
IsLessonStatus = 0;
}
if (item.PlanTimeList != null && item.PlanTimeList.Any())
{
item.PlanTimeList.ForEach(x => x.NewPlanDateTime = item.ClassDate.ToString("yyyy-MM-dd") + " " + x.StartTime);
......@@ -1844,10 +1861,10 @@ namespace Edu.WebApi.Controllers.Course
#endregion
#region 老师上课统计
/// <summary>
/// 老师上课计划统计
/// </summary>
/// <returns></returns>
/// <summary>
/// 老师上课计划统计
/// </summary>
/// <returns></returns>
public ApiResult GetClassPlanStatistical()
{
var startDate = base.ParmJObj.GetStringValue("StartTime");
......@@ -1879,10 +1896,10 @@ namespace Edu.WebApi.Controllers.Course
EndTime = endDate,
TeacherId = base.ParmJObj.GetInt("TeacherId"),
ClassRoomId = base.ParmJObj.GetInt("ClassRoomId"),
Group_Id=base.UserInfo.Group_Id,
Group_Id = base.UserInfo.Group_Id,
};
var obj = classModule.GetClassPlanStatisticalModule(query);
return ApiResult.Success(data:obj);
return ApiResult.Success(data: obj);
}
/// <summary>
......@@ -1912,7 +1929,7 @@ namespace Edu.WebApi.Controllers.Course
ClassRoomId = base.ParmJObj.GetInt("ClassRoomId"),
Group_Id = base.UserInfo.Group_Id,
};
var obj = classModule.GetTeacherClassHoursStatisticalModule(query);
return ApiResult.Success(data: obj);
}
......
......@@ -116,7 +116,7 @@ namespace Edu.WebApi.Controllers.User
var actionList = menuModule.GetPostMenuFunctionListModule(model.Post_Id.ToString());
//上传配置
var uploadConfig = publicModule.GetFileStoreList(new Model.Public.RB_File_Store() { Group_Id = model.Group_Id, IsDefault = 1 })?.FirstOrDefault();
UserInfo obj = new UserInfo
{
Id = model.Id,
......@@ -139,7 +139,7 @@ namespace Edu.WebApi.Controllers.User
DeptName = model.DeptName,
PostId = model.Post_Id,
PostName = model.PostName,
Email=model.Email,
Email = model.Email,
ActionMenuList = actionList?.Select(qitem => new { qitem.FunctionCode, qitem.FunctionName, qitem.MenuName, qitem.MenuUrl }),
UploadConfig = new
{
......@@ -274,6 +274,7 @@ namespace Edu.WebApi.Controllers.User
IsLessPlan = classModel.LessonPlanId > 0 ? 1 : 0,
RoomPicList = string.IsNullOrWhiteSpace(extModel.RoomPic) ? new List<string>() : JsonHelper.DeserializeObject<List<string>>(extModel.RoomPic),
SuiPaiList = string.IsNullOrWhiteSpace(classModel.SuiPai) ? new List<string>() : JsonHelper.DeserializeObject<List<string>>(classModel.SuiPai),
VideoUrl = classModel.VideoUrl ?? "",
classModel.ClassId,
classModel.ClassTimeId,
classModel.ClassPlanId,
......@@ -415,6 +416,7 @@ namespace Edu.WebApi.Controllers.User
IsLessPlan = classModel.LessonPlanId > 0 ? 1 : 0,
RoomPicList = string.IsNullOrWhiteSpace(extModel.RoomPic) ? new List<string>() : JsonHelper.DeserializeObject<List<string>>(extModel.RoomPic),
SuiPaiList = string.IsNullOrWhiteSpace(classModel.SuiPai) ? new List<string>() : JsonHelper.DeserializeObject<List<string>>(classModel.SuiPai),
VideoUrl = classModel.VideoUrl ?? "",
classModel.ClassId,
classModel.ClassTimeId,
classModel.ClassPlanId,
......
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