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
d36f3b19
Commit
d36f3b19
authored
Mar 05, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大屏文件上传,数据导入
parent
b5bf090f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
313 additions
and
45 deletions
+313
-45
performance/Performance.EntityModels/Entity/report_performance_person_tags.cs
+5
-0
performance/Performance.EntityModels/Entity/report_performance_tags.cs
+5
-0
performance/Performance.Services/ReportGlobalService.cs
+303
-45
No files found.
performance/Performance.EntityModels/Entity/report_performance_person_tags.cs
View file @
d36f3b19
...
@@ -70,5 +70,10 @@ public class report_performance_person_tags
...
@@ -70,5 +70,10 @@ public class report_performance_person_tags
/// 重点群体对比5
/// 重点群体对比5
/// </summary>
/// </summary>
public
string
Tag5
{
get
;
set
;
}
public
string
Tag5
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
Nullable
<
DateTime
>
CreateTime
{
get
;
set
;
}
}
}
}
}
performance/Performance.EntityModels/Entity/report_performance_tags.cs
View file @
d36f3b19
...
@@ -60,5 +60,10 @@ public class report_performance_tags
...
@@ -60,5 +60,10 @@ public class report_performance_tags
/// 重点群体对比5
/// 重点群体对比5
/// </summary>
/// </summary>
public
string
Tag5
{
get
;
set
;
}
public
string
Tag5
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
Nullable
<
DateTime
>
CreateTime
{
get
;
set
;
}
}
}
}
}
performance/Performance.Services/ReportGlobalService.cs
View file @
d36f3b19
...
@@ -19,18 +19,36 @@ public class ReportGlobalService : IAutoInjection
...
@@ -19,18 +19,36 @@ public class ReportGlobalService : IAutoInjection
private
readonly
PerforPerallotRepository
perallotRepository
;
private
readonly
PerforPerallotRepository
perallotRepository
;
private
readonly
PerforReportglobalRepository
reportglobalRepository
;
private
readonly
PerforReportglobalRepository
reportglobalRepository
;
private
readonly
PerforHisimportdataRepository
hisimportdataRepository
;
private
readonly
PerforHisimportdataRepository
hisimportdataRepository
;
private
readonly
PerforHisimportsummaryRepository
hisimportsummaryRepository
;
private
readonly
PerforHisimportaccountRepository
hisimportaccountRepository
;
private
readonly
PerforHisimportclinicRepository
hisimportclinicRepository
;
private
readonly
PerforHisimportbaiscnormRepository
hisimportbaiscnormRepository
;
private
readonly
PerforReportperformancetagsRepository
reportperformancetagsRepository
;
private
readonly
PerforReportperformancepersontagsRepository
reportperformancepersontagsRepository
;
public
ReportGlobalService
(
public
ReportGlobalService
(
ILogger
<
ReportGlobalService
>
logger
,
ILogger
<
ReportGlobalService
>
logger
,
PerforPerallotRepository
perallotRepository
,
PerforPerallotRepository
perallotRepository
,
PerforReportglobalRepository
reportglobalRepository
,
PerforReportglobalRepository
reportglobalRepository
,
PerforHisimportdataRepository
hisimportdataRepository
PerforHisimportdataRepository
hisimportdataRepository
,
PerforHisimportsummaryRepository
hisimportsummaryRepository
,
PerforHisimportaccountRepository
hisimportaccountRepository
,
PerforHisimportclinicRepository
hisimportclinicRepository
,
PerforHisimportbaiscnormRepository
hisimportbaiscnormRepository
,
PerforReportperformancetagsRepository
reportperformancetagsRepository
,
PerforReportperformancepersontagsRepository
reportperformancepersontagsRepository
)
)
{
{
this
.
logger
=
logger
;
this
.
logger
=
logger
;
this
.
perallotRepository
=
perallotRepository
;
this
.
perallotRepository
=
perallotRepository
;
this
.
reportglobalRepository
=
reportglobalRepository
;
this
.
reportglobalRepository
=
reportglobalRepository
;
this
.
hisimportdataRepository
=
hisimportdataRepository
;
this
.
hisimportdataRepository
=
hisimportdataRepository
;
this
.
hisimportsummaryRepository
=
hisimportsummaryRepository
;
this
.
hisimportaccountRepository
=
hisimportaccountRepository
;
this
.
hisimportclinicRepository
=
hisimportclinicRepository
;
this
.
hisimportbaiscnormRepository
=
hisimportbaiscnormRepository
;
this
.
reportperformancetagsRepository
=
reportperformancetagsRepository
;
this
.
reportperformancepersontagsRepository
=
reportperformancepersontagsRepository
;
}
}
#
region
Report_Global
#
region
Report_Global
...
@@ -170,44 +188,42 @@ public void ImportAllotData(int hospitalId, string filePath)
...
@@ -170,44 +188,42 @@ public void ImportAllotData(int hospitalId, string filePath)
if
(
sheet
==
null
)
continue
;
if
(
sheet
==
null
)
continue
;
string
sheetName
=
sheet
.
SheetName
.
NoBlank
();
string
sheetName
=
sheet
.
SheetName
.
NoBlank
();
logger
.
LogInformation
(
$"正在读取
{
sheetName
}
的数据"
);
var
columns
=
GetColumns
(
sheet
,
sheetName
,
out
string
sourceType
);
var
columns
=
GetColumns
(
sheet
,
sheetName
,
out
string
sourceType
);
if
(
columns
==
null
||
!
columns
.
Any
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
NoBlank
())))
continue
;
if
(
columns
==
null
||
!
columns
.
Any
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
NoBlank
())))
continue
;
var
data
=
new
List
<
his_importdata
>();
switch
(
sheetName
)
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
{
{
var
row
=
sheet
.
GetRow
(
rowIndex
);
case
"科室总绩效"
:
if
(
row
==
null
)
continue
;
ImporSummaryData
(
sheet
,
columns
,
hospitalId
,
allots
);
break
;
his_importdata
importdata
=
new
his_importdata
case
"临床科室绩效"
:
{
ImporAccountData
(
sheet
,
columns
,
hospitalId
,
allots
);
Year
=
GetCellValue
<
int
>(
row
,
columns
,
nameof
(
his_importdata
.
Year
)),
break
;
Month
=
GetCellValue
<
int
>(
row
,
columns
,
nameof
(
his_importdata
.
Month
)),
AccountingUnit
=
GetCellValue
<
string
>(
row
,
columns
,
nameof
(
his_importdata
.
AccountingUnit
)),
Department
=
GetCellValue
<
string
>(
row
,
columns
,
nameof
(
his_importdata
.
Department
)),
PersonnelNumber
=
GetCellValue
<
string
>(
row
,
columns
,
nameof
(
his_importdata
.
PersonnelNumber
)),
PersonnelName
=
GetCellValue
<
string
>(
row
,
columns
,
nameof
(
his_importdata
.
PersonnelName
)),
Original
=
GetCellValue
<
string
>(
row
,
columns
,
nameof
(
his_importdata
.
Original
)),
Value
=
GetCellValue
<
decimal
>(
row
,
columns
,
nameof
(
his_importdata
.
Value
)),
};
data
.
Add
(
importdata
);
}
if
(
data
==
null
||
!
data
.
Any
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
))
return
;
data
.
ForEach
(
t
=>
case
"科室标签"
:
{
ImporAccountTag
(
sheet
,
columns
,
hospitalId
);
t
.
HospitalId
=
hospitalId
;
break
;
t
.
AllotId
=
allots
?.
FirstOrDefault
(
w
=>
w
.
Year
==
t
.
Year
&&
t
.
Month
==
w
.
Month
)?.
ID
;
t
.
SourceType
=
sourceType
;
t
.
Category
=
sheetName
;
});
var
years
=
data
.
Select
(
t
=>
t
.
Year
).
Distinct
();
case
"科主任护士长绩效"
:
var
months
=
data
.
Select
(
t
=>
t
.
Month
).
Distinct
();
ImporClinicData
(
sheet
,
columns
,
hospitalId
,
allots
);
break
;
hisimportdataRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
years
.
Contains
(
t
.
Year
)
&&
months
.
Contains
(
t
.
Month
)
&&
t
.
Category
==
sheetName
);
case
"科主任护士长标签"
:
hisimportdataRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
ImporClinicTag
(
sheet
,
columns
,
hospitalId
);
break
;
case
"人均绩效"
:
ImporBasicnormData
(
sheet
,
columns
,
hospitalId
,
allots
);
break
;
default
:
ImportBasicData
(
sheet
,
columns
,
hospitalId
,
allots
,
sheetName
,
sourceType
);
break
;
}
logger
.
LogInformation
(
$"
{
sheetName
}
读取已结束"
);
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
@@ -216,6 +232,260 @@ public void ImportAllotData(int hospitalId, string filePath)
...
@@ -216,6 +232,260 @@ public void ImportAllotData(int hospitalId, string filePath)
}
}
}
}
private
void
ImportBasicData
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
,
List
<
per_allot
>
allots
,
string
sheetName
,
string
sourceType
)
{
var
data
=
new
List
<
his_importdata
>();
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
{
var
row
=
sheet
.
GetRow
(
rowIndex
);
if
(
row
==
null
)
continue
;
his_importdata
importdata
=
new
his_importdata
{
Year
=
GetCellValue
<
int
>(
row
,
columns
,
"年份"
),
Month
=
GetCellValue
<
int
>(
row
,
columns
,
"月份"
),
AccountingUnit
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元"
),
Department
=
GetCellValue
<
string
>(
row
,
columns
,
"科室"
),
PersonnelNumber
=
GetCellValue
<
string
>(
row
,
columns
,
"工号"
),
PersonnelName
=
GetCellValue
<
string
>(
row
,
columns
,
"医生姓名"
),
Original
=
GetCellValue
<
string
>(
row
,
columns
,
"类别"
),
Value
=
GetCellValue
<
decimal
>(
row
,
columns
,
"值"
),
};
data
.
Add
(
importdata
);
}
if
(
data
==
null
||
!
data
.
Any
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
))
return
;
var
dateTime
=
DateTime
.
Now
;
data
.
ForEach
(
t
=>
{
t
.
HospitalId
=
hospitalId
;
t
.
AllotId
=
allots
?.
FirstOrDefault
(
w
=>
w
.
Year
==
t
.
Year
&&
t
.
Month
==
w
.
Month
)?.
ID
;
t
.
SourceType
=
sourceType
;
t
.
Category
=
sheetName
;
t
.
CreateTime
=
dateTime
;
});
var
yearMonths
=
data
.
Select
(
t
=>
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
).
Distinct
();
hisimportdataRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
yearMonths
.
Contains
(
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
)
&&
t
.
Category
==
sheetName
);
hisimportdataRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
}
private
void
ImporSummaryData
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
,
List
<
per_allot
>
allots
)
{
var
data
=
new
List
<
his_import_summary
>();
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
{
var
row
=
sheet
.
GetRow
(
rowIndex
);
if
(
row
==
null
)
continue
;
his_import_summary
importdata
=
new
his_import_summary
{
Year
=
GetCellValue
<
int
>(
row
,
columns
,
"年份"
),
Month
=
GetCellValue
<
int
>(
row
,
columns
,
"月份"
),
AccountingUnit
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元"
),
RealGiveFee
=
GetCellValue
<
decimal
>(
row
,
columns
,
"实发绩效"
),
};
data
.
Add
(
importdata
);
}
logger
.
LogInformation
(
$"
{
sheet
.
SheetName
}
共有
{
sheet
.
LastRowNum
}
行数据,读取到
{
data
.
Count
}
条记录"
);
if
(
data
==
null
||
!
data
.
Any
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
))
return
;
var
dateTime
=
DateTime
.
Now
;
data
.
ForEach
(
t
=>
{
t
.
HospitalId
=
hospitalId
;
t
.
AllotId
=
allots
?.
FirstOrDefault
(
w
=>
w
.
Year
==
t
.
Year
&&
t
.
Month
==
w
.
Month
)?.
ID
??
0
;
t
.
CreateTime
=
dateTime
;
});
var
yearMonths
=
data
.
Select
(
t
=>
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
).
Distinct
();
hisimportsummaryRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
yearMonths
.
Contains
(
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
));
hisimportsummaryRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
}
private
void
ImporAccountData
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
,
List
<
per_allot
>
allots
)
{
var
data
=
new
List
<
his_import_account
>();
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
{
var
row
=
sheet
.
GetRow
(
rowIndex
);
if
(
row
==
null
)
continue
;
his_import_account
importdata
=
new
his_import_account
{
Year
=
GetCellValue
<
int
>(
row
,
columns
,
"年份"
),
Month
=
GetCellValue
<
int
>(
row
,
columns
,
"月份"
),
UnitType
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元类型"
),
AccountingUnit
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元"
),
Number
=
GetCellValue
<
decimal
>(
row
,
columns
,
"核算单元人员数量"
),
RealGiveFee
=
GetCellValue
<
decimal
>(
row
,
columns
,
"实发绩效"
),
};
data
.
Add
(
importdata
);
}
logger
.
LogInformation
(
$"
{
sheet
.
SheetName
}
共有
{
sheet
.
LastRowNum
}
行数据,读取到
{
data
.
Count
}
条记录"
);
if
(
data
==
null
||
!
data
.
Any
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
))
return
;
var
dateTime
=
DateTime
.
Now
;
data
.
ForEach
(
t
=>
{
t
.
HospitalId
=
hospitalId
;
t
.
AllotId
=
allots
?.
FirstOrDefault
(
w
=>
w
.
Year
==
t
.
Year
&&
t
.
Month
==
w
.
Month
)?.
ID
??
0
;
t
.
CreateTime
=
dateTime
;
});
var
yearMonths
=
data
.
Select
(
t
=>
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
).
Distinct
();
hisimportaccountRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
yearMonths
.
Contains
(
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
));
hisimportaccountRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
}
private
void
ImporAccountTag
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
)
{
var
data
=
new
List
<
report_performance_tags
>();
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
{
var
row
=
sheet
.
GetRow
(
rowIndex
);
if
(
row
==
null
)
continue
;
report_performance_tags
importdata
=
new
report_performance_tags
{
UnitType
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元类型"
),
AccountingUnit
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元"
),
Tag1
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag1"
),
Tag2
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag2"
),
Tag3
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag3"
),
Tag4
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag4"
),
Tag5
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag5"
),
};
data
.
Add
(
importdata
);
}
logger
.
LogInformation
(
$"
{
sheet
.
SheetName
}
共有
{
sheet
.
LastRowNum
}
行数据,读取到
{
data
.
Count
}
条记录"
);
if
(
data
==
null
||
!
data
.
Any
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
UnitType
)
&&
!
string
.
IsNullOrEmpty
(
t
.
AccountingUnit
)))
return
;
var
dateTime
=
DateTime
.
Now
;
data
.
ForEach
(
t
=>
{
t
.
HospitalId
=
hospitalId
;
t
.
CreateTime
=
dateTime
;
});
reportperformancetagsRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
);
reportperformancetagsRepository
.
BulkInsert
(
data
.
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
UnitType
)
&&
!
string
.
IsNullOrEmpty
(
t
.
AccountingUnit
)));
}
private
void
ImporClinicData
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
,
List
<
per_allot
>
allots
)
{
var
data
=
new
List
<
his_import_clinic
>();
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
{
var
row
=
sheet
.
GetRow
(
rowIndex
);
if
(
row
==
null
)
continue
;
his_import_clinic
importdata
=
new
his_import_clinic
{
Year
=
GetCellValue
<
int
>(
row
,
columns
,
"年份"
),
Month
=
GetCellValue
<
int
>(
row
,
columns
,
"月份"
),
UnitType
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元类型"
),
AccountingUnit
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元"
),
AccountType
=
GetCellValue
<
string
>(
row
,
columns
,
"职称"
),
JobNumber
=
GetCellValue
<
string
>(
row
,
columns
,
"工号"
),
EmployeeName
=
GetCellValue
<
string
>(
row
,
columns
,
"姓名"
),
Basics
=
GetCellValue
<
decimal
>(
row
,
columns
,
"基础绩效系数"
),
RealGiveFee
=
GetCellValue
<
decimal
>(
row
,
columns
,
"实发绩效"
),
};
data
.
Add
(
importdata
);
}
logger
.
LogInformation
(
$"
{
sheet
.
SheetName
}
共有
{
sheet
.
LastRowNum
}
行数据,读取到
{
data
.
Count
}
条记录"
);
if
(
data
==
null
||
!
data
.
Any
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
))
return
;
var
dateTime
=
DateTime
.
Now
;
data
.
ForEach
(
t
=>
{
t
.
HospitalId
=
hospitalId
;
t
.
AllotId
=
allots
?.
FirstOrDefault
(
w
=>
w
.
Year
==
t
.
Year
&&
t
.
Month
==
w
.
Month
)?.
ID
??
0
;
t
.
CreateTime
=
dateTime
;
});
var
yearMonths
=
data
.
Select
(
t
=>
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
).
Distinct
();
hisimportclinicRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
yearMonths
.
Contains
(
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
));
hisimportclinicRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
}
private
void
ImporClinicTag
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
)
{
var
data
=
new
List
<
report_performance_person_tags
>();
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
{
var
row
=
sheet
.
GetRow
(
rowIndex
);
if
(
row
==
null
)
continue
;
report_performance_person_tags
importdata
=
new
report_performance_person_tags
{
UnitType
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元类型"
),
AccountingUnit
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元"
),
PersonnelName
=
GetCellValue
<
string
>(
row
,
columns
,
"工号"
),
PersonnelNumber
=
GetCellValue
<
string
>(
row
,
columns
,
"姓名"
),
Tag1
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag1"
),
Tag2
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag2"
),
Tag3
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag3"
),
Tag4
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag4"
),
Tag5
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag5"
),
};
data
.
Add
(
importdata
);
}
logger
.
LogInformation
(
$"
{
sheet
.
SheetName
}
共有
{
sheet
.
LastRowNum
}
行数据,读取到
{
data
.
Count
}
条记录"
);
if
(
data
==
null
||
!
data
.
Any
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
UnitType
)
&&
!
string
.
IsNullOrEmpty
(
t
.
AccountingUnit
)))
return
;
var
dateTime
=
DateTime
.
Now
;
data
.
ForEach
(
t
=>
{
t
.
HospitalId
=
hospitalId
;
t
.
CreateTime
=
dateTime
;
});
reportperformancepersontagsRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
);
reportperformancepersontagsRepository
.
BulkInsert
(
data
.
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
PersonnelName
)
&&
!
string
.
IsNullOrEmpty
(
t
.
PersonnelNumber
)));
}
private
void
ImporBasicnormData
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
,
List
<
per_allot
>
allots
)
{
var
data
=
new
List
<
his_import_baiscnorm
>();
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
{
var
row
=
sheet
.
GetRow
(
rowIndex
);
if
(
row
==
null
)
continue
;
his_import_baiscnorm
importdata
=
new
his_import_baiscnorm
{
Year
=
GetCellValue
<
int
>(
row
,
columns
,
"年份"
),
Month
=
GetCellValue
<
int
>(
row
,
columns
,
"月份"
),
PositionName
=
GetCellValue
<
string
>(
row
,
columns
,
"绩效核算人群"
),
TotelValue
=
GetCellValue
<
decimal
>(
row
,
columns
,
"总绩效"
),
AvgValue
=
GetCellValue
<
decimal
>(
row
,
columns
,
"总人数"
),
TotelNumber
=
GetCellValue
<
decimal
>(
row
,
columns
,
"人均绩效"
),
};
data
.
Add
(
importdata
);
}
logger
.
LogInformation
(
$"
{
sheet
.
SheetName
}
共有
{
sheet
.
LastRowNum
}
行数据,读取到
{
data
.
Count
}
条记录"
);
if
(
data
==
null
||
!
data
.
Any
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
))
return
;
var
dateTime
=
DateTime
.
Now
;
data
.
ForEach
(
t
=>
{
t
.
HospitalId
=
hospitalId
;
t
.
AllotId
=
allots
?.
FirstOrDefault
(
w
=>
w
.
Year
==
t
.
Year
&&
t
.
Month
==
w
.
Month
)?.
ID
??
0
;
t
.
CreateTime
=
dateTime
;
});
var
yearMonths
=
data
.
Select
(
t
=>
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
).
Distinct
();
hisimportbaiscnormRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
yearMonths
.
Contains
(
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
));
hisimportbaiscnormRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
}
private
List
<
string
>
GetColumns
(
ISheet
sheet
,
string
sheetName
,
out
string
sourceType
)
private
List
<
string
>
GetColumns
(
ISheet
sheet
,
string
sheetName
,
out
string
sourceType
)
{
{
sourceType
=
""
;
sourceType
=
""
;
...
@@ -236,9 +506,8 @@ private List<string> GetColumns(ISheet sheet, string sheetName, out string sourc
...
@@ -236,9 +506,8 @@ private List<string> GetColumns(ISheet sheet, string sheetName, out string sourc
private
T
GetCellValue
<
T
>(
IRow
row
,
List
<
string
>
columns
,
string
key
)
private
T
GetCellValue
<
T
>(
IRow
row
,
List
<
string
>
columns
,
string
key
)
{
{
var
value
=
hisImportdataDict
[
key
];
if
(
columns
.
Contains
(
key
)
&&
row
.
GetCell
(
columns
.
IndexOf
(
key
))
!=
null
)
if
(
columns
.
Contains
(
value
)
&&
row
.
GetCell
(
columns
.
IndexOf
(
value
))
!=
null
)
return
row
.
GetCell
(
columns
.
IndexOf
(
key
)).
GetCellValue
<
T
>();
return
row
.
GetCell
(
columns
.
IndexOf
(
value
)).
GetCellValue
<
T
>();
return
default
;
return
default
;
}
}
...
@@ -248,18 +517,7 @@ private T GetCellValue<T>(IRow row, List<string> columns, string key)
...
@@ -248,18 +517,7 @@ private T GetCellValue<T>(IRow row, List<string> columns, string key)
{
"收入"
,
new
string
[]
{
"门诊收入"
,
"住院收入"
}
},
{
"收入"
,
new
string
[]
{
"门诊收入"
,
"住院收入"
}
},
{
"医生工作量"
,
new
string
[]
{
"门诊人次"
,
"出院人次"
,
"手术概况"
,
"住院天数"
,
"实际开放总床日数"
}
},
{
"医生工作量"
,
new
string
[]
{
"门诊人次"
,
"出院人次"
,
"手术概况"
,
"住院天数"
,
"实际开放总床日数"
}
},
{
"医技工作量"
,
new
string
[]
{
"医技工作量"
}
},
{
"医技工作量"
,
new
string
[]
{
"医技工作量"
}
},
};
{
"支出"
,
new
string
[]
{
"支出"
}
},
private
readonly
Dictionary
<
string
,
string
>
hisImportdataDict
=
new
Dictionary
<
string
,
string
>
{
{
nameof
(
his_importdata
.
Year
),
"年份"
},
{
nameof
(
his_importdata
.
Month
),
"月份"
},
{
nameof
(
his_importdata
.
AccountingUnit
),
"核算单元"
},
{
nameof
(
his_importdata
.
Department
),
"科室"
},
{
nameof
(
his_importdata
.
PersonnelNumber
),
"工号"
},
{
nameof
(
his_importdata
.
PersonnelName
),
"医生姓名"
},
{
nameof
(
his_importdata
.
Original
),
"类别"
},
{
nameof
(
his_importdata
.
Value
),
"值"
},
};
};
#
endregion
ImportFile
&&
SaveData
#
endregion
ImportFile
&&
SaveData
...
...
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