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
95f75800
Commit
95f75800
authored
May 06, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
医院新增开关,配置信息迁移,药占比获取
parent
fa18ec39
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
82 additions
and
19 deletions
+82
-19
performance/Performance.Api/Controllers/AllotController.cs
+3
-3
performance/Performance.DtoModels/Request/DrugpropRequest.cs
+4
-0
performance/Performance.DtoModels/Request/HospitalRequest.cs
+12
-0
performance/Performance.EntityModels/Entity/cof_drugprop.cs
+5
-0
performance/Performance.EntityModels/Entity/res_accountdoctor.cs
+5
-0
performance/Performance.EntityModels/Entity/sys_hospital.cs
+15
-0
performance/Performance.Services/AllotCompute/ProcessComputService.cs
+12
-5
performance/Performance.Services/AllotService.cs
+2
-2
performance/Performance.Services/ConfigService.cs
+13
-5
performance/Performance.Services/PerExcelService/PerSheetService.cs
+11
-4
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
95f75800
...
...
@@ -63,11 +63,12 @@ public ApiResponse List([FromBody]AllotRequest request)
/// <returns></returns>
[
Route
(
"insert"
)]
[
HttpPost
]
public
ApiResponse
<
AllotResponse
>
Insert
([
CustomizeValidator
(
RuleSet
=
"Insert"
),
FromBody
]
AllotRequest
request
)
public
ApiResponse
Insert
([
CustomizeValidator
(
RuleSet
=
"Insert"
),
FromBody
]
AllotRequest
request
)
{
var
user
=
_claim
.
At
(
request
);
var
result
=
_allotService
.
InsertAllot
(
request
,
user
.
UserID
);
return
new
ApiResponse
<
AllotResponse
>(
ResponseType
.
OK
,
result
);
_configService
.
Copy
(
result
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
...
...
@@ -137,7 +138,6 @@ public ApiResponse Import([FromForm] IFormCollection form)
if
(!
_allotService
.
Update
(
allot
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
$"
{
file
.
FileName
}
上传成功,修改状态失败"
);
_configService
.
Clear
(
allot
.
ID
);
_configService
.
Copy
(
allot
);
}
return
new
ApiResponse
(
ResponseType
.
OK
);
...
...
performance/Performance.DtoModels/Request/DrugpropRequest.cs
View file @
95f75800
...
...
@@ -22,6 +22,10 @@ public class DrugpropRequest : ApiRequest
/// 药占比对应系数
/// </summary>
public
decimal
Value
{
get
;
set
;
}
/// <summary>
/// 费用名称
/// </summary>
public
string
ChargeType
{
get
;
set
;
}
public
class
DrugpropRequestValidator
:
AbstractValidator
<
DrugpropRequest
>
...
...
performance/Performance.DtoModels/Request/HospitalRequest.cs
View file @
95f75800
...
...
@@ -39,6 +39,18 @@ public class HospitalRequest : ApiRequest
/// 是否开启年资系数 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsOpenWorkYear
{
get
;
set
;
}
/// <summary>
/// 是否开启药占比系数 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsOpenDrugprop
{
get
;
set
;
}
/// <summary>
/// 是否开启ICU有效收入系数 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsOpenIncome
{
get
;
set
;
}
/// <summary>
/// 是否开启规模/效率绩效 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsOpenDirector
{
get
;
set
;
}
}
public
class
HospitalRequestValidator
:
AbstractValidator
<
HospitalRequest
>
...
...
performance/Performance.EntityModels/Entity/cof_drugprop.cs
View file @
95f75800
...
...
@@ -40,5 +40,10 @@ public class cof_drugprop
/// 药占比对应系数
/// </summary>
public
Nullable
<
decimal
>
Value
{
get
;
set
;
}
/// <summary>
/// 费用名称
/// </summary>
public
string
ChargeType
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/res_accountdoctor.cs
View file @
95f75800
...
...
@@ -110,5 +110,10 @@ public class res_accountdoctor
/// 实发绩效
/// </summary>
public
Nullable
<
decimal
>
RealGiveFee
{
get
;
set
;
}
/// <summary>
/// 变更日志
/// </summary>
public
string
ChangeLog
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/sys_hospital.cs
View file @
95f75800
...
...
@@ -65,5 +65,20 @@ public class sys_hospital
/// 是否开启年资系数 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsOpenWorkYear
{
get
;
set
;
}
/// <summary>
/// 是否开启药占比系数 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsOpenDrugprop
{
get
;
set
;
}
/// <summary>
/// 是否开启ICU有效收入系数 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsOpenIncome
{
get
;
set
;
}
/// <summary>
/// 是否开启规模/效率绩效 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsOpenDirector
{
get
;
set
;
}
}
}
performance/Performance.Services/AllotCompute/ProcessComputService.cs
View file @
95f75800
...
...
@@ -49,7 +49,7 @@ public class ProcessComputService : IAutoInjection
/// <returns></returns>
public
List
<
PerSheet
>
MergeAndSave
(
PerExcel
excel
,
per_allot
allot
)
{
List
<
PerSheet
>
list
=
MergeCompute
(
excel
);
List
<
PerSheet
>
list
=
MergeCompute
(
excel
,
allot
.
ID
);
Save
(
list
,
allot
.
ID
);
return
list
;
}
...
...
@@ -175,7 +175,7 @@ private void Save(List<PerSheet> perSheets, int allotId)
/// <summary>
/// 合并计算
/// </summary>
private
List
<
PerSheet
>
MergeCompute
(
PerExcel
excel
)
private
List
<
PerSheet
>
MergeCompute
(
PerExcel
excel
,
int
allotid
)
{
List
<
PerSheet
>
perSheet
=
new
List
<
PerSheet
>();
...
...
@@ -197,7 +197,7 @@ private List<PerSheet> MergeCompute(PerExcel excel)
var
workload1
=
excel
.
PerSheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
SheetType
.
Workload
&&
t
.
SheetName
.
Contains
(
"医生组"
));
workload1
.
SheetName
=
"医生组工作量绩效测算表"
;
var
confs
=
GetDrugConfig
(
excel
);
var
confs
=
GetDrugConfig
(
excel
,
allotid
);
//医生组 一次计算
var
onceWorkload1
=
workloadCompute
.
OnceCompute
(
workload1
,
confs
);
//医生组 二次计算
...
...
@@ -256,14 +256,21 @@ private List<PerSheet> MergeCompute(PerExcel excel)
/// </summary>
/// <param name="excel"></param>
/// <returns></returns>
private
List
<
CofDrugProp
>
GetDrugConfig
(
PerExcel
excel
)
private
List
<
CofDrugProp
>
GetDrugConfig
(
PerExcel
excel
,
int
allotid
)
{
//计算药占比
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
chargeType
=
perforCofdrugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotid
)?.
FirstOrDefault
().
ChargeType
;
List
<
string
>
drugtype
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
chargeType
))
{
chargeType
=
chargeType
.
Replace
(
"["
,
""
).
Replace
(
"]"
,
""
).
Replace
(
"\""
,
""
);
drugtype
=
chargeType
.
Split
(
new
string
[]
{
","
},
StringSplitOptions
.
RemoveEmptyEntries
).
ToList
();
}
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
)
});
var
allData
=
datalist
.
GroupBy
(
t
=>
t
.
AccountingUnit
).
Select
(
t
=>
new
{
AccountingUnit
=
t
.
Key
,
SumValue
=
t
.
Sum
(
s
=>
s
.
CellValue
)
});
var
cofList
=
perforCofdrugpropRepository
.
GetEntities
();
...
...
performance/Performance.Services/AllotService.cs
View file @
95f75800
...
...
@@ -79,7 +79,7 @@ public List<AllotResponse> GetAllotList(int? hospitalId)
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
AllotResponse
InsertAllot
(
AllotRequest
request
,
int
userID
)
public
per_allot
InsertAllot
(
AllotRequest
request
,
int
userID
)
{
var
repAllot
=
_allotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
request
.
HospitalId
&&
t
.
Year
==
request
.
Year
&&
t
.
Month
==
request
.
Month
);
if
(
repAllot
!=
null
&&
repAllot
.
Count
()
>
0
)
...
...
@@ -93,7 +93,7 @@ public AllotResponse InsertAllot(AllotRequest request, int userID)
if
(!
_allotRepository
.
Add
(
allot
))
throw
new
PerformanceException
(
"保存失败"
);
return
Mapper
.
Map
<
AllotResponse
>(
allot
)
;
return
allot
;
}
/// <summary>
...
...
performance/Performance.Services/ConfigService.cs
View file @
95f75800
...
...
@@ -2,6 +2,7 @@
using
Newtonsoft.Json.Linq
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Repository
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -42,7 +43,7 @@ public class ConfigService : IAutoInjection
this
.
logdbug
=
logdbug
;
}
#
region
cof_director
#
region
cof_director
规模
/
效率绩效配置
/// <summary>
/// 获取cof_director列表
/// </summary>
...
...
@@ -101,7 +102,7 @@ public bool DireDelete(DirectorRequest request)
}
#
endregion
#
region
cof_drugprop
#
region
cof_drugprop
药占比系数配置
/// <summary>
/// 获取cof_drugprop列表
/// </summary>
...
...
@@ -139,6 +140,7 @@ public DrugpropResponse DrugUpdate(DrugpropRequest request)
drugprop
.
MaxRange
=
request
.
MaxRange
;
drugprop
.
MinRange
=
request
.
MinRange
;
drugprop
.
Value
=
request
.
Value
;
drugprop
.
ChargeType
=
request
.
ChargeType
;
if
(!
_drugpropRepository
.
Update
(
drugprop
))
throw
new
PerformanceException
(
"保存失败"
);
...
...
@@ -160,7 +162,7 @@ public bool DrugDelete(DrugpropRequest request)
}
#
endregion
#
region
cof_income
#
region
cof_income
ICU
有效收入配置
/// <summary>
/// 获取cof_income列表
/// </summary>
...
...
@@ -219,7 +221,7 @@ public bool IncomeDelete(IncomeRequest request)
}
#
endregion
#
region
cof_workyear
#
region
cof_workyear
年资系数配置
/// <summary>
/// 获取cof_drugprop列表
/// </summary>
...
...
@@ -303,11 +305,14 @@ public void Copy(per_allot allot)
if
(
list
[
i
].
ID
==
allot
.
ID
&&
(
i
-
1
)
>=
0
)
allotId
=
list
[
i
-
1
].
ID
;
}
var
hospital
=
perforHospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
allot
.
HospitalId
);
var
orgDirector
=
_directorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
orgDirector
==
null
||
orgDirector
.
Count
==
0
)
{
var
director
=
_directorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_directorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newDirectors
=
director
.
Select
(
t
=>
new
cof_director
{
AllotID
=
allot
.
ID
,
JobTitle
=
t
.
JobTitle
,
TypeName
=
t
.
TypeName
,
Value
=
t
.
Value
});
if
(
hospital
!=
null
&&
hospital
?.
IsOpenDirector
==
2
)
newDirectors
=
director
.
Select
(
t
=>
new
cof_director
{
AllotID
=
allot
.
ID
,
JobTitle
=
t
.
JobTitle
,
TypeName
=
t
.
TypeName
,
Value
=
1
});
_directorRepository
.
AddRange
(
newDirectors
.
ToArray
());
}
...
...
@@ -316,6 +321,8 @@ public void Copy(per_allot allot)
{
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
=
durgprop
.
Select
(
t
=>
new
cof_drugprop
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
1
});
_drugpropRepository
.
AddRange
(
newDurgprops
.
ToArray
());
}
...
...
@@ -324,6 +331,8 @@ public void Copy(per_allot allot)
{
var
income
=
_incomeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_incomeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newIncomes
=
income
.
Select
(
t
=>
new
cof_income
{
AllotID
=
allot
.
ID
,
SheetNameKeyword
=
t
.
SheetNameKeyword
,
UnitName
=
t
.
UnitName
,
Value
=
t
.
Value
});
if
(
hospital
!=
null
&&
hospital
?.
IsOpenIncome
==
2
)
newIncomes
=
income
.
Select
(
t
=>
new
cof_income
{
AllotID
=
allot
.
ID
,
SheetNameKeyword
=
t
.
SheetNameKeyword
,
UnitName
=
t
.
UnitName
,
Value
=
1
});
_incomeRepository
.
AddRange
(
newIncomes
.
ToArray
());
}
...
...
@@ -332,7 +341,6 @@ public void Copy(per_allot allot)
{
var
workyear
=
_workyearRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
??
_workyearRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
-
1
);
var
newWorkyears
=
workyear
.
Select
(
t
=>
new
cof_workyear
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
t
.
Value
});
var
hospital
=
perforHospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
allot
.
HospitalId
);
if
(
hospital
!=
null
&&
hospital
?.
IsOpenWorkYear
==
2
)
newWorkyears
=
workyear
.
Select
(
t
=>
new
cof_workyear
{
AllotID
=
allot
.
ID
,
MaxRange
=
t
.
MaxRange
,
MinRange
=
t
.
MinRange
,
Value
=
1
});
_workyearRepository
.
AddRange
(
newWorkyears
.
ToArray
());
...
...
performance/Performance.Services/PerExcelService/PerSheetService.cs
View file @
95f75800
...
...
@@ -72,7 +72,7 @@ public SheetType GetSheetType(string sheetName)
return
SheetType
.
Unidentifiable
;
}
internal
List
<
PerSheet
>
ProcessCompute
(
PerExcel
excel
)
internal
List
<
PerSheet
>
ProcessCompute
(
PerExcel
excel
,
int
allotid
)
{
List
<
PerSheet
>
perSheet
=
new
List
<
PerSheet
>();
...
...
@@ -95,7 +95,7 @@ internal List<PerSheet> ProcessCompute(PerExcel excel)
var
workload1
=
excel
.
PerSheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
SheetType
.
Workload
&&
t
.
SheetName
.
Contains
(
"医生组"
));
workload1
.
SheetName
=
"医生组工作量绩效测算表"
;
var
confs
=
GetDrugConfig
(
excel
);
var
confs
=
GetDrugConfig
(
excel
,
allotid
);
//医生组 一次计算
var
onceWorkload1
=
workloadCompute
.
OnceCompute
(
workload1
,
confs
);
//医生组 二次计算
...
...
@@ -147,14 +147,21 @@ internal List<PerSheet> ProcessCompute(PerExcel excel)
/// </summary>
/// <param name="excel"></param>
/// <returns></returns>
private
List
<
CofDrugProp
>
GetDrugConfig
(
PerExcel
excel
)
private
List
<
CofDrugProp
>
GetDrugConfig
(
PerExcel
excel
,
int
allotid
)
{
//计算药占比
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
chargeType
=
_perforCofdrugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotid
)?.
FirstOrDefault
().
ChargeType
;
List
<
string
>
drugtype
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
chargeType
))
{
chargeType
=
chargeType
.
Replace
(
"["
,
""
).
Replace
(
"]"
,
""
).
Replace
(
"\""
,
""
);
drugtype
=
chargeType
.
Split
(
new
string
[]
{
","
},
StringSplitOptions
.
RemoveEmptyEntries
).
ToList
();
}
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
)
});
var
allData
=
datalist
.
GroupBy
(
t
=>
t
.
AccountingUnit
).
Select
(
t
=>
new
{
AccountingUnit
=
t
.
Key
,
SumValue
=
t
.
Sum
(
s
=>
s
.
CellValue
)
});
var
cofList
=
_perforCofdrugpropRepository
.
GetEntities
();
...
...
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