20251009
This commit is contained in:
@@ -1183,7 +1183,7 @@ namespace FineUIPro.Web.ContractorQuality
|
||||
pun.UserDepStartDate = DateTime.Now;//用户部门审批到达时间
|
||||
pun.Pause = false;//如果审核通过,取消暂停
|
||||
|
||||
#region 主协调员审批通过邮件:发送给部门经理,抄送流程经办人
|
||||
#region 主协调员审批通过邮件:如果部门有部门代理人,发送给部门代理人,抄送给部门经理及流程经办人;如果没有部门代理人,发送给部门经理,抄送给流程经办人
|
||||
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
|
||||
if (pops == null)
|
||||
{
|
||||
@@ -1196,31 +1196,56 @@ namespace FineUIPro.Web.ContractorQuality
|
||||
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("主协调员填写完成后审批通过通知"));
|
||||
if (emailTemplate.Count() > 0)
|
||||
{
|
||||
string departLeader = string.Empty;
|
||||
string delegatedRepresentative = string.Empty;//部门代理人
|
||||
string departmentLeader = string.Empty;//部门经理
|
||||
var depart = BLL.DepartService.GetDepartById(drpUserDep.SelectedValue);
|
||||
if (depart != null)
|
||||
{
|
||||
departLeader = depart.DepartLeader;
|
||||
delegatedRepresentative = depart.DelegatedRepresentative;
|
||||
departmentLeader = depart.DepartLeader;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(departLeader))
|
||||
if (!string.IsNullOrEmpty(delegatedRepresentative))
|
||||
{
|
||||
var userTo = from x in Funs.DB.Sys_User
|
||||
where x.UserId.Contains(departLeader) && x.Email != null && x.Email != ""
|
||||
where x.UserId.Contains(delegatedRepresentative) && x.Email != null && x.Email != ""
|
||||
select x;
|
||||
if (userTo != null)
|
||||
{
|
||||
mailTo = userTo.Select(x => x.Email).ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
var userCc = from x in Funs.DB.View_EMail_UserTo
|
||||
where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector))
|
||||
&& x.Email != null && x.Email != ""
|
||||
select x;
|
||||
if (userCc != null)
|
||||
{
|
||||
mailCC = userCc.Select(x => x.Email).Distinct().ToArray();
|
||||
var userCc = from x in Funs.DB.View_EMail_UserTo
|
||||
where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector) || x.UserId.Contains(departmentLeader))
|
||||
&& x.Email != null && x.Email != ""
|
||||
select x;
|
||||
if (userCc != null)
|
||||
{
|
||||
mailCC = userCc.Select(x => x.Email).Distinct().ToArray();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!string.IsNullOrEmpty(departmentLeader))
|
||||
{
|
||||
var userTo = from x in Funs.DB.Sys_User
|
||||
where x.UserId.Contains(departmentLeader) && x.Email != null && x.Email != ""
|
||||
select x;
|
||||
if (userTo != null)
|
||||
{
|
||||
mailTo = userTo.Select(x => x.Email).ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
var userCc = from x in Funs.DB.View_EMail_UserTo
|
||||
where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector))
|
||||
&& x.Email != null && x.Email != ""
|
||||
select x;
|
||||
if (userCc != null)
|
||||
{
|
||||
mailCC = userCc.Select(x => x.Email).Distinct().ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
if (mailTo.Length > 0)
|
||||
{
|
||||
NameValueCollection myPram = new NameValueCollection();
|
||||
|
||||
Reference in New Issue
Block a user