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
084b90fd
Commit
084b90fd
authored
Jun 06, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://192.168.0.110:8880/zry/performance
into develop
parents
c2ff7db2
0c9df750
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
6 deletions
+16
-6
performance/Performance.Api/Controllers/AgainAllotController.cs
+1
-1
performance/Performance.Api/Controllers/AllotController.cs
+1
-1
performance/Performance.Api/Controllers/TemplateController.cs
+1
-1
performance/Performance.Infrastructure/Util/EmailService.cs
+12
-2
performance/Performance.Services/ExtractService.cs
+1
-1
No files found.
performance/Performance.Api/Controllers/AgainAllotController.cs
View file @
084b90fd
...
...
@@ -91,7 +91,7 @@ public ApiResponse Import([FromForm] IFormCollection form)
var
name
=
FileHelper
.
GetFileNameNoExtension
(
file
.
FileName
)
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
var
ext
=
FileHelper
.
GetExtension
(
file
.
FileName
);
var
dpath
=
Path
.
Combine
(
env
.
ContentRootPath
.
Substring
(
0
,
env
.
ContentRootPath
.
LastIndexOf
(
"\\"
))
,
"Files"
,
$"
{
allot
.
HospitalId
}
"
,
$"
{
allot
.
Year
}{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
"
);
var
dpath
=
Path
.
Combine
(
env
.
ContentRootPath
,
"Files"
,
$"
{
allot
.
HospitalId
}
"
,
$"
{
allot
.
Year
}{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
"
);
FileHelper
.
CreateDirectory
(
dpath
);
var
path
=
Path
.
Combine
(
dpath
,
$"
{
name
}{
ext
}
"
);
...
...
performance/Performance.Api/Controllers/AllotController.cs
View file @
084b90fd
...
...
@@ -120,7 +120,7 @@ public ApiResponse Import([FromForm] IFormCollection form)
var
name
=
FileHelper
.
GetFileNameNoExtension
(
file
.
FileName
)
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
var
ext
=
FileHelper
.
GetExtension
(
file
.
FileName
);
var
dpath
=
Path
.
Combine
(
_evn
.
ContentRootPath
.
Substring
(
0
,
_evn
.
ContentRootPath
.
LastIndexOf
(
"\\"
))
,
"Files"
,
$"
{
allot
.
HospitalId
}
"
,
$"
{
allot
.
Year
}{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
"
);
var
dpath
=
Path
.
Combine
(
_evn
.
ContentRootPath
,
"Files"
,
$"
{
allot
.
HospitalId
}
"
,
$"
{
allot
.
Year
}{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
"
);
FileHelper
.
CreateDirectory
(
dpath
);
var
path
=
Path
.
Combine
(
dpath
,
$"
{
name
}{
ext
}
"
);
...
...
performance/Performance.Api/Controllers/TemplateController.cs
View file @
084b90fd
...
...
@@ -69,7 +69,7 @@ public ApiResponse Import([FromForm] IFormCollection form)
var
name
=
FileHelper
.
GetFileNameNoExtension
(
file
.
FileName
)
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
var
ext
=
FileHelper
.
GetExtension
(
file
.
FileName
);
var
dpath
=
Path
.
Combine
(
evn
.
ContentRootPath
.
Substring
(
0
,
evn
.
ContentRootPath
.
LastIndexOf
(
"\\"
))
,
"Files"
,
$"
{
hospitalid
}
"
,
"first"
);
var
dpath
=
Path
.
Combine
(
evn
.
ContentRootPath
,
"Files"
,
$"
{
hospitalid
}
"
,
"first"
);
FileHelper
.
CreateDirectory
(
dpath
);
var
path
=
Path
.
Combine
(
dpath
,
$"
{
name
}{
ext
}
"
);
...
...
performance/Performance.Infrastructure/Util/EmailService.cs
View file @
084b90fd
...
...
@@ -2,6 +2,7 @@
using
Microsoft.Extensions.Logging
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Net
;
using
System.Net.Mail
;
using
System.Text
;
...
...
@@ -79,9 +80,9 @@ public Task<bool> SendAsync(EmailMessage message)
public
bool
Send
(
EmailMessage
message
)
{
MailMessage
mail
=
new
MailMessage
();
try
{
MailMessage
mail
=
new
MailMessage
();
mail
.
From
=
new
MailAddress
(
options
.
Account
,
message
.
DisplayName
);
//多邮箱地址处理
message
.
To
.
ForEach
(
t
=>
mail
.
To
.
Add
(
t
));
...
...
@@ -92,7 +93,11 @@ public bool Send(EmailMessage message)
mail
.
IsBodyHtml
=
true
;
//设置为HTML格式
mail
.
Priority
=
MailPriority
.
Low
;
//优先级
//发送附件 指明附件的绝对地址
message
.
Attachments
.
ForEach
(
t
=>
mail
.
Attachments
.
Add
(
new
Attachment
(
t
)));
message
.
Attachments
.
ForEach
(
t
=>
{
if
(
FileHelper
.
IsExistFile
(
t
))
mail
.
Attachments
.
Add
(
new
Attachment
(
t
));
});
SmtpClient
client
=
new
SmtpClient
(
options
.
SmtpServer
,
80
);
client
.
Timeout
=
10000
;
client
.
UseDefaultCredentials
=
true
;
...
...
@@ -106,6 +111,11 @@ public bool Send(EmailMessage message)
logger
.
LogError
(
ex
.
ToString
());
throw
ex
;
}
finally
{
if
(
message
.
Attachments
.
Any
())
mail
.
Attachments
.
Dispose
();
}
}
}
...
...
performance/Performance.Services/ExtractService.cs
View file @
084b90fd
...
...
@@ -123,7 +123,7 @@ public void ExtractData(int allotId, string mail, sys_hospital hospital)
}
}
LogHelper
.
Information
(
$"基础数据提取完成,"
,
"提取绩效数据"
);
var
dpath
=
Path
.
Combine
(
environment
.
ContentRootPath
.
Substring
(
0
,
environment
.
ContentRootPath
.
LastIndexOf
(
"\\"
))
,
"Files"
,
$"
{
hospital
.
ID
}
"
,
"autoextract"
);
var
dpath
=
Path
.
Combine
(
environment
.
ContentRootPath
,
"Files"
,
$"
{
hospital
.
ID
}
"
,
"autoextract"
);
FileHelper
.
CreateDirectory
(
dpath
);
string
path
=
Path
.
Combine
(
dpath
,
$"绩效数据
{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
)}
.xlsx"
);
//根据SHEET页信息,列头信息,创建EXCEL文件
...
...
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