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
b86bc909
Commit
b86bc909
authored
Jun 05, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收入、工作量的核算单元,数据填充
parent
8aa2b332
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
3 deletions
+52
-3
performance/Performance.Repository/BaseRepository.cs
+4
-0
performance/Performance.Repository/Repository/PerforImdataRepository.cs
+9
-1
performance/Performance.Services/ExtractService.cs
+39
-2
No files found.
performance/Performance.Repository/BaseRepository.cs
View file @
b86bc909
...
...
@@ -27,6 +27,10 @@ public IEnumerable<TEntity> DapperQuery(string sql, object 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
)
{
...
...
performance/Performance.Repository/Repository/PerforImdataRepository.cs
View file @
b86bc909
...
...
@@ -4,6 +4,7 @@
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.Collections.Generic
;
using
Performance.EntityModels
;
namespace
Performance.Repository
...
...
@@ -13,8 +14,15 @@ namespace Performance.Repository
/// </summary>
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
)
{
string
sql
=
"select distinct accountingUnit,department,unittype from im_data "
+
"where sheetid in @sheetList and department in @deptList"
;
return
DapperQuery
(
sql
,
new
{
sheetList
,
deptList
},
1000
*
60
*
5
);
}
}
}
performance/Performance.Services/ExtractService.cs
View file @
b86bc909
...
...
@@ -32,6 +32,7 @@ public class ExtractService : IAutoInjection
private
readonly
PerforPersheetRepository
perforPersheetRepository
;
private
readonly
PerforImheaderRepository
perforImheaderRepository
;
private
readonly
PerforImemployeeRepository
perforImemployeeRepository
;
private
readonly
PerforImdataRepository
perforImdataRepository
;
private
readonly
PerforImaccountbasicRepository
perforImaccountbasicRepository
;
private
readonly
PerforExtractRepository
perforExtractRepository
;
private
readonly
PerforPerfirstRepository
perforPerfirstRepository
;
...
...
@@ -46,6 +47,7 @@ public class ExtractService : IAutoInjection
PerforPersheetRepository
perforPersheetRepository
,
PerforImheaderRepository
perforImheaderRepository
,
PerforImemployeeRepository
perforImemployeeRepository
,
PerforImdataRepository
perforImdataRepository
,
PerforImaccountbasicRepository
perforImaccountbasicRepository
,
PerforExtractRepository
perforExtractRepository
,
PerforPerfirstRepository
perforPerfirstRepository
,
...
...
@@ -60,6 +62,7 @@ public class ExtractService : IAutoInjection
this
.
perforPersheetRepository
=
perforPersheetRepository
;
this
.
perforImheaderRepository
=
perforImheaderRepository
;
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
this
.
perforImdataRepository
=
perforImdataRepository
;
this
.
perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
this
.
perforExtractRepository
=
perforExtractRepository
;
this
.
perforPerfirstRepository
=
perforPerfirstRepository
;
...
...
@@ -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
(
$"填充临床科室医护绩效测算表,"
,
"提取绩效数据"
);
var
dataList
=
sheet
.
PerData
.
ConvertAll
(
new
Converter
<
IPerData
,
PerDataAccountBaisc
>(
t
=>
(
PerDataAccountBaisc
)
t
));
...
...
@@ -331,6 +334,12 @@ 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
dataList
=
perforExtractRepository
.
ExecuteScript
(
connection
,
script
.
ExecuteScript
,
null
);
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
imdata
=
perforImdataRepository
.
GetAccountingUnit
(
sheetIdList
,
deptList
);
//创建数据行
foreach
(
var
pointRow
in
dataList
.
Select
(
t
=>
t
.
RowNumber
).
Distinct
().
OrderBy
(
t
=>
t
))
{
...
...
@@ -344,6 +353,34 @@ private bool WriteExcel(string newpath, string originalPath, List<PerSheet> shee
{
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
);
}
}
}
}
}
}
...
...
@@ -416,7 +453,7 @@ private List<PerSheet> GetRepositoryData(int allotId)
}
return
sheetList
;
}
/// <summary>
/// 获取sheet及列头
/// </summary>
...
...
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