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
331719ba
Commit
331719ba
authored
Aug 08, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发送邮件
parent
e6d1e7cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletions
+28
-1
performance/Performance.Api/Template/医院绩效模板.xlsx
+0
-0
performance/Performance.Services/ModExtractService.cs
+1
-0
performance/Performance.Services/NewExtractService.cs
+27
-1
No files found.
performance/Performance.Api/Template/医院绩效模板.xlsx
View file @
331719ba
No preview for this file type
performance/Performance.Services/ModExtractService.cs
View file @
331719ba
...
...
@@ -435,6 +435,7 @@ public void AddItems(int moduleId)
ItemName
=
t
.
Value
.
ToString
(),
FactorValue1
=
0
m
,
FactorValue2
=
0
m
,
FactorValue3
=
0
m
,
ModuleId
=
module
.
Id
,
ExtractId
=
module
.
ExtractId
,
ReadOnly
=
1
...
...
performance/Performance.Services/NewExtractService.cs
View file @
331719ba
...
...
@@ -29,6 +29,7 @@ public class NewExtractService : IAutoInjection
#
region
private
readonly
ILogger
<
ExtractService
>
logger
;
private
readonly
IHostingEnvironment
environment
;
private
readonly
IEmailService
emailService
;
private
readonly
PerSheetService
perSheetService
;
private
readonly
PerforHospitalRepository
perforHospitalRepository
;
private
readonly
PerforHospitalconfigRepository
perforHospitalconfigRepository
;
...
...
@@ -48,6 +49,7 @@ public class NewExtractService : IAutoInjection
public
NewExtractService
(
ILogger
<
ExtractService
>
logger
,
IHostingEnvironment
environment
,
IEmailService
emailService
,
PerSheetService
perSheetService
,
PerforHospitalRepository
perforHospitalRepository
,
PerforHospitalconfigRepository
perforHospitalconfigRepository
,
...
...
@@ -64,6 +66,7 @@ public class NewExtractService : IAutoInjection
{
this
.
logger
=
logger
;
this
.
environment
=
environment
;
this
.
emailService
=
emailService
;
this
.
perSheetService
=
perSheetService
;
this
.
perforHospitalRepository
=
perforHospitalRepository
;
this
.
perforHospitalconfigRepository
=
perforHospitalconfigRepository
;
...
...
@@ -176,12 +179,13 @@ public string ExtractData(int allotId, string email, int hospitalId)
{
workbook
.
Write
(
file
);
}
SendEmail
(
email
,
newPath
,
$"
{
hospital
.
HosName
}
HIS数据提取成功"
,
$"
{
hospital
.
HosName
}
在
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
成功提取。"
);
return
newPath
;
}
catch
(
Exception
ex
)
{
LogHelper
.
Error
(
$"数据写入出现异常
{
ex
.
ToString
()}
"
,
"提取绩效数据"
,
"异常"
);
SendEmail
(
email
,
""
,
$"
{
hospital
.
HosName
}
HIS数据提取失败"
,
$"
{
hospital
.
HosName
}
提取数据过程中出现异常情况,我们将尽快解决问题。给您带来的不便我们深感歉意!"
);
throw
ex
;
}
finally
...
...
@@ -811,5 +815,27 @@ public string Judge(int allotId, int hospitalId, int useTemplate)
return
result
;
}
#
endregion
#
region
发送邮件
/// <summary>
/// 发送邮件
/// </summary>
/// <param name="path"></param>
/// <param name="subject"></param>
/// <param name="body"></param>
private
void
SendEmail
(
string
mail
,
string
path
,
string
subject
,
string
body
)
{
var
message
=
new
EmailMessage
{
To
=
new
List
<
string
>
{
mail
},
DisplayName
=
"溯直健康"
,
Subject
=
subject
,
Body
=
body
};
if
(!
string
.
IsNullOrEmpty
(
path
))
message
.
Attachments
=
new
List
<
string
>
{
path
};
emailService
.
Send
(
message
);
}
#
endregion
}
}
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