df2发布分支

parent 58138c57
...@@ -231,7 +231,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF ...@@ -231,7 +231,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
#endregion #endregion
app.UseCors("SignalrCore"); app.UseCors("SignalrCore");
app.UseSignalR(routes => routes.MapHub<AllotLogHub>("/performance/allotLogHub")); //app.UseSignalR(routes => routes.MapHub<AllotLogHub>("/performance/allotLogHub"));
loggerFactory.CreateLogger<Startup>().LogDebug(env.EnvironmentName); loggerFactory.CreateLogger<Startup>().LogDebug(env.EnvironmentName);
app.UseMvc(); app.UseMvc();
......
...@@ -237,7 +237,7 @@ public void Generate(per_allot allot, string mail) ...@@ -237,7 +237,7 @@ public void Generate(per_allot allot, string mail)
if (!checkDataService.Check(excel, allot)) if (!checkDataService.Check(excel, allot))
{ {
UpdateAllotStates(allot.ID, (int)AllotStates.CheckFail, EnumHelper.GetDescription(AllotStates.CheckFail)); UpdateAllotStates(allot.ID, (int)AllotStates.CheckFail, EnumHelper.GetDescription(AllotStates.CheckFail));
SendEmail(allot, mail, 3, time); //SendEmail(allot, mail, 3, time);
logManageService.WriteMsg("绩效数据校验失败", "详情可至“更多 -- 查看日志”查看", 3, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("绩效数据校验失败", "详情可至“更多 -- 查看日志”查看", 3, allot.ID, "ReceiveMessage", true);
return; return;
} }
...@@ -310,7 +310,7 @@ public void Generate(per_allot allot, string mail) ...@@ -310,7 +310,7 @@ public void Generate(per_allot allot, string mail)
//发送邮件 //发送邮件
logManageService.WriteMsg("正在发送邮件", "正在发送邮件", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在发送邮件", "正在发送邮件", 1, allot.ID, "ReceiveMessage", true);
SendEmail(allot, mail, 1, time); //SendEmail(allot, mail, 1, time);
//logdbug.Add(allot.ID, "绩效开始执行", "绩效生成成功"); //logdbug.Add(allot.ID, "绩效开始执行", "绩效生成成功");
logManageService.WriteMsg("绩效生成结束", "绩效生成成功", 5, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("绩效生成结束", "绩效生成成功", 5, allot.ID, "ReceiveMessage", true);
} }
...@@ -319,7 +319,7 @@ public void Generate(per_allot allot, string mail) ...@@ -319,7 +319,7 @@ public void Generate(per_allot allot, string mail)
logManageService.WriteMsg("绩效生成失败", "程序异常,请重新尝试。", 4, allot.ID, "ReceiveMessage"); logManageService.WriteMsg("绩效生成失败", "程序异常,请重新尝试。", 4, allot.ID, "ReceiveMessage");
logdbug.Add(allot.ID, "绩效开始执行", ex.ToString(), 4); logdbug.Add(allot.ID, "绩效开始执行", ex.ToString(), 4);
UpdateAllotStates(allot.ID, (int)AllotStates.GenerateFail, EnumHelper.GetDescription(AllotStates.GenerateFail)); UpdateAllotStates(allot.ID, (int)AllotStates.GenerateFail, EnumHelper.GetDescription(AllotStates.GenerateFail));
SendEmail(allot, mail, 2, time); //SendEmail(allot, mail, 2, time);
//throw ex; //throw ex;
} }
} }
......
...@@ -120,7 +120,7 @@ public string ExtractData(int allotId, string email, int hospitalId, string file ...@@ -120,7 +120,7 @@ public string ExtractData(int allotId, string email, int hospitalId, string file
{ {
logManageService.WriteMsg("提取数据异常", $"数据写入出现异常", 4, Allot.ID, "ReceiveMessage"); logManageService.WriteMsg("提取数据异常", $"数据写入出现异常", 4, Allot.ID, "ReceiveMessage");
logger.LogError($"提取绩效数据异常 数据写入出现异常{ex.ToString()}"); logger.LogError($"提取绩效数据异常 数据写入出现异常{ex.ToString()}");
SendEmail(email, "", $"{hospital.HosName}HIS数据提取失败", $"{hospital.HosName}提取数据过程中出现异常情况,我们将尽快解决问题。给您带来的不便我们深感歉意!"); //SendEmail(email, "", $"{hospital.HosName}HIS数据提取失败", $"{hospital.HosName}提取数据过程中出现异常情况,我们将尽快解决问题。给您带来的不便我们深感歉意!");
throw ex; throw ex;
} }
finally finally
...@@ -191,7 +191,7 @@ public string TemplateExecute(string email, per_allot lastAllot, sys_hospital ho ...@@ -191,7 +191,7 @@ public string TemplateExecute(string email, per_allot lastAllot, sys_hospital ho
} }
logManageService.WriteMsg("提取绩效数据", $"{hospital.HosName}HIS数据提取成功,文件路径:{newPath}。", 5, Allot.ID, "ReceiveMessage"); logManageService.WriteMsg("提取绩效数据", $"{hospital.HosName}HIS数据提取成功,文件路径:{newPath}。", 5, Allot.ID, "ReceiveMessage");
logger.LogInformation($"提取绩效数据 {hospital.HosName}HIS数据提取成功,文件路径:{newPath}。"); logger.LogInformation($"提取绩效数据 {hospital.HosName}HIS数据提取成功,文件路径:{newPath}。");
SendEmail(email, newPath, $"{hospital.HosName}HIS数据提取成功", $"{hospital.HosName}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}成功提取。"); //SendEmail(email, newPath, $"{hospital.HosName}HIS数据提取成功", $"{hospital.HosName}在{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}成功提取。");
return newPath; return newPath;
} }
...@@ -259,7 +259,7 @@ public string AlllotExecute(string email, per_allot lastAllot, sys_hospital hosp ...@@ -259,7 +259,7 @@ public string AlllotExecute(string email, per_allot lastAllot, sys_hospital hosp
} }
logManageService.WriteMsg("提取绩效数据", $"{hospital.HosName}HIS数据提取成功,文件路径:{newPath}。", 5, Allot.ID, "ReceiveMessage"); logManageService.WriteMsg("提取绩效数据", $"{hospital.HosName}HIS数据提取成功,文件路径:{newPath}。", 5, Allot.ID, "ReceiveMessage");
logger.LogInformation($"提取绩效数据 {hospital.HosName}HIS数据提取成功,文件路径:{newPath}。"); logger.LogInformation($"提取绩效数据 {hospital.HosName}HIS数据提取成功,文件路径:{newPath}。");
SendEmail(email, newPath, $"{hospital.HosName}HIS数据提取成功", $"{hospital.HosName}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}成功提取。"); //SendEmail(email, newPath, $"{hospital.HosName}HIS数据提取成功", $"{hospital.HosName}在{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}成功提取。");
return newPath; return newPath;
} }
......
...@@ -8,6 +8,12 @@ ...@@ -8,6 +8,12 @@
namespace Performance.Services namespace Performance.Services
{ {
public class HubGroupInfo
{
public DateTime AddTime { get; set; }
public string ConnectionId { get; set; }
}
public class AllotLogHub : Hub public class AllotLogHub : Hub
{ {
private readonly ILogger<AllotLogHub> logger; private readonly ILogger<AllotLogHub> logger;
......
using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Logging;
using Performance.Repository; using Performance.Repository;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -9,11 +10,15 @@ namespace Performance.Services ...@@ -9,11 +10,15 @@ namespace Performance.Services
{ {
public class LogManageService : IAutoInjection public class LogManageService : IAutoInjection
{ {
private readonly ILogger<LogManageService> logger;
private readonly IHubContext<AllotLogHub> hubContext; private readonly IHubContext<AllotLogHub> hubContext;
private PerforLogdbugRepository logdbug; private PerforLogdbugRepository logdbug;
public LogManageService(IHubContext<AllotLogHub> hubContext, public LogManageService(
ILogger<LogManageService> logger,
IHubContext<AllotLogHub> hubContext,
PerforLogdbugRepository logdbug) PerforLogdbugRepository logdbug)
{ {
this.logger = logger;
this.hubContext = hubContext; this.hubContext = hubContext;
this.logdbug = logdbug; this.logdbug = logdbug;
} }
...@@ -28,6 +33,7 @@ public class LogManageService : IAutoInjection ...@@ -28,6 +33,7 @@ public class LogManageService : IAutoInjection
/// <param name="method">方法名称</param> /// <param name="method">方法名称</param>
public void WriteMsg(string tag, string message, int level, int allotId, string method, bool isDebug = false) public void WriteMsg(string tag, string message, int level, int allotId, string method, bool isDebug = false)
{ {
logger.LogInformation($"method:{method};tag:{tag}; message:{message}; level:{level}");
hubContext.Clients.Group(allotId.ToString()).SendAsync(method, tag, message, level); hubContext.Clients.Group(allotId.ToString()).SendAsync(method, tag, message, level);
if (isDebug) if (isDebug)
{ {
......
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