Commit c1dc722b authored by 黄奎's avatar 黄奎

1111

parent c2a52d89
......@@ -6,7 +6,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNet.SignalR.Core" Version="2.4.3" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
......
using Microsoft.AspNet.SignalR.Hubs;
using Microsoft.AspNetCore.SignalR;
using Microsoft.AspNetCore.SignalR;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Edu.Common.SignalR
......@@ -74,7 +71,6 @@ namespace Edu.Common.SignalR
/// <returns></returns>
public async Task RigestLiver(string message)
{
await Groups.AddToGroupAsync(Context.ConnectionId, "LIVER");
await Clients.Group("LIVER").SendAsync("LIVER_HELLO", "LIVER_HELLO");
}
......
......@@ -4793,7 +4793,7 @@ namespace Edu.Module.Course
item.Key.RoomName,
item.Key.TeacherName,
subAppointList.FirstOrDefault().CourseGradeId,
ChapterNo = item.Key.ChapterNo,
item.Key.ChapterNo,
CourseGradeName = subAppointList.FirstOrDefault().CourseGradeId.ToName(),
Ranks = subAppointList.FirstOrDefault().CourseGradeNo,
TotalPlanNum = subAppointList.FirstOrDefault().TotalChapterNo,
......
......@@ -372,7 +372,7 @@ namespace Edu.Module.Course
if (!string.IsNullOrEmpty(item.Key.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/stu/subscribe");//地址需要后台功能做了之后吧
var content = $"<font color='info'>课程取消通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{item.Key.Date.ToString("yyyy-MM-dd")}</font>\n>上课时段:<font color='warning'>{CourseTime}</font>\n>取消原因:<font color='comment'>截止仅有{item.Count()}报名,预约人数未达到最低成班人数 {item.Key.ScrollMinNum}人</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={item.Key.AccountId}&target={recipientPath})";
var content = $"<font color='info'>课程取消通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{Common.ConvertHelper.FormatDate(item.Key.Date)}</font>\n>上课时段:<font color='warning'>{CourseTime}</font>\n>取消原因:<font color='comment'>截止仅有{item.Count()}报名,预约人数未达到最低成班人数 {item.Key.ScrollMinNum}人</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={item.Key.AccountId}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, item.Key.WorkUserId, "课程取消通知");
}
}
......@@ -449,7 +449,7 @@ namespace Edu.Module.Course
if (!string.IsNullOrEmpty(item.Key.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/stu/subscribe");//地址需要后台功能做了之后吧
var content = $"<font color='info'>课程预约成功通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{item.Key.Date.ToString("yyyy-MM-dd")}</font>\n>上课时段:<font color='warning'>{CourseTime}</font>\n>上课课程:<font color='warning'>{item.Key.CourseName}(第{item.FirstOrDefault().ChapterNo}次课)</font>\n>上课教室:<font color='warning'>{item.Key.RoomName}({item.Key.RoomSchoolName})</font>\n>上课人数:<font color='comment'>{item.Count()}人</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={item.Key.AccountId}&target={recipientPath})";
var content = $"<font color='info'>课程预约成功通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{ConvertHelper.FormatDate(item.Key.Date)}</font>\n>上课时段:<font color='warning'>{CourseTime}</font>\n>上课课程:<font color='warning'>{item.Key.CourseName}(第{item.FirstOrDefault().ChapterNo}次课)</font>\n>上课教室:<font color='warning'>{item.Key.RoomName}({item.Key.RoomSchoolName})</font>\n>上课人数:<font color='comment'>{item.Count()}人</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={item.Key.AccountId}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, item.Key.WorkUserId, "课程预约成功通知");
}
}
......@@ -504,7 +504,7 @@ namespace Edu.Module.Course
if (!string.IsNullOrEmpty(empModel.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/stu/subscribe");//地址需要后台功能做了之后吧
var content = $"<font color='info'>课程即将取消通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{item.Key.Date.ToString("yyyy-MM-dd")}</font>\n>上课时段:<font color='warning'>{CourseTime}</font>\n>上课老师:<font color='warning'>{item.Key.TeacherName}</font>\n>取消原因:<font color='comment'>截止目前仅有{item.Where(x => x.AppointType != 3).Count()}报名,预约人数未达到最低成班人数 {item.Key.ScrollMinNum}人,即将取消</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={empModel.Id}&target={recipientPath})";
var content = $"<font color='info'>课程即将取消通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{Common.ConvertHelper.FormatDate(item.Key.Date)}</font>\n>上课时段:<font color='warning'>{CourseTime}</font>\n>上课老师:<font color='warning'>{item.Key.TeacherName}</font>\n>取消原因:<font color='comment'>截止目前仅有{item.Where(x => x.AppointType != 3).Count()}报名,预约人数未达到最低成班人数 {item.Key.ScrollMinNum}人,即将取消</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={empModel.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, empModel.WorkUserId, "课程即将取消通知");
}
}
......
......@@ -949,7 +949,7 @@ namespace Edu.Module.Course
if (!string.IsNullOrEmpty(empModel.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/stu/subscribe");//地址需要后台功能做了之后吧
var content = $"<font color='info'>学生预约通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{demodel.Date.ToString("yyyy-MM-dd")}</font>\n>上课时段:<font color='warning'>{demodel.CourseSTime + "~" + demodel.CourseETime}</font>\n>上课老师:<font color='warning'>{accountRepository.GetEmployeeInfo(demodel.AccountId)?.EmployeeName ?? ""}</font>\n>约课备注:<font color='comment'>学生 {studentRepository.GetEntity(demodel.StuId)?.StuName ?? ""}已约课</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={empModel.Id}&target={recipientPath})";
var content = $"<font color='info'>学生预约通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{Common.ConvertHelper.FormatDate(demodel.Date)}</font>\n>上课时段:<font color='warning'>{demodel.CourseSTime + "~" + demodel.CourseETime}</font>\n>上课老师:<font color='warning'>{accountRepository.GetEmployeeInfo(demodel.AccountId)?.EmployeeName ?? ""}</font>\n>约课备注:<font color='comment'>学生 {studentRepository.GetEntity(demodel.StuId)?.StuName ?? ""}已约课</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={empModel.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, empModel.WorkUserId, "学生预约通知");
}
}
......@@ -1086,7 +1086,7 @@ namespace Edu.Module.Course
if (!string.IsNullOrEmpty(empModel.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/stu/subscribe");//地址需要后台功能做了之后吧
var content = $"<font color='info'>学生预约取消通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{appontModel.Date.ToString("yyyy-MM-dd")}</font>\n>上课时段:<font color='warning'>{appontModel.CourseSTime + "~" + appontModel.CourseETime}</font>\n>上课老师:<font color='warning'>{accountRepository.GetEmployeeInfo(appontModel.AccountId)?.EmployeeName ?? ""}</font>\n>取消备注:<font color='comment'>学生 {StuName}自行取消预约</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={empModel.Id}&target={recipientPath})";
var content = $"<font color='info'>学生预约取消通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{Common.ConvertHelper.FormatDate(appontModel.Date)}</font>\n>上课时段:<font color='warning'>{appontModel.CourseSTime + "~" + appontModel.CourseETime}</font>\n>上课老师:<font color='warning'>{accountRepository.GetEmployeeInfo(appontModel.AccountId)?.EmployeeName ?? ""}</font>\n>取消备注:<font color='comment'>学生 {StuName}自行取消预约</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={empModel.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, empModel.WorkUserId, "学生预约取消通知");
}
}
......@@ -1135,7 +1135,7 @@ namespace Edu.Module.Course
if (!string.IsNullOrEmpty(empModel.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/stu/subscribe");//地址需要后台功能做了之后吧
var content = $"<font color='info'>学生预约取消通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{item.Date.ToString("yyyy-MM-dd")}</font>\n>上课时段:<font color='warning'>{item.CourseSTime + "~" + item.CourseETime}</font>\n>上课老师:<font color='warning'>{accountRepository.GetEmployeeInfo(item.AccountId)?.EmployeeName ?? ""}</font>\n>取消备注:<font color='comment'>学生 {StuName}取消预约前面课程,连带此次课程取消预约,请注意排课</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={empModel.Id}&target={recipientPath})";
var content = $"<font color='info'>学生预约取消通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{Common.ConvertHelper.FormatDate(item.Date)}</font>\n>上课时段:<font color='warning'>{item.CourseSTime + "~" + item.CourseETime}</font>\n>上课老师:<font color='warning'>{accountRepository.GetEmployeeInfo(item.AccountId)?.EmployeeName ?? ""}</font>\n>取消备注:<font color='comment'>学生 {StuName}取消预约前面课程,连带此次课程取消预约,请注意排课</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={empModel.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, empModel.WorkUserId, "学生预约取消通知");
}
}
......@@ -1772,7 +1772,7 @@ namespace Edu.Module.Course
if (!string.IsNullOrEmpty(empModel.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/stu/subscribe");//地址需要后台功能做了之后吧
var content = $"<font color='info'>取消学生预约通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{firstModel.Date.ToString("yyyy-MM-dd")}</font>\n>上课时段:<font color='warning'>{CourseTime}</font>\n>上课老师:<font color='warning'>{firstModel.TeacherName}</font>\n>取消原因:<font color='comment'>后台管理取消 {StuName}的约课</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={empModel.Id}&target={recipientPath})";
var content = $"<font color='info'>取消学生预约通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{Common.ConvertHelper.FormatDate(firstModel.Date)}</font>\n>上课时段:<font color='warning'>{CourseTime}</font>\n>上课老师:<font color='warning'>{firstModel.TeacherName}</font>\n>取消原因:<font color='comment'>后台管理取消 {StuName}的约课</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={empModel.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, empModel.WorkUserId, "取消学生预约通知");
}
}
......@@ -1898,7 +1898,7 @@ namespace Edu.Module.Course
if (!string.IsNullOrEmpty(WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/stu/subscribe");//地址需要后台功能做了之后吧
var content = $"<font color='info'>课程预约成功通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{firstModel.Date.ToString("yyyy-MM-dd")}</font>\n>上课时段:<font color='warning'>{CourseTime}</font>\n>上课课程:<font color='warning'>{firstModel.CourseName}(第{firstModel.ChapterNo}次课)</font>\n>上课教室:<font color='warning'>{firstModel.RoomName}({firstModel.RoomSchoolName})</font>\n>上课人数:<font color='comment'>{list.Count()}人</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={firstModel.AccountId}&target={recipientPath})";
var content = $"<font color='info'>课程预约成功通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{Common.ConvertHelper.FormatDate(firstModel.Date)}</font>\n>上课时段:<font color='warning'>{CourseTime}</font>\n>上课课程:<font color='warning'>{firstModel.CourseName}(第{firstModel.ChapterNo}次课)</font>\n>上课教室:<font color='warning'>{firstModel.RoomName}({firstModel.RoomSchoolName})</font>\n>上课人数:<font color='comment'>{list.Count()}人</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={firstModel.AccountId}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, WorkUserId, "课程预约成功通知");
}
}
......@@ -3050,7 +3050,7 @@ namespace Edu.Module.Course
if (!string.IsNullOrEmpty(empModel.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/stu/subscribe");//地址需要后台功能做了之后吧
var content = $"<font color='info'>取消学生预约通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{firstModel.Date.ToString("yyyy-MM-dd")}</font>\n>上课时段:<font color='warning'>{CourseTime}</font>\n>上课老师:<font color='warning'>{firstModel.TeacherName}</font>\n>取消原因:<font color='comment'>后台管理取消 {StuName}的约课</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={empModel.Id}&target={recipientPath})";
var content = $"<font color='info'>取消学生预约通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>{Common.ConvertHelper.FormatDate(firstModel.Date)}</font>\n>上课时段:<font color='warning'>{CourseTime}</font>\n>上课老师:<font color='warning'>{firstModel.TeacherName}</font>\n>取消原因:<font color='comment'>后台管理取消 {StuName}的约课</font>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={empModel.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, empModel.WorkUserId, "取消学生预约通知");
}
}
......
......@@ -95,7 +95,7 @@ ORDER BY r.Id asc ";
/// <returns></returns>
public RB_Scroll_Appointment_ViewModel GetMyAppointmentNum(int stuId, int guestId, int group_Id)
{
string sql = $@"SELECT MAX(Date) AS Date, COUNT(0) as ScrollMinNum FROM rb_scroll_appointment WHERE `Status` =0 and State <>5 and CourseEndTime >='{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}' and Group_Id ={group_Id} and StuId ={stuId} and GuestId ={guestId} HAVING COUNT(0) >0";
string sql = $@"SELECT MAX(Date) AS Date, COUNT(0) as ScrollMinNum FROM rb_scroll_appointment WHERE `Status` =0 and State <>5 and CourseEndTime >='{Common.ConvertHelper.FormatTime( DateTime.Now)}' and Group_Id ={group_Id} and StuId ={stuId} and GuestId ={guestId} HAVING COUNT(0) >0";
return Get<RB_Scroll_Appointment_ViewModel>(sql).FirstOrDefault();
}
......
using System;
using System.Collections.Generic;
using System.Linq;
using Edu.Cache.User;
using Edu.Cache.User;
using Edu.Common;
using Edu.Common.API;
using Edu.Common.Enum;
using Edu.Common.Enum.User;
using Edu.Common.Plugin;
using Edu.Model.CacheModel;
using Edu.Model.ViewModel.System;
using Edu.Model.ViewModel.User;
using Edu.Module.Course;
using Edu.Module.Duty;
using Edu.Module.Public;
using Edu.Module.System;
using Edu.Module.User;
......@@ -22,6 +17,9 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Edu.WebApi.Controllers.User
......@@ -55,13 +53,7 @@ namespace Edu.WebApi.Controllers.User
/// 部门处理类对象
/// </summary>
private readonly DepartmentModule departmentModule = new DepartmentModule();
private readonly CourseModule courseModule = new CourseModule();
/// <summary>
/// 班级处理类对象
/// </summary>
private readonly ClassModule classModule = new ClassModule();
[HttpGet]
[HttpPost]
......
......@@ -86,7 +86,7 @@ namespace Edu.WebApi.Timers
static System.Timers.Timer finishGuest;//处理学生毕业状态
static System.Timers.Timer marketTimer;//处理市场部和课程顾问部数据统计
//static System.Timers.Timer marketTimer;//处理市场部和课程顾问部数据统计
static System.Timers.Timer dealStudentProgressTimer;//处理学员上课进度
......
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