Commit 15e62c9a by 799284587@qq.com

Merge branch '本地新都测试表核对' into develop

parents e6133e28 744355d3
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}, },
"Application": { "Application": {
//登录过期时间 //登录过期时间
"ExpirationMinutes": "5", "ExpirationMinutes": "420",
//验证码过期 //验证码过期
"SmsCodeMinutes": "5", "SmsCodeMinutes": "5",
//护士长二次绩效管理员 //护士长二次绩效管理员
......
...@@ -61,43 +61,116 @@ public enum SheetType ...@@ -61,43 +61,116 @@ public enum SheetType
/// <summary> /// <summary>
/// 绩效类型 /// 绩效类型
/// </summary> /// </summary>
public enum PerformanceType //public enum PerformanceType
//{
// /// <summary> </summary>
// [Description("")]
// Null = 0,
// /// <summary> 绩效基数临床科室主任(专门用来计算科主任绩效,由此产生=>>临床科室主任人均绩效)</summary>
// [Description("绩效基数临床科室主任")]
// StandardDirector = 1,
// /// <summary> 绩效基数临床科室副主任(专门用来计算科主任绩效,由此产生=>>临床科室副主任人均绩效) </summary>
// [Description("绩效基数临床科室副主任")]
// StandardDeputyDirector = 2,
// /// <summary> 绩效基数临床科室护士长(专门用来计算科主任绩效,由此产生=>>临床科室护士长人均绩效) </summary>
// [Description("绩效基数临床科室护士长")]
// StandardNurse = 3,
// /// <summary> 绩效基数医技科室主任(专门用来计算科主任绩效,由此产生=>>医技科室主任人均绩效) </summary>
// [Description("绩效基数医技科室主任")]
// StandardDirectorYJ = 14,
// /// <summary> 临床科室主任人均绩效 (绩效标准取 科室主任人均绩效) </summary>
// [Description("临床科室主任人均绩效")]
// ReferenceDirector = 4,
// /// <summary> 临床科室中层人均绩效 (绩效标准取 科室主任/护士长/科室副主任/医技主任 平均值) </summary>
// [Description("临床科室中层人均绩效")]
// ReferenceDirectorAvg = 5,
// /// <summary> 临床科室护士长人均绩效 (绩效标准取 护士长 平均值)</summary>
// [Description("临床科室护士长人均绩效")]
// ReferenceHeadNurse = 7,
// /// <summary> 临床科室副主任人均绩效 </summary>
// [Description("临床科室副主任人均绩效")]
// ReferenceDeputyDirector = 8,
// /// <summary> 临床科室医生人均绩效 </summary>
// [Description("临床科室医生人均绩效")]
// ReferenceDoctor = 9,
// /// <summary> 临床科室护士人均绩效 </summary>
// [Description("临床科室护士人均绩效")]
// ReferenceNurse = 10,
// /// <summary> 行政工勤人均绩效 </summary>
// [Description("行政工勤人均绩效")]
// LogisticsWorker = 11,
// /// <summary> 行政中层人均绩效 </summary>
// [Description("行政中层人均绩效")]
// MiddleManager = 12,
// /// <summary> 行政高层人均绩效 </summary>
// [Description("行政高层人均绩效")]
// TopManager = 13,
//}
/// <summary>
/// 核算单元类型
/// </summary>
public enum AccountUnitType
{ {
/// <summary> </summary> /// <summary> </summary>
[Description("")] [Description("")]
Null = 0, Null = 1,
/// <summary> 临床科室 </summary>
/// <summary> 绩效基数临床科室主任(专门用来计算科主任绩效,由此产生=>>临床科室主任人均绩效)</summary> [Description("临床科室")]
[Description("绩效基数临床科室主任")] 临床科室 = 2,
StandardDirector = 1, /// <summary> 临床科室 </summary>
/// <summary> 绩效基数临床科室副主任(专门用来计算科主任绩效,由此产生=>>临床科室副主任人均绩效) </summary> [Description("医技科室")]
[Description("绩效基数临床科室副主任")] 医技科室 = 3,
StandardDeputyDirector = 2, /// <summary> 行政高层 </summary>
/// <summary> 绩效基数临床科室护士长(专门用来计算科主任绩效,由此产生=>>临床科室护士长人均绩效) </summary> [Description("行政高层")]
[Description("绩效基数临床科室护士长")] 行政高层 = 4,
StandardNurse = 3, /// <summary> 临床科室 </summary>
[Description("行政中层")]
行政中层 = 5,
/// <summary> 临床科室 </summary>
[Description("行政工勤")]
行政工勤 = 6,
}
/// <summary> 临床科室主任人均绩效 (绩效标准取 科室主任人均绩效) </summary> public enum PerforType
{
[Description("临床科室主任人均绩效")] [Description("临床科室主任人均绩效")]
ReferenceDirector = 4, 临床主任,
/// <summary> 临床科室中层人均绩效 (绩效标准取 科室主任/护士长/科室副主任/医技主任 平均值) </summary>
[Description("临床科室中层人均绩效")]
ReferenceDirectorAvg = 5,
/// <summary> 临床科室护士长人均绩效 (绩效标准取 护士长 平均值)</summary>
[Description("临床科室护士长人均绩效")]
ReferenceHeadNurse = 7,
/// <summary> 临床科室副主任人均绩效 </summary>
[Description("临床科室副主任人均绩效")] [Description("临床科室副主任人均绩效")]
ReferenceDeputyDirector = 8, 临床副主任,
/// <summary> 临床科室医生人均绩效 </summary> [Description("医技科室主任人均绩效")]
[Description("临床科室医生人均绩效")] 医技主任,
ReferenceDoctor = 9, [Description("医技科室副主任人均绩效")]
/// <summary> 临床科室护士人均绩效 </summary> 医技副主任,
[Description("临床科室护士人均绩效")] [Description("护士长人均绩效")]
ReferenceNurse = 10, 护士长,
/// <summary> 行政工勤人均绩效 </summary> [Description("护士人均绩效")]
护士,
[Description("临床主任护士长平均")]
临床主任护士长平均,
[Description("临床医生人均绩效")]
临床医生,
[Description("医技医生人均绩效")]
医技医生,
[Description("行政中层人均绩效")]
行政中层,
[Description("行政工勤人均绩效")] [Description("行政工勤人均绩效")]
LogisticsWorker = 11, 行政工勤,
}
/// <summary>
/// 当前枚举为效率绩效、规模绩效中系数中文名称
/// 对应表cof_director中JobTitle 全文字匹配
/// </summary>
public enum DirectorType
{
临床科室主任,
临床科室副主任,
医技科室主任,
医技科室副主任,
临床科室护士长,
} }
} }
...@@ -60,36 +60,27 @@ public class PerDataAccountDoctor : IPerData ...@@ -60,36 +60,27 @@ public class PerDataAccountDoctor : IPerData
/// </summary> /// </summary>
public decimal Income { get; set; } public decimal Income { get; set; }
/// <summary> /// <summary>
/// 工作量绩效 /// 工作量绩效
/// </summary> /// </summary>
public decimal WorkloadFee { get; set; } public decimal WorkloadFee { get; set; }
private decimal perforFee;
private decimal perforTotal;
private decimal avg;
private decimal giveFee;
/// <summary> /// <summary>
/// 绩效合计 /// 绩效合计
/// </summary> /// </summary>
public decimal PerforTotal { get => PerforFee + WorkloadFee + OtherPerfor1; set => perforTotal = value; } public decimal PerforTotal { get; set; }
/// <summary> /// <summary>
/// 业绩绩效 /// 业绩绩效
/// </summary> /// </summary>
public decimal PerforFee { get => Income * (BasicFactor + (BasicFactor * SlopeFactor)); set => perforFee = value; } public decimal PerforFee { get; set; }
/// <summary> /// <summary>
/// 实发绩效 /// 实发绩效
/// </summary> /// </summary>
public decimal RealGiveFee { get => (PerforTotal * ScoringAverage + Extra + OtherPerfor2) * (AdjustFactor == 0 ? 1 : AdjustFactor); set => giveFee = value; } public decimal RealGiveFee { get; set; }
/// <summary> /// <summary>
/// 人均绩效 /// 人均绩效
/// </summary> /// </summary>
public decimal Avg { get => Number == 0 ? 0 : PerforTotal / Number; set => avg = value; } public decimal Avg { get; set; }
} }
} }
...@@ -65,30 +65,23 @@ public class PerDataAccountNurse : IPerData ...@@ -65,30 +65,23 @@ public class PerDataAccountNurse : IPerData
/// </summary> /// </summary>
public decimal WorkloadFee { get; set; } public decimal WorkloadFee { get; set; }
private decimal perforFee;
private decimal perforTotal;
private decimal avg;
private decimal giveFee;
/// <summary> /// <summary>
/// 绩效合计 /// 绩效合计
/// </summary> /// </summary>
public decimal PerforTotal { get => PerforFee + WorkloadFee + OtherPerfor1; set => perforTotal = value; } public decimal PerforTotal { get; set; }
/// <summary> /// <summary>
/// 业绩绩效 /// 业绩绩效
/// </summary> /// </summary>
public decimal PerforFee { get => Income * (BasicFactor + (BasicFactor * SlopeFactor)); set => perforFee = value; } public decimal PerforFee { get; set; }
/// <summary> /// <summary>
/// 实发绩效 /// 实发绩效
/// </summary> /// </summary>
public decimal RealGiveFee { get => (PerforTotal * ScoringAverage + Extra + OtherPerfor2) * (AdjustFactor == 0 ? 1 : AdjustFactor); set => giveFee = value; } public decimal RealGiveFee { get; set; }
/// <summary> /// <summary>
/// 人均绩效 /// 人均绩效
/// </summary> /// </summary>
public decimal Avg { get => Number == 0 ? 0 : PerforTotal / Number; set => avg = value; } public decimal Avg { get; set; }
} }
} }
...@@ -32,6 +32,11 @@ public class res_compute ...@@ -32,6 +32,11 @@ public class res_compute
public Nullable<int> SheetID { get; set; } public Nullable<int> SheetID { get; set; }
/// <summary> /// <summary>
/// 核算单元类型(医技科室、临床科室等)
/// </summary>
public string AccountType { get; set; }
/// <summary>
/// 核算单元 /// 核算单元
/// </summary> /// </summary>
public string AccountingUnit { get; set; } public string AccountingUnit { get; set; }
......
using Performance.DtoModels; using Performance.DtoModels;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -7,47 +8,99 @@ ...@@ -7,47 +8,99 @@
namespace Performance.Services.AllotCompute namespace Performance.Services.AllotCompute
{ {
/// <summary> /// <summary>
/// 绩效标准数据 /// 绩效标准数据
/// </summary> /// </summary>
public class BaiscNormService : IAutoInjection public class BaiscNormService : IAutoInjection
{ {
/// <summary> /// <summary>
/// 获取绩效标准基础值 /// 绩效标准计算 主任 副主任 护士长
/// </summary> /// </summary>
/// <param name="baiscnorms"></param> /// <param name="computes"></param>
/// <param name="type"></param>
/// <returns></returns> /// <returns></returns>
public decimal? GetBaiscNorm(List<res_baiscnorm> baiscnorms, PerformanceType type) public List<res_baiscnorm> ComputeAvg(List<res_baiscnorm> baiscnormList, List<ComputeResult> computes, List<im_employee> empolyeeList)
{ {
decimal? result = null; var keyList = new[]
if (type == PerformanceType.ReferenceDirector || type == PerformanceType.Null)
{ {
result = baiscnorms.FirstOrDefault(t => t.PositionName == "临床科主任")?.AvgValue; //绩效基数平均值项目
} new { type = AccountUnitType.临床科室, reference = PerforType.临床主任 },
else if (type == PerformanceType.ReferenceDirectorAvg) new { type = AccountUnitType.临床科室, reference = PerforType.临床副主任 },
new { type = AccountUnitType.临床科室, reference = PerforType.护士长 },
new { type = AccountUnitType.医技科室, reference = PerforType.医技主任 },
new { type = AccountUnitType.医技科室, reference = PerforType.医技副主任 },
};
foreach (var item in keyList)
{ {
List<string> avgObjectList = new List<string> { "临床科主任", "临床科副主任", "医技科主任", "临床科护长" }; var count = empolyeeList.Count(t => t.AccountType == item.type.ToString() && t.FitPeople == EnumHelper.GetDescription(item.reference));
var baisc = baiscnorms.Where(t => avgObjectList.Contains(t.PositionName)); if (count > 0)
{
result = baisc.Sum(s => s.TotelValue) / baisc.Sum(s => s.TotelNumber); var dataList = computes.Where(t => t.AccountType == item.type.ToString() && t.FitPeople == EnumHelper.GetDescription(item.reference));
} var baiscnorm = new res_baiscnorm
else if (type == PerformanceType.ReferenceHeadNurse)
{ {
result = baiscnorms.FirstOrDefault(t => t.PositionName == "临床科护长")?.AvgValue; PositionName = EnumHelper.GetDescription(item.reference),
TotelNumber = count,
TotelValue = dataList.Sum(t => t.GiveFee),
AvgValue = dataList.Sum(t => t.GiveFee) / count
};
baiscnormList.Add(baiscnorm);
} }
else if (type == PerformanceType.ReferenceNurse) }
return baiscnormList;
}
/// <summary>
/// 院领导、行政中层、行政工勤 平均值
/// </summary>
/// <param name="computes"></param>
/// <returns></returns>
public List<res_baiscnorm> ComputeOtherAvg(List<res_baiscnorm> baiscnormList, List<ComputeResult> computes, List<im_employee> empolyeeList)
{
var keyList = new[]
{
//行政绩效平均值项目
new { type = AccountUnitType.行政中层, reference = PerforType.行政中层 },
new { type = AccountUnitType.行政工勤, reference = PerforType.行政工勤 },
};
foreach (var item in keyList)
{
var count = empolyeeList.Count(t => t.AccountType == item.type.ToString());
if (count > 0)
{
var dataList = computes.Where(t => t.AccountType == item.type.ToString());
var baiscnorm = new res_baiscnorm
{ {
result = baiscnorms.FirstOrDefault(t => t.PositionName == "临床护士")?.AvgValue; PositionName = EnumHelper.GetDescription(item.reference),
TotelNumber = count,
TotelValue = dataList.Sum(t => t.GiveFee),
AvgValue = dataList.Sum(t => t.GiveFee) / count
};
baiscnormList.Add(baiscnorm);
}
} }
else if (type == PerformanceType.ReferenceDoctor) return baiscnormList;
}
/// <summary>
/// 获取绩效标准基础值
/// </summary>
/// <param name="baiscnorms"></param>
/// <param name="type"></param>
/// <returns></returns>
public decimal? GetBaiscNorm(List<res_baiscnorm> baiscnorms, PerforType type)
{ {
result = baiscnorms.FirstOrDefault(t => t.PositionName == "临床医生")?.AvgValue; decimal? result = null;
if (type == PerforType.临床主任护士长平均)
{
var lczrValue = baiscnorms.FirstOrDefault(t => t.PositionName == EnumHelper.GetDescription(PerforType.临床主任))?.AvgValue;
var hszValue = baiscnorms.FirstOrDefault(t => t.PositionName == EnumHelper.GetDescription(PerforType.护士长))?.AvgValue;
result = ((lczrValue ?? 0) + (hszValue ?? 0)) / 2;
} }
else if (type == PerformanceType.LogisticsWorker) else
{ {
result = baiscnorms.FirstOrDefault(t => t.PositionName == "行政工勤")?.AvgValue; result = baiscnorms.FirstOrDefault(t => t.PositionName == EnumHelper.GetDescription(type))?.AvgValue;
} }
if (result.HasValue) if (result.HasValue)
result = Math.Round(result.Value, 4); result = Math.Round(result.Value, 4);
return result; return result;
...@@ -58,47 +111,19 @@ public class BaiscNormService : IAutoInjection ...@@ -58,47 +111,19 @@ public class BaiscNormService : IAutoInjection
/// </summary> /// </summary>
/// <param name="list"></param> /// <param name="list"></param>
/// <returns></returns> /// <returns></returns>
public res_baiscnorm NurseBaiscnorm(List<PerSheet> list) public List<res_baiscnorm> NurseBaiscnorm(List<res_baiscnorm> baiscnormList, List<PerSheet> list)
{ {
var sheet = list.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseAccount); var sheet = list.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseAccount);
var perdata = sheet.PerData.Select(t => (PerDataAccountNurse)t); var perdata = sheet.PerData.Select(t => (PerDataAccountNurse)t);
return new res_baiscnorm var baiscnorm = new res_baiscnorm
{ {
PositionName = "临床护士", PositionName = EnumHelper.GetDescription(PerforType.护士),
TotelNumber = perdata.Sum(t => t.Number), TotelNumber = perdata.Sum(t => t.Number),
TotelValue = perdata.Sum(t => t.PerforTotal), TotelValue = perdata.Sum(t => t.PerforTotal),
AvgValue = perdata.Sum(t => t.PerforTotal) / perdata.Sum(t => t.Number) AvgValue = perdata.Sum(t => t.PerforTotal) / perdata.Sum(t => t.Number)
}; };
} baiscnormList.Add(baiscnorm);
return baiscnormList;
/// <summary>
/// 绩效标准计算
/// </summary>
/// <param name="computes"></param>
/// <returns></returns>
public List<res_baiscnorm> ComputeAvg(List<ComputeResult> computes)
{
var keyList = new[]
{
new { type = "临床科室", reference = "科室主任人均绩效", groupname = "临床科主任" },
new { type = "临床科室", reference = "科室副主任人均绩效", groupname = "临床科副主任" },
new { type = "医技科室", reference = "科室主任人均绩效", groupname = "医技科主任" },
new { type = "临床科室", reference = "科室护士长人均绩效", groupname = "临床科护长" },
};
var groupList = from cp in computes
join gp in keyList on new { type = cp.AccountType, reference = cp.FitPeople } equals new { gp.type, gp.reference }
select new { gp.groupname, cp };
var result = groupList.GroupBy(t => t.groupname)
.Select(s => new res_baiscnorm
{
PositionName = s.Key,
TotelNumber = s.Count(),
TotelValue = s.Sum(t => t.cp.GiveFee),
AvgValue = s.Sum(t => t.cp.GiveFee) / s.Count()
});
return result.ToList();
} }
} }
} }
using Performance.DtoModels; using Performance.DtoModels;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Repository; using Performance.Repository;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
using System.Linq; using System.Linq;
using Performance.Infrastructure; using System.Text;
namespace Performance.Services.AllotCompute namespace Performance.Services.AllotCompute
{ {
...@@ -156,12 +156,7 @@ public bool CheckData(PerExcel excel, per_allot allot) ...@@ -156,12 +156,7 @@ public bool CheckData(PerExcel excel, per_allot allot)
if (sheet.SheetName.StartsWith("医院人员名单")) if (sheet.SheetName.StartsWith("医院人员名单"))
{ {
List<string> accountType = new List<string>() { "临床科室", "医技科室", "行政工勤", "行政中高层", "" }; List<string> accountType = new List<string>() { "临床科室", "医技科室", "行政工勤", "行政中高层", "" };
List<string> fitPeople = new List<string>(); List<string> fitPeople = EnumHelper.GetItems<PerforType>().Select(t => t.Description).ToList();
foreach (var name in EnumHelper.GetNames<PerformanceType>())
{
var a = (int)Enum.Parse(typeof(PerformanceType), name);
fitPeople.Add(EnumHelper.GetDescription((PerformanceType)a));
}
var dataList = sheet.PerData.Select(t => (PerDataEmployee)t); var dataList = sheet.PerData.Select(t => (PerDataEmployee)t);
foreach (var item in dataList) foreach (var item in dataList)
{ {
...@@ -209,7 +204,7 @@ public bool CheckData(PerExcel excel, per_allot allot) ...@@ -209,7 +204,7 @@ public bool CheckData(PerExcel excel, per_allot allot)
var dataList = sheet.PerData.Select(t => (PerDataAccountBaisc)t); var dataList = sheet.PerData.Select(t => (PerDataAccountBaisc)t);
foreach (var item in dataList) foreach (var item in dataList)
{ {
if (string.IsNullOrEmpty(item.AccountingUnit)) if (string.IsNullOrEmpty(item.AccountingUnit) && string.IsNullOrEmpty(item.Department))
{ {
flag = false; flag = false;
rowNumber.Add(item.RowNumber + 1); rowNumber.Add(item.RowNumber + 1);
......
...@@ -223,37 +223,93 @@ private List<PerSheet> MergeCompute(PerExcel excel, int allotid) ...@@ -223,37 +223,93 @@ private List<PerSheet> MergeCompute(PerExcel excel, int allotid)
var deptAccounting = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic); var deptAccounting = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic);
var dataList = deptAccounting.PerData.Select(t => (PerDataAccountBaisc)t); var dataList = deptAccounting.PerData.Select(t => (PerDataAccountBaisc)t);
var doctorSheet = ComputeDoctor(dataList, twiceEconomicResult.PerData, twiceWorkloadResult1.PerData);
perSheet.Add(doctorSheet);
var nurseSheet = ComputeNurse(dataList, twiceEconomicResult.PerData, twiceWorkloadResult2.PerData);
perSheet.Add(nurseSheet);
return perSheet;
}
/// <summary>
/// 计算医生组科室绩效
/// </summary>
/// <param name="dataList"></param>
/// <param name="economicData"></param>
/// <param name="workloadData"></param>
/// <returns></returns>
private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<PerData> economicData, List<PerData> workloadData)
{
PerSheet doctorSheet = new PerSheet("医生组临床科室单元核算表", "医生组临床科室单元核算表", SheetType.ComputeDoctorAccount, new List<PerHeader>(), new List<IPerData>()); PerSheet doctorSheet = new PerSheet("医生组临床科室单元核算表", "医生组临床科室单元核算表", SheetType.ComputeDoctorAccount, new List<PerHeader>(), new List<IPerData>());
PerSheet nurseSheet = new PerSheet("护理组临床科室单元核算表", "护理组临床科室单元核算表", SheetType.ComputeNurseAccount, new List<PerHeader>(), new List<IPerData>());
foreach (var dept in dataList) foreach (var dept in dataList)
{ {
var doctor = Mapper.Map<PerDataAccountDoctor>(dept); if (string.IsNullOrEmpty(dept.AccountingUnit)) continue;
var econDoctor = twiceEconomicResult.PerData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.AccountingUnit);
doctor.Income = econDoctor?.CellValue ?? 0;
var workDoctor = twiceWorkloadResult1.PerData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.AccountingUnit);
doctor.WorkloadFee = workDoctor?.CellValue ?? 0;
doctorSheet.PerData.Add(doctor);
var nurse = Mapper.Map<PerDataAccountNurse>(dept); var econDoctor = economicData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.AccountingUnit);
if (nurse.AdjustFactor == 0m) nurse.AdjustFactor = 1; var workDoctor = workloadData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.AccountingUnit);
if (nurse.ScoringAverage == 0m) nurse.ScoringAverage = 1; var doctor = new PerDataAccountDoctor
var econNurse = twiceEconomicResult.PerData.FirstOrDefault(t => t.UnitType == "护理组" && t.AccountingUnit == dept.AccountingUnit);
nurse.Income = econNurse?.CellValue ?? 0;
var workNurse = twiceWorkloadResult2.PerData.FirstOrDefault(t => t.UnitType == "护理组" && t.AccountingUnit == dept.AccountingUnit);
nurse.WorkloadFee = workNurse?.CellValue ?? 0;
if (nurse.PerforTotal == 0m && nurse.Extra == 0m && nurse.OtherPerfor2 == 0m && nurse.ScoringAverage == 1m && nurse.AdjustFactor == 1m)
{ {
nurse.AdjustFactor = 0; AccountingUnit = dept.AccountingUnit,
nurse.ScoringAverage = 0; Department = dept.AccountingUnit,
Number = dept.DoctorNumber,
BasicFactor = dept.DoctorBasicFactor,
SlopeFactor = dept.DoctorSlopeFactor,
OtherPerfor1 = dept.DoctorOtherPerfor1,
OtherPerfor2 = dept.DoctorOtherPerfor2,
Extra = dept.DoctorExtra,
ScoringAverage = dept.DoctorScoringAverage == 0m ? 1 : dept.DoctorScoringAverage,
AdjustFactor = dept.DoctorAdjustFactor == 0m ? 1 : dept.DoctorAdjustFactor,
Income = econDoctor?.CellValue ?? 0,
WorkloadFee = workDoctor?.CellValue ?? 0,
};
doctor.PerforFee = doctor.Income * (doctor.BasicFactor + (doctor.BasicFactor * doctor.SlopeFactor));
doctor.PerforTotal = doctor.PerforFee + doctor.WorkloadFee + doctor.OtherPerfor1;
doctor.RealGiveFee = (doctor.PerforTotal * doctor.ScoringAverage + doctor.Extra + doctor.OtherPerfor2) * doctor.AdjustFactor;
doctor.Avg = doctor.Number == 0 ? 0 : doctor.PerforTotal / doctor.Number;
doctorSheet.PerData.Add(doctor);
} }
nurseSheet.PerData.Add(nurse); return doctorSheet;
} }
perSheet.Add(doctorSheet);
perSheet.Add(nurseSheet);
return perSheet; /// <summary>
} /// 计算护理组科室绩效
/// </summary>
/// <param name="dataList"></param>
/// <param name="economicData"></param>
/// <param name="workloadData"></param>
private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<PerData> economicData, List<PerData> workloadData)
{
PerSheet nurseSheet = new PerSheet("护理组临床科室单元核算表", "护理组临床科室单元核算表", SheetType.ComputeNurseAccount, new List<PerHeader>(), new List<IPerData>());
foreach (var dept in dataList)
{
if (string.IsNullOrEmpty(dept.Department)) continue;
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.Department,
Department = dept.Department,
Number = dept.NurseNumber,
BasicFactor = dept.NurseBasicFactor,
SlopeFactor = dept.NurseSlopeFactor,
OtherPerfor1 = dept.NurseOtherPerfor1,
OtherPerfor2 = dept.NurseOtherPerfor2,
Extra = dept.NurseExtra,
ScoringAverage = dept.NurseScoringAverage == 0m ? 1 : dept.NurseScoringAverage,
AdjustFactor = dept.NurseAdjustFactor == 0m ? 1 : dept.NurseAdjustFactor,
Income = econNurse?.CellValue ?? 0,
WorkloadFee = workNurse?.CellValue ?? 0,
};
nurse.PerforFee = nurse.Income * (nurse.BasicFactor + (nurse.BasicFactor * nurse.SlopeFactor));
nurse.PerforTotal = nurse.PerforFee + nurse.WorkloadFee + nurse.OtherPerfor1;
nurse.RealGiveFee = (nurse.PerforTotal * nurse.ScoringAverage + nurse.Extra + nurse.OtherPerfor2) * nurse.AdjustFactor;
nurse.Avg = nurse.Number == 0 ? 0 : nurse.PerforTotal / nurse.Number;
nurseSheet.PerData.Add(nurse);
}
return nurseSheet;
}
/// <summary> /// <summary>
/// 获取药占比分割比例 /// 获取药占比分割比例
......
...@@ -15,32 +15,22 @@ namespace Performance.Services.AllotCompute ...@@ -15,32 +15,22 @@ namespace Performance.Services.AllotCompute
/// </summary> /// </summary>
public class ResultComputeService : IAutoInjection public class ResultComputeService : IAutoInjection
{ {
private BaiscNormService baiscNormService;
private ComputeDirector computeDirector; private ComputeDirector computeDirector;
private PerforImemployeeRepository perforImEmployeeRepository; private PerforImemployeeRepository perforImEmployeeRepository;
private PerforCofworkyearRepository perforCofworkyearRepository;
private PerforCofdirectorRepository perforCofdirectorRepository;
private PerforResaccountdoctorRepository perforResAccountdoctorRepository;
private PerforResaccountnurseRepository perforResAccountnurseRepository;
private PerforRescomputeRepository perforRescomputeRepository; private PerforRescomputeRepository perforRescomputeRepository;
private PerforResbaiscnormRepository perforResbaiscnormRepository; private PerforResbaiscnormRepository perforResbaiscnormRepository;
private PerforResspecialunitRepository perforResspecialunitRepository; private PerforResspecialunitRepository perforResspecialunitRepository;
public ResultComputeService( public ResultComputeService(
PerforImemployeeRepository perforImEmployeeRepository, PerforImemployeeRepository perforImEmployeeRepository,
PerforCofworkyearRepository perforCofworkyearRepository,
PerforCofdirectorRepository perforCofdirectorRepository,
PerforResaccountdoctorRepository perforResAccountdoctorRepository,
PerforResaccountnurseRepository perforResAccountnurseRepository,
PerforRescomputeRepository perforRescomputeRepository, PerforRescomputeRepository perforRescomputeRepository,
PerforResbaiscnormRepository perforResbaiscnormRepository, PerforResbaiscnormRepository perforResbaiscnormRepository,
PerforResspecialunitRepository perforResspecialunitRepository, PerforResspecialunitRepository perforResspecialunitRepository,
ComputeDirector computeDirector) BaiscNormService baiscNormService, ComputeDirector computeDirector)
{ {
this.baiscNormService = baiscNormService;
this.computeDirector = computeDirector; this.computeDirector = computeDirector;
this.perforImEmployeeRepository = perforImEmployeeRepository; this.perforImEmployeeRepository = perforImEmployeeRepository;
this.perforCofworkyearRepository = perforCofworkyearRepository;
this.perforCofdirectorRepository = perforCofdirectorRepository;
this.perforResAccountdoctorRepository = perforResAccountdoctorRepository;
this.perforResAccountnurseRepository = perforResAccountnurseRepository;
this.perforRescomputeRepository = perforRescomputeRepository; this.perforRescomputeRepository = perforRescomputeRepository;
this.perforResbaiscnormRepository = perforResbaiscnormRepository; this.perforResbaiscnormRepository = perforResbaiscnormRepository;
this.perforResspecialunitRepository = perforResspecialunitRepository; this.perforResspecialunitRepository = perforResspecialunitRepository;
...@@ -50,34 +40,22 @@ public class ResultComputeService : IAutoInjection ...@@ -50,34 +40,22 @@ public class ResultComputeService : IAutoInjection
/// 计算最终数据 /// 计算最终数据
/// </summary> /// </summary>
/// <param name="excel"></param> /// <param name="excel"></param>
public List<res_baiscnorm> Compute(per_allot allot, PerExcel excel, res_baiscnorm baiscnorm) public List<res_baiscnorm> Compute(per_allot allot, PerExcel excel, List<PerSheet> perSheets)
{ {
//取出人员信息 //取出人员信息
var empolyeeList = perforImEmployeeRepository.GetEntities(t => t.AllotID == allot.ID); var empolyeeList = perforImEmployeeRepository.GetEntities(t => t.AllotID == allot.ID);
//年资系数
var workyearList = perforCofworkyearRepository.GetEntities(t => t.AllotID == allot.ID);
//规模绩效和效率绩效配置表
var directorList = perforCofdirectorRepository.GetEntities(t => t.AllotID == allot.ID);
//取出医生科室
var doctorList = perforResAccountdoctorRepository.GetEntities(t => t.AllotID == allot.ID);
//取出护士科室
var nurseList = perforResAccountnurseRepository.GetEntities(t => t.AllotID == allot.ID);
List<ComputeEmployee> computeEmployees = Mapper.Map<List<ComputeEmployee>>(empolyeeList); List<ComputeEmployee> computeEmployees = Mapper.Map<List<ComputeEmployee>>(empolyeeList);
List<ComputeSource> computeSources = new List<ComputeSource>(); var computResult = computeDirector.Compute(computeEmployees, allot);
computeSources.AddRange(Mapper.Map<List<ComputeSource>>(doctorList));
computeSources.AddRange(Mapper.Map<List<ComputeSource>>(nurseList));
var computResult = computeDirector.Compute(computeEmployees, computeSources, directorList);
//计算 绩效标准 基数(科主任、副主任、护士长 =>> 平均值) //计算 绩效标准 基数(科主任、副主任、护士长 =>> 平均值)
var baiscnormList = computeDirector.ComputeAvg(computResult); List<res_baiscnorm> baiscnormList = new List<res_baiscnorm>();
baiscnormList.Add(baiscnorm); baiscNormService.ComputeAvg(baiscnormList, computResult, empolyeeList);
baiscNormService.NurseBaiscnorm(baiscnormList, perSheets);
var computResult2 = computeDirector.Compute(computeEmployees, baiscnormList, workyearList); var computResult2 = computeDirector.Compute(computeEmployees, allot, baiscnormList);
//计算 行政人员 平均值 //计算 行政人员 平均值
var baiscnormList2 = computeDirector.ComputeOtherAvg(computResult2); baiscNormService.ComputeOtherAvg(baiscnormList, computResult2, empolyeeList);
baiscnormList.AddRange(baiscnormList2);
var computes = Mapper.Map<List<res_compute>>(computResult); var computes = Mapper.Map<List<res_compute>>(computResult);
computes.AddRange(Mapper.Map<List<res_compute>>(computResult2)); computes.AddRange(Mapper.Map<List<res_compute>>(computResult2));
...@@ -101,41 +79,63 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno ...@@ -101,41 +79,63 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
var specialUnit = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.SpecialUnit); var specialUnit = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.SpecialUnit);
if (specialUnit == null || specialUnit.PerData.Count == 0) if (specialUnit == null || specialUnit.PerData.Count == 0)
return; return;
var typeList = EnumHelper.GetItems<PerforType>();
var dataList = specialUnit.PerData.Select(t => (PerDataSpecialUnit)t); var dataList = specialUnit.PerData.Select(t => (PerDataSpecialUnit)t);
BaiscNormService baiscNormService = new BaiscNormService(); //替换考核基数
foreach (var item in dataList)
var typeList = EnumHelper.GetItems<PerformanceType>();
List<res_specialunit> resDataList = new List<res_specialunit>();
foreach (var t in dataList)
{ {
var type = typeList.FirstOrDefault(o => o.Description == t.QuantitativeIndicators); var type = typeList.FirstOrDefault(o => o.Description == item.QuantitativeIndicators);
if (type != null) if (type != null)
{ {
var radio = perforImEmployeeRepository.GetEntities(p => p.FitPeople == EnumHelper.GetDescription((PerformanceType)type.Value) && p.AllotID == allot.ID) var radio = perforImEmployeeRepository.GetEntities(p => p.FitPeople == EnumHelper.GetDescription((PerforType)type.Value) && p.AllotID == allot.ID)
?.FirstOrDefault().FitPeopleRatio ?? 1; ?.FirstOrDefault().FitPeopleRatio ?? 1;
var basic = baiscNormService.GetBaiscNorm(baiscnormList, (PerformanceType)type.Value); var basic = baiscNormService.GetBaiscNorm(baiscnormList, (PerforType)type.Value);
t.Quantity = basic != null ? basic * radio : 0; //添加参数计算 // 添加参数计算
// 新都医院在特殊科室计算时,如果取核算基数计算时带入人数计算
item.Quantity = basic != null ? basic * radio * (!item.Number.HasValue || item.Number == 0 ? 1 : item.Number) : null;
} }
}
List<res_specialunit> resDataList = new List<res_specialunit>();
var groupSpeList = dataList.GroupBy(t => t.AccountingUnit).Select(t => new
{
AccountingUnit = t.Key,
Number = t.Sum(p => p.Number),
ScoringAverage = t.Sum(p => p.ScoringAverage),
OtherPerfor = t.Sum(p => p.OtherPerfor),
Punishment = t.Sum(p => p.Punishment),
Adjust = t.Sum(p => p.Adjust),
});
foreach (var group in groupSpeList)
{
//获取需要聚合的科室
var accountDataList = dataList.Where(t => t.AccountingUnit == group.AccountingUnit);
//计算量化指标子项合计
var sumValue = accountDataList.Sum(t => t.Quantity * t.QuantitativeIndicatorsValue);
foreach (var item in accountDataList)
{
var res = new res_specialunit var res = new res_specialunit
{ {
AllotID = allot.ID, AllotID = allot.ID,
AccountingUnit = t.AccountingUnit, AccountingUnit = group.AccountingUnit,
Department = t.AccountingUnit, Department = group.AccountingUnit,
Number = t.Number, Number = group.Number,
QuantitativeIndicators = t.QuantitativeIndicators, QuantitativeIndicators = item.QuantitativeIndicators,
Quantity = t.Quantity, Quantity = item.Quantity,
QuantitativeIndicatorsValue = t.QuantitativeIndicatorsValue, QuantitativeIndicatorsValue = item.QuantitativeIndicatorsValue,
ScoringAverage = t.ScoringAverage, ScoringAverage = group.ScoringAverage,
OtherPerfor = t.OtherPerfor, OtherPerfor = group.OtherPerfor,
Punishment = t.Punishment, Punishment = group.Punishment,
Adjust = t.Adjust ?? 1, Adjust = group.Adjust == 0 ? 1 : group.Adjust,
Avg = t.Number != 0 ? t.Quantity * t.QuantitativeIndicatorsValue / t.Number : null, Avg = group.Number != 0 ? sumValue / group.Number : null,
GiveFee = t.Quantity * t.QuantitativeIndicatorsValue, GiveFee = sumValue,
RealGiveFee = (t.Quantity * t.QuantitativeIndicatorsValue + (t.OtherPerfor ?? 0) + (t.Punishment ?? 0)) * (t.Adjust ?? 1), RealGiveFee = (sumValue + (group.OtherPerfor ?? 0) + (group.Punishment ?? 0)) * (group.Adjust == 0 ? 1 : group.Adjust),
}; };
resDataList.Add(res); resDataList.Add(res);
} }
}
perforResspecialunitRepository.AddRange(resDataList.ToArray()); perforResspecialunitRepository.AddRange(resDataList.ToArray());
} }
} }
......
...@@ -220,11 +220,11 @@ public void Generate(per_allot allot, string mail) ...@@ -220,11 +220,11 @@ public void Generate(per_allot allot, string mail)
logdbug.Add(allot.ID, "计算合并数据", JsonHelper.Serialize(allot)); logdbug.Add(allot.ID, "计算合并数据", JsonHelper.Serialize(allot));
List<PerSheet> list = processComputService.MergeAndSave(excel, allot); List<PerSheet> list = processComputService.MergeAndSave(excel, allot);
var baiscnorm = baiscNormService.NurseBaiscnorm(list); //var baiscnorm = baiscNormService.NurseBaiscnorm(list);
logdbug.Add(allot.ID, "护士平均绩效", JsonHelper.Serialize(baiscnorm)); //logdbug.Add(allot.ID, "护士平均绩效", JsonHelper.Serialize(baiscnorm));
// 计算最总数据 // 计算最总数据
logdbug.Add(allot.ID, "绩效结果计算数据开始", ""); logdbug.Add(allot.ID, "绩效结果计算数据开始", "");
var baiscnormList = resultComputeService.Compute(allot, excel, baiscnorm); var baiscnormList = resultComputeService.Compute(allot, excel, list);
resultComputeService.SpecialUnitCompute(excel, allot, baiscnormList); resultComputeService.SpecialUnitCompute(excel, allot, baiscnormList);
_allotRepository.UpdateAllotStates(allot.ID, (int)AllotStates.GenerateSucceed, EnumHelper.GetDescription(AllotStates.GenerateSucceed)); _allotRepository.UpdateAllotStates(allot.ID, (int)AllotStates.GenerateSucceed, EnumHelper.GetDescription(AllotStates.GenerateSucceed));
......
...@@ -51,27 +51,40 @@ public class ComputeService : IAutoInjection ...@@ -51,27 +51,40 @@ public class ComputeService : IAutoInjection
public List<ResComputeResponse> GetCompute(int allotId, int type) public List<ResComputeResponse> GetCompute(int allotId, int type)
{ {
var data = new List<ResComputeResponse>(); var data = new List<ResComputeResponse>();
Dictionary<int, List<PerformanceType>> keyValues = new Dictionary<int, List<PerformanceType>> List<res_compute> conpute = new List<res_compute>();
if ((new int[] { 1, 2, 3 }).Contains(type))
{
var keyValues2 = new[]
{ {
{ 1,new List<PerformanceType>{ PerformanceType.ReferenceDirector } }, new { type = 1, accounttype = AccountUnitType.行政高层 },
{ 2,new List<PerformanceType>{ PerformanceType.ReferenceDirectorAvg } }, new { type = 2, accounttype = AccountUnitType.行政中层 },
{ 3,new List<PerformanceType>{ PerformanceType.LogisticsWorker, PerformanceType.ReferenceHeadNurse, PerformanceType.ReferenceNurse, PerformanceType.Null } }, new { type = 3, accounttype = AccountUnitType.行政工勤 },
{ 4,new List<PerformanceType>{ PerformanceType.ReferenceDoctor, PerformanceType.StandardDeputyDirector } },
{ 5,new List<PerformanceType>{ PerformanceType.ReferenceNurse } }
}; };
var obj = keyValues2.First(t => t.type == type);
if (keyValues.ContainsKey(type)) conpute = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId && t.AccountType == obj.accounttype.ToString())
?.OrderBy(t => t.AccountingUnit).ThenBy(t => t.FitPeople).ToList();
}
else if ((new int[] { 4, 5 }).Contains(type))
{
var types = new PerforType[] { PerforType.临床主任, PerforType.临床副主任, PerforType.医技主任, PerforType.医技副主任 };
var keyValues2 = new[]
{ {
var conList = keyValues[type].Select(t => EnumHelper.GetDescription(t)); new { type = 4, accounttype = types.Select(t=>EnumHelper.GetDescription(t)).ToList() },
var list = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId && conList.Contains(t.FitPeople)) new { type = 5, accounttype = new List<string>{ EnumHelper.GetDescription(PerforType.护士长) }},
};
var obj = keyValues2.First(t => t.type == type);
var dept = new string[] { AccountUnitType.临床科室.ToString(), AccountUnitType.医技科室.ToString() };
conpute = _perforRescomputeRepository
.GetEntities(t => t.AllotID == allotId && dept.Contains(t.AccountType) && obj.accounttype.Contains(t.FitPeople))
?.OrderBy(t => t.AccountingUnit).ThenBy(t => t.FitPeople).ToList(); ?.OrderBy(t => t.AccountingUnit).ThenBy(t => t.FitPeople).ToList();
data = Mapper.Map<List<ResComputeResponse>>(list);
data?.ForEach(t => t.WorkTime = string.IsNullOrEmpty(t.WorkTime) ? null : Convert.ToDateTime(t.WorkTime).ToString("yyyy-MM-dd"));
} }
else else
{ {
throw new PerformanceException("参数错误,type无效"); throw new PerformanceException("参数错误,type无效");
} }
data = Mapper.Map<List<ResComputeResponse>>(conpute);
data?.ForEach(t => t.WorkTime = string.IsNullOrEmpty(t.WorkTime) ? null : Convert.ToDateTime(t.WorkTime).ToString("yyyy-MM-dd"));
return data; return data;
} }
...@@ -83,8 +96,13 @@ public List<ResComputeResponse> GetCompute(int allotId, int type) ...@@ -83,8 +96,13 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
public List<res_specialunit> GetSpecial(int allotId) public List<res_specialunit> GetSpecial(int allotId)
{ {
var list = _perforResspecialunitRepository.GetEntities(t => t.AllotID == allotId); var list = _perforResspecialunitRepository.GetEntities(t => t.AllotID == allotId);
if (list != null && list.Any())
{
list = list.OrderBy(t => t.AccountingUnit).ToList();
return Mapper.Map<List<res_specialunit>>(list); return Mapper.Map<List<res_specialunit>>(list);
} }
return new List<res_specialunit>();
}
/// <summary> /// <summary>
/// 返回医生组科室绩效 /// 返回医生组科室绩效
......
using Performance.DtoModels; using Performance.DtoModels;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Repository;
using Performance.Services.AllotCompute; using Performance.Services.AllotCompute;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -14,10 +15,23 @@ namespace Performance.Services ...@@ -14,10 +15,23 @@ namespace Performance.Services
/// </summary> /// </summary>
public class ComputeDirector : IAutoInjection public class ComputeDirector : IAutoInjection
{ {
private BaiscNormService baiscNormService; private readonly BaiscNormService baiscNormService;
public ComputeDirector(BaiscNormService baiscNormService) private readonly PerforCofdirectorRepository perforCofdirectorRepository;
private readonly PerforCofworkyearRepository perforCofworkyearRepository;
private readonly PerforResaccountnurseRepository perforResAccountnurseRepository;
private readonly PerforResaccountdoctorRepository perforResAccountdoctorRepository;
public ComputeDirector(BaiscNormService baiscNormService,
PerforCofdirectorRepository perforCofdirectorRepository,
PerforCofworkyearRepository perforCofworkyearRepository,
PerforResaccountnurseRepository perforResAccountnurseRepository,
PerforResaccountdoctorRepository perforResAccountdoctorRepository)
{ {
this.baiscNormService = baiscNormService; this.baiscNormService = baiscNormService;
this.perforCofdirectorRepository = perforCofdirectorRepository;
this.perforCofworkyearRepository = perforCofworkyearRepository;
this.perforResAccountnurseRepository = perforResAccountnurseRepository;
this.perforResAccountdoctorRepository = perforResAccountdoctorRepository;
} }
/// <summary> /// <summary>
...@@ -27,24 +41,57 @@ public ComputeDirector(BaiscNormService baiscNormService) ...@@ -27,24 +41,57 @@ public ComputeDirector(BaiscNormService baiscNormService)
/// <param name="nurseList"></param> /// <param name="nurseList"></param>
/// <param name="directorList"></param> /// <param name="directorList"></param>
/// <returns></returns> /// <returns></returns>
public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<ComputeSource> nurseList, List<cof_director> directorList) public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot allot)
{
Dictionary<PerformanceType, string> keyValues = new Dictionary<PerformanceType, string>
{ {
{ PerformanceType.StandardDirector, "临床科室主任"}, //规模绩效和效率绩效配置表
{ PerformanceType.StandardDeputyDirector, "临床科室副主任"}, var directorList = perforCofdirectorRepository.GetEntities(t => t.AllotID == allot.ID);
{ PerformanceType.StandardNurse, "临床科室护士长"}, //取出医生科室
}; var doctorList = perforResAccountdoctorRepository.GetEntities(t => t.AllotID == allot.ID);
//取出护士科室
var nurseList = perforResAccountnurseRepository.GetEntities(t => t.AllotID == allot.ID);
List<ComputeResult> computeList = new List<ComputeResult>(); List<ComputeResult> computeList = new List<ComputeResult>();
foreach (var key in keyValues.Keys) // 主任及护士长 对应 效率绩效/规模绩效 关系
// 科室名称 确定绩效计算人员中的人群
// 绩效考核基数参考对象 确定科室下那些考核对象归纳为 科室主任 护士长
// 数据库存放的文本 与枚举 全文字中文匹配
var basicRuleList = new[]
{
new { AccountUnitType = AccountUnitType.临床科室, PerforType = PerforType.临床主任, DirectorType = DirectorType.临床科室主任 },
new { AccountUnitType = AccountUnitType.临床科室, PerforType = PerforType.临床副主任, DirectorType = DirectorType.临床科室副主任 },
new { AccountUnitType = AccountUnitType.医技科室, PerforType = PerforType.医技主任, DirectorType = DirectorType.医技科室主任 },
new { AccountUnitType = AccountUnitType.医技科室, PerforType = PerforType.医技副主任, DirectorType = DirectorType.医技科室副主任 },
new { AccountUnitType = AccountUnitType.临床科室, PerforType = PerforType.护士长, DirectorType = DirectorType.临床科室护士长 },
};
foreach (var basicRule in basicRuleList)
{ {
var needCompute = empolyeeList.Where(t => t.FitPeople == EnumHelper.GetDescription(key)); var needCompute = empolyeeList.Where(t => t.AccountType == basicRule.AccountUnitType.ToString() && t.FitPeople.Trim() == EnumHelper.GetDescription(basicRule.PerforType));
foreach (var item in needCompute) foreach (var item in needCompute)
{ {
//分别取出对应的 计算 人员 平均值等信息
decimal? number, perforTotal, avg;
if (basicRule.PerforType == PerforType.护士长)
{
var resAccount = nurseList.FirstOrDefault(t => t.AccountingUnit == item.AccountingUnit); var resAccount = nurseList.FirstOrDefault(t => t.AccountingUnit == item.AccountingUnit);
var efficiency = directorList.FirstOrDefault(t => t.TypeName == "效率绩效" && t.JobTitle == keyValues[key]); number = resAccount?.Number;
var scale = directorList.FirstOrDefault(t => t.TypeName == "规模绩效" && t.JobTitle == keyValues[key]); perforTotal = resAccount?.PerforTotal;
avg = resAccount?.Avg;
}
else
{
var resAccount = doctorList.FirstOrDefault(t => t.AccountingUnit == item.AccountingUnit);
number = resAccount?.Number;
perforTotal = resAccount?.PerforTotal;
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 efficAccount = directorList.FirstOrDefault(t => t.TypeName == "效率绩效" && t.JobTitle == item.AccountingUnit);
var scaleAccount = directorList.FirstOrDefault(t => t.TypeName == "规模绩效" && t.JobTitle == item.AccountingUnit);
var compute = new ComputeResult var compute = new ComputeResult
{ {
AccountType = item.AccountType, AccountType = item.AccountType,
...@@ -53,11 +100,11 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<Comp ...@@ -53,11 +100,11 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<Comp
FitPeople = item.FitPeople, FitPeople = item.FitPeople,
JobTitle = item.JobTitle, JobTitle = item.JobTitle,
Number = resAccount?.Number, Number = number,
PerforTotal = resAccount?.PerforTotal, PerforTotal = perforTotal,
Avg = resAccount?.Avg, Avg = avg,
Efficiency = efficiency?.Value * resAccount?.Avg, Efficiency = avg * efficiency?.Value * (efficAccount?.Value ?? 1),
Scale = scale?.Value * resAccount?.PerforTotal, Scale = perforTotal * scale?.Value * (scaleAccount?.Value ?? 1),
Grant = item.Grant ?? 1, Grant = item.Grant ?? 1,
ScoreAverageRate = item.ScoreAverageRate, ScoreAverageRate = item.ScoreAverageRate,
Punishment = item.Punishment, Punishment = item.Punishment,
...@@ -66,17 +113,19 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<Comp ...@@ -66,17 +113,19 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<Comp
Workload = item.Workload Workload = item.Workload
}; };
//应发管理绩效 //应发管理绩效
compute.ShouldGiveFee = (efficiency?.Value * resAccount?.Avg + scale?.Value * resAccount?.PerforTotal) * (item.Grant ?? 1); compute.ShouldGiveFee = (compute.Efficiency + compute.Scale) * (item.Grant ?? 1);
//绩效合计 //绩效合计
var perforSumFee = (compute.Avg + compute.Efficiency + compute.Scale) * (item.Grant ?? 1); var perforSumFee = (compute.Avg + compute.Efficiency + compute.Scale) * (item.Grant ?? 1);
if (perforSumFee > (compute.Avg ?? 0) * 2.5m) // 在科主任护士长绩效测试时,有特殊情况需要乘一个基数
compute.PerforSumFee = (compute.Avg ?? 0) * 2.5m; //if (perforSumFee > (compute.Avg ?? 0) * 2.5m)
else // compute.PerforSumFee = (compute.Avg ?? 0) * 2.5m;
//else
compute.PerforSumFee = perforSumFee; compute.PerforSumFee = perforSumFee;
//应发绩效 //应发绩效
compute.GiveFee = compute.Avg * (item.Grant ?? 1) + (compute.Efficiency + compute.Scale) * (item.Grant ?? 1) * compute.ScoreAverageRate + (item.Punishment ?? 0) + (item.OtherPerfor ?? 0); compute.GiveFee = compute.Avg * (item.Grant ?? 1) + (compute.Efficiency + compute.Scale) * (item.Grant ?? 1) * compute.ScoreAverageRate + (item.Punishment ?? 0) + (item.OtherPerfor ?? 0);
//实发绩效 //实发绩效
compute.RealGiveFee = compute.GiveFee * (item.Adjust ?? 1m) - compute.ShouldGiveFee * item.ScoreAverageRate * (item.Grant ?? 1) * 0.1m; //compute.RealGiveFee = compute.GiveFee * (item.Adjust ?? 1m) - compute.ShouldGiveFee * item.ScoreAverageRate * (item.Grant ?? 1) * 0.1m;
compute.RealGiveFee = compute.GiveFee;
computeList.Add(compute); computeList.Add(compute);
} }
...@@ -85,99 +134,24 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<Comp ...@@ -85,99 +134,24 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<Comp
} }
/// <summary> /// <summary>
/// 绩效标准计算
/// </summary>
/// <param name="computes"></param>
/// <returns></returns>
public List<res_baiscnorm> ComputeAvg(List<ComputeResult> computes)
{
var keyList = new[]
{
//绩效基数平均值项目
new { type = "临床科室", reference = EnumHelper.GetDescription(PerformanceType.StandardDirector), groupname = "临床科主任" },
new { type = "临床科室", reference = EnumHelper.GetDescription(PerformanceType.StandardDeputyDirector), groupname = "临床科副主任" },
new { type = "医技科室", reference = EnumHelper.GetDescription(PerformanceType.StandardDirector), groupname = "医技科主任" },
new { type = "医技科室", reference = EnumHelper.GetDescription(PerformanceType.StandardDeputyDirector), groupname = "医技科副主任" },
new { type = "临床科室", reference = EnumHelper.GetDescription(PerformanceType.StandardNurse), groupname = "临床科护长" },
};
var groupList = from cp in computes
join gp in keyList on new { type = cp.AccountType, reference = cp.FitPeople } equals new { gp.type, gp.reference }
select new { gp.groupname, cp };
var result = groupList.GroupBy(t => t.groupname)
.Select(s => new res_baiscnorm
{
PositionName = s.Key,
TotelNumber = s.Count(),
TotelValue = s.Sum(t => t.cp.GiveFee),
AvgValue = s.Sum(t => t.cp.GiveFee) / s.Count()
});
return result.ToList();
}
/// <summary>
/// 绩效标准计算
/// </summary>
/// <param name="computes"></param>
/// <returns></returns>
public List<res_baiscnorm> ComputeOtherAvg(List<ComputeResult> computes)
{
var keyList = new[]
{
//行政绩效平均值项目
new { type = "行政中高层", groupname = "行政中高层" },
new { type = "行政高层", groupname = "行政高层" },
new { type = "行政中层", groupname = "行政中层" },
new { type = "行政工勤", groupname = "行政工勤" },
};
var groupList = from cp in computes
join gp in keyList on cp.AccountType equals gp.type
select new { gp.groupname, cp };
var result = groupList.GroupBy(t => t.groupname)
.Select(s => new res_baiscnorm
{
PositionName = s.Key,
TotelNumber = s.Count(),
TotelValue = s.Sum(t => t.cp.GiveFee),
AvgValue = s.Sum(t => t.cp.GiveFee) / s.Count()
});
return result.ToList();
}
/// <summary>
/// 院领导、业务中层、工勤人员 计算 /// 院领导、业务中层、工勤人员 计算
/// </summary> /// </summary>
/// <param name="empolyeeList"></param> /// <param name="empolyeeList"></param>
/// <param name="baiscnormList"></param> /// <param name="baiscnormList"></param>
/// <returns></returns> /// <returns></returns>
public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<res_baiscnorm> baiscnormList, List<cof_workyear> workyearList) public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot allot, List<res_baiscnorm> baiscnormList)
{
PerformanceType[] types = new PerformanceType[]
{ {
PerformanceType.ReferenceDirector, //年资系数
PerformanceType.ReferenceDirectorAvg, var workyearList = perforCofworkyearRepository.GetEntities(t => t.AllotID == allot.ID);
PerformanceType.ReferenceNurse,
PerformanceType.ReferenceHeadNurse,
PerformanceType.Null,
};
PerformanceType[] yearTypes = new PerformanceType[]
{
PerformanceType.ReferenceNurse,
PerformanceType.ReferenceHeadNurse,
PerformanceType.Null,
};
List<ComputeResult> computeList = new List<ComputeResult>(); List<ComputeResult> computeList = new List<ComputeResult>();
foreach (var type in types) List<string> involve = new List<string> { AccountUnitType.行政高层.ToString(), AccountUnitType.行政中层.ToString(), AccountUnitType.行政工勤.ToString() };
{ var needCompute = empolyeeList.Where(t => involve.Contains(t.AccountType));
var needCompute = empolyeeList.Where(t => t.FitPeople == EnumHelper.GetDescription(type));
if (!needCompute.Any())
continue;
var baiscnorm = baiscNormService.GetBaiscNorm(baiscnormList, type);
if (!needCompute.Any()) return computeList;
var perforTypeArray = EnumHelper.GetItems<PerforType>();
foreach (var item in needCompute) foreach (var item in needCompute)
{ {
var compute = new ComputeResult var compute = new ComputeResult
...@@ -188,7 +162,6 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<res_ ...@@ -188,7 +162,6 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<res_
FitPeople = item.FitPeople, FitPeople = item.FitPeople,
Grant = item.Grant ?? 1, Grant = item.Grant ?? 1,
WorkTime = item.WorkTime, WorkTime = item.WorkTime,
BaiscNormValue = baiscnorm * (item.FitPeopleRatio ?? 1), //添加参数计算
PostCoefficient = item.PostCoefficient, PostCoefficient = item.PostCoefficient,
Attendance = item.Attendance, Attendance = item.Attendance,
ScoreAverageRate = item.ScoreAverageRate, ScoreAverageRate = item.ScoreAverageRate,
...@@ -199,21 +172,32 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<res_ ...@@ -199,21 +172,32 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<res_
Workload = item.Workload Workload = item.Workload
}; };
decimal? baiscnorm = 1;
var perforTypeItem = perforTypeArray.FirstOrDefault(t => t.Description == item.FitPeople);
if (perforTypeItem != null)
{
var perforType = (PerforType)perforTypeItem.Value;
baiscnorm = baiscNormService.GetBaiscNorm(baiscnormList, perforType);
//年资系数 //年资系数
if (yearTypes.Contains(type) && item.WorkTime.HasValue && item.WorkTime.Value > new DateTime(1970, 1, 1)) if (item.FitPeople == AccountUnitType.行政工勤.ToString() && item.WorkTime.HasValue && item.WorkTime.Value > new DateTime(1970, 1, 1))
{ {
var years = ((DateTime.Now.Year - item.WorkTime.Value.Year) * 12 + (DateTime.Now.Month - item.WorkTime.Value.Month)) / 12.0m; var years = ((DateTime.Now.Year - item.WorkTime.Value.Year) * 12 + (DateTime.Now.Month - item.WorkTime.Value.Month)) / 12.0m;
var value = workyearList.FirstOrDefault(t => t.MinRange < years && years <= t.MaxRange)?.Value; var value = workyearList.FirstOrDefault(t => t.MinRange < years && years <= t.MaxRange)?.Value;
compute.WorkYear = value; compute.WorkYear = value;
} }
}
//添加参数计算
compute.BaiscNormValue = baiscnorm * (item.FitPeopleRatio ?? 1);
//应发绩效 //应发绩效
compute.GiveFee = baiscnorm * compute.PostCoefficient * compute.Attendance * compute.ScoreAverageRate * (compute.WorkYear ?? 1) + (compute.OtherPerfor ?? 0) + (item.Workload ?? 0) + (compute.Punishment ?? 0); compute.GiveFee = compute.BaiscNormValue * (compute.PostCoefficient + item.Adjust ?? 0)
* (item.Grant ?? 1) * compute.Attendance * compute.ScoreAverageRate * (compute.WorkYear ?? 1)
+ (compute.OtherPerfor ?? 0) + (item.Workload ?? 0) + (compute.Punishment ?? 0);
//实发绩效 //实发绩效
var adjust = item.Adjust ?? 1m; compute.RealGiveFee = compute.GiveFee;
compute.RealGiveFee = compute.GiveFee * adjust * (item.Grant ?? 1);
computeList.Add(compute); computeList.Add(compute);
} }
}
return computeList; return computeList;
} }
} }
......
...@@ -13,6 +13,8 @@ public class NopiSevice ...@@ -13,6 +13,8 @@ public class NopiSevice
{ {
if (cell != null) if (cell != null)
{ {
try
{
switch (cell.CellType) switch (cell.CellType)
{ {
case CellType.Numeric: case CellType.Numeric:
...@@ -23,6 +25,11 @@ public class NopiSevice ...@@ -23,6 +25,11 @@ public class NopiSevice
return ConvertHelper.To<decimal?>(cell.NumericCellValue); return ConvertHelper.To<decimal?>(cell.NumericCellValue);
} }
} }
catch (Exception ex)
{
//throw ex;
}
}
return null; return null;
} }
......
...@@ -75,109 +75,5 @@ public SheetType GetSheetType(string sheetName) ...@@ -75,109 +75,5 @@ public SheetType GetSheetType(string sheetName)
return SheetType.SpecialUnit; return SheetType.SpecialUnit;
return SheetType.Unidentifiable; return SheetType.Unidentifiable;
} }
internal List<PerSheet> ProcessCompute(PerExcel excel, int allotid)
{
List<PerSheet> perSheet = new List<PerSheet>();
//合并科室收入、支出
var incomeconfs = _perforCofincomeRepository.GetEntities();
var economicCompute = new PerSheetDataComputeEconomic();
var mergeResult = economicCompute.MergeCompute(excel, incomeconfs);
//一次计算
var onceEconomic = economicCompute.OnceCompute(mergeResult);
//二次计算
var twiceEconomicResult = economicCompute.TwiceCompute(onceEconomic);
twiceEconomicResult.Sheet.SheetType = SheetType.ComputeEconomic;
perSheet.Add(twiceEconomicResult.Sheet);
//工作量
var workloadCompute = new PerSheetDataComputeWorkload();
var workload1 = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.Workload && t.SheetName.Contains("医生组"));
workload1.SheetName = "医生组工作量绩效测算表";
var confs = GetDrugConfig(excel, allotid);
//医生组 一次计算
var onceWorkload1 = workloadCompute.OnceCompute(workload1, confs);
//医生组 二次计算
var twiceWorkloadResult1 = workloadCompute.TwiceCompute(onceWorkload1);
twiceWorkloadResult1.Sheet.SheetType = SheetType.ComputeDoctorWorkload;
perSheet.Add(twiceWorkloadResult1.Sheet);
var workload2 = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.Workload && t.SheetName.Contains("护理组"));
workload2.SheetName = "护理组工作量绩效测算表";
//护理组 一次计算
var onceWorkload2 = workloadCompute.OnceCompute(workload2);
//护理组 二次计算
var twiceWorkloadResult2 = workloadCompute.TwiceCompute(onceWorkload2);
twiceWorkloadResult2.Sheet.SheetType = SheetType.ComputeNurseWorkload;
perSheet.Add(twiceWorkloadResult2.Sheet);
var deptAccounting = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic);
var dataList = deptAccounting.PerData.Select(t => (PerDataAccountBaisc)t);
PerSheet doctorSheet = new PerSheet("医生组临床科室单元核算表", "医生组临床科室单元核算表", SheetType.ComputeDoctorAccount, new List<PerHeader>(), new List<IPerData>());
PerSheet nurseSheet = new PerSheet("护理组临床科室单元核算表", "护理组临床科室单元核算表", SheetType.ComputeNurseAccount, new List<PerHeader>(), new List<IPerData>());
foreach (var dept in dataList)
{
var doctor = Mapper.Map<PerDataAccountDoctor>(dept);
var econDoctor = twiceEconomicResult.PerData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.AccountingUnit);
doctor.Income = econDoctor?.CellValue ?? 0;
var workDoctor = twiceWorkloadResult1.PerData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.AccountingUnit);
doctor.WorkloadFee = workDoctor?.CellValue ?? 0;
doctorSheet.PerData.Add(doctor);
var nurse = Mapper.Map<PerDataAccountNurse>(dept);
var econNurse = twiceEconomicResult.PerData.FirstOrDefault(t => t.UnitType == "护理组" && t.AccountingUnit == dept.AccountingUnit);
nurse.Income = econNurse?.CellValue ?? 0;
var workNurse = twiceWorkloadResult2.PerData.FirstOrDefault(t => t.UnitType == "护理组" && t.AccountingUnit == dept.AccountingUnit);
nurse.WorkloadFee = workNurse?.CellValue ?? 0;
nurseSheet.PerData.Add(nurse);
}
perSheet.Add(doctorSheet);
perSheet.Add(nurseSheet);
return perSheet;
}
/// <summary>
/// 获取药占比分割比例
/// </summary>
/// <param name="excel"></param>
/// <returns></returns>
private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
{
//计算药占比
List<CofDrugProp> cofs = new List<CofDrugProp>();
var incomeSheet = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.Income && t.SheetName.Contains("门诊") && t.SheetName.Contains("就诊"));
var datalist = incomeSheet.PerData.Select(t => (PerData)t);
var drugtype = _perforCofdrugtypeRepository.GetEntities(t => t.AllotID == allotid)?.Select(t => t.Charge).ToList();
var drugData = datalist.Where(t => drugtype.Contains(t.TypeName)).GroupBy(t => t.AccountingUnit).Select(t => new { AccountingUnit = t.Key, SumValue = t.Sum(s => s.CellValue) });
var allData = datalist.GroupBy(t => t.AccountingUnit).Select(t => new { AccountingUnit = t.Key, SumValue = t.Sum(s => s.CellValue) });
var cofList = _perforCofdrugpropRepository.GetEntities();
var unitList = drugData.Select(t => t.AccountingUnit).Union(allData.Select(t => t.AccountingUnit));
foreach (var unit in unitList)
{
var dsv = drugData.FirstOrDefault(t => t.AccountingUnit == unit)?.SumValue;
var asv = allData.FirstOrDefault(t => t.AccountingUnit == unit)?.SumValue;
var prop = asv.HasValue && asv.Value > 0 ? Math.Round((dsv ?? 0) / asv.Value, 2) : 0;
var fvalue = prop == 0
? 0
: cofList.FirstOrDefault(t => prop > t.MinRange && prop <= t.MaxRange)?.Value ?? 0;
cofs.Add(new CofDrugProp { AccoutingUnit = unit, Factor = fvalue, Prop = prop });
}
return cofs;
}
} }
} }
...@@ -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 => t.CellValue.HasValue && t.CellValue.Value > 0) var ds = group.Where(t => !string.IsNullOrWhiteSpace(t.AccountingUnit) && t.CellValue.HasValue && t.CellValue.Value > 0)
.GroupBy(t => t.AccountingUnit).Select(t => new PerData .GroupBy(t => t.AccountingUnit).Select(t => new PerData
{ {
SignID = childHeader.SignID, SignID = childHeader.SignID,
......
...@@ -30,12 +30,10 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -30,12 +30,10 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
var row = sheet.GetRow(r); var row = sheet.GetRow(r);
if (row == null) continue; if (row == null) continue;
var accountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.ToString();
PerDataAccountBaisc unifyUnit = new PerDataAccountBaisc(); PerDataAccountBaisc unifyUnit = new PerDataAccountBaisc();
unifyUnit.RowNumber = r; unifyUnit.RowNumber = r;
unifyUnit.AccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.ToString(); unifyUnit.AccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元(医生组)").PointCell)?.ToString();
unifyUnit.Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室").PointCell)?.ToString(); unifyUnit.Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元(护理组)").PointCell)?.ToString();
unifyUnit.DoctorNumber = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元医生数量" && p.Parent.CellValue == "医生组").PointCell)?.ToString()); unifyUnit.DoctorNumber = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元医生数量" && p.Parent.CellValue == "医生组").PointCell)?.ToString());
unifyUnit.DoctorBasicFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "基础系数" && p.Parent.CellValue == "医生组").PointCell)?.ToString()); unifyUnit.DoctorBasicFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "基础系数" && p.Parent.CellValue == "医生组").PointCell)?.ToString());
unifyUnit.DoctorSlopeFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "倾斜系数" && p.Parent.CellValue == "医生组").PointCell)?.ToString()); unifyUnit.DoctorSlopeFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "倾斜系数" && p.Parent.CellValue == "医生组").PointCell)?.ToString());
...@@ -44,6 +42,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -44,6 +42,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
unifyUnit.DoctorExtra = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医院奖罚" && p.Parent.CellValue == "医生组").PointCell)?.ToString()); unifyUnit.DoctorExtra = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医院奖罚" && p.Parent.CellValue == "医生组").PointCell)?.ToString());
unifyUnit.DoctorScoringAverage = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "考核得分率" && p.Parent.CellValue == "医生组").PointCell)?.ToString()); unifyUnit.DoctorScoringAverage = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "考核得分率" && p.Parent.CellValue == "医生组").PointCell)?.ToString());
unifyUnit.DoctorAdjustFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "调节系数" && p.Parent.CellValue == "医生组").PointCell)?.ToString()); unifyUnit.DoctorAdjustFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "调节系数" && p.Parent.CellValue == "医生组").PointCell)?.ToString());
unifyUnit.NurseNumber = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元护士数量" && p.Parent.CellValue == "护理组").PointCell)?.ToString()); unifyUnit.NurseNumber = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元护士数量" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
unifyUnit.NurseBasicFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "基础系数" && p.Parent.CellValue == "护理组").PointCell)?.ToString()); unifyUnit.NurseBasicFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "基础系数" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
unifyUnit.NurseSlopeFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "倾斜系数" && p.Parent.CellValue == "护理组").PointCell)?.ToString()); unifyUnit.NurseSlopeFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "倾斜系数" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
......
...@@ -21,7 +21,8 @@ public class PerSheetDataReadSpecialUnit : IPerSheetDataRead ...@@ -21,7 +21,8 @@ public class PerSheetDataReadSpecialUnit : IPerSheetDataRead
public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{ {
List<IPerData> dataList = new List<IPerData>(); List<IPerData> dataList = new List<IPerData>();
// 特殊科室多科室聚合,合并时保留科室名称
string lastAccount = "";
for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++) for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{ {
var row = sheet.GetRow(r); var row = sheet.GetRow(r);
...@@ -29,12 +30,12 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -29,12 +30,12 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
var accountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室").PointCell)?.ToString(); var accountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室").PointCell)?.ToString();
if (string.IsNullOrEmpty(accountingUnit)) if (string.IsNullOrEmpty(accountingUnit))
continue; accountingUnit = lastAccount;
PerDataSpecialUnit employee = new PerDataSpecialUnit PerDataSpecialUnit employee = new PerDataSpecialUnit
{ {
RowNumber = r, RowNumber = r,
AccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室").PointCell)?.ToString(), AccountingUnit = accountingUnit,
Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室").PointCell)?.ToString(), Department = accountingUnit,
Number = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人数").PointCell)?.ToString()), Number = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人数").PointCell)?.ToString()),
QuantitativeIndicators = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "量化指标").PointCell)?.ToString(), QuantitativeIndicators = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "量化指标").PointCell)?.ToString(),
Quantity = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "数量").PointCell)?.ToString()), Quantity = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "数量").PointCell)?.ToString()),
...@@ -45,6 +46,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -45,6 +46,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
Adjust = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "调节系数").PointCell)?.ToString()), Adjust = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "调节系数").PointCell)?.ToString()),
}; };
dataList.Add(employee); dataList.Add(employee);
lastAccount = employee.AccountingUnit;
} }
return dataList; return dataList;
......
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