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
911392b9
Commit
911392b9
authored
Mar 12, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/feature/dongfang' into feature/dongfang
parents
af06d961
9dbcb36e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
475 additions
and
307 deletions
+475
-307
performance/Performance.Api/Controllers/ConfigController.cs
+153
-153
performance/Performance.Api/wwwroot/Performance.Api.xml
+0
-84
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
+1
-0
performance/Performance.Infrastructure/Helper/CommonHelper.cs
+65
-0
performance/Performance.Repository/PerforPerAllotRepository.cs
+16
-0
performance/Performance.Services/ReportService.cs
+1
-0
performance/Performance.Services/SecondAllotService.cs
+239
-70
No files found.
performance/Performance.Api/Controllers/ConfigController.cs
View file @
911392b9
...
...
@@ -26,60 +26,60 @@ public ConfigController(ConfigService configService, AllotService allotService)
_allotService
=
allotService
;
}
#
region
director
/// <summary>
/// 获取规模/效率绩效配置列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"directorlist"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
DirectorResponse
>>
GetDireList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
DirectorRequest
request
)
{
var
list
=
_configService
.
GetDireList
(
request
.
AllotID
);
return
new
ApiResponse
<
List
<
DirectorResponse
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
//
#region director
///
//
<summary>
///
//
获取规模/效率绩效配置列表
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("directorlist")]
//
[HttpPost]
//
public ApiResponse<List<DirectorResponse>> GetDireList([CustomizeValidator(RuleSet = "Select"), FromBody]DirectorRequest request)
//
{
//
var list = _configService.GetDireList(request.AllotID);
//
return new ApiResponse<List<DirectorResponse>>(ResponseType.OK, "ok", list);
//
}
/// <summary>
/// 新增规模/效率绩效配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"direinsert"
)]
[
HttpPost
]
public
ApiResponse
<
DirectorResponse
>
DireInsert
([
CustomizeValidator
(
RuleSet
=
"Insert"
),
FromBody
]
DirectorRequest
request
)
{
var
director
=
_configService
.
DireInsert
(
request
);
return
new
ApiResponse
<
DirectorResponse
>(
ResponseType
.
OK
,
director
);
}
///
//
<summary>
///
//
新增规模/效率绩效配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("direinsert")]
//
[HttpPost]
//
public ApiResponse<DirectorResponse> DireInsert([CustomizeValidator(RuleSet = "Insert"), FromBody]DirectorRequest request)
//
{
//
var director = _configService.DireInsert(request);
//
return new ApiResponse<DirectorResponse>(ResponseType.OK, director);
//
}
/// <summary>
/// 更新规模/效率绩效配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"direupdate"
)]
[
HttpPost
]
public
ApiResponse
<
DirectorResponse
>
DireUpdate
([
CustomizeValidator
(
RuleSet
=
"Update"
),
FromBody
]
DirectorRequest
request
)
{
var
director
=
_configService
.
DireUpdate
(
request
);
return
new
ApiResponse
<
DirectorResponse
>(
ResponseType
.
OK
,
director
);
}
///
//
<summary>
///
//
更新规模/效率绩效配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("direupdate")]
//
[HttpPost]
//
public ApiResponse<DirectorResponse> DireUpdate([CustomizeValidator(RuleSet = "Update"), FromBody]DirectorRequest request)
//
{
//
var director = _configService.DireUpdate(request);
//
return new ApiResponse<DirectorResponse>(ResponseType.OK, director);
//
}
/// <summary>
/// 删除规模/效率绩效配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"diredelete"
)]
[
HttpPost
]
public
ApiResponse
DireDelete
([
CustomizeValidator
(
RuleSet
=
"Delete"
),
FromBody
]
DirectorRequest
request
)
{
if
(!
_configService
.
DireDelete
(
request
))
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
#
endregion
///
//
<summary>
///
//
删除规模/效率绩效配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("diredelete")]
//
[HttpPost]
//
public ApiResponse DireDelete([CustomizeValidator(RuleSet = "Delete"), FromBody]DirectorRequest request)
//
{
//
if (!_configService.DireDelete(request))
//
return new ApiResponse(ResponseType.Fail);
//
return new ApiResponse(ResponseType.OK);
//
}
//
#endregion
#
region
drugprop
/// <summary>
...
...
@@ -191,115 +191,115 @@ public ApiResponse DrugtypeDelete([CustomizeValidator(RuleSet = "Delete"), FromB
}
#
endregion
#
region
income
/// <summary>
/// 获取ICU有效收入配置列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"incomelist"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
IncomeResponse
>>
GetIncomeList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
IncomeRequest
request
)
{
var
list
=
_configService
.
GetIncomeList
(
request
.
AllotID
);
return
new
ApiResponse
<
List
<
IncomeResponse
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
//
#region income
///
//
<summary>
///
//
获取ICU有效收入配置列表
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("incomelist")]
//
[HttpPost]
//
public ApiResponse<List<IncomeResponse>> GetIncomeList([CustomizeValidator(RuleSet = "Select"), FromBody]IncomeRequest request)
//
{
//
var list = _configService.GetIncomeList(request.AllotID);
//
return new ApiResponse<List<IncomeResponse>>(ResponseType.OK, "ok", list);
//
}
/// <summary>
/// 新增ICU有效收入配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"incomeinsert"
)]
[
HttpPost
]
public
ApiResponse
<
IncomeResponse
>
Insert
([
CustomizeValidator
(
RuleSet
=
"Insert"
),
FromBody
]
IncomeRequest
request
)
{
var
income
=
_configService
.
IncomeInsert
(
request
);
return
new
ApiResponse
<
IncomeResponse
>(
ResponseType
.
OK
,
income
);
}
///
//
<summary>
///
//
新增ICU有效收入配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("incomeinsert")]
//
[HttpPost]
//
public ApiResponse<IncomeResponse> Insert([CustomizeValidator(RuleSet = "Insert"), FromBody]IncomeRequest request)
//
{
//
var income = _configService.IncomeInsert(request);
//
return new ApiResponse<IncomeResponse>(ResponseType.OK, income);
//
}
/// <summary>
/// 修改ICU有效收入配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"incomeupdate"
)]
[
HttpPost
]
public
ApiResponse
<
IncomeResponse
>
Update
([
CustomizeValidator
(
RuleSet
=
"Update"
),
FromBody
]
IncomeRequest
request
)
{
var
income
=
_configService
.
IncomeUpdate
(
request
);
return
new
ApiResponse
<
IncomeResponse
>(
ResponseType
.
OK
,
income
);
}
///
//
<summary>
///
//
修改ICU有效收入配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("incomeupdate")]
//
[HttpPost]
//
public ApiResponse<IncomeResponse> Update([CustomizeValidator(RuleSet = "Update"), FromBody]IncomeRequest request)
//
{
//
var income = _configService.IncomeUpdate(request);
//
return new ApiResponse<IncomeResponse>(ResponseType.OK, income);
//
}
/// <summary>
/// 删除ICU有效收入配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"incomedelete"
)]
[
HttpPost
]
public
ApiResponse
Delete
([
CustomizeValidator
(
RuleSet
=
"Delete"
),
FromBody
]
IncomeRequest
request
)
{
if
(!
_configService
.
IncomeDelete
(
request
))
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
#
endregion
///
//
<summary>
///
//
删除ICU有效收入配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("incomedelete")]
//
[HttpPost]
//
public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]IncomeRequest request)
//
{
//
if (!_configService.IncomeDelete(request))
//
return new ApiResponse(ResponseType.Fail);
//
return new ApiResponse(ResponseType.OK);
//
}
//
#endregion
#
region
workyear
/// <summary>
/// 获取年资系数配置列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"workyearlist"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
WorkyearResponse
>>
GetWorkList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
WorkyearRequest
request
)
{
var
list
=
_configService
.
GetWorkList
(
request
.
AllotID
);
return
new
ApiResponse
<
List
<
WorkyearResponse
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
//
#region workyear
///
//
<summary>
///
//
获取年资系数配置列表
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("workyearlist")]
//
[HttpPost]
//
public ApiResponse<List<WorkyearResponse>> GetWorkList([CustomizeValidator(RuleSet = "Select"), FromBody]WorkyearRequest request)
//
{
//
var list = _configService.GetWorkList(request.AllotID);
//
return new ApiResponse<List<WorkyearResponse>>(ResponseType.OK, "ok", list);
//
}
/// <summary>
/// 新增年资系数配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"workinsert"
)]
[
HttpPost
]
public
ApiResponse
<
WorkyearResponse
>
WorkyearInsert
([
CustomizeValidator
(
RuleSet
=
"Insert"
),
FromBody
]
WorkyearRequest
request
)
{
var
workyear
=
_configService
.
WorkInsert
(
request
);
return
new
ApiResponse
<
WorkyearResponse
>(
ResponseType
.
OK
,
workyear
);
}
///
//
<summary>
///
//
新增年资系数配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("workinsert")]
//
[HttpPost]
//
public ApiResponse<WorkyearResponse> WorkyearInsert([CustomizeValidator(RuleSet = "Insert"), FromBody]WorkyearRequest request)
//
{
//
var workyear = _configService.WorkInsert(request);
//
return new ApiResponse<WorkyearResponse>(ResponseType.OK, workyear);
//
}
/// <summary>
/// 修改年资系数配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"workupdate"
)]
[
HttpPost
]
public
ApiResponse
<
WorkyearResponse
>
WorkyearUpdate
([
CustomizeValidator
(
RuleSet
=
"Update"
),
FromBody
]
WorkyearRequest
request
)
{
var
workyear
=
_configService
.
WorkUpdate
(
request
);
return
new
ApiResponse
<
WorkyearResponse
>(
ResponseType
.
OK
,
workyear
);
}
///
//
<summary>
///
//
修改年资系数配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("workupdate")]
//
[HttpPost]
//
public ApiResponse<WorkyearResponse> WorkyearUpdate([CustomizeValidator(RuleSet = "Update"), FromBody]WorkyearRequest request)
//
{
//
var workyear = _configService.WorkUpdate(request);
//
return new ApiResponse<WorkyearResponse>(ResponseType.OK, workyear);
//
}
/// <summary>
/// 删除年资系数配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"workdelete"
)]
[
HttpPost
]
public
ApiResponse
WorkyearDelete
([
CustomizeValidator
(
RuleSet
=
"Delete"
),
FromBody
]
WorkyearRequest
request
)
{
if
(!
_configService
.
WorkDelete
(
request
))
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
#
endregion
///
//
<summary>
///
//
删除年资系数配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("workdelete")]
//
[HttpPost]
//
public ApiResponse WorkyearDelete([CustomizeValidator(RuleSet = "Delete"), FromBody]WorkyearRequest request)
//
{
//
if (!_configService.WorkDelete(request))
//
return new ApiResponse(ResponseType.Fail);
//
return new ApiResponse(ResponseType.OK);
//
}
//
#endregion
#
region
cofagain
/// <summary>
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
911392b9
...
...
@@ -249,34 +249,6 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetDireList(Performance.DtoModels.DirectorRequest)"
>
<summary>
获取规模/效率绩效配置列表
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.DireInsert(Performance.DtoModels.DirectorRequest)"
>
<summary>
新增规模/效率绩效配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.DireUpdate(Performance.DtoModels.DirectorRequest)"
>
<summary>
更新规模/效率绩效配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.DireDelete(Performance.DtoModels.DirectorRequest)"
>
<summary>
删除规模/效率绩效配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetDrugList(Performance.DtoModels.DrugpropRequest)"
>
<summary>
获取 药占比配置信息列表
...
...
@@ -333,62 +305,6 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetIncomeList(Performance.DtoModels.IncomeRequest)"
>
<summary>
获取ICU有效收入配置列表
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.Insert(Performance.DtoModels.IncomeRequest)"
>
<summary>
新增ICU有效收入配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.Update(Performance.DtoModels.IncomeRequest)"
>
<summary>
修改ICU有效收入配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.Delete(Performance.DtoModels.IncomeRequest)"
>
<summary>
删除ICU有效收入配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetWorkList(Performance.DtoModels.WorkyearRequest)"
>
<summary>
获取年资系数配置列表
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.WorkyearInsert(Performance.DtoModels.WorkyearRequest)"
>
<summary>
新增年资系数配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.WorkyearUpdate(Performance.DtoModels.WorkyearRequest)"
>
<summary>
修改年资系数配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.WorkyearDelete(Performance.DtoModels.WorkyearRequest)"
>
<summary>
删除年资系数配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetAgainList(Performance.DtoModels.CofAgainRequest)"
>
<summary>
获取二次绩效配置列表
...
...
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
View file @
911392b9
...
...
@@ -191,6 +191,7 @@ public AutoMapperConfigs()
CreateMap
<
ag_fixatitem
,
BodyItem
>()
.
ForMember
(
dest
=>
dest
.
FiledName
,
opt
=>
opt
.
MapFrom
(
src
=>
src
.
ItemName
))
.
ForMember
(
dest
=>
dest
.
Value
,
opt
=>
opt
.
MapFrom
(
src
=>
src
.
ItemValue
));
CreateMap
<
HeadItem
,
BodyItem
>().
ReverseMap
();
CreateMap
<
ag_temp
,
SecondTempResponse
>();
CreateMap
<
ag_secondallot
,
SecondListResponse
>().
ReverseMap
();
...
...
performance/Performance.Infrastructure/Helper/CommonHelper.cs
0 → 100644
View file @
911392b9
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Reflection
;
using
System.Text
;
namespace
Performance.Infrastructure
{
public
static
class
CommonHelper
{
public
static
IEnumerable
<
T
>
ToDistinct
<
T
>(
this
IEnumerable
<
T
>
source
)
{
return
source
.
Distinct
(
new
TCompare
<
T
>());
}
public
static
IEnumerable
<
T
>
ToDistinct
<
T
,
C
>(
this
IEnumerable
<
T
>
source
,
Func
<
T
,
C
>
field
)
{
return
source
.
Distinct
(
new
TCompare
<
T
,
C
>(
field
));
}
public
class
TCompare
<
T
>
:
IEqualityComparer
<
T
>
{
public
bool
Equals
(
T
x
,
T
y
)
{
try
{
bool
result
=
true
;
PropertyInfo
[]
propertyInfos
=
typeof
(
T
).
GetProperties
();
foreach
(
var
propertyInfo
in
propertyInfos
)
//可设置i的起始值或判断i的值,来跳过不需要比较的字段
{
result
=
propertyInfo
.
GetValue
(
x
,
null
)?.
ToString
()
==
propertyInfo
.
GetValue
(
y
,
null
)?.
ToString
();
if
(!
result
)
break
;
}
return
result
;
}
catch
{
return
false
;
}
}
public
int
GetHashCode
(
T
obj
)
{
return
1
;
}
}
public
class
TCompare
<
T
,
C
>
:
IEqualityComparer
<
T
>
{
private
readonly
Func
<
T
,
C
>
field
;
public
TCompare
(
Func
<
T
,
C
>
field
)
{
this
.
field
=
field
;
}
public
bool
Equals
(
T
x
,
T
y
)
{
return
EqualityComparer
<
C
>.
Default
.
Equals
(
field
(
x
),
field
(
y
));
}
public
int
GetHashCode
(
T
obj
)
{
return
EqualityComparer
<
C
>.
Default
.
GetHashCode
(
field
(
obj
));
}
}
}
}
performance/Performance.Repository/PerforPerAllotRepository.cs
View file @
911392b9
...
...
@@ -34,5 +34,21 @@ public int ImportData(int allotId)
select distinct allotid,year,month,hospitalid,sourcetype,department,typename,cellvalue from view_report_original_income where allotid=@allotId;"
;
return
Execute
(
sql
,
new
{
allotId
});
}
/// <summary>
///
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public
int
SupplyData
(
int
allotId
)
{
string
sql
=
@"
insert into cof_drugtype(charge,allotid) select distinct id.typename charge,
@allotId allotid from im_data id
inner join per_sheet ps on id.sheetid = ps.id
where id.allotid = @allotId and ps.sheettype = 3 and ifnull(id.typename, '') != ''
and id.typename not in (select charge from cof_drugtype where allotid = @allotId);"
;
return
Execute
(
sql
,
new
{
allotId
});
}
}
}
performance/Performance.Services/ReportService.cs
View file @
911392b9
...
...
@@ -228,6 +228,7 @@ internal int ImportData(int allotId)
{
try
{
var
flag
=
perforPerallotRepository
.
SupplyData
(
allotId
);
return
perforPerallotRepository
.
ImportData
(
allotId
);
}
catch
{
}
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
911392b9
...
...
@@ -63,6 +63,7 @@ public class SecondAllotService : IAutoInjection
this
.
perforCofagainRepository
=
perforCofagainRepository
;
this
.
perforAgothersourceRepository
=
perforAgothersourceRepository
;
}
#
region
二次绩效列表与数据保存
/// <summary>
/// 获取二次绩效列表
...
...
@@ -131,13 +132,122 @@ public List<SecondListResponse> GetSecondList(int userId)
return
list
;
}
#
region
二次绩效详情
///// <summary>
///// 二次绩效详情
///// </summary>
///// <returns></returns>
//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 second = perforAgsecondallotRepository.GetEntity(t => t.Id == request.SecondId);
// //获取固定模板列 + 工作量列
// var headItems = GetHeadItems(usetemp.UseTempId.Value, usetemp.HospitalId.Value, usetemp.Department, usetemp.UnitType);
// var result = new SecondResponse { HeadItems = headItems, BodyItems = new List<BodyItem>() };
// //获取已录入数据
// var fixatList = perforAgfixatitemRepository.GetEntities(t => t.SecondId == request.SecondId && t.RowNumber.HasValue);
// if (request.IsArchive == 1 || new List<int> { 2, 3 }.Contains(second.Status ?? 1)) //归档 等待审核、审核通过
// {
// #region 已归档数据,根据数据获取 列
// if (fixatList == null || fixatList.Where(t => t.RowNumber != -1).Count() == 0)
// throw new PerformanceException("提交时未添加数据。");
// else
// {
// var existHead = fixatList.Select(t => new { FiledName = t.ItemName, Sort = t.Sort.Value, SourceType = t.SourceType.Value, Type = t.Type.Value, FactorValue = t.FactorValue.Value }).Distinct().ToList();
// headItems = existHead.Select(t => new HeadItem
// {
// FiledId = headItems.FirstOrDefault(h => h.FiledName == t.FiledName && h.Type == t.Type)?.FiledId ?? "无FiledId",
// FiledName = t.FiledName,
// Sort = headItems.FirstOrDefault(h => h.FiledName == t.FiledName && h.Type == t.Type)?.Sort ?? 0,
// SourceType = t.SourceType,
// Type = t.Type,
// FactorValue = headItems.FirstOrDefault(h => h.FiledName == t.FiledName && h.Type == t.Type)?.FactorValue ?? 0
// }).ToList();
// result.HeadItems = headItems;
// }
// #endregion
// }
// //未归档
// if (fixatList != null && fixatList.Where(t => t.RowNumber != -1).Count() > 0)
// {
// var rows = fixatList.Select(t => t.RowNumber.Value).Distinct();
// foreach (var row in rows)
// {
// var header = row == -1 ? headItems.Where(t => t.Type == 1).ToList() : headItems.Where(t => t.Type != 1).ToList();
// result.BodyItems.AddRange(GetBodyItems(header, 2, fixatitems: fixatList, row: row));
// }
// }
// else if (fixatList == null || (fixatList != null && fixatList.Where(t => t.RowNumber != -1).Count() == 0))
// {
// #region 补充历史绩效需要带出的数据
// var bringhead = headItems.Where(t => t.IsBring == 1).ToList();
// if (bringhead != null && bringhead.Count > 0)
// {
// var allotIds = perforPerallotRepository.GetEntities(t => t.HospitalId == request.HospitalId).Select(a => a.ID);
// var secondIdList = perforAgsecondallotRepository.GetEntities(t => allotIds.Contains(t.AllotId.Value)
// && t.Department == request.Department && t.UnitType == request.UnitType)
// .OrderBy(t => t.Year).ThenBy(t => t.Month).Select(t => t.Id).ToList();
// var index = secondIdList.IndexOf(request.SecondId);
// if (index != 0)
// fixatList = perforAgfixatitemRepository.GetEntities(t => t.SecondId == secondIdList.ElementAt(index - 1) && t.RowNumber.HasValue);
// fixatList = fixatList?.Where(t => bringhead.Select(h => h.FiledName).Contains(t.ItemName)).ToList();
// if (fixatList != null && fixatList.Count > 0)
// {
// var rows = fixatList.Select(t => t.RowNumber.Value).Distinct();
// foreach (var row in rows)
// {
// var header = row == -1 ? bringhead.Where(t => t.Type == 1).ToList() : bringhead.Where(t => t.Type != 1).ToList();
// result.BodyItems.AddRange(GetBodyItems(header, 2, fixatitems: fixatList, row: row));
// }
// }
// }
// #endregion
// }
// if (fixatList == null || (fixatList != null && fixatList.Where(t => t.RowNumber == -1).Count() == 0))
// {
// var config = perforCofagainRepository.GetEntities(t => t.AllotID == second.AllotId && t.Department == request.Department) ?? new List<cof_again>();
// #region 补充顶部数据
// config.Add(new cof_again { TypeName = "绩效合计(考核后)", Value = second.RealGiveFee });
// 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}月";
// #endregion
// }
// return new SecondResponse
// {
// HeadItems = result.HeadItems.OrderBy(t => t.Type).ThenBy(t => t.Sort).ThenBy(t => t.FiledName).ToList(),
// BodyItems = result.BodyItems.OrderBy(t => t.RowNumber).ThenBy(t => t.Type).ThenBy(t => t.Sort).ToList(),
// };
//}
///// <summary>
///// 二次绩效详情
///// </summary>
///// <returns></returns>
//public List<ag_othersource> GetSecondDetail(int secondid)
//{
// var others = perforAgothersourceRepository.GetEntities(t => t.SecondId == secondid);
// return others;
//}
#
endregion
#
region
二次绩效详情
-
使用中
/// <summary>
/// 二次绩效详情
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
SecondResponse
GetSecondDetail
(
UseTempRequest
request
)
{
var
usetemp
=
perforAgusetempRepository
.
GetEntity
(
t
=>
t
.
HospitalId
==
request
.
HospitalId
&&
t
.
Department
==
request
.
Department
&&
t
.
UnitType
==
request
.
UnitType
);
var
usetemp
=
perforAgusetempRepository
.
GetEntity
(
t
=>
t
.
HospitalId
==
request
.
HospitalId
&&
t
.
Department
==
request
.
Department
&&
t
.
UnitType
==
request
.
UnitType
);
//获取科室二次绩效费用分配使用的模板
if
(
usetemp
==
null
)
throw
new
PerformanceException
(
"当前科室暂未配置绩效模板"
);
...
...
@@ -145,93 +255,152 @@ public SecondResponse GetSecondDetail(UseTempRequest request)
//获取固定模板列 + 工作量列
var
headItems
=
GetHeadItems
(
usetemp
.
UseTempId
.
Value
,
usetemp
.
HospitalId
.
Value
,
usetemp
.
Department
,
usetemp
.
UnitType
);
var
result
=
new
SecondResponse
{
HeadItems
=
headItems
,
BodyItems
=
new
List
<
BodyItem
>()
}
;
//获取已录入数据
var
result
=
new
SecondResponse
()
;
var
fixatList
=
perforAgfixatitemRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
request
.
SecondId
&&
t
.
RowNumber
.
HasValue
);
if
(
request
.
IsArchive
==
1
||
new
List
<
int
>
{
2
,
3
}.
Contains
(
second
.
Status
??
1
))
//归档 等待审核、审核通过
//归档 或 等待审核、审核通过时,headItems不会随选择模板改动,带出已填写数据中的headItems
if
(
request
.
IsArchive
==
1
||
new
List
<
int
>
{
2
,
3
}.
Contains
(
second
.
Status
??
1
))
{
#
region
已归档数据,根据数据获取
列
if
(
fixatList
==
null
||
fixatList
.
Where
(
t
=>
t
.
RowNumber
!=
-
1
).
Count
()
==
0
)
throw
new
PerformanceException
(
"提交时未添加数据。"
);
else
{
var
existHead
=
fixatList
.
Select
(
t
=>
new
{
FiledName
=
t
.
ItemName
,
Sort
=
t
.
Sort
.
Value
,
SourceType
=
t
.
SourceType
.
Value
,
Type
=
t
.
Type
.
Value
,
FactorValue
=
t
.
FactorValue
.
Value
}).
Distinct
().
ToList
();
headItems
=
existHead
.
Select
(
t
=>
new
HeadItem
{
FiledId
=
headItems
.
FirstOrDefault
(
h
=>
h
.
FiledName
==
t
.
FiledName
&&
h
.
Type
==
t
.
Type
)?.
FiledId
??
"无FiledId"
,
FiledName
=
t
.
FiledName
,
Sort
=
headItems
.
FirstOrDefault
(
h
=>
h
.
FiledName
==
t
.
FiledName
&&
h
.
Type
==
t
.
Type
)?.
Sort
??
0
,
SourceType
=
t
.
SourceType
,
Type
=
t
.
Type
,
FactorValue
=
headItems
.
FirstOrDefault
(
h
=>
h
.
FiledName
==
t
.
FiledName
&&
h
.
Type
==
t
.
Type
)?.
FactorValue
??
0
}).
ToList
();
result
.
HeadItems
=
headItems
;
}
#
endregion
result
=
SubmittedData
(
fixatList
,
headItems
);
}
//未归档
if
(
fixatList
!=
null
&&
fixatList
.
Where
(
t
=>
t
.
RowNumber
!=
-
1
).
Count
()
>
0
)
else
{
var
rows
=
fixatList
.
Select
(
t
=>
t
.
RowNumber
.
Value
).
Distinct
();
foreach
(
var
row
in
rows
)
result
=
new
SecondResponse
{
HeadItems
=
headItems
};
//判断是否有数据
//有数据 带出历史数据
if
(
fixatList
!=
null
&&
fixatList
.
Any
())
{
var
header
=
row
==
-
1
?
headItems
.
Where
(
t
=>
t
.
Type
==
1
).
ToList
()
:
headItems
.
Where
(
t
=>
t
.
Type
!=
1
).
ToList
();
result
.
BodyItems
.
AddRange
(
GetBodyItems
(
header
,
2
,
fixatitems
:
fixatList
,
row
:
row
));
result
.
BodyItems
=
GetBodyItems
(
fixatList
,
headItems
);
if
(
fixatList
.
Where
(
t
=>
t
.
RowNumber
!=
-
1
)
==
null
||
!
fixatList
.
Where
(
t
=>
t
.
RowNumber
!=
-
1
).
Any
())
result
.
BodyItems
.
AddRange
(
GetBringItems
(
request
,
headItems
));
//更换模板时,会自动保存顶部数据
}
}
else
if
(
fixatList
==
null
||
(
fixatList
!=
null
&&
fixatList
.
Where
(
t
=>
t
.
RowNumber
!=
-
1
).
Count
()
==
0
))
{
#
region
补充历史绩效需要带出的数据
var
bringhead
=
headItems
.
Where
(
t
=>
t
.
IsBring
==
1
).
ToList
();
if
(
bringhead
!=
null
&&
bringhead
.
Count
>
0
)
else
{
var
allotIds
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
request
.
HospitalId
).
Select
(
a
=>
a
.
ID
);
var
secondIdList
=
perforAgsecondallotRepository
.
GetEntities
(
t
=>
allotIds
.
Contains
(
t
.
AllotId
.
Value
)
&&
t
.
Department
==
request
.
Department
&&
t
.
UnitType
==
request
.
UnitType
)
.
OrderBy
(
t
=>
t
.
Year
).
ThenBy
(
t
=>
t
.
Month
).
Select
(
t
=>
t
.
Id
).
ToList
();
var
index
=
secondIdList
.
IndexOf
(
request
.
SecondId
);
if
(
index
!=
0
)
fixatList
=
perforAgfixatitemRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondIdList
.
ElementAt
(
index
-
1
)
&&
t
.
RowNumber
.
HasValue
);
fixatList
=
fixatList
?.
Where
(
t
=>
bringhead
.
Select
(
h
=>
h
.
FiledName
).
Contains
(
t
.
ItemName
)).
ToList
();
if
(
fixatList
!=
null
&&
fixatList
.
Count
>
0
)
{
var
rows
=
fixatList
.
Select
(
t
=>
t
.
RowNumber
.
Value
).
Distinct
();
foreach
(
var
row
in
rows
)
{
var
header
=
row
==
-
1
?
bringhead
.
Where
(
t
=>
t
.
Type
==
1
).
ToList
()
:
bringhead
.
Where
(
t
=>
t
.
Type
!=
1
).
ToList
();
result
.
BodyItems
.
AddRange
(
GetBodyItems
(
header
,
2
,
fixatitems
:
fixatList
,
row
:
row
));
}
}
//无数据 根据IsBring带出历史二次绩效中需要带出的数据
result
.
BodyItems
=
GetBringItems
(
request
,
headItems
);
result
.
BodyItems
.
AddRange
(
Mapper
.
Map
<
List
<
BodyItem
>>(
headItems
.
Where
(
t
=>
t
.
Type
==
1
)));
}
#
endregion
}
if
(
fixatList
==
null
||
(
fixatList
!=
null
&&
fixatList
.
Where
(
t
=>
t
.
RowNumber
==
-
1
).
Count
()
==
0
))
{
var
config
=
perforCofagainRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
second
.
AllotId
&&
t
.
Department
==
request
.
Department
)
??
new
List
<
cof_again
>();
#
region
补充顶部数据
config
.
Add
(
new
cof_again
{
TypeName
=
"绩效合计(考核后)"
,
Value
=
second
.
RealGiveFee
});
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
}
月"
;
#
endregion
}
//检验 二次绩效配置 数据是否 有值,无则补充带出
FillData
(
second
,
result
.
BodyItems
);
return
new
SecondResponse
{
HeadItems
=
result
.
HeadItems
.
OrderBy
(
t
=>
t
.
Type
).
ThenBy
(
t
=>
t
.
Sort
).
ThenBy
(
t
=>
t
.
FiledName
).
ToList
(),
BodyItems
=
result
.
BodyItems
.
OrderBy
(
t
=>
t
.
RowNumber
).
ThenBy
(
t
=>
t
.
Type
).
ThenBy
(
t
=>
t
.
Sort
).
ToList
(),
};
;
}
/// <summary>
/// 根据已保存的数据返回
/// </summary>
/// <param name="fixatitems">已保存的数据</param>
/// <param name="headItems">列的名称、系数等值</param>
/// <returns></returns>
private
SecondResponse
SubmittedData
(
List
<
ag_fixatitem
>
fixatitems
,
List
<
HeadItem
>
headItems
)
{
var
header
=
fixatitems
.
Select
(
t
=>
new
{
t
.
ItemName
,
t
.
Type
,
t
.
Sort
}).
ToDistinct
().
ToList
();
var
result
=
new
SecondResponse
{
HeadItems
=
header
.
Select
(
t
=>
new
HeadItem
{
FiledId
=
headItems
.
FirstOrDefault
(
h
=>
h
.
FiledName
==
t
.
ItemName
&&
h
.
Type
==
t
.
Type
)?.
FiledId
??
t
.
ItemName
+
t
.
Type
,
FiledName
=
t
.
ItemName
,
Sort
=
t
.
Sort
.
Value
,
Type
=
t
.
Type
.
Value
,
FactorValue
=
headItems
.
FirstOrDefault
(
h
=>
h
.
FiledName
==
t
.
ItemName
&&
h
.
Type
==
t
.
Type
)?.
FactorValue
??
0
}).
ToList
()
};
result
.
BodyItems
=
GetBodyItems
(
fixatitems
,
headItems
);
return
result
;
}
///// <summary>
///// 二次绩效详情
///// </summary>
///// <returns></returns>
//public List<ag_othersource> GetSecondDetail(int secondid)
//{
// var others = perforAgothersourceRepository.GetEntities(t => t.SecondId == secondid);
// return others;
//}
/// <summary>
/// 获取历史数据
/// </summary>
/// <param name="fixatitems"></param>
/// <param name="headItems"></param>
/// <returns></returns>
private
List
<
BodyItem
>
GetBodyItems
(
List
<
ag_fixatitem
>
fixatitems
,
List
<
HeadItem
>
headItems
)
{
var
bodyItems
=
new
List
<
BodyItem
>();
if
(
fixatitems
!=
null
&&
fixatitems
.
Any
())
{
bodyItems
=
fixatitems
.
Select
(
t
=>
new
BodyItem
{
RowNumber
=
t
.
RowNumber
.
Value
,
FiledId
=
headItems
.
FirstOrDefault
(
h
=>
h
.
FiledName
==
t
.
ItemName
&&
h
.
Type
==
t
.
Type
)?.
FiledId
??
t
.
ItemName
+
t
.
Type
,
FiledName
=
t
.
ItemName
,
SourceType
=
t
.
SourceType
.
Value
,
Type
=
t
.
Type
.
Value
,
Value
=
t
.
ItemValue
}).
ToList
();
}
return
bodyItems
;
}
/// <summary>
/// 补充须带出的历史数据,如姓名、职称等
/// </summary>
/// <param name="request"></param>
/// <param name="headItems"></param>
/// <returns></returns>
private
List
<
BodyItem
>
GetBringItems
(
UseTempRequest
request
,
List
<
HeadItem
>
headItems
)
{
var
bodyItems
=
new
List
<
BodyItem
>();
var
bringhead
=
headItems
.
Where
(
t
=>
t
.
IsBring
==
1
).
ToList
();
if
(
bringhead
!=
null
&&
bringhead
.
Count
>
0
)
{
var
allotIds
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
request
.
HospitalId
).
Select
(
a
=>
a
.
ID
);
var
secondIdList
=
perforAgsecondallotRepository
.
GetEntities
(
t
=>
allotIds
.
Contains
(
t
.
AllotId
.
Value
)
&&
t
.
Department
==
request
.
Department
&&
t
.
UnitType
==
request
.
UnitType
)
.
OrderBy
(
t
=>
t
.
Year
).
ThenBy
(
t
=>
t
.
Month
).
Select
(
t
=>
t
.
Id
).
ToList
();
var
index
=
secondIdList
.
IndexOf
(
request
.
SecondId
);
var
fixatList
=
new
List
<
ag_fixatitem
>();
if
(
index
!=
0
)
fixatList
=
perforAgfixatitemRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondIdList
.
ElementAt
(
index
-
1
)
&&
t
.
RowNumber
.
HasValue
&&
t
.
RowNumber
!=
-
1
&&
bringhead
.
Select
(
s
=>
s
.
FiledName
).
Contains
(
t
.
ItemName
));
if
(
fixatList
!=
null
&&
fixatList
.
Any
())
bodyItems
=
GetBodyItems
(
fixatList
,
headItems
);
}
return
bodyItems
;
}
/// <summary>
/// 补充二次绩效配置数据
/// </summary>
/// <param name="second"></param>
/// <param name="bodyItems"></param>
private
void
FillData
(
ag_secondallot
second
,
List
<
BodyItem
>
bodyItems
)
{
if
(
bodyItems
==
null
||
!
bodyItems
.
Any
())
return
;
var
keyValue
=
new
Dictionary
<
string
,
string
>
{
{
"发放月份"
,
$"
{
second
.
Year
}
年
{
second
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
月"
},
{
"绩效合计(考核后)"
,
second
.
RealGiveFee
.
ToString
()},
};
var
config
=
perforCofagainRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
second
.
AllotId
);
if
(
config
!=
null
&&
config
.
Any
())
config
.
ForEach
(
t
=>
{
keyValue
.
Add
(
t
.
TypeName
,
t
.
Value
.
ToString
());
});
foreach
(
var
item
in
keyValue
)
{
var
header
=
bodyItems
.
FirstOrDefault
(
t
=>
t
.
FiledName
==
item
.
Key
);
if
(
header
!=
null
&&
string
.
IsNullOrEmpty
(
header
.
Value
))
bodyItems
.
FirstOrDefault
(
t
=>
t
.
FiledName
==
item
.
Key
).
Value
=
item
.
Value
;
}
}
#
endregion
/// <summary>
/// 二次绩效项录入保存
/// </summary>
...
...
@@ -404,7 +573,7 @@ public bool UseTemp(UseTempRequest request)
AllotId
=
second
.
AllotId
,
SecondId
=
second
.
Id
,
ItemValue
=
head
.
FiledName
==
"绩效合计(考核后)"
?
second
.
RealGiveFee
?.
ToString
()
:
head
.
FiledName
==
"发放月份"
?
$"
{
second
.
Year
}
年
{
second
.
Month
}
月"
:
head
.
FiledName
==
"发放月份"
?
$"
{
second
.
Year
}
年
{
second
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)
}
月"
:
configs
.
FirstOrDefault
(
t
=>
t
.
TypeName
==
head
.
FiledName
)?.
Value
.
ToString
()
});
}
...
...
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