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
11e4627b
Commit
11e4627b
authored
Apr 28, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提取优化
parent
ec9077c3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
84 deletions
+78
-84
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
+39
-48
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+39
-36
No files found.
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
View file @
11e4627b
This diff is collapsed.
Click to expand it.
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
11e4627b
...
...
@@ -309,44 +309,47 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, int allotId, List<
t
.
HISDeptName
=
WriteDataHelper
.
HasValue
(
t
.
HISDeptName
,
t
.
Department
);
});
var
data
=
results
.
GroupJoin
(
dict
,
outer
=>
new
{
Department
=
outer
.
Department
},
inner
=>
new
{
Department
=
inner
.
HISDeptName
},
(
outer
,
inner
)
=>
new
{
outer
,
inner
})
.
Select
(
t
=>
var
data
=
new
List
<
ExtractTransDto
>();
foreach
(
var
item
in
results
)
{
var
firstDic
=
dict
.
FirstOrDefault
(
w
=>
w
.
HISDeptName
==
item
.
Department
)
??
dict
.
FirstOrDefault
(
w
=>
w
.
Department
==
item
.
Department
);
var
dept
=
!
string
.
IsNullOrEmpty
(
firstDic
?.
Department
)
?
firstDic
?.
Department
:
item
.
Department
;
var
d
=
new
ExtractTransDto
{
var
dept
=
!
string
.
IsNullOrEmpty
(
t
.
inner
.
FirstOrDefault
()?.
Department
)
?
t
.
inner
.
FirstOrDefault
()?.
Department
:
t
.
outer
.
Department
;
return
new
ExtractTransDto
{
SheetName
=
t
.
outer
.
Source
,
Department
=
dept
,
Category
=
t
.
outer
.
Category
,
DoctorName
=
t
.
outer
.
DoctorName
,
PersonnelNumber
=
t
.
outer
.
PersonnelNumber
,
Value
=
t
.
outer
.
Fee
??
0
,
OutDoctorAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
OutDoctorAccounting
?.
AccountingUnit
,
OutNurseAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
OutNurseAccounting
?.
AccountingUnit
,
OutTechnicAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
OutTechnicAccounting
?.
AccountingUnit
,
InpatDoctorAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
InpatDoctorAccounting
?.
AccountingUnit
,
InpatNurseAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
InpatNurseAccounting
?.
AccountingUnit
,
InpatTechnicAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
InpatTechnicAccounting
?.
AccountingUnit
,
SpecialAccounting
=
t
.
inner
.
FirstOrDefault
(
f
=>
f
.
Department
==
dept
)?.
SpecialAccounting
?.
AccountingUnit
??
dept
,
EName
=
types
.
FirstOrDefault
(
w
=>
w
.
Id
==
t
.
outer
.
TypeId
)?.
EName
,
};
});
SheetName
=
item
.
Source
,
Department
=
dept
,
Category
=
item
.
Category
,
DoctorName
=
item
.
DoctorName
,
PersonnelNumber
=
item
.
PersonnelNumber
,
Value
=
item
.
Fee
??
0
,
OutDoctorAccounting
=
firstDic
?.
OutDoctorAccounting
?.
AccountingUnit
,
OutNurseAccounting
=
firstDic
?.
OutNurseAccounting
?.
AccountingUnit
,
OutTechnicAccounting
=
firstDic
?.
OutTechnicAccounting
?.
AccountingUnit
,
InpatDoctorAccounting
=
firstDic
?.
InpatDoctorAccounting
?.
AccountingUnit
,
InpatNurseAccounting
=
firstDic
?.
InpatNurseAccounting
?.
AccountingUnit
,
InpatTechnicAccounting
=
firstDic
?.
InpatTechnicAccounting
?.
AccountingUnit
,
SpecialAccounting
=
firstDic
?.
SpecialAccounting
?.
AccountingUnit
??
dept
,
EName
=
types
.
FirstOrDefault
(
w
=>
w
.
Id
==
item
.
TypeId
)?.
EName
,
};
data
.
Add
(
d
);
}
var
groupdata
=
data
.
GroupBy
(
t
=>
new
{
t
.
Department
,
t
.
Category
,
t
.
SheetName
}).
Select
(
t
=>
new
ExtractTransDto
{
SheetName
=
t
.
Key
.
SheetName
,
Department
=
t
.
Key
.
Department
,
Category
=
t
.
Key
.
Category
,
Value
=
t
.
Sum
(
group
=>
group
.
Value
)
==
0
?
null
:
t
.
Sum
(
group
=>
group
.
Value
),
OutDoctorAccounting
=
t
.
FirstOrDefault
()?.
OutDoctorAccounting
,
OutNurseAccounting
=
t
.
FirstOrDefault
()?.
OutNurseAccounting
,
OutTechnicAccounting
=
t
.
FirstOrDefault
()?.
OutTechnicAccounting
,
InpatDoctorAccounting
=
t
.
FirstOrDefault
()?.
InpatDoctorAccounting
,
InpatNurseAccounting
=
t
.
FirstOrDefault
()?.
InpatNurseAccounting
,
InpatTechnicAccounting
=
t
.
FirstOrDefault
()?.
InpatTechnicAccounting
,
SpecialAccounting
=
t
.
FirstOrDefault
()?.
SpecialAccounting
,
EName
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
EName
))?.
EName
});
var
groupdata
=
data
.
GroupBy
(
t
=>
new
{
t
.
Department
,
t
.
Category
,
t
.
SheetName
})
.
Select
(
t
=>
new
ExtractTransDto
{
SheetName
=
t
.
Key
.
SheetName
,
Department
=
t
.
Key
.
Department
,
Category
=
t
.
Key
.
Category
,
Value
=
t
.
Sum
(
group
=>
group
.
Value
)
==
0
?
null
:
t
.
Sum
(
group
=>
group
.
Value
),
OutDoctorAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
OutDoctorAccounting
))?.
OutDoctorAccounting
,
OutNurseAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
OutNurseAccounting
))?.
OutNurseAccounting
,
OutTechnicAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
OutTechnicAccounting
))?.
OutTechnicAccounting
,
InpatDoctorAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
InpatDoctorAccounting
))?.
InpatDoctorAccounting
,
InpatNurseAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
InpatNurseAccounting
))?.
InpatNurseAccounting
,
InpatTechnicAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
InpatTechnicAccounting
))?.
InpatTechnicAccounting
,
SpecialAccounting
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
SpecialAccounting
))?.
SpecialAccounting
,
EName
=
t
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
EName
))?.
EName
});
return
groupdata
.
ToList
();
}
...
...
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