测算BUG

parent 18c77ade
......@@ -1182,6 +1182,11 @@
数据开始行
</summary>
</member>
<member name="P:Performance.DtoModels.PerSheetPoint.TotalCellNum">
<summary>
汇总列
</summary>
</member>
<member name="P:Performance.DtoModels.AccountingUnit.FactorRow">
<summary>
系数行号
......
......@@ -2044,6 +2044,16 @@
科室名称
</summary>
</member>
<member name="P:Performance.EntityModels.im_data.EmployeeName">
<summary>
人员姓名
</summary>
</member>
<member name="P:Performance.EntityModels.im_data.JobNumber">
<summary>
人员工号
</summary>
</member>
<member name="P:Performance.EntityModels.im_data.TypeName">
<summary>
列头类型名称
......
......@@ -33,6 +33,12 @@ public enum UnitType
其他护理组 = 8,
[Description("其他医技组")]
其他医技组 = 9,
[Description("行政高层")]
行政高层 = 10,
[Description("行政中层")]
行政中层 = 11,
[Description("行政工勤")]
行政工勤 = 12,
}
public enum SheetType
......
......@@ -41,7 +41,7 @@ public class PerSheetHeader
("职务分类", (t) => t.JobTitle, 1, 1, false, true, false, "JobTitle"),
//("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false, "PostCoefficient"),
("基础绩效系数", (t) => Math.Round(t.Basics.Value * 100, 2), 1, 1, false, true, false, "Basics"),
("效率绩效人数", (t) => Math.Round((t.PermanentStaff ?? 0) * 100, 2), 1, 1, false, true, true, "PermanentStaff"),
("效率绩效人数", (t) => t.PermanentStaff, 1, 1, false, true, true, "PermanentStaff"),
("效率绩效系数", (t) => Math.Round(t.Efficiency.Value * 100, 2), 1, 1, false, true, true, "Efficiency"),
("规模绩效系数", (t) => Math.Round(t.Scale.Value * 100, 2), 1, 1, false, true, true, "Scale"),
("管理绩效发放系数", (t) => Math.Round(t.Management.Value * 100, 2), 1, 1, false, true, true, "Management"),
......
......@@ -27,6 +27,10 @@ public class PerSheetPoint
public int? DataFirstRowNum { get; set; }
public List<AccountingUnit> AccountingUnit { get; set; }
/// <summary>
/// 汇总列
/// </summary>
public int? TotalCellNum { get; set; }
}
public class AccountingUnit
......
......@@ -50,7 +50,16 @@ public class im_data
/// 科室名称
/// </summary>
public string Department { get; set; }
/// <summary>
/// 人员姓名
/// </summary>
public string EmployeeName { get; set; }
/// <summary>
/// 人员工号
/// </summary>
public string JobNumber { get; set; }
/// <summary>
/// 列头类型名称
/// </summary>
......
......@@ -245,7 +245,7 @@ private void SaveLogisticsEmployee(PerSheet sheet, int allotId)
var imdata = Mapper.Map<im_employee_logistics>(data);
imdata.SheetID = imsheet.ID;
imdata.AllotID = allotId;
//imdata.OtherPerfor = data.OthePerfor;
imdata.OtherPerfor = data.OthePerfor;
addList.Add(imdata);
}
perforImemployeelogisticsRepository.AddRange(addList.ToArray());
......
......@@ -341,23 +341,26 @@ public void Save(List<PerSheet> perSheets, int allotId)
if (!empolyees.Any()) continue;
//科室奖罚汇总结果
var extra = extras.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == resAccount.AccountingUnit)?.TotelValue;
var drugExtra = drugExtras.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == resAccount.AccountingUnit)?.TotelValue;
var materialsExtra = materialsExtras.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == resAccount.AccountingUnit)?.TotelValue;
var extra = extras.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == account.AccountingUnit)?.TotelValue;
//var drugExtra = drugExtras.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == resAccount.AccountingUnit)?.TotelValue;
//var materialsExtra = materialsExtras.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == resAccount.AccountingUnit)?.TotelValue;
var dept = new PerDataAccountBaisc();
//dept.ManagerNumber = resAccount?.ManagerNumber ?? 0;
dept.Number = empolyees.Count();
dept.AccountingUnit = account.AccountingUnit;
//dept.UnitType = account.AccountType;
dept.UnitType = account.AccountType;
dept.ScoringAverage = resAccount?.ScoringAverage == null ? 0 : resAccount.ScoringAverage;
dept.AdjustFactor = resAccount?.AdjustFactor == null ? 1 : resAccount.AdjustFactor;
dept.Income = empolyees.Sum(w => w.PerforTotal ?? 0);
dept.Extra = (extra ?? 0);
dept.MedicineExtra = (drugExtra ?? 0);
dept.MaterialsExtra = (materialsExtra ?? 0);
dept.MedicineExtra = 0;// (drugExtra ?? 0);
dept.MaterialsExtra = 0;//(materialsExtra ?? 0);
dept.PerforFee = empolyees.Sum(w => w.PerforTotal ?? 0);
dept.PerforTotal = Math.Round((dept.PerforFee + (dept?.OtherPerfor1 ?? 0)) ?? 0);
dept.RealGiveFee = Math.Round(((dept.PerforTotal * dept.ScoringAverage + dept.MedicineExtra + dept.MaterialsExtra + dept.OtherPerfor2 + (extra ?? 0)) * dept.AdjustFactor) ?? 0);
dept.Avg = dept.ManagerNumber + dept.Number == 0 ? 0 : dept.PerforTotal / (dept.ManagerNumber + dept.Number);
//dept.Avg = dept.ManagerNumber + dept.Number == 0 ? 0 : dept.PerforTotal / (dept.ManagerNumber + dept.Number);
dept.Avg = dept.Number == 0 ? 0 : dept.PerforTotal / dept.Number;
perDatas.Add(dept);
}
......@@ -376,16 +379,20 @@ public void Save(List<PerSheet> perSheets, int allotId)
/// 获取科室奖罚汇总结果
/// </summary>
/// <param name="excel"></param>
public IEnumerable<AccountUnitTotal> GetAccountExtra(PerExcel excel, SheetType sheetType)
public IEnumerable<AccountUnitTotal> GetAccountExtra(PerExcel excel, SheetType sheetType, bool isTotal = false)
{
var assessList = excel.PerSheet
.FirstOrDefault(t => t.SheetType == sheetType)
?.PerData
?.Select(t => (PerData)t);
assessList = (isTotal)
? assessList?.Where(w => w.IsTotal == 1)
: assessList?.Where(w => w.IsTotal != 1);
return assessList
?.GroupBy(t => new { t.UnitType, t.AccountingUnit })
?.Select(t => new AccountUnitTotal { UnitType = t.Key.UnitType, AccountingUnit = t.Key.AccountingUnit, TotelValue = t.Sum(g => g.CellValue) });
?.GroupBy(t => new { t.UnitType, t.AccountingUnit })
?.Select(t => new AccountUnitTotal { UnitType = t.Key.UnitType, AccountingUnit = t.Key.AccountingUnit, TotelValue = t.Sum(g => g.CellValue) });
}
/// <summary>
......@@ -397,7 +404,8 @@ public IEnumerable<EmpolyeeTotal> GetEmployeeExtra(PerExcel excel)
var assessList = excel.PerSheet
.FirstOrDefault(t => t.SheetType == SheetType.PersonExtra)
?.PerData
?.Select(t => (PerData)t);
?.Select(t => (PerData)t)
?.Where(w => w.IsTotal != 1);
return assessList
?.GroupBy(t => new
......
......@@ -131,7 +131,7 @@ public class ResultComputeService : IAutoInjection
foreach (var group in groupSpeList)
{
// 获取科室测算信息
var dept = accountList?.FirstOrDefault(t => t.UnitType == UnitType.特殊核算组.ToString() && !string.IsNullOrEmpty(t.AccountingUnit));
var dept = accountList?.FirstOrDefault(t => t.UnitType == UnitType.特殊核算组.ToString() && t.AccountingUnit == group.AccountingUnit);
//获取需要聚合的科室
var accountDataList = dataList.Where(t => t.AccountingUnit == group.AccountingUnit);
//计算量化指标子项合计
......
......@@ -346,10 +346,10 @@ public void Generate(per_allot allot, string mail)
var accountExtras = processComputService.GetAccountExtra(excel, SheetType.AccountExtra);
// 科室药占比考核
logManageService.WriteMsg("正在生成绩效", "科室药占比考核", 1, allot.ID, "ReceiveMessage", true);
var drugExtras = processComputService.GetAccountExtra(excel, SheetType.AccountDrugAssess);
var drugExtras = processComputService.GetAccountExtra(excel, SheetType.AccountDrugAssess, true);
// 科室材料占比考核
logManageService.WriteMsg("正在生成绩效", "科室材料占比考核", 1, allot.ID, "ReceiveMessage", true);
var materialsExtras = processComputService.GetAccountExtra(excel, SheetType.AccountMaterialsAssess);
var materialsExtras = processComputService.GetAccountExtra(excel, SheetType.AccountMaterialsAssess, true);
////科室药占比考核
//logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true);
......
......@@ -259,7 +259,9 @@ public List<DeptResponse> GetOtherPerformance(int allotId)
/// <returns></returns>
public List<DeptResponse> GetOfficePerformance(int allotId)
{
var list = perforResaccountRepository.GetEntities(t => t.UnitType == -1 && t.AllotID == allotId)
var unitType = new List<int> { (int)UnitType.行政中层, (int)UnitType.行政工勤 };
var list = perforResaccountRepository.GetEntities(t => unitType.Contains(t.UnitType.Value) && t.AllotID == allotId)
?.OrderBy(t => t.UnitType)
.ThenByDescending(t => t.AccountingUnit);
List<DeptResponse> other = Mapper.Map<List<DeptResponse>>(list);
......
......@@ -19,6 +19,7 @@ public class PerSheetDataReadAccountExtra : IPerSheetDataRead
HeaderLastRowNum = 1,
HeaderFirstCellNum = 0,
DataFirstRowNum = 2,
TotalCellNum = 0,
AccountingUnit = new List<AccountingUnit>
{
new AccountingUnit
......@@ -36,14 +37,16 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
var unit = Point.AccountingUnit.First();
//查询除了 核算单元 科室名称 有效数据列头位置
var vhead = perHeader.Where(t => t.PointCell != unit.UnitTypeNum && t.PointCell != unit.AccountingUnitCellNum && t.PointCell != unit.DeptCellNum).OrderBy(t => t.PointCell);
//var vhead = perHeader.Where(t => t.PointCell != unit.UnitTypeNum && t.PointCell != unit.AccountingUnitCellNum && t.PointCell != unit.DeptCellNum)
// .OrderBy(t => t.PointCell);
var vhead = perHeader.OrderBy(t => t.PointCell);
for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{
var row = sheet.GetRow(r);
if (row == null) continue;
for (int c = 1; c < vhead.Count(); c++)
for (int c = 0; c < vhead.Count(); c++)
{
var athead = vhead.ElementAt(c);
var cellValue = NopiSevice.GetCellValue(row.GetCell(athead.PointCell));
......@@ -62,6 +65,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
FactorValue = 1,
IsFactor = true,
};
if (Point.TotalCellNum.HasValue && athead.PointCell == Point.TotalCellNum)
data.IsTotal = 1;
if (unit.DeptCellNum.HasValue)
data.Department = NopiSevice.GetCellStringValue(row.GetCell(unit.DeptCellNum.Value));
if (unit.EmpNameCellNum.HasValue)
......
......@@ -24,7 +24,7 @@ public class PerSheetDataReadDeptAccountingSpecial : IPerSheetDataRead
new AccountingUnit
{
AccountingUnitCellNum = 1,
DeptCellNum = 2,
//DeptCellNum = 2,
}
}
};
......@@ -35,7 +35,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
var unit = Point.AccountingUnit.First();
//查询除了 核算单元 科室名称 有效数据列头位置
var vhead = perHeader.Where(t => t.PointCell > unit.DeptCellNum).OrderBy(t => t.PointCell);
var vhead = perHeader.OrderBy(t => t.PointCell);
for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{
......@@ -54,7 +54,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
RowNumber = r,
SignID = athead.SignID,
AccountingUnit = NopiSevice.GetCellStringValue(row.GetCell(unit.AccountingUnitCellNum.Value)),
Department = NopiSevice.GetCellStringValue(row.GetCell(unit.DeptCellNum.Value)),
//Department = NopiSevice.GetCellStringValue(row.GetCell(unit.DeptCellNum.Value)),
TypeName = athead?.CellValue,
CellValue = cellValue,
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
......
......@@ -19,6 +19,7 @@ public class PerSheetDataReadPersonExtra : IPerSheetDataRead
HeaderLastRowNum = 1,
HeaderFirstCellNum = 0,
DataFirstRowNum = 2,
TotalCellNum = 0,
AccountingUnit = new List<AccountingUnit>
{
new AccountingUnit
......@@ -44,7 +45,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
var row = sheet.GetRow(r);
if (row == null) continue;
for (int c = 1; c < vhead.Count(); c++)
for (int c = 0; c < vhead.Count(); c++)
{
var athead = vhead.ElementAt(c);
var cellValue = NopiSevice.GetCellValue(row.GetCell(athead.PointCell));
......@@ -63,6 +64,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
FactorValue = 1,
IsFactor = true,
};
if (Point.TotalCellNum.HasValue && athead.PointCell == Point.TotalCellNum)
data.IsTotal = 1;
if (unit.DeptCellNum.HasValue)
data.Department = NopiSevice.GetCellStringValue(row.GetCell(unit.DeptCellNum.Value));
if (unit.EmpNameCellNum.HasValue)
......
......@@ -275,6 +275,16 @@ private void CommonExport(int sheetID, SheetExportResponse response)
var value = dataList.FirstOrDefault(t => t.RowNumber == rowNumber);
rowbody.Data.Add(new Cell(head.PointCell.Value, value.Remark, 1, 1, false, false, "", value.ID, head.CellValue));
}
else if (head.CellValue.Contains("人员工号"))
{
var value = dataList.FirstOrDefault(t => t.RowNumber == rowNumber).JobNumber;
rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1, false, false));
}
else if (head.CellValue.Contains("医生姓名"))
{
var value = dataList.FirstOrDefault(t => t.RowNumber == rowNumber).EmployeeName;
rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1, false, false));
}
else if (!rowbody.Data.Any(t => t.PointCell == head.PointCell))
{
var data = dataList.FirstOrDefault(t => t.RowNumber == rowNumber && t.SignID == head.SignID);
......
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