Commit 9fc2d5d3 by 799284587@qq.com

新都中医五月

parent 3e9317f2
......@@ -66,15 +66,15 @@ public class ComputeEmployee
/// </summary>
public Nullable<decimal> Attendance { get; set; }
/// <summary>
/// 核算单元医生数
/// </summary>
public Nullable<int> PeopleNumber { get; set; }
///// <summary>
///// 核算单元医生数
///// </summary>
//public Nullable<int> PeopleNumber { get; set; }
/// <summary>
/// 工作量绩效
/// </summary>
public Nullable<decimal> Workload { get; set; }
///// <summary>
///// 工作量绩效
///// </summary>
//public Nullable<decimal> Workload { get; set; }
/// <summary>
/// 其他绩效
......@@ -91,9 +91,9 @@ public class ComputeEmployee
/// </summary>
public Nullable<decimal> Adjust { get; set; }
/// <summary>
/// 发放系数
/// </summary>
public Nullable<decimal> Grant { get; set; }
///// <summary>
///// 发放系数
///// </summary>
//public Nullable<decimal> Grant { get; set; }
}
}
......@@ -55,10 +55,10 @@ public class ComputeResult
/// </summary>
public Nullable<decimal> PostCoefficient { get; set; }
/// <summary>
/// 发放系数(来自人员名单)
/// </summary>
public Nullable<decimal> Grant { get; set; }
///// <summary>
///// 发放系数(来自人员名单)
///// </summary>
//public Nullable<decimal> Grant { get; set; }
/// <summary>
/// 应发管理绩效(需计算)
......
......@@ -22,6 +22,11 @@ public class PerDataAccountBaisc : IPerData
public string Department { get; set; }
/// <summary>
/// 科主任数量
/// </summary>
public decimal DirectorNumber { get; set; }
/// <summary>
/// 核算单元医生数量
/// </summary>
public decimal DoctorNumber { get; set; }
......@@ -61,6 +66,11 @@ public class PerDataAccountBaisc : IPerData
public decimal DoctorAdjustFactor { get; set; }
/// <summary>
/// 护士长人数
/// </summary>
public decimal NurseHeadNumber { get; set; }
/// <summary>
/// 核算单元护士数量
/// </summary>
public decimal NurseNumber { get; set; }
......
......@@ -61,15 +61,10 @@ public class PerDataEmployee : IPerData
/// </summary>
public Nullable<decimal> Attendance { get; set; }
/// <summary>
/// 核算单元医生数
/// </summary>
public Nullable<int> PeopleNumber { get; set; }
/// <summary>
/// 工作量绩效
/// </summary>
public Nullable<decimal> Workload { get; set; }
///// <summary>
///// 工作量绩效
///// </summary>
//public Nullable<decimal> Workload { get; set; }
/// <summary>
/// 其他绩效
......@@ -86,10 +81,10 @@ public class PerDataEmployee : IPerData
/// </summary>
public Nullable<decimal> Adjust { get; set; }
/// <summary>
/// 发放系数
/// </summary>
public Nullable<decimal> Grant { get; set; }
///// <summary>
///// 发放系数
///// </summary>
//public Nullable<decimal> Grant { get; set; }
/// <summary>
/// 行号
......
......@@ -47,6 +47,11 @@ public class im_accountbasic
public string Department { get; set; }
/// <summary>
/// 科主任数量
/// </summary>
public Nullable<decimal> DirectorNumber { get; set; }
/// <summary>
/// 核算单元医生数量
/// </summary>
public Nullable<decimal> DoctorNumber { get; set; }
......@@ -87,9 +92,14 @@ public class im_accountbasic
public Nullable<decimal> DoctorAdjustFactor { get; set; }
/// <summary>
/// 护士长人数
/// </summary>
public Nullable<decimal> NurseHeadNumber { get; set; }
/// <summary>
/// 护士人数
/// </summary>
public Nullable<int> NurseNumber { get; set; }
public Nullable<decimal> NurseNumber { get; set; }
/// <summary>
/// 护理基础系数
......
......@@ -19,22 +19,27 @@ public class BaiscNormService : IAutoInjection
/// </summary>
/// <param name="computes"></param>
/// <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[]
{
//绩效基数平均值项目
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)
{
var count = empolyeeList.Count(t => t.AccountType == item.type.ToString() && t.FitPeople == EnumHelper.GetDescription(item.reference));
if (count > 0)
var accountingUnitList = empolyeeList.Where(t => t.AccountType == item.type.ToString()).Select(t => t.AccountingUnit).ToList();
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 baiscnorm = new res_baiscnorm
{
......@@ -113,7 +118,8 @@ public List<res_baiscnorm> ComputeOtherAvg(List<res_baiscnorm> baiscnormList, Li
/// </summary>
/// <param name="list"></param>
/// <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);
......@@ -135,21 +141,21 @@ public List<res_baiscnorm> DocterNurseBaiscnorm(List<res_baiscnorm> baiscnormLis
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 perdataDocter = sheetDocter.PerData.Select(t => (PerDataAccountDoctor)t);
perdataDocter = perdataDocter.GroupBy(t => t.AccountingUnit)
.Select(t => new PerDataAccountDoctor
{
AccountingUnit = t.Key,
Number = t.Sum(p => p.Number),
PerforTotal = t.Max(p => p.PerforTotal)
});
//剔除不同科室相同核算单元
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) });
var baiscnormDocter = new res_baiscnorm
{
PositionName = EnumHelper.GetDescription(PerforType.临床医生),
TotelNumber = perdataDocter.Sum(t => t.Number),
TotelNumber = count,
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);
......
......@@ -253,7 +253,7 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P
{
AccountingUnit = dept.DoctorAccountingUnit,
Department = dept.Department,
Number = dept.DoctorNumber,
Number = dept.DoctorNumber + dept.DirectorNumber,
BasicFactor = dept.DoctorBasicFactor,
SlopeFactor = dept.DoctorSlopeFactor,
OtherPerfor1 = dept.DoctorOtherPerfor1,
......@@ -264,7 +264,7 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P
Income = econDoctor?.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.RealGiveFee = (doctor.PerforTotal * doctor.ScoringAverage + doctor.Extra + doctor.OtherPerfor2) * doctor.AdjustFactor;
doctor.Avg = doctor.Number == 0 ? 0 : doctor.PerforTotal / doctor.Number;
......@@ -321,7 +321,7 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe
{
AccountingUnit = dept.NurseAccountingUnit,
Department = dept.Department,
Number = dept.NurseNumber,
Number = dept.NurseNumber + dept.NurseHeadNumber,
BasicFactor = dept.NurseBasicFactor,
SlopeFactor = dept.NurseSlopeFactor,
OtherPerfor1 = dept.NurseOtherPerfor1,
......@@ -332,7 +332,7 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe
Income = econNurse?.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.RealGiveFee = (nurse.PerforTotal * nurse.ScoringAverage + nurse.Extra + nurse.OtherPerfor2) * nurse.AdjustFactor;
nurse.Avg = nurse.Number == 0 ? 0 : nurse.PerforTotal / nurse.Number;
......
......@@ -15,17 +15,20 @@ namespace Performance.Services.AllotCompute
/// </summary>
public class ResultComputeService : IAutoInjection
{
private BaiscNormService baiscNormService;
private ComputeDirector computeDirector;
private PerforImemployeeRepository perforImEmployeeRepository;
private PerforRescomputeRepository perforRescomputeRepository;
private PerforResbaiscnormRepository perforResbaiscnormRepository;
private PerforResspecialunitRepository perforResspecialunitRepository;
private readonly BaiscNormService baiscNormService;
private readonly ComputeDirector computeDirector;
private readonly PerforImemployeeRepository perforImEmployeeRepository;
private readonly PerforRescomputeRepository perforRescomputeRepository;
private readonly PerforResbaiscnormRepository perforResbaiscnormRepository;
private readonly PerforResspecialunitRepository perforResspecialunitRepository;
private readonly PerforImaccountbasicRepository perforImaccountbasicRepository;
public ResultComputeService(
PerforImemployeeRepository perforImEmployeeRepository,
PerforRescomputeRepository perforRescomputeRepository,
PerforResbaiscnormRepository perforResbaiscnormRepository,
PerforResspecialunitRepository perforResspecialunitRepository,
PerforImaccountbasicRepository perforImaccountbasicRepository,
BaiscNormService baiscNormService, ComputeDirector computeDirector)
{
this.baiscNormService = baiscNormService;
......@@ -34,6 +37,7 @@ public class ResultComputeService : IAutoInjection
this.perforRescomputeRepository = perforRescomputeRepository;
this.perforResbaiscnormRepository = perforResbaiscnormRepository;
this.perforResspecialunitRepository = perforResspecialunitRepository;
this.perforImaccountbasicRepository = perforImaccountbasicRepository;
}
/// <summary>
......@@ -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 accountbasicList = perforImaccountbasicRepository.GetEntities(t => t.AllotID == allot.ID);
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>();
baiscNormService.ComputeAvg(baiscnormList, computResult, empolyeeList);
baiscNormService.DocterNurseBaiscnorm(baiscnormList, perSheets);
baiscNormService.ComputeAvg(baiscnormList, accountbasicList, computResult, empolyeeList);
baiscNormService.DocterNurseBaiscnorm(baiscnormList, accountbasicList, perSheets, empolyeeList);
var computResult2 = computeDirector.Compute(computeEmployees, allot, baiscnormList);
//计算 行政人员 平均值
......
......@@ -300,12 +300,12 @@ private bool WriteExcel(string newpath, string originalPath, List<PerSheet> shee
{ "参加工作时间", (t) => t.WorkTime },
{ "考核得分率", (t) => t.ScoreAverageRate },
{ "出勤率", (t) => t.Attendance },
{ "核算单元医生数", (t) => t.PeopleNumber },
{ "工作量绩效", (t) => t.Workload },
//{ "核算单元医生数", (t) => t.PeopleNumber },
//{ "工作量绩效", (t) => t.Workload },
{ "其他绩效", (t) => t.OthePerfor },
{ "医院奖罚", (t) => t.Punishment },
{ "调节系数", (t) => t.Adjust },
{ "发放系数", (t) => t.Grant },
//{ "发放系数", (t) => t.Grant },
};
foreach (var item in keyValues.Keys)
{
......
......@@ -41,7 +41,7 @@ public class ComputeDirector : IAutoInjection
/// <param name="nurseList"></param>
/// <param name="directorList"></param>
/// <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);
......@@ -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));
foreach (var item in needCompute)
{
//分别取出对应的 计算 人员 平均值等信息
decimal? number, perforTotal, avg;
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);
number = resAccount?.Number;
perforTotal = resAccount?.PerforTotal;
......@@ -79,6 +83,9 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
}
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);
number = resAccount?.Number;
perforTotal = resAccount?.PerforTotal;
......@@ -160,7 +167,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
AccountingUnit = item.AccountingUnit,
EmployeeName = item.DoctorName,
FitPeople = item.FitPeople,
Grant = item.Grant ?? 1,
//Grant = item.Grant ?? 1,
WorkTime = item.WorkTime,
PostCoefficient = item.PostCoefficient,
Attendance = item.Attendance,
......@@ -169,7 +176,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
OtherPerfor = item.OtherPerfor,
JobTitle = item.JobTitle,
Adjust = item.Adjust,
Workload = item.Workload
//Workload = item.Workload
};
decimal? baiscnorm = 1;
......@@ -190,11 +197,10 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
//添加参数计算
compute.BaiscNormValue = baiscnorm * (item.FitPeopleRatio ?? 1);
//应发绩效
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);
compute.GiveFee = compute.BaiscNormValue * compute.PostCoefficient * (compute.WorkYear ?? 1) * compute.Attendance * compute.ScoreAverageRate
+ (compute.OtherPerfor ?? 0) + (compute.Punishment ?? 0);
//实发绩效
compute.RealGiveFee = compute.GiveFee;
compute.RealGiveFee = compute.GiveFee * (item.Adjust ?? 1);
computeList.Add(compute);
}
......
......@@ -35,8 +35,9 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
unifyUnit.DoctorAccountingUnit = 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.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.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.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());
......@@ -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.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.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.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());
......
......@@ -44,12 +44,12 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
WorkTime = NopiSevice.GetCellDatetimeValue(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "参加工作时间").PointCell)),
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()),
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()),
//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()),
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()),
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);
}
......
......@@ -13,19 +13,28 @@ namespace Performance.Services
/// </summary>
public class PerSheetDataReadOtherIncome : IPerSheetDataRead
{
public PerSheetPoint Point => new PerSheetPoint
{
HeaderFirstRowNum = 2,
HeaderLastRowNum = 2,
HeaderFirstRowNum = 3,
HeaderLastRowNum = 3,
HeaderFirstCellNum = 0,
DataFirstRowNum = 3,
DataFirstRowNum = 4,
AccountingUnit = new List<AccountingUnit>
{
//核算单元(医生组)
new AccountingUnit
{
AccountingUnitCellNum = 0,
DeptCellNum = 1,
UnitType = "医生组",
DeptCellNum = 2,
FactorRow = 2,
},
//核算单元(护理组)
new AccountingUnit
{
AccountingUnitCellNum = 1,
UnitType = "护理组",
DeptCellNum = 2,
FactorRow = 1,
}
}
......@@ -35,10 +44,12 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
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);
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 r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{
var row = sheet.GetRow(r);
......@@ -59,34 +70,16 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
TypeName = athead?.CellValue,
CellValue = cellValue,
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
UnitType = GetUnitType(sheet.SheetName, perHeader),
UnitType = unit.UnitType, //手动匹配
FactorValue = ConvertHelper.To<decimal?>(sheet.GetRow(unit.FactorRow.Value).GetCell(athead.PointCell)?.ToString()),
IsFactor = true,
};
dataList.Add(data);
}
}
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 "";
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