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
1373e6f2
Commit
1373e6f2
authored
Aug 03, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加cmi配置,保存药占比系数、
parent
71fafeda
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
416 additions
and
43 deletions
+416
-43
performance/Performance.Api/Controllers/ConfigController.cs
+55
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+28
-0
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+16
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+43
-0
performance/Performance.DtoModels/PerExcel/PerData.cs
+2
-0
performance/Performance.DtoModels/PerExcel/PerDataAccountBaisc.cs
+6
-0
performance/Performance.DtoModels/Request/WorkItemRequest.cs
+25
-20
performance/Performance.DtoModels/Response/DeptDetailResponse.cs
+6
-0
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+2
-0
performance/Performance.EntityModels/Entity/cof_cmi.cs
+44
-0
performance/Performance.EntityModels/Entity/cof_workitem.cs
+5
-0
performance/Performance.EntityModels/Entity/res_account.cs
+6
-1
performance/Performance.Repository/PerforCofdirectorRepository.cs
+5
-1
performance/Performance.Repository/Repository/PerforCofcmiRepository.cs
+20
-0
performance/Performance.Services/AllotCompute/ProcessComputService.cs
+7
-2
performance/Performance.Services/ComputeService.cs
+4
-1
performance/Performance.Services/ConfigService.cs
+94
-0
performance/Performance.Services/PerExcelService/SheetDataCompute/PerSheetDataComputeWorkload.cs
+48
-18
No files found.
performance/Performance.Api/Controllers/ConfigController.cs
View file @
1373e6f2
...
...
@@ -468,6 +468,61 @@ 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
(
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
(
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
(
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
(
cof_cmi
request
)
{
if
(!
_configService
.
HosCMIDelete
(
request
))
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
#
endregion
/// <summary>
/// 获取工作量绩效列头
/// </summary>
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
1373e6f2
...
...
@@ -501,6 +501,34 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetHosCMIList(Performance.EntityModels.cof_cmi)"
>
<summary>
获取 药占比类型信息列表
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.HosCMIInsert(Performance.EntityModels.cof_cmi)"
>
<summary>
新增药占比类型
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.HosCMIUpdate(Performance.EntityModels.cof_cmi)"
>
<summary>
修改药占比类型
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.HosCMIDelete(Performance.EntityModels.cof_cmi)"
>
<summary>
删除药占比类型
</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 @
1373e6f2
...
...
@@ -855,6 +855,11 @@
工作量倾斜系数
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PerDataAccountBaisc.MedicineFactor"
>
<summary>
药占比系数
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PerDataAccountBaisc.MinimumFee"
>
<summary>
保底绩效金额
...
...
@@ -1948,6 +1953,11 @@
工作量绩效项
</summary>
</member>
<member
name=
"P:Performance.DtoModels.WorkItemRequest.Type"
>
<summary>
1. 药占比 2. CMI
</summary>
</member>
<member
name=
"P:Performance.DtoModels.WorkloadRequest.Id"
>
<summary>
绩效ID
...
...
@@ -2371,6 +2381,12 @@
<member
name=
"P:Performance.DtoModels.DetailModule.Factor"
>
<summary>
系数
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DetailModule.MediFactor"
>
<summary>
药占比系数
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DetailModule.CMIFactor"
>
<summary>
CMI系数
</summary>
</member>
<member
name=
"P:Performance.DtoModels.DetailModule.ItemValue"
>
<summary>
结算值
</summary>
</member>
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
1373e6f2
...
...
@@ -67,6 +67,9 @@
<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>
...
...
@@ -1193,6 +1196,36 @@
单元格列头名称
</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>
科室类型
...
...
@@ -1428,6 +1461,11 @@
工作量中需做运算的项
</summary>
</member>
<member
name=
"P:Performance.EntityModels.cof_workitem.Type"
>
<summary>
1. 药占比 2. CMI
</summary>
</member>
<member
name=
"T:Performance.EntityModels.cof_workyear"
>
<summary>
工龄对应绩效系数配置
...
...
@@ -3798,6 +3836,11 @@
倾斜系数
</summary>
</member>
<member
name=
"P:Performance.EntityModels.res_account.MedicineFactor"
>
<summary>
药占比系数
</summary>
</member>
<member
name=
"P:Performance.EntityModels.res_account.MinimumReference"
>
<summary>
保底绩效参考标准
...
...
performance/Performance.DtoModels/PerExcel/PerData.cs
View file @
1373e6f2
...
...
@@ -63,5 +63,7 @@ public class PerData : IPerData
/// </summary>
public
int
PointCell
{
get
;
set
;
}
public
string
SignID
{
get
;
set
;
}
public
decimal
?
MedicineFactor
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/PerExcel/PerDataAccountBaisc.cs
View file @
1373e6f2
...
...
@@ -126,6 +126,12 @@ public class PerDataAccountBaisc : IPerData
#
region
由计算得出
/// <summary>
/// 药占比系数
/// </summary>
public
Nullable
<
decimal
>
MedicineFactor
{
get
;
set
;
}
/// <summary>
/// 保底绩效金额
/// </summary>
...
...
performance/Performance.DtoModels/Request/WorkItemRequest.cs
View file @
1373e6f2
...
...
@@ -16,31 +16,36 @@ public class WorkItemRequest
/// </summary>
public
string
Item
{
get
;
set
;
}
public
class
WorkItemRequestValidator
:
AbstractValidator
<
WorkItemRequest
>
/// <summary>
/// 1. 药占比 2. CMI
/// </summary>
public
int
Type
{
get
;
set
;
}
}
public
class
WorkItemRequestValidator
:
AbstractValidator
<
WorkItemRequest
>
{
public
WorkItemRequestValidator
()
{
public
WorkItemRequestValidator
()
RuleSet
(
"Select"
,
()
=>
{
RuleSet
(
"Select"
,
()
=>
{
RuleFor
(
x
=>
x
.
AllotID
).
NotNull
().
NotEmpty
().
GreaterThan
(
0
);
});
RuleFor
(
x
=>
x
.
AllotID
).
NotNull
().
NotEmpty
().
GreaterThan
(
0
);
});
RuleSet
(
"Insert"
,
()
=>
{
RuleFor
(
x
=>
x
.
AllotID
).
NotNull
().
GreaterThan
(
0
);
});
RuleSet
(
"Insert"
,
()
=>
{
RuleFor
(
x
=>
x
.
AllotID
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
Type
).
NotNull
().
GreaterThan
(
0
);
});
RuleSet
(
"Update"
,
()
=>
{
RuleFor
(
x
=>
x
.
ID
).
NotNull
().
GreaterThan
(
0
);
});
RuleSet
(
"Update"
,
()
=>
{
RuleFor
(
x
=>
x
.
ID
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
Type
).
NotNull
().
GreaterThan
(
0
);
});
RuleSet
(
"Delete"
,
()
=>
{
RuleFor
(
x
=>
x
.
ID
).
NotNull
().
GreaterThan
(
0
);
});
}
RuleSet
(
"Delete"
,
()
=>
{
RuleFor
(
x
=>
x
.
ID
).
NotNull
().
GreaterThan
(
0
);
});
}
}
}
performance/Performance.DtoModels/Response/DeptDetailResponse.cs
View file @
1373e6f2
...
...
@@ -76,6 +76,12 @@ public class DetailModule
/// <summary> 系数 </summary>
public
decimal
?
Factor
{
get
;
set
;
}
/// <summary> 药占比系数 </summary>
public
decimal
?
MediFactor
{
get
;
set
;
}
/// <summary> CMI系数 </summary>
public
decimal
?
CMIFactor
{
get
;
set
;
}
/// <summary> 结算值 </summary>
public
decimal
?
ItemValue
{
get
;
set
;
}
}
...
...
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
1373e6f2
...
...
@@ -54,6 +54,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
public
virtual
DbSet
<
cof_again
>
cof_again
{
get
;
set
;
}
/// <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_depttype
>
cof_depttype
{
get
;
set
;
}
/// <summary> 规模绩效、效率绩效计算系数配置 </summary>
...
...
performance/Performance.EntityModels/Entity/cof_cmi.cs
0 → 100644
View file @
1373e6f2
//-----------------------------------------------------------------------
// <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
;
}
/// <summary>
///
/// </summary>
public
int
AllotId
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
int
UnitType
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
AccountingUnit
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
decimal
>
Value
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/cof_workitem.cs
View file @
1373e6f2
...
...
@@ -30,5 +30,10 @@ public class cof_workitem
/// 工作量中需做运算的项
/// </summary>
public
string
Item
{
get
;
set
;
}
/// <summary>
/// 1. 药占比 2. CMI
/// </summary>
public
int
Type
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/res_account.cs
View file @
1373e6f2
...
...
@@ -75,7 +75,12 @@ public class res_account
/// 倾斜系数
/// </summary>
public
Nullable
<
decimal
>
SlopeFactor
{
get
;
set
;
}
/// <summary>
/// 药占比系数
/// </summary>
public
Nullable
<
decimal
>
MedicineFactor
{
get
;
set
;
}
/// <summary>
/// 保底绩效参考标准
/// </summary>
...
...
performance/Performance.Repository/PerforCofdirectorRepository.cs
View file @
1373e6f2
...
...
@@ -134,7 +134,11 @@ public int SupplementaryData(int allotid)
select AllotId,PeopleNumber PersonnelNumber,DoctorName from im_employee where allotid = @allotid
union all
select AllotId,PersonnelNumber,DoctorName from im_employee_clinic where allotid = @allotid
) t where DoctorName not in (select DoctorName from per_apr_amount where allotid = @allotid);"
) t where DoctorName not in (select DoctorName from per_apr_amount where allotid = @allotid);"
,
@"insert into cof_cmi(AllotId, UnitType, AccountingUnit)
select AllotId,UnitType,DoctorAccountingUnit from im_accountbasic where allotid = @allotid
and concat(UnitType,DoctorAccountingUnit) not in (select concat(UnitType,AccountingUnit) from cof_cmi where allotid = @allotid)"
};
int
flag
=
0
;
...
...
performance/Performance.Repository/Repository/PerforCofcmiRepository.cs
0 → 100644
View file @
1373e6f2
//-----------------------------------------------------------------------
// <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
)
{
}
}
}
performance/Performance.Services/AllotCompute/ProcessComputService.cs
View file @
1373e6f2
...
...
@@ -26,6 +26,7 @@ public class ProcessComputService : IAutoInjection
private
PerforResbaiscnormRepository
perforResbaiscnormRepository
;
private
PerforCofdrugtypeRepository
perforCofdrugtypeRepository
;
private
PerforCofworkitemRepository
perforCofworkitemRepository
;
private
PerforCofcmiRepository
perforCofcmiRepository
;
private
readonly
LogManageService
logManageService
;
private
readonly
GuaranteeService
guaranteeService
;
...
...
@@ -39,6 +40,7 @@ public class ProcessComputService : IAutoInjection
PerforResbaiscnormRepository
perforResbaiscnormRepository
,
PerforCofdrugtypeRepository
perforCofdrugtypeRepository
,
PerforCofworkitemRepository
perforCofworkitemRepository
,
PerforCofcmiRepository
perforCofcmiRepository
,
LogManageService
logManageService
,
GuaranteeService
guaranteeService
)
{
...
...
@@ -52,6 +54,7 @@ public class ProcessComputService : IAutoInjection
this
.
perforResbaiscnormRepository
=
perforResbaiscnormRepository
;
this
.
perforCofdrugtypeRepository
=
perforCofdrugtypeRepository
;
this
.
perforCofworkitemRepository
=
perforCofworkitemRepository
;
this
.
perforCofcmiRepository
=
perforCofcmiRepository
;
this
.
logManageService
=
logManageService
;
this
.
guaranteeService
=
guaranteeService
;
}
...
...
@@ -197,12 +200,13 @@ public void Save(List<PerSheet> perSheets, int allotId)
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 onceWorkload1 = workloadCompute.OnceCompute(workload1, confs);
//医生组 二次计算
logManageService
.
WriteMsg
(
"正在生成绩效"
,
"医生组工作量计算"
,
1
,
allotid
,
"ReceiveMessage"
);
var
twiceWorkloadResult1
=
workloadCompute
.
TwiceCompute
(
workload1
,
confs
,
c
onitem
);
var
twiceWorkloadResult1
=
workloadCompute
.
TwiceCompute
(
workload1
,
confs
,
c
mis
,
conitem
,
true
);
twiceWorkloadResult1
.
Sheet
.
SheetType
=
SheetType
.
ComputeDoctorWorkload
;
perSheet
.
Add
(
twiceWorkloadResult1
.
Sheet
);
...
...
@@ -213,7 +217,7 @@ public void Save(List<PerSheet> perSheets, int allotId)
//var onceWorkload2 = workloadCompute.OnceCompute(workload2);
//护理组 二次计算
logManageService
.
WriteMsg
(
"正在生成绩效"
,
"护理组工作量计算"
,
1
,
allotid
,
"ReceiveMessage"
);
var
twiceWorkloadResult2
=
workloadCompute
.
TwiceCompute
(
workload2
,
confs
,
conitem
);
var
twiceWorkloadResult2
=
workloadCompute
.
TwiceCompute
(
workload2
,
confs
,
c
mis
,
c
onitem
);
twiceWorkloadResult2
.
Sheet
.
SheetType
=
SheetType
.
ComputeNurseWorkload
;
perSheet
.
Add
(
twiceWorkloadResult2
.
Sheet
);
...
...
@@ -312,6 +316,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_
if
(
isFirst
&&
extra
!=
null
)
dept
.
Extra
+=
extra
.
CellValue
??
0
;
dept
.
MedicineFactor
=
workDoctor
?.
MedicineFactor
;
dept
.
ScoringAverage
=
dept
.
ScoringAverage
==
0
m
?
1
:
dept
.
ScoringAverage
;
dept
.
AdjustFactor
=
dept
.
AdjustFactor
==
0
m
?
1
:
dept
.
AdjustFactor
;
dept
.
WorkSlopeFactor
=
dept
.
WorkSlopeFactor
==
0
m
?
1
:
dept
.
WorkSlopeFactor
;
...
...
performance/Performance.Services/ComputeService.cs
View file @
1373e6f2
...
...
@@ -28,6 +28,7 @@ public class ComputeService : IAutoInjection
private
readonly
PerforPerallotRepository
perforPerallotRepository
;
private
readonly
PerforHospitalRepository
hospitalRepository
;
private
readonly
PerforPerapramountRepository
perapramountRepository
;
private
readonly
PerforCofcmiRepository
cofcmiRepository
;
public
ComputeService
(
PerforResaccountRepository
perforResaccountRepository
,
PerforPersheetRepository
perforPerSheetRepository
,
...
...
@@ -42,7 +43,8 @@ public class ComputeService : IAutoInjection
PerforImemployeeRepository
perforImemployeeRepository
,
PerforPerallotRepository
perforPerallotRepository
,
PerforHospitalRepository
hospitalRepository
,
PerforPerapramountRepository
perapramountRepository
)
PerforPerapramountRepository
perapramountRepository
,
PerforCofcmiRepository
cofcmiRepository
)
{
this
.
perforResaccountRepository
=
perforResaccountRepository
;
this
.
_perforPerSheetRepository
=
perforPerSheetRepository
;
...
...
@@ -58,6 +60,7 @@ public class ComputeService : IAutoInjection
this
.
perforPerallotRepository
=
perforPerallotRepository
;
this
.
hospitalRepository
=
hospitalRepository
;
this
.
perapramountRepository
=
perapramountRepository
;
this
.
cofcmiRepository
=
cofcmiRepository
;
}
public
int
IsShowManage
(
int
allotId
)
...
...
performance/Performance.Services/ConfigService.cs
View file @
1373e6f2
...
...
@@ -26,6 +26,7 @@ public class ConfigService : IAutoInjection
private
PerforImheaderRepository
perforImheaderRepository
;
private
PerforCofdepttypeRepository
perforCofdepttypeRepository
;
private
PerforPerapramountRepository
perapramountRepository
;
private
PerforCofcmiRepository
perforCofcmiRepository
;
private
PersonService
personService
;
private
LogManageService
logManageService
;
private
ILogger
<
ConfigService
>
logger
;
...
...
@@ -41,6 +42,7 @@ public class ConfigService : IAutoInjection
PerforImheaderRepository
perforImheaderRepository
,
PerforCofdepttypeRepository
perforCofdepttypeRepository
,
PerforPerapramountRepository
perapramountRepository
,
PerforCofcmiRepository
perforCofcmiRepository
,
PersonService
personService
,
LogManageService
logManageService
,
ILogger
<
ConfigService
>
logger
)
...
...
@@ -56,6 +58,7 @@ public class ConfigService : IAutoInjection
this
.
perforImheaderRepository
=
perforImheaderRepository
;
this
.
perforCofdepttypeRepository
=
perforCofdepttypeRepository
;
this
.
perapramountRepository
=
perapramountRepository
;
this
.
perforCofcmiRepository
=
perforCofcmiRepository
;
this
.
personService
=
personService
;
this
.
logManageService
=
logManageService
;
this
.
logger
=
logger
;
...
...
@@ -485,6 +488,64 @@ public bool DepttypeDelete(DrugpropRequest request)
}
#
endregion
#
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>
/// <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
}
"
);
entity
.
UnitType
=
request
.
UnitType
;
entity
.
AccountingUnit
=
request
.
AccountingUnit
;
entity
.
Value
=
request
.
Value
;
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
}
"
);
return
perforCofcmiRepository
.
Remove
(
entity
);
}
#
endregion
#
region
cof_again
/// <summary>
/// 获取cof_drugprop列表
...
...
@@ -567,6 +628,8 @@ public void Copy(per_allot allot)
personService
.
CreateAllotPersons
(
allot
.
HospitalId
,
allot
.
ID
,
allotId
);
CopyCMIData
(
allotId
,
allot
.
ID
);
#
region
弃用
//var orgDirector = _directorRepository.GetEntities(t => t.AllotID == allot.ID);
...
...
@@ -738,5 +801,36 @@ private void CopyAprData(int prevAllotId, int allotId)
perapramountRepository
.
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/SheetDataCompute/PerSheetDataComputeWorkload.cs
View file @
1373e6f2
...
...
@@ -99,7 +99,7 @@ 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
,
List
<
CofDrugProp
>
confs
=
null
,
List
<
cof_
workitem
>
workitems
=
null
)
public
(
PerSheet
Sheet
,
List
<
PerData
>
PerData
)
TwiceCompute
(
PerSheet
sheet
,
List
<
CofDrugProp
>
confs
=
null
,
List
<
cof_
cmi
>
cmis
=
null
,
List
<
cof_workitem
>
workitems
=
null
,
bool
isDoctor
=
false
)
{
//获取最大列坐标位置
int
thiscell
=
sheet
.
PerHeader
.
OrderByDescending
(
t
=>
t
.
PointCell
).
FirstOrDefault
().
PointCell
+
1
;
...
...
@@ -113,18 +113,25 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
var
groupList
=
dataList
.
Where
(
t
=>
t
.
CellValue
.
HasValue
).
GroupBy
(
t
=>
new
{
t
.
UnitType
,
t
.
AccountingUnit
});
foreach
(
var
group
in
groupList
)
{
var
ds
=
group
.
Select
(
t
=>
new
PerData
var
ds
=
group
.
Select
(
t
=>
{
UnitType
=
group
.
Key
.
UnitType
,
AccountingUnit
=
group
.
Key
.
AccountingUnit
,
//CellValue = group.Sum(s => s.CellValue),
CellValue
=
ComputValue
(
group
,
confs
,
workitems
),
TypeName
=
group
.
Key
.
UnitType
,
RowNumber
=
group
.
FirstOrDefault
()?.
RowNumber
??
0
,
IsTotal
=
1
,
PointCell
=
thiscell
,
ComputRule
=
group
.
Select
(
s
=>
s
.
ComputRule
).
Distinct
().
First
(),
SignID
=
perHead
.
SignID
,
var
(
cellvalue
,
factor
)
=
ComputValue
(
group
,
confs
,
cmis
,
workitems
,
isDoctor
);
var
dto
=
new
PerData
{
UnitType
=
group
.
Key
.
UnitType
,
AccountingUnit
=
group
.
Key
.
AccountingUnit
,
//CellValue = group.Sum(s => s.CellValue),
CellValue
=
cellvalue
,
MedicineFactor
=
factor
,
TypeName
=
group
.
Key
.
UnitType
,
RowNumber
=
group
.
FirstOrDefault
()?.
RowNumber
??
0
,
IsTotal
=
1
,
PointCell
=
thiscell
,
ComputRule
=
group
.
Select
(
s
=>
s
.
ComputRule
).
Distinct
().
First
(),
SignID
=
perHead
.
SignID
,
};
return
dto
;
});
perDataList
.
AddRange
(
ds
);
}
...
...
@@ -133,21 +140,44 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
return
(
sheet
,
perDataList
);
}
private
decimal
?
ComputValue
(
IGrouping
<
object
,
PerData
>
group
,
List
<
CofDrugProp
>
confs
=
null
,
List
<
cof_workitem
>
workitems
=
null
)
private
(
decimal
?,
decimal
?)
ComputValue
(
IGrouping
<
object
,
PerData
>
group
,
List
<
CofDrugProp
>
confs
=
null
,
List
<
cof_cmi
>
cmis
=
null
,
List
<
cof_workitem
>
workitems
=
null
,
bool
isDoctor
=
false
)
{
if
(
confs
==
null
||
workitems
==
null
)
return
group
.
Sum
(
s
=>
s
.
IsFactor
?
s
.
CellValue
*
s
.
FactorValue
:
s
.
CellValue
);
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
.
其他护理组
};
if
((
confs
==
null
&&
cmis
==
null
)
||
workitems
==
null
)
return
(
group
.
Sum
(
s
=>
s
.
IsFactor
?
s
.
CellValue
*
s
.
FactorValue
:
s
.
CellValue
),
null
);
else
{
var
factor
=
confs
.
FirstOrDefault
(
t
=>
t
.
AccoutingUnit
==
group
.
First
().
AccountingUnit
)?.
Factor
??
1
;
var
cmifactor
=
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
);
return
value
;
//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
;
})
*
factor
;
value
+=
ngroup
.
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
;
});
return
(
value
,
factor
);
}
}
#
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