Commit c0ea08f1 authored by 黄奎's avatar 黄奎

页面修改

parent d5344680
......@@ -457,7 +457,7 @@ namespace Edu.Module.Course
}
}
#endregion
return flag;
}
......@@ -490,7 +490,7 @@ namespace Edu.Module.Course
if (FinishMinutes > 0)
{
//基础课时分钟数
var BasicMinutes = GetBasicMinutesModule(classModel.Group_Id);
var BasicMinutes = class_ConfigRepository.GetClassMinutesRepository(classId);
//完成课时数
var finishHours = FinishMinutes / BasicMinutes;
if (classModel.ClassHours > 0)
......@@ -512,11 +512,11 @@ namespace Edu.Module.Course
/// <summary>
/// 获取基础课时分钟数
/// </summary>
/// <param name="Group_Id"></param>
/// <param name="classId"></param>
/// <returns></returns>
public int GetBasicMinutesModule(int Group_Id)
public int GetClassMinutesModule(int classId)
{
return class_ConfigRepository.GetBasicMinutesRepository(Group_Id);
return class_ConfigRepository.GetClassMinutesRepository(classId);
}
/// <summary>
......@@ -1266,7 +1266,9 @@ namespace Edu.Module.Course
public virtual bool AddClassCheckModule(List<RB_Class_Check_ViewModel> list)
{
//基础课时分钟数
var BasicMinutes = class_ConfigRepository.GetBasicMinutesRepository(list[0].Group_Id);
var BasicMinutes =0;
//BasicMinutes = class_ConfigRepository.GetBasicMinutesRepository(list[0].Group_Id);
BasicMinutes = class_ConfigRepository.GetClassMinutesRepository(list[0].ClassId);
var totalMinutes = classCheckRepository.CalcPlanMinutesRepository(new RB_Class_Plan_ViewModel()
{
ClassId = list[0].ClassId,
......@@ -1302,8 +1304,8 @@ namespace Edu.Module.Course
item.ClassCheckId = newId;
flag = newId > 0;
}
var oldModel= classCheckRepository.GetGuestFinishMinutesRepository(item.OrderGuestId.ToString(), ClassCheckId:item.ClassCheckId)?.FirstOrDefault();
if (flag )
var oldModel = classCheckRepository.GetGuestFinishMinutesRepository(item.OrderGuestId.ToString(), ClassCheckId: item.ClassCheckId)?.FirstOrDefault();
if (flag)
{
//缺勤
if (item.CheckStatus == 1)
......@@ -1338,7 +1340,7 @@ namespace Edu.Module.Course
List<RB_Class_Check_ViewModel> list = new List<RB_Class_Check_ViewModel>();
bool flag = false;
var checkList = classCheckRepository.GetGuestFinishMinutesRepository("");
if (checkList != null && checkList.Count > 0)
{
foreach (var item in checkList)
......@@ -1433,7 +1435,7 @@ namespace Edu.Module.Course
/// <param name="GuestId"></param>
/// <returns></returns>
[TransactionCallHandler]
public virtual bool SetMakeUpStatusModule(int Id,int MakeUpStatus, int ClassCheckId, int GuestId,UserInfo userinfo)
public virtual bool SetMakeUpStatusModule(int Id, int MakeUpStatus, int ClassCheckId, int GuestId, UserInfo userinfo)
{
bool flag = true;
if (MakeUpStatus == 2)
......@@ -1455,13 +1457,13 @@ namespace Edu.Module.Course
//更新签到表状态
flag = classCheckRepository.Update(fileds, new WhereHelper(nameof(RB_Class_Check_ViewModel.ClassCheckId), ClassCheckId));
}
if (flag)
{
//更新学员状态和已补课时
var guestModel= order_GuestRepository.GetEntity(GuestId);
var guestModel = order_GuestRepository.GetEntity(GuestId);
var checkModel = classCheckRepository.GetEntity(ClassCheckId);
var makeUpHours = (guestModel?.MakeUpHours ?? 0) + (checkModel?.CurrentDeductionHours??0);
var makeUpHours = (guestModel?.MakeUpHours ?? 0) + (checkModel?.CurrentDeductionHours ?? 0);
Dictionary<string, object> guestFileds = new Dictionary<string, object>()
{
{ nameof(RB_Order_Guest_ViewModel.GuestState), 1 },
......@@ -2040,13 +2042,18 @@ namespace Edu.Module.Course
}
/// <summary>
/// 计算当前班级完成课时
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public int GetNowClassHours(RB_Class_Time_Extend model)
{
int classHours = 0;
//班级完成的总分钟数
var FinishMinutes = classCheckRepository.GetClassFinishMinutesRepository(model.ClassId.ToString())?.FirstOrDefault()?.FinishMinutes ?? 0;
//基础课时分钟数
var BasicMinutes = class_ConfigRepository.GetBasicMinutesRepository(model.Group_Id);
var BasicMinutes = class_ConfigRepository.GetClassMinutesRepository(model.ClassId);
var nowHours = model.NewEndPlanDateTime.Value.Subtract(model.NewPlanDateTime.Value).TotalSeconds;
if (FinishMinutes > 0)
{
......@@ -2526,7 +2533,7 @@ namespace Edu.Module.Course
Type = 0,// 0-班级,1-使用记录,2-异常记录
});
}
}
var tempReserveList = reserveList.Where(qitem => qitem.ClassDate == ClassDate).OrderBy(qitem => qitem.ClassTime);
......
......@@ -238,7 +238,7 @@ namespace Edu.Module.Course
var planList = class_PlanRepository.GetClassPlanListExtRepository(new RB_Class_Plan_ViewModel() { ClassId = classId, EndTime = Common.ConvertHelper.FormatDate(DateTime.Now) });
var totalMinutes = planList?.Sum(qitem => qitem.ClassMinutes) ?? 0;
//查询基础课时时长
var BasicMinutes = class_ConfigRepository.GetBasicMinutesRepository(Group_Id);
var BasicMinutes = class_ConfigRepository.GetClassMinutesRepository(classId);
var finishHours = totalMinutes / BasicMinutes;
fileds.Add("finishHours", finishHours);
var classModel = classRepository.GetEntity(classId);
......
......@@ -106,7 +106,7 @@ namespace Edu.Module.Course
}
var teacherId = teacherModel?.Id ?? 0;
//基础课时分钟数
var BasicMinutes = class_ConfigRepository.GetBasicMinutesRepository(userinfo.Group_Id);
var BasicMinutes = class_ConfigRepository.GetClassMinutesRepository(orderModel.ClassId);
var stuCheckList = class_CheckRepository.GetGuestFinishMinutesRepository(GuestId.ToString());
//总签到上课分钟数
var totalFinishMinutes = stuCheckList?.Sum(qitem => qitem.FinishMinutes) ?? 0;
......
......@@ -121,7 +121,7 @@ namespace Edu.Module.Course
//班级实体类
var classModel = classRepository.GetEntity(backModel.ClassId);
//基础课时分钟数
var BasicMinutes = class_ConfigRepository.GetBasicMinutesRepository(backModel.Group_Id);
var BasicMinutes = class_ConfigRepository.GetClassMinutesRepository(backModel.ClassId);
var stuCheckList = class_CheckRepository.GetGuestFinishMinutesRepository(backModel.GuestId.ToString());
//总签到上课分钟数
var totalFinishMinutes = stuCheckList?.Sum(qitem => qitem.FinishMinutes) ?? 0;
......
......@@ -10,6 +10,11 @@ namespace Edu.Repository.Course
/// </summary>
public class RB_Class_ConfigRepository : BaseRepository<RB_Class_Config>
{
/// <summary>
/// 班级仓储层对象
/// </summary>
private readonly RB_ClassRepository classRepository = new RB_ClassRepository();
/// <summary>
/// 获取班级基础配置实体
/// </summary>
......@@ -47,5 +52,16 @@ WHERE 1=1
var BasicMinutes = GetClassConfigRepository(new RB_Class_Config_ViewModel() { Group_Id = Group_Id })?.BasicMinutes ?? 45;
return BasicMinutes;
}
/// <summary>
/// 获取班级基础课时分钟数
/// </summary>
/// <param name="classId"></param>
/// <returns></returns>
public int GetClassMinutesRepository(int classId)
{
var BasicMinutes = classRepository.GetEntity(classId)?.ClassHourMinute ?? 45;
return BasicMinutes;
}
}
}
......@@ -806,7 +806,7 @@ namespace Edu.WebApi.Controllers.Course
data.TeacherName,
data.RoomName,
TotalHour = Convert.ToDecimal(totalMinutes / 60.0),
ClassNum = Convert.ToInt32(totalMinutes / classModule.GetBasicMinutesModule(base.UserInfo.Group_Id)),
ClassNum = Convert.ToInt32(totalMinutes / classModule.GetClassMinutesModule(classId)),
DefaultMinutes = totalMinutes,
ClassDate = data.ClassDate.ToString("yyyy-MM-dd"),
GuestList = guestList
......
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