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
88a437e0
Commit
88a437e0
authored
Jan 07, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMI新增SHEET页存放(东方) 药占比新增SHEET页存放(东方) 工作量倾斜新增SHEET页存放(东方)
parent
2a027676
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
523 additions
and
598 deletions
+523
-598
performance/Performance.Api/Controllers/ConfigController.cs
+98
-98
performance/Performance.Api/wwwroot/Performance.Api.xml
+0
-56
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+12
-10
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+0
-66
performance/Performance.DtoModels/PerExcel/CofDrugProp.cs
+7
-5
performance/Performance.DtoModels/PerExcel/ExcelEnum.cs
+11
-0
performance/Performance.DtoModels/PerExcel/PerData.cs
+1
-1
performance/Performance.DtoModels/PerExcel/PerDataAccountBaisc.cs
+4
-4
performance/Performance.DtoModels/Response/DeptDetailResponse.cs
+3
-0
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+4
-4
performance/Performance.EntityModels/Entity/cof_cmi.cs
+39
-39
performance/Performance.EntityModels/Entity/cof_drugprop.cs
+39
-39
performance/Performance.Repository/Repository/PerforCofcmiRepository.cs
+19
-19
performance/Performance.Repository/Repository/PerforCofdrugpropRepository.cs
+19
-19
performance/Performance.Services/AllotCompute/ProcessComputService.cs
+53
-37
performance/Performance.Services/ComputeService.cs
+18
-11
performance/Performance.Services/ConfigService.cs
+148
-148
performance/Performance.Services/PerExcelService/PerSheetDataFactory.cs
+10
-0
performance/Performance.Services/PerExcelService/PerSheetService.cs
+11
-3
performance/Performance.Services/PerExcelService/SheetDataCompute/PerSheetDataComputeWorkload.cs
+27
-39
No files found.
performance/Performance.Api/Controllers/ConfigController.cs
View file @
88a437e0
...
...
@@ -194,58 +194,58 @@ public ConfigController(ConfigService configService, AllotService allotService)
#
endregion
#
region
drugprop
/// <summary>
/// 获取 药占比配置信息列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"drugproplist"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
DrugpropResponse
>>
GetDrugList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
DrugpropRequest
request
)
{
var
list
=
_configService
.
GetDrugList
(
request
.
AllotID
);
return
new
ApiResponse
<
List
<
DrugpropResponse
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
///
//
<summary>
///
//
获取 药占比配置信息列表
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("drugproplist")]
//
[HttpPost]
//
public ApiResponse<List<DrugpropResponse>> GetDrugList([CustomizeValidator(RuleSet = "Select"), FromBody] DrugpropRequest request)
//
{
//
var list = _configService.GetDrugList(request.AllotID);
//
return new ApiResponse<List<DrugpropResponse>>(ResponseType.OK, "ok", list);
//
}
/// <summary>
/// 新增药占比配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"druginsert"
)]
[
HttpPost
]
public
ApiResponse
<
DrugpropResponse
>
DrugInsert
([
CustomizeValidator
(
RuleSet
=
"Insert"
),
FromBody
]
DrugpropRequest
request
)
{
var
drugprop
=
_configService
.
DrugInsert
(
request
);
return
new
ApiResponse
<
DrugpropResponse
>(
ResponseType
.
OK
,
drugprop
);
}
///
//
<summary>
///
//
新增药占比配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("druginsert")]
//
[HttpPost]
//
public ApiResponse<DrugpropResponse> DrugInsert([CustomizeValidator(RuleSet = "Insert"), FromBody] DrugpropRequest request)
//
{
//
var drugprop = _configService.DrugInsert(request);
//
return new ApiResponse<DrugpropResponse>(ResponseType.OK, drugprop);
//
}
/// <summary>
/// 修改药占比配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"drugupdate"
)]
[
HttpPost
]
public
ApiResponse
<
DrugpropResponse
>
Update
([
CustomizeValidator
(
RuleSet
=
"Update"
),
FromBody
]
DrugpropRequest
request
)
{
var
drugprop
=
_configService
.
DrugUpdate
(
request
);
return
new
ApiResponse
<
DrugpropResponse
>(
ResponseType
.
OK
,
drugprop
);
}
///
//
<summary>
///
//
修改药占比配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("drugupdate")]
//
[HttpPost]
//
public ApiResponse<DrugpropResponse> Update([CustomizeValidator(RuleSet = "Update"), FromBody] DrugpropRequest request)
//
{
//
var drugprop = _configService.DrugUpdate(request);
//
return new ApiResponse<DrugpropResponse>(ResponseType.OK, drugprop);
//
}
/// <summary>
/// 删除药占比配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"drugdelete"
)]
[
HttpPost
]
public
ApiResponse
Delete
([
CustomizeValidator
(
RuleSet
=
"Delete"
),
FromBody
]
DrugpropRequest
request
)
{
if
(!
_configService
.
DrugDelete
(
request
))
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
///
//
<summary>
///
//
删除药占比配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("drugdelete")]
//
[HttpPost]
//
public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody] DrugpropRequest request)
//
{
//
if (!_configService.DrugDelete(request))
//
return new ApiResponse(ResponseType.Fail);
//
return new ApiResponse(ResponseType.OK);
//
}
#
endregion
#
region
drugtype
...
...
@@ -469,58 +469,58 @@ public ApiResponse DepttypeDelete([CustomizeValidator(RuleSet = "Delete"), FromB
#
endregion
#
region
cmi
/// <summary>
/// 获取 CMI配置信息
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"cmilist"
)]
[
HttpPost
]
public
ApiResponse
GetHosCMIList
([
FromBody
]
cof_cmi
request
)
{
var
list
=
_configService
.
GetCMIList
(
request
.
AllotId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
}
///
//
<summary>
///
//
获取 CMI配置信息
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("cmilist")]
//
[HttpPost]
//
public ApiResponse GetHosCMIList([FromBody] cof_cmi request)
//
{
//
var list = _configService.GetCMIList(request.AllotId);
//
return new ApiResponse(ResponseType.OK, "ok", list);
//
}
/// <summary>
/// 新增 CMI配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"cmiinsert"
)]
[
HttpPost
]
public
ApiResponse
HosCMIInsert
([
FromBody
]
cof_cmi
request
)
{
var
drugprop
=
_configService
.
HosCMIInsert
(
request
);
return
new
ApiResponse
(
ResponseType
.
OK
,
drugprop
);
}
///
//
<summary>
///
//
新增 CMI配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("cmiinsert")]
//
[HttpPost]
//
public ApiResponse HosCMIInsert([FromBody] cof_cmi request)
//
{
//
var drugprop = _configService.HosCMIInsert(request);
//
return new ApiResponse(ResponseType.OK, drugprop);
//
}
/// <summary>
/// 修改 CMI配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"cmiupdate"
)]
[
HttpPost
]
public
ApiResponse
HosCMIUpdate
([
FromBody
]
cof_cmi
request
)
{
var
drugprop
=
_configService
.
HosCMIUpdate
(
request
);
return
new
ApiResponse
(
ResponseType
.
OK
,
drugprop
);
}
///
//
<summary>
///
//
修改 CMI配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("cmiupdate")]
//
[HttpPost]
//
public ApiResponse HosCMIUpdate([FromBody] cof_cmi request)
//
{
//
var drugprop = _configService.HosCMIUpdate(request);
//
return new ApiResponse(ResponseType.OK, drugprop);
//
}
/// <summary>
/// 删除 CMI配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"cmidelete"
)]
[
HttpPost
]
public
ApiResponse
HosCMIDelete
([
FromBody
]
cof_cmi
request
)
{
if
(!
_configService
.
HosCMIDelete
(
request
))
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
///
//
<summary>
///
//
删除 CMI配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
[Route("cmidelete")]
//
[HttpPost]
//
public ApiResponse HosCMIDelete([FromBody] cof_cmi request)
//
{
//
if (!_configService.HosCMIDelete(request))
//
return new ApiResponse(ResponseType.Fail);
//
return new ApiResponse(ResponseType.OK);
//
}
#
endregion
/// <summary>
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
88a437e0
...
...
@@ -426,34 +426,6 @@
<param
name=
"computeId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetDrugList(Performance.DtoModels.DrugpropRequest)"
>
<summary>
获取 药占比配置信息列表
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.DrugInsert(Performance.DtoModels.DrugpropRequest)"
>
<summary>
新增药占比配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.Update(Performance.DtoModels.DrugpropRequest)"
>
<summary>
修改药占比配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.Delete(Performance.DtoModels.DrugpropRequest)"
>
<summary>
删除药占比配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetDrugtypeList(Performance.DtoModels.DrugpropRequest)"
>
<summary>
获取 药占比类型信息列表
...
...
@@ -566,34 +538,6 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetHosCMIList(Performance.EntityModels.cof_cmi)"
>
<summary>
获取 CMI配置信息
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.HosCMIInsert(Performance.EntityModels.cof_cmi)"
>
<summary>
新增 CMI配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.HosCMIUpdate(Performance.EntityModels.cof_cmi)"
>
<summary>
修改 CMI配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.HosCMIDelete(Performance.EntityModels.cof_cmi)"
>
<summary>
删除 CMI配置
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.WorkHeader(Performance.DtoModels.WorkItemRequest)"
>
<summary>
获取工作量绩效列头
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
88a437e0
...
...
@@ -396,11 +396,6 @@
门诊药占比分值
</summary>
</member>
<member
name=
"P:Performance.DtoModels.CofDrugProp.Prop"
>
<summary>
占比
</summary>
</member>
<member
name=
"P:Performance.DtoModels.CofDrugProp.Factor"
>
<summary>
分值
...
...
@@ -804,6 +799,15 @@
<member
name=
"F:Performance.DtoModels.SheetType.PersonPostCoefficient"
>
<summary>
个人岗位系数
</summary>
</member>
<member
name=
"F:Performance.DtoModels.SheetType.WorkloadMedicineProp"
>
<summary>
药占比系数
</summary>
</member>
<member
name=
"F:Performance.DtoModels.SheetType.WorkloadCMI"
>
<summary>
CMI系数
</summary>
</member>
<member
name=
"F:Performance.DtoModels.SheetType.WorkloadIncline"
>
<summary>
工作量倾斜系数
</summary>
</member>
<member
name=
"T:Performance.DtoModels.AccountUnitType"
>
<summary>
核算单元类型
...
...
@@ -1037,11 +1041,6 @@
应发管理绩效
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PerDataAccountBaisc.MedicineFactor"
>
<summary>
药占比系数
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PerDataAccountBaisc.Income"
>
<summary>
科室业绩
...
...
@@ -2782,6 +2781,9 @@
<member
name=
"P:Performance.DtoModels.DetailModule.CMIFactor"
>
<summary>
CMI系数
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DetailModule.InclineFactor"
>
<summary>
工作量倾斜系数
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DetailModule.ItemValue"
>
<summary>
结算值
</summary>
</member>
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
88a437e0
...
...
@@ -67,18 +67,12 @@
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.cof_check"
>
<summary>
上传excel文件校验配置
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.cof_cmi"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.cof_depttype"
>
<summary>
科室类型
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.cof_director"
>
<summary>
规模绩效、效率绩效计算系数配置
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.cof_drugprop"
>
<summary>
工作量门诊药占比系数
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.cof_drugtype"
>
<summary>
药占比费用列头名称
</summary>
</member>
...
...
@@ -1256,36 +1250,6 @@
单元格列头名称
</summary>
</member>
<member
name=
"T:Performance.EntityModels.cof_cmi"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.cof_cmi.Id"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.cof_cmi.AllotId"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.cof_cmi.UnitType"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.cof_cmi.AccountingUnit"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.cof_cmi.Value"
>
<summary>
</summary>
</member>
<member
name=
"T:Performance.EntityModels.cof_depttype"
>
<summary>
科室类型
...
...
@@ -1346,36 +1310,6 @@
绩效系数
</summary>
</member>
<member
name=
"T:Performance.EntityModels.cof_drugprop"
>
<summary>
工作量门诊药占比系数
</summary>
</member>
<member
name=
"P:Performance.EntityModels.cof_drugprop.ID"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.cof_drugprop.AllotID"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.cof_drugprop.MaxRange"
>
<summary>
药占比最大范围(小于)
</summary>
</member>
<member
name=
"P:Performance.EntityModels.cof_drugprop.MinRange"
>
<summary>
药占比最小范围(大于等于)
</summary>
</member>
<member
name=
"P:Performance.EntityModels.cof_drugprop.Value"
>
<summary>
药占比对应系数
</summary>
</member>
<member
name=
"T:Performance.EntityModels.cof_drugtype"
>
<summary>
药占比费用列头名称
...
...
performance/Performance.DtoModels/PerExcel/CofDrugProp.cs
View file @
88a437e0
...
...
@@ -9,11 +9,13 @@ namespace Performance.DtoModels
/// </summary>
public
class
CofDrugProp
{
public
string
AccoutingUnit
{
get
;
set
;
}
/// <summary>
/// 占比
/// </summary>
public
decimal
Prop
{
get
;
set
;
}
public
string
AccountingUnit
{
get
;
set
;
}
public
string
UnitType
{
get
;
set
;
}
//public string AccoutingUnit { get; set; }
///// <summary>
///// 占比
///// </summary>
//public decimal Prop { get; set; }
/// <summary>
/// 分值
/// </summary>
...
...
performance/Performance.DtoModels/PerExcel/ExcelEnum.cs
View file @
88a437e0
...
...
@@ -148,6 +148,17 @@ public enum SheetType
/// <summary> 个人岗位系数 </summary>
[
Description
(
"个人岗位系数"
)]
PersonPostCoefficient
=
34
,
/// <summary> 药占比系数 </summary>
[
Description
(
"药占比系数"
)]
WorkloadMedicineProp
=
35
,
/// <summary> CMI系数 </summary>
[
Description
(
"CMI系数"
)]
WorkloadCMI
=
36
,
/// <summary> 工作量倾斜系数 </summary>
[
Description
(
"工作量倾斜系数"
)]
WorkloadIncline
=
37
,
}
/// <summary>
...
...
performance/Performance.DtoModels/PerExcel/PerData.cs
View file @
88a437e0
...
...
@@ -72,6 +72,6 @@ public class PerData : IPerData
public
int
PointCell
{
get
;
set
;
}
public
string
SignID
{
get
;
set
;
}
public
decimal
?
MedicineFactor
{
get
;
set
;
}
//
public decimal? MedicineFactor { get; set; }
}
}
performance/Performance.DtoModels/PerExcel/PerDataAccountBaisc.cs
View file @
88a437e0
...
...
@@ -177,10 +177,10 @@ public class PerDataAccountBaisc : IPerData
#
region
由计算得出
/// <summary>
/// 药占比系数
/// </summary>
public
Nullable
<
decimal
>
MedicineFactor
{
get
;
set
;
}
///
//
<summary>
///
//
药占比系数
///
//
</summary>
//
public Nullable<decimal> MedicineFactor { get; set; }
///// <summary>
///// 保底绩效金额
...
...
performance/Performance.DtoModels/Response/DeptDetailResponse.cs
View file @
88a437e0
...
...
@@ -85,6 +85,9 @@ public class DetailModule
/// <summary> CMI系数 </summary>
public
decimal
?
CMIFactor
{
get
;
set
;
}
/// <summary> 工作量倾斜系数 </summary>
public
decimal
?
InclineFactor
{
get
;
set
;
}
/// <summary> 结算值 </summary>
public
decimal
?
ItemValue
{
get
;
set
;
}
}
...
...
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
88a437e0
...
...
@@ -74,8 +74,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
/// <summary> 上传excel文件校验配置 </summary>
public
virtual
DbSet
<
cof_check
>
cof_check
{
get
;
set
;
}
/// <summary> </summary>
public
virtual
DbSet
<
cof_cmi
>
cof_cmi
{
get
;
set
;
}
///
//
<summary> </summary>
//
public virtual DbSet<cof_cmi> cof_cmi { get; set; }
/// <summary> 科室类型 </summary>
public
virtual
DbSet
<
cof_depttype
>
cof_depttype
{
get
;
set
;
}
...
...
@@ -83,8 +83,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
/// <summary> 规模绩效、效率绩效计算系数配置 </summary>
public
virtual
DbSet
<
cof_director
>
cof_director
{
get
;
set
;
}
/// <summary> 工作量门诊药占比系数 </summary>
public
virtual
DbSet
<
cof_drugprop
>
cof_drugprop
{
get
;
set
;
}
///
//
<summary> 工作量门诊药占比系数 </summary>
//
public virtual DbSet<cof_drugprop> cof_drugprop { get; set; }
/// <summary> 药占比费用列头名称 </summary>
public
virtual
DbSet
<
cof_drugtype
>
cof_drugtype
{
get
;
set
;
}
...
...
performance/Performance.EntityModels/Entity/cof_cmi.cs
View file @
88a437e0
//-----------------------------------------------------------------------
// <copyright file=" cof_cmi.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
//
//
-----------------------------------------------------------------------
//
//
<copyright file=" cof_cmi.cs">
//
//
* FileName: .cs
//
//
</copyright>
//
//
-----------------------------------------------------------------------
//
using System;
//
using System.ComponentModel.DataAnnotations;
//
using System.ComponentModel.DataAnnotations.Schema;
namespace
Performance.EntityModels
{
/// <summary>
///
/// </summary>
[
Table
(
"cof_cmi"
)]
public
class
cof_cmi
{
/// <summary>
///
/// </summary>
[
Key
]
public
int
Id
{
get
;
set
;
}
//
namespace Performance.EntityModels
//
{
//
/// <summary>
//
///
//
/// </summary>
//
[Table("cof_cmi")]
//
public class cof_cmi
//
{
//
/// <summary>
//
///
//
/// </summary>
//
[Key]
//
public int Id { get; set; }
/// <summary>
///
/// </summary>
public
int
AllotId
{
get
;
set
;
}
//
/// <summary>
//
///
//
/// </summary>
//
public int AllotId { get; set; }
/// <summary>
///
/// </summary>
public
int
UnitType
{
get
;
set
;
}
//
/// <summary>
//
///
//
/// </summary>
//
public int UnitType { get; set; }
/// <summary>
///
/// </summary>
public
string
AccountingUnit
{
get
;
set
;
}
//
/// <summary>
//
///
//
/// </summary>
//
public string AccountingUnit { get; set; }
/// <summary>
///
/// </summary>
public
Nullable
<
decimal
>
Value
{
get
;
set
;
}
}
}
//
/// <summary>
//
///
//
/// </summary>
//
public Nullable<decimal> Value { get; set; }
//
}
//
}
performance/Performance.EntityModels/Entity/cof_drugprop.cs
View file @
88a437e0
//-----------------------------------------------------------------------
// <copyright file=" cof_drugprop.cs">
// * FileName: 工作量门诊药占比系数.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
//
//
-----------------------------------------------------------------------
//
//
<copyright file=" cof_drugprop.cs">
//
//
* FileName: 工作量门诊药占比系数.cs
//
//
</copyright>
//
//
-----------------------------------------------------------------------
//
using System;
//
using System.ComponentModel.DataAnnotations;
//
using System.ComponentModel.DataAnnotations.Schema;
namespace
Performance.EntityModels
{
/// <summary>
/// 工作量门诊药占比系数
/// </summary>
[
Table
(
"cof_drugprop"
)]
public
class
cof_drugprop
{
/// <summary>
///
/// </summary>
[
Key
]
public
int
ID
{
get
;
set
;
}
//
namespace Performance.EntityModels
//
{
//
/// <summary>
//
/// 工作量门诊药占比系数
//
/// </summary>
//
[Table("cof_drugprop")]
//
public class cof_drugprop
//
{
//
/// <summary>
//
///
//
/// </summary>
//
[Key]
//
public int ID { get; set; }
/// <summary>
///
/// </summary>
public
Nullable
<
int
>
AllotID
{
get
;
set
;
}
//
/// <summary>
//
///
//
/// </summary>
//
public Nullable<int> AllotID { get; set; }
/// <summary>
/// 药占比最大范围(小于)
/// </summary>
public
Nullable
<
decimal
>
MaxRange
{
get
;
set
;
}
//
/// <summary>
//
/// 药占比最大范围(小于)
//
/// </summary>
//
public Nullable<decimal> MaxRange { get; set; }
/// <summary>
/// 药占比最小范围(大于等于)
/// </summary>
public
Nullable
<
decimal
>
MinRange
{
get
;
set
;
}
//
/// <summary>
//
/// 药占比最小范围(大于等于)
//
/// </summary>
//
public Nullable<decimal> MinRange { get; set; }
/// <summary>
/// 药占比对应系数
/// </summary>
public
Nullable
<
decimal
>
Value
{
get
;
set
;
}
}
}
//
/// <summary>
//
/// 药占比对应系数
//
/// </summary>
//
public Nullable<decimal> Value { get; set; }
//
}
//
}
performance/Performance.Repository/Repository/PerforCofcmiRepository.cs
View file @
88a437e0
//-----------------------------------------------------------------------
// <copyright file=" cof_cmi.cs">
// * FileName: cof_cmi.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
Performance.EntityModels
;
//
//
-----------------------------------------------------------------------
//
//
<copyright file=" cof_cmi.cs">
//
//
* FileName: cof_cmi.cs
//
//
</copyright>
//
//
-----------------------------------------------------------------------
//
using System;
//
using Performance.EntityModels;
namespace
Performance.Repository
{
/// <summary>
/// cof_cmi Repository
/// </summary>
public
partial
class
PerforCofcmiRepository
:
PerforRepository
<
cof_cmi
>
{
public
PerforCofcmiRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
}
}
}
//
namespace Performance.Repository
//
{
//
/// <summary>
//
/// cof_cmi Repository
//
/// </summary>
//
public partial class PerforCofcmiRepository : PerforRepository<cof_cmi>
//
{
//
public PerforCofcmiRepository(PerformanceDbContext context) : base(context)
//
{
//
}
//
}
//
}
performance/Performance.Repository/Repository/PerforCofdrugpropRepository.cs
View file @
88a437e0
//-----------------------------------------------------------------------
// <copyright file=" cof_drugprop.cs">
// * FileName: cof_drugprop.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
Performance.EntityModels
;
//
//
-----------------------------------------------------------------------
//
//
<copyright file=" cof_drugprop.cs">
//
//
* FileName: cof_drugprop.cs
//
//
</copyright>
//
//
-----------------------------------------------------------------------
//
using System;
//
using Performance.EntityModels;
namespace
Performance.Repository
{
/// <summary>
/// cof_drugprop Repository
/// </summary>
public
partial
class
PerforCofdrugpropRepository
:
PerforRepository
<
cof_drugprop
>
{
public
PerforCofdrugpropRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
}
}
}
//
namespace Performance.Repository
//
{
//
/// <summary>
//
/// cof_drugprop Repository
//
/// </summary>
//
public partial class PerforCofdrugpropRepository : PerforRepository<cof_drugprop>
//
{
//
public PerforCofdrugpropRepository(PerformanceDbContext context) : base(context)
//
{
//
}
//
}
//
}
performance/Performance.Services/AllotCompute/ProcessComputService.cs
View file @
88a437e0
...
...
@@ -18,7 +18,6 @@ public class ProcessComputService : IAutoInjection
{
private
readonly
BudgetService
_budgetService
;
private
PerforCofincomeRepository
perforCofincomeRepository
;
private
PerforCofdrugpropRepository
perforCofdrugpropRepository
;
private
PerforPersheetRepository
perforPerSheetRepository
;
private
PerforImdataRepository
perforImDataRepository
;
private
PerforImheaderRepository
perforImHeaderRepository
;
...
...
@@ -27,7 +26,6 @@ public class ProcessComputService : IAutoInjection
private
PerforResbaiscnormRepository
perforResbaiscnormRepository
;
private
PerforCofdrugtypeRepository
perforCofdrugtypeRepository
;
private
PerforCofworkitemRepository
perforCofworkitemRepository
;
private
PerforCofcmiRepository
perforCofcmiRepository
;
private
readonly
PerforRescomputeRepository
perforRescomputeRepository
;
private
readonly
LogManageService
logManageService
;
private
readonly
GuaranteeService
guaranteeService
;
...
...
@@ -37,7 +35,6 @@ public class ProcessComputService : IAutoInjection
public
ProcessComputService
(
BudgetService
budgetService
,
PerforCofincomeRepository
perforCofincomeRepository
,
PerforCofdrugpropRepository
perforCofdrugpropRepository
,
PerforPersheetRepository
perforPerSheetRepository
,
PerforImdataRepository
perforImDataRepository
,
PerforImheaderRepository
perforImHeaderRepository
,
...
...
@@ -46,7 +43,6 @@ public class ProcessComputService : IAutoInjection
PerforResbaiscnormRepository
perforResbaiscnormRepository
,
PerforCofdrugtypeRepository
perforCofdrugtypeRepository
,
PerforCofworkitemRepository
perforCofworkitemRepository
,
PerforCofcmiRepository
perforCofcmiRepository
,
PerforRescomputeRepository
perforRescomputeRepository
,
LogManageService
logManageService
,
GuaranteeService
guaranteeService
,
...
...
@@ -55,7 +51,6 @@ public class ProcessComputService : IAutoInjection
{
_budgetService
=
budgetService
;
this
.
perforCofincomeRepository
=
perforCofincomeRepository
;
this
.
perforCofdrugpropRepository
=
perforCofdrugpropRepository
;
this
.
perforPerSheetRepository
=
perforPerSheetRepository
;
this
.
perforImDataRepository
=
perforImDataRepository
;
this
.
perforImHeaderRepository
=
perforImHeaderRepository
;
...
...
@@ -64,7 +59,6 @@ public class ProcessComputService : IAutoInjection
this
.
perforResbaiscnormRepository
=
perforResbaiscnormRepository
;
this
.
perforCofdrugtypeRepository
=
perforCofdrugtypeRepository
;
this
.
perforCofworkitemRepository
=
perforCofworkitemRepository
;
this
.
perforCofcmiRepository
=
perforCofcmiRepository
;
this
.
perforRescomputeRepository
=
perforRescomputeRepository
;
this
.
logManageService
=
logManageService
;
this
.
guaranteeService
=
guaranteeService
;
...
...
@@ -219,14 +213,17 @@ public void Save(List<PerSheet> perSheets, int allotId)
workload1
.
SheetName
=
"医生组工作量绩效测算表"
;
logManageService
.
WriteMsg
(
"正在生成绩效"
,
"获取药品费用分割比例"
,
1
,
allotid
,
"ReceiveMessage"
);
var
confs
=
GetDrugConfig
(
excel
,
allotid
);
var
cmis
=
perforCofcmiRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotid
);
var
conitem
=
perforCofworkitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotid
);
var
medicineProps
=
GetFactors
(
excel
,
SheetType
.
WorkloadMedicineProp
);
var
cmis
=
GetFactors
(
excel
,
SheetType
.
WorkloadCMI
);
var
inclines
=
GetFactors
(
excel
,
SheetType
.
WorkloadIncline
);
//医生组 一次计算
//var onceWorkload1 = workloadCompute.OnceCompute(workload1, confs);
//医生组 二次计算
logManageService
.
WriteMsg
(
"正在生成绩效"
,
"医生组工作量计算"
,
1
,
allotid
,
"ReceiveMessage"
);
var
twiceWorkloadResult1
=
workloadCompute
.
TwiceCompute
(
workload1
,
hospital
,
con
fs
,
cmis
,
conitem
,
true
);
var
twiceWorkloadResult1
=
workloadCompute
.
TwiceCompute
(
workload1
,
hospital
,
con
item
,
medicineProps
,
cmis
,
inclines
,
true
);
twiceWorkloadResult1
.
Sheet
.
SheetType
=
SheetType
.
ComputeDoctorWorkload
;
perSheet
.
Add
(
twiceWorkloadResult1
.
Sheet
);
...
...
@@ -237,7 +234,7 @@ public void Save(List<PerSheet> perSheets, int allotId)
//var onceWorkload2 = workloadCompute.OnceCompute(workload2);
//护理组 二次计算
logManageService
.
WriteMsg
(
"正在生成绩效"
,
"护理组工作量计算"
,
1
,
allotid
,
"ReceiveMessage"
);
var
twiceWorkloadResult2
=
workloadCompute
.
TwiceCompute
(
workload2
,
hospital
,
con
fs
,
cmis
,
conitem
);
var
twiceWorkloadResult2
=
workloadCompute
.
TwiceCompute
(
workload2
,
hospital
,
con
item
,
medicineProps
,
cmis
,
inclines
);
twiceWorkloadResult2
.
Sheet
.
SheetType
=
SheetType
.
ComputeNurseWorkload
;
perSheet
.
Add
(
twiceWorkloadResult2
.
Sheet
);
...
...
@@ -305,7 +302,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, per_allot
if
(
UnitType
.
医技组
==
unitType
&&
workDoctor
==
null
)
workDoctor
=
info
.
Data
.
FirstOrDefault
(
t
=>
t
.
UnitType
==
UnitType
.
医生组
.
ToString
()
&&
t
.
AccountingUnit
==
dept
.
AccountingUnit
);
dept
.
MedicineFactor
=
workDoctor
?.
MedicineFactor
;
//
dept.MedicineFactor = workDoctor?.MedicineFactor;
//dept.ScoringAverage = scoreAverage.HasValue ? scoreAverage ?? 0 : dept.ScoringAverage;
dept
.
ScoringAverage
=
dept
.
ScoringAverage
;
dept
.
AdjustFactor
=
(
isBudget
?
adjust
:
dept
?.
AdjustFactor
)
??
1
;
...
...
@@ -619,40 +616,59 @@ public IEnumerable<AccountUnitTotal> GetAccountScoreAverage(PerExcel excel, Shee
/// </summary>
/// <param name="excel"></param>
/// <returns></returns>
private
List
<
CofDrugProp
>
GetDrugConfig
(
PerExcel
excel
,
int
allotid
)
private
IEnumerable
<
CofDrugProp
>
GetFactors
(
PerExcel
excel
,
SheetType
sheetType
)
{
//计算药占比
List
<
CofDrugProp
>
cofs
=
new
List
<
CofDrugProp
>();
var
perDatas
=
excel
.
PerSheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
SheetType
.
WorkloadMedicineProp
)?.
PerData
.
Select
(
w
=>
(
PerData
)
w
);
var
factors
=
perDatas
?.
Where
(
w
=>
w
.
IsTotal
==
1
)
.
Select
(
w
=>
new
CofDrugProp
{
AccountingUnit
=
w
.
AccountingUnit
,
UnitType
=
w
.
UnitType
,
Factor
=
w
.
CellValue
??
1
});
return
factors
??
new
List
<
CofDrugProp
>();
}
var
incomeSheet
=
excel
.
PerSheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
SheetType
.
Income
&&
t
.
SheetName
.
Contains
(
"门诊"
)
&&
t
.
SheetName
.
Contains
(
"开单"
));
var
datalist
=
incomeSheet
.
PerData
.
Select
(
t
=>
(
PerData
)
t
);
var
drugtype
=
perforCofdrugtypeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotid
&&
t
.
ChargeType
==
"药费"
)?.
Select
(
t
=>
t
.
Charge
).
ToList
();
///// <summary>
///// 获取药占比分割比例
///// </summary>
///// <param name="excel"></param>
///// <returns></returns>
//private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
//{
// //计算药占比
// List<CofDrugProp> cofs = new List<CofDrugProp>();
var
drugData
=
datalist
.
Where
(
t
=>
drugtype
.
Contains
(
t
.
TypeName
)).
GroupBy
(
t
=>
t
.
AccountingUnit
).
Select
(
t
=>
new
{
AccountingUnit
=
t
.
Key
,
SumValue
=
t
.
Sum
(
s
=>
s
.
CellValue
)
});
if
(
drugtype
==
null
)
{
drugData
=
null
;
//throw new PerformanceException("未配置药占比类型");
}
// var incomeSheet = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.Income && t.SheetName.Contains("门诊") && t.SheetName.Contains("开单"));
// var datalist = incomeSheet.PerData.Select(t => (PerData)t);
// var drugtype = perforCofdrugtypeRepository.GetEntities(t => t.AllotID == allotid && t.ChargeType == "药费")?.Select(t => t.Charge).ToList();
var
allData
=
datalist
.
GroupBy
(
t
=>
t
.
AccountingUnit
).
Select
(
t
=>
new
{
AccountingUnit
=
t
.
Key
,
SumValue
=
t
.
Sum
(
s
=>
s
.
CellValue
)
});
// var drugData = datalist.Where(t => drugtype.Contains(t.TypeName)).GroupBy(t => t.AccountingUnit).Select(t => new { AccountingUnit = t.Key, SumValue = t.Sum(s => s.CellValue) });
// if (drugtype == null)
// {
// drugData = null;
// //throw new PerformanceException("未配置药占比类型");
// }
var
cofList
=
perforCofdrugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotid
);
if
(
cofList
==
null
||
!
cofList
.
Any
())
return
cofs
;
// var allData = datalist.GroupBy(t => t.AccountingUnit).Select(t => new { AccountingUnit = t.Key, SumValue = t.Sum(s => s.CellValue) });
var
unitList
=
(
drugData
?.
Select
(
t
=>
t
.
AccountingUnit
)
??
new
List
<
string
>()).
Union
(
allData
.
Select
(
t
=>
t
.
AccountingUnit
));
// var cofList = perforCofdrugpropRepository.GetEntities(t => t.AllotID == allotid);
// if (cofList == null || !cofList.Any()) return cofs;
foreach
(
var
unit
in
unitList
)
{
var
dsv
=
drugData
?.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
unit
)?.
SumValue
;
var
asv
=
allData
.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
unit
)?.
SumValue
;
// var unitList = (drugData?.Select(t => t.AccountingUnit) ?? new List<string>()).Union(allData.Select(t => t.AccountingUnit));
var
prop
=
asv
.
HasValue
&&
asv
.
Value
>
0
?
Math
.
Round
((
dsv
??
0
)
/
asv
.
Value
,
2
)
:
0
;
var
fvalue
=
cofList
.
FirstOrDefault
(
t
=>
prop
>
t
.
MinRange
&&
prop
<=
t
.
MaxRange
)?.
Value
??
0
;
cofs
.
Add
(
new
CofDrugProp
{
AccoutingUnit
=
unit
,
Factor
=
fvalue
,
Prop
=
prop
});
}
return
cofs
;
}
// foreach (var unit in unitList)
// {
// var dsv = drugData?.FirstOrDefault(t => t.AccountingUnit == unit)?.SumValue;
// var asv = allData.FirstOrDefault(t => t.AccountingUnit == unit)?.SumValue;
// var prop = asv.HasValue && asv.Value > 0 ? Math.Round((dsv ?? 0) / asv.Value, 2) : 0;
// var fvalue = cofList.FirstOrDefault(t => prop > t.MinRange && prop <= t.MaxRange)?.Value ?? 0;
// cofs.Add(new CofDrugProp { AccoutingUnit = unit, Factor = fvalue, Prop = prop });
// }
// return cofs;
//}
#
endregion
compute
}
...
...
performance/Performance.Services/ComputeService.cs
View file @
88a437e0
using
AutoMapper
;
using
NPOI.SS.Formula.Functions
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
...
...
@@ -7,7 +6,6 @@
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Text.RegularExpressions
;
namespace
Performance.Services
...
...
@@ -28,7 +26,6 @@ public class ComputeService : IAutoInjection
private
readonly
PerforPerallotRepository
perforPerallotRepository
;
private
readonly
PerforHospitalRepository
hospitalRepository
;
private
readonly
PerforPerapramountRepository
perapramountRepository
;
private
readonly
PerforCofcmiRepository
cofcmiRepository
;
private
readonly
PerforPeremployeeRepository
perforPeremployeeRepository
;
private
readonly
PerforCofworkitemRepository
cofworkitemRepository
;
...
...
@@ -46,7 +43,6 @@ public class ComputeService : IAutoInjection
PerforPerallotRepository
perforPerallotRepository
,
PerforHospitalRepository
hospitalRepository
,
PerforPerapramountRepository
perapramountRepository
,
PerforCofcmiRepository
cofcmiRepository
,
PerforPeremployeeRepository
perforPeremployeeRepository
,
PerforCofworkitemRepository
cofworkitemRepository
)
{
...
...
@@ -64,7 +60,6 @@ public class ComputeService : IAutoInjection
this
.
perforPerallotRepository
=
perforPerallotRepository
;
this
.
hospitalRepository
=
hospitalRepository
;
this
.
perapramountRepository
=
perapramountRepository
;
this
.
cofcmiRepository
=
cofcmiRepository
;
this
.
perforPeremployeeRepository
=
perforPeremployeeRepository
;
this
.
cofworkitemRepository
=
cofworkitemRepository
;
}
...
...
@@ -791,15 +786,20 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
continue
;
var
workitems
=
cofworkitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
account
.
AllotID
);
var
allotCmi
=
cofcmiRepository
.
GetEntity
(
t
=>
t
.
AllotId
==
account
.
AllotID
&&
t
.
UnitType
==
account
.
UnitType
&&
t
.
AccountingUnit
==
account
.
AccountingUnit
);
//var allotCmi = cofcmiRepository.GetEntity(t => t.AllotId == account.AllotID && t.UnitType == account.UnitType && t.AccountingUnit == account.AccountingUnit);
var
medicineFactor
=
GetFactors
(
persheet
,
basicData
,
SheetType
.
WorkloadMedicineProp
);
var
cmiFactor
=
GetFactors
(
persheet
,
basicData
,
SheetType
.
WorkloadCMI
);
var
inclineFactor
=
GetFactors
(
persheet
,
basicData
,
SheetType
.
WorkloadIncline
);
foreach
(
var
dto
in
items
)
{
if
(
workitems
!=
null
&&
workitems
.
Any
(
a
=>
a
.
Type
==
1
&&
a
.
Item
==
dto
.
ItemName
))
dto
.
MediFactor
=
account
.
MedicineFactor
;
if
(
workitems
!=
null
&&
workitems
.
Any
(
a
=>
a
.
Type
==
2
&&
a
.
Item
==
dto
.
ItemName
)
&&
allotCmi
!=
null
)
dto
.
CMIFactor
=
allotCmi
.
Value
;
dto
.
ItemValue
=
dto
.
ItemValue
*
(
dto
.
MediFactor
??
1
)
*
(
dto
.
CMIFactor
??
1
);
if
(
workitems
!=
null
&&
workitems
.
Any
(
a
=>
a
.
Type
==
1
&&
a
.
Item
==
dto
.
ItemName
)
&&
medicineFactor
!=
null
)
dto
.
MediFactor
=
medicineFactor
;
if
(
workitems
!=
null
&&
workitems
.
Any
(
a
=>
a
.
Type
==
2
&&
a
.
Item
==
dto
.
ItemName
)
&&
cmiFactor
!=
null
)
dto
.
CMIFactor
=
cmiFactor
;
if
(
workitems
!=
null
&&
workitems
.
Any
(
a
=>
a
.
Type
==
2
&&
a
.
Item
==
dto
.
ItemName
)
&&
inclineFactor
!=
null
)
dto
.
InclineFactor
=
inclineFactor
;
dto
.
ItemValue
=
dto
.
ItemValue
*
(
dto
.
MediFactor
??
1
)
*
(
dto
.
CMIFactor
??
1
)
*
(
dto
.
InclineFactor
??
1
);
}
}
...
...
@@ -818,6 +818,12 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
//return deptDetails;
}
private
decimal
?
GetFactors
(
List
<
per_sheet
>
persheet
,
List
<
im_data
>
basicData
,
SheetType
sheetType
)
{
var
sheet
=
persheet
.
FirstOrDefault
(
w
=>
w
.
SheetType
==
(
int
)
sheetType
);
return
basicData
.
FirstOrDefault
(
t
=>
t
.
SheetID
==
sheet
.
ID
&&
t
.
UnitType
==
(
int
)
sheetType
&&
t
.
IsTotal
!=
1
)?.
CellValue
;
}
private
(
int
sheettype
,
decimal
amount
)
ClinicDepartmentDetail
(
List
<
per_sheet
>
persheet
,
res_account
account
,
List
<
im_data
>
basicData
,
per_sheet
sheet
,
UnitType
type
,
string
sheetName
)
{
var
sheettype
=
1
;
...
...
@@ -993,6 +999,7 @@ private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details
Factor
=
t
.
Factor
,
MediFactor
=
t
.
MediFactor
,
CMIFactor
=
t
.
CMIFactor
,
InclineFactor
=
t
.
InclineFactor
,
}).
ToList
();
}
}
...
...
performance/Performance.Services/ConfigService.cs
View file @
88a437e0
...
...
@@ -16,7 +16,7 @@ public class ConfigService : IAutoInjection
{
#
region
private
PerforCofdirectorRepository
_directorRepository
;
private
PerforCofdrugpropRepository
_drugpropRepository
;
//
private PerforCofdrugpropRepository _drugpropRepository;
private
PerforCofworkitemRepository
_workitemRepository
;
private
PerforCofagainRepository
_againRepository
;
private
PerforCofdrugtypeRepository
_drugtypeRepository
;
...
...
@@ -26,13 +26,13 @@ public class ConfigService : IAutoInjection
private
PerforImheaderRepository
perforImheaderRepository
;
private
PerforCofdepttypeRepository
perforCofdepttypeRepository
;
private
PerforPerapramountRepository
perapramountRepository
;
private
PerforCofcmiRepository
perforCofcmiRepository
;
//
private PerforCofcmiRepository perforCofcmiRepository;
private
PersonService
personService
;
private
LogManageService
logManageService
;
private
ILogger
<
ConfigService
>
logger
;
public
ConfigService
(
PerforCofdirectorRepository
cofdirectorRepository
,
PerforCofdrugpropRepository
cofdrugpropRepository
,
//
PerforCofdrugpropRepository cofdrugpropRepository,
PerforCofagainRepository
againRepository
,
PerforCofdrugtypeRepository
drugtypeRepository
,
PerforPerallotRepository
perforPerAllotRepository
,
...
...
@@ -42,13 +42,13 @@ public class ConfigService : IAutoInjection
PerforImheaderRepository
perforImheaderRepository
,
PerforCofdepttypeRepository
perforCofdepttypeRepository
,
PerforPerapramountRepository
perapramountRepository
,
PerforCofcmiRepository
perforCofcmiRepository
,
//
PerforCofcmiRepository perforCofcmiRepository,
PersonService
personService
,
LogManageService
logManageService
,
ILogger
<
ConfigService
>
logger
)
{
this
.
_directorRepository
=
cofdirectorRepository
;
this
.
_drugpropRepository
=
cofdrugpropRepository
;
//
this._drugpropRepository = cofdrugpropRepository;
this
.
_workitemRepository
=
workitemRepository
;
this
.
_againRepository
=
againRepository
;
this
.
_drugtypeRepository
=
drugtypeRepository
;
...
...
@@ -58,7 +58,7 @@ public class ConfigService : IAutoInjection
this
.
perforImheaderRepository
=
perforImheaderRepository
;
this
.
perforCofdepttypeRepository
=
perforCofdepttypeRepository
;
this
.
perapramountRepository
=
perapramountRepository
;
this
.
perforCofcmiRepository
=
perforCofcmiRepository
;
//
this.perforCofcmiRepository = perforCofcmiRepository;
this
.
personService
=
personService
;
this
.
logManageService
=
logManageService
;
this
.
logger
=
logger
;
...
...
@@ -249,62 +249,62 @@ public class ConfigService : IAutoInjection
#
region
cof_drugprop
药占比系数配置
/// <summary>
/// 获取cof_drugprop列表
/// </summary>
/// <returns></returns>
public
List
<
DrugpropResponse
>
GetDrugList
(
int
allotId
)
{
var
list
=
_drugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
return
Mapper
.
Map
<
List
<
DrugpropResponse
>>(
list
);
}
///
//
<summary>
///
//
获取cof_drugprop列表
///
//
</summary>
///
//
<returns></returns>
//
public List<DrugpropResponse> GetDrugList(int allotId)
//
{
//
var list = _drugpropRepository.GetEntities(t => t.AllotID == allotId);
//
return Mapper.Map<List<DrugpropResponse>>(list);
//
}
/// <summary>
/// 添加数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
DrugpropResponse
DrugInsert
(
DrugpropRequest
request
)
{
var
drugprop
=
Mapper
.
Map
<
cof_drugprop
>(
request
);
if
(!
_drugpropRepository
.
Add
(
drugprop
))
throw
new
PerformanceException
(
"保存失败"
);
return
Mapper
.
Map
<
DrugpropResponse
>(
drugprop
);
}
///
//
<summary>
///
//
添加数据
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
public DrugpropResponse DrugInsert(DrugpropRequest request)
//
{
//
var drugprop = Mapper.Map<cof_drugprop>(request);
//
if (!_drugpropRepository.Add(drugprop))
//
throw new PerformanceException("保存失败");
//
return Mapper.Map<DrugpropResponse>(drugprop);
//
}
/// <summary>
/// 更新数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
DrugpropResponse
DrugUpdate
(
DrugpropRequest
request
)
{
var
drugprop
=
_drugpropRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
ID
);
if
(
null
==
drugprop
)
throw
new
PerformanceException
(
$"ID不存在 :
{
request
.
ID
}
"
);
///
//
<summary>
///
//
更新数据
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
public DrugpropResponse DrugUpdate(DrugpropRequest request)
//
{
//
var drugprop = _drugpropRepository.GetEntity(t => t.ID == request.ID);
//
if (null == drugprop)
//
throw new PerformanceException($"ID不存在 :{request.ID}");
drugprop
.
MaxRange
=
request
.
MaxRange
;
drugprop
.
MinRange
=
request
.
MinRange
;
drugprop
.
Value
=
request
.
Value
;
//
drugprop.MaxRange = request.MaxRange;
//
drugprop.MinRange = request.MinRange;
//
drugprop.Value = request.Value;
if
(!
_drugpropRepository
.
Update
(
drugprop
))
throw
new
PerformanceException
(
"保存失败"
);
return
Mapper
.
Map
<
DrugpropResponse
>(
drugprop
);
}
//
if (!_drugpropRepository.Update(drugprop))
//
throw new PerformanceException("保存失败");
//
return Mapper.Map<DrugpropResponse>(drugprop);
//
}
/// <summary>
/// 删除数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
bool
DrugDelete
(
DrugpropRequest
request
)
{
var
drugprop
=
_drugpropRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
ID
);
if
(
null
==
drugprop
)
throw
new
PerformanceException
(
$"ID不存在 :
{
request
.
ID
}
"
);
///
//
<summary>
///
//
删除数据
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
public bool DrugDelete(DrugpropRequest request)
//
{
//
var drugprop = _drugpropRepository.GetEntity(t => t.ID == request.ID);
//
if (null == drugprop)
//
throw new PerformanceException($"ID不存在 :{request.ID}");
return
_drugpropRepository
.
Remove
(
drugprop
);
}
//
return _drugpropRepository.Remove(drugprop);
//
}
#
endregion
...
...
@@ -499,61 +499,61 @@ public bool DepttypeDelete(DrugpropRequest request)
#
region
cof_cmi
cmi
/// <summary>
/// 获取 CMI配置
/// </summary>
/// <returns></returns>
public
List
<
cof_cmi
>
GetCMIList
(
int
allotId
)
{
var
list
=
perforCofcmiRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
return
list
;
}
///
//
<summary>
///
//
获取 CMI配置
///
//
</summary>
///
//
<returns></returns>
//
public List<cof_cmi> GetCMIList(int allotId)
//
{
//
var list = perforCofcmiRepository.GetEntities(t => t.AllotId == allotId);
//
return list;
//
}
/// <summary>
/// 添加 CMI配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
cof_cmi
HosCMIInsert
(
cof_cmi
request
)
{
if
(!
perforCofcmiRepository
.
Add
(
request
))
throw
new
PerformanceException
(
"保存失败"
);
return
request
;
}
///
//
<summary>
///
//
添加 CMI配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
public cof_cmi HosCMIInsert(cof_cmi request)
//
{
//
if (!perforCofcmiRepository.Add(request))
//
throw new PerformanceException("保存失败");
//
return request;
//
}
/// <summary>
/// 更新 CMI配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
cof_cmi
HosCMIUpdate
(
cof_cmi
request
)
{
var
entity
=
perforCofcmiRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
Id
);
if
(
null
==
entity
)
throw
new
PerformanceException
(
$"ID不存在 :
{
request
.
Id
}
"
);
///
//
<summary>
///
//
更新 CMI配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
public cof_cmi HosCMIUpdate(cof_cmi request)
//
{
//
var entity = perforCofcmiRepository.GetEntity(t => t.Id == request.Id);
//
if (null == entity)
//
throw new PerformanceException($"ID不存在 :{request.Id}");
entity
.
UnitType
=
request
.
UnitType
;
entity
.
AccountingUnit
=
request
.
AccountingUnit
;
entity
.
Value
=
request
.
Value
;
//
entity.UnitType = request.UnitType;
//
entity.AccountingUnit = request.AccountingUnit;
//
entity.Value = request.Value;
if
(!
perforCofcmiRepository
.
Update
(
entity
))
throw
new
PerformanceException
(
"保存失败"
);
return
entity
;
}
//
if (!perforCofcmiRepository.Update(entity))
//
throw new PerformanceException("保存失败");
//
return entity;
//
}
/// <summary>
/// 删除 CMI配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
bool
HosCMIDelete
(
cof_cmi
request
)
{
var
entity
=
perforCofcmiRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
Id
);
if
(
null
==
entity
)
throw
new
PerformanceException
(
$"ID不存在 :
{
request
.
Id
}
"
);
///
//
<summary>
///
//
删除 CMI配置
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
public bool HosCMIDelete(cof_cmi request)
//
{
//
var entity = perforCofcmiRepository.GetEntity(t => t.Id == request.Id);
//
if (null == entity)
//
throw new PerformanceException($"ID不存在 :{request.Id}");
return
perforCofcmiRepository
.
Remove
(
entity
);
}
//
return perforCofcmiRepository.Remove(entity);
//
}
#
endregion
...
...
@@ -642,7 +642,7 @@ public void Copy(per_allot allot)
personService
.
CreateAllotPersons
(
allot
.
HospitalId
,
allot
.
ID
,
allotId
);
CopyCMIData
(
allotId
,
allot
.
ID
);
//
CopyCMIData(allotId, allot.ID);
#
region
弃用
...
...
@@ -678,17 +678,17 @@ public void Copy(per_allot allot)
#
endregion
logger
.
LogInformation
(
$"orgDurgprop"
);
var
orgDurgprop
=
_drugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
orgDurgprop
==
null
||
orgDurgprop
.
Count
==
0
)
{
var
durgprop
=
_drugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_drugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newDurgprops
=
durgprop
?.
Select
(
t
=>
new
cof_drugprop
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
t
.
Value
});
//if (hospital != null && hospital?.IsOpenDrugprop == 2)
// newDurgprops = new List<cof_drugprop> { new cof_drugprop { AllotID = allot.ID, MaxRange = 1000, MinRange = 0, Value = 1 } };
if
(
durgprop
!=
null
&&
durgprop
.
Any
())
_drugpropRepository
.
AddRange
(
newDurgprops
.
ToArray
());
}
//
logger.LogInformation($"orgDurgprop");
//
var orgDurgprop = _drugpropRepository.GetEntities(t => t.AllotID == allot.ID);
//
if (orgDurgprop == null || orgDurgprop.Count == 0)
//
{
//
var durgprop = _drugpropRepository.GetEntities(t => t.AllotID == allotId) ?? _drugpropRepository.GetEntities(t => t.AllotID == -1);
//
var newDurgprops = durgprop?.Select(t => new cof_drugprop { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value });
//
//if (hospital != null && hospital?.IsOpenDrugprop == 2)
//
// newDurgprops = new List<cof_drugprop> { new cof_drugprop { AllotID = allot.ID, MaxRange = 1000, MinRange = 0, Value = 1 } };
//
if (durgprop != null && durgprop.Any())
//
_drugpropRepository.AddRange(newDurgprops.ToArray());
//
}
logger
.
LogInformation
(
$"workItem"
);
var
workItem
=
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
...
...
@@ -697,7 +697,7 @@ public void Copy(per_allot allot)
workItem
=
_workitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
if
(
workItem
!=
null
&&
workItem
.
Count
>
0
)
{
var
newWorkItem
=
workItem
.
Select
(
t
=>
new
cof_workitem
{
AllotID
=
allot
.
ID
,
Item
=
t
.
Item
});
var
newWorkItem
=
workItem
.
Select
(
t
=>
new
cof_workitem
{
AllotID
=
allot
.
ID
,
Type
=
t
.
Type
,
Item
=
t
.
Item
});
_workitemRepository
.
AddRange
(
newWorkItem
.
ToArray
());
}
}
...
...
@@ -830,35 +830,35 @@ private void CopyAprData(int prevAllotId, int allotId)
}
}
/// <summary>
/// CMI值
/// </summary>
/// <param name="prevAllotId"></param>
/// <param name="allotId"></param>
private
void
CopyCMIData
(
int
prevAllotId
,
int
allotId
)
{
if
(
prevAllotId
==
0
)
return
;
var
list
=
perforCofcmiRepository
.
GetEntities
(
t
=>
new
List
<
int
>
{
prevAllotId
,
allotId
}.
Contains
(
t
.
AllotId
));
if
(
list
==
null
||
!
list
.
Any
(
t
=>
t
.
AllotId
==
prevAllotId
))
return
;
if
(
list
.
Any
(
t
=>
t
.
AllotId
==
allotId
))
{
var
prevData
=
list
.
Where
(
t
=>
t
.
AllotId
==
prevAllotId
);
var
existData
=
list
.
Where
(
t
=>
t
.
AllotId
==
allotId
);
if
(
existData
!=
null
&&
existData
.
Any
())
list
=
prevData
.
Where
(
t
=>
!
existData
.
Select
(
w
=>
w
.
UnitType
+
w
.
AccountingUnit
).
Contains
(
t
.
UnitType
+
t
.
AccountingUnit
)).
ToList
();
}
if
(
list
.
Any
())
{
var
data
=
list
.
Select
(
t
=>
new
cof_cmi
{
AllotId
=
allotId
,
UnitType
=
t
.
UnitType
,
AccountingUnit
=
t
.
AccountingUnit
,
Value
=
t
.
Value
,
});
perforCofcmiRepository
.
AddRange
(
data
.
ToArray
());
}
}
///
//
<summary>
///
//
CMI值
///
//
</summary>
///
//
<param name="prevAllotId"></param>
///
//
<param name="allotId"></param>
//
private void CopyCMIData(int prevAllotId, int allotId)
//
{
//
if (prevAllotId == 0) return;
//
var list = perforCofcmiRepository.GetEntities(t => new List<int> { prevAllotId, allotId }.Contains(t.AllotId));
//
if (list == null || !list.Any(t => t.AllotId == prevAllotId)) return;
//
if (list.Any(t => t.AllotId == allotId))
//
{
//
var prevData = list.Where(t => t.AllotId == prevAllotId);
//
var existData = list.Where(t => t.AllotId == allotId);
//
if (existData != null && existData.Any())
//
list = prevData.Where(t => !existData.Select(w => w.UnitType + w.AccountingUnit).Contains(t.UnitType + t.AccountingUnit)).ToList();
//
}
//
if (list.Any())
//
{
//
var data = list.Select(t => new cof_cmi
//
{
//
AllotId = allotId,
//
UnitType = t.UnitType,
//
AccountingUnit = t.AccountingUnit,
//
Value = t.Value,
//
});
//
perforCofcmiRepository.AddRange(data.ToArray());
//
}
//
}
}
}
performance/Performance.Services/PerExcelService/PerSheetDataFactory.cs
View file @
88a437e0
...
...
@@ -101,6 +101,16 @@ public static IPerSheetDataRead GetDataRead(SheetType sheetType, bool isnew = fa
case
SheetType
.
PersonPostCoefficient
:
dataread
=
new
PerSheetDataReadPersonExtra
();
// 个人岗位系数
break
;
case
SheetType
.
WorkloadMedicineProp
:
dataread
=
new
PerSheetDataReadAccountExtra
();
// 药占比系数
break
;
case
SheetType
.
WorkloadCMI
:
dataread
=
new
PerSheetDataReadAccountExtra
();
// CMI系数
break
;
case
SheetType
.
WorkloadIncline
:
dataread
=
new
PerSheetDataReadAccountExtra
();
// 工作量倾斜系数
break
;
}
return
dataread
;
}
...
...
performance/Performance.Services/PerExcelService/PerSheetService.cs
View file @
88a437e0
...
...
@@ -14,14 +14,14 @@ namespace Performance.Services
public
class
PerSheetService
:
IAutoInjection
{
private
PerHeaderService
_perHeader
;
private
PerforCofdrugpropRepository
_perforCofdrugpropRepository
;
//
private PerforCofdrugpropRepository _perforCofdrugpropRepository;
private
PerforCofdrugtypeRepository
_perforCofdrugtypeRepository
;
public
PerSheetService
(
PerHeaderService
perHeader
,
PerforCofdrugpropRepository
perforCofdrugpropRepository
,
//
PerforCofdrugpropRepository perforCofdrugpropRepository,
PerforCofdrugtypeRepository
perforCofdrugtypeRepository
)
{
_perHeader
=
perHeader
;
_perforCofdrugpropRepository
=
perforCofdrugpropRepository
;
//
_perforCofdrugpropRepository = perforCofdrugpropRepository;
_perforCofdrugtypeRepository
=
perforCofdrugtypeRepository
;
}
/// <summary>
...
...
@@ -113,6 +113,14 @@ public SheetType GetSheetType(string sheetName)
return
SheetType
.
PersonAdjustLaterOtherManagePerforFee
;
else
if
(
sheetName
.
StartsWith
(
"6.11"
))
// 个人岗位系数
return
SheetType
.
PersonPostCoefficient
;
else
if
(
sheetName
.
StartsWith
(
"6.12"
))
// 药占比系数
return
SheetType
.
WorkloadMedicineProp
;
else
if
(
sheetName
.
StartsWith
(
"6.13"
))
// CMI系数
return
SheetType
.
WorkloadCMI
;
else
if
(
sheetName
.
StartsWith
(
"6.14"
))
// 工作量倾斜系数
return
SheetType
.
WorkloadIncline
;
else
if
(
sheetName
.
StartsWith
(
"6.1"
))
return
SheetType
.
AccountScoreAverage
;
else
if
(
sheetName
.
StartsWith
(
"6.2"
))
...
...
performance/Performance.Services/PerExcelService/SheetDataCompute/PerSheetDataComputeWorkload.cs
View file @
88a437e0
...
...
@@ -84,7 +84,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
var
value
=
group
.
Sum
(
s
=>
s
.
IsFactor
?
s
.
CellValue
*
s
.
FactorValue
:
s
.
CellValue
);
if
(
header
.
CellValue
==
"门急诊工作量"
)
{
var
factor
=
confs
.
FirstOrDefault
(
t
=>
t
.
AccoutingUnit
==
group
.
Key
)?.
Factor
??
0
;
var
factor
=
confs
.
FirstOrDefault
(
t
=>
t
.
Accou
n
tingUnit
==
group
.
Key
)?.
Factor
??
0
;
value
=
value
*
factor
;
}
...
...
@@ -99,7 +99,8 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
/// </summary>
/// <param name="sheet"></param>
/// <returns></returns>
public
(
PerSheet
Sheet
,
List
<
PerData
>
PerData
)
TwiceCompute
(
PerSheet
sheet
,
sys_hospital
hospital
,
List
<
CofDrugProp
>
confs
=
null
,
List
<
cof_cmi
>
cmis
=
null
,
List
<
cof_workitem
>
workitems
=
null
,
bool
isDoctor
=
false
)
public
(
PerSheet
Sheet
,
List
<
PerData
>
PerData
)
TwiceCompute
(
PerSheet
sheet
,
sys_hospital
hospital
,
IEnumerable
<
cof_workitem
>
workitems
,
IEnumerable
<
CofDrugProp
>
medicineProps
,
IEnumerable
<
CofDrugProp
>
cmis
,
IEnumerable
<
CofDrugProp
>
inclines
,
bool
isDoctor
=
false
)
{
//获取最大列坐标位置
int
thiscell
=
sheet
.
PerHeader
.
OrderByDescending
(
t
=>
t
.
PointCell
).
FirstOrDefault
().
PointCell
+
1
;
...
...
@@ -115,7 +116,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
{
var
ds
=
group
.
Select
(
t
=>
{
var
(
cellvalue
,
factor
)
=
ComputValue
(
group
,
hospital
,
confs
,
cmis
,
workitem
s
,
isDoctor
);
var
cellvalue
=
ComputValue
(
group
,
hospital
,
workitems
,
medicineProps
,
cmis
,
incline
s
,
isDoctor
);
var
dto
=
new
PerData
{
...
...
@@ -123,7 +124,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
AccountingUnit
=
group
.
Key
.
AccountingUnit
,
//CellValue = group.Sum(s => s.CellValue),
CellValue
=
cellvalue
,
MedicineFactor
=
factor
,
//
MedicineFactor = factor,
TypeName
=
group
.
Key
.
UnitType
,
RowNumber
=
group
.
FirstOrDefault
()?.
RowNumber
??
0
,
IsTotal
=
1
,
...
...
@@ -140,45 +141,32 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
return
(
sheet
,
perDataList
);
}
private
(
decimal
?,
decimal
?)
ComputValue
(
IGrouping
<
object
,
PerData
>
group
,
sys_hospital
hospital
,
List
<
CofDrugProp
>
confs
=
null
,
List
<
cof_cmi
>
cmis
=
null
,
List
<
cof_workitem
>
workitems
=
null
,
bool
isDoctor
=
false
)
private
decimal
?
ComputValue
(
IGrouping
<
object
,
PerData
>
group
,
sys_hospital
hospital
,
IEnumerable
<
cof_workitem
>
workitems
,
IEnumerable
<
CofDrugProp
>
medicineProps
,
IEnumerable
<
CofDrugProp
>
cmis
,
IEnumerable
<
CofDrugProp
>
inclines
,
bool
isDoctor
=
false
)
{
var
unittype
=
isDoctor
?
new
List
<
int
>
{
(
int
)
UnitType
.
医生组
,
(
int
)
UnitType
.
医技组
,
(
int
)
UnitType
.
专家组
,
(
int
)
UnitType
.
其他医生组
,
(
int
)
UnitType
.
其他医技组
,
(
int
)
UnitType
.
特殊核算组
}
:
new
List
<
int
>
{
(
int
)
UnitType
.
护理组
,
(
int
)
UnitType
.
其他护理组
};
var
unittype
=
isDoctor
?
new
List
<
string
>
{
UnitType
.
医生组
.
ToString
(),
UnitType
.
医技组
.
ToString
(),
UnitType
.
专家组
.
ToString
(),
UnitType
.
其他医生组
.
ToString
(),
UnitType
.
其他医技组
.
ToString
(),
UnitType
.
特殊核算组
.
ToString
()
}
:
new
List
<
string
>
{
UnitType
.
护理组
.
ToString
(),
UnitType
.
其他护理组
.
ToString
()
};
if
((
medicineProps
==
null
&&
cmis
==
null
&&
inclines
==
null
)
||
workitems
==
null
)
return
group
.
Sum
(
s
=>
s
.
IsFactor
?
s
.
CellValue
*
s
.
FactorValue
:
s
.
CellValue
);
if
((
confs
==
null
&&
cmis
==
null
)
||
workitems
==
null
)
return
(
group
.
Sum
(
s
=>
s
.
IsFactor
?
s
.
CellValue
*
s
.
FactorValue
:
s
.
CellValue
),
null
);
else
{
var
factor
=
hospital
.
IsOpenDrugprop
==
2
?
1
:
(
confs
?.
FirstOrDefault
(
t
=>
t
.
AccoutingUnit
==
group
.
First
().
AccountingUnit
)?.
Factor
??
1
);
var
cmifactor
=
hospital
.
IsOpenCMIPercent
==
2
?
1
:
(
cmis
?.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
group
.
First
().
AccountingUnit
&&
unittype
.
Contains
(
t
.
UnitType
))?.
Value
??
1
);
//需要乘系数的项
var
fgroup
=
group
.
Where
(
t
=>
workitems
.
Select
(
s
=>
s
.
Item
).
Contains
(
t
.
TypeName
));
//需要乘系数的项
var
ngroup
=
group
.
Where
(
t
=>
!
workitems
.
Select
(
s
=>
s
.
Item
).
Contains
(
t
.
TypeName
));
//var value = fgroup.Sum(s => s.IsFactor ? s.CellValue * s.FactorValue : s.CellValue) * factor;
//value += ngroup.Sum(s => s.IsFactor ? s.CellValue * s.FactorValue : s.CellValue);
var
value
=
fgroup
.
Sum
(
s
=>
{
var
cellvalue
=
s
.
IsFactor
?
s
.
CellValue
*
s
.
FactorValue
:
s
.
CellValue
;
if
(
workitems
.
Any
(
w
=>
w
.
Type
==
2
)
&&
workitems
.
Where
(
w
=>
w
.
Type
==
2
).
Select
(
q
=>
q
.
Item
).
Contains
(
s
.
TypeName
))
{
cellvalue
=
cmifactor
*
cellvalue
;
}
return
cellvalue
;
});
decimal
medicinefactor
=
medicineProps
?.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
group
.
First
().
AccountingUnit
&&
unittype
.
Contains
(
t
.
UnitType
))?.
Factor
??
1
;
decimal
cmifactor
=
cmis
?.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
group
.
First
().
AccountingUnit
&&
unittype
.
Contains
(
t
.
UnitType
))?.
Factor
??
1
;
decimal
inclinefactor
=
inclines
?.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
group
.
First
().
AccountingUnit
&&
unittype
.
Contains
(
t
.
UnitType
))?.
Factor
??
1
;
value
+=
ngroup
.
Sum
(
s
=>
{
var
cellvalue
=
s
.
IsFactor
?
s
.
CellValue
*
s
.
FactorValue
:
s
.
CellValue
;
if
(
workitems
.
Any
(
w
=>
w
.
Type
==
1
)
&&
workitems
.
Where
(
w
=>
w
.
Type
==
1
).
Select
(
q
=>
q
.
Item
).
Contains
(
s
.
TypeName
))
{
cellvalue
=
factor
*
cellvalue
;
}
return
cellvalue
;
});
return
(
value
,
factor
);
}
var
value
=
group
.
Sum
(
s
=>
{
var
cellvalue
=
s
.
IsFactor
?
s
.
CellValue
*
s
.
FactorValue
:
s
.
CellValue
;
if
(
workitems
.
Any
(
w
=>
w
.
Type
==
3
&&
w
.
Item
==
s
.
TypeName
))
cellvalue
=
cellvalue
*
inclinefactor
;
if
(
workitems
.
Any
(
w
=>
w
.
Type
==
2
&&
w
.
Item
==
s
.
TypeName
))
cellvalue
=
cellvalue
*
cmifactor
;
if
(
workitems
.
Any
(
w
=>
w
.
Type
==
1
&&
w
.
Item
==
s
.
TypeName
))
cellvalue
=
cellvalue
*
medicinefactor
;
return
cellvalue
;
});
return
value
;
}
#
endregion
}
...
...
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