Commit 0572501a by 799284587@qq.com

新都五月绩效调整

parent 3a3d37de
...@@ -27,6 +27,11 @@ public class cof_director ...@@ -27,6 +27,11 @@ public class cof_director
public Nullable<int> AllotID { get; set; } public Nullable<int> AllotID { get; set; }
/// <summary> /// <summary>
/// 科室
/// </summary>
public string Department { get; set; }
/// <summary>
/// 绩效类型 /// 绩效类型
/// </summary> /// </summary>
public string TypeName { get; set; } public string TypeName { get; set; }
......
//-----------------------------------------------------------------------
// <copyright file=" cof_singlefactor.cs">
// * FileName: 特殊绩效项指标.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
/// 特殊绩效项指标
/// </summary>
[Table("cof_singlefactor")]
public class cof_singlefactor
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
/// 1 工作量
/// </summary>
public Nullable<int> Type { get; set; }
/// <summary>
/// 类型名称
/// </summary>
public string TypeName { get; set; }
/// <summary>
/// 绩效核算单元
/// </summary>
public string AccountingUnit { get; set; }
/// <summary>
/// 绩效项系数
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 系数值
/// </summary>
public Nullable<decimal> FactorValue { get; set; }
}
}
...@@ -24,6 +24,11 @@ public class hos_personfee ...@@ -24,6 +24,11 @@ public class hos_personfee
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public int HospitalId { get; set; }
/// <summary>
///
/// </summary>
public int Year { get; set; } public int Year { get; set; }
/// <summary> /// <summary>
......
//-----------------------------------------------------------------------
// <copyright file=" per_item.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("per_item")]
public class per_item
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> ModuleId { get; set; }
/// <summary>
/// 绩效考核项
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 默认系数或医生系数
/// </summary>
public Nullable<decimal> FactorValue1 { get; set; }
/// <summary>
/// 护理系数
/// </summary>
public string FactorValue2 { get; set; }
/// <summary>
/// 抽取绩效值SQL
/// </summary>
public Nullable<int> ExtractId { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" per_module.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("per_module")]
public class per_module
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> HospitalId { get; set; }
/// <summary>
///
/// </summary>
public string ModuleName { get; set; }
/// <summary>
///
/// </summary>
public string Description { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" per_special.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("per_special")]
public class per_special
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> HospitalId { get; set; }
/// <summary>
/// 科室
/// </summary>
public string Department { get; set; }
/// <summary>
/// 量化指标
/// </summary>
public string Target { get; set; }
/// <summary>
/// 量化指标绩效分值
/// </summary>
public Nullable<decimal> TargetFactor { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public Nullable<decimal> AdjustFactor { get; set; }
}
}
...@@ -247,8 +247,8 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P ...@@ -247,8 +247,8 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P
{ {
if (string.IsNullOrEmpty(dept.DoctorAccountingUnit)) continue; if (string.IsNullOrEmpty(dept.DoctorAccountingUnit)) continue;
var econDoctor = economicData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.DoctorAccountingUnit); var econDoctor = economicData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.Department);
var workDoctor = workloadData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.DoctorAccountingUnit); var workDoctor = workloadData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.Department);
var doctor = new PerDataAccountDoctor var doctor = new PerDataAccountDoctor
{ {
AccountingUnit = dept.DoctorAccountingUnit, AccountingUnit = dept.DoctorAccountingUnit,
...@@ -271,18 +271,28 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P ...@@ -271,18 +271,28 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P
data.Add(doctor); data.Add(doctor);
} }
var groupdata = from d in data
group d by new { d.AccountingUnit } into s var multi = data.GroupBy(t => t.AccountingUnit)
select new .Select(t => new
{ {
AccountingUnit = s.Select(t => t.AccountingUnit).First(), AccountingUnit = t.Key,
Avg = s.Sum(t => t.Number) == 0 ? 0 : s.Sum(t => t.RealGiveFee) / s.Sum(t => t.Number) Count = t.Count(),
}; RealGiveFee = t.Sum(p => p.RealGiveFee),
if (data != null && data.Any()) PerforTotal = t.Sum(p => p.PerforTotal),
Avg = t.Sum(p => p.Number) == 0 ? 0 : t.Sum(p => p.RealGiveFee) / t.Sum(p => p.Number)
})
.Where(t => t.Count > 1).ToArray();
if (multi != null && multi.Any())
{ {
data.ForEach(t => data.ForEach(t =>
{ {
t.Avg = groupdata.FirstOrDefault(group => group.AccountingUnit == t.AccountingUnit).Avg; if (multi.Any(group => group.AccountingUnit == t.AccountingUnit))
{
t.Avg = multi.FirstOrDefault(group => group.AccountingUnit == t.AccountingUnit).Avg;
t.RealGiveFee = multi.FirstOrDefault(group => group.AccountingUnit == t.AccountingUnit).RealGiveFee;
t.PerforTotal = multi.FirstOrDefault(group => group.AccountingUnit == t.AccountingUnit).PerforTotal;
}
}); });
} }
doctorSheet.PerData.AddRange(data); doctorSheet.PerData.AddRange(data);
...@@ -305,8 +315,8 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe ...@@ -305,8 +315,8 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe
{ {
if (string.IsNullOrEmpty(dept.NurseAccountingUnit)) continue; if (string.IsNullOrEmpty(dept.NurseAccountingUnit)) continue;
var econNurse = economicData.FirstOrDefault(t => t.UnitType == "护理组" && t.AccountingUnit == dept.NurseAccountingUnit); var econNurse = economicData.FirstOrDefault(t => t.UnitType == "护理组" && t.AccountingUnit == dept.Department);
var workNurse = workloadData.FirstOrDefault(t => t.UnitType == "护理组" && t.AccountingUnit == dept.NurseAccountingUnit); var workNurse = workloadData.FirstOrDefault(t => t.UnitType == "护理组" && t.AccountingUnit == dept.Department);
var nurse = new PerDataAccountNurse var nurse = new PerDataAccountNurse
{ {
AccountingUnit = dept.NurseAccountingUnit, AccountingUnit = dept.NurseAccountingUnit,
...@@ -329,18 +339,27 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe ...@@ -329,18 +339,27 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe
data.Add(nurse); data.Add(nurse);
} }
var groupdata = from d in data var multi = data.GroupBy(t => t.AccountingUnit)
group d by new { d.AccountingUnit } into s .Select(t => new
select new
{ {
AccountingUnit = s.Select(t => t.AccountingUnit).First(), AccountingUnit = t.Key,
Avg = s.Sum(t => t.Number) == 0 ? 0 : s.Sum(t => t.RealGiveFee) / s.Sum(t => t.Number) Count = t.Count(),
}; RealGiveFee = t.Sum(p => p.RealGiveFee),
if (data != null && data.Any()) PerforTotal = t.Sum(p => p.PerforTotal),
Avg = t.Sum(p => p.Number) == 0 ? 0 : t.Sum(p => p.RealGiveFee) / t.Sum(p => p.Number)
})
.Where(t => t.Count > 1).ToArray();
if (multi != null && multi.Any())
{ {
data.ForEach(t => data.ForEach(t =>
{ {
t.Avg = groupdata.FirstOrDefault(group => group.AccountingUnit == t.AccountingUnit).Avg; if (multi.Any(group => group.AccountingUnit == t.AccountingUnit))
{
t.Avg = multi.FirstOrDefault(group => group.AccountingUnit == t.AccountingUnit).Avg;
t.RealGiveFee = multi.FirstOrDefault(group => group.AccountingUnit == t.AccountingUnit).RealGiveFee;
t.PerforTotal = multi.FirstOrDefault(group => group.AccountingUnit == t.AccountingUnit).PerforTotal;
}
}); });
} }
nurseSheet.PerData.AddRange(data); nurseSheet.PerData.AddRange(data);
......
...@@ -85,12 +85,12 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -85,12 +85,12 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
avg = resAccount?.Avg; avg = resAccount?.Avg;
} }
var efficiency = directorList.FirstOrDefault(t => t.TypeName == "效率绩效" && t.JobTitle == basicRule.DirectorType.ToString()); var efficiency = directorList.FirstOrDefault(t => t.TypeName == "效率绩效" && t.JobTitle == basicRule.DirectorType.ToString() && string.IsNullOrEmpty(t.Department));
var scale = directorList.FirstOrDefault(t => t.TypeName == "规模绩效" && t.JobTitle == basicRule.DirectorType.ToString()); var scale = directorList.FirstOrDefault(t => t.TypeName == "规模绩效" && t.JobTitle == basicRule.DirectorType.ToString() && string.IsNullOrEmpty(t.Department));
// 科室单独规模绩效 效率绩效 系数 // 科室单独规模绩效 效率绩效 系数
var efficAccount = directorList.FirstOrDefault(t => t.TypeName == "效率绩效" && t.JobTitle == item.AccountingUnit); var efficAccount = directorList.FirstOrDefault(t => t.TypeName == "效率绩效" && t.JobTitle == basicRule.DirectorType.ToString() && t.Department == item.AccountingUnit);
var scaleAccount = directorList.FirstOrDefault(t => t.TypeName == "规模绩效" && t.JobTitle == item.AccountingUnit); var scaleAccount = directorList.FirstOrDefault(t => t.TypeName == "规模绩效" && t.JobTitle == basicRule.DirectorType.ToString() && t.Department == item.AccountingUnit);
var compute = new ComputeResult var compute = new ComputeResult
{ {
...@@ -103,8 +103,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -103,8 +103,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
Number = number, Number = number,
PerforTotal = perforTotal, PerforTotal = perforTotal,
Avg = avg, Avg = avg,
Efficiency = avg * efficiency?.Value * (efficAccount?.Value ?? 1), Efficiency = avg * (efficAccount == null ? efficiency?.Value : efficAccount?.Value),
Scale = perforTotal * scale?.Value * (scaleAccount?.Value ?? 1), Scale = perforTotal * (efficAccount == null ? scale?.Value : scaleAccount?.Value),
Grant = item.Grant ?? 1, Grant = item.Grant ?? 1,
ScoreAverageRate = item.ScoreAverageRate, ScoreAverageRate = item.ScoreAverageRate,
Punishment = item.Punishment, Punishment = item.Punishment,
......
...@@ -60,7 +60,7 @@ public PerSheet MergeCompute(PerExcel excel, List<EntityModels.cof_income> incom ...@@ -60,7 +60,7 @@ public PerSheet MergeCompute(PerExcel excel, List<EntityModels.cof_income> incom
PerHeader childHeader = new PerHeader(1, childPointCell, typeName, 1, 1, 1, null, 2); PerHeader childHeader = new PerHeader(1, childPointCell, typeName, 1, 1, 1, null, 2);
headList.Add(childHeader); headList.Add(childHeader);
var ds = group.Where(t => !string.IsNullOrWhiteSpace(t.AccountingUnit) && t.CellValue.HasValue && t.CellValue.Value > 0) var ds = group.Where(t => !string.IsNullOrWhiteSpace(t.AccountingUnit) && t.CellValue.HasValue)
.GroupBy(t => t.AccountingUnit).Select(t => new PerData .GroupBy(t => t.AccountingUnit).Select(t => new PerData
{ {
SignID = childHeader.SignID, SignID = childHeader.SignID,
...@@ -165,7 +165,7 @@ public PerSheet OnceCompute(PerSheet sheet) ...@@ -165,7 +165,7 @@ public PerSheet OnceCompute(PerSheet sheet)
pointcell++; pointcell++;
var childHead = new PerHeader(1, maxcell + pointcell, group.Key, 1, 1, 1, null, 1); var childHead = new PerHeader(1, maxcell + pointcell, group.Key, 1, 1, 1, null, 1);
parentHead.Children.Add(childHead); parentHead.Children.Add(childHead);
var ds = group.Where(t => t.CellValue.HasValue && t.CellValue.Value > 0) var ds = group.Where(t => t.CellValue.HasValue )
.GroupBy(t => t.AccountingUnit).Select(t => new PerData .GroupBy(t => t.AccountingUnit).Select(t => new PerData
{ {
UnitType = group.Key, UnitType = group.Key,
...@@ -207,7 +207,7 @@ public PerSheet OnceCompute(PerSheet sheet) ...@@ -207,7 +207,7 @@ public PerSheet OnceCompute(PerSheet sheet)
List<PerData> perDataList = new List<PerData>(); List<PerData> perDataList = new List<PerData>();
//插入合计结果 //插入合计结果
var groupList = dataList.Where(t => t.IsTotal == 1 && t.CellValue.HasValue && t.CellValue.Value > 0).GroupBy(t => t.UnitType); var groupList = dataList.Where(t => t.IsTotal == 1 && t.CellValue.HasValue ).GroupBy(t => t.UnitType);
foreach (var group in groupList) foreach (var group in groupList)
{ {
var childHead = new PerHeader(1, thiscell, group.Key, 1, 1, 1, null, 1); var childHead = new PerHeader(1, thiscell, group.Key, 1, 1, 1, null, 1);
......
...@@ -52,7 +52,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null) ...@@ -52,7 +52,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
foreach (var group in typeClass.GroupBy(t => t.UnitType)) foreach (var group in typeClass.GroupBy(t => t.UnitType))
{ {
var ds = group.Where(t => t.CellValue.HasValue && t.CellValue.Value > 0) var ds = group.Where(t => t.CellValue.HasValue)
.GroupBy(t => t.AccountingUnit).Select(t => new PerData .GroupBy(t => t.AccountingUnit).Select(t => new PerData
{ {
UnitType = group.Key, UnitType = group.Key,
...@@ -108,7 +108,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null) ...@@ -108,7 +108,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
List<PerData> perDataList = new List<PerData>(); List<PerData> perDataList = new List<PerData>();
//插入合计结果 //插入合计结果
var groupList = dataList.Where(t => t.IsTotal == 1 && t.CellValue.HasValue && t.CellValue.Value > 0).GroupBy(t => new { t.UnitType, t.AccountingUnit }); var groupList = dataList.Where(t => t.IsTotal == 1 && t.CellValue.HasValue).GroupBy(t => new { t.UnitType, t.AccountingUnit });
foreach (var group in groupList) foreach (var group in groupList)
{ {
var ds = group.Select(t => new PerData var ds = group.Select(t => new PerData
......
using AutoMapper; using AutoMapper;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Repository;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Repository;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -149,26 +149,20 @@ private void CommonExport(int sheetID, SheetExportResponse response) ...@@ -149,26 +149,20 @@ private void CommonExport(int sheetID, SheetExportResponse response)
var dataList = _perforImDataRepository.GetEntities(t => t.SheetID == sheetID)?.OrderByDescending(t => t.AccountingUnit).ToList(); var dataList = _perforImDataRepository.GetEntities(t => t.SheetID == sheetID)?.OrderByDescending(t => t.AccountingUnit).ToList();
if (dataList == null || dataList.Count == 0) return; if (dataList == null || dataList.Count == 0) return;
List<string> sheetNames = new List<string> {
"1.1.1 门诊就诊收入","1.1.2 门诊执行收入","1.2.1 住院就诊收入",
"1.2.2 住院执行收入","1.3.1 转入ICU就诊收入","1.3.2 转入ICU执行收入","2.1 成本支出统计表"
};
//添加系数值 //添加系数值
string sheetName = _perforImSheetRepository.GetEntity(t => t.ID == sheetID).SheetName; var sheet = _perforImSheetRepository.GetEntity(t => t.ID == sheetID);
var factorhead = new Row(0); var factorhead = new Row(0);
if (sheetName.Contains("工作量绩效测算表")) if (sheet.SheetType == (int)SheetType.Workload)
{ {
factorhead.Data.Add(new Cell(0, "单元工作量绩效标准:", 1, 2, false, false)); factorhead.Data.Add(new Cell(0, "单元工作量绩效标准:", 1, 2, false, false));
response = AddFactor(response, factorhead, headList.ToList(), dataList, sheetName); response = AddFactor(response, factorhead, headList.ToList(), dataList, sheet.SheetName);
} }
else if (sheetName.Contains("额外收入")) else if (sheet.SheetType == (int)SheetType.OtherIncome)
{ {
factorhead.Data.Add(new Cell(0, "额外收入绩效标准:", 1, 2, false, false)); factorhead.Data.Add(new Cell(0, "额外收入绩效标准:", 1, 2, false, false));
response = AddFactor(response, factorhead, headList.ToList(), dataList, sheetName); response = AddFactor(response, factorhead, headList.ToList(), dataList, sheet.SheetName);
} }
else if (sheetNames.Contains(sheetName)) else if (sheet.SheetType == (int)SheetType.Income || sheet.SheetType == (int)SheetType.Income)
{ {
factorhead.Data.Add(new Cell(0, "护理组分割比例", 1, 3, false, false)); factorhead.Data.Add(new Cell(0, "护理组分割比例", 1, 3, false, false));
response = AddFactor(response, factorhead, headList.ToList(), dataList, "护理组"); response = AddFactor(response, factorhead, headList.ToList(), dataList, "护理组");
...@@ -177,8 +171,6 @@ private void CommonExport(int sheetID, SheetExportResponse response) ...@@ -177,8 +171,6 @@ private void CommonExport(int sheetID, SheetExportResponse response)
response = AddFactor(response, factorhead1, headList.ToList(), dataList, "医生组"); response = AddFactor(response, factorhead1, headList.ToList(), dataList, "医生组");
} }
//创建列头行 //创建列头行
var rowhead = new Row(response.Header.Count()); var rowhead = new Row(response.Header.Count());
response.Header.Add(rowhead); response.Header.Add(rowhead);
......
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