11212121
This commit is contained in:
@@ -120,6 +120,7 @@
|
||||
<Compile Include="Common\Const.cs" />
|
||||
<Compile Include="NPOIHelper.cs" />
|
||||
<Compile Include="PublicInfo\BaseInfo\Base_PIPClassService.cs" />
|
||||
<Compile Include="Schedule\TaskScheduleService.cs" />
|
||||
<Compile Include="SendEmail\Email_ParamsService.cs" />
|
||||
<Compile Include="SendEmail\Email_PopService.cs" />
|
||||
<Compile Include="SendEmail\Email_SendLogService.cs" />
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Model;
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Mail;
|
||||
namespace FineUIPro.Web.common
|
||||
{
|
||||
@@ -170,12 +172,13 @@ namespace FineUIPro.Web.common
|
||||
}
|
||||
|
||||
|
||||
public static Email_Pop getEmailPop(string EmailID)
|
||||
public static Email_Pop getEmailPop()
|
||||
{
|
||||
Email_Pop pp = new Email_Pop();
|
||||
pp = BLL.Email_Send.Email_PopService.GetEmail_Pop(EmailID);
|
||||
var pp = Funs.DB.Email_Pop.FirstOrDefault();
|
||||
|
||||
return pp;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
using FineUIPro.Web.common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class TaskScheduleService
|
||||
{
|
||||
|
||||
//NDE点口未审核统计
|
||||
public static int NDEWeldPointNotAuditStatusTotal(int type)
|
||||
{
|
||||
if (type == 0)
|
||||
return 0;
|
||||
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append(@"SELECT count(1) FROM dbo.View_Batch_PointBatchItem WHERE PointState IS NOT NULL ");
|
||||
switch (type)
|
||||
{
|
||||
case 1:
|
||||
strSql.Append(" AND JLAudit='未审核'");
|
||||
break;
|
||||
case 2:
|
||||
strSql.Append(" AND GLGSAudit='未审核' ");
|
||||
break;
|
||||
}
|
||||
|
||||
int totalCount= SQLHelper.getIntValue(strSql.ToString());
|
||||
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
public static void GetNDEAuditEmailTemplate(int type)
|
||||
{
|
||||
var pop = MailHelper.getEmailPop();
|
||||
if (pop == null)
|
||||
{
|
||||
BLL.ErrLogInfo.WriteLog($"未配置邮件服务器");
|
||||
return;
|
||||
}
|
||||
string templateContent = string.Empty;
|
||||
List<string> emailSend = new List<string>(); //发送人
|
||||
List<string> emailCC = new List<string>(); //抄送给
|
||||
string mailSubject = string.Empty;
|
||||
string typeStr = string.Empty;
|
||||
if (type == 1)
|
||||
typeStr = "监理";
|
||||
if (type == 2)
|
||||
typeStr = "管理公司";
|
||||
|
||||
var emailTemplate = BLL.Email_Send.Email_SendTemplateService.GetEmailNotifier(typeStr);
|
||||
if (emailTemplate == null)
|
||||
{
|
||||
BLL.ErrLogInfo.WriteLog($"不存在此邮件模版");
|
||||
return;
|
||||
}
|
||||
emailSend = BLL.Email_Send.Email_SendTemplateService.GetEmailByTemplateId(emailTemplate.EmailId, "0");
|
||||
emailCC = BLL.Email_Send.Email_SendTemplateService.GetEmailByTemplateId(emailTemplate.EmailId, "1");
|
||||
if (emailSend.Count == 0)
|
||||
{
|
||||
BLL.ErrLogInfo.WriteLog($"未检测到发送人邮箱,请先配置邮箱地址");
|
||||
return;
|
||||
}
|
||||
mailSubject = $"{typeStr}—{emailTemplate.EailTiaoJian}"; //发送主题
|
||||
templateContent = emailTemplate.EmailContext;
|
||||
int totalCount = BLL.TaskScheduleService.NDEWeldPointNotAuditStatusTotal(type);
|
||||
templateContent = templateContent.Replace("{{totalCount}}", totalCount.ToString());
|
||||
|
||||
string resultMessage = "";
|
||||
MailHelper.SendNetMail(pop, pop.EmailYx, emailSend.ToArray(), mailSubject, templateContent, string.Empty, string.Empty, string.Empty, emailCC.ToArray(), out resultMessage);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Model;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
@@ -79,7 +80,7 @@ namespace BLL.Email_Send
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据主键删除EProject
|
||||
#region 根据主键删除
|
||||
/// <summary>
|
||||
/// 根据主键删除EProject
|
||||
/// </summary>
|
||||
@@ -95,7 +96,7 @@ namespace BLL.Email_Send
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据EmailNotifier查询EProject
|
||||
#region 根据EmailNotifier查询
|
||||
/// <summary>
|
||||
/// 根据EmailNotifier查询EProject
|
||||
/// </summary>
|
||||
@@ -106,7 +107,7 @@ namespace BLL.Email_Send
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据EmailNotifier查询EProject
|
||||
#region 根据EmailNotifier查询
|
||||
/// <summary>
|
||||
/// 根据EmailNotifier查询EProject
|
||||
/// </summary>
|
||||
@@ -117,6 +118,19 @@ namespace BLL.Email_Send
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据模版ID获取发送人列表
|
||||
public static List<string> GetEmailByTemplateId(string templateId,string isCc)
|
||||
{
|
||||
var result = (from a in Funs.DB.Email_ToPeople
|
||||
join b in Funs.DB.Sys_User on a.EmuserID equals b.UserId
|
||||
where b.IsPost.Value && b.Email!=""
|
||||
&& a.EMPeopleType==isCc && a.EmtempID==templateId
|
||||
select b.Email
|
||||
).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 事务提交 新增
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user