Commit daaade91 authored by 黄奎's avatar 黄奎

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

parents 72b75926 928e7552
......@@ -3005,7 +3005,7 @@ namespace Edu.Module.Course
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})";
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, "课后反馈通知");
});
}
......
......@@ -24,6 +24,7 @@ using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using VT.FW.DB;
namespace Edu.Module.Course
......@@ -544,6 +545,42 @@ namespace Edu.Module.Course
keyValues.Add(nameof(RB_Education_Contract_ViewModel.AuditDate), DateTime.Now);
}
}
#region 企业消息推送
var model = education_ContractRepository.GetEntity(contractId);
if (state == 1)
{
var notifyList = accountRepository.GetWorkUserIdByFunctionNameRepository("'EducationContractSchool','EducationContractAdmin'");
if (notifyList != null && notifyList.Any())
{
notifyList.ForEach(x =>
{
var recipientPath = HttpUtility.UrlEncode($"/sale/contractAudit?no={model.ContractNo}");
var content = $"合同通知 你收到了一份需要审批的合同\n>**概要信息** \n>申 领 人:<font color='comment'>{userInfo.AccountName}</font>\n>合同编号:<font color='comment'>{model.ContractNo}</font>\n>合同类型:<font color='warning'>{EnumHelper.ToName(model.CType)}合同</font> \n>订单编号:<font color='comment'>{model.OrderId}</font>\n>合同金额:<font color='info'>{model.Money.ToString("C")}</font>\n>请点击:[查看合同详情]({Config.ErpUrl}/autologin?loginId={x.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, x.WorkUserId, "合同审批通知");
});
}
}
else if (state == 2 || state == 3 || state==6)
{
var notifyObj = accountRepository.GetEntity(model.CreateBy);
if (notifyObj != null && !string.IsNullOrEmpty(notifyObj.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/sale/contractManage?no={model.ContractNo}");
var content = $"{((state == 2 || state == 6) ? "<font color='info'>合同审核通过</font>" : "`合同审核驳回`")} 你收到了一份合同审批结果通知\n>**概要信息** \n>审 批 人:<font color='comment'>{userInfo.AccountName}</font>\n>合同编号:<font color='comment'>{model.ContractNo}</font>\n>合同类型:<font color='warning'>{EnumHelper.ToName(model.CType)}合同</font> \n>订单编号:<font color='comment'>{model.OrderId}</font>\n>合同金额:<font color='info'>{model.Money.ToString("C")}</font>\n>请点击:[查看合同]({Config.ErpUrl}/autologin?loginId={notifyObj.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, notifyObj.WorkUserId, "合同审批通知");
}
}
else if (state == 5)
{
var notifyObj = accountRepository.GetEntity(model.CreateBy);
if (notifyObj != null && !string.IsNullOrEmpty(notifyObj.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/sale/contractManage?no={model.ContractNo}");
var content = $"<font color='info'>合同已盖章</font> 你收到了一份合同加盖公章通知\n>**概要信息** \n>盖 章 人:<font color='comment'>{userInfo.AccountName}</font>\n>合同编号:<font color='comment'>{model.ContractNo}</font>\n>合同类型:<font color='warning'>{EnumHelper.ToName(model.CType)}合同</font> \n>订单编号:<font color='comment'>{model.OrderId}</font>\n>合同金额:<font color='info'>{model.Money.ToString("C")}</font>\n>请点击:[查看合同]({Config.ErpUrl}/autologin?loginId={notifyObj.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, notifyObj.WorkUserId, "合同审批通知");
}
}
#endregion
return education_ContractRepository.Update(keyValues, new WhereHelper(nameof(RB_Education_Contract_ViewModel.Id), contractId));
}
......@@ -586,6 +623,42 @@ namespace Edu.Module.Course
}
}
#region 企业消息推送
var model = education_ContractRepository.GetEntity(contractId);
if (state == 1)
{
var notifyList = accountRepository.GetWorkUserIdByFunctionNameRepository("'EducationContractSchool','EducationContractAdmin'");
if (notifyList != null && notifyList.Any())
{
notifyList.ForEach(x =>
{
var recipientPath = HttpUtility.UrlEncode($"/sale/contractAudit?no={model.ContractNo}");
var content = $"合同通知 你收到了一份需要审批的合同\n>**概要信息** \n>申 领 人:<font color='comment'>{userInfo.AccountName}</font>\n>合同编号:<font color='comment'>{model.ContractNo}</font>\n>合同类型:<font color='warning'>{EnumHelper.ToName(model.CType)}合同</font> \n>订单编号:<font color='comment'>{model.OrderId}</font>\n>合同金额:<font color='info'>{model.Money.ToString("C")}</font>\n>请点击:[查看合同详情]({Config.ErpUrl}/autologin?loginId={x.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, x.WorkUserId, "合同审批通知");
});
}
}
else if (state == 2 || state == 3 || state==6)
{
var notifyObj = accountRepository.GetEntity(model.CreateBy);
if (notifyObj != null && !string.IsNullOrEmpty(notifyObj.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/sale/contractManage?no={model.ContractNo}");
var content = $"{((state == 2||state==6) ? "<font color='info'>合同审核通过</font>" : "`合同审核驳回`")} 你收到了一份合同审批结果通知\n>**概要信息** \n>审 批 人:<font color='comment'>{userInfo.AccountName}</font>\n>合同编号:<font color='comment'>{model.ContractNo}</font>\n>合同类型:<font color='warning'>{EnumHelper.ToName(model.CType)}合同</font> \n>订单编号:<font color='comment'>{model.OrderId}</font>\n>合同金额:<font color='info'>{model.Money.ToString("C")}</font>\n>请点击:[查看合同]({Config.ErpUrl}/autologin?loginId={notifyObj.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, notifyObj.WorkUserId, "合同审批通知");
}
}
else if (state == 5)
{
var notifyObj = accountRepository.GetEntity(model.CreateBy);
if (notifyObj != null && !string.IsNullOrEmpty(notifyObj.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/sale/contractManage?no={model.ContractNo}");
var content = $"<font color='info'>合同已盖章</font> 你收到了一份合同加盖公章通知\n>**概要信息** \n>盖 章 人:<font color='comment'>{userInfo.AccountName}</font>\n>合同编号:<font color='comment'>{model.ContractNo}</font>\n>合同类型:<font color='warning'>{EnumHelper.ToName(model.CType)}合同</font> \n>订单编号:<font color='comment'>{model.OrderId}</font>\n>合同金额:<font color='info'>{model.Money.ToString("C")}</font>\n>请点击:[查看合同]({Config.ErpUrl}/autologin?loginId={notifyObj.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, notifyObj.WorkUserId, "合同审批通知");
}
}
#endregion
return education_ContractRepository.Update(keyValues, new WhereHelper(nameof(RB_Education_Contract_ViewModel.Id), contractId));
}
......@@ -604,6 +677,14 @@ namespace Edu.Module.Course
{ nameof(RB_Education_Contract_ViewModel.Sign),sign},
{ nameof(RB_Education_Contract_ViewModel.SignDate),DateTime.Now},
};
var model = education_ContractRepository.GetEntity(contractId);
var notifyObj = accountRepository.GetEntity(model.CreateBy);
if (notifyObj != null && !string.IsNullOrEmpty(notifyObj.WorkUserId))
{
var recipientPath = HttpUtility.UrlEncode($"/sale/contractManage?no={model.ContractNo}");
var content = $"<font color='info'>合同签字确认</font> 你的一份合同用户已签字确认\n>**概要信息** \n>合同编号:<font color='comment'>{model.ContractNo}</font>\n>合同类型:<font color='warning'>{EnumHelper.ToName(model.CType)}合同</font> \n>订单编号:<font color='comment'>{model.OrderId}</font>\n>合同金额:<font color='info'>{model.Money.ToString("C")}</font>\n>请点击:[查看合同]({Config.ErpUrl}/autologin?loginId={notifyObj.Id}&target={recipientPath})";
PushWorkChatHelper.PushToWorkChat(content, notifyObj.WorkUserId, "合同审批通知");
}
return education_ContractRepository.Update(keyValues, new WhereHelper(nameof(RB_Education_Contract_ViewModel.Id), contractId));
}
......
......@@ -668,5 +668,22 @@ WHERE e.RB_Group_id ={GroupId} AND e.IsLeave =0 AND o.Score =0 GROUP BY e.Employ
return Get<RB_Account_ViewModel>(sql).ToList();
}
/// <summary>
/// 获取指定权限的员工信息
/// </summary>
/// <param name="functionName"></param>
/// <returns></returns>
public List<RB_Account_ViewModel> GetWorkUserIdByFunctionNameRepository(string functionName)
{
string sql = $@"SELECT d.EmployeeId as Id,d.WorkUserId FROM RB_Menu_Function AS a
left join rb_role_functionpermission b on a.Id=b.Action_Id
left join rb_post_role c on b.Role_Id=c.RoleId
left join rb_employee d on c.PostId=d.RB_Post_Id
where d.IsLeave=0 and d.WorkUserId is not null and a.FunctionCode in({functionName}) GROUP BY d.EmployeeId";
return Get<RB_Account_ViewModel>(sql).ToList();
}
}
}
\ No newline at end of file
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