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
0c9df750
Commit
0c9df750
authored
Jun 06, 2019
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://192.168.0.110:8880/zry/performance
into develop
parents
dfd758f7
f0358673
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
1 deletions
+51
-1
performance/Performance.Repository/BaseRepository.cs
+4
-0
performance/Performance.Repository/Repository/PerforImdataRepository.cs
+8
-0
performance/Performance.Services/ExtractService.cs
+39
-1
No files found.
performance/Performance.Repository/BaseRepository.cs
View file @
0c9df750
...
@@ -27,6 +27,10 @@ public IEnumerable<TEntity> DapperQuery(string sql, object param)
...
@@ -27,6 +27,10 @@ public IEnumerable<TEntity> DapperQuery(string sql, object param)
{
{
return
context
.
Database
.
GetDbConnection
().
Query
<
TEntity
>(
sql
,
param
);
return
context
.
Database
.
GetDbConnection
().
Query
<
TEntity
>(
sql
,
param
);
}
}
public
IEnumerable
<
TEntity
>
DapperQuery
(
string
sql
,
object
param
,
int
?
commandTimeout
=
null
)
{
return
context
.
Database
.
GetDbConnection
().
Query
<
TEntity
>(
sql
,
param
,
commandTimeout
:
commandTimeout
);
}
public
int
Execute
(
string
sql
,
object
param
)
public
int
Execute
(
string
sql
,
object
param
)
{
{
...
...
performance/Performance.Repository/Repository/PerforImdataRepository.cs
View file @
0c9df750
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
// </copyright>
// </copyright>
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using
System
;
using
System
;
using
System.Collections.Generic
;
using
Performance.EntityModels
;
using
Performance.EntityModels
;
namespace
Performance.Repository
namespace
Performance.Repository
...
@@ -16,5 +17,12 @@ public partial class PerforImdataRepository : PerforRepository<im_data>
...
@@ -16,5 +17,12 @@ public partial class PerforImdataRepository : PerforRepository<im_data>
public
PerforImdataRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
public
PerforImdataRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
{
}
}
public
IEnumerable
<
im_data
>
GetAccountingUnit
(
List
<
int
>
sheetList
,
List
<
string
>
deptList
,
List
<
int
>
allotList
)
{
string
sql
=
"select distinct accountingUnit,department,unittype from im_data "
+
"where sheetid in @sheetList and department in @deptList and allotid in @allotList"
;
return
DapperQuery
(
sql
,
new
{
sheetList
,
deptList
,
allotList
},
1000
*
60
*
5
);
}
}
}
}
}
performance/Performance.Services/ExtractService.cs
View file @
0c9df750
...
@@ -32,6 +32,7 @@ public class ExtractService : IAutoInjection
...
@@ -32,6 +32,7 @@ public class ExtractService : IAutoInjection
private
readonly
PerforPersheetRepository
perforPersheetRepository
;
private
readonly
PerforPersheetRepository
perforPersheetRepository
;
private
readonly
PerforImheaderRepository
perforImheaderRepository
;
private
readonly
PerforImheaderRepository
perforImheaderRepository
;
private
readonly
PerforImemployeeRepository
perforImemployeeRepository
;
private
readonly
PerforImemployeeRepository
perforImemployeeRepository
;
private
readonly
PerforImdataRepository
perforImdataRepository
;
private
readonly
PerforImaccountbasicRepository
perforImaccountbasicRepository
;
private
readonly
PerforImaccountbasicRepository
perforImaccountbasicRepository
;
private
readonly
PerforExtractRepository
perforExtractRepository
;
private
readonly
PerforExtractRepository
perforExtractRepository
;
private
readonly
PerforPerfirstRepository
perforPerfirstRepository
;
private
readonly
PerforPerfirstRepository
perforPerfirstRepository
;
...
@@ -46,6 +47,7 @@ public class ExtractService : IAutoInjection
...
@@ -46,6 +47,7 @@ public class ExtractService : IAutoInjection
PerforPersheetRepository
perforPersheetRepository
,
PerforPersheetRepository
perforPersheetRepository
,
PerforImheaderRepository
perforImheaderRepository
,
PerforImheaderRepository
perforImheaderRepository
,
PerforImemployeeRepository
perforImemployeeRepository
,
PerforImemployeeRepository
perforImemployeeRepository
,
PerforImdataRepository
perforImdataRepository
,
PerforImaccountbasicRepository
perforImaccountbasicRepository
,
PerforImaccountbasicRepository
perforImaccountbasicRepository
,
PerforExtractRepository
perforExtractRepository
,
PerforExtractRepository
perforExtractRepository
,
PerforPerfirstRepository
perforPerfirstRepository
,
PerforPerfirstRepository
perforPerfirstRepository
,
...
@@ -60,6 +62,7 @@ public class ExtractService : IAutoInjection
...
@@ -60,6 +62,7 @@ public class ExtractService : IAutoInjection
this
.
perforPersheetRepository
=
perforPersheetRepository
;
this
.
perforPersheetRepository
=
perforPersheetRepository
;
this
.
perforImheaderRepository
=
perforImheaderRepository
;
this
.
perforImheaderRepository
=
perforImheaderRepository
;
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
this
.
perforImdataRepository
=
perforImdataRepository
;
this
.
perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
this
.
perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
this
.
perforExtractRepository
=
perforExtractRepository
;
this
.
perforExtractRepository
=
perforExtractRepository
;
this
.
perforPerfirstRepository
=
perforPerfirstRepository
;
this
.
perforPerfirstRepository
=
perforPerfirstRepository
;
...
@@ -262,7 +265,7 @@ private bool WriteExcel(string newpath, string originalPath, List<PerSheet> shee
...
@@ -262,7 +265,7 @@ private bool WriteExcel(string newpath, string originalPath, List<PerSheet> shee
}
}
//临床科室医护绩效测算表
//临床科室医护绩效测算表
else
if
(
SheetType
.
AccountBasic
==
sheet
.
SheetType
/*&& sheet.PerData != null && sheet.PerData.Any()*/
)
else
if
(
SheetType
.
AccountBasic
==
sheet
.
SheetType
&&
sheet
.
PerData
!=
null
&&
sheet
.
PerData
.
Any
()
)
{
{
LogHelper
.
Information
(
$"填充临床科室医护绩效测算表,"
,
"提取绩效数据"
);
LogHelper
.
Information
(
$"填充临床科室医护绩效测算表,"
,
"提取绩效数据"
);
var
dataList
=
sheet
.
PerData
.
ConvertAll
(
new
Converter
<
IPerData
,
PerDataAccountBaisc
>(
t
=>
(
PerDataAccountBaisc
)
t
));
var
dataList
=
sheet
.
PerData
.
ConvertAll
(
new
Converter
<
IPerData
,
PerDataAccountBaisc
>(
t
=>
(
PerDataAccountBaisc
)
t
));
...
@@ -331,6 +334,13 @@ private bool WriteExcel(string newpath, string originalPath, List<PerSheet> shee
...
@@ -331,6 +334,13 @@ private bool WriteExcel(string newpath, string originalPath, List<PerSheet> shee
var
connection
=
ConnectionBuilder
.
Create
(
DatabaseType
.
SqlServer
,
hospitalConfig
.
DbSource
,
hospitalConfig
.
DbName
,
hospitalConfig
.
DbUser
,
hospitalConfig
.
DbPassword
);
var
connection
=
ConnectionBuilder
.
Create
(
DatabaseType
.
SqlServer
,
hospitalConfig
.
DbSource
,
hospitalConfig
.
DbName
,
hospitalConfig
.
DbUser
,
hospitalConfig
.
DbPassword
);
var
dataList
=
perforExtractRepository
.
ExecuteScript
(
connection
,
script
.
ExecuteScript
,
null
);
var
dataList
=
perforExtractRepository
.
ExecuteScript
(
connection
,
script
.
ExecuteScript
,
null
);
LogHelper
.
Information
(
$"写入SQL脚本执行结果"
,
"提取绩效数据"
);
LogHelper
.
Information
(
$"写入SQL脚本执行结果"
,
"提取绩效数据"
);
//用于查询核算单元
var
deptList
=
dataList
.
Where
(
t
=>
t
.
ColumnName
==
"科室名称"
).
Select
(
t
=>
t
.
Value
.
ToString
()).
Distinct
().
ToList
();
var
sheetIdList
=
perforPersheetRepository
.
GetEntities
(
t
=>
t
.
SheetType
==
(
int
)
sheet
.
SheetType
).
Select
(
t
=>
t
.
ID
).
ToList
();
var
allotIdList
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
).
Select
(
t
=>
t
.
ID
).
ToList
();
var
imdata
=
perforImdataRepository
.
GetAccountingUnit
(
sheetIdList
,
deptList
,
allotIdList
);
//创建数据行
//创建数据行
foreach
(
var
pointRow
in
dataList
.
Select
(
t
=>
t
.
RowNumber
).
Distinct
().
OrderBy
(
t
=>
t
))
foreach
(
var
pointRow
in
dataList
.
Select
(
t
=>
t
.
RowNumber
).
Distinct
().
OrderBy
(
t
=>
t
))
{
{
...
@@ -344,6 +354,34 @@ private bool WriteExcel(string newpath, string originalPath, List<PerSheet> shee
...
@@ -344,6 +354,34 @@ private bool WriteExcel(string newpath, string originalPath, List<PerSheet> shee
{
{
importRow
.
CreateCell
(
headInfo
.
PointCell
).
SetCellValue
(
Verify
(
data
.
Value
.
ToString
()));
importRow
.
CreateCell
(
headInfo
.
PointCell
).
SetCellValue
(
Verify
(
data
.
Value
.
ToString
()));
}
}
if
(
data
.
ColumnName
==
"科室名称"
)
{
//补充核算单元
if
(
sheet
.
SheetType
==
SheetType
.
Income
)
{
var
doctor
=
imdata
.
FirstOrDefault
(
t
=>
t
.
UnitType
==
1
&&
t
.
Department
==
data
.
Value
.
ToString
());
if
(
doctor
!=
null
)
importRow
.
CreateCell
(
0
).
SetCellValue
(
doctor
.
AccountingUnit
);
var
nurse
=
imdata
.
FirstOrDefault
(
t
=>
t
.
UnitType
==
2
&&
t
.
Department
==
data
.
Value
.
ToString
());
if
(
nurse
!=
null
)
importRow
.
CreateCell
(
1
).
SetCellValue
(
nurse
.
AccountingUnit
);
}
else
if
(
sheet
.
SheetType
==
SheetType
.
Workload
)
{
if
(
sheet
.
SheetName
.
Contains
(
"医生"
))
{
var
doctor
=
imdata
.
FirstOrDefault
(
t
=>
t
.
UnitType
==
1
&&
t
.
Department
==
data
.
Value
.
ToString
());
if
(
doctor
!=
null
)
importRow
.
CreateCell
(
0
).
SetCellValue
(
doctor
.
AccountingUnit
);
}
else
{
var
nurse
=
imdata
.
FirstOrDefault
(
t
=>
t
.
UnitType
==
2
&&
t
.
Department
==
data
.
Value
.
ToString
());
if
(
nurse
!=
null
)
importRow
.
CreateCell
(
0
).
SetCellValue
(
nurse
.
AccountingUnit
);
}
}
}
}
}
}
}
}
}
...
...
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