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
87de3c0a
Commit
87de3c0a
authored
Oct 14, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2020calculate' into fixed/bug
parents
5b4f2155
738cc72f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
289 additions
and
19 deletions
+289
-19
performance/Performance.Api/Controllers/BudgetController.cs
+28
-6
performance/Performance.Api/Controllers/SecondAllotController.cs
+27
-2
performance/Performance.Api/Controllers/TemplateController.cs
+23
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+19
-0
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+5
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+25
-0
performance/Performance.DtoModels/Request/BudgetRequest.cs
+4
-0
performance/Performance.DtoModels/Response/HospitalRequest.cs
+4
-0
performance/Performance.EntityModels/Entity/ag_secondallot.cs
+20
-0
performance/Performance.EntityModels/Entity/sys_hospital.cs
+5
-0
performance/Performance.Repository/BaseRepository.cs
+4
-0
performance/Performance.Services/AllotCompute/ResultComputeService.cs
+3
-0
performance/Performance.Services/BudgetService.cs
+56
-0
performance/Performance.Services/ComputeService.cs
+1
-1
performance/Performance.Services/ExtractIncomeService.cs
+0
-0
performance/Performance.Services/SecondAllotService.cs
+65
-10
No files found.
performance/Performance.Api/Controllers/BudgetController.cs
View file @
87de3c0a
...
...
@@ -30,7 +30,7 @@ public BudgetController(ClaimService claim, BudgetService budgetService)
/// <returns></returns>
[
HttpPost
]
[
Route
(
"query"
)]
public
ApiResponse
<
List
<
BudgetResponse
>>
Query
([
FromBody
]
BudgetRequest
request
)
public
ApiResponse
<
List
<
BudgetResponse
>>
Query
([
FromBody
]
BudgetRequest
request
)
{
if
(
request
.
HospitalId
==
0
||
request
.
Year
==
0
)
return
new
ApiResponse
<
List
<
BudgetResponse
>>(
ResponseType
.
ParameterError
,
"参数无效"
);
...
...
@@ -47,7 +47,7 @@ public ApiResponse<List<BudgetResponse>> Query([FromBody]BudgetRequest request)
/// <returns></returns>
[
HttpPost
]
[
Route
(
"save/{mainYear}"
)]
public
ApiResponse
Save
(
int
mainYear
,
[
FromBody
]
List
<
BudgetResponse
>
request
)
public
ApiResponse
Save
(
int
mainYear
,
[
FromBody
]
List
<
BudgetResponse
>
request
)
{
var
userId
=
claim
.
GetUserId
();
var
result
=
false
;
...
...
@@ -65,7 +65,7 @@ public ApiResponse Save(int mainYear, [FromBody]List<BudgetResponse> request)
/// <returns></returns>
[
HttpPost
]
[
Route
(
"modify"
)]
public
ApiResponse
Modify
([
FromBody
]
List
<
BudgetResponse
>
request
)
public
ApiResponse
Modify
([
FromBody
]
List
<
BudgetResponse
>
request
)
{
//var result = budgetService.ModifyBudgetData(request);
//return result ? new ApiResponse(ResponseType.OK, "修改成功") : new ApiResponse(ResponseType.Fail, "修改失败");
...
...
@@ -79,7 +79,7 @@ public ApiResponse Modify([FromBody]List<BudgetResponse> request)
/// <returns></returns>
[
HttpPost
]
[
Route
(
"result/query"
)]
public
ApiResponse
<
List
<
per_budget_result
>>
Result
([
FromBody
]
BudgetRequest
request
)
public
ApiResponse
<
List
<
per_budget_result
>>
Result
([
FromBody
]
BudgetRequest
request
)
{
if
(
request
.
HospitalId
==
0
||
request
.
Year
==
0
)
return
new
ApiResponse
<
List
<
per_budget_result
>>(
ResponseType
.
ParameterError
,
"参数无效"
);
...
...
@@ -95,7 +95,7 @@ public ApiResponse<List<per_budget_result>> Result([FromBody]BudgetRequest reque
/// <returns></returns>
[
HttpPost
]
[
Route
(
"result/ratio"
)]
public
ApiResponse
<
List
<
BudgetRatioResponse
>>
Ratio
([
FromBody
]
BudgetRequest
request
)
public
ApiResponse
<
List
<
BudgetRatioResponse
>>
Ratio
([
FromBody
]
BudgetRequest
request
)
{
if
(
request
.
HospitalId
==
0
||
request
.
Year
==
0
)
return
new
ApiResponse
<
List
<
BudgetRatioResponse
>>(
ResponseType
.
ParameterError
,
"参数无效"
);
...
...
@@ -111,7 +111,7 @@ public ApiResponse<List<BudgetRatioResponse>> Ratio([FromBody]BudgetRequest requ
/// <returns></returns>
[
HttpPost
]
[
Route
(
"result/save"
)]
public
ApiResponse
ResultSave
([
FromBody
]
List
<
per_budget_result
>
request
)
public
ApiResponse
ResultSave
([
FromBody
]
List
<
per_budget_result
>
request
)
{
var
userId
=
claim
.
GetUserId
();
var
result
=
budgetService
.
SaveBudgetRatio
(
request
,
userId
);
...
...
@@ -143,5 +143,26 @@ public ApiResponse CancelResult(int id)
var
result
=
budgetService
.
CancelResult
(
id
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
}
/// <summary>
/// 统计指定月份绩效信息
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"result/collect"
)]
public
ApiResponse
Collect
([
FromBody
]
BudgetCollectRequest
request
)
{
var
result
=
budgetService
.
Collect
(
request
.
HospitalId
,
request
.
Year
,
request
.
Month
);
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
result
.
Year
,
result
.
Month
,
result
.
MedicalIncome
,
result
.
TheNewPerformance
,
result
.
MedicineProportion
,
result
.
MaterialCosts
,
});
}
}
}
\ No newline at end of file
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
87de3c0a
...
...
@@ -331,8 +331,7 @@ public ApiResponse SubmitAudit(SubmitAuditRequest request)
[
Route
(
"/api/second/audit/list"
)]
public
ApiResponse
<
List
<
ag_secondallot
>>
AuditList
([
FromBody
]
AllotDeptRequest
request
)
{
var
userid
=
claimService
.
GetUserId
();
var
list
=
secondAllotService
.
AuditList
(
userid
,
request
.
AllotId
);
var
list
=
secondAllotService
.
AuditList
(
request
.
AllotId
);
return
new
ApiResponse
<
List
<
ag_secondallot
>>(
ResponseType
.
OK
,
"审核列表"
,
list
);
}
...
...
@@ -352,6 +351,32 @@ public ApiResponse AuditResult([FromBody] SecondAuditRequest request)
}
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
}
/// <summary>
/// 护理部二次绩效审核列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"/api/second/audit/nursingdept/list"
)]
public
ApiResponse
<
List
<
ag_secondallot
>>
NursingDeptlist
([
FromBody
]
AllotDeptRequest
request
)
{
var
list
=
secondAllotService
.
NursingDeptlist
(
request
.
AllotId
);
return
new
ApiResponse
<
List
<
ag_secondallot
>>(
ResponseType
.
OK
,
"审核列表"
,
list
);
}
/// <summary>
/// 护理部二次绩效审核结果;驳回、成功
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"/api/second/audit/nursingdept/result"
)]
public
ApiResponse
NursingDeptAuditResult
([
FromBody
]
SecondAuditRequest
request
)
{
var
userid
=
claimService
.
GetUserId
();
var
result
=
secondAllotService
.
NursingDeptAudit
(
userid
,
request
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
}
#
endregion
#
region
二次绩效其他绩效
...
...
performance/Performance.Api/Controllers/TemplateController.cs
View file @
87de3c0a
...
...
@@ -25,6 +25,7 @@ public class TemplateController : Controller
{
private
readonly
TemplateService
templateService
;
private
readonly
DFExtractService
extractService
;
private
readonly
ExtractIncomeService
extractIncomeService
;
private
HospitalService
hospitalService
;
private
IHostingEnvironment
env
;
private
ClaimService
claim
;
...
...
@@ -37,6 +38,7 @@ public class TemplateController : Controller
public
TemplateController
(
TemplateService
templateService
,
HospitalService
hospitalService
,
DFExtractService
extractService
,
ExtractIncomeService
extractIncomeService
,
IHostingEnvironment
env
,
ClaimService
claim
,
IOptions
<
Application
>
options
,
...
...
@@ -47,6 +49,7 @@ public class TemplateController : Controller
{
this
.
templateService
=
templateService
;
this
.
extractService
=
extractService
;
this
.
extractIncomeService
=
extractIncomeService
;
this
.
hospitalService
=
hospitalService
;
this
.
env
=
env
;
this
.
claim
=
claim
;
...
...
@@ -407,5 +410,24 @@ public ApiResponse Schedule([FromBody] log_dbug request)
var
ratio
=
allotService
.
AllotLog
(
allot
,
3
)?.
Max
(
t
=>
ConvertHelper
.
TryDecimal
(
t
.
Message
))
??
0
;
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
ratio
});
}
[
Route
(
"extract/income/{allotId}"
)]
[
AllowAnonymous
]
[
HttpGet
]
public
IActionResult
ExtractIncome
(
int
allotId
)
{
string
filepath
=
extractIncomeService
.
Execture
(
allotId
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
string
fileExt
=
Path
.
GetExtension
(
filepath
);
var
provider
=
new
FileExtensionContentTypeProvider
();
var
memi
=
provider
.
Mappings
[
fileExt
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
filepath
));
}
}
}
\ No newline at end of file
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
87de3c0a
...
...
@@ -276,6 +276,13 @@
<param
name=
"id"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.BudgetController.Collect(Performance.DtoModels.Request.BudgetCollectRequest)"
>
<summary>
统计指定月份绩效信息
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.GetCompute(Performance.DtoModels.ComputerRequest)"
>
<summary>
获取绩效发放列表
...
...
@@ -1161,6 +1168,18 @@
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.NursingDeptlist(Performance.DtoModels.AllotDeptRequest)"
>
<summary>
护理部二次绩效审核列表
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.NursingDeptAuditResult(Performance.DtoModels.SecondAuditRequest)"
>
<summary>
护理部二次绩效审核结果;驳回、成功
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.OtherList(Performance.DtoModels.AgOtherRequest)"
>
<summary>
二次绩效其他绩效详情
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
87de3c0a
...
...
@@ -2817,6 +2817,11 @@
是否开启科室CMI占比 1 启用 2 禁用
</summary>
</member>
<member
name=
"P:Performance.DtoModels.HospitalResponse.IsOpenNursingDeptAudit"
>
<summary>
是否开启护理部审核 1 启用 2 禁用
</summary>
</member>
<member
name=
"P:Performance.DtoModels.IncomeResponse.SheetNameKeyword"
>
<summary>
关键字匹配
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
87de3c0a
...
...
@@ -857,6 +857,26 @@
备注
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.NursingDeptStatus"
>
<summary>
护理部审核状态 1 未提交 2 等待审核 3 审核通过 4 驳回
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.NursingDeptAuditTime"
>
<summary>
护理部审核时间
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.NursingDeptAuditUser"
>
<summary>
护理部审核人
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.NursingDeptRemark"
>
<summary>
护理部备注
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ag_temp"
>
<summary>
二次绩效模板
...
...
@@ -4997,6 +5017,11 @@
是否开启科室CMI占比 1 启用 2 禁用
</summary>
</member>
<member
name=
"P:Performance.EntityModels.sys_hospital.IsOpenNursingDeptAudit"
>
<summary>
是否开启护理部审核 1 启用 2 禁用
</summary>
</member>
<member
name=
"T:Performance.EntityModels.sys_hospitalconfig"
>
<summary>
...
...
performance/Performance.DtoModels/Request/BudgetRequest.cs
View file @
87de3c0a
...
...
@@ -10,4 +10,8 @@ public class BudgetRequest
public
int
Year
{
get
;
set
;
}
}
public
class
BudgetCollectRequest
:
BudgetRequest
{
public
int
Month
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/Response/HospitalRequest.cs
View file @
87de3c0a
...
...
@@ -23,5 +23,9 @@ public class HospitalResponse
/// 是否开启科室CMI占比 1 启用 2 禁用
/// </summary>
public
int
IsOpenCMIPercent
{
get
;
set
;
}
/// <summary>
/// 是否开启护理部审核 1 启用 2 禁用
/// </summary>
public
int
IsOpenNursingDeptAudit
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/ag_secondallot.cs
View file @
87de3c0a
...
...
@@ -85,5 +85,25 @@ public class ag_secondallot
/// 备注
/// </summary>
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// 护理部审核状态 1 未提交 2 等待审核 3 审核通过 4 驳回
/// </summary>
public
Nullable
<
int
>
NursingDeptStatus
{
get
;
set
;
}
/// <summary>
/// 护理部审核时间
/// </summary>
public
Nullable
<
DateTime
>
NursingDeptAuditTime
{
get
;
set
;
}
/// <summary>
/// 护理部审核人
/// </summary>
public
Nullable
<
int
>
NursingDeptAuditUser
{
get
;
set
;
}
/// <summary>
/// 护理部备注
/// </summary>
public
string
NursingDeptRemark
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/sys_hospital.cs
View file @
87de3c0a
...
...
@@ -90,5 +90,10 @@ public class sys_hospital
/// 是否开启科室CMI占比 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsOpenCMIPercent
{
get
;
set
;
}
/// <summary>
/// 是否开启护理部审核 1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsOpenNursingDeptAudit
{
get
;
set
;
}
}
}
performance/Performance.Repository/BaseRepository.cs
View file @
87de3c0a
...
...
@@ -35,6 +35,10 @@ public IEnumerable<T> DapperQuery<T>(string sql, object param) where T : class,
{
return
context
.
Database
.
GetDbConnection
().
Query
<
T
>(
sql
,
param
);
}
public
T
DapperQueryFirstOrDefault
<
T
>(
string
sql
,
object
param
)
{
return
context
.
Database
.
GetDbConnection
().
QueryFirstOrDefault
<
T
>(
sql
,
param
);
}
public
IEnumerable
<
T
>
DapperQuery
<
T
>(
string
sql
,
object
param
,
int
?
commandTimeout
=
null
)
{
...
...
performance/Performance.Services/AllotCompute/ResultComputeService.cs
View file @
87de3c0a
...
...
@@ -545,6 +545,7 @@ public void GenerateSecondAllot(per_allot allot)
Department
=
item
.
Department
,
RealGiveFee
=
item
.
RealGiveFee
,
Status
=
1
,
NursingDeptStatus
=
1
,
});
}
else
if
(
Math
.
Round
((
second
.
RealGiveFee
??
0
)
-
(
item
.
RealGiveFee
??
0
))
>=
0.5
m
)
...
...
@@ -554,6 +555,8 @@ public void GenerateSecondAllot(per_allot allot)
{
second
.
Status
=
4
;
second
.
Remark
=
"科室绩效结果发生变更,需要重新提交"
;
second
.
NursingDeptStatus
=
4
;
second
.
NursingDeptRemark
=
"科室绩效结果发生变更,需要重新提交"
;
}
updSecond
.
Add
(
second
);
}
...
...
performance/Performance.Services/BudgetService.cs
View file @
87de3c0a
...
...
@@ -329,5 +329,61 @@ public bool GetAdjustAndGrant(per_allot allot, out decimal adjust, out decimal g
grant
=
result
.
Grant
.
Value
/
100
;
return
true
;
}
/// <summary>
/// 统计指定月份绩效信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public
per_budget_result
Collect
(
int
hospitalid
,
int
year
,
int
month
)
{
return
new
per_budget_result
{
Year
=
year
,
Month
=
month
,
MedicalIncome
=
GetMedicalIncome
(
hospitalid
,
year
,
month
),
TheNewPerformance
=
GetTheNewPerformance
(
hospitalid
,
year
,
month
),
MedicineProportion
=
GetMedicineProportion
(
hospitalid
,
year
,
month
),
MaterialCosts
=
GetMaterialCosts
(
hospitalid
,
year
,
month
),
};
}
///绩效总金额
private
decimal
GetTheNewPerformance
(
int
hospitalid
,
int
year
,
int
month
)
{
string
sql
=
@"select ifnull(sum(fee),0) as fee from (
select realgivefee as fee from res_compute t1
join per_allot t2 on t1.allotid=t2.id
where hospitalid=@hospitalid and year=@year and month=@month and accounttype in ('护士长','科主任','行政中层','行政高层')
union all
select AssessLaterPerforTotal as fee from res_account t1
join per_allot t2 on t1.allotid=t2.id
where hospitalid=@hospitalid and year=@year and month=@month
) tab"
;
return
perbudgetresultRepository
.
DapperQueryFirstOrDefault
<
decimal
>(
sql
,
new
{
hospitalid
,
year
,
month
});
}
///医疗收入
private
decimal
GetMedicalIncome
(
int
hospitalid
,
int
year
,
int
month
)
{
string
sql
=
@"select ifnull(sum(cellvalue),0) as fee from report_original_income t1 where hospitalid=@hospitalid and year=@year and month=@month"
;
return
perbudgetresultRepository
.
DapperQueryFirstOrDefault
<
decimal
>(
sql
,
new
{
hospitalid
,
year
,
month
});
}
///药品收入
private
decimal
GetMedicineProportion
(
int
hospitalid
,
int
year
,
int
month
)
{
string
sql
=
@"select ifnull(sum(cellvalue),0) as fee
from report_original_income t1
join cof_drugtype t2 on t1.allotid = t2.allotid and t2.chargetype = '药费'
where hospitalid=@hospitalid and year=@year and month=@month"
;
return
perbudgetresultRepository
.
DapperQueryFirstOrDefault
<
decimal
>(
sql
,
new
{
hospitalid
,
year
,
month
});
}
///材料支出
private
decimal
GetMaterialCosts
(
int
hospitalid
,
int
year
,
int
month
)
{
string
sql
=
@"select ifnull(sum(cellvalue),0) as fee
from report_original_income t1
join cof_drugtype t2 on t1.allotid = t2.allotid and t2.chargetype = '材料费'
where hospitalid=@hospitalid and year=@year and month=@month"
;
return
perbudgetresultRepository
.
DapperQueryFirstOrDefault
<
decimal
>(
sql
,
new
{
hospitalid
,
year
,
month
});
}
}
}
performance/Performance.Services/ComputeService.cs
View file @
87de3c0a
...
...
@@ -474,7 +474,7 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int isShowManage)
var
types2
=
new
List
<
string
>
{
AccountUnitType
.
行政中层
.
ToString
(),
AccountUnitType
.
行政高层
.
ToString
()
};
// 一次绩效 获取特定人员绩效结果
var
allot
=
_perforRescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
mTypes
.
Contains
(
t
.
AccountType
))?.
OrderByDescending
(
t
=>
t
.
AccountingUnit
);
var
apramounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
//
var apramounts = perapramountRepository.GetEntities(t => t.AllotId == allotId);
return
allot
?.
Select
(
t
=>
{
...
...
performance/Performance.Services/ExtractIncomeService.cs
0 → 100644
View file @
87de3c0a
This diff is collapsed.
Click to expand it.
performance/Performance.Services/SecondAllotService.cs
View file @
87de3c0a
...
...
@@ -17,6 +17,7 @@ namespace Performance.Services
public
class
SecondAllotService
:
IAutoInjection
{
private
readonly
Application
application
;
private
readonly
PerforHospitalRepository
hospitalRepository
;
private
readonly
PerforUserRepository
perforUserRepository
;
private
readonly
PerforUserhospitalRepository
perforUserhospitalRepository
;
private
readonly
PerforPerallotRepository
perforPerallotRepository
;
...
...
@@ -40,6 +41,7 @@ public class SecondAllotService : IAutoInjection
private
readonly
List
<
ag_tempitem
>
tempitems
=
new
List
<
ag_tempitem
>();
public
SecondAllotService
(
IOptions
<
Application
>
application
,
PerforHospitalRepository
hospitalRepository
,
PerforUserRepository
perforUserRepository
,
PerforUserhospitalRepository
perforUserhospitalRepository
,
PerforPerallotRepository
perforPerallotRepository
,
...
...
@@ -62,6 +64,7 @@ public class SecondAllotService : IAutoInjection
PerforRescomputeRepository
rescomputeRepository
)
{
this
.
application
=
application
.
Value
;
this
.
hospitalRepository
=
hospitalRepository
;
this
.
perforUserRepository
=
perforUserRepository
;
this
.
perforUserhospitalRepository
=
perforUserhospitalRepository
;
this
.
perforPerallotRepository
=
perforPerallotRepository
;
...
...
@@ -1214,21 +1217,18 @@ public bool DeleteWorkType(WorkloadRequest request)
/// </summary>
/// <param name="userId">用户ID</param>
/// <returns></returns>
public
List
<
ag_secondallot
>
AuditList
(
int
userId
,
int
allotId
)
public
List
<
ag_secondallot
>
AuditList
(
int
allotId
)
{
//var hospital = perforUserhospitalRepository.GetEntities(t => t.UserID == userId);
//var allotList = perforPerallotRepository.GetEntities(t => hospital.Select(h => h.HospitalID).Contains(t.HospitalId));
//if (allotList != null && allotList.Count > 0)
//{
// var allotIds = allotList.Select(t => t.ID);
// return perforAgsecondallotRepository.GetEntities(t => allotIds.Contains(t.AllotId.Value) && t.Status == 2);
//}
//return null;
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
if
(
allot
==
null
)
throw
new
PerformanceException
(
"所选绩效不存在!"
);
var
accountUnit
=
perforResaccountRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
!
new
int
[]
{
(
int
)
UnitType
.
行政高层
,
(
int
)
UnitType
.
行政中层
}.
Contains
(
t
.
UnitType
.
Value
));
return
SecondList
(
allot
,
accountUnit
);
}
private
List
<
ag_secondallot
>
SecondList
(
per_allot
allot
,
List
<
res_account
>
accountUnit
)
{
if
(
accountUnit
==
null
||
!
accountUnit
.
Any
())
return
new
List
<
ag_secondallot
>();
var
secondList
=
perforAgsecondallotRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allot
.
ID
&&
t
.
Year
==
allot
.
Year
&&
t
.
Month
==
allot
.
Month
);
...
...
@@ -1238,7 +1238,7 @@ public List<ag_secondallot> AuditList(int userId, int allotId)
if
(
second
!=
null
)
return
second
;
return
new
ag_secondallot
{
AllotId
=
allot
Id
,
AllotId
=
allot
.
ID
,
Year
=
allot
.
Year
,
Month
=
allot
.
Month
,
UnitType
=
((
UnitType
)
t
.
UnitType
).
ToString
(),
...
...
@@ -1255,6 +1255,21 @@ public List<ag_secondallot> AuditList(int userId, int allotId)
}
/// <summary>
/// 护理部二次绩效考核列表
/// </summary>
/// <param name="userId">用户ID</param>
/// <returns></returns>
public
List
<
ag_secondallot
>
NursingDeptlist
(
int
allotId
)
{
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
if
(
allot
==
null
)
throw
new
PerformanceException
(
"所选绩效不存在!"
);
var
types
=
new
int
[]
{
(
int
)
UnitType
.
其他护理组
,
(
int
)
UnitType
.
护理组
};
var
accountUnit
=
perforResaccountRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
types
.
Contains
(
t
.
UnitType
.
Value
));
return
SecondList
(
allot
,
accountUnit
);
}
/// <summary>
/// 提交审核
/// </summary>
/// <param name="userId">用户ID</param>
...
...
@@ -1298,6 +1313,7 @@ public bool AuditSubmit(ag_secondallot second, int userId)
}
second
.
UseTempId
=
temp
.
UseTempId
;
second
.
Status
=
2
;
second
.
NursingDeptStatus
=
2
;
second
.
SubmitType
=
temp
.
UseTempId
==
6
?
2
:
1
;
second
.
SubmitTime
=
DateTime
.
Now
;
//second.Remark = "已提交审核,等待审核中";
...
...
@@ -1345,6 +1361,16 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
if
(
result
&&
request
.
IsPass
==
1
)
{
// 护理部审核
var
allot
=
perforPerallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
second
.
AllotId
);
if
(
allot
==
null
)
return
true
;
var
hospital
=
hospitalRepository
.
GetEntity
(
w
=>
w
.
ID
==
allot
.
HospitalId
);
if
(
hospital
==
null
)
return
true
;
if
(
hospital
.
IsOpenNursingDeptAudit
!=
1
||
second
.
NursingDeptStatus
!=
3
)
return
true
;
var
computes
=
new
List
<
ag_compute
>();
if
(
second
.
SubmitType
==
1
)
{
...
...
@@ -1404,6 +1430,35 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
#
endregion
return
result
;
}
/// <summary>
/// 护理部审核
/// </summary>
/// <param name="userId">用户ID</param>
/// <param name="secondId">二次绩效ID</param>
/// <param name="ispass">1、审核通过 2、驳回</param>
/// <returns></returns>
public
bool
NursingDeptAudit
(
int
userId
,
SecondAuditRequest
request
)
{
var
second
=
perforAgsecondallotRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
SecondId
);
if
(
second
==
null
)
throw
new
PerformanceException
(
"二次分配绩效无效"
);
if
(
request
.
IsPass
==
1
)
{
second
.
NursingDeptStatus
=
3
;
second
.
NursingDeptRemark
=
$"护理部审核通过;
{
request
.
Remark
}
"
;
}
else
{
second
.
UseTempId
=
null
;
second
.
NursingDeptStatus
=
4
;
second
.
NursingDeptRemark
=
$"护理部驳回;驳回原因:
{
request
.
Remark
}
"
;
}
second
.
NursingDeptAuditUser
=
userId
;
second
.
NursingDeptAuditTime
=
DateTime
.
Now
;
return
perforAgsecondallotRepository
.
Update
(
second
);
}
#
endregion
#
region
common
...
...
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