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
3aaa548d
Commit
3aaa548d
authored
Nov 08, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报表sql修改
parent
8ddcaf41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
42 deletions
+61
-42
performance/Performance.Services/SecondAllotService.cs
+61
-42
No files found.
performance/Performance.Services/SecondAllotService.cs
View file @
3aaa548d
...
...
@@ -435,18 +435,8 @@ public SecondResponse GetSecondDetail(UseTempRequest request)
var
usetemp
=
perforAgusetempRepository
.
GetEntity
(
t
=>
t
.
HospitalId
==
request
.
HospitalId
&&
t
.
Department
==
request
.
Department
&&
t
.
UnitType
==
request
.
UnitType
);
if
(
usetemp
==
null
)
throw
new
PerformanceException
(
"当前科室暂未配置绩效模板"
);
//获取固定模板列头
var
tempItem
=
perforAgtempitemRepository
.
GetEntities
(
t
=>
t
.
TempId
==
usetemp
.
UseTempId
);
var
headItems
=
Mapper
.
Map
<
List
<
HeadItem
>>(
tempItem
)
??
new
List
<
HeadItem
>();
//获取工作量列头
var
workItem
=
perforAgworkloadRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
usetemp
.
HospitalId
&&
t
.
Department
==
usetemp
.
Department
&&
t
.
UnitType
==
usetemp
.
UnitType
);
if
(
workItem
!=
null
&&
workItem
.
Count
>
0
)
{
var
workDtos
=
Mapper
.
Map
<
List
<
HeadItem
>>(
workItem
);
workDtos
.
ForEach
(
t
=>
{
t
.
Type
=
3
;
});
headItems
.
AddRange
(
workDtos
);
}
//获取固定模板列 + 工作量列
var
headItems
=
GetHeadItems
(
usetemp
.
UseTempId
.
Value
,
usetemp
.
HospitalId
.
Value
,
usetemp
.
Department
,
usetemp
.
UnitType
);
var
result
=
new
SecondResponse
{
HeadItems
=
headItems
,
BodyItems
=
new
List
<
BodyItem
>()
};
//获取数据
...
...
@@ -478,21 +468,7 @@ public SecondResponse GetSecondDetail(UseTempRequest request)
foreach
(
var
row
in
rows
)
{
var
header
=
row
==
-
1
?
headItems
.
Where
(
t
=>
t
.
Type
==
1
).
ToList
()
:
headItems
.
Where
(
t
=>
t
.
Type
!=
1
).
ToList
();
foreach
(
var
item
in
header
)
{
var
bodyItem
=
new
BodyItem
{
RowNumber
=
row
,
FiledId
=
item
.
FiledId
,
FiledName
=
item
.
FiledName
,
FactorValue
=
item
.
FactorValue
,
SourceType
=
item
.
SourceType
,
Type
=
item
.
Type
,
Sort
=
item
.
Sort
,
Value
=
fixatList
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
row
&&
t
.
ItemName
==
item
.
FiledName
)?.
ItemValue
};
result
.
BodyItems
.
Add
(
bodyItem
);
}
result
.
BodyItems
.
AddRange
(
GetBodyItems
(
header
,
2
,
fixatitems
:
fixatList
,
row
:
row
));
}
}
else
...
...
@@ -500,24 +476,67 @@ public SecondResponse GetSecondDetail(UseTempRequest request)
var
second
=
perforAgsecondallotRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
SecondId
);
var
config
=
perforCofagainRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
second
.
AllotId
&&
t
.
Department
==
request
.
Department
)
??
new
List
<
cof_again
>();
config
.
Add
(
new
cof_again
{
TypeName
=
"绩效合计(考核后)"
,
Value
=
second
.
RealGiveFee
});
foreach
(
var
item
in
headItems
.
Where
(
t
=>
t
.
Type
==
1
))
{
var
bodyItem
=
new
BodyItem
{
RowNumber
=
-
1
,
FiledId
=
item
.
FiledId
,
FiledName
=
item
.
FiledName
,
FactorValue
=
item
.
FactorValue
,
SourceType
=
item
.
SourceType
,
Type
=
item
.
Type
,
Sort
=
item
.
Sort
,
Value
=
config
.
FirstOrDefault
(
t
=>
t
.
TypeName
==
item
.
FiledName
)?.
Value
.
ToString
()
};
result
.
BodyItems
.
Add
(
bodyItem
);
}
result
.
BodyItems
.
AddRange
(
GetBodyItems
(
headItems
.
Where
(
t
=>
t
.
Type
==
1
).
ToList
(),
1
,
configs
:
config
));
result
.
BodyItems
.
FirstOrDefault
(
t
=>
t
.
FiledName
==
"发放月份"
).
Value
=
$"
{
second
.
Year
}
年
{
second
.
Month
}
月"
;
}
return
result
;
}
/// <summary>
///
/// </summary>
/// <param name="tempId">模板Id</param>
/// <param name="hospitalId">医院Id</param>
/// <param name="department">科室</param>
/// <param name="unitType">核算单元类型</param>
/// <returns></returns>
public
List
<
HeadItem
>
GetHeadItems
(
int
tempId
,
int
hospitalId
,
string
department
,
string
unitType
)
{
var
tempItem
=
perforAgtempitemRepository
.
GetEntities
(
t
=>
t
.
TempId
==
tempId
);
var
headItems
=
Mapper
.
Map
<
List
<
HeadItem
>>(
tempItem
)
??
new
List
<
HeadItem
>();
//获取工作量列头
var
workItem
=
perforAgworkloadRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Department
==
department
&&
t
.
UnitType
==
unitType
);
if
(
workItem
!=
null
&&
workItem
.
Count
>
0
)
{
var
workDtos
=
Mapper
.
Map
<
List
<
HeadItem
>>(
workItem
);
workDtos
.
ForEach
(
t
=>
{
t
.
Type
=
3
;
});
headItems
.
AddRange
(
workDtos
);
}
return
headItems
;
}
/// <summary>
/// 获取 展示数据
/// </summary>
/// <param name="headItems">列</param>
/// <param name="source">数据来源 1. 二次绩效配置 2. 保存数据 </param>
/// <param name="configs">二次绩效配置</param>
/// <param name="fixatitems">保存数据</param>
/// <param name="row">行号</param>
/// <returns></returns>
public
List
<
BodyItem
>
GetBodyItems
(
List
<
HeadItem
>
headItems
,
int
source
,
List
<
cof_again
>
configs
=
null
,
List
<
ag_fixatitem
>
fixatitems
=
null
,
int
?
row
=
null
)
{
var
bodyItems
=
new
List
<
BodyItem
>();
foreach
(
var
item
in
headItems
)
{
var
bodyItem
=
new
BodyItem
{
RowNumber
=
-
1
,
FiledId
=
item
.
FiledId
,
FiledName
=
item
.
FiledName
,
FactorValue
=
item
.
FactorValue
,
SourceType
=
item
.
SourceType
,
Type
=
item
.
Type
,
Sort
=
item
.
Sort
,
Value
=
source
==
1
?
configs
.
FirstOrDefault
(
t
=>
t
.
TypeName
==
item
.
FiledName
)?.
Value
.
ToString
()
:
fixatitems
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
row
&&
t
.
ItemName
==
item
.
FiledName
)?.
ItemValue
};
bodyItems
.
Add
(
bodyItem
);
}
return
bodyItems
;
}
}
}
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