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
f7c427b1
Commit
f7c427b1
authored
Jun 08, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并冲突
parent
97a487e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
+1
-0
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
+18
-12
No files found.
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
View file @
f7c427b1
...
...
@@ -77,6 +77,7 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
// }
//}
var
sheetNames
=
workbook
.
GetAllNames
().
Select
(
w
=>
w
.
SheetName
);
foreach
(
var
module
in
modulesList
.
Where
(
t
=>
new
int
[]
{
(
int
)
SheetType
.
Income
,
(
int
)
SheetType
.
OtherIncome
}.
Contains
(
t
.
SheetType
.
Value
))?.
OrderBy
(
t
=>
t
.
ModuleName
))
{
var
no
=
module
.
ModuleName
.
GetNo
();
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
View file @
f7c427b1
...
...
@@ -157,15 +157,12 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
if
(
row
==
null
)
continue
;
string
department
=
row
.
GetOrCreate
(
dataFirstCellNum
-
1
).
GetDecodeEscapes
();
if
(
string
.
IsNullOrEmpty
(
department
))
continue
;
if
(
rowIndex
>=
dataFirstRowNum
)
dataFirstRowNum
=
rowIndex
+
1
;
var
deptData
=
data
.
Where
(
t
=>
t
.
Department
.
NoBlank
()
==
department
);
if
(
deptData
==
null
||
!
deptData
.
Any
(
t
=>
t
.
Value
.
HasValue
&&
t
.
Value
!=
0
))
continue
;
if
(
rowIndex
>
dataFirstRowNum
)
dataFirstRowNum
=
rowIndex
+
1
;
#
region
写入数据
if
(
sheetType
==
SheetType
.
Income
)
if
(
sheetType
==
SheetType
.
Income
&&
!
string
.
IsNullOrEmpty
(
department
)
)
{
if
(!
incomes
.
Any
(
t
=>
t
.
Department
==
department
))
incomes
.
Add
(
GetIncomeRowMessage
(
row
,
dataFirstCellNum
,
department
,
rowIndex
));
...
...
@@ -178,13 +175,22 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
var
cell
=
row
.
GetOrCreate
(
cellIndex
);
if
(
string
.
IsNullOrEmpty
(
column
))
continue
;
var
value
=
deptData
.
FirstOrDefault
(
t
=>
t
.
Category
.
NoBlank
()
==
column
)?.
Value
;
decimal
?
value
=
0
m
;
if
(!
string
.
IsNullOrEmpty
(
department
))
{
var
deptData
=
data
.
Where
(
t
=>
t
.
Department
.
NoBlank
()
==
department
);
if
(
deptData
!=
null
&&
deptData
.
Any
(
t
=>
t
.
Value
.
HasValue
&&
t
.
Value
!=
0
))
value
=
deptData
.
FirstOrDefault
(
t
=>
t
.
Category
.
NoBlank
()
==
column
)?.
Value
;
}
//数据为空,且单元格值不为空,不写入数据(保留原始值)
// 22.3.29 ry 只要是提取的列头全部覆盖数据
if
(
headers
!=
null
&&
headers
.
Contains
(
column
)
&&
value
.
HasValue
&&
value
!=
0
)
{
cell
.
SetCellValue
<
decimal
>(
value
);
cell
.
CellStyle
=
cellStyle
;
}
}
#
endregion
...
...
@@ -270,14 +276,14 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
{
{
1
,
item
.
Department
},
{
2
,
(
sheet
.
SheetName
.
Contains
(
"门诊"
)
?
deptData
.
FirstOrDefault
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
OutNurseAccounting
))?.
OutNurseAccounting
:
deptData
.
FirstOrDefault
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
InpatNurseAccounting
))?.
InpatNurseAccounting
)
??
item
.
NurseAccount
},
?
deptData
.
FirstOrDefault
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
OutNurseAccounting
))?.
OutNurseAccounting
:
deptData
.
FirstOrDefault
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
InpatNurseAccounting
))?.
InpatNurseAccounting
)
??
item
.
NurseAccount
},
{
3
,
(
sheet
.
SheetName
.
Contains
(
"门诊"
)
?
deptData
.
FirstOrDefault
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
OutDoctorAccounting
))?.
OutDoctorAccounting
:
deptData
.
FirstOrDefault
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
InpatDoctorAccounting
))?.
InpatDoctorAccounting
)
??
item
.
DoctorAccount
},
?
deptData
.
FirstOrDefault
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
OutDoctorAccounting
))?.
OutDoctorAccounting
:
deptData
.
FirstOrDefault
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
InpatDoctorAccounting
))?.
InpatDoctorAccounting
)
??
item
.
DoctorAccount
},
{
4
,
(
sheet
.
SheetName
.
Contains
(
"门诊"
)
?
deptData
.
FirstOrDefault
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
OutTechnicAccounting
))?.
OutTechnicAccounting
:
deptData
.
FirstOrDefault
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
InpatTechnicAccounting
))?.
InpatTechnicAccounting
)
??
item
.
TechnicAccounting
},
?
deptData
.
FirstOrDefault
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
OutTechnicAccounting
))?.
OutTechnicAccounting
:
deptData
.
FirstOrDefault
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
InpatTechnicAccounting
))?.
InpatTechnicAccounting
)
??
item
.
TechnicAccounting
},
};
foreach
(
var
content
in
deptContents
)
...
...
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