Commit 01d7cbcc authored by 罗超's avatar 罗超

更新匿名获取教室上课信息

parent 4dc936a3
......@@ -11,6 +11,11 @@ namespace Edu.Model.ViewModel.Grade
/// </summary>
public string TeacherName { get; set; }
/// <summary>
/// 计划类型
/// </summary>
public int PlanType { get; set; }
/// <summary>
/// 老师头像
......@@ -117,5 +122,10 @@ namespace Edu.Model.ViewModel.Grade
/// </summary>
public string VideoUrl { get; set; }
/// <summary>
/// 当前学习进度
/// </summary>
public int Progress { get; set; }
}
}
......@@ -3510,6 +3510,11 @@ namespace Edu.Module.Course
return class_TimeRepository.GetClassTimeByRoomId(RoomId, Group_Id);
}
public List<RB_Class_Time_Extend> GetClassTimeByRoomIdV2(int RoomId, int Group_Id)
{
return class_TimeRepository.GetClassTimeByRoomIdV2(RoomId, Group_Id);
}
/// <summary>
/// 获取班级上课时间
/// </summary>
......
......@@ -223,6 +223,16 @@ where a.`Status`=0 and b.ClassStatus<>2 and c.ClassStatus in(1,2) and c.`Status
return Get<RB_Class_Time_Extend>(builder.ToString()).ToList();
}
public List<RB_Class_Time_Extend> GetClassTimeByRoomIdV2(int RoomId, int Group_Id)
{
string sql = "select a.ClassPlanId,c.TeacherName,c.TeacherHead,d.RoomName,b.StartTime,b.EndTime,a.PlanType,(case a.PlanType when 1 then (select CourseName from rb_course where CourseId=e.CouseId) when 2 then (select func_course_rate(CourseGradeId) from rb_scroll_appointment where ClassPlanId=a.ClassPlanId group by ClassPlanId) END) as CourseName,(case a.PlanType when 1 then (select (Count(0)+1) from rb_class_plan where `status`=0 and ClassId=a.ClassId and TO_Days(ClassDate)<TO_Days(a.ClassDate)) when 2 then (select CourseGradeNo from rb_scroll_appointment where ClassPlanId=a.ClassPlanId group by ClassPlanId) end) as Progress from rb_class_plan a left join rb_class_time b on a.ClassPlanId=b.ClassPlanId left join rb_teacher c on a.TeacherId=c.TId left join rb_class_room d on a.ClassRoomId = d.RoomId left join rb_class e on a.ClassId=e.ClassId where TO_Days(a.ClassDate)=TO_Days(now()) and c.TId is not null and a.`status`=0 and b.EndTime>=DATE_FORMAT(now(),'%H:%i') and a.Group_Id=@gid and a.ClassRoomId=@roomId;";
DynamicParameters parameters = new DynamicParameters();
parameters.Add("gid", Group_Id);
parameters.Add("roomId", RoomId);
return Get<RB_Class_Time_Extend>(sql, parameters).ToList();
}
/// <summary>
/// 获取班级上课时间
......
......@@ -29,6 +29,7 @@ namespace Edu.WebApi.Controllers.Course
[EnableCors("AllowCors")]
public class ClassController : BaseController
{
GetClassTimeList
/// <summary>
/// 班级处理类对象
/// </summary>
......@@ -2324,6 +2325,41 @@ namespace Edu.WebApi.Controllers.Course
#region 老师上课挂件
[HttpGet]
[HttpPost]
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
public ApiResult GetClassTimeListV2()
{
var ClassRoomId = base.ParmJObj.GetInt("ClassRoomId", 0);
if (ClassRoomId == 0)
{
return ApiResult.Failed("请传入教室ID");
}
var list = classModule.GetClassTimeByRoomIdV2(ClassRoomId, 100000);
if (list == null || !list.Any())
{
return ApiResult.Failed("暂无排课安排");
}
else
{
var result = list.OrderBy(x => x.EndTime).Select(x => new
{
x.ClassPlanId,
x.TeacherName,
x.TeacherHead,
x.TeacherId,
x.RoomName,
x.StartTime,
x.EndTime,
x.PlanType,
x.CourseName,
x.Progress
});
return ApiResult.Success(data: result);
}
}
[HttpGet]
[HttpPost]
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
......
......@@ -18,7 +18,7 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
"SettlementRate": "0.60",
"SettlementRated": "0.60",
"SellCommissionFFBL": "0.15",
"JwtSecretKey": "@VIITTOREBORN*2018",
"MallJwtSecretKey": "@VIITTOREBORN*2018123",
......
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