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
83de9ea4
Commit
83de9ea4
authored
Apr 14, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下载接口
parent
b2907b7d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
119 additions
and
0 deletions
+119
-0
performance/Performance.Api/Controllers/AttendanceController.cs
+91
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+28
-0
No files found.
performance/Performance.Api/Controllers/AttendanceController.cs
View file @
83de9ea4
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.StaticFiles
;
using
Performance.DtoModels
;
using
Performance.EntityModels.Entity
;
using
Performance.EntityModels.Other
;
using
Performance.Services
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
namespace
Performance.Api.Controllers
{
...
...
@@ -184,5 +187,93 @@ public ApiResponse<List<AttendanceStatistics>> GetAttendanceStatistics(int allot
// 返回结果参考接口 employee/apr/getdeptdetail
return
_attendanceService
.
GetAttendanceStatistics
(
allotId
);
}
#
region
下载
/// <summary>
/// 初始考勤记录下载
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"download/attendance/{allotId}"
)]
public
IActionResult
DownloadAttendance
(
int
allotId
)
{
var
path
=
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"Template"
,
"医院人员绩效模板.xlsx"
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
path
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
path
));
}
/// <summary>
/// 考勤记录下载
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"download/vacation/{allotId}"
)]
public
IActionResult
DownloadVacation
(
int
allotId
)
{
var
path
=
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"Template"
,
"医院人员绩效模板.xlsx"
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
path
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
path
));
}
/// <summary>
/// 调动记录下载
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"download/callin/{allotId}"
)]
public
IActionResult
DownloadCallIn
(
int
allotId
)
{
var
path
=
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"Template"
,
"医院人员绩效模板.xlsx"
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
path
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
path
));
}
/// <summary>
/// 生成最总考勤结果下载
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"download/statistics/{allotId}"
)]
public
IActionResult
DownloadStatistics
(
int
allotId
)
{
var
path
=
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"Template"
,
"医院人员绩效模板.xlsx"
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
path
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
path
));
}
#
endregion
}
}
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
83de9ea4
...
...
@@ -403,6 +403,34 @@
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.DownloadAttendance(System.Int32)"
>
<summary>
初始考勤记录下载
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.DownloadVacation(System.Int32)"
>
<summary>
考勤记录下载
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.DownloadCallIn(System.Int32)"
>
<summary>
调动记录下载
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.DownloadStatistics(System.Int32)"
>
<summary>
生成最总考勤结果下载
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.BudgetController.Query(Performance.DtoModels.Request.BudgetRequest)"
>
<summary>
预算管理查询(包含金额、占比)
...
...
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