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
adefae09
Commit
adefae09
authored
Feb 25, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提取数据时,5.x~6.x的核算单元和4.1中保持一致
parent
b0b2d449
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
141 additions
and
3 deletions
+141
-3
performance/Performance.Services/CollectService.cs
+141
-3
No files found.
performance/Performance.Services/CollectService.cs
View file @
adefae09
...
@@ -30,6 +30,7 @@ public class CollectService : IAutoInjection
...
@@ -30,6 +30,7 @@ public class CollectService : IAutoInjection
private
readonly
PerforCollectpermissionRepository
perforcollectpermissionRepository
;
private
readonly
PerforCollectpermissionRepository
perforcollectpermissionRepository
;
private
readonly
PerforUserroleRepository
userroleRepository
;
private
readonly
PerforUserroleRepository
userroleRepository
;
private
readonly
PerforImaccountbasicRepository
perforImaccountbasicRepository
;
private
readonly
PerforImaccountbasicRepository
perforImaccountbasicRepository
;
private
readonly
PerforPerdeptdicRepository
perforPerdeptdicRepository
;
private
readonly
SheetSevice
sheetSevice
;
private
readonly
SheetSevice
sheetSevice
;
private
readonly
Application
options
;
private
readonly
Application
options
;
...
@@ -46,6 +47,7 @@ public class CollectService : IAutoInjection
...
@@ -46,6 +47,7 @@ public class CollectService : IAutoInjection
PerforCollectpermissionRepository
perforcollectpermissionRepository
,
PerforCollectpermissionRepository
perforcollectpermissionRepository
,
PerforUserroleRepository
userroleRepository
,
PerforUserroleRepository
userroleRepository
,
PerforImaccountbasicRepository
perforImaccountbasicRepository
,
PerforImaccountbasicRepository
perforImaccountbasicRepository
,
PerforPerdeptdicRepository
perforPerdeptdicRepository
,
SheetSevice
sheetSevice
,
SheetSevice
sheetSevice
,
IOptions
<
Application
>
options
)
IOptions
<
Application
>
options
)
{
{
...
@@ -61,6 +63,7 @@ public class CollectService : IAutoInjection
...
@@ -61,6 +63,7 @@ public class CollectService : IAutoInjection
this
.
perforcollectpermissionRepository
=
perforcollectpermissionRepository
;
this
.
perforcollectpermissionRepository
=
perforcollectpermissionRepository
;
this
.
userroleRepository
=
userroleRepository
;
this
.
userroleRepository
=
userroleRepository
;
this
.
perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
this
.
perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
this
.
perforPerdeptdicRepository
=
perforPerdeptdicRepository
;
this
.
sheetSevice
=
sheetSevice
;
this
.
sheetSevice
=
sheetSevice
;
this
.
options
=
options
.
Value
;
this
.
options
=
options
.
Value
;
}
}
...
@@ -368,11 +371,27 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
...
@@ -368,11 +371,27 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
LogisticsEmployee
)
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
LogisticsEmployee
)
rowDatas
=
GetLogisticsEmployee
(
sheet
);
rowDatas
=
GetLogisticsEmployee
(
sheet
);
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountBasic
)
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountBasic
)
rowDatas
=
GetAccountBasic
(
sheet
);
{
List
<
HandsonCellData
>
cells
=
new
List
<
HandsonCellData
>();
var
dept
=
perforPerdeptdicRepository
.
GetAccountBasicAccountingUnit
(
allot
.
HospitalId
);
rowDatas
=
GetAccountBasic
(
sheet
,
dept
,
cells
);
}
else
else
rowDatas
=
GetCommonData
(
sheet
);
rowDatas
=
GetCommonData
(
sheet
);
}
}
//补全核算单元和类型
var
sTypes
=
new
[]
{
(
int
)
SheetType
.
AccountExtra
,
(
int
)
SheetType
.
PersonExtra
,
(
int
)
SheetType
.
AccountDrugAssess
,
(
int
)
SheetType
.
AccountMaterialsAssess
};
var
sTypeName
=
new
[]
{
"6.1目标考核"
,
"6.6 科室预算比例"
};
if
(
sTypes
.
Contains
((
int
)
sheet
.
SheetType
)
||
sTypeName
.
Contains
(
sheet
.
SheetName
))
{
List
<
HandsonCellData
>
cells
=
new
List
<
HandsonCellData
>();
var
perSheet
=
perforPersheetRepository
.
GetEntity
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetName
==
"4.1 临床科室医护绩效测算表"
);
var
dept
=
perforPerdeptdicRepository
.
GetAccountBasicAccountingUnit
(
allot
.
HospitalId
);
GetAccountBasic
(
perSheet
,
dept
,
cells
);
UnitFit
(
rowDatas
,
cells
,
sheet
);
}
if
(
rowDatas
==
null
||
!
rowDatas
.
Any
())
if
(
rowDatas
==
null
||
!
rowDatas
.
Any
())
rowDatas
=
GetAccountExtra
(
allot
,
sheet
.
SheetType
.
Value
);
rowDatas
=
GetAccountExtra
(
allot
,
sheet
.
SheetType
.
Value
);
...
@@ -514,10 +533,11 @@ private HandsonRowData CreateRowData(int row, ColumnInfo[] columns, SortedDictio
...
@@ -514,10 +533,11 @@ private HandsonRowData CreateRowData(int row, ColumnInfo[] columns, SortedDictio
return
xx
;
return
xx
;
}
}
private
List
<
HandsonRowData
>
GetAccountBasic
(
per_sheet
sheet
)
private
List
<
HandsonRowData
>
GetAccountBasic
(
per_sheet
sheet
,
IEnumerable
<
per_dept_dic
>
dept
,
List
<
HandsonCellData
>
cells
)
{
{
//var accounts = sheetSevice.SheetExport(sheet.ID);
//var accounts = sheetSevice.SheetExport(sheet.ID);
var
result
=
new
List
<
HandsonRowData
>();
var
result
=
new
List
<
HandsonRowData
>();
var
groupAccount
=
perforImdataRepository
.
GetEntities
(
t
=>
t
.
SheetID
==
sheet
.
ID
);
//.OrderBy(c=>c.RowNumber).GroupBy(c => c.RowNumber);
var
groupAccount
=
perforImdataRepository
.
GetEntities
(
t
=>
t
.
SheetID
==
sheet
.
ID
);
//.OrderBy(c=>c.RowNumber).GroupBy(c => c.RowNumber);
if
(
groupAccount
!=
null
&&
groupAccount
.
Any
())
if
(
groupAccount
!=
null
&&
groupAccount
.
Any
())
{
{
...
@@ -551,14 +571,28 @@ private List<HandsonRowData> GetAccountBasic(per_sheet sheet)
...
@@ -551,14 +571,28 @@ private List<HandsonRowData> GetAccountBasic(per_sheet sheet)
break
;
break
;
}
}
var
rowData
=
new
HandsonRowData
(
rowNumber
.
Value
,
data
);
var
rowData
=
new
HandsonRowData
(
rowNumber
.
Value
,
data
);
result
.
Add
(
rowData
);
result
.
Add
(
rowData
);
string
unit
=
""
;
string
type
=
""
;
foreach
(
var
cell
in
data
)
{
if
(
cell
.
Name
==
"核算单元"
)
{
unit
=
cell
.
Value
.
ToString
();
}
else
if
(
cell
.
Name
==
"核算单元类型"
)
{
type
=
cell
.
Value
.
ToString
();
}
}
cells
.
Add
(
new
HandsonCellData
(
unit
,
type
));
}
}
//var temps = accounts.Row.Select(item => new { row = item.Rownumber, dic = JsonHelper.Deserialize(item) });
//var temps = accounts.Row.Select(item => new { row = item.Rownumber, dic = JsonHelper.Deserialize(item) });
//return new List<HandsonRowData>(temps.Select(temp => CreateRowData(temp.row, ExcelReadConfig.AccountBaisc, temp.dic)));
//return new List<HandsonRowData>(temps.Select(temp => CreateRowData(temp.row, ExcelReadConfig.AccountBaisc, temp.dic)));
}
}
UnitFit
(
result
,
dept
,
cells
);
return
result
;
return
result
;
}
}
...
@@ -669,6 +703,110 @@ public void SaveCollectData(int allotId, SaveCollectData request)
...
@@ -669,6 +703,110 @@ public void SaveCollectData(int allotId, SaveCollectData request)
return
result
;
return
result
;
}
}
private
void
UnitFit
(
List
<
HandsonRowData
>
rowDatas
,
IEnumerable
<
per_dept_dic
>
dept
,
List
<
HandsonCellData
>
cellDatas
)
{
var
rowCount
=
rowDatas
.
Count
;
List
<
HandsonRowData
>
suppRowDatas
=
new
List
<
HandsonRowData
>();
foreach
(
var
dic
in
dept
)
{
bool
exists
=
false
;
bool
exists2
=
false
;
foreach
(
var
rowData
in
rowDatas
)
{
foreach
(
var
cellData
in
rowData
.
CellData
)
{
//var cell = rowData.CellData.Where(c => c.Value == dic.AccountingUnit).ToList();
if
(
cellData
.
Value
?.
ToString
()
==
dic
.
AccountingUnit
)
{
exists
=
true
;
}
if
(
exists
&&
cellData
.
Value
?.
ToString
()
==
dic
.
UnitType
)
{
exists2
=
true
;
}
}
}
if
((
exists
==
false
&&
exists2
==
false
)
||
exists2
==
false
)
{
cellDatas
.
Add
(
new
HandsonCellData
(
dic
.
AccountingUnit
,
dic
.
UnitType
));
var
cells
=
new
List
<
HandsonCellData
>();
cells
.
Add
(
new
HandsonCellData
(
"核算单元"
,
dic
.
AccountingUnit
));
cells
.
Add
(
new
HandsonCellData
(
"核算单元类型"
,
dic
.
UnitType
));
suppRowDatas
.
Add
(
new
HandsonRowData
(
rowCount
++,
cells
));
}
}
cellDatas
.
Distinct
().
ToList
();
rowDatas
.
AddRange
(
suppRowDatas
);
}
private
void
UnitFit
(
List
<
HandsonRowData
>
rowDatas
,
List
<
HandsonCellData
>
cellDatas
,
per_sheet
sheet
)
{
var
rowCount
=
rowDatas
.
Count
;
List
<
HandsonRowData
>
suppRowDatas
=
new
List
<
HandsonRowData
>();
foreach
(
var
cell
in
cellDatas
)
{
bool
exists
=
false
;
bool
exists2
=
false
;
var
cells
=
new
List
<
HandsonCellData
>();
if
(
cell
.
Name
==
"总务科"
)
{
var
ss
=
1
;
}
foreach
(
var
rowData
in
rowDatas
)
{
foreach
(
var
cellData
in
rowData
.
CellData
)
{
//var cell = rowData.CellData.Where(c => c.Value == dic.AccountingUnit).ToList();
if
(
cellData
.
Value
?.
ToString
()
==
cell
.
Name
)
{
exists
=
true
;
}
if
(
cellData
.
Name
==
"核算单元分类"
&&
cellData
.
Value
?.
ToString
()
==
cell
.
Value
)
{
exists2
=
true
;
}
else
if
(
cellData
.
Name
==
"核算组别"
&&
cellData
.
Value
?.
ToString
()
==
cell
.
Value
)
{
exists2
=
true
;
}
else
if
(
cellData
.
Name
==
"核算单元类型"
&&
cellData
.
Value
?.
ToString
()
==
cell
.
Value
)
{
exists2
=
true
;
}
else
{
exists2
=
true
;
}
}
}
if
(
exists
==
false
||
(
exists
==
false
&&
exists2
==
false
)
||
exists2
==
false
)
{
cells
.
Add
(
new
HandsonCellData
(
"核算单元"
,
cell
.
Name
));
if
(
sheet
.
SheetName
==
"5.2业务中层行政中高层医院奖罚"
)
{
cells
.
Add
(
new
HandsonCellData
(
"核算单元分类"
,
cell
.
Value
));
}
else
if
(
sheet
.
SheetName
==
"5.1 科室绩效医院奖罚"
)
{
cells
.
Add
(
new
HandsonCellData
(
"核算组别"
,
cell
.
Value
));
}
else
{
cells
.
Add
(
new
HandsonCellData
(
"核算单元类型"
,
cell
.
Value
));
}
suppRowDatas
.
Add
(
new
HandsonRowData
(++
rowCount
,
cells
));
}
}
rowDatas
.
AddRange
(
suppRowDatas
);
}
}
}
public
class
CollectDataConfig
public
class
CollectDataConfig
...
...
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