预留比例,全院发放表等

parent c3162559
...@@ -192,10 +192,11 @@ public ApiResponse AllCompute([FromBody] ComputerRequest request) ...@@ -192,10 +192,11 @@ public ApiResponse AllCompute([FromBody] ComputerRequest request)
if (null == allot) if (null == allot)
throw new PerformanceException("当前绩效记录不存在"); throw new PerformanceException("当前绩效记录不存在");
var isShowManage = _computeService.IsShowManage(request.AllotId); var isShowManage = _computeService.IsShowManage(request.AllotId);
var list = isShowManage == 1 //var list = isShowManage == 1
? _computeService.AllCompute(request.AllotId) // ? _computeService.AllCompute(request.AllotId)
: _computeService.AllManageCompute(request.AllotId); // : _computeService.AllManageCompute(request.AllotId);
var list = _computeService.AllCompute(request.AllotId, isShowManage);
return new ApiResponse(ResponseType.OK, "ok", list); return new ApiResponse(ResponseType.OK, "ok", list);
} }
...@@ -211,7 +212,7 @@ public ApiResponse AllManageCompute([FromBody] ComputerRequest request) ...@@ -211,7 +212,7 @@ public ApiResponse AllManageCompute([FromBody] ComputerRequest request)
var allot = _allotService.GetAllot(request.AllotId); var allot = _allotService.GetAllot(request.AllotId);
if (null == allot) if (null == allot)
throw new PerformanceException("当前绩效记录不存在"); throw new PerformanceException("当前绩效记录不存在");
var list = _computeService.AllManageCompute(request.AllotId); var list = _computeService.AllCompute(request.AllotId, 1);
return new ApiResponse(ResponseType.OK, "ok", list); return new ApiResponse(ResponseType.OK, "ok", list);
} }
......
...@@ -136,6 +136,18 @@ public ApiResponse SecondDetail([CustomizeValidator(RuleSet = "Refresh"), FromBo ...@@ -136,6 +136,18 @@ public ApiResponse SecondDetail([CustomizeValidator(RuleSet = "Refresh"), FromBo
//} //}
#endregion #endregion
/// <summary>
/// 二次绩效录入页面自动补全
/// </summary>
/// <returns></returns>
[Route("api/second/autocomplete")]
[HttpPost]
public ApiResponse AutoComplete([FromBody] SecondEmpRequest request)
{
var result = secondAllotService.AutoComplete(request, claimService.GetUserId());
return new ApiResponse(ResponseType.OK, result);
}
#region 模板使用 #region 模板使用
/// <summary> /// <summary>
/// 选择二次绩效模板 /// 选择二次绩效模板
......
...@@ -1059,6 +1059,12 @@ ...@@ -1059,6 +1059,12 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.SecondAllotController.AutoComplete(Performance.DtoModels.SecondEmpRequest)">
<summary>
二次绩效录入页面自动补全
</summary>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.SecondAllotController.Temp(Performance.DtoModels.AllotDeptRequest)"> <member name="M:Performance.Api.Controllers.SecondAllotController.Temp(Performance.DtoModels.AllotDeptRequest)">
<summary> <summary>
选择二次绩效模板 选择二次绩效模板
......
...@@ -2356,6 +2356,21 @@ ...@@ -2356,6 +2356,21 @@
职位 职位
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ComputeResponse.PerforSumFee">
<summary>
绩效合计
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResponse.OthePerfor">
<summary>
医院其他绩效
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResponse.NightWorkPerfor">
<summary>
实发绩效工资金额
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResponse.RealGiveFee"> <member name="P:Performance.DtoModels.ComputeResponse.RealGiveFee">
<summary> <summary>
实发绩效 实发绩效
......
...@@ -362,6 +362,16 @@ ...@@ -362,6 +362,16 @@
人员名称 人员名称
</summary> </summary>
</member> </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"> <member name="P:Performance.EntityModels.ag_compute.RealGiveFee">
<summary> <summary>
实发金额 实发金额
......
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class SecondEmpRequest
{
public int TempId { get; set; }
public int HospitalId { get; set; }
public string Department { get; set; }
public string UnitType { get; set; }
public int SecondId { get; set; }
public string EmployeeName { get; set; }
public string JobNumber { get; set; }
}
public class SecondEmpRequestValidator : AbstractValidator<SecondEmpRequest>
{
public SecondEmpRequestValidator()
{
RuleFor(x => x.TempId).NotNull().GreaterThan(0);
RuleFor(x => x.HospitalId).NotNull().GreaterThan(0);
RuleFor(x => x.Department).NotNull().NotEmpty();
RuleFor(x => x.UnitType).NotNull().NotEmpty();
RuleFor(x => x.SecondId).NotNull().GreaterThan(0);
}
}
}
...@@ -6,6 +6,19 @@ namespace Performance.DtoModels ...@@ -6,6 +6,19 @@ namespace Performance.DtoModels
{ {
public class ComputeResponse public class ComputeResponse
{ {
public ComputeResponse() { }
public ComputeResponse(string source, string accountingUnit, string employeeName,
string jobNumber, string jobTitle, decimal? perforSumFee)
{
Source = source;
AccountingUnit = accountingUnit;
EmployeeName = employeeName;
JobNumber = jobNumber;
JobTitle = jobTitle;
PerforSumFee = perforSumFee;
}
/// <summary> /// <summary>
/// 来源 /// 来源
/// </summary> /// </summary>
...@@ -33,6 +46,20 @@ public class ComputeResponse ...@@ -33,6 +46,20 @@ public class ComputeResponse
/// </summary> /// </summary>
public string JobTitle { get; set; } public string JobTitle { get; set; }
/// <summary>
/// 绩效合计
/// </summary>
public Nullable<decimal> PerforSumFee { get; set; }
/// <summary>
/// 医院其他绩效
/// </summary>
public Nullable<decimal> OthePerfor { get; set; }
/// <summary>
/// 实发绩效工资金额
/// </summary>
public Nullable<decimal> NightWorkPerfor { get; set; }
/// <summary> /// <summary>
/// 实发绩效 /// 实发绩效
...@@ -42,11 +69,11 @@ public class ComputeResponse ...@@ -42,11 +69,11 @@ public class ComputeResponse
/// <summary> /// <summary>
/// 预留比例 /// 预留比例
/// </summary> /// </summary>
public decimal ReservedRatio { get; set; } public Nullable<decimal> ReservedRatio { get; set; }
/// <summary> /// <summary>
/// 预留比例金额 /// 预留比例金额
/// </summary> /// </summary>
public decimal ReservedRatioFee { get; set; } public Nullable<decimal> ReservedRatioFee { get; set; }
} }
} }
...@@ -7,50 +7,60 @@ ...@@ -7,50 +7,60 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels namespace Performance.EntityModels
{ {
/// <summary> /// <summary>
/// 二次绩效结果表 /// 二次绩效结果表
/// </summary> /// </summary>
[Table("ag_compute")] [Table("ag_compute")]
public class ag_compute public class ag_compute
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
[Key] [Key]
public int Id { get; set; } public int Id { get; set; }
/// <summary> /// <summary>
/// 绩效ID /// 绩效ID
/// </summary> /// </summary>
public Nullable<int> AllotId { get; set; } public Nullable<int> AllotId { get; set; }
/// <summary> /// <summary>
/// 二次绩效ID /// 二次绩效ID
/// </summary> /// </summary>
public Nullable<int> SecondId { get; set; } public Nullable<int> SecondId { get; set; }
/// <summary> /// <summary>
/// 科室 /// 科室
/// </summary> /// </summary>
public string Department { get; set; } public string Department { get; set; }
/// <summary> /// <summary>
/// 职称 /// 职称
/// </summary> /// </summary>
public string WorkPost { get; set; } public string WorkPost { get; set; }
/// <summary> /// <summary>
/// 工号 /// 工号
/// </summary> /// </summary>
public string JobNumber { get; set; } public string JobNumber { get; set; }
/// <summary> /// <summary>
/// 人员名称 /// 人员名称
/// </summary> /// </summary>
public string PersonName { get; set; } public string PersonName { get; set; }
/// <summary>
/// 医院其他绩效
/// </summary>
public Nullable<decimal> OthePerfor { get; set; }
/// <summary>
/// 实发绩效工资金额
/// </summary>
public Nullable<decimal> NightWorkPerfor { get; set; }
/// <summary> /// <summary>
/// 实发金额 /// 实发金额
/// </summary> /// </summary>
......
...@@ -33,6 +33,7 @@ public class SecondAllotService : IAutoInjection ...@@ -33,6 +33,7 @@ public class SecondAllotService : IAutoInjection
private readonly PerforAgothersourceRepository perforAgothersourceRepository; private readonly PerforAgothersourceRepository perforAgothersourceRepository;
private readonly PerforAgworkloadtypeRepository perforAgworkloadtypeRepository; private readonly PerforAgworkloadtypeRepository perforAgworkloadtypeRepository;
private readonly PerforRoleRepository roleRepository; private readonly PerforRoleRepository roleRepository;
private readonly PerforPerapramountRepository perapramountRepository;
private readonly PerforResspecialunitRepository resspecialunitRepository; private readonly PerforResspecialunitRepository resspecialunitRepository;
private readonly PersonService personService; private readonly PersonService personService;
private readonly PerforRescomputeRepository rescomputeRepository; private readonly PerforRescomputeRepository rescomputeRepository;
...@@ -55,6 +56,7 @@ public class SecondAllotService : IAutoInjection ...@@ -55,6 +56,7 @@ public class SecondAllotService : IAutoInjection
PerforAgothersourceRepository perforAgothersourceRepository, PerforAgothersourceRepository perforAgothersourceRepository,
PerforAgworkloadtypeRepository perforAgworkloadtypeRepository, PerforAgworkloadtypeRepository perforAgworkloadtypeRepository,
PerforRoleRepository roleRepository, PerforRoleRepository roleRepository,
PerforPerapramountRepository perapramountRepository,
PerforResspecialunitRepository resspecialunitRepository, PerforResspecialunitRepository resspecialunitRepository,
PersonService personService, PersonService personService,
PerforRescomputeRepository rescomputeRepository) PerforRescomputeRepository rescomputeRepository)
...@@ -76,6 +78,7 @@ public class SecondAllotService : IAutoInjection ...@@ -76,6 +78,7 @@ public class SecondAllotService : IAutoInjection
this.perforAgothersourceRepository = perforAgothersourceRepository; this.perforAgothersourceRepository = perforAgothersourceRepository;
this.perforAgworkloadtypeRepository = perforAgworkloadtypeRepository; this.perforAgworkloadtypeRepository = perforAgworkloadtypeRepository;
this.roleRepository = roleRepository; this.roleRepository = roleRepository;
this.perapramountRepository = perapramountRepository;
this.resspecialunitRepository = resspecialunitRepository; this.resspecialunitRepository = resspecialunitRepository;
this.personService = personService; this.personService = personService;
this.rescomputeRepository = rescomputeRepository; this.rescomputeRepository = rescomputeRepository;
...@@ -271,6 +274,31 @@ public List<SecondListResponse> GetSecondList(int userId) ...@@ -271,6 +274,31 @@ public List<SecondListResponse> GetSecondList(int userId)
#endregion #endregion
/// <summary>
/// 二次绩效分配录入人员自动补全信息
/// </summary>
/// <param name="request"></param>
/// <param name="userId"></param>
/// <returns></returns>
public List<BodyItem> AutoComplete(SecondEmpRequest request, int userId)
{
var usetemp = perforAgusetempRepository.GetEntity(
t => t.HospitalId == request.HospitalId && t.Department == request.Department && t.UnitType == request.UnitType);
if (usetemp == null)
throw new PerformanceException("当前科室暂未配置绩效模板");
//获取固定模板列 + 工作量列
var headItems = GetHeadItems(request.TempId, usetemp.HospitalId.Value, usetemp.Department, usetemp.UnitType);
var second = perforAgsecondallotRepository.GetEntity(t => t.Id == request.SecondId);
if (second == null)
throw new PerformanceException("当前科室二次分配绩效信息无效");
var bodyItems = GetEmployees(second.AllotId.Value, userId, headItems, request.EmployeeName, request.JobNumber);
return bodyItems;
}
#region 二次绩效详情-使用中 #region 二次绩效详情-使用中
/// <summary> /// <summary>
/// 二次绩效详情 /// 二次绩效详情
...@@ -340,19 +368,30 @@ public SecondResponse GetSecondDetail(UseTempRequest request, int userId) ...@@ -340,19 +368,30 @@ public SecondResponse GetSecondDetail(UseTempRequest request, int userId)
}; };
} }
private List<BodyItem> GetEmployees(int allotId, int userId, List<HeadItem> heads) private List<BodyItem> GetEmployees(int allotId, int userId, List<HeadItem> heads, string empName = "", string jobNumber = "")
{ {
var list = new List<BodyItem>(); var list = new List<BodyItem>();
var employees = personService.GetPersons(allotId, userId); var employees = personService.GetPersons(allotId, userId);
if (employees == null || !employees.Any()) return list; if (employees == null || !employees.Any()) return list;
if (!string.IsNullOrEmpty(empName))
employees = employees?.Where(w => w.DoctorName == empName).ToList();
if (!string.IsNullOrEmpty(jobNumber))
employees = employees?.Where(w => w.PersonnelNumber == jobNumber).ToList();
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == allotId);
Func<per_employee, decimal?> getAprAmount = (t) => perapramounts
?.Where(w => w.DoctorName == t.DoctorName && w.PersonnelNumber == t.PersonnelNumber)
?.Sum(w => w.Amount);
Dictionary<(string, string), Func<per_employee, object>> dict = new Dictionary<(string, string), Func<per_employee, object>> Dictionary<(string, string), Func<per_employee, object>> dict = new Dictionary<(string, string), Func<per_employee, object>>
{ {
{ ("姓名", "FullName"), (t) => t.DoctorName }, { ("姓名", "FullName"), (t) => t.DoctorName },
{ ("岗位", "Post"), (t) => !string.IsNullOrEmpty(t.Duty) && (t.Duty.IndexOf("主任") > -1 || t.Duty.IndexOf("护士长") > -1) ? "主任" : "其他" }, { ("岗位", "Post"), (t) => !string.IsNullOrEmpty(t.Duty) && (t.Duty.IndexOf("主任") > -1 || t.Duty.IndexOf("护士长") > -1) ? "主任" : "其他" },
{ ("出勤", "ActualAttendance"), (t) => t.AttendanceDay }, { ("出勤", "ActualAttendance"), (t) => t.AttendanceDay },
{ ("预留比例", "ReservedRatio"), (t) => t.ReservedRatio }, { ("预留比例", "ReservedRatio"), (t) => t.ReservedRatio },
{ ("医院其他绩效","OtherPerformance"), (t) => getAprAmount(t)},
}; };
int rowNumber = 1; int rowNumber = 1;
...@@ -1192,6 +1231,8 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request) ...@@ -1192,6 +1231,8 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
JobNumber = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "人员工号")?.ItemValue, JobNumber = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "人员工号")?.ItemValue,
WorkPost = 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, PersonName = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "姓名")?.ItemValue,
OthePerfor = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "医院其他绩效")?.ItemValue, 0),
NightWorkPerfor = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "夜班工作量绩效")?.ItemValue, 0),
RealGiveFee = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "实发绩效工资金额")?.ItemValue, 0), RealGiveFee = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "实发绩效工资金额")?.ItemValue, 0),
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment