Commit b9390c88 authored by liudong1993's avatar liudong1993

1

parent 35ac9e84
...@@ -227,15 +227,12 @@ namespace Edu.Module.Course ...@@ -227,15 +227,12 @@ namespace Edu.Module.Course
var CourseTimeList = JsonHelper.DeserializeObject<List<CourseTimeModel>>(item.FirstOrDefault().CourseTime); var CourseTimeList = JsonHelper.DeserializeObject<List<CourseTimeModel>>(item.FirstOrDefault().CourseTime);
string CourseTime = CourseTimeList.Min(x => x.StartTime) + "~" + CourseTimeList.Max(x => x.EndTime); string CourseTime = CourseTimeList.Min(x => x.StartTime) + "~" + CourseTimeList.Max(x => x.EndTime);
string StartTime = item.Key.Date.ToString("yyyy-MM-dd") + " " + CourseTimeList.Min(x => x.StartTime); string StartTime = item.Key.Date.ToString("yyyy-MM-dd") + " " + CourseTimeList.Min(x => x.StartTime);
Console.WriteLine(JsonHelper.Serialize(CancelStuId));
//开始验证学生的数量是否达标 //开始验证学生的数量是否达标
if (item.Where(x => !CancelStuId.Contains(x.StuId)).Count() < item.Key.ScrollMinNum) if (item.Where(x => !CancelStuId.Contains(x.StuId)).Count() < item.Key.ScrollMinNum)
{ {
Console.WriteLine("不达标");
//人数未达标 取消课程 //人数未达标 取消课程
foreach (var qitem in item.Where(x => !CancelStuId.Contains(x.StuId))) foreach (var qitem in item.Where(x => !CancelStuId.Contains(x.StuId)))
{ {
Console.WriteLine("不达标:" + qitem.StuId);
CancelStuId.Add(qitem.StuId); CancelStuId.Add(qitem.StuId);
Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Scroll_Appointment_ViewModel.State), Common.Enum.Course.CourseAppointStateEnum.Cancel}, { nameof(RB_Scroll_Appointment_ViewModel.State), Common.Enum.Course.CourseAppointStateEnum.Cancel},
...@@ -258,7 +255,6 @@ namespace Edu.Module.Course ...@@ -258,7 +255,6 @@ namespace Edu.Module.Course
var clist = scroll_AppointmentRepository.GetAppointList(new RB_Scroll_Appointment_ViewModel() { Group_Id = groupId, StartTime = qitem.Date.ToString("yyyy-MM-dd"), StuId = qitem.StuId, State = Common.Enum.Course.CourseAppointStateEnum.WaitSure }); var clist = scroll_AppointmentRepository.GetAppointList(new RB_Scroll_Appointment_ViewModel() { Group_Id = groupId, StartTime = qitem.Date.ToString("yyyy-MM-dd"), StuId = qitem.StuId, State = Common.Enum.Course.CourseAppointStateEnum.WaitSure });
foreach (var qcitem in clist) foreach (var qcitem in clist)
{ {
Console.WriteLine("之后的取消:" + qcitem.StuId);
bool IsCancel = false; bool IsCancel = false;
if (qitem.Date == qcitem.Date) if (qitem.Date == qcitem.Date)
{ {
...@@ -306,12 +302,11 @@ namespace Edu.Module.Course ...@@ -306,12 +302,11 @@ namespace Edu.Module.Course
上课时段:<font color='warning'>{CourseTime}</font>\n> 上课时段:<font color='warning'>{CourseTime}</font>\n>
取消原因:<font color='comment'>截止仅有{item.Count()}报名,预约人数未达到最低成班人数 {item.Key.ScrollMinNum}人</font>\n> 取消原因:<font color='comment'>截止仅有{item.Count()}报名,预约人数未达到最低成班人数 {item.Key.ScrollMinNum}人</font>\n>
请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={item.Key.AccountId}&target={recipientPath})"; 请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={item.Key.AccountId}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, "LiuDong", "课程取消通知"); PushWorkChatHelper.PushToWorkChat(content, item.Key.WorkUserId, "课程取消通知");
} }
} }
else else
{ {
Console.WriteLine("达标");
#region 写入class_plan 计划表 #region 写入class_plan 计划表
//先查询计划是否已存在 //先查询计划是否已存在
...@@ -390,7 +385,7 @@ namespace Edu.Module.Course ...@@ -390,7 +385,7 @@ namespace Edu.Module.Course
上课教室:<font color='warning'>{item.Key.RoomName}({item.Key.RoomSchoolName})</font>\n> 上课教室:<font color='warning'>{item.Key.RoomName}({item.Key.RoomSchoolName})</font>\n>
上课人数:<font color='comment'>{item.Count()}人</font>\n> 上课人数:<font color='comment'>{item.Count()}人</font>\n>
请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={item.Key.AccountId}&target={recipientPath})"; 请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={item.Key.AccountId}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, "LiuDong", "课程预约成功通知"); PushWorkChatHelper.PushToWorkChat(content, item.Key.WorkUserId, "课程预约成功通知");
} }
} }
......
...@@ -349,8 +349,9 @@ namespace Edu.WebApi.Controllers.Course ...@@ -349,8 +349,9 @@ namespace Edu.WebApi.Controllers.Course
var query = new RB_Course_ViewModel() var query = new RB_Course_ViewModel()
{ {
IsQPrice = base.ParmJObj.GetInt("IsQPrice", 0), IsQPrice = base.ParmJObj.GetInt("IsQPrice", 0),
CourseSubject=base.ParmJObj.GetInt("CourseSubject"), CourseSubject = base.ParmJObj.GetInt("CourseSubject"),
IsQuerySalePlat=base.ParmJObj.GetInt("IsQuerySalePlat"), IsQuerySalePlat = base.ParmJObj.GetInt("IsQuerySalePlat"),
IsScrollClass = base.ParmJObj.GetInt("IsScrollClass", 0)
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
......
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