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
b489a8c8
Commit
b489a8c8
authored
Sep 23, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保底绩效相关配置
parent
0656f781
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
327 additions
and
1 deletions
+327
-1
performance/Performance.Api/Controllers/GuaranteeController.cs
+93
-0
performance/Performance.DtoModels/Request/GuaranteeRequest.cs
+56
-0
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+2
-0
performance/Performance.EntityModels/Entity/cof_guarantee.cs
+49
-0
performance/Performance.EntityModels/Entity/res_compute.cs
+1
-1
performance/Performance.Repository/Repository/PerforCofguaranteeRepository.cs
+20
-0
performance/Performance.Services/GuaranteeService.cs
+106
-0
No files found.
performance/Performance.Api/Controllers/GuaranteeController.cs
0 → 100644
View file @
b489a8c8
using
FluentValidation.AspNetCore
;
using
Microsoft.AspNetCore.Mvc
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Services
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
Performance.Api.Controllers
{
[
Route
(
"api/[controller]"
)]
public
class
GuaranteeController
{
private
readonly
GuaranteeService
guaranteeService
;
public
GuaranteeController
(
GuaranteeService
guaranteeService
)
{
this
.
guaranteeService
=
guaranteeService
;
}
#
region
cof_guarantee
/// <summary>
/// 保底绩效配置列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"list"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
cof_guarantee
>>
Guarantee
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
GuaranteeRequest
request
)
{
var
list
=
guaranteeService
.
Guarantee
(
request
.
AllotId
);
return
new
ApiResponse
<
List
<
cof_guarantee
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
/// <summary>
/// 新增保底绩效配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"insert"
)]
[
HttpPost
]
public
ApiResponse
<
cof_guarantee
>
GuarantInsert
([
CustomizeValidator
(
RuleSet
=
"Insert"
),
FromBody
]
GuaranteeRequest
request
)
{
var
entity
=
guaranteeService
.
GuarantInsert
(
request
);
if
(
entity
.
Id
>
0
)
return
new
ApiResponse
<
cof_guarantee
>(
ResponseType
.
OK
,
"新增配置成功"
,
entity
);
return
new
ApiResponse
<
cof_guarantee
>(
ResponseType
.
Fail
,
"新增配置失败"
,
entity
);
}
/// <summary>
/// 修改保底绩效配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"update"
)]
[
HttpPost
]
public
ApiResponse
<
cof_guarantee
>
GuarantUpdate
([
CustomizeValidator
(
RuleSet
=
"Update"
),
FromBody
]
GuaranteeRequest
request
)
{
var
result
=
guaranteeService
.
GuarantUpdate
(
request
);
return
new
ApiResponse
<
cof_guarantee
>(
ResponseType
.
OK
,
"修改配置成功"
,
result
);
}
/// <summary>
/// 删除保底绩效配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"delete"
)]
[
HttpPost
]
public
ApiResponse
<
cof_guarantee
>
GuarantDelete
([
CustomizeValidator
(
RuleSet
=
"Delete"
),
FromBody
]
GuaranteeRequest
request
)
{
var
result
=
guaranteeService
.
GuarantDelete
(
request
.
Id
);
if
(
result
)
return
new
ApiResponse
<
cof_guarantee
>(
ResponseType
.
OK
,
"删除配置成功"
);
return
new
ApiResponse
<
cof_guarantee
>(
ResponseType
.
Fail
,
"删除配置失败"
);
}
/// <summary>
/// 医院核算单元
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"accountingunit"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
TitleValue
>>
Accounting
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
GuaranteeRequest
request
)
{
var
result
=
guaranteeService
.
Accounting
(
request
.
AllotId
);
return
new
ApiResponse
<
List
<
TitleValue
>>(
ResponseType
.
OK
,
"医院核算单元列表"
,
result
);
}
#
endregion
}
}
performance/Performance.DtoModels/Request/GuaranteeRequest.cs
0 → 100644
View file @
b489a8c8
using
FluentValidation
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
GuaranteeRequest
{
/// <summary> </summary>
public
int
Id
{
get
;
set
;
}
/// <summary> </summary>
public
int
AllotId
{
get
;
set
;
}
/// <summary> 优先级 </summary>
public
int
Priority
{
get
;
set
;
}
/// <summary> 核算单元类型 1 医生组 2 护理组 3 医技组 </summary>
public
Nullable
<
int
>
UnitType
{
get
;
set
;
}
/// <summary> 保底科室 </summary>
public
string
Target
{
get
;
set
;
}
/// <summary> 保底来源科室 </summary>
public
string
Source
{
get
;
set
;
}
}
public
class
GuaranteeRequestValidator
:
AbstractValidator
<
GuaranteeRequest
>
{
public
GuaranteeRequestValidator
()
{
RuleSet
(
"Select"
,
()
=>
{
RuleFor
(
x
=>
x
.
AllotId
).
NotNull
().
NotEmpty
().
GreaterThan
(
0
);
});
RuleSet
(
"Insert"
,
()
=>
{
RuleFor
(
x
=>
x
.
AllotId
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
Priority
).
NotNull
().
GreaterThan
(
0
);
});
RuleSet
(
"Update"
,
()
=>
{
RuleFor
(
x
=>
x
.
Id
).
NotNull
().
GreaterThan
(
0
);
});
RuleSet
(
"Delete"
,
()
=>
{
RuleFor
(
x
=>
x
.
Id
).
NotNull
().
GreaterThan
(
0
);
});
}
}
}
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
b489a8c8
...
...
@@ -40,6 +40,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
public
virtual
DbSet
<
cof_drugprop
>
cof_drugprop
{
get
;
set
;
}
/// <summary> 药占比费用列头名称 </summary>
public
virtual
DbSet
<
cof_drugtype
>
cof_drugtype
{
get
;
set
;
}
/// <summary> 保底科室配置 </summary>
public
virtual
DbSet
<
cof_guarantee
>
cof_guarantee
{
get
;
set
;
}
/// <summary> ICU医生护士有效收入汇总计算系数 </summary>
public
virtual
DbSet
<
cof_income
>
cof_income
{
get
;
set
;
}
/// <summary> 特殊绩效项指标 </summary>
...
...
performance/Performance.EntityModels/Entity/cof_guarantee.cs
0 → 100644
View file @
b489a8c8
//-----------------------------------------------------------------------
// <copyright file=" cof_guarantee.cs">
// * FileName: 保底科室配置.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
namespace
Performance.EntityModels
{
/// <summary>
/// 保底科室配置
/// </summary>
[
Table
(
"cof_guarantee"
)]
public
class
cof_guarantee
{
/// <summary>
///
/// </summary>
[
Key
]
public
int
Id
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
int
>
AllotId
{
get
;
set
;
}
/// <summary>
/// 优先级
/// </summary>
public
Nullable
<
int
>
Priority
{
get
;
set
;
}
/// <summary>
/// 核算单元类型 1 医生组 2 护理组 3 医技组
/// </summary>
public
Nullable
<
int
>
UnitType
{
get
;
set
;
}
/// <summary>
/// 保底科室
/// </summary>
public
string
Target
{
get
;
set
;
}
/// <summary>
/// 保底来源科室
/// </summary>
public
string
Source
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/res_compute.cs
View file @
b489a8c8
...
...
@@ -160,7 +160,7 @@ public class res_compute
/// 变更日志
/// </summary>
public
string
ChangeLog
{
get
;
set
;
}
/// <summary>
///
/// </summary>
...
...
performance/Performance.Repository/Repository/PerforCofguaranteeRepository.cs
0 → 100644
View file @
b489a8c8
//-----------------------------------------------------------------------
// <copyright file=" cof_guarantee.cs">
// * FileName: cof_guarantee.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
Performance.EntityModels
;
namespace
Performance.Repository
{
/// <summary>
/// cof_guarantee Repository
/// </summary>
public
partial
class
PerforCofguaranteeRepository
:
PerforRepository
<
cof_guarantee
>
{
public
PerforCofguaranteeRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
}
}
}
performance/Performance.Services/GuaranteeService.cs
0 → 100644
View file @
b489a8c8
using
AutoMapper
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Repository
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Performance.Services
{
public
class
GuaranteeService
{
private
readonly
PerforPerallotRepository
perforPerAllotRepository
;
private
readonly
PerforImdataRepository
perforImdataRepository
;
private
readonly
PerforCofguaranteeRepository
perforCofguaranteeRepository
;
public
GuaranteeService
(
PerforPerallotRepository
perforPerAllotRepository
,
PerforImdataRepository
perforImdataRepository
,
PerforCofguaranteeRepository
perforCofguaranteeRepository
)
{
this
.
perforPerAllotRepository
=
perforPerAllotRepository
;
this
.
perforImdataRepository
=
perforImdataRepository
;
this
.
perforCofguaranteeRepository
=
perforCofguaranteeRepository
;
}
#
region
cof_guarantee
/// <summary>
/// 保底绩效配置列表
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public
List
<
cof_guarantee
>
Guarantee
(
int
allotId
)
{
var
list
=
perforCofguaranteeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
return
list
?.
OrderBy
(
t
=>
t
.
Priority
).
ThenBy
(
t
=>
t
.
Target
).
ToList
();
}
/// <summary>
/// 新增保底绩效配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
cof_guarantee
GuarantInsert
(
GuaranteeRequest
request
)
{
var
guarantee
=
Mapper
.
Map
<
cof_guarantee
>(
request
);
perforCofguaranteeRepository
.
Add
(
guarantee
);
return
guarantee
;
}
/// <summary>
/// 修改保底绩效配置
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
cof_guarantee
GuarantUpdate
(
GuaranteeRequest
request
)
{
var
guarantee
=
perforCofguaranteeRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
Id
);
if
(
guarantee
==
null
)
throw
new
PerformanceException
(
"request.Id 参数错误"
);
guarantee
.
UnitType
=
request
.
UnitType
;
guarantee
.
Priority
=
request
.
Priority
;
guarantee
.
Target
=
request
.
Target
;
guarantee
.
Source
=
request
.
Source
;
if
(!
perforCofguaranteeRepository
.
Update
(
guarantee
))
throw
new
PerformanceException
(
"保存失败"
);
return
Mapper
.
Map
<
cof_guarantee
>(
request
);
}
/// <summary>
/// 删除保底绩效配置
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public
bool
GuarantDelete
(
int
id
)
{
var
guarantee
=
perforCofguaranteeRepository
.
GetEntity
(
t
=>
t
.
Id
==
id
);
if
(
guarantee
==
null
)
return
false
;
return
perforCofguaranteeRepository
.
Remove
(
guarantee
);
}
/// <summary>
/// 医院核算单元
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public
List
<
TitleValue
>
Accounting
(
int
allotId
)
{
List
<
TitleValue
>
result
=
new
List
<
TitleValue
>();
var
allot
=
perforPerAllotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
if
(
allot
==
null
)
return
result
;
var
allotIds
=
perforPerAllotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
).
Select
(
t
=>
t
.
ID
);
var
data
=
perforImdataRepository
.
GetEntities
(
t
=>
allotIds
.
Contains
(
t
.
AllotID
.
Value
))?.
Select
(
t
=>
t
.
AccountingUnit
);
if
(
data
!=
null
&&
data
.
Any
())
{
data
=
data
.
Distinct
().
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
)).
OrderBy
(
t
=>
t
).
ToList
();
result
.
AddRange
(
data
.
Select
(
t
=>
new
TitleValue
{
Title
=
t
,
Value
=
t
}));
}
return
result
;
}
#
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