Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
38a07311
Commit
38a07311
authored
Mar 16, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
df2发布分支
parent
58138c57
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
8 deletions
+20
-8
performance/Performance.Api/Startup.cs
+1
-1
performance/Performance.Services/AllotService.cs
+3
-3
performance/Performance.Services/DFExtractService.cs
+3
-3
performance/Performance.Services/Hubs/AllotLogHub.cs
+6
-0
performance/Performance.Services/LogManageService.cs
+7
-1
No files found.
performance/Performance.Api/Startup.cs
View file @
38a07311
...
...
@@ -231,7 +231,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
#
endregion
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
);
app
.
UseMvc
();
...
...
performance/Performance.Services/AllotService.cs
View file @
38a07311
...
...
@@ -237,7 +237,7 @@ public void Generate(per_allot allot, string mail)
if
(!
checkDataService
.
Check
(
excel
,
allot
))
{
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
);
return
;
}
...
...
@@ -310,7 +310,7 @@ public void Generate(per_allot allot, string mail)
//发送邮件
logManageService
.
WriteMsg
(
"正在发送邮件"
,
"正在发送邮件"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
SendEmail
(
allot
,
mail
,
1
,
time
);
//
SendEmail(allot, mail, 1, time);
//logdbug.Add(allot.ID, "绩效开始执行", "绩效生成成功");
logManageService
.
WriteMsg
(
"绩效生成结束"
,
"绩效生成成功"
,
5
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
}
...
...
@@ -319,7 +319,7 @@ public void Generate(per_allot allot, string mail)
logManageService
.
WriteMsg
(
"绩效生成失败"
,
"程序异常,请重新尝试。"
,
4
,
allot
.
ID
,
"ReceiveMessage"
);
logdbug
.
Add
(
allot
.
ID
,
"绩效开始执行"
,
ex
.
ToString
(),
4
);
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateFail
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateFail
));
SendEmail
(
allot
,
mail
,
2
,
time
);
//
SendEmail(allot, mail, 2, time);
//throw ex;
}
}
...
...
performance/Performance.Services/DFExtractService.cs
View file @
38a07311
...
...
@@ -120,7 +120,7 @@ public string ExtractData(int allotId, string email, int hospitalId, string file
{
logManageService
.
WriteMsg
(
"提取数据异常"
,
$"数据写入出现异常"
,
4
,
Allot
.
ID
,
"ReceiveMessage"
);
logger
.
LogError
(
$"提取绩效数据异常 数据写入出现异常
{
ex
.
ToString
()}
"
);
SendEmail
(
email
,
""
,
$"
{
hospital
.
HosName
}
HIS数据提取失败"
,
$"
{
hospital
.
HosName
}
提取数据过程中出现异常情况,我们将尽快解决问题。给您带来的不便我们深感歉意!"
);
//
SendEmail(email, "", $"{hospital.HosName}HIS数据提取失败", $"{hospital.HosName}提取数据过程中出现异常情况,我们将尽快解决问题。给您带来的不便我们深感歉意!");
throw
ex
;
}
finally
...
...
@@ -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"
);
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
;
}
...
...
@@ -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"
);
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
;
}
...
...
performance/Performance.Services/Hubs/AllotLogHub.cs
View file @
38a07311
...
...
@@ -8,6 +8,12 @@
namespace
Performance.Services
{
public
class
HubGroupInfo
{
public
DateTime
AddTime
{
get
;
set
;
}
public
string
ConnectionId
{
get
;
set
;
}
}
public
class
AllotLogHub
:
Hub
{
private
readonly
ILogger
<
AllotLogHub
>
logger
;
...
...
performance/Performance.Services/LogManageService.cs
View file @
38a07311
using
Microsoft.AspNetCore.Mvc.ViewFeatures
;
using
Microsoft.AspNetCore.SignalR
;
using
Microsoft.Extensions.Logging
;
using
Performance.Repository
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -9,11 +10,15 @@ namespace Performance.Services
{
public
class
LogManageService
:
IAutoInjection
{
private
readonly
ILogger
<
LogManageService
>
logger
;
private
readonly
IHubContext
<
AllotLogHub
>
hubContext
;
private
PerforLogdbugRepository
logdbug
;
public
LogManageService
(
IHubContext
<
AllotLogHub
>
hubContext
,
public
LogManageService
(
ILogger
<
LogManageService
>
logger
,
IHubContext
<
AllotLogHub
>
hubContext
,
PerforLogdbugRepository
logdbug
)
{
this
.
logger
=
logger
;
this
.
hubContext
=
hubContext
;
this
.
logdbug
=
logdbug
;
}
...
...
@@ -28,6 +33,7 @@ public class LogManageService : IAutoInjection
/// <param name="method">方法名称</param>
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
);
if
(
isDebug
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment