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
35b069ed
Commit
35b069ed
authored
Nov 23, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/二次分配重新整理' into develop
parents
7baa4bde
3a913b8b
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
318 additions
and
336 deletions
+318
-336
performance/Performance.Api/Controllers/SecondAllotController.cs
+23
-23
performance/Performance.Api/wwwroot/Performance.Api.xml
+0
-6
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+0
-73
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+2
-2
performance/Performance.EntityModels/Entity/ag_compute.cs
+71
-71
performance/Performance.EntityModels/Other/view_second_compute_collect.cs
+20
-0
performance/Performance.Repository/PerforAgsecondallotRepository.cs
+46
-0
performance/Performance.Repository/Repository/PerforAgcomputeRepository.cs
+9
-9
performance/Performance.Services/AllotCompute/ResultComputeService.cs
+4
-6
performance/Performance.Services/ComputeService.cs
+5
-5
performance/Performance.Services/SecondAllotService.cs
+138
-141
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
35b069ed
...
...
@@ -102,33 +102,33 @@ public ApiResponse SaveValue(int secondid, [FromBody] List<ag_fixatitem> request
return
new
ApiResponse
(
ResponseType
.
OK
);
}
/// <summary>
/// 提交二次绩效分配结果
/// </summary>
/// <returns></returns>
[
Route
(
"api/second/savecompute"
)]
[
HttpPost
]
public
ApiResponse
SaveCompute
([
FromBody
]
List
<
ag_compute
>
request
)
{
var
allotCount
=
request
.
Where
(
t
=>
t
.
AllotId
>
0
).
Select
(
t
=>
t
.
AllotId
).
Distinct
().
Count
();
if
(
allotCount
!=
1
||
request
.
Any
(
t
=>
t
.
AllotId
==
0
))
throw
new
PerformanceException
(
"一次绩效ID错误"
);
///
//
<summary>
///
//
提交二次绩效分配结果
///
//
</summary>
///
//
<returns></returns>
//
[Route("api/second/savecompute")]
//
[HttpPost]
//
public ApiResponse SaveCompute([FromBody] List<ag_compute> request)
//
{
//
var allotCount = request.Where(t => t.AllotId > 0).Select(t => t.AllotId).Distinct().Count();
//
if (allotCount != 1 || request.Any(t => t.AllotId == 0))
//
throw new PerformanceException("一次绩效ID错误");
var
secondCount
=
request
.
Where
(
t
=>
t
.
SecondId
>
0
).
Select
(
t
=>
t
.
SecondId
).
Distinct
().
Count
();
if
(
secondCount
!=
1
||
request
.
Any
(
t
=>
t
.
SecondId
==
0
))
throw
new
PerformanceException
(
"二次绩效ID错误"
);
//
var secondCount = request.Where(t => t.SecondId > 0).Select(t => t.SecondId).Distinct().Count();
//
if (secondCount != 1 || request.Any(t => t.SecondId == 0))
//
throw new PerformanceException("二次绩效ID错误");
var
departmentCount
=
request
.
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
Department
)).
Select
(
t
=>
t
.
Department
).
Distinct
().
Count
();
if
(
departmentCount
!=
1
||
request
.
Any
(
t
=>
string
.
IsNullOrEmpty
(
t
.
Department
)))
throw
new
PerformanceException
(
"科室名称错误"
);
//
var departmentCount = request.Where(t => !string.IsNullOrEmpty(t.Department)).Select(t => t.Department).Distinct().Count();
//
if (departmentCount != 1 || request.Any(t => string.IsNullOrEmpty(t.Department)))
//
throw new PerformanceException("科室名称错误");
var
personNameCount
=
request
.
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
PersonName
)).
Select
(
t
=>
t
.
PersonName
).
Distinct
().
Count
();
if
(
personNameCount
!=
1
||
request
.
Any
(
t
=>
string
.
IsNullOrEmpty
(
t
.
PersonName
)))
throw
new
PerformanceException
(
"人员名称错误"
);
//
var personNameCount = request.Where(t => !string.IsNullOrEmpty(t.PersonName)).Select(t => t.PersonName).Distinct().Count();
//
if (personNameCount != 1 || request.Any(t => string.IsNullOrEmpty(t.PersonName)))
//
throw new PerformanceException("人员名称错误");
var
result
=
secondAllotService
.
SaveCompute
(
request
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
//
var result = secondAllotService.SaveCompute(request);
//
return new ApiResponse(ResponseType.OK);
//
}
/// <summary>
/// 二次绩效录入页面配置信息
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
35b069ed
...
...
@@ -1691,12 +1691,6 @@
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.SaveCompute(System.Collections.Generic.List{Performance.EntityModels.ag_compute})"
>
<summary>
提交二次绩效分配结果
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.SecondDetail(Performance.DtoModels.UseTempRequest)"
>
<summary>
二次绩效录入页面配置信息
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
35b069ed
...
...
@@ -10,9 +10,6 @@
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.ag_bodysource"
>
<summary>
二次绩效保存数据
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.ag_compute"
>
<summary>
二次绩效结果表
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.ag_data"
>
<summary>
二次分配不固定数据
</summary>
</member>
...
...
@@ -550,76 +547,6 @@
备注
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ag_compute"
>
<summary>
二次绩效结果表
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.Id"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.AllotId"
>
<summary>
绩效ID
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.SecondId"
>
<summary>
二次绩效ID
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.UnitType"
>
<summary>
科室类型
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.Department"
>
<summary>
科室
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.WorkPost"
>
<summary>
职称
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.JobNumber"
>
<summary>
工号
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.PersonName"
>
<summary>
人员名称
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.PerforSumFee"
>
<summary>
可分配绩效
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.PerforManagementFee"
>
<summary>
管理绩效
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.OthePerfor"
>
<summary>
医院其他绩效
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.NightWorkPerfor"
>
<summary>
夜班工作量绩效
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_compute.RealGiveFee"
>
<summary>
实发金额
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ag_data"
>
<summary>
二次分配不固定数据
...
...
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
35b069ed
...
...
@@ -15,8 +15,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
public
virtual
DbSet
<
ag_againsituation
>
ag_againsituation
{
get
;
set
;
}
/// <summary> 二次绩效保存数据 </summary>
public
virtual
DbSet
<
ag_bodysource
>
ag_bodysource
{
get
;
set
;
}
/// <summary> 二次绩效结果表 </summary>
public
virtual
DbSet
<
ag_compute
>
ag_compute
{
get
;
set
;
}
///
//
<summary> 二次绩效结果表 </summary>
//
public virtual DbSet<ag_compute> ag_compute { get; set; }
/// <summary> 二次分配不固定数据 </summary>
public
virtual
DbSet
<
ag_data
>
ag_data
{
get
;
set
;
}
/// <summary> 二次分配人员名单 </summary>
...
...
performance/Performance.EntityModels/Entity/ag_compute.cs
View file @
35b069ed
//-----------------------------------------------------------------------
// <copyright file=" ag_compute.cs">
// * FileName: 二次绩效结果表.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
//
//
-----------------------------------------------------------------------
//
//
<copyright file=" ag_compute.cs">
//
//
* FileName: 二次绩效结果表.cs
//
//
</copyright>
//
//
-----------------------------------------------------------------------
//
using System;
//
using System.ComponentModel.DataAnnotations;
//
using System.ComponentModel.DataAnnotations.Schema;
namespace
Performance.EntityModels
{
/// <summary>
/// 二次绩效结果表
/// </summary>
[
Table
(
"ag_compute"
)]
public
class
ag_compute
{
/// <summary>
///
/// </summary>
[
Key
]
public
int
Id
{
get
;
set
;
}
//
namespace Performance.EntityModels
//
{
//
/// <summary>
//
/// 二次绩效结果表
//
/// </summary>
//
[Table("ag_compute")]
//
public class ag_compute
//
{
//
/// <summary>
//
///
//
/// </summary>
//
[Key]
//
public int Id { get; set; }
/// <summary>
/// 绩效ID
/// </summary>
public
Nullable
<
int
>
AllotId
{
get
;
set
;
}
//
/// <summary>
//
/// 绩效ID
//
/// </summary>
//
public Nullable<int> AllotId { get; set; }
/// <summary>
/// 二次绩效ID
/// </summary>
public
Nullable
<
int
>
SecondId
{
get
;
set
;
}
//
/// <summary>
//
/// 二次绩效ID
//
/// </summary>
//
public Nullable<int> SecondId { get; set; }
/// <summary>
/// 科室类型
/// </summary>
public
string
UnitType
{
get
;
set
;
}
//
/// <summary>
//
/// 科室类型
//
/// </summary>
//
public string UnitType { get; set; }
/// <summary>
/// 科室
/// </summary>
public
string
Department
{
get
;
set
;
}
//
/// <summary>
//
/// 科室
//
/// </summary>
//
public string Department { get; set; }
/// <summary>
/// 职称
/// </summary>
public
string
WorkPost
{
get
;
set
;
}
//
/// <summary>
//
/// 职称
//
/// </summary>
//
public string WorkPost { get; set; }
/// <summary>
/// 工号
/// </summary>
public
string
JobNumber
{
get
;
set
;
}
//
/// <summary>
//
/// 工号
//
/// </summary>
//
public string JobNumber { get; set; }
/// <summary>
/// 人员名称
/// </summary>
public
string
PersonName
{
get
;
set
;
}
//
/// <summary>
//
/// 人员名称
//
/// </summary>
//
public string PersonName { get; set; }
/// <summary>
/// 可分配绩效
/// </summary>
public
Nullable
<
decimal
>
PerforSumFee
{
get
;
set
;
}
//
/// <summary>
//
/// 可分配绩效
//
/// </summary>
//
public Nullable<decimal> PerforSumFee { get; set; }
/// <summary>
/// 管理绩效
/// </summary>
public
Nullable
<
decimal
>
PerforManagementFee
{
get
;
set
;
}
//
/// <summary>
//
/// 管理绩效
//
/// </summary>
//
public Nullable<decimal> PerforManagementFee { get; set; }
/// <summary>
/// 医院其他绩效
/// </summary>
public
Nullable
<
decimal
>
OthePerfor
{
get
;
set
;
}
//
/// <summary>
//
/// 医院其他绩效
//
/// </summary>
//
public Nullable<decimal> OthePerfor { get; set; }
/// <summary>
/// 夜班工作量绩效
/// </summary>
public
Nullable
<
decimal
>
NightWorkPerfor
{
get
;
set
;
}
//
/// <summary>
//
/// 夜班工作量绩效
//
/// </summary>
//
public Nullable<decimal> NightWorkPerfor { get; set; }
/// <summary>
/// 实发金额
/// </summary>
public
Nullable
<
decimal
>
RealGiveFee
{
get
;
set
;
}
}
}
//
/// <summary>
//
/// 实发金额
//
/// </summary>
//
public Nullable<decimal> RealGiveFee { get; set; }
//
}
//
}
performance/Performance.EntityModels/Other/view_second_compute_collect.cs
0 → 100644
View file @
35b069ed
namespace
Performance.EntityModels
{
public
class
view_second_compute_collect
{
public
int
HospitalId
{
get
;
set
;
}
public
int
Year
{
get
;
set
;
}
public
int
Month
{
get
;
set
;
}
public
int
AllotId
{
get
;
set
;
}
public
int
SecondId
{
get
;
set
;
}
public
int
UseTempId
{
get
;
set
;
}
public
string
UnitType
{
get
;
set
;
}
public
string
Department
{
get
;
set
;
}
public
string
Status
{
get
;
set
;
}
public
string
JobNumber
{
get
;
set
;
}
public
string
WorkPost
{
get
;
set
;
}
public
string
PersonName
{
get
;
set
;
}
public
decimal
PerforSumFee
{
get
;
set
;
}
public
decimal
NightWorkPerfor
{
get
;
set
;
}
}
}
performance/Performance.Repository/PerforAgsecondallotRepository.cs
0 → 100644
View file @
35b069ed
using
Performance.EntityModels
;
using
System.Collections.Generic
;
using
System.Linq
;
namespace
Performance.Repository
{
public
partial
class
PerforAgsecondallotRepository
:
PerforRepository
<
ag_secondallot
>
{
/// <summary>
/// 删除已提交的历史记录(ag_compute)
/// </summary>
/// <param name="secondId"></param>
/// <returns></returns>
public
int
DeleteComputeHistory
(
int
secondId
)
{
return
Execute
(
"DELETE FROM ag_compute WHERE SecondId = @secondId"
,
new
{
secondId
});
}
/// <summary>
/// 查询二次分配结果 根据AllotId
/// </summary>
/// <param name="secondId"></param>
/// <returns></returns>
public
List
<
view_second_compute_collect
>
GetComputeByAllot
(
int
allotId
)
{
var
datas
=
DapperQuery
<
view_second_compute_collect
>(
"SELECT * FROM ag_compute WHERE AllotId = @allotId"
,
new
{
allotId
});
if
(
datas
!=
null
)
return
datas
.
ToList
();
return
new
List
<
view_second_compute_collect
>();
}
/// <summary>
/// 查询二次分配结果 根据SecondId
/// </summary>
/// <param name="secondId"></param>
/// <returns></returns>
public
List
<
view_second_compute_collect
>
GetComputeBySecond
(
int
secondId
)
{
var
datas
=
DapperQuery
<
view_second_compute_collect
>(
"SELECT * FROM ag_compute WHERE SecondId = @secondId"
,
new
{
secondId
});
if
(
datas
!=
null
)
return
datas
.
ToList
();
return
new
List
<
view_second_compute_collect
>();
}
}
}
performance/Performance.Repository/Repository/PerforAgcomputeRepository.cs
View file @
35b069ed
...
...
@@ -7,13 +7,13 @@
namespace
Performance.Repository
{
/// <summary>
/// ag_compute Repository
/// </summary>
public
partial
class
PerforAgcomputeRepository
:
PerforRepository
<
ag_compute
>
{
public
PerforAgcomputeRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
}
}
///
//
<summary>
///
//
ag_compute Repository
///
//
</summary>
//
public partial class PerforAgcomputeRepository : PerforRepository<ag_compute>
//
{
//
public PerforAgcomputeRepository(PerformanceDbContext context) : base(context)
//
{
//
}
//
}
}
performance/Performance.Services/AllotCompute/ResultComputeService.cs
View file @
35b069ed
...
...
@@ -21,7 +21,7 @@ public class ResultComputeService : IAutoInjection
private
readonly
BudgetService
budgetService
;
private
readonly
PerforPeremployeeRepository
perforPeremployeeRepository
;
private
readonly
PerforPerallotRepository
perforPerallotRepository
;
private
readonly
PerforAgcomputeRepository
perforAgcomputeRepository
;
//
private readonly PerforAgcomputeRepository perforAgcomputeRepository;
private
readonly
PerforAgsecondallotRepository
perforAgsecondallotRepository
;
private
readonly
PerforHospitalRepository
hospitalRepository
;
private
readonly
PerforImemployeeRepository
perforImEmployeeRepository
;
...
...
@@ -47,7 +47,7 @@ public class ResultComputeService : IAutoInjection
LogManageService
logManageService
,
BudgetService
budgetService
,
PerforPeremployeeRepository
perforPeremployeeRepository
,
PerforPerallotRepository
perforPerallotRepository
,
PerforAgcomputeRepository
perforAgcomputeRepository
,
//
PerforAgcomputeRepository perforAgcomputeRepository,
PerforAgsecondallotRepository
perforAgsecondallotRepository
,
PerforImemployeeclinicRepository
perforImemployeeclinicRepository
,
PerforImemployeelogisticsRepository
perforImemployeelogisticsRepository
,
...
...
@@ -66,7 +66,7 @@ public class ResultComputeService : IAutoInjection
this
.
budgetService
=
budgetService
;
this
.
perforPeremployeeRepository
=
perforPeremployeeRepository
;
this
.
perforPerallotRepository
=
perforPerallotRepository
;
this
.
perforAgcomputeRepository
=
perforAgcomputeRepository
;
//
this.perforAgcomputeRepository = perforAgcomputeRepository;
this
.
perforAgsecondallotRepository
=
perforAgsecondallotRepository
;
this
.
perforImemployeeclinicRepository
=
perforImemployeeclinicRepository
;
this
.
perforImemployeelogisticsRepository
=
perforImemployeelogisticsRepository
;
...
...
@@ -643,9 +643,7 @@ public void GenerateSecondAllot(per_allot allot)
foreach (var item in updSecond.Where(w => w.Status == 4))
{
// 自动驳回,需要清空该科室历史数据
var histories = perforAgcomputeRepository.GetEntities(w => w.SecondId == item.Id);
if (histories != null && histories.Any())
perforAgcomputeRepository.RemoveRange(histories.ToArray());
perforAgsecondallotRepository.DeleteComputeHistory(item.Id);
}
*/
}
...
...
performance/Performance.Services/ComputeService.cs
View file @
35b069ed
...
...
@@ -25,7 +25,7 @@ public class ComputeService : IAutoInjection
private
readonly
PerforResspecialunitRepository
_perforResspecialunitRepository
;
private
readonly
PerforResbaiscnormRepository
perforResbaiscnormRepository
;
private
readonly
PerforAgsecondallotRepository
_perforAgsecondallotRepository
;
private
readonly
PerforAgcomputeRepository
_perforAgcomputeRepository
;
//
private readonly PerforAgcomputeRepository _perforAgcomputeRepository;
private
readonly
PerforImemployeeclinicRepository
_perforImemployeeclinicRepository
;
private
readonly
PerforImemployeeRepository
_perforImemployeeRepository
;
private
readonly
PerforPerallotRepository
perforPerallotRepository
;
...
...
@@ -47,7 +47,7 @@ public class ComputeService : IAutoInjection
PerforResspecialunitRepository
perforResspecialunitRepository
,
PerforResbaiscnormRepository
perforResbaiscnormRepository
,
PerforAgsecondallotRepository
perforAgsecondallotRepository
,
PerforAgcomputeRepository
perforAgcomputeRepository
,
//
PerforAgcomputeRepository perforAgcomputeRepository,
PerforImemployeeclinicRepository
perforImemployeeclinicRepository
,
PerforImemployeeRepository
perforImemployeeRepository
,
PerforPerallotRepository
perforPerallotRepository
,
...
...
@@ -68,7 +68,7 @@ public class ComputeService : IAutoInjection
this
.
_perforResspecialunitRepository
=
perforResspecialunitRepository
;
this
.
perforResbaiscnormRepository
=
perforResbaiscnormRepository
;
this
.
_perforAgsecondallotRepository
=
perforAgsecondallotRepository
;
this
.
_perforAgcomputeRepository
=
perforAgcomputeRepository
;
//
this._perforAgcomputeRepository = perforAgcomputeRepository;
this
.
_perforImemployeeclinicRepository
=
perforImemployeeclinicRepository
;
this
.
_perforImemployeeRepository
=
perforImemployeeRepository
;
this
.
perforPerallotRepository
=
perforPerallotRepository
;
...
...
@@ -1084,14 +1084,14 @@ private List<ComputeResponse> GetSecondPerformance(int allotId)
{
List
<
ComputeResponse
>
responses
=
new
List
<
ComputeResponse
>();
var
again
=
_perforAg
computeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
var
again
=
_perforAg
secondallotRepository
.
GetComputeByAllot
(
allotId
);
if
(
again
==
null
||
!
again
.
Any
())
{
return
responses
;
}
var
disAgains
=
again
.
Select
(
w
=>
new
{
w
.
AllotId
,
w
.
SecondId
,
w
.
UnitType
,
w
.
Department
,
w
.
WorkPost
,
w
.
JobNumber
,
w
.
PersonName
,
w
.
PerforSumFee
,
w
.
OthePerfor
,
w
.
NightWorkPerfor
,
w
.
RealGiveFee
})
.
Select
(
w
=>
new
{
w
.
AllotId
,
w
.
SecondId
,
w
.
UnitType
,
w
.
Department
,
w
.
WorkPost
,
w
.
JobNumber
,
w
.
PersonName
,
w
.
PerforSumFee
,
w
.
NightWorkPerfor
})
.
Distinct
();
responses
=
disAgains
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
35b069ed
...
...
@@ -44,7 +44,7 @@ public partial class SecondAllotService : IAutoInjection
private
readonly
PerforAgfixatitemRepository
agfixatitemRepository
;
private
readonly
PerforAgothersourceRepository
agothersourceRepository
;
private
readonly
PerforAgcomputeRepository
agcomputeRepository
;
//
private readonly PerforAgcomputeRepository agcomputeRepository;
private
readonly
PerforCofagainRepository
cofagainRepository
;
private
readonly
ComputeService
computeService
;
...
...
@@ -78,7 +78,7 @@ public partial class SecondAllotService : IAutoInjection
PerforPerapramountRepository
perapramountRepository
,
PerforAgfixatitemRepository
agfixatitemRepository
,
PerforAgothersourceRepository
agothersourceRepository
,
PerforAgcomputeRepository
agcomputeRepository
,
//
PerforAgcomputeRepository agcomputeRepository,
PerforCofagainRepository
cofagainRepository
,
PersonService
personService
,
ComputeService
computeService
...
...
@@ -110,7 +110,7 @@ ComputeService computeService
this
.
perapramountRepository
=
perapramountRepository
;
this
.
agfixatitemRepository
=
agfixatitemRepository
;
this
.
agothersourceRepository
=
agothersourceRepository
;
this
.
agcomputeRepository
=
agcomputeRepository
;
//
this.agcomputeRepository = agcomputeRepository;
this
.
cofagainRepository
=
cofagainRepository
;
this
.
computeService
=
computeService
;
this
.
personService
=
personService
;
...
...
@@ -814,36 +814,36 @@ public bool DelValue(int secondId, List<ag_fixatitem> oldFixatItems, List<ag_fix
return
result
;
}
/// <summary>
/// 二次绩效分配结果保存
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
bool
SaveCompute
(
List
<
ag_compute
>
request
)
{
var
secondId
=
request
.
First
().
SecondId
;
var
second
=
agsecondallotRepository
.
GetEntity
(
t
=>
t
.
Id
==
secondId
);
if
(
second
==
null
)
throw
new
PerformanceException
(
"二次绩效ID不存在"
);
if
(
second
.
Status
==
2
)
throw
new
PerformanceException
(
"二次绩效已提交,无法重复提交"
);
var
compute
=
agcomputeRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
foreach
(
var
item
in
request
)
{
if
(
compute
!=
null
&&
compute
.
Any
(
t
=>
t
.
SecondId
==
secondId
&&
t
.
Department
==
item
.
Department
&&
t
.
PersonName
==
item
.
PersonName
))
{
var
cellItem
=
compute
.
First
(
t
=>
t
.
SecondId
==
secondId
&&
t
.
Department
==
item
.
Department
&&
t
.
PersonName
==
item
.
PersonName
);
cellItem
.
RealGiveFee
=
item
.
RealGiveFee
;
agcomputeRepository
.
Update
(
cellItem
);
}
else
{
agcomputeRepository
.
Add
(
item
);
}
}
return
true
;
}
///
//
<summary>
///
//
二次绩效分配结果保存
///
//
</summary>
///
//
<param name="request"></param>
///
//
<returns></returns>
//
public bool SaveCompute(List<ag_compute> request)
//
{
//
var secondId = request.First().SecondId;
//
var second = agsecondallotRepository.GetEntity(t => t.Id == secondId);
//
if (second == null)
//
throw new PerformanceException("二次绩效ID不存在");
//
if (second.Status == 2)
//
throw new PerformanceException("二次绩效已提交,无法重复提交");
//
var compute = agcomputeRepository.GetEntities(t => t.SecondId == secondId);
//
foreach (var item in request)
//
{
//
if (compute != null && compute.Any(t => t.SecondId == secondId && t.Department == item.Department && t.PersonName == item.PersonName))
//
{
//
var cellItem = compute.First(t => t.SecondId == secondId && t.Department == item.Department && t.PersonName == item.PersonName);
//
cellItem.RealGiveFee = item.RealGiveFee;
//
agcomputeRepository.Update(cellItem);
//
}
//
else
//
{
//
agcomputeRepository.Add(item);
//
}
//
}
//
return true;
//
}
#
endregion
二次绩效列表与数据保存
...
...
@@ -1699,123 +1699,120 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
var
result
=
agsecondallotRepository
.
Update
(
second
);
// 无论驳回还是通过,都需要清空该科室历史数据
var
histories
=
agcomputeRepository
.
GetEntities
(
w
=>
w
.
SecondId
==
request
.
SecondId
);
if
(
histories
!=
null
&&
histories
.
Any
())
agcomputeRepository
.
RemoveRange
(
histories
.
ToArray
());
if
(
request
.
IsPass
==
1
)
SyncSecondComputeData
(
second
);
agsecondallotRepository
.
DeleteComputeHistory
(
request
.
SecondId
);
//if (request.IsPass == 1)
// SyncSecondComputeData(second);
return
result
;
}
/// <summary>
/// 审核结束 添加至二次绩效汇总
/// </summary>
/// <param name="second"></param>
/// <param name="isPass"></param>
/// <returns></returns>
private
bool
SyncSecondComputeData
(
ag_secondallot
second
)
{
// 护理部及二次分配审核同时审核完成
var
allot
=
perallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
second
.
AllotId
);
if
(
allot
==
null
)
return
true
;
///
//
<summary>
///
//
审核结束 添加至二次绩效汇总
///
//
</summary>
///
//
<param name="second"></param>
///
//
<param name="isPass"></param>
///
//
<returns></returns>
//
private bool SyncSecondComputeData(ag_secondallot second)
//
{
//
// 护理部及二次分配审核同时审核完成
//
var allot = perallotRepository.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
;
//
var hospital = hospitalRepository.GetEntity(w => w.ID == allot.HospitalId);
//
if (hospital == null) return true;
if
(
hospital
.
IsOpenNursingDeptAudit
==
1
&&
second
.
NursingDeptStatus
!=
3
&&
new
string
[]
{
UnitType
.
护理组
.
ToString
(),
UnitType
.
其他护理组
.
ToString
()
}.
Contains
(
second
.
UnitType
))
return
true
;
//
if (hospital.IsOpenNursingDeptAudit == 1 && second.NursingDeptStatus != 3 && new string[] { UnitType.护理组.ToString(), UnitType.其他护理组.ToString() }.Contains(second.UnitType))
//
return true;
if
(
second
.
Status
!=
3
)
return
true
;
//
if (second.Status != 3)
//
return true;
var
computes
=
new
List
<
ag_compute
>();
//
var computes = new List<ag_compute>();
var
(
tempId
,
name
)
=
GetUsingTempId
(
hospital
.
ID
,
second
);
//
var (tempId, name) = GetUsingTempId(hospital.ID, second);
if
(
new
int
[]
{
(
int
)
Temp
.
crosswise
,
(
int
)
Temp
.
lengthways
}.
Contains
(
tempId
))
{
var
items
=
agfixatitemRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
second
.
Id
);
if
(
items
!=
null
&&
items
.
Any
())
{
var
rowNumbers
=
items
.
Select
(
t
=>
t
.
RowNumber
).
Where
(
t
=>
t
>=
0
)?.
Distinct
();
if
(
rowNumbers
!=
null
&&
rowNumbers
.
Any
())
{
foreach
(
var
item
in
rowNumbers
)
{
var
perforsumfee
=
ConvertHelper
.
TryDecimal
(
items
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
item
&&
t
.
ItemName
==
"可分配绩效"
)?.
ItemValue
,
0
);
var
nightworkperfor
=
ConvertHelper
.
TryDecimal
(
items
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
item
&&
t
.
ItemName
==
"夜班工作量绩效"
)?.
ItemValue
,
0
);
computes
.
Add
(
new
ag_compute
{
AllotId
=
second
.
AllotId
,
SecondId
=
second
.
Id
,
UnitType
=
second
.
UnitType
,
Department
=
second
.
Department
,
JobNumber
=
items
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
item
&&
t
.
ItemName
==
"人员工号"
)?.
ItemValue
,
WorkPost
=
items
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
item
&&
t
.
ItemName
==
"岗位"
)?.
ItemValue
,
PersonName
=
items
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
item
&&
t
.
ItemName
==
"姓名"
)?.
ItemValue
,
PerforSumFee
=
perforsumfee
,
OthePerfor
=
ConvertHelper
.
TryDecimal
(
items
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
item
&&
t
.
ItemName
==
"医院其他绩效"
)?.
ItemValue
,
0
),
NightWorkPerfor
=
nightworkperfor
,
RealGiveFee
=
perforsumfee
+
nightworkperfor
,
});
}
}
}
}
else
if
(
tempId
==
(
int
)
Temp
.
other
)
{
var
others
=
agothersourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
second
.
Id
);
if
(
others
!=
null
&&
others
.
Any
())
{
foreach
(
var
item
in
others
)
{
computes
.
Add
(
new
ag_compute
{
AllotId
=
second
.
AllotId
,
SecondId
=
second
.
Id
,
UnitType
=
second
.
UnitType
,
Department
=
second
.
Department
,
WorkPost
=
item
.
WorkPost
,
JobNumber
=
item
.
WorkNumber
,
PersonName
=
item
.
Name
,
PerforSumFee
=
item
.
DistPerformance
,
OthePerfor
=
item
.
OtherPerformance
,
NightWorkPerfor
=
item
.
NightWorkPerformance
,
RealGiveFee
=
item
.
RealAmount
,
});
}
}
}
else
{
var
bodys
=
agbodysourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
second
.
Id
);
if
(
bodys
!=
null
&&
bodys
.
Any
())
{
foreach
(
var
item
in
bodys
)
{
computes
.
Add
(
new
ag_compute
{
AllotId
=
second
.
AllotId
,
SecondId
=
second
.
Id
,
UnitType
=
second
.
UnitType
,
Department
=
second
.
Department
,
WorkPost
=
item
.
JobTitle
,
JobNumber
=
item
.
WorkNumber
,
PersonName
=
item
.
Name
,
PerforSumFee
=
item
.
DistPerformance
,
OthePerfor
=
item
.
OtherPerformance
,
NightWorkPerfor
=
item
.
NightWorkPerformance
,
RealGiveFee
=
item
.
RealAmount
,
});
}
}
}
agcomputeRepository
.
AddRange
(
computes
.
ToArray
());
//
if (new int[] { (int)Temp.crosswise, (int)Temp.lengthways }.Contains(tempId))
//
{
//
var items = agfixatitemRepository.GetEntities(t => t.SecondId == second.Id);
//
if (items != null && items.Any())
//
{
//
var rowNumbers = items.Select(t => t.RowNumber).Where(t => t >= 0)?.Distinct();
//
if (rowNumbers != null && rowNumbers.Any())
//
{
//
foreach (var item in rowNumbers)
//
{
//
var perforsumfee = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "可分配绩效")?.ItemValue, 0);
//
var nightworkperfor = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "夜班工作量绩效")?.ItemValue, 0);
//
computes.Add(new ag_compute
//
{
//
AllotId = second.AllotId,
//
SecondId = second.Id,
//
UnitType = second.UnitType,
//
Department = second.Department,
//
JobNumber = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "人员工号")?.ItemValue,
//
WorkPost = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "岗位")?.ItemValue,
//
PersonName = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "姓名")?.ItemValue,
//
PerforSumFee = perforsumfee,
//
OthePerfor = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "医院其他绩效")?.ItemValue, 0),
//
NightWorkPerfor = nightworkperfor,
//
RealGiveFee = perforsumfee + nightworkperfor,
//
});
//
}
//
}
//
}
//
}
//
else if (tempId == (int)Temp.other)
//
{
//
var others = agothersourceRepository.GetEntities(t => t.SecondId == second.Id);
//
if (others != null && others.Any())
//
{
//
foreach (var item in others)
//
{
//
computes.Add(new ag_compute
//
{
//
AllotId = second.AllotId,
//
SecondId = second.Id,
//
UnitType = second.UnitType,
//
Department = second.Department,
//
WorkPost = item.WorkPost,
//
JobNumber = item.WorkNumber,
//
PersonName = item.Name,
//
PerforSumFee = item.DistPerformance,
//
OthePerfor = item.OtherPerformance,
//
NightWorkPerfor = item.NightWorkPerformance,
//
RealGiveFee = item.RealAmount,
//
});
//
}
//
}
//
}
//
else
//
{
//
var bodys = agbodysourceRepository.GetEntities(t => t.SecondId == second.Id);
//
if (bodys != null && bodys.Any())
//
{
//
foreach (var item in bodys)
//
{
//
computes.Add(new ag_compute
//
{
//
AllotId = second.AllotId,
//
SecondId = second.Id,
//
UnitType = second.UnitType,
//
Department = second.Department,
//
WorkPost = item.JobTitle,
//
JobNumber = item.WorkNumber,
//
PersonName = item.Name,
//
PerforSumFee = item.DistPerformance,
//
OthePerfor = item.OtherPerformance,
//
NightWorkPerfor = item.NightWorkPerformance,
//
RealGiveFee = item.RealAmount,
//
});
//
}
//
}
//
}
//
agcomputeRepository.AddRange(computes.ToArray());
return
true
;
}
//
return true;
//
}
/// <summary>
/// 护理部审核
...
...
@@ -1844,8 +1841,8 @@ public bool NursingDeptAudit(int userId, SecondAuditRequest request)
second
.
NursingDeptAuditUser
=
userId
;
second
.
NursingDeptAuditTime
=
DateTime
.
Now
;
if
(
request
.
IsPass
==
1
)
SyncSecondComputeData
(
second
);
//
if (request.IsPass == 1)
//
SyncSecondComputeData(second);
return
agsecondallotRepository
.
Update
(
second
);
}
...
...
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