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
e578045e
Commit
e578045e
authored
Feb 24, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文件上传添加文件格式判断
parent
37780167
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
0 deletions
+19
-0
performance/Performance.Api/Controllers/AgainAllotController.cs
+4
-0
performance/Performance.Api/Controllers/EmployeeController.cs
+4
-0
performance/Performance.Api/Controllers/HistoryController.cs
+4
-0
performance/Performance.Api/Controllers/ReportGlobalController.cs
+4
-0
performance/Performance.Api/Controllers/TemplateController.cs
+3
-0
No files found.
performance/Performance.Api/Controllers/AgainAllotController.cs
View file @
e578045e
...
...
@@ -11,6 +11,7 @@
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Services
;
using
Performance.Services.ExtractExcelService
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
...
...
@@ -85,6 +86,9 @@ public ApiResponse Import([FromForm] IFormCollection form)
if
(
file
==
null
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"参数错误"
,
"文件无效"
);
if
(!
ExtractHelper
.
IsXlsxFile
(
file
.
FileName
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"文件格式错误"
,
"文件暂只支持xlsx文件"
);
var
again
=
againAllotService
.
GetAgainallot
(
againid
);
if
(
again
==
null
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"二次绩效记录不存在"
);
...
...
performance/Performance.Api/Controllers/EmployeeController.cs
View file @
e578045e
...
...
@@ -7,6 +7,7 @@
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Services
;
using
Performance.Services.ExtractExcelService
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
...
...
@@ -407,6 +408,9 @@ public ApiResponse Import([FromForm] IFormCollection form)
if
(
file
==
null
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"参数错误"
,
"文件无效"
);
if
(!
ExtractHelper
.
IsXlsxFile
(
file
.
FileName
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"文件格式错误"
,
"文件暂只支持xlsx文件"
);
var
allot
=
allotService
.
GetAllot
(
allotid
);
if
(
allot
==
null
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"allotid不存在"
);
...
...
performance/Performance.Api/Controllers/HistoryController.cs
View file @
e578045e
...
...
@@ -10,6 +10,7 @@
using
Performance.DtoModels
;
using
Performance.Infrastructure
;
using
Performance.Services
;
using
Performance.Services.ExtractExcelService
;
namespace
Performance.Api.Controllers
{
...
...
@@ -47,6 +48,9 @@ public ApiResponse Import([FromForm] IFormCollection form)
if
(
file
==
null
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"参数错误"
,
"文件无效"
);
if
(!
ExtractHelper
.
IsXlsxFile
(
file
.
FileName
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"文件格式错误"
,
"文件暂只支持xlsx文件"
);
var
name
=
$"History_
{
FileHelper
.
GetFileNameNoExtension
(
file
.
FileName
)}{
DateTime
.
Now
:
yyyyMMddHHmmssfff
}
"
;
var
ext
=
FileHelper
.
GetExtension
(
file
.
FileName
);
var
dpath
=
Path
.
Combine
(
evn
.
ContentRootPath
,
"Files"
,
hospitalid
.
ToString
());
...
...
performance/Performance.Api/Controllers/ReportGlobalController.cs
View file @
e578045e
...
...
@@ -6,6 +6,7 @@
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Services
;
using
Performance.Services.ExtractExcelService
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
...
...
@@ -103,6 +104,9 @@ public ApiResponse Import(int hospitalId, [FromForm] IFormCollection form)
if
(
file
==
null
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"参数错误"
,
"文件无效"
);
if
(!
ExtractHelper
.
IsXlsxFile
(
file
.
FileName
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"文件格式错误"
,
"文件暂只支持xlsx文件"
);
var
name
=
FileHelper
.
GetFileNameNoExtension
(
file
.
FileName
)
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
var
ext
=
FileHelper
.
GetExtension
(
file
.
FileName
);
var
dpath
=
Path
.
Combine
(
env
.
ContentRootPath
,
"Files"
,
$"
{
hospitalId
}
"
,
$"ImportDataFiles"
);
...
...
performance/Performance.Api/Controllers/TemplateController.cs
View file @
e578045e
...
...
@@ -129,6 +129,9 @@ public ApiResponse Import([FromForm] IFormCollection form)
if
(
file
==
null
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"参数错误"
,
"文件无效"
);
if
(!
ExtractHelper
.
IsXlsxFile
(
file
.
FileName
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"文件格式错误"
,
"文件暂只支持xlsx文件"
);
var
hospital
=
hospitalService
.
GetHopital
(
hospitalid
);
if
(
hospital
==
null
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"hospitalid不存在"
);
...
...
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