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
a8f6ea6d
Commit
a8f6ea6d
authored
Dec 16, 2021
by
纪旭 韦
Browse files
Options
Browse Files
Download
Plain Diff
修改下载时excel顶部时间显示
parents
235e54d3
3bf7c507
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
15 deletions
+19
-15
performance/Performance.Api/Controllers/ReportController.cs
+7
-7
performance/Performance.Services/DownloadService.cs
+12
-8
No files found.
performance/Performance.Api/Controllers/ReportController.cs
View file @
a8f6ea6d
...
@@ -291,10 +291,10 @@ public ApiResponse GetAllComputeView([FromBody] BeginEndTime request)
...
@@ -291,10 +291,10 @@ public ApiResponse GetAllComputeView([FromBody] BeginEndTime request)
var
date
=
_computeService
.
performanceImposeDate
(
request
.
BeginTime
,
request
.
EndTime
);
var
date
=
_computeService
.
performanceImposeDate
(
request
.
BeginTime
,
request
.
EndTime
);
var
datas
=
_computeService
.
GetAllComputeViewByDate
(
"view_allot_sign_emp"
,
date
.
BeginTime
,
date
.
EndTime
);
var
datas
=
_computeService
.
GetAllComputeViewByDate
(
"view_allot_sign_emp"
,
date
.
BeginTime
,
date
.
EndTime
);
if
(
null
==
datas
)
if
(
null
==
datas
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
new
QueryComputeByDateGetPage
var
list
=
new
QueryComputeByDateGetPage
{
{
Data
=
datas
.
Skip
((
request
.
CurrentPage
-
1
)
*
request
.
PageSize
).
Take
(
request
.
PageSize
).
ToList
(),
Data
=
datas
.
Skip
((
request
.
CurrentPage
-
1
)
*
request
.
PageSize
).
Take
(
request
.
PageSize
).
ToList
(),
TotalData
=
_computeService
.
SumDatas
(
datas
),
TotalData
=
_computeService
.
SumDatas
(
datas
),
...
@@ -324,7 +324,7 @@ public IActionResult AllComputeViewDownload([FromBody] BeginEndTimeDown request)
...
@@ -324,7 +324,7 @@ public IActionResult AllComputeViewDownload([FromBody] BeginEndTimeDown request)
if
(
null
==
list
)
if
(
null
==
list
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
filepath
=
downloadService
.
AllComputerViewReportByDate
(
request
.
HospitalId
,
list
,
"/report/wholehospital_grant"
,
"全院绩效发放"
);
var
filepath
=
downloadService
.
AllComputerViewReportByDate
(
request
.
HospitalId
,
list
,
"/report/wholehospital_grant"
,
"全院绩效发放"
,
date
);
var
memoryStream
=
new
MemoryStream
();
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
...
@@ -385,7 +385,7 @@ public IActionResult GethosdataView([FromBody] BeginEndTimeDown request)
...
@@ -385,7 +385,7 @@ public IActionResult GethosdataView([FromBody] BeginEndTimeDown request)
if
(
null
==
list
)
if
(
null
==
list
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
filepath
=
downloadService
.
AllComputerViewReportByDate
(
request
.
HospitalId
,
list
,
"/report/wholehospital_accounting_grant"
,
"全院核算绩效发放"
);
var
filepath
=
downloadService
.
AllComputerViewReportByDate
(
request
.
HospitalId
,
list
,
"/report/wholehospital_accounting_grant"
,
"全院核算绩效发放"
,
date
);
var
memoryStream
=
new
MemoryStream
();
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
...
@@ -415,8 +415,8 @@ public ApiResponse AllComputeViewByPM([FromBody] BeginEndTime request)
...
@@ -415,8 +415,8 @@ public ApiResponse AllComputeViewByPM([FromBody] BeginEndTime request)
if
(
null
==
datas
)
if
(
null
==
datas
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
new
QueryComputeByDateGetPage
var
list
=
new
QueryComputeByDateGetPage
{
{
Data
=
datas
.
Skip
((
request
.
CurrentPage
-
1
)
*
request
.
PageSize
).
Take
(
request
.
PageSize
).
ToList
(),
Data
=
datas
.
Skip
((
request
.
CurrentPage
-
1
)
*
request
.
PageSize
).
Take
(
request
.
PageSize
).
ToList
(),
TotalData
=
_computeService
.
SumDatas
(
datas
),
TotalData
=
_computeService
.
SumDatas
(
datas
),
...
@@ -446,7 +446,7 @@ public IActionResult AllComputeByPMViewDownLoad([FromBody] BeginEndTimeDown requ
...
@@ -446,7 +446,7 @@ public IActionResult AllComputeByPMViewDownLoad([FromBody] BeginEndTimeDown requ
if
(
null
==
list
)
if
(
null
==
list
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
filepath
=
downloadService
.
AllComputerViewReportByDate
(
request
.
HospitalId
,
list
,
"/report/wholehospital_finance_grant"
,
"财务全院绩效发放"
);
var
filepath
=
downloadService
.
AllComputerViewReportByDate
(
request
.
HospitalId
,
list
,
"/report/wholehospital_finance_grant"
,
"财务全院绩效发放"
,
date
);
var
memoryStream
=
new
MemoryStream
();
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
...
...
performance/Performance.Services/DownloadService.cs
View file @
a8f6ea6d
...
@@ -181,7 +181,8 @@ public string AllComputerViewReport(int allotId, List<dynamic> dynamics, string
...
@@ -181,7 +181,8 @@ public string AllComputerViewReport(int allotId, List<dynamic> dynamics, string
{
{
var
allot
=
perallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
var
allot
=
perallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
var
hospital
=
perforHospital
.
GetEntity
(
t
=>
t
.
ID
==
allot
.
HospitalId
);
var
hospital
=
perforHospital
.
GetEntity
(
t
=>
t
.
ID
==
allot
.
HospitalId
);
return
AllComputerDown
(
hospital
,
dynamics
,
route
,
name
);
var
title
=
$"
{
allot
.
Year
}
年
{
allot
.
Month
}
月
{
hospital
.
HosName
}
医院 ---
{
name
}
"
;
return
AllComputerDown
(
hospital
,
dynamics
,
route
,
title
,
name
);
}
}
/// <summary>
/// <summary>
/// 财务、全院绩效发放下载(时间段)
/// 财务、全院绩效发放下载(时间段)
...
@@ -190,18 +191,21 @@ public string AllComputerViewReport(int allotId, List<dynamic> dynamics, string
...
@@ -190,18 +191,21 @@ public string AllComputerViewReport(int allotId, List<dynamic> dynamics, string
/// <param name="allData"></param>
/// <param name="allData"></param>
/// <param name="isAll"></param>
/// <param name="isAll"></param>
/// <returns></returns>
/// <returns></returns>
public
string
AllComputerViewReportByDate
(
int
HospitalId
,
List
<
dynamic
>
dynamics
,
string
route
,
string
nam
e
)
public
string
AllComputerViewReportByDate
(
int
hospitalId
,
List
<
dynamic
>
dynamics
,
string
route
,
string
name
,
BeginEndTime
dat
e
)
{
{
var
hospital
=
perforHospital
.
GetEntity
(
t
=>
t
.
ID
==
HospitalId
);
var
hospital
=
perforHospital
.
GetEntity
(
t
=>
t
.
ID
==
hospitalId
);
return
AllComputerDown
(
hospital
,
dynamics
,
route
,
name
);
var
title
=
$"
{
date
.
BeginTime
}
至
{
date
.
EndTime
}
{
hospital
.
HosName
}
医院 ---
{
name
}
"
;
return
AllComputerDown
(
hospital
,
dynamics
,
route
,
title
,
name
);
}
}
public
string
AllComputerDown
(
sys_hospital
hospital
,
List
<
dynamic
>
dynamics
,
string
rout
e
,
string
name
)
public
string
AllComputerDown
(
sys_hospital
hospital
,
List
<
dynamic
>
dynamics
,
string
route
,
string
titl
e
,
string
name
)
{
{
var
headList
=
_computeService
.
CustomColumnHeaders
(
hospital
.
ID
,
route
).
Where
(
w
=>
w
.
States
==
1
).
ToList
();
var
headList
=
_computeService
.
CustomColumnHeaders
(
hospital
.
ID
,
route
).
Where
(
w
=>
w
.
States
==
1
).
ToList
();
var
dpath
=
Path
.
Combine
(
evn
.
ContentRootPath
,
"Files"
,
"PerformanceRelease"
,
$"
{
hospital
.
ID
}
"
);
var
dpath
=
Path
.
Combine
(
evn
.
ContentRootPath
,
"Files"
,
"PerformanceRelease"
,
$"
{
hospital
.
ID
}
"
);
FileHelper
.
CreateDirectory
(
dpath
);
FileHelper
.
CreateDirectory
(
dpath
);
string
filepath
=
Path
.
Combine
(
dpath
,
$"
{
hospital
.
HosName
}
-
{
name
}
-
{
DateTime
.
Now
:
yyyy
年
MM
月
dd
日
}
"
);
string
filepath
=
Path
.
Combine
(
dpath
,
$"
{
hospital
.
HosName
}
-
{
name
}
-
{
DateTime
.
Now
:
yyyy
年
MM
月
dd
日
}
"
);
FileHelper
.
DeleteFile
(
filepath
);
FileHelper
.
DeleteFile
(
filepath
);
string
[]
notSum
=
new
string
[]
{
"year"
,
"month"
};
using
(
FileStream
fs
=
new
FileStream
(
filepath
,
FileMode
.
OpenOrCreate
))
using
(
FileStream
fs
=
new
FileStream
(
filepath
,
FileMode
.
OpenOrCreate
))
using
(
ExcelPackage
package
=
new
ExcelPackage
(
fs
))
using
(
ExcelPackage
package
=
new
ExcelPackage
(
fs
))
{
{
...
@@ -209,7 +213,7 @@ public string AllComputerDown(sys_hospital hospital,List<dynamic> dynamics, stri
...
@@ -209,7 +213,7 @@ public string AllComputerDown(sys_hospital hospital,List<dynamic> dynamics, stri
if
(
dynamics
!=
null
&&
dynamics
.
Count
()
>
0
)
if
(
dynamics
!=
null
&&
dynamics
.
Count
()
>
0
)
{
{
worksheet
.
SetValue
(
1
,
1
,
$"
{
allot
.
Year
}
年
{
allot
.
Month
}
月
{
hospital
.
HosName
}
医院 ---
{
name
}
"
);
worksheet
.
SetValue
(
1
,
1
,
title
);
var
headers
=
((
IDictionary
<
string
,
object
>)
dynamics
.
ElementAt
(
0
)).
Keys
;
var
headers
=
((
IDictionary
<
string
,
object
>)
dynamics
.
ElementAt
(
0
)).
Keys
;
for
(
int
col
=
0
;
col
<
headList
.
Count
;
col
++)
for
(
int
col
=
0
;
col
<
headList
.
Count
;
col
++)
...
@@ -228,7 +232,7 @@ public string AllComputerDown(sys_hospital hospital,List<dynamic> dynamics, stri
...
@@ -228,7 +232,7 @@ public string AllComputerDown(sys_hospital hospital,List<dynamic> dynamics, stri
}
}
if
(
col
==
0
)
if
(
col
==
0
)
worksheet
.
SetValue
(
dynamics
.
Count
()
+
2
,
col
+
1
,
"合计"
);
worksheet
.
SetValue
(
dynamics
.
Count
()
+
2
,
col
+
1
,
"合计"
);
else
else
if
(!
notSum
.
Contains
(
headList
[
col
].
Name
.
ToLower
()))
worksheet
.
Cells
[
dynamics
.
Count
()
+
2
,
col
+
1
].
Formula
=
string
.
Format
(
"SUM({0})"
,
new
ExcelAddress
(
2
,
col
+
1
,
dynamics
.
Count
()
+
1
,
col
+
1
).
Address
);
worksheet
.
Cells
[
dynamics
.
Count
()
+
2
,
col
+
1
].
Formula
=
string
.
Format
(
"SUM({0})"
,
new
ExcelAddress
(
2
,
col
+
1
,
dynamics
.
Count
()
+
1
,
col
+
1
).
Address
);
}
}
...
@@ -238,8 +242,8 @@ public string AllComputerDown(sys_hospital hospital,List<dynamic> dynamics, stri
...
@@ -238,8 +242,8 @@ public string AllComputerDown(sys_hospital hospital,List<dynamic> dynamics, stri
worksheet
.
Row
(
row
).
Height
=
20
;
worksheet
.
Row
(
row
).
Height
=
20
;
for
(
int
col
=
worksheet
.
Dimension
.
Start
.
Column
;
col
<=
worksheet
.
Dimension
.
End
.
Column
;
col
++)
for
(
int
col
=
worksheet
.
Dimension
.
Start
.
Column
;
col
<=
worksheet
.
Dimension
.
End
.
Column
;
col
++)
{
{
worksheet
.
Cells
[
row
,
col
].
Style
.
Border
.
BorderAround
(
ExcelBorderStyle
.
Thin
);
worksheet
.
Cells
[
row
,
col
].
Style
.
Numberformat
.
Format
=
"#,##0.00"
;
worksheet
.
Cells
[
row
,
col
].
Style
.
Numberformat
.
Format
=
"#,##0.00"
;
worksheet
.
Cells
[
row
,
col
].
Style
.
Border
.
BorderAround
(
ExcelBorderStyle
.
Thin
);
worksheet
.
Cells
[
row
,
col
].
Style
.
VerticalAlignment
=
ExcelVerticalAlignment
.
Center
;
worksheet
.
Cells
[
row
,
col
].
Style
.
VerticalAlignment
=
ExcelVerticalAlignment
.
Center
;
}
}
}
}
...
...
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