Commit b32a9070 by 李承祥

Merge branch 'develop' of http://192.168.18.110:8880/zry/performance into develop

parents f4499c43 9fc2d5d3
...@@ -66,15 +66,15 @@ public class ComputeEmployee ...@@ -66,15 +66,15 @@ public class ComputeEmployee
/// </summary> /// </summary>
public Nullable<decimal> Attendance { get; set; } public Nullable<decimal> Attendance { get; set; }
/// <summary> ///// <summary>
/// 核算单元医生数 ///// 核算单元医生数
/// </summary> ///// </summary>
public Nullable<int> PeopleNumber { get; set; } //public Nullable<int> PeopleNumber { get; set; }
/// <summary> ///// <summary>
/// 工作量绩效 ///// 工作量绩效
/// </summary> ///// </summary>
public Nullable<decimal> Workload { get; set; } //public Nullable<decimal> Workload { get; set; }
/// <summary> /// <summary>
/// 其他绩效 /// 其他绩效
...@@ -91,9 +91,9 @@ public class ComputeEmployee ...@@ -91,9 +91,9 @@ public class ComputeEmployee
/// </summary> /// </summary>
public Nullable<decimal> Adjust { get; set; } public Nullable<decimal> Adjust { get; set; }
/// <summary> ///// <summary>
/// 发放系数 ///// 发放系数
/// </summary> ///// </summary>
public Nullable<decimal> Grant { get; set; } //public Nullable<decimal> Grant { get; set; }
} }
} }
...@@ -55,10 +55,10 @@ public class ComputeResult ...@@ -55,10 +55,10 @@ public class ComputeResult
/// </summary> /// </summary>
public Nullable<decimal> PostCoefficient { get; set; } public Nullable<decimal> PostCoefficient { get; set; }
/// <summary> ///// <summary>
/// 发放系数(来自人员名单) ///// 发放系数(来自人员名单)
/// </summary> ///// </summary>
public Nullable<decimal> Grant { get; set; } //public Nullable<decimal> Grant { get; set; }
/// <summary> /// <summary>
/// 应发管理绩效(需计算) /// 应发管理绩效(需计算)
......
...@@ -22,6 +22,11 @@ public class PerDataAccountBaisc : IPerData ...@@ -22,6 +22,11 @@ public class PerDataAccountBaisc : IPerData
public string Department { get; set; } public string Department { get; set; }
/// <summary> /// <summary>
/// 科主任数量
/// </summary>
public decimal DirectorNumber { get; set; }
/// <summary>
/// 核算单元医生数量 /// 核算单元医生数量
/// </summary> /// </summary>
public decimal DoctorNumber { get; set; } public decimal DoctorNumber { get; set; }
...@@ -61,6 +66,11 @@ public class PerDataAccountBaisc : IPerData ...@@ -61,6 +66,11 @@ public class PerDataAccountBaisc : IPerData
public decimal DoctorAdjustFactor { get; set; } public decimal DoctorAdjustFactor { get; set; }
/// <summary> /// <summary>
/// 护士长人数
/// </summary>
public decimal NurseHeadNumber { get; set; }
/// <summary>
/// 核算单元护士数量 /// 核算单元护士数量
/// </summary> /// </summary>
public decimal NurseNumber { get; set; } public decimal NurseNumber { get; set; }
......
...@@ -61,15 +61,10 @@ public class PerDataEmployee : IPerData ...@@ -61,15 +61,10 @@ public class PerDataEmployee : IPerData
/// </summary> /// </summary>
public Nullable<decimal> Attendance { get; set; } public Nullable<decimal> Attendance { get; set; }
/// <summary> ///// <summary>
/// 核算单元医生数 ///// 工作量绩效
/// </summary> ///// </summary>
public Nullable<int> PeopleNumber { get; set; } //public Nullable<decimal> Workload { get; set; }
/// <summary>
/// 工作量绩效
/// </summary>
public Nullable<decimal> Workload { get; set; }
/// <summary> /// <summary>
/// 其他绩效 /// 其他绩效
...@@ -86,10 +81,10 @@ public class PerDataEmployee : IPerData ...@@ -86,10 +81,10 @@ public class PerDataEmployee : IPerData
/// </summary> /// </summary>
public Nullable<decimal> Adjust { get; set; } public Nullable<decimal> Adjust { get; set; }
/// <summary> ///// <summary>
/// 发放系数 ///// 发放系数
/// </summary> ///// </summary>
public Nullable<decimal> Grant { get; set; } //public Nullable<decimal> Grant { get; set; }
/// <summary> /// <summary>
/// 行号 /// 行号
......
...@@ -47,6 +47,11 @@ public class im_accountbasic ...@@ -47,6 +47,11 @@ public class im_accountbasic
public string Department { get; set; } public string Department { get; set; }
/// <summary> /// <summary>
/// 科主任数量
/// </summary>
public Nullable<decimal> DirectorNumber { get; set; }
/// <summary>
/// 核算单元医生数量 /// 核算单元医生数量
/// </summary> /// </summary>
public Nullable<decimal> DoctorNumber { get; set; } public Nullable<decimal> DoctorNumber { get; set; }
...@@ -87,9 +92,14 @@ public class im_accountbasic ...@@ -87,9 +92,14 @@ public class im_accountbasic
public Nullable<decimal> DoctorAdjustFactor { get; set; } public Nullable<decimal> DoctorAdjustFactor { get; set; }
/// <summary> /// <summary>
/// 护士长人数
/// </summary>
public Nullable<decimal> NurseHeadNumber { get; set; }
/// <summary>
/// 护士人数 /// 护士人数
/// </summary> /// </summary>
public Nullable<int> NurseNumber { get; set; } public Nullable<decimal> NurseNumber { get; set; }
/// <summary> /// <summary>
/// 护理基础系数 /// 护理基础系数
......
<?xml version="1.0" encoding="utf-8"?>
<!--
此文件由 Web 项目的发布/打包过程使用。可以通过编辑此 MSBuild 文件
自定义此过程的行为。为了解与此相关的更多内容,请访问 https://go.microsoft.com/fwlink/?LinkID=208121。
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>a7ae6d0f-7b11-4eef-9fea-a279001ea54d</ProjectGuid>
<publishUrl>bin\Release\netcoreapp2.2\publish\</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
</Project>
\ No newline at end of file
...@@ -19,22 +19,27 @@ public class BaiscNormService : IAutoInjection ...@@ -19,22 +19,27 @@ public class BaiscNormService : IAutoInjection
/// </summary> /// </summary>
/// <param name="computes"></param> /// <param name="computes"></param>
/// <returns></returns> /// <returns></returns>
public List<res_baiscnorm> ComputeAvg(List<res_baiscnorm> baiscnormList, List<ComputeResult> computes, List<im_employee> empolyeeList) public List<res_baiscnorm> ComputeAvg(List<res_baiscnorm> baiscnormList, List<im_accountbasic> accountbasicList,
List<ComputeResult> computes, List<im_employee> empolyeeList)
{ {
var keyList = new[] var keyList = new[]
{ {
//绩效基数平均值项目 //绩效基数平均值项目
new { type = AccountUnitType.临床科室, reference = PerforType.临床主任 }, new { type = AccountUnitType.临床科室, reference = PerforType.临床主任 },
new { type = AccountUnitType.临床科室, reference = PerforType.临床副主任 },
new { type = AccountUnitType.临床科室, reference = PerforType.护士长 }, new { type = AccountUnitType.临床科室, reference = PerforType.护士长 },
new { type = AccountUnitType.医技科室, reference = PerforType.医技主任 }, 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) foreach (var item in keyList)
{ {
var count = empolyeeList.Count(t => t.AccountType == item.type.ToString() && t.FitPeople == EnumHelper.GetDescription(item.reference)); var accountingUnitList = empolyeeList.Where(t => t.AccountType == item.type.ToString()).Select(t => t.AccountingUnit).ToList();
if (count > 0) if (accountingUnitList.Any())
{ {
var count = (item.reference == PerforType.护士长)
? accountbasicList.Where(t => accountingUnitList.Contains(t.NurseAccountingUnit)).Sum(t => t.NurseHeadNumber)
: accountbasicList.Where(t => accountingUnitList.Contains(t.DoctorAccountingUnit)).Sum(t => t.DirectorNumber);
var dataList = computes.Where(t => t.AccountType == item.type.ToString() && t.FitPeople == EnumHelper.GetDescription(item.reference)); var dataList = computes.Where(t => t.AccountType == item.type.ToString() && t.FitPeople == EnumHelper.GetDescription(item.reference));
var baiscnorm = new res_baiscnorm var baiscnorm = new res_baiscnorm
{ {
...@@ -113,7 +118,8 @@ public List<res_baiscnorm> ComputeOtherAvg(List<res_baiscnorm> baiscnormList, Li ...@@ -113,7 +118,8 @@ public List<res_baiscnorm> ComputeOtherAvg(List<res_baiscnorm> baiscnormList, Li
/// </summary> /// </summary>
/// <param name="list"></param> /// <param name="list"></param>
/// <returns></returns> /// <returns></returns>
public List<res_baiscnorm> DocterNurseBaiscnorm(List<res_baiscnorm> baiscnormList, List<PerSheet> list) public List<res_baiscnorm> DocterNurseBaiscnorm(List<res_baiscnorm> baiscnormList, List<im_accountbasic> accountbasicList,
List<PerSheet> list, List<im_employee> empolyeeList)
{ {
// 护士 // 护士
var sheetNurse = list.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseAccount); var sheetNurse = list.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseAccount);
...@@ -135,21 +141,21 @@ public List<res_baiscnorm> DocterNurseBaiscnorm(List<res_baiscnorm> baiscnormLis ...@@ -135,21 +141,21 @@ public List<res_baiscnorm> DocterNurseBaiscnorm(List<res_baiscnorm> baiscnormLis
baiscnormList.Add(baiscnormNurse); baiscnormList.Add(baiscnormNurse);
// 医生 // 医生
var accountingUnitList = empolyeeList.Where(t => t.AccountType == AccountUnitType.临床科室.ToString()).Select(t => t.AccountingUnit).ToList();
var count = accountbasicList.Where(t => accountingUnitList.Contains(t.DoctorAccountingUnit)).Sum(t => t.DoctorNumber + t.DirectorNumber);
var sheetDocter = list.FirstOrDefault(t => t.SheetType == SheetType.ComputeDoctorAccount); var sheetDocter = list.FirstOrDefault(t => t.SheetType == SheetType.ComputeDoctorAccount);
var perdataDocter = sheetDocter.PerData.Select(t => (PerDataAccountDoctor)t); var perdataDocter = sheetDocter.PerData.Select(t => (PerDataAccountDoctor)t);
perdataDocter = perdataDocter.GroupBy(t => t.AccountingUnit) //剔除不同科室相同核算单元
.Select(t => new PerDataAccountDoctor perdataDocter = perdataDocter.Where(t => accountingUnitList.Contains(t.AccountingUnit)).GroupBy(t => t.AccountingUnit)
{ .Select(t => new PerDataAccountDoctor { AccountingUnit = t.Key, PerforTotal = t.Max(p => p.PerforTotal) });
AccountingUnit = t.Key,
Number = t.Sum(p => p.Number),
PerforTotal = t.Max(p => p.PerforTotal)
});
var baiscnormDocter = new res_baiscnorm var baiscnormDocter = new res_baiscnorm
{ {
PositionName = EnumHelper.GetDescription(PerforType.临床医生), PositionName = EnumHelper.GetDescription(PerforType.临床医生),
TotelNumber = perdataDocter.Sum(t => t.Number), TotelNumber = count,
TotelValue = perdataDocter.Sum(t => t.PerforTotal), TotelValue = perdataDocter.Sum(t => t.PerforTotal),
AvgValue = perdataDocter.Sum(t => t.PerforTotal) / perdataDocter.Sum(t => t.Number) AvgValue = perdataDocter.Sum(t => t.PerforTotal) / count
}; };
baiscnormList.Add(baiscnormDocter); baiscnormList.Add(baiscnormDocter);
......
...@@ -253,7 +253,7 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P ...@@ -253,7 +253,7 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P
{ {
AccountingUnit = dept.DoctorAccountingUnit, AccountingUnit = dept.DoctorAccountingUnit,
Department = dept.Department, Department = dept.Department,
Number = dept.DoctorNumber, Number = dept.DoctorNumber + dept.DirectorNumber,
BasicFactor = dept.DoctorBasicFactor, BasicFactor = dept.DoctorBasicFactor,
SlopeFactor = dept.DoctorSlopeFactor, SlopeFactor = dept.DoctorSlopeFactor,
OtherPerfor1 = dept.DoctorOtherPerfor1, OtherPerfor1 = dept.DoctorOtherPerfor1,
...@@ -264,7 +264,7 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P ...@@ -264,7 +264,7 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P
Income = econDoctor?.CellValue ?? 0, Income = econDoctor?.CellValue ?? 0,
WorkloadFee = workDoctor?.CellValue ?? 0, WorkloadFee = workDoctor?.CellValue ?? 0,
}; };
doctor.PerforFee = doctor.Income * (doctor.BasicFactor + (doctor.BasicFactor * doctor.SlopeFactor)); doctor.PerforFee = doctor.Income * (doctor.BasicFactor + doctor.SlopeFactor);
doctor.PerforTotal = doctor.PerforFee + doctor.WorkloadFee + doctor.OtherPerfor1; doctor.PerforTotal = doctor.PerforFee + doctor.WorkloadFee + doctor.OtherPerfor1;
doctor.RealGiveFee = (doctor.PerforTotal * doctor.ScoringAverage + doctor.Extra + doctor.OtherPerfor2) * doctor.AdjustFactor; doctor.RealGiveFee = (doctor.PerforTotal * doctor.ScoringAverage + doctor.Extra + doctor.OtherPerfor2) * doctor.AdjustFactor;
doctor.Avg = doctor.Number == 0 ? 0 : doctor.PerforTotal / doctor.Number; doctor.Avg = doctor.Number == 0 ? 0 : doctor.PerforTotal / doctor.Number;
...@@ -321,7 +321,7 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe ...@@ -321,7 +321,7 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe
{ {
AccountingUnit = dept.NurseAccountingUnit, AccountingUnit = dept.NurseAccountingUnit,
Department = dept.Department, Department = dept.Department,
Number = dept.NurseNumber, Number = dept.NurseNumber + dept.NurseHeadNumber,
BasicFactor = dept.NurseBasicFactor, BasicFactor = dept.NurseBasicFactor,
SlopeFactor = dept.NurseSlopeFactor, SlopeFactor = dept.NurseSlopeFactor,
OtherPerfor1 = dept.NurseOtherPerfor1, OtherPerfor1 = dept.NurseOtherPerfor1,
...@@ -332,7 +332,7 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe ...@@ -332,7 +332,7 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe
Income = econNurse?.CellValue ?? 0, Income = econNurse?.CellValue ?? 0,
WorkloadFee = workNurse?.CellValue ?? 0, WorkloadFee = workNurse?.CellValue ?? 0,
}; };
nurse.PerforFee = nurse.Income * (nurse.BasicFactor + (nurse.BasicFactor * nurse.SlopeFactor)); nurse.PerforFee = nurse.Income * (nurse.BasicFactor + nurse.SlopeFactor);
nurse.PerforTotal = nurse.PerforFee + nurse.WorkloadFee + nurse.OtherPerfor1; nurse.PerforTotal = nurse.PerforFee + nurse.WorkloadFee + nurse.OtherPerfor1;
nurse.RealGiveFee = (nurse.PerforTotal * nurse.ScoringAverage + nurse.Extra + nurse.OtherPerfor2) * nurse.AdjustFactor; nurse.RealGiveFee = (nurse.PerforTotal * nurse.ScoringAverage + nurse.Extra + nurse.OtherPerfor2) * nurse.AdjustFactor;
nurse.Avg = nurse.Number == 0 ? 0 : nurse.PerforTotal / nurse.Number; nurse.Avg = nurse.Number == 0 ? 0 : nurse.PerforTotal / nurse.Number;
......
...@@ -15,17 +15,20 @@ namespace Performance.Services.AllotCompute ...@@ -15,17 +15,20 @@ namespace Performance.Services.AllotCompute
/// </summary> /// </summary>
public class ResultComputeService : IAutoInjection public class ResultComputeService : IAutoInjection
{ {
private BaiscNormService baiscNormService; private readonly BaiscNormService baiscNormService;
private ComputeDirector computeDirector; private readonly ComputeDirector computeDirector;
private PerforImemployeeRepository perforImEmployeeRepository; private readonly PerforImemployeeRepository perforImEmployeeRepository;
private PerforRescomputeRepository perforRescomputeRepository; private readonly PerforRescomputeRepository perforRescomputeRepository;
private PerforResbaiscnormRepository perforResbaiscnormRepository; private readonly PerforResbaiscnormRepository perforResbaiscnormRepository;
private PerforResspecialunitRepository perforResspecialunitRepository; private readonly PerforResspecialunitRepository perforResspecialunitRepository;
private readonly PerforImaccountbasicRepository perforImaccountbasicRepository;
public ResultComputeService( public ResultComputeService(
PerforImemployeeRepository perforImEmployeeRepository, PerforImemployeeRepository perforImEmployeeRepository,
PerforRescomputeRepository perforRescomputeRepository, PerforRescomputeRepository perforRescomputeRepository,
PerforResbaiscnormRepository perforResbaiscnormRepository, PerforResbaiscnormRepository perforResbaiscnormRepository,
PerforResspecialunitRepository perforResspecialunitRepository, PerforResspecialunitRepository perforResspecialunitRepository,
PerforImaccountbasicRepository perforImaccountbasicRepository,
BaiscNormService baiscNormService, ComputeDirector computeDirector) BaiscNormService baiscNormService, ComputeDirector computeDirector)
{ {
this.baiscNormService = baiscNormService; this.baiscNormService = baiscNormService;
...@@ -34,6 +37,7 @@ public class ResultComputeService : IAutoInjection ...@@ -34,6 +37,7 @@ public class ResultComputeService : IAutoInjection
this.perforRescomputeRepository = perforRescomputeRepository; this.perforRescomputeRepository = perforRescomputeRepository;
this.perforResbaiscnormRepository = perforResbaiscnormRepository; this.perforResbaiscnormRepository = perforResbaiscnormRepository;
this.perforResspecialunitRepository = perforResspecialunitRepository; this.perforResspecialunitRepository = perforResspecialunitRepository;
this.perforImaccountbasicRepository = perforImaccountbasicRepository;
} }
/// <summary> /// <summary>
...@@ -44,14 +48,15 @@ public List<res_baiscnorm> Compute(per_allot allot, PerExcel excel, List<PerShee ...@@ -44,14 +48,15 @@ public List<res_baiscnorm> Compute(per_allot allot, PerExcel excel, List<PerShee
{ {
//取出人员信息 //取出人员信息
var empolyeeList = perforImEmployeeRepository.GetEntities(t => t.AllotID == allot.ID); var empolyeeList = perforImEmployeeRepository.GetEntities(t => t.AllotID == allot.ID);
var accountbasicList = perforImaccountbasicRepository.GetEntities(t => t.AllotID == allot.ID);
List<ComputeEmployee> computeEmployees = Mapper.Map<List<ComputeEmployee>>(empolyeeList); List<ComputeEmployee> computeEmployees = Mapper.Map<List<ComputeEmployee>>(empolyeeList);
var computResult = computeDirector.Compute(computeEmployees, allot); var computResult = computeDirector.Compute(computeEmployees, accountbasicList, allot);
//计算 绩效标准 基数(科主任、副主任、护士长 =>> 平均值) //计算 绩效标准 基数(科主任、副主任、护士长 =>> 平均值)
List<res_baiscnorm> baiscnormList = new List<res_baiscnorm>(); List<res_baiscnorm> baiscnormList = new List<res_baiscnorm>();
baiscNormService.ComputeAvg(baiscnormList, computResult, empolyeeList); baiscNormService.ComputeAvg(baiscnormList, accountbasicList, computResult, empolyeeList);
baiscNormService.DocterNurseBaiscnorm(baiscnormList, perSheets); baiscNormService.DocterNurseBaiscnorm(baiscnormList, accountbasicList, perSheets, empolyeeList);
var computResult2 = computeDirector.Compute(computeEmployees, allot, baiscnormList); var computResult2 = computeDirector.Compute(computeEmployees, allot, baiscnormList);
//计算 行政人员 平均值 //计算 行政人员 平均值
...@@ -148,8 +153,8 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno ...@@ -148,8 +153,8 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
Punishment = group.Punishment, Punishment = group.Punishment,
Adjust = group.Adjust == 0 ? 1 : group.Adjust, Adjust = group.Adjust == 0 ? 1 : group.Adjust,
}; };
res.GiveFee = (sumValue + (group.OtherPerfor ?? 0) + (group.Punishment ?? 0)) * (group.Adjust == 0 ? 1 : group.Adjust); res.GiveFee = (sumValue + (group.OtherPerfor ?? 0) + (group.Punishment ?? 0));
res.RealGiveFee = res.GiveFee; res.RealGiveFee = res.GiveFee * (group.Adjust == 0 ? 1 : group.Adjust);
res.Avg = group.Number != 0 ? res.GiveFee / group.Number : null; res.Avg = group.Number != 0 ? res.GiveFee / group.Number : null;
resDataList.Add(res); resDataList.Add(res);
} }
......
...@@ -300,12 +300,12 @@ private bool WriteExcel(string newpath, string originalPath, List<PerSheet> shee ...@@ -300,12 +300,12 @@ private bool WriteExcel(string newpath, string originalPath, List<PerSheet> shee
{ "参加工作时间", (t) => t.WorkTime }, { "参加工作时间", (t) => t.WorkTime },
{ "考核得分率", (t) => t.ScoreAverageRate }, { "考核得分率", (t) => t.ScoreAverageRate },
{ "出勤率", (t) => t.Attendance }, { "出勤率", (t) => t.Attendance },
{ "核算单元医生数", (t) => t.PeopleNumber }, //{ "核算单元医生数", (t) => t.PeopleNumber },
{ "工作量绩效", (t) => t.Workload }, //{ "工作量绩效", (t) => t.Workload },
{ "其他绩效", (t) => t.OthePerfor }, { "其他绩效", (t) => t.OthePerfor },
{ "医院奖罚", (t) => t.Punishment }, { "医院奖罚", (t) => t.Punishment },
{ "调节系数", (t) => t.Adjust }, { "调节系数", (t) => t.Adjust },
{ "发放系数", (t) => t.Grant }, //{ "发放系数", (t) => t.Grant },
}; };
foreach (var item in keyValues.Keys) foreach (var item in keyValues.Keys)
{ {
......
...@@ -41,7 +41,7 @@ public class ComputeDirector : IAutoInjection ...@@ -41,7 +41,7 @@ public class ComputeDirector : IAutoInjection
/// <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, per_allot allot) public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_accountbasic> accountbasicList, per_allot allot)
{ {
//规模绩效和效率绩效配置表 //规模绩效和效率绩效配置表
var directorList = perforCofdirectorRepository.GetEntities(t => t.AllotID == allot.ID); var directorList = perforCofdirectorRepository.GetEntities(t => t.AllotID == allot.ID);
...@@ -68,10 +68,14 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -68,10 +68,14 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
var needCompute = empolyeeList.Where(t => t.AccountType == basicRule.AccountUnitType.ToString() && t.FitPeople.Trim() == EnumHelper.GetDescription(basicRule.PerforType)); 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; decimal? number, perforTotal, avg;
if (basicRule.PerforType == PerforType.护士长) if (basicRule.PerforType == PerforType.护士长)
{ {
var nurseHeadNumber = accountbasicList.FirstOrDefault(t => t.Department == item.Department)?.NurseHeadNumber;
if (!nurseHeadNumber.HasValue || nurseHeadNumber.Value == 0) continue;
var resAccount = nurseList.FirstOrDefault(t => t.AccountingUnit == item.AccountingUnit); var resAccount = nurseList.FirstOrDefault(t => t.AccountingUnit == item.AccountingUnit);
number = resAccount?.Number; number = resAccount?.Number;
perforTotal = resAccount?.PerforTotal; perforTotal = resAccount?.PerforTotal;
...@@ -79,6 +83,9 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -79,6 +83,9 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
} }
else else
{ {
var directorNumber = accountbasicList.FirstOrDefault(t => t.Department == item.Department)?.DirectorNumber;
if (!directorNumber.HasValue || directorNumber.Value == 0) continue;
var resAccount = doctorList.FirstOrDefault(t => t.AccountingUnit == item.AccountingUnit); var resAccount = doctorList.FirstOrDefault(t => t.AccountingUnit == item.AccountingUnit);
number = resAccount?.Number; number = resAccount?.Number;
perforTotal = resAccount?.PerforTotal; perforTotal = resAccount?.PerforTotal;
...@@ -125,7 +132,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -125,7 +132,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
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; compute.RealGiveFee = compute.GiveFee * (item.Adjust ?? 1m);
computeList.Add(compute); computeList.Add(compute);
} }
...@@ -160,7 +167,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -160,7 +167,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
AccountingUnit = item.AccountingUnit, AccountingUnit = item.AccountingUnit,
EmployeeName = item.DoctorName, EmployeeName = item.DoctorName,
FitPeople = item.FitPeople, FitPeople = item.FitPeople,
Grant = item.Grant ?? 1, //Grant = item.Grant ?? 1,
WorkTime = item.WorkTime, WorkTime = item.WorkTime,
PostCoefficient = item.PostCoefficient, PostCoefficient = item.PostCoefficient,
Attendance = item.Attendance, Attendance = item.Attendance,
...@@ -169,7 +176,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -169,7 +176,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
OtherPerfor = item.OtherPerfor, OtherPerfor = item.OtherPerfor,
JobTitle = item.JobTitle, JobTitle = item.JobTitle,
Adjust = item.Adjust, Adjust = item.Adjust,
Workload = item.Workload //Workload = item.Workload
}; };
decimal? baiscnorm = 1; decimal? baiscnorm = 1;
...@@ -190,11 +197,10 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -190,11 +197,10 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
//添加参数计算 //添加参数计算
compute.BaiscNormValue = baiscnorm * (item.FitPeopleRatio ?? 1); compute.BaiscNormValue = baiscnorm * (item.FitPeopleRatio ?? 1);
//应发绩效 //应发绩效
compute.GiveFee = compute.BaiscNormValue * (compute.PostCoefficient + (item.Adjust ?? 0)) compute.GiveFee = compute.BaiscNormValue * compute.PostCoefficient * (compute.WorkYear ?? 1) * compute.Attendance * compute.ScoreAverageRate
* (item.Grant ?? 1) * compute.Attendance * compute.ScoreAverageRate * (compute.WorkYear ?? 1) + (compute.OtherPerfor ?? 0) + (compute.Punishment ?? 0);
+ (compute.OtherPerfor ?? 0) + (item.Workload ?? 0) + (compute.Punishment ?? 0);
//实发绩效 //实发绩效
compute.RealGiveFee = compute.GiveFee; compute.RealGiveFee = compute.GiveFee * (item.Adjust ?? 1);
computeList.Add(compute); computeList.Add(compute);
} }
......
...@@ -29,14 +29,15 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -29,14 +29,15 @@ 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;
PerDataAccountBaisc unifyUnit = new PerDataAccountBaisc(); PerDataAccountBaisc unifyUnit = new PerDataAccountBaisc();
unifyUnit.RowNumber = r; unifyUnit.RowNumber = r;
unifyUnit.DoctorAccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元(医生组)").PointCell)?.ToString(); unifyUnit.DoctorAccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元(医生组)").PointCell)?.ToString();
unifyUnit.NurseAccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元(护理组)").PointCell)?.ToString(); unifyUnit.NurseAccountingUnit = 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.DirectorNumber = 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.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());
unifyUnit.DoctorOtherPerfor1 = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效1" && p.Parent.CellValue == "医生组").PointCell)?.ToString()); unifyUnit.DoctorOtherPerfor1 = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效1" && p.Parent.CellValue == "医生组").PointCell)?.ToString());
unifyUnit.DoctorOtherPerfor2 = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效2" && p.Parent.CellValue == "医生组").PointCell)?.ToString()); unifyUnit.DoctorOtherPerfor2 = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效2" && p.Parent.CellValue == "医生组").PointCell)?.ToString());
...@@ -44,8 +45,9 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -44,8 +45,9 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
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.NurseHeadNumber = 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());
unifyUnit.NurseOtherPerfor1 = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效1" && p.Parent.CellValue == "护理组").PointCell)?.ToString()); unifyUnit.NurseOtherPerfor1 = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效1" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
unifyUnit.NurseOtherPerfor2 = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效2" && p.Parent.CellValue == "护理组").PointCell)?.ToString()); unifyUnit.NurseOtherPerfor2 = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效2" && p.Parent.CellValue == "护理组").PointCell)?.ToString());
......
...@@ -44,12 +44,12 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -44,12 +44,12 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
WorkTime = NopiSevice.GetCellDatetimeValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "参加工作时间").PointCell)), WorkTime = NopiSevice.GetCellDatetimeValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "参加工作时间").PointCell)),
ScoreAverageRate = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "考核得分率").PointCell)?.ToString()), ScoreAverageRate = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "考核得分率").PointCell)?.ToString()),
Attendance = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "出勤率").PointCell)?.ToString()), Attendance = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "出勤率").PointCell)?.ToString()),
PeopleNumber = ConvertHelper.To<int?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元医生数").PointCell)?.ToString()), //PeopleNumber = ConvertHelper.To<int?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元医生数").PointCell)?.ToString()),
Workload = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "工作量绩效").PointCell)?.ToString()), //Workload = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "工作量绩效").PointCell)?.ToString()),
OthePerfor = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效").PointCell)?.ToString()), OthePerfor = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效").PointCell)?.ToString()),
Punishment = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医院奖罚").PointCell)?.ToString()), Punishment = 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()), Adjust = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "调节系数").PointCell)?.ToString()),
Grant = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "发放系数").PointCell)?.ToString()), //Grant = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "发放系数").PointCell)?.ToString()),
}; };
dataList.Add(employee); dataList.Add(employee);
} }
......
...@@ -13,19 +13,28 @@ namespace Performance.Services ...@@ -13,19 +13,28 @@ namespace Performance.Services
/// </summary> /// </summary>
public class PerSheetDataReadOtherIncome : IPerSheetDataRead public class PerSheetDataReadOtherIncome : IPerSheetDataRead
{ {
public PerSheetPoint Point => new PerSheetPoint public PerSheetPoint Point => new PerSheetPoint
{ {
HeaderFirstRowNum = 2, HeaderFirstRowNum = 3,
HeaderLastRowNum = 2, HeaderLastRowNum = 3,
HeaderFirstCellNum = 0, HeaderFirstCellNum = 0,
DataFirstRowNum = 3, DataFirstRowNum = 4,
AccountingUnit = new List<AccountingUnit> AccountingUnit = new List<AccountingUnit>
{ {
//核算单元(医生组)
new AccountingUnit new AccountingUnit
{ {
AccountingUnitCellNum = 0, AccountingUnitCellNum = 0,
DeptCellNum = 1, UnitType = "医生组",
DeptCellNum = 2,
FactorRow = 2,
},
//核算单元(护理组)
new AccountingUnit
{
AccountingUnitCellNum = 1,
UnitType = "护理组",
DeptCellNum = 2,
FactorRow = 1, FactorRow = 1,
} }
} }
...@@ -35,58 +44,42 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -35,58 +44,42 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{ {
List<IPerData> dataList = new List<IPerData>(); List<IPerData> dataList = new List<IPerData>();
var unit = Point.AccountingUnit.First(); //循环 当前有几个核算单元
//查询除了 核算单元 科室名称 有效数据列头位置 foreach (var unit in Point.AccountingUnit)
var vhead = perHeader.Where(t => t.PointCell != unit.AccountingUnitCellNum && t.PointCell != unit.DeptCellNum).OrderBy(t => t.PointCell);
for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{ {
var row = sheet.GetRow(r); //查询除了 核算单元 科室名称 有效数据列头位置
if (row == null) continue; var vhead = perHeader.Where(t => !Point.AccountingUnit.Select(p => p.AccountingUnitCellNum).Contains(t.PointCell)
&& !Point.AccountingUnit.Select(p => p.DeptCellNum).Contains(t.PointCell)).OrderBy(t => t.PointCell);
for (int c = 0; c < vhead.Count(); c++) for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{ {
var athead = vhead.ElementAt(c); var row = sheet.GetRow(r);
var cellValue = NopiSevice.GetCellValue(row.GetCell(athead.PointCell)); if (row == null) continue;
if (!cellValue.HasValue || cellValue.Value == 0)
continue;
PerData data = new PerData
{
RowNumber = r,
SignID = athead.SignID,
AccountingUnit = row.GetCell(unit.AccountingUnitCellNum.Value)?.ToString(),
Department = row.GetCell(unit.DeptCellNum.Value)?.ToString(),
TypeName = athead?.CellValue,
CellValue = cellValue,
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
UnitType = GetUnitType(sheet.SheetName, perHeader),
FactorValue = ConvertHelper.To<decimal?>(sheet.GetRow(unit.FactorRow.Value).GetCell(athead.PointCell)?.ToString()),
IsFactor = true,
};
dataList.Add(data); for (int c = 0; c < vhead.Count(); c++)
{
var athead = vhead.ElementAt(c);
var cellValue = NopiSevice.GetCellValue(row.GetCell(athead.PointCell));
if (!cellValue.HasValue || cellValue.Value == 0)
continue;
PerData data = new PerData
{
RowNumber = r,
SignID = athead.SignID,
AccountingUnit = row.GetCell(unit.AccountingUnitCellNum.Value)?.ToString(),
Department = row.GetCell(unit.DeptCellNum.Value)?.ToString(),
TypeName = athead?.CellValue,
CellValue = cellValue,
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
UnitType = unit.UnitType, //手动匹配
FactorValue = ConvertHelper.To<decimal?>(sheet.GetRow(unit.FactorRow.Value).GetCell(athead.PointCell)?.ToString()),
IsFactor = true,
};
dataList.Add(data);
}
} }
} }
return dataList; return dataList;
} }
/// <summary>
/// 获取核算单元类型
/// </summary>
/// <param name="sheet"></param>
/// <param name="perHeader"></param>
private string GetUnitType(string sheetName, List<PerHeader> perHeader)
{
if (sheetName.Contains("医生组"))
return "医生组";
else if (sheetName.Contains("护理组"))
return "护理组";
else if (perHeader.Any(t => t.CellValue.Contains("核算单元") && t.CellValue.Contains("医生组")))
return "医生组";
else if (perHeader.Any(t => t.CellValue.Contains("核算单元") && t.CellValue.Contains("护理组")))
return "护理组";
return "";
}
} }
} }
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