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
3df6fed5
Commit
3df6fed5
authored
Mar 22, 2019
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临时过渡版
parent
093f1039
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
162 additions
and
43 deletions
+162
-43
performance/Performance.ConsoleApp/Program.cs
+1
-1
performance/Performance.DtoModels/PerExcel/ExcelEnum.cs
+31
-1
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeDeputyDirector.cs
+17
-0
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeDirector.cs
+18
-0
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeMedicalTechnician .cs
+14
-0
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeNurse.cs
+17
-0
performance/Performance.Services/PerExcelService/PerExcelService.cs
+25
-39
performance/Performance.Services/PerExcelService/PerSheetService.cs
+39
-2
No files found.
performance/Performance.ConsoleApp/Program.cs
View file @
3df6fed5
...
...
@@ -86,7 +86,7 @@ static void Main(string[] args)
}
// 计算最总数据
perExcelService
.
Compute
(
excel
);
//
perExcelService.Compute(excel);
Console
.
ReadKey
();
}
...
...
performance/Performance.DtoModels/PerExcel/ExcelEnum.cs
View file @
3df6fed5
...
...
@@ -29,13 +29,43 @@ public enum SheetType
Workload
=
7
,
[
Description
(
"特殊核算单元"
)]
SpecialUnit
=
8
,
[
Description
(
"
核算单元统一系数
"
)]
[
Description
(
"
临床科室医护绩效测算基础
"
)]
DeptAccounting
=
9
,
[
Description
(
"科室经济核算汇总表"
)]
ComputeEconomic
=
10
,
[
Description
(
"医生工作量计算"
)]
ComputeDoctorWorkload
=
11
,
[
Description
(
"护士工作量计算"
)]
ComputeNurseWorkload
=
12
,
[
Description
(
"临床科室医生绩效测算表"
)]
ComputeDoctorAccount
=
13
,
[
Description
(
"临床科室护士绩效测算表"
)]
ComputeNurseAccount
=
14
,
}
/// <summary>
/// 职位归类
/// </summary>
public
enum
EmpolyeeType
{
/// <summary> 院领导 </summary>
[
Description
(
"院领导"
)]
TopManage
=
1
,
/// <summary> 行政中层 </summary>
[
Description
(
"行政中层"
)]
MiddleManage
=
2
,
/// <summary> 行政中层 </summary>
[
Description
(
"行政工勤"
)]
LogisticsWorkers
=
3
,
/// <summary> 行政中层 </summary>
[
Description
(
"临床科室主任"
)]
Director
=
4
,
/// <summary> 行政中层 </summary>
[
Description
(
"临床科室副主任"
)]
DeputyDirector
=
5
,
/// <summary> 行政中层 </summary>
[
Description
(
"临床科室护士长"
)]
Nurse
=
6
,
}
}
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeDeputyDirector.cs
0 → 100644
View file @
3df6fed5
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.Services
{
/// <summary>
/// 临床科室副主任
/// </summary>
public
class
ComputeDeputyDirector
{
public
void
Compute
(
List
<
EntityModels
.
im_employee
>
empolyeeList
)
{
throw
new
NotImplementedException
();
}
}
}
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeDirector.cs
0 → 100644
View file @
3df6fed5
using
Performance.EntityModels
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.Services
{
/// <summary>
/// 临床科室主任
/// </summary>
public
class
ComputeDirector
{
public
void
Compute
(
List
<
im_employee
>
empolyeeList
)
{
throw
new
NotImplementedException
();
}
}
}
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeMedicalTechnician .cs
0 → 100644
View file @
3df6fed5
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.Services
{
public
class
ComputeMedicalTechnician
{
public
void
Compute
(
List
<
EntityModels
.
im_employee
>
empolyeeList
)
{
}
}
}
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeNurse.cs
0 → 100644
View file @
3df6fed5
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.Services
{
/// <summary>
/// 护士长
/// </summary>
public
class
ComputeNurse
{
public
void
Compute
(
List
<
EntityModels
.
im_employee
>
empolyeeList
)
{
throw
new
NotImplementedException
();
}
}
}
performance/Performance.Services/PerExcelService/PerExcelService.cs
View file @
3df6fed5
...
...
@@ -25,7 +25,6 @@ public class PerExcelService : IAutoInjection
private
PerforImaccountbasicRepository
_perforImaccountbasicRepository
;
private
PerforImaccountdoctorRepository
_perforImaccountdoctorRepository
;
private
PerforImaccountnurseRepository
_perforImaccountnurseRepository
;
private
PerforCofdrugpropRepository
_perforCofdrugpropRepository
;
public
PerExcelService
(
PerSheetService
perSheetService
,
PerHeaderService
perHeaderService
,
PerforImSheetRepository
perforImSheetRepository
,
...
...
@@ -34,8 +33,7 @@ public class PerExcelService : IAutoInjection
PerforImEmployeeRepository
perforImEmployeeRepository
,
PerforImaccountbasicRepository
perforImaccountbasicRepository
,
PerforImaccountdoctorRepository
perforImaccountdoctorRepository
,
PerforImaccountnurseRepository
perforImaccountnurseRepository
,
PerforCofdrugpropRepository
perforCofdrugpropRepository
)
PerforImaccountnurseRepository
perforImaccountnurseRepository
)
{
_perSheetService
=
perSheetService
;
_perHeaderService
=
perHeaderService
;
...
...
@@ -46,7 +44,6 @@ public class PerExcelService : IAutoInjection
_perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
_perforImaccountdoctorRepository
=
perforImaccountdoctorRepository
;
_perforImaccountnurseRepository
=
perforImaccountnurseRepository
;
_perforCofdrugpropRepository
=
perforCofdrugpropRepository
;
}
public
void
Execute
(
sys_allot
allot
)
...
...
@@ -70,7 +67,7 @@ public void Execute(sys_allot allot)
Save
(
list
,
allot
.
ID
,
2
);
// 计算最总数据
Compute
(
excel
);
Compute
(
allot
,
excel
);
//发送邮件
SendEmail
(
allot
);
...
...
@@ -134,41 +131,9 @@ public void Copy(int iD)
/// <param name="excel"></param>
public
List
<
PerSheet
>
ProcessCompute
(
PerExcel
excel
)
{
var
confs
=
GetDrugConfig
(
excel
);
return
_perSheetService
.
ProcessCompute
(
excel
,
confs
);
return
_perSheetService
.
ProcessCompute
(
excel
);
}
/// <summary>
/// 获取药占比分割比例
/// </summary>
/// <param name="excel"></param>
/// <returns></returns>
private
List
<
CofDrugProp
>
GetDrugConfig
(
PerExcel
excel
)
{
//计算药占比
List
<
CofDrugProp
>
cofs
=
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
drugData
=
datalist
.
Where
(
t
=>
t
.
TypeName
==
"西药费"
||
t
.
TypeName
==
"中成药费"
).
GroupBy
(
t
=>
t
.
AccountingUnit
).
Select
(
t
=>
new
{
AccountingUnit
=
t
.
Key
,
SumValue
=
t
.
Sum
(
s
=>
s
.
CellValue
)
});
var
allData
=
datalist
.
GroupBy
(
t
=>
t
.
AccountingUnit
).
Select
(
t
=>
new
{
AccountingUnit
=
t
.
Key
,
SumValue
=
t
.
Sum
(
s
=>
s
.
CellValue
)
});
var
cofList
=
_perforCofdrugpropRepository
.
GetEntities
();
var
unitList
=
drugData
.
Select
(
t
=>
t
.
AccountingUnit
).
Union
(
allData
.
Select
(
t
=>
t
.
AccountingUnit
));
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
=
prop
==
0
?
0
:
cofList
.
FirstOrDefault
(
t
=>
prop
>
t
.
MinRange
&&
prop
<=
t
.
MaxRange
)?.
Value
??
0
;
cofs
.
Add
(
new
CofDrugProp
{
AccoutingUnit
=
unit
,
Factor
=
fvalue
,
Prop
=
prop
});
}
return
cofs
;
}
/// <summary>
/// 保存绩效结果
...
...
@@ -328,8 +293,29 @@ private IRow CreateRow(ICellStyle cellstyle, ISheet exportSheet, IRow row, PerHe
/// 计算最终数据
/// </summary>
/// <param name="excel"></param>
public
void
Compute
(
PerExcel
excel
)
public
void
Compute
(
sys_allot
allot
,
PerExcel
excel
)
{
var
sheetList
=
_perforImSheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
//取出人员信息
var
empolyeeList
=
_perforImEmployeeRepository
.
GetEntities
(
t
=>
sheetList
.
Select
(
s
=>
s
.
ID
).
Contains
(
t
.
SheetID
.
Value
));
//根据不同人员执行不同算法
ComputeDirector
computeDirector
=
new
ComputeDirector
();
computeDirector
.
Compute
(
empolyeeList
);
ComputeDeputyDirector
computeDeputyDirector
=
new
ComputeDeputyDirector
();
computeDeputyDirector
.
Compute
(
empolyeeList
);
ComputeNurse
computeNurse
=
new
ComputeNurse
();
computeNurse
.
Compute
(
empolyeeList
);
ComputeMedicalTechnician
computeMedicalTechnician
=
new
ComputeMedicalTechnician
();
computeMedicalTechnician
.
Compute
(
empolyeeList
);
//计算院领导、中层管理、工勤人员
//throw new NotImplementedException();
}
}
...
...
performance/Performance.Services/PerExcelService/PerSheetService.cs
View file @
3df6fed5
...
...
@@ -14,11 +14,14 @@ public class PerSheetService : IAutoInjection
{
private
PerHeaderService
_perHeader
;
private
PerforCofincomeRepository
_perforCofincomeRepository
;
private
PerforCofdrugpropRepository
_perforCofdrugpropRepository
;
public
PerSheetService
(
PerHeaderService
perHeader
,
PerforCofincomeRepository
perforCofincomeRepository
)
PerforCofincomeRepository
perforCofincomeRepository
,
PerforCofdrugpropRepository
perforCofdrugpropRepository
)
{
_perHeader
=
perHeader
;
_perforCofincomeRepository
=
perforCofincomeRepository
;
_perforCofdrugpropRepository
=
perforCofdrugpropRepository
;
}
/// <summary>
...
...
@@ -67,7 +70,7 @@ public SheetType GetSheetType(string sheetName)
return
SheetType
.
Unidentifiable
;
}
internal
List
<
PerSheet
>
ProcessCompute
(
PerExcel
excel
,
List
<
CofDrugProp
>
confs
)
internal
List
<
PerSheet
>
ProcessCompute
(
PerExcel
excel
)
{
List
<
PerSheet
>
perSheet
=
new
List
<
PerSheet
>();
...
...
@@ -90,6 +93,7 @@ internal List<PerSheet> ProcessCompute(PerExcel excel, List<CofDrugProp> confs)
var
workload1
=
excel
.
PerSheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
SheetType
.
Workload
&&
t
.
SheetName
.
Contains
(
"医生组"
));
workload1
.
SheetName
=
"医生组工作量绩效测算表"
;
var
confs
=
GetDrugConfig
(
excel
);
//医生组 一次计算
var
onceWorkload1
=
workloadCompute
.
OnceCompute
(
workload1
,
confs
);
//医生组 二次计算
...
...
@@ -134,5 +138,38 @@ internal List<PerSheet> ProcessCompute(PerExcel excel, List<CofDrugProp> confs)
return
perSheet
;
}
/// <summary>
/// 获取药占比分割比例
/// </summary>
/// <param name="excel"></param>
/// <returns></returns>
private
List
<
CofDrugProp
>
GetDrugConfig
(
PerExcel
excel
)
{
//计算药占比
List
<
CofDrugProp
>
cofs
=
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
drugData
=
datalist
.
Where
(
t
=>
t
.
TypeName
==
"西药费"
||
t
.
TypeName
==
"中成药费"
).
GroupBy
(
t
=>
t
.
AccountingUnit
).
Select
(
t
=>
new
{
AccountingUnit
=
t
.
Key
,
SumValue
=
t
.
Sum
(
s
=>
s
.
CellValue
)
});
var
allData
=
datalist
.
GroupBy
(
t
=>
t
.
AccountingUnit
).
Select
(
t
=>
new
{
AccountingUnit
=
t
.
Key
,
SumValue
=
t
.
Sum
(
s
=>
s
.
CellValue
)
});
var
cofList
=
_perforCofdrugpropRepository
.
GetEntities
();
var
unitList
=
drugData
.
Select
(
t
=>
t
.
AccountingUnit
).
Union
(
allData
.
Select
(
t
=>
t
.
AccountingUnit
));
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
=
prop
==
0
?
0
:
cofList
.
FirstOrDefault
(
t
=>
prop
>
t
.
MinRange
&&
prop
<=
t
.
MaxRange
)?.
Value
??
0
;
cofs
.
Add
(
new
CofDrugProp
{
AccoutingUnit
=
unit
,
Factor
=
fvalue
,
Prop
=
prop
});
}
return
cofs
;
}
}
}
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