二次绩效分配

parent 59012bec
...@@ -64,7 +64,7 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Generate"), FromBody] ...@@ -64,7 +64,7 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Generate"), FromBody]
{ {
var user = claimService.At(request); var user = claimService.At(request);
var result = againAllotService.Generate(request, user); var result = againAllotService.Generate(request, user);
return new ApiResponse(ResponseType.OK, result); return new ApiResponse(ResponseType.OK, new { result.AgainSituation, result.SheetExport });
} }
} }
} }
...@@ -6,59 +6,115 @@ namespace Performance.DtoModels ...@@ -6,59 +6,115 @@ namespace Performance.DtoModels
{ {
public class PerAgainSituation public class PerAgainSituation
{ {
private decimal? _departmentTotal;
private decimal? _nightShift;
private decimal? _bossPerfor;
private decimal? _award;
private decimal? _allowance;
private decimal? _allotPerfor;
private decimal? _jobPerfor;
private decimal? _workloadPerfor;
private decimal? _alonePerfor;
private decimal? _attendance;
private decimal? _departmentFactorAvg;
/// <summary> /// <summary>
/// 夜班费 /// 夜班费
/// </summary> /// </summary>
public Nullable<decimal> NightShift { get; set; } public Nullable<decimal> NightShift
{
get => _nightShift.HasValue ? Math.Round(_nightShift.Value, 2) : _nightShift;
set => _nightShift = value;
}
/// <summary> /// <summary>
/// 科室总绩效 /// 科室总绩效
/// </summary> /// </summary>
public Nullable<decimal> DepartmentTotal { get; set; } public Nullable<decimal> DepartmentTotal
{
get => (_departmentTotal.HasValue ? Math.Round(_departmentTotal.Value, 2) : _departmentTotal);
set => _departmentTotal = value;
}
/// <summary> /// <summary>
/// 护士长或科主任基础绩效 /// 护士长或科主任基础绩效
/// </summary> /// </summary>
public Nullable<decimal> BossPerfor { get; set; } public Nullable<decimal> BossPerfor
{
get => _bossPerfor.HasValue ? Math.Round(_bossPerfor.Value, 2) : _bossPerfor;
set => _bossPerfor = value;
}
/// <summary> /// <summary>
/// 重点奖励 /// 重点奖励
/// </summary> /// </summary>
public Nullable<decimal> Award { get; set; } public Nullable<decimal> Award
{
get => _award.HasValue ? Math.Round(_award.Value, 2) : _award;
set => _award = value;
}
/// <summary> /// <summary>
/// 管理津贴 /// 管理津贴
/// </summary> /// </summary>
public Nullable<decimal> Allowance { get; set; } public Nullable<decimal> Allowance
{
get => _allowance.HasValue ? Math.Round(_allowance.Value, 2) : _allowance;
set => _allowance = value;
}
/// <summary> /// <summary>
/// 业绩分配绩效 /// 业绩分配绩效
/// </summary> /// </summary>
public Nullable<decimal> AllotPerfor { get; set; } public Nullable<decimal> AllotPerfor
{
get => _allotPerfor.HasValue ? Math.Round(_allotPerfor.Value, 2) : _allotPerfor;
set => _allotPerfor = value;
}
/// <summary> /// <summary>
/// 职称绩效 /// 职称绩效
/// </summary> /// </summary>
public Nullable<decimal> JobPerfor { get; set; } public Nullable<decimal> JobPerfor
{
get => _jobPerfor.HasValue ? Math.Round(_jobPerfor.Value, 2) : _jobPerfor;
set => _jobPerfor = value;
}
/// <summary> /// <summary>
/// 工作量绩效 /// 工作量绩效
/// </summary> /// </summary>
public Nullable<decimal> WorkloadPerfor { get; set; } public Nullable<decimal> WorkloadPerfor
{
get => _workloadPerfor.HasValue ? Math.Round(_workloadPerfor.Value, 2) : _workloadPerfor;
set => _workloadPerfor = value;
}
/// <summary> /// <summary>
/// 单独核算人员绩效 /// 单独核算人员绩效
/// </summary> /// </summary>
public Nullable<decimal> AlonePerfor { get; set; } public Nullable<decimal> AlonePerfor
{
get => _alonePerfor.HasValue ? Math.Round(_alonePerfor.Value, 2) : _alonePerfor;
set => _alonePerfor = value;
}
/// <summary> /// <summary>
/// 出勤 /// 出勤
/// </summary> /// </summary>
public Nullable<decimal> Attendance { get; set; } public Nullable<decimal> Attendance
{
get => _attendance.HasValue ? Math.Round(_attendance.Value, 2) : _attendance;
set => _attendance = value;
}
/// <summary> /// <summary>
/// 科室系数人均 /// 科室系数人均
/// </summary> /// </summary>
public Nullable<decimal> DepartmentFactorAvg { get; set; } public Nullable<decimal> DepartmentFactorAvg
{
get => _departmentFactorAvg.HasValue ? Math.Round(_departmentFactorAvg.Value, 2) : _departmentFactorAvg;
set => _departmentFactorAvg = value;
}
} }
} }
...@@ -35,11 +35,13 @@ public class AgainAllotService : IAutoInjection ...@@ -35,11 +35,13 @@ public class AgainAllotService : IAutoInjection
/// 生成二次绩效 /// 生成二次绩效
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
public SheetExportResponse Generate(AgainAllotRequest request, UserIdentity user) public (SheetExportResponse SheetExport, PerAgainSituation AgainSituation) Generate(AgainAllotRequest request, UserIdentity user)
{ {
var againAllot = perforPeragainallotRepository.GetEntity(t => t.ID == request.AgainAllotID); var againAllot = perforPeragainallotRepository.GetEntity(t => t.ID == request.AgainAllotID);
if (againAllot == null || againAllot.ID == 0) if (againAllot == null || againAllot.ID == 0)
throw new PerformanceException("绩效二次分配不存在"); throw new PerformanceException("绩效二次分配不存在");
#region 基础信息
//获取基础配置信息 //获取基础配置信息
var config = perforCofagainRepository.GetEntities(t => t.AgainAllotID == againAllot.ID); var config = perforCofagainRepository.GetEntities(t => t.AgainAllotID == againAllot.ID);
var jobfactor = config.FirstOrDefault(t => t.Type == 1)?.Value; var jobfactor = config.FirstOrDefault(t => t.Type == 1)?.Value;
...@@ -58,6 +60,9 @@ public SheetExportResponse Generate(AgainAllotRequest request, UserIdentity user ...@@ -58,6 +60,9 @@ public SheetExportResponse Generate(AgainAllotRequest request, UserIdentity user
: perforResaccountdoctorRepository.GetEntity(t => t.AllotID == againAllot.AllotID && t.AccountingUnit == user.Department)?.RealGiveFee; : perforResaccountdoctorRepository.GetEntity(t => t.AllotID == againAllot.AllotID && t.AccountingUnit == user.Department)?.RealGiveFee;
} }
} }
#endregion
#region 计算
//读取二次计算excel数据 //读取二次计算excel数据
var perAgainExcel = againService.ReadData(againAllot); var perAgainExcel = againService.ReadData(againAllot);
//护士长或科主任出勤 //护士长或科主任出勤
...@@ -146,6 +151,9 @@ public SheetExportResponse Generate(AgainAllotRequest request, UserIdentity user ...@@ -146,6 +151,9 @@ public SheetExportResponse Generate(AgainAllotRequest request, UserIdentity user
employee.RealGiveFee = (employee.GiveFee ?? 0) + (employee.NightShift ?? 0); employee.RealGiveFee = (employee.GiveFee ?? 0) + (employee.NightShift ?? 0);
} }
} }
#endregion
#region 表格显示
SheetExportResponse response = new SheetExportResponse("二次绩效分配表"); SheetExportResponse response = new SheetExportResponse("二次绩效分配表");
//返回表格展示数据结构 //返回表格展示数据结构
var row = new Row(0); var row = new Row(0);
...@@ -204,8 +212,9 @@ public SheetExportResponse Generate(AgainAllotRequest request, UserIdentity user ...@@ -204,8 +212,9 @@ public SheetExportResponse Generate(AgainAllotRequest request, UserIdentity user
rowbody.Data.Add(new Cell(14 + perAgainExcel.Header.Children.Count, item.RealGiveFee, 1, 1, false, false)); rowbody.Data.Add(new Cell(14 + perAgainExcel.Header.Children.Count, item.RealGiveFee, 1, 1, false, false));
response.Row.Add(rowbody); response.Row.Add(rowbody);
} }
#endregion
return response; return (response, situation);
} }
} }
} }
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