Commit 1a144e1f authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq-ld

parents afdf5dd7 c2ef2ebb
......@@ -1016,7 +1016,7 @@ namespace Mall.Module.Education
TimeSpan dspWorkingDayAM = DateTime.Parse(StartTime).TimeOfDay;
TimeSpan dspWorkingDayPM = DateTime.Parse(EndTime).TimeOfDay;
TimeSpan dspNow = timeStr.TimeOfDay;
if (dspNow > dspWorkingDayAM && dspNow < dspWorkingDayPM)
if (dspNow >= dspWorkingDayAM && dspNow <= dspWorkingDayPM)
{
return true;
}
......
......@@ -346,11 +346,14 @@ namespace Mall.WebApi.Controllers.Education
{
return ApiResult.Failed("约课总时长必须课时时长的整数倍");
}
if (courseModel.IsPublic==1)
{
//判断时长是否一致
if (query.StudyDuration != courseModel.StudyDuration)
{
return ApiResult.Failed("约课时长与课时时长不等");
}
}
if (query.BasePointNum != courseModel.PointNum)
{
......@@ -799,13 +802,13 @@ namespace Mall.WebApi.Controllers.Education
List<RB_Point_TeacherCourseOrder_Extend> courseOrder = new List<RB_Point_TeacherCourseOrder_Extend>();
if (model != null)
{
courseOrder = pointModule.GetPointOrderList(new RB_Point_TeacherCourseOrder_Extend { SelectOrderStatus = 1, TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId, CourseId = model.ID, UserId = userInfo.UserId });
courseOrder = pointModule.GetPointOrderList(new RB_Point_TeacherCourseOrder_Extend { SelectOrderStatus = 1, TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId, CourseId = model.ID });
}
List<object> orderList = new List<object>();
if (courseOrder != null && courseOrder.Any())
{
orderList.AddRange(courseOrder.Select(x => new { x.UserName, x.Photo, StartStudyDate = x.StudyDate.ToString("HH:mm"), EndStudyDate = x.DurationUnit == Common.Enum.Point.DurationUnitEnum.Hour ? (x.StudyDate.AddMinutes(Convert.ToDouble(x.TotalStudyDuration * 60))) : x.StudyDate.AddMinutes(Convert.ToDouble(x.TotalStudyDuration)) }));
orderList.AddRange(courseOrder.Select(x => new { x.UserName, x.Photo, StartStudyDate = x.StudyDate.ToString("HH:mm"), EndStudyDate = (x.DurationUnit == Common.Enum.Point.DurationUnitEnum.Hour ? (x.StudyDate.AddMinutes(Convert.ToDouble(x.TotalStudyDuration * 60))) : x.StudyDate.AddMinutes(Convert.ToDouble(x.TotalStudyDuration))).ToString("HH:mm") }));
}
List<string> template_message_list = new List<string>();
......@@ -832,7 +835,10 @@ namespace Mall.WebApi.Controllers.Education
model.CourseName,
model.RoomId,
model.DurationUnit,
model.StudentNumType,
StudyDateStr = model.StudyDate.ToString("yyyy-MM-dd"),
model.StudyStartDate,
model.StudyEndDate,
orderList,
StudentNumTypeName = EnumHelper.GetEnumName(model.StudentNumType)
};
......
......@@ -732,6 +732,10 @@ namespace Mall.WebApi.Controllers.Education
{
return ApiResult.Failed("排课时间不能交叉,已存在" + item.StudyStartDate + "~" + item.StudyEndDate);
}
if (pointModule.GetTimeSpan(item.StudyStartTime, query.StudyStartDate, query.StudyEndDate))
{
return ApiResult.Failed("排课时间不能交叉,已存在" + item.StudyStartDate + "~" + item.StudyEndDate);
}
}
......
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