Commit 9d2c0fee authored by 吴春's avatar 吴春

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents acaa9d1f 8e4ebae7
......@@ -88,8 +88,6 @@ namespace Edu.Model.ViewModel.Course
get; set;
}
/// <summary>
/// 课程编号
/// </summary>
......
......@@ -207,8 +207,6 @@ namespace Edu.Module.Course
return class_TimeRepository.GetClassTimeList(query);
}
/// <summary>
/// 获取班级分页列表
/// </summary>
......@@ -268,24 +266,6 @@ namespace Edu.Module.Course
return classLogRepository.GetClassLogPageListRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 检查班级是否存在
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool ExistsClassModule(RB_Class_ViewModel model)
{
List<WhereHelper> wheres = new List<WhereHelper>()
{
new WhereHelper (nameof(RB_Class_ViewModel.ClassName),model.ClassName.Trim()),
};
if (model.ClassId > 0)
{
wheres.Add(new WhereHelper(nameof(RB_Class_ViewModel.ClassId), model.ClassId, OperatorEnum.NotEqual));
}
return classRepository.Exists(wheres);
}
/// <summary>
/// 新增修改班级
/// </summary>
......@@ -651,10 +631,6 @@ namespace Edu.Module.Course
if (model.ClassHours > 0)
{
var srartDate = model.OpenTime;
// var BasicMinutes = class_ConfigRepository.GetBasicMinutesRepository(model.Group_Id);
//按周排课和按月排课
if (model.ClassStyle == ClassStyleEnum.Week || model.ClassStyle == ClassStyleEnum.Month)
{
......@@ -988,8 +964,6 @@ namespace Edu.Module.Course
return list;
}
/// <summary>
/// 获取班级计划列表
/// </summary>
......@@ -1252,7 +1226,7 @@ namespace Edu.Module.Course
CreateTimeStr = Common.ConvertHelper.FormatTime(item.CreateTime),
item.Mobile,
item.OrderId,
ClassHours = classModel?.ClassHours ?? 0,
ClassHours = item.CompleteHours + "-" + (classModel?.ClassHours ?? 0),
IsRenew = courseModel?.IsRenew ?? 0,
CheckStatus = checkStatus,
item.IsChaBan,
......@@ -1438,42 +1412,19 @@ namespace Edu.Module.Course
}
/// <summary>
/// 初始化签到
/// 初始化缺勤数据
/// </summary>
/// <param name="Ids"></param>
/// <param name="DropOutRemark"></param>
/// <returns></returns>
public virtual bool InitClassCheckModule()
public bool InitDataModule()
{
List<RB_Class_Check_ViewModel> list = new List<RB_Class_Check_ViewModel>();
bool flag = true;
var checkList = classCheckRepository.GetClassCheckListRepository(new RB_Class_Check_ViewModel());
var planList = class_PlanRepository.GetClassPlanListExtRepository(new RB_Class_Plan_ViewModel());
if (checkList != null && checkList.Count > 0)
var list = GetClassCheckListRepository(new RB_Class_Check_ViewModel());
var tempList = list?.Where(qitem => qitem.CheckStatus > 0)?.ToList();
foreach (var item in tempList)
{
var groupList = checkList.GroupBy(qitem => new { qitem.ClassId, qitem.ClassDate, qitem.OrderGuestId })
.Select(qitem => new { qitem.Key.ClassId, qitem.Key.ClassDate, qitem.Key.OrderGuestId });
foreach (var item in groupList)
{
var tempCheckList = checkList.Where(qitem => qitem.ClassId == item.ClassId && qitem.ClassDate == item.ClassDate && qitem.OrderGuestId == item.OrderGuestId).OrderBy(qitem => qitem.ClassTimeId).ToList();
var tempPlanList = planList.Where(qitem => qitem.ClassId == item.ClassId && qitem.ClassDate == item.ClassDate).OrderBy(qitem => qitem.ClassTimeId).ToList();
for (var i = 0; i < tempCheckList.Count; i++)
{
if (tempPlanList != null && tempPlanList.Count > 0)
{
var cItem = tempCheckList[i];
cItem.ClassTimeId = tempPlanList[i].ClassTimeId;
if (flag)
{
flag = classCheckRepository.Update(cItem);
}
else
{
return false;
}
}
}
}
var guestModel = order_GuestRepository.GetEntity(item.OrderGuestId);
flag = CalcGuestHoursModule(guestModel, item);
}
return flag;
}
......@@ -1807,7 +1758,6 @@ namespace Edu.Module.Course
[TransactionCallHandler]
public bool SetClassLessPlan(Class_LessonPlan_ViewModel model)
{
bool flag = false;
if (model.LessonPlanList != null && model.LessonPlanList.Any())
{
......
......@@ -350,63 +350,14 @@ namespace Edu.WebApi.Controllers.Course
}
/// <summary>
/// 添加修改班级
/// 初始化数据
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult InitClassTime()
public ApiResult InitData()
{
bool flag = false;
var list = classModule.GetClassListModule(new RB_Class_ViewModel());
foreach (var item in list)
{
List<ClassTimeItem> dateList = new List<ClassTimeItem>();
if (!string.IsNullOrEmpty(item.DefaultTimeJson))
{
dateList = Common.Plugin.JsonHelper.DeserializeObject<List<ClassTimeItem>>(item.DefaultTimeJson);
}
foreach (var jItem in dateList)
{
if (jItem.TimeList != null && jItem.TimeList.Count > 0)
{
foreach (var sItem in jItem.TimeList)
{
var startDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + sItem.StartTime + ":00");
var endDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + sItem.EndTime + ":00");
TimeSpan span = endDate.Subtract(startDate);
if (sItem.TimeHour <= 0)
{
sItem.TimeHour = Convert.ToDecimal(span.TotalMinutes / classModule.GetBasicMinutesModule(item.Group_Id));
}
}
}
}
//flag = classModule.UpdateClassTimeModule(item.ClassId, Common.Plugin.JsonHelper.Serialize(dateList));
}
var classTimeList = classModule.GetClassTimeListModule(new RB_Class_Time_ViewModel());
int basicMintues= classModule.GetBasicMinutesModule(classTimeList[0].Group_Id);
Task.Run(() =>
{
foreach (var item in classTimeList)
{
var startDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + item.StartTime + ":00");
var endDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + item.EndTime + ":00");
TimeSpan span = endDate.Subtract(startDate);
if (item.TimeHour <= 0)
{
if (span.TotalMinutes % basicMintues == 0)
{
item.TimeHour = Convert.ToDecimal(span.TotalMinutes / basicMintues);
}
if (item.TimeHour > 0)
{
flag = classModule.UpdateClassPlanTimeModule(item.ClassTimeId, item.TimeHour);
}
}
}
});
return ApiResult.Success();
bool flag = classModule.InitDataModule();
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
......@@ -993,17 +944,6 @@ namespace Edu.WebApi.Controllers.Course
return result ? ApiResult.Success() : ApiResult.Failed("签到失败");
}
/// <summary>
/// 初始化签到数据
/// </summary>
/// <returns></returns>
public ApiResult InitClassCheck()
{
bool result = classModule.InitClassCheckModule();
return result ? ApiResult.Success("初始化成功!") : ApiResult.Failed("初始化失败!");
//return ApiResult.Failed("初始化失败!");
}
/// <summary>
/// 签到
/// </summary>
......
......@@ -24,16 +24,6 @@ namespace Edu.WebApi.Controllers.User
[EnableCors("AllowCors")]
public class UserInfoController : BaseController
{
/// <summary>
/// 集团处理类对象
/// </summary>
private readonly GroupModule groupModule = AOPHelper.CreateAOPObject<GroupModule>();
/// <summary>
/// 学校处理类对象
/// </summary>
private readonly SchoolModule schoolModule = AOPHelper.CreateAOPObject<SchoolModule>();
/// <summary>
/// 账户相关处理类对象
/// </summary>
......@@ -48,14 +38,16 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
private readonly SellCommissionModule sellCommissionModule = new SellCommissionModule();
/// <summary>
/// 教师奖励明细
/// </summary>
private readonly TeachingRewardsModule teachingRewardsModule = new TeachingRewardsModule();
/// <summary>
/// 订单处理类对象
/// </summary>
private readonly OrderModule orderModule = new OrderModule();
#region 个人资料-密码修改
/// <summary>
/// 重置用户密码信息
......
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