Commit 2f1759de by 799284587@qq.com

医技科初稿

parent 92b3321d
......@@ -6,6 +6,7 @@ namespace Performance.DtoModels
{
public class PerDataAccountDoctor : IPerData
{
public int UnitType { get; set; }
/// <summary>
/// 核算单元
/// </summary>
......
......@@ -6,6 +6,7 @@ namespace Performance.DtoModels
{
public class PerDataAccountNurse : IPerData
{
public int UnitType { get; set; }
/// <summary>
/// 核算单元
/// </summary>
......
......@@ -25,7 +25,7 @@ public List<res_baiscnorm> ComputeAvg(List<res_baiscnorm> baiscnormList, List<im
{
//绩效基数平均值项目
new { Reference = PerforType.临床主任 , UnitType = UnitType.医生组},
new { Reference = PerforType.护士长, UnitType = UnitType.医生 },
new { Reference = PerforType.护士长, UnitType = UnitType.护理 },
new { Reference = PerforType.医技主任, UnitType = UnitType.医技组 },
};
foreach (var item in keyList)
......@@ -108,8 +108,7 @@ 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<im_accountbasic> accountbasicList,
List<PerSheet> list, List<im_employee> empolyeeList)
public List<res_baiscnorm> DocterNurseBaiscnorm(List<res_baiscnorm> baiscnormList, List<im_accountbasic> accountbasicList, List<PerSheet> list)
{
// 护士
var sheetNurse = list.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseAccount);
......@@ -131,13 +130,12 @@ public List<res_baiscnorm> ComputeOtherAvg(List<res_baiscnorm> baiscnormList, Li
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.DoctorDirectorNumber);
var count = accountbasicList.Where(t => t.UnitType == (int)UnitType.医生组).Sum(t => t.DoctorNumber + t.DoctorDirectorNumber);
var sheetDocter = list.FirstOrDefault(t => t.SheetType == SheetType.ComputeDoctorAccount);
var perdataDocter = sheetDocter.PerData.Select(t => (PerDataAccountDoctor)t);
//剔除不同科室相同核算单元
perdataDocter = perdataDocter.Where(t => accountingUnitList.Contains(t.AccountingUnit)).GroupBy(t => t.AccountingUnit)
perdataDocter = perdataDocter.Where(t => t.UnitType == (int)UnitType.医生组).GroupBy(t => t.AccountingUnit)
.Select(t => new PerDataAccountDoctor { AccountingUnit = t.Key, PerforTotal = t.Max(p => p.PerforTotal) });
var baiscnormDocter = new res_baiscnorm
......
......@@ -2,6 +2,7 @@
using Newtonsoft.Json.Linq;
using Performance.DtoModels;
using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Repository;
using System;
using System.Collections.Generic;
......@@ -243,14 +244,20 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P
var data = new List<PerDataAccountDoctor>();
foreach (var dept in dataList.Where(t => t.UnitType == 1))
foreach (var item in EnumHelper.GetItems<UnitType>())
{
if (item.Value == (int)UnitType.护理组)
continue;
foreach (var dept in dataList.Where(t => t.UnitType == item.Value))
{
if (string.IsNullOrEmpty(dept.AccountingUnit)) continue;
var econDoctor = economicData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.Department);
var workDoctor = workloadData.FirstOrDefault(t => t.UnitType == "医生组" && t.AccountingUnit == dept.Department);
var econDoctor = economicData.FirstOrDefault(t => t.UnitType == item.Name && t.AccountingUnit == dept.Department);
var workDoctor = workloadData.FirstOrDefault(t => t.UnitType == item.Name && t.AccountingUnit == dept.Department);
var doctor = new PerDataAccountDoctor
{
UnitType = dept.UnitType.Value,
AccountingUnit = dept.AccountingUnit,
Department = dept.Department,
Number = dept.Number + dept.ManagerNumber,
......@@ -272,6 +279,8 @@ private PerSheet ComputeDoctor(IEnumerable<PerDataAccountBaisc> dataList, List<P
data.Add(doctor);
}
}
var multi = data.GroupBy(t => t.AccountingUnit)
.Select(t => new
{
......@@ -319,6 +328,7 @@ private PerSheet ComputeNurse(IEnumerable<PerDataAccountBaisc> dataList, List<Pe
var workNurse = workloadData.FirstOrDefault(t => t.UnitType == "护理组" && t.AccountingUnit == dept.Department);
var nurse = new PerDataAccountNurse
{
UnitType = dept.UnitType.Value,
AccountingUnit = dept.AccountingUnit,
Department = dept.Department,
Number = dept.Number + dept.ManagerNumber,
......
......@@ -56,7 +56,7 @@ public List<res_baiscnorm> Compute(per_allot allot, PerExcel excel, List<PerShee
//计算 绩效标准 基数(科主任、副主任、护士长 =>> 平均值)
List<res_baiscnorm> baiscnormList = new List<res_baiscnorm>();
baiscNormService.ComputeAvg(baiscnormList, accountbasicList, computResult);
baiscNormService.DocterNurseBaiscnorm(baiscnormList, accountbasicList, perSheets, empolyeeList);
baiscNormService.DocterNurseBaiscnorm(baiscnormList, accountbasicList, perSheets);
var computResult2 = computeDirector.Compute(computeEmployees, allot, baiscnormList);
//计算 行政人员 平均值
......
......@@ -163,20 +163,24 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
decimal? number, perforTotal, avg;
if (accountbasic.UnitType == (int)UnitType.护理组)
{
var resAccount = nurseList.FirstOrDefault(t => t.AccountingUnit == accountbasic.DoctorAccountingUnit);
number = resAccount?.Number;
perforTotal = resAccount?.PerforTotal;
avg = resAccount?.Avg;
var resAccount = nurseList.Where(t => t.AccountingUnit == accountbasic.DoctorAccountingUnit);
number = resAccount.Max(t => t.Number);
perforTotal = resAccount.Max(t => t.PerforTotal);
avg = resAccount.Max(t => t.PerforTotal);
}
else
{
var resAccount = doctorList.FirstOrDefault(t => t.AccountingUnit == accountbasic.DoctorAccountingUnit);
number = resAccount?.Number;
perforTotal = resAccount?.PerforTotal;
avg = resAccount?.Avg;
var resAccount = doctorList.Where(t => t.AccountingUnit == accountbasic.DoctorAccountingUnit);
number = resAccount.Max(t => t.Number);
perforTotal = resAccount.Max(t => t.PerforTotal);
avg = resAccount.Max(t => t.PerforTotal);
}
var basicRule = basicRuleList.FirstOrDefault(t => t.UnitType == (UnitType)accountbasic.UnitType);
var empolyee = empolyeeList.FirstOrDefault(t => t.AccountType == basicRule.AccountUnitType.ToString() && t.FitPeople.Trim() == EnumHelper.GetDescription(basicRule.PerforType));
var empolyee = empolyeeList.FirstOrDefault(t =>
t.AccountType == basicRule.AccountUnitType.ToString()
&& t.AccountingUnit == accountbasic.DoctorAccountingUnit
&& t.FitPeople.Trim() == EnumHelper.GetDescription(basicRule.PerforType));
if (empolyee == null)
{
empolyee = new ComputeEmployee
......
......@@ -101,7 +101,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
public (PerSheet Sheet, List<PerData> PerData) TwiceCompute(PerSheet sheet)
{
//获取最大列坐标位置
int thiscell = sheet.PerHeader.OrderByDescending(t => t.PointCell).FirstOrDefault().Children.Max(t => t.PointCell) + 1;
int thiscell = sheet.PerHeader.OrderByDescending(t => t.PointCell).FirstOrDefault().PointCell + 1;
PerHeader perHead = new PerHeader(0, thiscell, "工作量绩效合计", 0, 2, 1, new List<PerHeader>(), 1);
var dataList = sheet.PerData.Select(t => (PerData)t);
......
......@@ -35,7 +35,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
unifyUnit.UnitType = UnitType(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.ManagerNumber = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元科主任/护士长数量").PointCell)?.ToString());
unifyUnit.ManagerNumber = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科主任/护士长人数").PointCell)?.ToString());
unifyUnit.Number = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元人员数量").PointCell)?.ToString());
unifyUnit.BasicFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "预算比例").PointCell)?.ToString());
unifyUnit.SlopeFactor = ConvertHelper.To<decimal>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "倾斜系数").PointCell)?.ToString());
......
......@@ -16,16 +16,16 @@ public class PerSheetDataReadWorkload : IPerSheetDataRead
public PerSheetPoint Point => new PerSheetPoint
{
HeaderFirstRowNum = 1,
HeaderLastRowNum = 2,
HeaderLastRowNum = 1,
HeaderFirstCellNum = 0,
DataFirstRowNum = 4,
DataFirstRowNum = 3,
AccountingUnit = new List<AccountingUnit>
{
new AccountingUnit
{
AccountingUnitCellNum = 0,
DeptCellNum = 1,
FactorRow = 3
FactorRow = 2
}
}
};
......
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