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
68035f62
Commit
68035f62
authored
Mar 09, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入模板、方法调整
parent
d2b1f625
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
101 additions
and
78 deletions
+101
-78
performance/Performance.Api/Template/导入数据模板.xlsx
+0
-0
performance/Performance.Services/ReportGlobalService.cs
+101
-78
No files found.
performance/Performance.Api/Template/导入数据模板.xlsx
View file @
68035f62
No preview for this file type
performance/Performance.Services/ReportGlobalService.cs
View file @
68035f62
...
@@ -195,11 +195,7 @@ public void ImportAllotData(int hospitalId, string filePath)
...
@@ -195,11 +195,7 @@ public void ImportAllotData(int hospitalId, string filePath)
switch
(
sheetName
)
switch
(
sheetName
)
{
{
case
"科室总绩效"
:
case
"科室绩效"
:
ImporSummaryData
(
sheet
,
columns
,
hospitalId
,
allots
);
break
;
case
"临床科室绩效"
:
ImporAccountData
(
sheet
,
columns
,
hospitalId
,
allots
);
ImporAccountData
(
sheet
,
columns
,
hospitalId
,
allots
);
break
;
break
;
...
@@ -215,10 +211,6 @@ public void ImportAllotData(int hospitalId, string filePath)
...
@@ -215,10 +211,6 @@ public void ImportAllotData(int hospitalId, string filePath)
ImporClinicTag
(
sheet
,
columns
,
hospitalId
);
ImporClinicTag
(
sheet
,
columns
,
hospitalId
);
break
;
break
;
case
"人均绩效"
:
ImporBasicnormData
(
sheet
,
columns
,
hospitalId
,
allots
);
break
;
default
:
default
:
ImportBasicData
(
sheet
,
columns
,
hospitalId
,
allots
,
sheetName
,
sourceType
);
ImportBasicData
(
sheet
,
columns
,
hospitalId
,
allots
,
sheetName
,
sourceType
);
break
;
break
;
...
@@ -273,19 +265,21 @@ private void ImportBasicData(ISheet sheet, List<string> columns, int hospitalId,
...
@@ -273,19 +265,21 @@ private void ImportBasicData(ISheet sheet, List<string> columns, int hospitalId,
hisimportdataRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
hisimportdataRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
}
}
private
void
Impor
Summary
Data
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
,
List
<
per_allot
>
allots
)
private
void
Impor
Account
Data
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
,
List
<
per_allot
>
allots
)
{
{
var
data
=
new
List
<
his_import_
summary
>();
var
data
=
new
List
<
his_import_
account
>();
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
{
{
var
row
=
sheet
.
GetRow
(
rowIndex
);
var
row
=
sheet
.
GetRow
(
rowIndex
);
if
(
row
==
null
)
continue
;
if
(
row
==
null
)
continue
;
his_import_
summary
importdata
=
new
his_import_summary
his_import_
account
importdata
=
new
his_import_account
{
{
Year
=
GetCellValue
<
int
>(
row
,
columns
,
"年份"
),
Year
=
GetCellValue
<
int
>(
row
,
columns
,
"年份"
),
Month
=
GetCellValue
<
int
>(
row
,
columns
,
"月份"
),
Month
=
GetCellValue
<
int
>(
row
,
columns
,
"月份"
),
UnitType
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元类型"
),
AccountingUnit
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元"
),
AccountingUnit
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元"
),
Number
=
GetCellValue
<
decimal
>(
row
,
columns
,
"核算单元人员数量"
),
RealGiveFee
=
GetCellValue
<
decimal
>(
row
,
columns
,
"实发绩效"
),
RealGiveFee
=
GetCellValue
<
decimal
>(
row
,
columns
,
"实发绩效"
),
};
};
data
.
Add
(
importdata
);
data
.
Add
(
importdata
);
...
@@ -301,48 +295,79 @@ private void ImporSummaryData(ISheet sheet, List<string> columns, int hospitalId
...
@@ -301,48 +295,79 @@ private void ImporSummaryData(ISheet sheet, List<string> columns, int hospitalId
t
.
CreateTime
=
dateTime
;
t
.
CreateTime
=
dateTime
;
});
});
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
#
region
his_import_summary
科室总绩效
logger
.
LogInformation
(
$"添加科室总绩效"
);
var
summaryData
=
data
.
GroupBy
(
t
=>
new
{
t
.
AllotId
,
t
.
Year
,
t
.
Month
,
t
.
AccountingUnit
}).
Select
(
t
=>
new
his_import_summary
{
HospitalId
=
hospitalId
,
AllotId
=
t
.
Key
.
AllotId
??
0
,
Year
=
t
.
Key
.
Year
,
Month
=
t
.
Key
.
Month
,
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
RealGiveFee
=
t
.
Sum
(
s
=>
s
.
RealGiveFee
),
CreateTime
=
dateTime
});
foreach
(
var
item
in
summaryData
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
{
{
hisimportsummaryRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
hisimportsummaryRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
}
}
hisimportsummaryRepository
.
BulkInsert
(
d
ata
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
hisimportsummaryRepository
.
BulkInsert
(
summaryD
ata
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
}
#
endregion
his_import_summary
private
void
ImporAccountData
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
,
List
<
per_allot
>
allots
)
#
region
his_import_account
临床科室绩效
logger
.
LogInformation
(
$"临床科室绩效"
);
string
[]
clinicAccountTypes
=
new
string
[]
{
{
var
data
=
new
List
<
his_import_account
>();
UnitType
.
医生组
.
ToString
(),
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
UnitType
.
护理组
.
ToString
(),
UnitType
.
医技组
.
ToString
(),
UnitType
.
其他医生组
.
ToString
(),
UnitType
.
其他护理组
.
ToString
(),
UnitType
.
其他医技组
.
ToString
(),
UnitType
.
特殊核算组
.
ToString
()
};
if
(
data
.
Any
(
t
=>
clinicAccountTypes
.
Contains
(
t
.
UnitType
)))
{
{
var
row
=
sheet
.
GetRow
(
rowIndex
);
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
if
(
row
==
null
)
continue
;
his_import_account
importdata
=
new
his_import_account
{
{
Year
=
GetCellValue
<
int
>(
row
,
columns
,
"年份"
),
hisimportaccountRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
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
}
条记录"
);
hisimportaccountRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
&&
clinicAccountTypes
.
Contains
(
t
.
UnitType
)));
if
(
data
==
null
||
!
data
.
Any
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
))
return
;
}
#
endregion
his_import_account
var
dateTime
=
DateTime
.
Now
;
#
region
his_import_baiscnorm
人均绩效计算
data
.
ForEach
(
t
=>
logger
.
LogInformation
(
$"人均绩效计算"
);
Dictionary
<
string
,
string
>
basicDict
=
new
Dictionary
<
string
,
string
>
{
{
t
.
HospitalId
=
hospitalId
;
{
"行政工勤人均绩效"
,
UnitType
.
行政后勤
.
ToString
()
},
t
.
AllotId
=
allots
?.
FirstOrDefault
(
w
=>
w
.
Year
==
t
.
Year
&&
t
.
Month
==
w
.
Month
)?.
ID
??
0
;
{
"临床医生人均绩效"
,
UnitType
.
医生组
.
ToString
()
},
t
.
CreateTime
=
dateTime
;
{
"医技医生人均绩效"
,
UnitType
.
医技组
.
ToString
()
},
{
"护士人均绩效"
,
UnitType
.
护理组
.
ToString
()
},
};
List
<
his_import_baiscnorm
>
baiscnorms
=
new
List
<
his_import_baiscnorm
>();
foreach
(
var
item
in
basicDict
)
{
var
basicnormData
=
data
.
Where
(
t
=>
t
.
UnitType
==
item
.
Value
).
GroupBy
(
t
=>
new
{
t
.
AllotId
,
t
.
Year
,
t
.
Month
}).
Select
(
t
=>
new
his_import_baiscnorm
{
HospitalId
=
hospitalId
,
AllotId
=
t
.
Key
.
AllotId
??
0
,
Year
=
t
.
Key
.
Year
,
Month
=
t
.
Key
.
Month
,
PositionName
=
item
.
Key
,
TotelValue
=
t
.
Sum
(
s
=>
s
.
RealGiveFee
),
TotelNumber
=
t
.
Sum
(
s
=>
s
.
Number
),
AvgValue
=
t
.
Sum
(
s
=>
s
.
Number
)
==
0
?
0
:
t
.
Sum
(
s
=>
s
.
RealGiveFee
)
/
t
.
Sum
(
s
=>
s
.
Number
),
CreateTime
=
dateTime
});
});
baiscnorms
.
AddRange
(
basicnormData
);
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
}
foreach
(
var
item
in
baiscnorms
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
,
t
.
PositionName
}).
Distinct
())
{
{
hisimport
accountRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
hisimport
baiscnormRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
&&
t
.
PositionName
==
item
.
PositionName
);
}
}
hisimportaccountRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
hisimportbaiscnormRepository
.
BulkInsert
(
baiscnorms
);
#
endregion
his_import_baiscnorm
}
}
private
void
ImporAccountTag
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
)
private
void
ImporAccountTag
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
)
...
@@ -412,11 +437,46 @@ private void ImporClinicData(ISheet sheet, List<string> columns, int hospitalId,
...
@@ -412,11 +437,46 @@ private void ImporClinicData(ISheet sheet, List<string> columns, int hospitalId,
t
.
CreateTime
=
dateTime
;
t
.
CreateTime
=
dateTime
;
});
});
#
region
his_import_clinic
科主任护士长绩效
logger
.
LogInformation
(
$"科主任护士长绩效"
);
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
{
{
hisimportclinicRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
hisimportclinicRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
}
}
hisimportclinicRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
hisimportclinicRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
#
endregion
his_import_clinic
#
region
his_import_baiscnorm
人均绩效计算
logger
.
LogInformation
(
$"人均绩效计算"
);
Dictionary
<
string
,
string
>
basicDict
=
new
Dictionary
<
string
,
string
>
{
{
"临床科室主任人均绩效"
,
UnitType
.
医生组
.
ToString
()
},
{
"医技科室主任人均绩效"
,
UnitType
.
医技组
.
ToString
()
},
{
"护士长人均绩效"
,
UnitType
.
护理组
.
ToString
()
},
};
List
<
his_import_baiscnorm
>
baiscnorms
=
new
List
<
his_import_baiscnorm
>();
foreach
(
var
item
in
basicDict
)
{
var
basicnormData
=
data
.
Where
(
t
=>
t
.
UnitType
==
item
.
Value
).
GroupBy
(
t
=>
new
{
t
.
AllotId
,
t
.
Year
,
t
.
Month
}).
Select
(
t
=>
new
his_import_baiscnorm
{
HospitalId
=
hospitalId
,
AllotId
=
t
.
Key
.
AllotId
??
0
,
Year
=
t
.
Key
.
Year
,
Month
=
t
.
Key
.
Month
,
PositionName
=
item
.
Key
,
TotelValue
=
t
.
Sum
(
s
=>
s
.
RealGiveFee
),
TotelNumber
=
t
.
Sum
(
s
=>
s
.
Basics
),
AvgValue
=
t
.
Sum
(
s
=>
s
.
Basics
)
==
0
?
0
:
t
.
Sum
(
s
=>
s
.
RealGiveFee
)
/
t
.
Sum
(
s
=>
s
.
Basics
),
CreateTime
=
dateTime
});
baiscnorms
.
AddRange
(
basicnormData
);
}
foreach
(
var
item
in
baiscnorms
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
,
t
.
PositionName
}).
Distinct
())
{
hisimportbaiscnormRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
&&
t
.
PositionName
==
item
.
PositionName
);
}
hisimportbaiscnormRepository
.
BulkInsert
(
baiscnorms
);
#
endregion
his_import_baiscnorm
}
}
private
void
ImporClinicTag
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
)
private
void
ImporClinicTag
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
)
...
@@ -455,43 +515,6 @@ private void ImporClinicTag(ISheet sheet, List<string> columns, int hospitalId)
...
@@ -455,43 +515,6 @@ private void ImporClinicTag(ISheet sheet, List<string> columns, int hospitalId)
reportperformancepersontagsRepository
.
BulkInsert
(
data
.
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
PersonnelName
)
&&
!
string
.
IsNullOrEmpty
(
t
.
PersonnelNumber
)));
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
;
});
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
{
hisimportbaiscnormRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
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
=
""
;
...
...
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