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
8f2d0d65
Commit
8f2d0d65
authored
Mar 28, 2024
by
ruyun.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
签字表下载
parent
51e9dcf7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
133 additions
and
56 deletions
+133
-56
performance/Performance.Api/Controllers/ComputeController.cs
+84
-20
performance/Performance.Api/wwwroot/Performance.Api.xml
+12
-3
performance/Performance.Services/DownloadService.cs
+37
-33
No files found.
performance/Performance.Api/Controllers/ComputeController.cs
View file @
8f2d0d65
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
FluentValidation.AspNetCore
;
using
FluentValidation.AspNetCore
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Routing
;
using
Microsoft.AspNetCore.StaticFiles
;
using
Performance.DtoModels
;
using
Performance.DtoModels.Request
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Services
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
namespace
Performance.Api.Controllers
{
[
Route
(
"api/[controller]"
)]
public
class
ComputeController
:
Controller
{
private
ComputeService
_computeService
;
private
readonly
ComputeService
_computeService
;
private
readonly
DapperService
_service
;
private
AllotService
_allotService
;
private
ClaimService
_claim
;
private
EmployeeService
_employeeService
;
private
readonly
AllotService
_allotService
;
private
readonly
HospitalService
_hospitalService
;
private
readonly
ClaimService
_claim
;
private
readonly
DownloadService
downloadService
;
public
ComputeController
(
DapperService
service
,
AllotService
allotService
,
HospitalService
hospitalService
,
ComputeService
computeService
,
EmployeeService
employeeService
,
DownloadService
downloadService
,
ClaimService
claim
)
{
_service
=
service
;
_allotService
=
allotService
;
_hospitalService
=
hospitalService
;
_computeService
=
computeService
;
_employeeService
=
employeeService
;
this
.
downloadService
=
downloadService
;
_claim
=
claim
;
}
...
...
@@ -711,17 +713,37 @@ public ApiResponse GethosdataView([FromBody] ComputerRequest request)
/// 全院核算绩效发放(视图) 下载
/// </summary>
/// <param name="allotId"></param>
/// <param name="unitType"></param>
/// <param name="accountingUnit"></param>
/// <param name="content"></param>
/// <returns></returns>
[
Route
(
"gethosdataView/download/{allotId}"
)]
[
HttpPost
]
public
IActionResult
GethosdataView
(
int
allotId
)
public
IActionResult
GethosdataView
(
int
allotId
,
[
FromQuery
]
string
?
unitType
,
[
FromQuery
]
string
?
accountingUnit
,
[
FromQuery
]
string
?
content
)
{
var
allot
=
_allotService
.
GetAllot
(
allotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
_computeService
.
GetAllComputeView
(
allot
.
HospitalId
,
allotId
,
"view_allot_sign_dept"
);
var
filepath
=
downloadService
.
AllComputerViewReport
(
allotId
,
list
,
"/result/print/compute"
,
"全院核算绩效发放"
);
unitType
??=
""
;
accountingUnit
??=
""
;
content
??=
""
;
var
hospital
=
_hospitalService
.
GetHopital
(
allot
.
HospitalId
);
var
result
=
_computeService
.
GetAllComputeView
(
allot
.
HospitalId
,
allotId
,
"view_allot_sign_dept"
);
var
ser
=
JsonHelper
.
Serialize
(
result
);
var
dict
=
JsonHelper
.
Deserialize
<
List
<
Dictionary
<
string
,
object
>>>(
ser
);
var
data
=
new
List
<
Dictionary
<
string
,
object
>>();
foreach
(
var
obj
in
dict
)
{
Dictionary
<
string
,
object
>
nobj
=
new
Dictionary
<
string
,
object
>();
foreach
(
var
item
in
obj
)
{
nobj
[
item
.
Key
.
ToLower
()]
=
item
.
Value
;
}
var
values
=
nobj
.
Select
(
item
=>
item
.
Value
==
null
?
""
:
item
.
Value
.
ToString
());
if
(
values
.
Any
(
w
=>
w
.
Contains
(
unitType
))
&&
values
.
Any
(
w
=>
w
.
Contains
(
accountingUnit
))
&&
values
.
Any
(
w
=>
w
.
Contains
(
content
)))
data
.
Add
(
nobj
);
}
var
title
=
$"
{
allot
.
Year
}
年
{
allot
.
Month
}
月
{
hospital
.
HosName
}
医院 --- 全院核算绩效发放"
;
var
filepath
=
downloadService
.
AllComputerDown
(
hospital
,
data
,
"/result/print/compute"
,
title
,
"全院核算绩效发放"
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
...
...
@@ -757,17 +779,38 @@ public ApiResponse AllComputeView([FromBody] ComputerRequest request)
/// 下载全院绩效列表
/// </summary>
/// <param name="allotId"></param>
/// <param name="unitType"></param>
/// <param name="accountingUnit"></param>
/// <param name="content"></param>
/// <returns></returns>
[
Route
(
"allcomputeView/download/{allotId}"
)]
[
HttpPost
]
public
IActionResult
AllComputeViewDownload
(
int
allotId
)
public
IActionResult
AllComputeViewDownload
(
int
allotId
,
[
FromQuery
]
string
?
unitType
,
[
FromQuery
]
string
?
accountingUnit
,
[
FromQuery
]
string
?
content
)
{
var
allot
=
_allotService
.
GetAllot
(
allotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
unitType
??=
""
;
accountingUnit
??=
""
;
content
??=
""
;
var
hospital
=
_hospitalService
.
GetHopital
(
allot
.
HospitalId
);
var
result
=
_computeService
.
GetAllComputeView
(
allot
.
HospitalId
,
allotId
,
"view_allot_sign_emp"
);
var
list
=
_computeService
.
GetAllComputeView
(
allot
.
HospitalId
,
allotId
,
"view_allot_sign_emp"
);
var
filepath
=
downloadService
.
AllComputerViewReport
(
allotId
,
list
,
"/result/compute"
,
"全院绩效发放"
);
var
ser
=
JsonHelper
.
Serialize
(
result
);
var
dict
=
JsonHelper
.
Deserialize
<
List
<
Dictionary
<
string
,
object
>>>(
ser
);
var
data
=
new
List
<
Dictionary
<
string
,
object
>>();
foreach
(
var
obj
in
dict
)
{
Dictionary
<
string
,
object
>
nobj
=
new
Dictionary
<
string
,
object
>();
foreach
(
var
item
in
obj
)
{
nobj
[
item
.
Key
.
ToLower
()]
=
item
.
Value
;
}
var
values
=
nobj
.
Select
(
item
=>
item
.
Value
==
null
?
""
:
item
.
Value
.
ToString
());
if
(
values
.
Any
(
w
=>
w
.
Contains
(
unitType
))
&&
values
.
Any
(
w
=>
w
.
Contains
(
accountingUnit
))
&&
values
.
Any
(
w
=>
w
.
Contains
(
content
)))
data
.
Add
(
nobj
);
}
var
title
=
$"
{
allot
.
Year
}
年
{
allot
.
Month
}
月
{
hospital
.
HosName
}
医院 --- 全院绩效发放"
;
var
filepath
=
downloadService
.
AllComputerDown
(
hospital
,
data
,
"/result/compute"
,
title
,
"全院绩效发放"
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
...
...
@@ -807,17 +850,38 @@ public ApiResponse AllComputeViewByPM([FromBody] ComputerRequest request)
/// 下载全院绩效列表(人事科)
/// </summary>
/// <param name="allotId"></param>
/// <param name="unitType"></param>
/// <param name="accountingUnit"></param>
/// <param name="content"></param>
/// <returns></returns>
[
Route
(
"allcomputeView/personnel/download/{allotId}"
)]
[
HttpPost
]
public
IActionResult
AllComputeByPMViewDownLoad
(
int
allotId
)
public
IActionResult
AllComputeByPMViewDownLoad
(
int
allotId
,
[
FromQuery
]
string
?
unitType
,
[
FromQuery
]
string
?
accountingUnit
,
[
FromQuery
]
string
?
content
)
{
var
allot
=
_allotService
.
GetAllot
(
allotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
hospital
=
_hospitalService
.
GetHopital
(
allot
.
HospitalId
);
unitType
??=
""
;
accountingUnit
??=
""
;
content
??=
""
;
var
result
=
_computeService
.
GetAllComputeView
(
allot
.
HospitalId
,
allotId
,
"view_allot_sign_emp_finance"
);
var
filepath
=
downloadService
.
AllComputerViewReport
(
allotId
,
result
,
"/result/wholehospital"
,
"财务全院绩效发放"
);
var
ser
=
JsonHelper
.
Serialize
(
result
);
var
dict
=
JsonHelper
.
Deserialize
<
List
<
Dictionary
<
string
,
object
>>>(
ser
);
var
data
=
new
List
<
Dictionary
<
string
,
object
>>();
foreach
(
var
obj
in
dict
)
{
Dictionary
<
string
,
object
>
nobj
=
new
Dictionary
<
string
,
object
>();
foreach
(
var
item
in
obj
)
{
nobj
[
item
.
Key
.
ToLower
()]
=
item
.
Value
;
}
var
values
=
nobj
.
Select
(
item
=>
item
.
Value
==
null
?
""
:
item
.
Value
.
ToString
());
if
(
values
.
Any
(
w
=>
w
.
Contains
(
unitType
))
&&
values
.
Any
(
w
=>
w
.
Contains
(
accountingUnit
))
&&
values
.
Any
(
w
=>
w
.
Contains
(
content
)))
data
.
Add
(
nobj
);
}
var
title
=
$"
{
allot
.
Year
}
年
{
allot
.
Month
}
月
{
hospital
.
HosName
}
医院 --- 财务全院绩效发放"
;
var
filepath
=
downloadService
.
AllComputerDown
(
hospital
,
data
,
"/result/wholehospital"
,
title
,
"财务全院绩效发放"
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
8f2d0d65
...
...
@@ -1227,11 +1227,14 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.GethosdataView(System.Int32)"
>
<member
name=
"M:Performance.Api.Controllers.ComputeController.GethosdataView(System.Int32
,System.String,System.String,System.String
)"
>
<summary>
全院核算绩效发放(视图) 下载
</summary>
<param
name=
"allotId"
></param>
<param
name=
"unitType"
></param>
<param
name=
"accountingUnit"
></param>
<param
name=
"content"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.AllComputeView(Performance.DtoModels.ComputerRequest)"
>
...
...
@@ -1241,11 +1244,14 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.AllComputeViewDownload(System.Int32)"
>
<member
name=
"M:Performance.Api.Controllers.ComputeController.AllComputeViewDownload(System.Int32
,System.String,System.String,System.String
)"
>
<summary>
下载全院绩效列表
</summary>
<param
name=
"allotId"
></param>
<param
name=
"unitType"
></param>
<param
name=
"accountingUnit"
></param>
<param
name=
"content"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.AllComputeViewByPM(Performance.DtoModels.ComputerRequest)"
>
...
...
@@ -1255,11 +1261,14 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.AllComputeByPMViewDownLoad(System.Int32)"
>
<member
name=
"M:Performance.Api.Controllers.ComputeController.AllComputeByPMViewDownLoad(System.Int32
,System.String,System.String,System.String
)"
>
<summary>
下载全院绩效列表(人事科)
</summary>
<param
name=
"allotId"
></param>
<param
name=
"unitType"
></param>
<param
name=
"accountingUnit"
></param>
<param
name=
"content"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetDrugtypeList(Performance.DtoModels.DrugpropRequest)"
>
...
...
performance/Performance.Services/DownloadService.cs
View file @
8f2d0d65
...
...
@@ -213,7 +213,11 @@ public string AllComputerDown(sys_hospital hospital, List<dynamic> dynamics, str
}
data
.
Add
(
nobj
);
}
return
AllComputerDown
(
hospital
,
data
,
route
,
title
,
name
,
headlist
);
}
public
string
AllComputerDown
(
sys_hospital
hospital
,
List
<
Dictionary
<
string
,
object
>>
data
,
string
route
,
string
title
,
string
name
,
params
string
[]
headlist
)
{
var
headList
=
_computeService
.
CustomColumnHeaders
(
hospital
.
ID
,
route
,
headlist
).
Where
(
w
=>
w
.
States
==
1
).
ToList
();
var
dpath
=
Path
.
Combine
(
evn
.
ContentRootPath
,
"Files"
,
"PerformanceRelease"
,
$"
{
hospital
.
ID
}
"
);
...
...
@@ -226,16 +230,16 @@ public string AllComputerDown(sys_hospital hospital, List<dynamic> dynamics, str
using
(
ExcelPackage
package
=
new
ExcelPackage
(
fs
))
{
var
worksheet
=
package
.
Workbook
.
Worksheets
.
Add
(
name
);
worksheet
.
SetValue
(
1
,
1
,
title
);
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Merge
=
true
;
if
(
dynamics
!=
null
&&
dynamics
.
Count
()
>
0
)
for
(
int
col
=
0
;
col
<
headList
.
Count
;
col
++
)
{
worksheet
.
SetValue
(
1
,
1
,
title
);
worksheet
.
SetValue
(
2
,
col
+
1
,
headList
[
col
].
Alias
);
}
var
headers
=
((
IDictionary
<
string
,
object
>)
dynamics
.
ElementAt
(
0
)).
Keys
;
for
(
int
col
=
0
;
col
<
headList
.
Count
;
col
++)
{
worksheet
.
SetValue
(
2
,
col
+
1
,
headList
[
col
].
Alias
);
}
if
(
data
!=
null
&&
data
.
Count
()
>
0
)
{
for
(
int
col
=
0
;
col
<
headList
.
Count
;
col
++)
{
for
(
int
row
=
0
;
row
<
data
.
Count
();
row
++)
...
...
@@ -246,42 +250,42 @@ public string AllComputerDown(sys_hospital hospital, List<dynamic> dynamics, str
worksheet
.
Cells
[
row
+
3
,
col
+
1
].
Value
=
value
;
}
if
(
col
==
0
)
worksheet
.
SetValue
(
d
ynamics
.
Count
()
+
3
,
col
+
1
,
"合计"
);
worksheet
.
SetValue
(
d
ata
.
Count
()
+
3
,
col
+
1
,
"合计"
);
else
if
(!
notSum
.
Contains
(
headList
[
col
].
Name
.
ToLower
()))
worksheet
.
Cells
[
d
ynamics
.
Count
()
+
3
,
col
+
1
].
Formula
=
string
.
Format
(
"SUM({0})"
,
new
ExcelAddress
(
3
,
col
+
1
,
dynamics
.
Count
()
+
2
,
col
+
1
).
Address
);
worksheet
.
Cells
[
d
ata
.
Count
()
+
3
,
col
+
1
].
Formula
=
string
.
Format
(
"SUM({0})"
,
new
ExcelAddress
(
3
,
col
+
1
,
data
.
Count
()
+
2
,
col
+
1
).
Address
);
}
#
region
样式设置
for
(
int
row
=
worksheet
.
Dimension
.
Start
.
Row
;
row
<=
worksheet
.
Dimension
.
End
.
Row
;
row
++)
{
worksheet
.
Row
(
row
).
Height
=
20
;
for
(
int
col
=
worksheet
.
Dimension
.
Start
.
Column
;
col
<=
worksheet
.
Dimension
.
End
.
Column
;
col
++)
{
if
(
headList
.
Count
<
col
&&
!
notSum
.
Contains
(
headList
[
col
-
1
].
Name
.
ToLower
()))
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
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
VerticalAlignment
=
ExcelVerticalAlignment
.
Center
;
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
HorizontalAlignment
=
ExcelHorizontalAlignment
.
Center
;
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
Font
.
Bold
=
true
;
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
Font
.
Size
=
16
;
worksheet
.
Row
(
1
).
Height
=
24
;
worksheet
.
Cells
[
2
,
1
,
2
,
headList
.
Count
].
Style
.
Font
.
Bold
=
true
;
worksheet
.
View
.
FreezePanes
(
3
,
1
);
worksheet
.
Cells
.
AutoFitColumns
();
}
#
region
样式设置
for
(
int
row
=
worksheet
.
Dimension
.
Start
.
Row
;
row
<=
worksheet
.
Dimension
.
End
.
Row
;
row
++)
{
worksheet
.
Row
(
row
).
Height
=
20
;
for
(
int
col
=
worksheet
.
Dimension
.
Start
.
Column
;
col
<=
worksheet
.
Dimension
.
End
.
Column
;
col
++)
{
worksheet
.
Column
(
col
).
Width
=
worksheet
.
Column
(
col
).
Width
>
20
?
20
:
worksheet
.
Column
(
col
).
Width
;
if
(
headList
.
Count
<
col
&&
!
notSum
.
Contains
(
headList
[
col
-
1
].
Name
.
ToLower
()))
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
;
}
#
endregion
}
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
VerticalAlignment
=
ExcelVerticalAlignment
.
Center
;
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
HorizontalAlignment
=
ExcelHorizontalAlignment
.
Center
;
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
Font
.
Bold
=
true
;
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
Font
.
Size
=
16
;
worksheet
.
Row
(
1
).
Height
=
24
;
worksheet
.
Cells
[
2
,
1
,
2
,
headList
.
Count
].
Style
.
Font
.
Bold
=
true
;
worksheet
.
View
.
FreezePanes
(
3
,
1
);
worksheet
.
Cells
.
AutoFitColumns
();
for
(
int
col
=
worksheet
.
Dimension
.
Start
.
Column
;
col
<=
worksheet
.
Dimension
.
End
.
Column
;
col
++)
{
worksheet
.
Column
(
col
).
Width
=
worksheet
.
Column
(
col
).
Width
>
20
?
20
:
worksheet
.
Column
(
col
).
Width
;
}
#
endregion
package
.
Save
();
}
return
filepath
;
}
public
string
ExcelDownload
(
List
<
Dictionary
<
string
,
object
>>
rows
,
string
name
,
List
<
ExcelDownloadHeads
>
excelDownloadHeads
,
string
[]
notSum
,
string
[]
ignoreColumns
)
{
var
dpath
=
Path
.
Combine
(
evn
.
ContentRootPath
,
"Files"
,
"PerformanceRelease"
);
...
...
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