Commit 0572501a by 799284587@qq.com

新都五月绩效调整

parent 3a3d37de
......@@ -27,6 +27,11 @@ public class cof_director
public Nullable<int> AllotID { get; set; }
/// <summary>
/// 科室
/// </summary>
public string Department { get; set; }
/// <summary>
/// 绩效类型
/// </summary>
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; }
}
}
......@@ -20,16 +20,21 @@ public class hos_personfee
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
///
/// </summary>
public int Year { get; set; }
public int HospitalId { get; set; }
/// <summary>
///
/// </summary>
public int Year { get; set; }
/// <summary>
///
/// </summary>
public int Month { get; set; }
public int Month { get; set; }
/// <summary>
/// 来源 门诊 住院
......
......@@ -30,17 +30,17 @@ public class im_accountbasic
///
/// </summary>
public Nullable<int> SheetID { get; set; }
/// <summary>
/// 核算单元(医生组)
/// </summary>
public string DoctorAccountingUnit { get; set; }
/// <summary>
/// 核算单元(护理组)
/// </summary>
public string NurseAccountingUnit { 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
{
if (string.IsNullOrEmpty(dept.DoctorAccountingUnit)) continue;
var econDoctor = economicData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.DoctorAccountingUnit);
var workDoctor = workloadData.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.Department);
var doctor = new PerDataAccountDoctor
{
AccountingUnit = dept.DoctorAccountingUnit,
......@@ -271,18 +271,28 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P
data.Add(doctor);
}
var groupdata = from d in data
group d by new { d.AccountingUnit } into s
select new
{
AccountingUnit = s.Select(t => t.AccountingUnit).First(),
Avg = s.Sum(t => t.Number) == 0 ? 0 : s.Sum(t => t.RealGiveFee) / s.Sum(t => t.Number)
};
if (data != null && data.Any())
var multi = data.GroupBy(t => t.AccountingUnit)
.Select(t => new
{
AccountingUnit = t.Key,
Count = t.Count(),
RealGiveFee = t.Sum(p => p.RealGiveFee),
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 =>
{
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);
......@@ -305,8 +315,8 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe
{
if (string.IsNullOrEmpty(dept.NurseAccountingUnit)) continue;
var econNurse = economicData.FirstOrDefault(t => t.UnitType == "护理组" && t.AccountingUnit == dept.NurseAccountingUnit);
var workNurse = workloadData.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.Department);
var nurse = new PerDataAccountNurse
{
AccountingUnit = dept.NurseAccountingUnit,
......@@ -329,18 +339,27 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe
data.Add(nurse);
}
var groupdata = from d in data
group d by new { d.AccountingUnit } into s
select new
{
AccountingUnit = s.Select(t => t.AccountingUnit).First(),
Avg = s.Sum(t => t.Number) == 0 ? 0 : s.Sum(t => t.RealGiveFee) / s.Sum(t => t.Number)
};
if (data != null && data.Any())
var multi = data.GroupBy(t => t.AccountingUnit)
.Select(t => new
{
AccountingUnit = t.Key,
Count = t.Count(),
RealGiveFee = t.Sum(p => p.RealGiveFee),
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 =>
{
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);
......
......@@ -85,12 +85,12 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
avg = resAccount?.Avg;
}
var efficiency = directorList.FirstOrDefault(t => t.TypeName == "效率绩效" && t.JobTitle == basicRule.DirectorType.ToString());
var scale = 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() && string.IsNullOrEmpty(t.Department));
// 科室单独规模绩效 效率绩效 系数
var efficAccount = directorList.FirstOrDefault(t => t.TypeName == "效率绩效" && t.JobTitle == item.AccountingUnit);
var scaleAccount = 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 == basicRule.DirectorType.ToString() && t.Department == item.AccountingUnit);
var compute = new ComputeResult
{
......@@ -103,8 +103,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
Number = number,
PerforTotal = perforTotal,
Avg = avg,
Efficiency = avg * efficiency?.Value * (efficAccount?.Value ?? 1),
Scale = perforTotal * scale?.Value * (scaleAccount?.Value ?? 1),
Efficiency = avg * (efficAccount == null ? efficiency?.Value : efficAccount?.Value),
Scale = perforTotal * (efficAccount == null ? scale?.Value : scaleAccount?.Value),
Grant = item.Grant ?? 1,
ScoreAverageRate = item.ScoreAverageRate,
Punishment = item.Punishment,
......
......@@ -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);
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
{
SignID = childHeader.SignID,
......@@ -165,7 +165,7 @@ public PerSheet OnceCompute(PerSheet sheet)
pointcell++;
var childHead = new PerHeader(1, maxcell + pointcell, group.Key, 1, 1, 1, null, 1);
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
{
UnitType = group.Key,
......@@ -207,7 +207,7 @@ public PerSheet OnceCompute(PerSheet sheet)
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)
{
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)
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
{
UnitType = group.Key,
......@@ -108,7 +108,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
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)
{
var ds = group.Select(t => new PerData
......
using AutoMapper;
using Performance.DtoModels;
using Performance.EntityModels;
using Performance.Repository;
using Performance.Infrastructure;
using Performance.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -149,26 +149,20 @@ private void CommonExport(int sheetID, SheetExportResponse response)
var dataList = _perforImDataRepository.GetEntities(t => t.SheetID == sheetID)?.OrderByDescending(t => t.AccountingUnit).ToList();
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);
if (sheetName.Contains("工作量绩效测算表"))
if (sheet.SheetType == (int)SheetType.Workload)
{
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));
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));
response = AddFactor(response, factorhead, headList.ToList(), dataList, "护理组");
......@@ -177,8 +171,6 @@ private void CommonExport(int sheetID, SheetExportResponse response)
response = AddFactor(response, factorhead1, headList.ToList(), dataList, "医生组");
}
//创建列头行
var rowhead = new Row(response.Header.Count());
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