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
002f472e
Commit
002f472e
authored
Aug 26, 2022
by
纪旭 韦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员字典标签下载只显示开启的列头
parent
2126f8d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
17 deletions
+16
-17
performance/Performance.Api/Controllers/ReportGlobalController.cs
+4
-4
performance/Performance.Services/ReportGlobalService.cs
+12
-13
No files found.
performance/Performance.Api/Controllers/ReportGlobalController.cs
View file @
002f472e
...
...
@@ -164,8 +164,8 @@ public ApiResponse GetReportPersonTag(int hospitalId, int allotId)
var
relust
=
reportGlobalService
.
GetReportPersonTag
(
hospitalId
,
allotId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
relust
.
ColHeaders
,
relust
.
Data
relust
.
handsonTable
.
ColHeaders
,
relust
.
handsonTable
.
Data
});
}
/// <summary>
...
...
@@ -179,13 +179,13 @@ public ApiResponse GetReportPersonTag(int hospitalId, int allotId)
public
ActionResult
DownloadReportPersonTag
(
int
hospitalId
,
int
allotId
)
{
var
result
=
reportGlobalService
.
GetReportPersonTag
(
hospitalId
,
allotId
).
Data
;
var
(
result
,
colHeaders
)
=
reportGlobalService
.
GetReportPersonTag
(
hospitalId
,
allotId
)
;
var
ser
=
JsonHelper
.
Serialize
(
result
);
var
rows
=
JsonHelper
.
Deserialize
<
List
<
Dictionary
<
string
,
object
>>>(
ser
);
var
filepath
=
reportGlobalService
.
ReportPersonTagDownload
(
rows
,
"人员标签"
);
var
filepath
=
reportGlobalService
.
ReportPersonTagDownload
(
rows
,
colHeaders
,
"人员标签"
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
...
...
performance/Performance.Services/ReportGlobalService.cs
View file @
002f472e
...
...
@@ -544,7 +544,7 @@ private T GetCellValue<T>(IRow row, List<string> columns, string key)
#
region
人员、科室标签配置
public
HandsonTable
GetReportPersonTag
(
int
hospitalId
,
int
allotId
)
public
(
HandsonTable
handsonTable
,
List
<
string
>
colHeaders
)
GetReportPersonTag
(
int
hospitalId
,
int
allotId
)
{
var
hos
=
_hospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
hospitalId
);
var
columnHeaders
=
_computeService
.
CustomColumnHeaders
(
hos
,
"/result/all_employee"
);
...
...
@@ -590,7 +590,7 @@ select new
Tag5
=
t
?.
Tag5
,
}).
Distinct
()?.
ToList
();
if
(
data
==
null
||
!
data
.
Any
())
return
result
;
if
(
data
==
null
||
!
data
.
Any
())
return
(
result
,
null
)
;
var
users
=
new
List
<
sys_user
>();
if
(
hos
?.
IsOwnerQuery
==
1
)
...
...
@@ -630,10 +630,10 @@ select new
if
(
columns
.
Contains
(
t
.
Data
))
t
.
ReadOnly
=
true
;
});
return
result
;
return
(
result
,
result
.
ColHeaders
.
ToList
())
;
}
public
string
ReportPersonTagDownload
(
List
<
Dictionary
<
string
,
object
>>
rows
,
string
title
)
public
string
ReportPersonTagDownload
(
List
<
Dictionary
<
string
,
object
>>
rows
,
List
<
string
>
colHeaders
,
string
title
)
{
var
data
=
new
List
<
Dictionary
<
string
,
object
>>();
foreach
(
var
obj
in
rows
)
...
...
@@ -662,17 +662,16 @@ public string ReportPersonTagDownload(List<Dictionary<string, object>> rows, str
{
worksheet
.
SetValue
(
1
,
1
,
title
);
var
headList
=
data
.
FirstOrDefault
().
ToList
();
for
(
int
col
=
0
;
col
<
headList
.
Count
;
col
++)
for
(
int
col
=
0
;
col
<
colHeaders
.
Count
;
col
++)
{
worksheet
.
SetValue
(
2
,
col
+
1
,
headList
[
col
].
Key
);
worksheet
.
SetValue
(
2
,
col
+
1
,
colHeaders
[
col
]
);
}
for
(
int
col
=
0
;
col
<
headList
.
Count
;
col
++)
for
(
int
col
=
0
;
col
<
colHeaders
.
Count
;
col
++)
{
for
(
int
row
=
0
;
row
<
data
.
Count
();
row
++)
{
var
temp
=
data
.
ElementAt
(
row
);
var
value
=
temp
[
headList
[
col
].
Key
]
!=
null
?
temp
[
headList
[
col
].
Key
].
ToString
()
:
temp
[
headList
[
col
].
Key
];
var
value
=
temp
[
colHeaders
[
col
]]
!=
null
?
temp
[
colHeaders
[
col
]].
ToString
()
:
temp
[
colHeaders
[
col
]
];
worksheet
.
Cells
[
row
+
3
,
col
+
1
].
Value
=
value
;
}
...
...
@@ -689,10 +688,10 @@ public string ReportPersonTagDownload(List<Dictionary<string, object>> rows, str
worksheet
.
Cells
[
row
,
col
].
Style
.
HorizontalAlignment
=
ExcelHorizontalAlignment
.
Center
;
}
}
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Merge
=
true
;
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
Font
.
Bold
=
true
;
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
Font
.
Size
=
16
;
worksheet
.
Cells
[
2
,
1
,
2
,
headList
.
Count
].
Style
.
Font
.
Bold
=
true
;
worksheet
.
Cells
[
1
,
1
,
1
,
colHeaders
.
Count
].
Merge
=
true
;
worksheet
.
Cells
[
1
,
1
,
1
,
colHeaders
.
Count
].
Style
.
Font
.
Bold
=
true
;
worksheet
.
Cells
[
1
,
1
,
1
,
colHeaders
.
Count
].
Style
.
Font
.
Size
=
16
;
worksheet
.
Cells
[
2
,
1
,
2
,
colHeaders
.
Count
].
Style
.
Font
.
Bold
=
true
;
worksheet
.
Row
(
1
).
Height
=
24
;
worksheet
.
View
.
FreezePanes
(
3
,
1
);
worksheet
.
Cells
.
AutoFitColumns
();
...
...
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