Commit 806e6f5f authored by 罗超's avatar 罗超

新增教师备课消息推送

parent 1397b2a2
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_LastSelectedProfileId>E:\LDWork\LiuDongWork\OnLineItem\Education\Edu.EducationCore\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
<_LastSelectedProfileId>D:\线上代码\education\Edu.EducationCore\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
</PropertyGroup>
<ItemGroup>
<Compile Update="EducationTimerServer.cs">
......
......@@ -166,7 +166,7 @@ namespace Edu.Education.Helper
await scheduler.Start();
IJobDetail job = JobBuilder.Create<NotifyTeachPerparing>()
.WithIdentity("job4", "group4")
.WithIdentity("trigger5", "group5")
.Build();
ICronTrigger trigger = (ICronTrigger)TriggerBuilder.Create()
.WithIdentity("trigger5", "group5")
......
......@@ -2806,7 +2806,7 @@ namespace Edu.Module.Course
/// <param name="model"></param>
/// <returns></returns>
[TransactionCallHandler]
public bool SetClassLessPlan(Class_LessonPlan_ViewModel model)
public bool SetClassLessPlan(Class_LessonPlan_ViewModel model,UserInfo user)
{
bool flag = false;
if (model.LessonPlanList != null && model.LessonPlanList.Any())
......@@ -2862,12 +2862,38 @@ namespace Edu.Module.Course
{
ClassLessonPlanProjectsRepository.DeleteBatch(projectsList);
}
#region 备课通知
var classInfo = classRepository.GetEntity(item.ClassId);
var recipientPath = HttpUtility.UrlEncode($"/course/prepareclassDetails?ClassId={item.ClassId}&ClassPlanId={item.ClassPlanId}&TeacherId={user.AccountId}");
var notifyObjs = accountRepository.GetWorkUserIdByDictRepository("Push_TeachPreparing");
if (notifyObjs != null && notifyObjs.Any())
{
notifyObjs.ForEach(x => {
var content = $"<font color='info'>修改备课通知</font> 有老师对备课内容进行了修改调整\n>**概要信息** \n>备课老师:<font color='comment'>{user.AccountName}</font>\n>备课标题:<font color='comment'>{item.LessonPlan}(第{item.CourseNum}课)</font>\n>目标班级:<font color='comment'>{classInfo.ClassName}</font> \n>上课日期:<font color='warning'>{item.ClassDate.Value.ToString("yyyy年MM月dd日")}</font>\n>请点击:[查看备课内容]({Config.ErpUrl}/autologin?loginId={x.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, x.WorkUserId, "修改备课通知");
});
}
#endregion
}
else
{
LessonPlanId = ClassLessonPlanRepository.Insert(item);
flag = LessonPlanId > 0;
#region 备课通知
var classInfo = classRepository.GetEntity(item.ClassId);
var recipientPath = HttpUtility.UrlEncode($"/course/prepareclassDetails?ClassId={item.ClassId}&ClassPlanId={item.ClassPlanId}&TeacherId={user.AccountId}");
var notifyObjs = accountRepository.GetWorkUserIdByDictRepository("Push_TeachPreparing");
if (notifyObjs != null && notifyObjs.Any())
{
notifyObjs.ForEach(x => {
var content = $"<font color='info'>备课通知</font> 有老师完成了备课工作\n>**概要信息** \n>备课老师:<font color='comment'>{user.AccountName}</font>\n>备课标题:<font color='comment'>{item.LessonPlan}(第{item.CourseNum}课)</font>\n>目标班级:<font color='comment'>{classInfo.ClassName}</font> \n>上课日期:<font color='warning'>{item.ClassDate.Value.ToString("yyyy年MM月dd日")}</font>\n>请点击:[查看备课内容]({Config.ErpUrl}/autologin?loginId={x.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, x.WorkUserId, "新增备课通知");
});
}
#endregion
}
if (flag)
{
......@@ -2916,7 +2942,7 @@ namespace Edu.Module.Course
/// <param name="model"></param>
/// <returns></returns>
[TransactionCallHandler]
public virtual bool UpdateClassLessPlan(Class_LessonPlan_ViewModel model)
public virtual bool UpdateClassLessPlan(Class_LessonPlan_ViewModel model,UserInfo user)
{
bool flag = true;
if (model.LessonPlanList != null && model.LessonPlanList.Any())
......@@ -2934,6 +2960,8 @@ namespace Edu.Module.Course
flag = ClassLessonPlanDetailsRepository.Update(fileds, new WhereHelper(nameof(RB_Class_LessonPlanDetails_ViewModel.LessonPlanDetailsId), itemDetails.LessonPlanDetailsId));
}
}
}
}
return flag;
......@@ -2946,7 +2974,7 @@ namespace Edu.Module.Course
/// <param name="model"></param>
/// <returns></returns>
[TransactionCallHandler]
public virtual bool GetUpdateClassLessPlanSummary(Class_LessonPlan_ViewModel model)
public virtual bool GetUpdateClassLessPlanSummary(Class_LessonPlan_ViewModel model,UserInfo user)
{
bool flag = true;
if (model.LessonPlanList != null && model.LessonPlanList.Any())
......@@ -2962,6 +2990,20 @@ namespace Edu.Module.Course
{
flag = ClassLessonPlanRepository.Update(fileds, new WhereHelper(nameof(RB_Class_LessonPlan_ViewModel.LessonPlanId), item.LessonPlanId));
}
#region 备课通知
var classInfo = classRepository.GetEntity(item.ClassId);
var recipientPath = HttpUtility.UrlEncode($"/course/prepareclassDetails?ClassId={item.ClassId}&ClassPlanId={item.ClassPlanId}&TeacherId={user.AccountId}");
var notifyObjs = accountRepository.GetWorkUserIdByDictRepository("Push_TeachPreparing");
if (notifyObjs != null && notifyObjs.Any())
{
notifyObjs.ForEach(x => {
var content = $"<font color='info'>课后反馈通知</font> 有老师完成了课后反馈工作\n>**概要信息** \n>反馈老师:<font color='comment'>{user.AccountName}</font>\n>备课标题:<font color='comment'>{item.LessonPlan}(第{item.CourseNum}课)</font>\n>目标班级:<font color='comment'>{classInfo.ClassName}`</font> \n>上课日期:<font color='warning'>{item.ClassDate.Value.ToString("yyyy年MM月dd日")}</font>\n>请点击:[查看反馈内容]({Config.ErpUrl}/autologin?loginId={x.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, x.WorkUserId, "课后反馈通知");
});
}
#endregion
}
if (flag)
{
......
......@@ -1529,7 +1529,9 @@ namespace Edu.WebApi.Controllers.Course
item.LessonPlanDetailsList.ForEach(x => x.ProjectPic = (x.ProjectPicList != null && x.ProjectPicList.Any()) ? JsonConvert.SerializeObject(x.ProjectPicList) : "");
}
}
bool flag = classModule.SetClassLessPlan(query);
bool flag = classModule.SetClassLessPlan(query, base.UserInfo);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......@@ -1574,7 +1576,7 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Failed("老师教案信息为空必须更新");
}
bool flag = classModule.UpdateClassLessPlan(query);
bool flag = classModule.UpdateClassLessPlan(query,base.UserInfo);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......@@ -1971,7 +1973,7 @@ namespace Edu.WebApi.Controllers.Course
}
query.LessonPlanList.ForEach(x => x.ProjectPic = (x.ProjectPicList != null && x.ProjectPicList.Any()) ? JsonConvert.SerializeObject(x.ProjectPicList) : "");
bool flag = classModule.GetUpdateClassLessPlanSummary(query);
bool flag = classModule.GetUpdateClassLessPlanSummary(query,base.UserInfo);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......
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