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
0e7acd0c
Commit
0e7acd0c
authored
Apr 21, 2023
by
ruyun.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交验证,下载修改为统一样式
parent
43e9ea87
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
16 deletions
+6
-16
performance/Performance.Api/Controllers/AttendanceController.cs
+6
-16
performance/Performance.Services/AttendanceService.cs
+0
-0
No files found.
performance/Performance.Api/Controllers/AttendanceController.cs
View file @
0e7acd0c
...
...
@@ -812,29 +812,19 @@ public ApiResponse<AttendanceDeptDetail> DeptDetail(int allotId, string unitType
/// <param name="unitType">核算组别</param>
/// <param name="accountingUnit">核算单元</param>
/// <param name="searchTxet">工号/姓名</param>
/// <param name="fileName"></param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"dept/detail/download"
)]
public
IActionResult
DeptDetailDownload
(
int
allotId
,
string
unitType
,
string
accountingUnit
,
string
searchTxet
,
string
?
fileName
)
public
IActionResult
DeptDetailDownload
(
int
allotId
,
string
unitType
,
string
accountingUnit
,
string
searchTxet
)
{
fileName
=
string
.
IsNullOrWhiteSpace
(
fileName
)
?
"考勤上报审核结果"
:
Path
.
GetFileNameWithoutExtension
(
fileName
);
var
dpath
=
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"Files"
);
if
(!
Directory
.
Exists
(
dpath
))
Directory
.
CreateDirectory
(
dpath
);
string
filepath
=
Path
.
Combine
(
dpath
,
$"
{
fileName
}{
DateTime
.
Now
:
yyyy
年
MM
月
dd
日
}
.xlsx"
);
if
(!
Enum
.
TryParse
(
unitType
,
out
UnitType
unitType1
))
throw
new
PerformanceException
(
"核算组别错误"
);
var
res
=
_attendanceService
.
DeptDetail
(
allotId
,
unitType
,
accountingUnit
,
searchTxet
);
var
config
=
new
ExcelDownloadRequest
()
{
Name
=
"考勤上报审核结果"
};
if
(
res
.
State
==
ResponseType
.
OK
)
{
var
items
=
JsonHelper
.
Deserialize
<
List
<
Dictionary
<
string
,
object
>>>(
JsonHelper
.
Serialize
(
res
.
Data
.
Data
));
config
.
Rows
=
items
;
var
columns
=
res
.
Data
.
Columns
.
Select
(
w
=>
new
EColumn
(
w
.
Title
,
w
.
Field
));
config
.
Columns
=
columns
;
}
var
heads
=
res
.
Data
.
Columns
.
Select
(
w
=>
new
ExcelDownloadHeads
{
Alias
=
w
.
Title
,
Name
=
w
.
Field
}).
ToList
();
var
rows
=
JsonHelper
.
Deserialize
<
List
<
Dictionary
<
string
,
object
>>>(
JsonHelper
.
Serialize
(
res
.
Data
.
Data
));
UtilExtensions
.
Export
(
filepath
,
config
);
var
filepath
=
_attendanceService
.
ExcelDownload
(
rows
,
"科室考勤上报结果详情"
,
allotId
,
heads
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
...
...
performance/Performance.Services/AttendanceService.cs
View file @
0e7acd0c
This diff is collapsed.
Click to expand it.
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