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
2922823f
Commit
2922823f
authored
Mar 11, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取报表sql条件更改
parent
68035f62
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
213 deletions
+73
-213
performance/Performance.Api/GraphQLSchema/PerformanceQuery.cs
+5
-8
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+2
-47
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+0
-2
performance/Performance.EntityModels/Entity/his_import_summary.cs
+0
-59
performance/Performance.Repository/Repository/PerforHisimportsummaryRepository.cs
+0
-20
performance/Performance.Services/GraphQLService.cs
+23
-4
performance/Performance.Services/ReportGlobalService.cs
+43
-73
No files found.
performance/Performance.Api/GraphQLSchema/PerformanceQuery.cs
View file @
2922823f
...
@@ -43,9 +43,8 @@ public PerformanceQuery(GraphQLService service)
...
@@ -43,9 +43,8 @@ public PerformanceQuery(GraphQLService service)
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
:
0
;
:
0
;
StringBuilder
where
=
new
StringBuilder
();
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
,
QueryParams
.
accountingUnit
);
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
where
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
,
QueryParams
.
accountingUnit
);
return
service
.
GetChartData
(
reportId
,
parameters
);
return
service
.
GetChartData
(
reportId
,
parameters
,
where
.
ToString
());
}
}
);
);
...
@@ -60,9 +59,8 @@ public PerformanceQuery(GraphQLService service)
...
@@ -60,9 +59,8 @@ public PerformanceQuery(GraphQLService service)
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
:
0
;
:
0
;
StringBuilder
where
=
new
StringBuilder
();
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
,
QueryParams
.
accountingUnit
,
QueryParams
.
category
,
QueryParams
.
itemName
);
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
where
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
,
QueryParams
.
accountingUnit
,
QueryParams
.
category
,
QueryParams
.
itemName
);
return
service
.
GetReportPerformance
(
reportId
,
parameters
);
return
service
.
GetReportPerformance
(
reportId
,
parameters
,
where
.
ToString
());
}
}
);
);
}
}
...
@@ -88,7 +86,7 @@ public static QueryArguments Arguments(params QueryArgument[] args)
...
@@ -88,7 +86,7 @@ public static QueryArguments Arguments(params QueryArgument[] args)
return
basic
;
return
basic
;
}
}
public
DynamicParameters
GetDynamicParameters
(
Dictionary
<
string
,
object
>
arguments
,
StringBuilder
builder
,
params
string
[]
fields
)
public
DynamicParameters
GetDynamicParameters
(
Dictionary
<
string
,
object
>
arguments
,
params
string
[]
fields
)
{
{
DynamicParameters
parameters
=
new
DynamicParameters
();
DynamicParameters
parameters
=
new
DynamicParameters
();
if
(
arguments
==
null
||
!
arguments
.
Any
())
return
parameters
;
if
(
arguments
==
null
||
!
arguments
.
Any
())
return
parameters
;
...
@@ -99,7 +97,6 @@ public DynamicParameters GetDynamicParameters(Dictionary<string, object> argumen
...
@@ -99,7 +97,6 @@ public DynamicParameters GetDynamicParameters(Dictionary<string, object> argumen
if
(
arguments
.
ContainsKey
(
item
))
if
(
arguments
.
ContainsKey
(
item
))
{
{
parameters
.
Add
(
item
.
ToLower
(),
arguments
[
item
]);
parameters
.
Add
(
item
.
ToLower
(),
arguments
[
item
]);
builder
.
Append
(
$" and
{
item
.
ToLower
()}
=@
{
item
.
ToLower
()}
"
);
}
}
}
}
}
}
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
2922823f
...
@@ -142,10 +142,10 @@
...
@@ -142,10 +142,10 @@
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.his_import_clinic"
>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.his_import_clinic"
>
<summary>
</summary>
<summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.his_import
_summary
"
>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.his_import
data
"
>
<summary>
</summary>
<summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.his_
importdata
"
>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.his_
script
"
>
<summary>
</summary>
<summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.hos_personfee"
>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.hos_personfee"
>
...
@@ -2498,51 +2498,6 @@
...
@@ -2498,51 +2498,6 @@
创建时间
创建时间
</summary>
</summary>
</member>
</member>
<member
name=
"T:Performance.EntityModels.his_import_summary"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.Id"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.HospitalId"
>
<summary>
医院ID
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.AllotId"
>
<summary>
ID
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.Year"
>
<summary>
绩效发放年
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.Month"
>
<summary>
绩效发放月
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.AccountingUnit"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.RealGiveFee"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.CreateTime"
>
<summary>
创建时间
</summary>
</member>
<member
name=
"T:Performance.EntityModels.his_script"
>
<member
name=
"T:Performance.EntityModels.his_script"
>
<summary>
<summary>
...
...
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
2922823f
...
@@ -105,8 +105,6 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
...
@@ -105,8 +105,6 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
/// <summary> </summary>
/// <summary> </summary>
public
virtual
DbSet
<
his_import_clinic
>
his_import_clinic
{
get
;
set
;
}
public
virtual
DbSet
<
his_import_clinic
>
his_import_clinic
{
get
;
set
;
}
/// <summary> </summary>
/// <summary> </summary>
public
virtual
DbSet
<
his_import_summary
>
his_import_summary
{
get
;
set
;
}
/// <summary> </summary>
public
virtual
DbSet
<
his_importdata
>
his_importdata
{
get
;
set
;
}
public
virtual
DbSet
<
his_importdata
>
his_importdata
{
get
;
set
;
}
/// <summary> </summary>
/// <summary> </summary>
public
virtual
DbSet
<
his_script
>
his_script
{
get
;
set
;
}
public
virtual
DbSet
<
his_script
>
his_script
{
get
;
set
;
}
...
...
performance/Performance.EntityModels/Entity/his_import_summary.cs
deleted
100644 → 0
View file @
68035f62
//-----------------------------------------------------------------------
// <copyright file=" his_import_summary.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
namespace
Performance.EntityModels
{
/// <summary>
///
/// </summary>
[
Table
(
"his_import_summary"
)]
public
class
his_import_summary
{
/// <summary>
///
/// </summary>
[
Key
]
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 医院ID
/// </summary>
public
int
HospitalId
{
get
;
set
;
}
/// <summary>
/// ID
/// </summary>
public
int
AllotId
{
get
;
set
;
}
/// <summary>
/// 绩效发放年
/// </summary>
public
int
Year
{
get
;
set
;
}
/// <summary>
/// 绩效发放月
/// </summary>
public
int
Month
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
AccountingUnit
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
decimal
>
RealGiveFee
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
Nullable
<
DateTime
>
CreateTime
{
get
;
set
;
}
}
}
performance/Performance.Repository/Repository/PerforHisimportsummaryRepository.cs
deleted
100644 → 0
View file @
68035f62
//-----------------------------------------------------------------------
// <copyright file=" his_import_summary.cs">
// * FileName: his_import_summary.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
Performance.EntityModels
;
namespace
Performance.Repository
{
/// <summary>
/// his_import_summary Repository
/// </summary>
public
partial
class
PerforHisimportsummaryRepository
:
PerforRepository
<
his_import_summary
>
{
public
PerforHisimportsummaryRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
}
}
}
performance/Performance.Services/GraphQLService.cs
View file @
2922823f
...
@@ -52,7 +52,7 @@ public ReportData GetReport(int reportId)
...
@@ -52,7 +52,7 @@ public ReportData GetReport(int reportId)
return
new
ReportData
(
report
);
return
new
ReportData
(
report
);
}
}
public
List
<
ChartData
>
GetChartData
(
int
reportId
,
DynamicParameters
parameters
,
string
where
=
null
)
public
List
<
ChartData
>
GetChartData
(
int
reportId
,
DynamicParameters
parameters
)
{
{
if
(
reportId
==
0
)
return
new
List
<
ChartData
>();
if
(
reportId
==
0
)
return
new
List
<
ChartData
>();
...
@@ -62,7 +62,8 @@ public List<ChartData> GetChartData(int reportId, DynamicParameters parameters,
...
@@ -62,7 +62,8 @@ public List<ChartData> GetChartData(int reportId, DynamicParameters parameters,
if
(
report
==
null
||
string
.
IsNullOrEmpty
(
report
.
Content
))
return
new
List
<
ChartData
>();
if
(
report
==
null
||
string
.
IsNullOrEmpty
(
report
.
Content
))
return
new
List
<
ChartData
>();
var
sql
=
report
.
Content
.
ToLower
();
var
sql
=
report
.
Content
.
ToLower
();
if
(!
string
.
IsNullOrEmpty
(
where
))
sql
=
sql
.
Replace
(
"{wh}"
,
where
);
string
where
=
GetQueryCondition
(
sql
,
parameters
);
sql
=
sql
.
Replace
(
"{wh}"
,
where
);
var
chartData
=
repreportRepository
.
DapperQuery
<
ChartData
>(
sql
,
parameters
,
60
*
5
);
var
chartData
=
repreportRepository
.
DapperQuery
<
ChartData
>(
sql
,
parameters
,
60
*
5
);
...
@@ -75,7 +76,7 @@ public List<ChartData> GetChartData(int reportId, DynamicParameters parameters,
...
@@ -75,7 +76,7 @@ public List<ChartData> GetChartData(int reportId, DynamicParameters parameters,
}
}
}
}
public
List
<
ReportTable
>
GetReportPerformance
(
int
reportId
,
DynamicParameters
parameters
,
string
where
=
null
)
public
List
<
ReportTable
>
GetReportPerformance
(
int
reportId
,
DynamicParameters
parameters
)
{
{
if
(
reportId
==
0
)
return
new
List
<
ReportTable
>();
if
(
reportId
==
0
)
return
new
List
<
ReportTable
>();
...
@@ -85,7 +86,8 @@ public List<ReportTable> GetReportPerformance(int reportId, DynamicParameters pa
...
@@ -85,7 +86,8 @@ public List<ReportTable> GetReportPerformance(int reportId, DynamicParameters pa
if
(
report
==
null
||
string
.
IsNullOrEmpty
(
report
.
Content
))
return
new
List
<
ReportTable
>();
if
(
report
==
null
||
string
.
IsNullOrEmpty
(
report
.
Content
))
return
new
List
<
ReportTable
>();
var
sql
=
report
.
Content
.
ToLower
();
var
sql
=
report
.
Content
.
ToLower
();
if
(!
string
.
IsNullOrEmpty
(
where
))
sql
=
sql
.
Replace
(
"{wh}"
,
where
);
string
where
=
GetQueryCondition
(
sql
,
parameters
);
sql
=
sql
.
Replace
(
"{wh}"
,
where
);
var
chartData
=
repreportRepository
.
DapperQuery
<
ReportTable
>(
sql
,
parameters
,
60
*
5
);
var
chartData
=
repreportRepository
.
DapperQuery
<
ReportTable
>(
sql
,
parameters
,
60
*
5
);
...
@@ -97,5 +99,22 @@ public List<ReportTable> GetReportPerformance(int reportId, DynamicParameters pa
...
@@ -97,5 +99,22 @@ public List<ReportTable> GetReportPerformance(int reportId, DynamicParameters pa
return
new
List
<
ReportTable
>();
return
new
List
<
ReportTable
>();
}
}
}
}
private
string
GetQueryCondition
(
string
sql
,
DynamicParameters
parameters
)
{
StringBuilder
builder
=
new
StringBuilder
();
if
(
parameters
!=
null
&&
parameters
.
ParameterNames
.
Any
())
{
foreach
(
var
parameter
in
parameters
.
ParameterNames
.
Select
(
t
=>
t
))
{
string
key
=
"@"
+
parameter
;
if
(
sql
.
IndexOf
(
key
)
==
-
1
)
{
builder
.
Append
(
$" and
{
parameter
}
=
{
key
}
"
);
}
}
}
return
builder
.
ToString
();
}
}
}
}
}
performance/Performance.Services/ReportGlobalService.cs
View file @
2922823f
...
@@ -19,7 +19,6 @@ public class ReportGlobalService : IAutoInjection
...
@@ -19,7 +19,6 @@ 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
PerforHisimportaccountRepository
hisimportaccountRepository
;
private
readonly
PerforHisimportclinicRepository
hisimportclinicRepository
;
private
readonly
PerforHisimportclinicRepository
hisimportclinicRepository
;
private
readonly
PerforHisimportbaiscnormRepository
hisimportbaiscnormRepository
;
private
readonly
PerforHisimportbaiscnormRepository
hisimportbaiscnormRepository
;
...
@@ -31,7 +30,6 @@ public class ReportGlobalService : IAutoInjection
...
@@ -31,7 +30,6 @@ public class ReportGlobalService : IAutoInjection
PerforPerallotRepository
perallotRepository
,
PerforPerallotRepository
perallotRepository
,
PerforReportglobalRepository
reportglobalRepository
,
PerforReportglobalRepository
reportglobalRepository
,
PerforHisimportdataRepository
hisimportdataRepository
,
PerforHisimportdataRepository
hisimportdataRepository
,
PerforHisimportsummaryRepository
hisimportsummaryRepository
,
PerforHisimportaccountRepository
hisimportaccountRepository
,
PerforHisimportaccountRepository
hisimportaccountRepository
,
PerforHisimportclinicRepository
hisimportclinicRepository
,
PerforHisimportclinicRepository
hisimportclinicRepository
,
PerforHisimportbaiscnormRepository
hisimportbaiscnormRepository
,
PerforHisimportbaiscnormRepository
hisimportbaiscnormRepository
,
...
@@ -43,7 +41,6 @@ PerforReportperformancepersontagsRepository reportperformancepersontagsRepositor
...
@@ -43,7 +41,6 @@ PerforReportperformancepersontagsRepository reportperformancepersontagsRepositor
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
.
hisimportaccountRepository
=
hisimportaccountRepository
;
this
.
hisimportclinicRepository
=
hisimportclinicRepository
;
this
.
hisimportclinicRepository
=
hisimportclinicRepository
;
this
.
hisimportbaiscnormRepository
=
hisimportbaiscnormRepository
;
this
.
hisimportbaiscnormRepository
=
hisimportbaiscnormRepository
;
...
@@ -181,6 +178,8 @@ public void ImportAllotData(int hospitalId, string filePath)
...
@@ -181,6 +178,8 @@ public void ImportAllotData(int hospitalId, string filePath)
var
allots
=
perallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
var
allots
=
perallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
var
basicnormData
=
new
List
<
his_import_baiscnorm
>();
for
(
int
sheetIndex
=
0
;
sheetIndex
<
workbook
.
NumberOfSheets
;
sheetIndex
++)
for
(
int
sheetIndex
=
0
;
sheetIndex
<
workbook
.
NumberOfSheets
;
sheetIndex
++)
{
{
var
sheet
=
workbook
.
GetSheetAt
(
sheetIndex
);
var
sheet
=
workbook
.
GetSheetAt
(
sheetIndex
);
...
@@ -196,7 +195,7 @@ public void ImportAllotData(int hospitalId, string filePath)
...
@@ -196,7 +195,7 @@ public void ImportAllotData(int hospitalId, string filePath)
switch
(
sheetName
)
switch
(
sheetName
)
{
{
case
"科室绩效"
:
case
"科室绩效"
:
ImporAccountData
(
sheet
,
columns
,
hospitalId
,
allots
);
ImporAccountData
(
sheet
,
columns
,
hospitalId
,
allots
,
basicnormData
);
break
;
break
;
case
"科室标签"
:
case
"科室标签"
:
...
@@ -204,7 +203,7 @@ public void ImportAllotData(int hospitalId, string filePath)
...
@@ -204,7 +203,7 @@ public void ImportAllotData(int hospitalId, string filePath)
break
;
break
;
case
"科主任护士长绩效"
:
case
"科主任护士长绩效"
:
ImporClinicData
(
sheet
,
columns
,
hospitalId
,
allots
);
ImporClinicData
(
sheet
,
columns
,
hospitalId
,
allots
,
basicnormData
);
break
;
break
;
case
"科主任护士长标签"
:
case
"科主任护士长标签"
:
...
@@ -217,6 +216,19 @@ public void ImportAllotData(int hospitalId, string filePath)
...
@@ -217,6 +216,19 @@ public void ImportAllotData(int hospitalId, string filePath)
}
}
logger
.
LogInformation
(
$"
{
sheetName
}
读取已结束"
);
logger
.
LogInformation
(
$"
{
sheetName
}
读取已结束"
);
}
}
#
region
人均绩效
if
(
basicnormData
!=
null
&&
basicnormData
.
Any
())
{
foreach
(
var
item
in
basicnormData
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
{
hisimportbaiscnormRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
}
hisimportbaiscnormRepository
.
BulkInsert
(
basicnormData
);
}
#
endregion
科室总绩效
人均绩效
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
@@ -226,6 +238,8 @@ public void ImportAllotData(int hospitalId, string filePath)
...
@@ -226,6 +238,8 @@ 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
)
private
void
ImportBasicData
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
,
List
<
per_allot
>
allots
,
string
sheetName
,
string
sourceType
)
{
{
if
(
string
.
IsNullOrEmpty
(
sourceType
))
return
;
var
data
=
new
List
<
his_importdata
>();
var
data
=
new
List
<
his_importdata
>();
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
{
{
...
@@ -265,7 +279,7 @@ private void ImportBasicData(ISheet sheet, List<string> columns, int hospitalId,
...
@@ -265,7 +279,7 @@ 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
ImporAccountData
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
,
List
<
per_allot
>
allots
)
private
void
ImporAccountData
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
,
List
<
per_allot
>
allots
,
List
<
his_import_baiscnorm
>
basicnormData
)
{
{
var
data
=
new
List
<
his_import_account
>();
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
++)
...
@@ -295,47 +309,6 @@ private void ImporAccountData(ISheet sheet, List<string> columns, int hospitalId
...
@@ -295,47 +309,6 @@ private void ImporAccountData(ISheet sheet, List<string> columns, int hospitalId
t
.
CreateTime
=
dateTime
;
t
.
CreateTime
=
dateTime
;
});
});
#
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
.
BulkInsert
(
summaryData
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
#
endregion
his_import_summary
#
region
his_import_account
临床科室绩效
logger
.
LogInformation
(
$"临床科室绩效"
);
string
[]
clinicAccountTypes
=
new
string
[]
{
UnitType
.
医生组
.
ToString
(),
UnitType
.
护理组
.
ToString
(),
UnitType
.
医技组
.
ToString
(),
UnitType
.
其他医生组
.
ToString
(),
UnitType
.
其他护理组
.
ToString
(),
UnitType
.
其他医技组
.
ToString
(),
UnitType
.
特殊核算组
.
ToString
()
};
if
(
data
.
Any
(
t
=>
clinicAccountTypes
.
Contains
(
t
.
UnitType
)))
{
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
{
hisimportaccountRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
}
hisimportaccountRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
&&
clinicAccountTypes
.
Contains
(
t
.
UnitType
)));
}
#
endregion
his_import_account
#
region
his_import_baiscnorm
人均绩效计算
#
region
his_import_baiscnorm
人均绩效计算
logger
.
LogInformation
(
$"人均绩效计算"
);
logger
.
LogInformation
(
$"人均绩效计算"
);
Dictionary
<
string
,
string
>
basicDict
=
new
Dictionary
<
string
,
string
>
Dictionary
<
string
,
string
>
basicDict
=
new
Dictionary
<
string
,
string
>
...
@@ -348,7 +321,7 @@ private void ImporAccountData(ISheet sheet, List<string> columns, int hospitalId
...
@@ -348,7 +321,7 @@ private void ImporAccountData(ISheet sheet, List<string> columns, int hospitalId
List
<
his_import_baiscnorm
>
baiscnorms
=
new
List
<
his_import_baiscnorm
>();
List
<
his_import_baiscnorm
>
baiscnorms
=
new
List
<
his_import_baiscnorm
>();
foreach
(
var
item
in
basicDict
)
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
basicnormData
.
AddRange
(
data
.
Where
(
t
=>
t
.
UnitType
==
item
.
Value
).
GroupBy
(
t
=>
new
{
t
.
AllotId
,
t
.
Year
,
t
.
Month
}).
Select
(
t
=>
new
his_import_baiscnorm
{
{
HospitalId
=
hospitalId
,
HospitalId
=
hospitalId
,
AllotId
=
t
.
Key
.
AllotId
??
0
,
AllotId
=
t
.
Key
.
AllotId
??
0
,
...
@@ -359,15 +332,18 @@ private void ImporAccountData(ISheet sheet, List<string> columns, int hospitalId
...
@@ -359,15 +332,18 @@ private void ImporAccountData(ISheet sheet, List<string> columns, int hospitalId
TotelNumber
=
t
.
Sum
(
s
=>
s
.
Number
),
TotelNumber
=
t
.
Sum
(
s
=>
s
.
Number
),
AvgValue
=
t
.
Sum
(
s
=>
s
.
Number
)
==
0
?
0
:
t
.
Sum
(
s
=>
s
.
RealGiveFee
)
/
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
CreateTime
=
dateTime
});
}));
baiscnorms
.
AddRange
(
basicnormData
);
}
}
foreach
(
var
item
in
baiscnorms
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
,
t
.
PositionName
}).
Distinct
())
#
endregion
his_import_baiscnorm
#
region
his_import_account
临床科室绩效
logger
.
LogInformation
(
$"临床科室绩效"
);
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
{
{
hisimport
baiscnormRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
&&
t
.
PositionName
==
item
.
PositionName
);
hisimport
accountRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
}
}
hisimport
baiscnormRepository
.
BulkInsert
(
baiscnorms
);
hisimport
accountRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
)
);
#
endregion
his_import_
baiscnorm
#
endregion
his_import_
account
}
}
private
void
ImporAccountTag
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
)
private
void
ImporAccountTag
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
)
...
@@ -404,7 +380,7 @@ private void ImporAccountTag(ISheet sheet, List<string> columns, int hospitalId)
...
@@ -404,7 +380,7 @@ private void ImporAccountTag(ISheet sheet, List<string> columns, int hospitalId)
reportperformancetagsRepository
.
BulkInsert
(
data
.
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
UnitType
)
&&
!
string
.
IsNullOrEmpty
(
t
.
AccountingUnit
)));
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
)
private
void
ImporClinicData
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
,
List
<
per_allot
>
allots
,
List
<
his_import_baiscnorm
>
basicnormData
)
{
{
var
data
=
new
List
<
his_import_clinic
>();
var
data
=
new
List
<
his_import_clinic
>();
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
for
(
int
rowIndex
=
1
;
rowIndex
<
sheet
.
LastRowNum
+
1
;
rowIndex
++)
...
@@ -437,15 +413,6 @@ private void ImporClinicData(ISheet sheet, List<string> columns, int hospitalId,
...
@@ -437,15 +413,6 @@ 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
())
{
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
));
#
endregion
his_import_clinic
#
region
his_import_baiscnorm
人均绩效计算
#
region
his_import_baiscnorm
人均绩效计算
logger
.
LogInformation
(
$"人均绩效计算"
);
logger
.
LogInformation
(
$"人均绩效计算"
);
Dictionary
<
string
,
string
>
basicDict
=
new
Dictionary
<
string
,
string
>
Dictionary
<
string
,
string
>
basicDict
=
new
Dictionary
<
string
,
string
>
...
@@ -457,7 +424,7 @@ private void ImporClinicData(ISheet sheet, List<string> columns, int hospitalId,
...
@@ -457,7 +424,7 @@ private void ImporClinicData(ISheet sheet, List<string> columns, int hospitalId,
List
<
his_import_baiscnorm
>
baiscnorms
=
new
List
<
his_import_baiscnorm
>();
List
<
his_import_baiscnorm
>
baiscnorms
=
new
List
<
his_import_baiscnorm
>();
foreach
(
var
item
in
basicDict
)
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
basicnormData
.
AddRange
(
data
.
Where
(
t
=>
t
.
UnitType
==
item
.
Value
).
GroupBy
(
t
=>
new
{
t
.
AllotId
,
t
.
Year
,
t
.
Month
}).
Select
(
t
=>
new
his_import_baiscnorm
{
{
HospitalId
=
hospitalId
,
HospitalId
=
hospitalId
,
AllotId
=
t
.
Key
.
AllotId
??
0
,
AllotId
=
t
.
Key
.
AllotId
??
0
,
...
@@ -468,15 +435,18 @@ private void ImporClinicData(ISheet sheet, List<string> columns, int hospitalId,
...
@@ -468,15 +435,18 @@ private void ImporClinicData(ISheet sheet, List<string> columns, int hospitalId,
TotelNumber
=
t
.
Sum
(
s
=>
s
.
Basics
),
TotelNumber
=
t
.
Sum
(
s
=>
s
.
Basics
),
AvgValue
=
t
.
Sum
(
s
=>
s
.
Basics
)
==
0
?
0
:
t
.
Sum
(
s
=>
s
.
RealGiveFee
)
/
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
CreateTime
=
dateTime
});
}));
baiscnorms
.
AddRange
(
basicnormData
);
}
}
foreach
(
var
item
in
baiscnorms
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
,
t
.
PositionName
}).
Distinct
())
#
endregion
his_import_baiscnorm
#
region
his_import_clinic
科主任护士长绩效
logger
.
LogInformation
(
$"科主任护士长绩效"
);
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
{
{
hisimport
baiscnormRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
&&
t
.
PositionName
==
item
.
PositionName
);
hisimport
clinicRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
}
}
hisimport
baiscnormRepository
.
BulkInsert
(
baiscnorms
);
hisimport
clinicRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
)
);
#
endregion
his_import_
baiscnorm
#
endregion
his_import_
clinic
}
}
private
void
ImporClinicTag
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
)
private
void
ImporClinicTag
(
ISheet
sheet
,
List
<
string
>
columns
,
int
hospitalId
)
...
@@ -491,8 +461,8 @@ private void ImporClinicTag(ISheet sheet, List<string> columns, int hospitalId)
...
@@ -491,8 +461,8 @@ private void ImporClinicTag(ISheet sheet, List<string> columns, int hospitalId)
{
{
UnitType
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元类型"
),
UnitType
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元类型"
),
AccountingUnit
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元"
),
AccountingUnit
=
GetCellValue
<
string
>(
row
,
columns
,
"核算单元"
),
PersonnelName
=
GetCellValue
<
string
>(
row
,
columns
,
"
工号
"
),
PersonnelName
=
GetCellValue
<
string
>(
row
,
columns
,
"
姓名
"
),
PersonnelNumber
=
GetCellValue
<
string
>(
row
,
columns
,
"
姓名
"
),
PersonnelNumber
=
GetCellValue
<
string
>(
row
,
columns
,
"
工号
"
),
Tag1
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag1"
),
Tag1
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag1"
),
Tag2
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag2"
),
Tag2
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag2"
),
Tag3
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag3"
),
Tag3
=
GetCellValue
<
string
>(
row
,
columns
,
"Tag3"
),
...
...
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