Commit 879cd838 by lcx

二次绩效打印

parent db2bf913
......@@ -237,14 +237,12 @@ public AutoMapperConfigs()
.ReverseMap();
CreateMap<cost_transfer, CostTransferResponse>(
).ForMember(back=>back.Items,n=>n.Ignore());
).ForMember(back => back.Items, n => n.Ignore());
CreateMap<cost_transfer, cost_transfer>(
).ForMember(back => back.Id, n => n.Ignore());
}
public void xx()
{
CreateMap<ag_headsource, SecPrintHeaderResponse>().ReverseMap();
}
}
}
......@@ -61,4 +61,63 @@ public class SecPrintResponse
public int RowNumber { get; set; }
}
public class SecPrintHeaderResponse
{
/// <summary>
/// 可分配绩效
/// </summary>
public decimal TotalPerformance { get; set; }
/// <summary>
/// 科室总绩效
/// </summary>
public decimal TotalDistPerformance { get; set; }
/// <summary>
/// 科室单项奖励
/// </summary>
public decimal TheTotalAllocationOfPerformanceResults { get; set; }
/// <summary>
/// 主任基础绩效
/// </summary>
public decimal DirectorBasisPerformance { get; set; }
/// <summary>
/// 夜班绩效总和
/// </summary>
public decimal NightShiftWorkPerforTotal { get; set; }
/// <summary>
/// 医院其他绩效
/// </summary>
public decimal HosOtherPerformance { get; set; }
/// <summary>
/// 年资职称绩效占比
/// </summary>
public decimal SeniorityTitlesAccountedPerformance { get; set; }
/// <summary>
/// 年资职称绩效
/// </summary>
public decimal SeniorityTitlesPerformance { get; set; }
/// <summary>
/// 工作量绩效占比
/// </summary>
public decimal Workload_Ratio_Default { get; set; }
/// <summary>
/// 工作量分配绩效金额
/// </summary>
public decimal Workload_Amount_Default { get; set; }
/// <summary>
/// 其他工作量占比
/// </summary>
public List<TitleValue<decimal>> WorkloadTypes { get; set; }
}
}
......@@ -2081,7 +2081,7 @@ public void OtherSave(int secondId, SaveCollectData collectData)
#region 打印
public List<SecPrintResponse> Print(int secondId)
public dynamic Print(int secondId)
{
var second = agsecondallotRepository.GetEntity(t => t.Id == secondId);
if (second == null) return new List<SecPrintResponse>();
......@@ -2090,12 +2090,17 @@ public List<SecPrintResponse> Print(int secondId)
//if (computes == null || !computes.Any())
// return new List<SecPrintResponse>();
List<SecPrintResponse> result = new List<SecPrintResponse>();
SecPrintHeaderResponse header = new SecPrintHeaderResponse();
if (second.UseTempId.HasValue && second.UseTempId == 6)
{
var data = agothersourceRepository.GetEntities(t => t.SecondId == secondId);
if (data == null || !data.Any()) return new List<SecPrintResponse>();
result = Mapper.Map<List<SecPrintResponse>>(data);
header.TotalDistPerformance = second.RealGiveFee ?? 0;
header.HosOtherPerformance = result.Sum(t => t.OtherPerformance ?? 0);
header.TotalPerformance = header.TotalDistPerformance - header.HosOtherPerformance;
}
else if (second.UseTempId.HasValue && (new int[] { 9, 10 }).Contains(second.UseTempId.Value))
{
......@@ -2119,6 +2124,11 @@ public List<SecPrintResponse> Print(int secondId)
OtherPerformance = w.OtherPerformance,
NightWorkPerformance = w.NightWorkPerformance,
}).ToList();
var headerdata = agheadsourceRepository.GetEntity(t => t.SecondId == secondId);
header = Mapper.Map<SecPrintHeaderResponse>(headerdata);
//header.HosOtherPerformance = result.Sum(t => t.OtherPerformance ?? 0);
}
else
{
......@@ -2149,6 +2159,21 @@ public List<SecPrintResponse> Print(int secondId)
sec.NightWorkPerformance = nightworkperfor;
result.Add(sec);
}
fixaitems = agfixatitemRepository.GetEntities(t => t.SecondId == secondId && t.RowNumber == -1);
if (fixaitems != null && fixaitems.Any())
{
header.TotalDistPerformance = ConvertHelper.To<decimal>(fixaitems.FirstOrDefault(t => t.ItemName == "科室总绩效")?.ItemValue);
header.TotalPerformance = ConvertHelper.To<decimal>(fixaitems.FirstOrDefault(t => t.ItemName == "可分配绩效")?.ItemValue);
header.TheTotalAllocationOfPerformanceResults = ConvertHelper.To<decimal>(fixaitems.FirstOrDefault(t => t.ItemName == "科室单项奖励")?.ItemValue);
header.DirectorBasisPerformance = ConvertHelper.To<decimal>(fixaitems.FirstOrDefault(t => t.ItemName == "主任基础绩效")?.ItemValue);
header.NightShiftWorkPerforTotal = ConvertHelper.To<decimal>(fixaitems.FirstOrDefault(t => t.ItemName == "夜班绩效总和")?.ItemValue);
header.HosOtherPerformance = ConvertHelper.To<decimal>(fixaitems.FirstOrDefault(t => t.ItemName == "医院其他绩效")?.ItemValue);
header.SeniorityTitlesAccountedPerformance = ConvertHelper.To<decimal>(fixaitems.FirstOrDefault(t => t.ItemName == "年资职称绩效占比")?.ItemValue);
header.SeniorityTitlesPerformance = ConvertHelper.To<decimal>(fixaitems.FirstOrDefault(t => t.ItemName == "年资职称绩效")?.ItemValue);
header.Workload_Ratio_Default = ConvertHelper.To<decimal>(fixaitems.FirstOrDefault(t => t.ItemName == "工作量绩效占比")?.ItemValue);
header.Workload_Amount_Default = ConvertHelper.To<decimal>(fixaitems.FirstOrDefault(t => t.ItemName == "工作量分配绩效金额")?.ItemValue);
}
}
// 补充医院其他绩效 及 预留比例
......@@ -2191,8 +2216,24 @@ public List<SecPrintResponse> Print(int secondId)
item.RealAmount = (item.DistPerformance ?? 0) * (1 - (item.ReservedRatio ?? 0)) + (item.OtherPerformance ?? 0) + (item.NightWorkPerformance ?? 0);
}
var otherWorktypes = agworktypesourceRepository.GetEntities(t => t.SecondId == secondId);
if (otherWorktypes != null && otherWorktypes.Any())
{
List<TitleValue<decimal>> dict = new List<TitleValue<decimal>>();
foreach (var worktype in otherWorktypes.OrderBy(t => t.WorkTypeId).ThenBy(t => t.FieldId))
{
dict.Add(new TitleValue<decimal>
{
Title = worktype.FieldName,
Value = worktype.Value ?? 0
});
}
header.WorkloadTypes = dict;
}
return result.OrderBy(t => t.JobNumber).ThenBy(t => t.PersonName).ToList();
return new { header, body = result.OrderBy(t => t.JobNumber).ThenBy(t => t.PersonName).ToList() };
}
#endregion 打印
......
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