Commit 7e4c9653 by lcx

Excel读取5.1 科室绩效详情返回增加 5.1内容

parent 072dee28
...@@ -634,6 +634,9 @@ ...@@ -634,6 +634,9 @@
<member name="F:Performance.DtoModels.SheetType.AccountBasicSpecial"> <member name="F:Performance.DtoModels.SheetType.AccountBasicSpecial">
<summary> 特殊临床科室医护绩效测算基础 </summary> <summary> 特殊临床科室医护绩效测算基础 </summary>
</member> </member>
<member name="F:Performance.DtoModels.SheetType.AccountAssess">
<summary> 临床科室医护绩效考核表 </summary>
</member>
<member name="T:Performance.DtoModels.AccountUnitType"> <member name="T:Performance.DtoModels.AccountUnitType">
<summary> <summary>
核算单元类型 核算单元类型
...@@ -1192,6 +1195,11 @@ ...@@ -1192,6 +1195,11 @@
科室名称 科室名称
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.AccountingUnit.UnitTypeNum">
<summary>
核算单元类型列
</summary>
</member>
<member name="P:Performance.DtoModels.AccountingUnit.UnitType"> <member name="P:Performance.DtoModels.AccountingUnit.UnitType">
<summary> <summary>
核算单元类型 核算单元类型
......
...@@ -88,6 +88,10 @@ public enum SheetType ...@@ -88,6 +88,10 @@ public enum SheetType
/// <summary> 特殊临床科室医护绩效测算基础 </summary> /// <summary> 特殊临床科室医护绩效测算基础 </summary>
[Description("特殊临床科室医护绩效测算基础")] [Description("特殊临床科室医护绩效测算基础")]
AccountBasicSpecial = 16, AccountBasicSpecial = 16,
/// <summary> 临床科室医护绩效考核表 </summary>
[Description("临床科室医护绩效考核表")]
AccountAssess = 17,
} }
/// <summary> /// <summary>
......
...@@ -44,6 +44,10 @@ public class AccountingUnit ...@@ -44,6 +44,10 @@ public class AccountingUnit
/// </summary> /// </summary>
public int? DeptCellNum { get; set; } public int? DeptCellNum { get; set; }
/// <summary> /// <summary>
/// 核算单元类型列
/// </summary>
public int? UnitTypeNum { get; set; }
/// <summary>
/// 核算单元类型 /// 核算单元类型
/// </summary> /// </summary>
public string UnitType { get; set; } public string UnitType { get; set; }
......
...@@ -241,11 +241,25 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -241,11 +241,25 @@ public void Save(List<PerSheet> perSheets, int allotId)
/// <param name="economicData"></param> /// <param name="economicData"></param>
/// <param name="workloadData"></param> /// <param name="workloadData"></param>
/// <returns></returns> /// <returns></returns>
public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_baiscnorm> baiscnormList) public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_baiscnorm> baiscnormList, bool isFirst = false)
{ {
var deptAccounting = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic); var deptAccounting = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic);
var accountList = deptAccounting.PerData.Select(t => (PerDataAccountBaisc)t); var accountList = deptAccounting.PerData.Select(t => (PerDataAccountBaisc)t);
var deptAccountAssess = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountAssess);
var assessList = deptAccountAssess.PerData.Select(t => (PerData)t);
var deptExtra = new List<PerData>();
if (isFirst && assessList != null && assessList.Any())
{
deptExtra = assessList.GroupBy(t => new { t.UnitType, t.AccountingUnit, t.Department }).Select(t => new PerData
{
UnitType = t.Key.UnitType,
AccountingUnit = t.Key.AccountingUnit,
Department = t.Key.Department,
CellValue = t.Sum(g => g.CellValue)
}).ToList();
}
var economicData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeEconomic)?.PerData.Select(t => (PerData)t); var economicData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeEconomic)?.PerData.Select(t => (PerData)t);
var doctorWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeDoctorWorkload)?.PerData.Select(t => (PerData)t); var doctorWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeDoctorWorkload)?.PerData.Select(t => (PerData)t);
var nurseWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseWorkload)?.PerData.Select(t => (PerData)t); var nurseWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseWorkload)?.PerData.Select(t => (PerData)t);
...@@ -291,6 +305,10 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_ ...@@ -291,6 +305,10 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_
dept.MinimumFee = minimum.AvgValue * (dept.MinimumFactor ?? 0) * (dept.ManagerNumber + dept.Number); dept.MinimumFee = minimum.AvgValue * (dept.MinimumFactor ?? 0) * (dept.ManagerNumber + dept.Number);
} }
var extra = deptExtra.FirstOrDefault(t => t.AccountingUnit == dept.AccountingUnit && t.UnitType == dept.UnitType && t.Department == dept.Department);
if (isFirst && extra != null)
dept.Extra += extra.CellValue ?? 0;
dept.ScoringAverage = dept.ScoringAverage == 0m ? 1 : dept.ScoringAverage; dept.ScoringAverage = dept.ScoringAverage == 0m ? 1 : dept.ScoringAverage;
dept.AdjustFactor = dept.AdjustFactor == 0m ? 1 : dept.AdjustFactor; dept.AdjustFactor = dept.AdjustFactor == 0m ? 1 : dept.AdjustFactor;
dept.WorkSlopeFactor = dept.WorkSlopeFactor == 0m ? 1 : dept.WorkSlopeFactor; dept.WorkSlopeFactor = dept.WorkSlopeFactor == 0m ? 1 : dept.WorkSlopeFactor;
......
...@@ -317,7 +317,7 @@ public void Generate(per_allot allot, string mail) ...@@ -317,7 +317,7 @@ public void Generate(per_allot allot, string mail)
//计算科室业绩(含保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效)保底绩效 //计算科室业绩(含保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效)保底绩效
logManageService.WriteMsg("计算保底绩效参考标准值", "计算科室业绩", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("计算保底绩效参考标准值", "计算科室业绩", 1, allot.ID, "ReceiveMessage", true);
var sheet = processComputService.Compute(excel, mergeSheets, minimumBaiscnorm); var sheet = processComputService.Compute(excel, mergeSheets, minimumBaiscnorm, true);
//计算科室自定义保底绩效范围 //计算科室自定义保底绩效范围
logManageService.WriteMsg("计算保底绩效参考标准值", "正在计算科室自定义保底绩效范围", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("计算保底绩效参考标准值", "正在计算科室自定义保底绩效范围", 1, allot.ID, "ReceiveMessage", true);
......
...@@ -540,7 +540,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId) ...@@ -540,7 +540,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
int groupbasis = 1; int groupbasis = 1;
string single = ""; string single = "";
var sheetType = new List<int> { (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload }; var sheetType = new List<int> { (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload, (int)SheetType.AccountAssess };
foreach (var stype in sheetType) foreach (var stype in sheetType)
{ {
if (type == 3 && stype == (int)SheetType.Workload) type = 1; if (type == 3 && stype == (int)SheetType.Workload) type = 1;
...@@ -556,12 +556,29 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId) ...@@ -556,12 +556,29 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
var headerData = headers?.Where(t => t.SheetID == sheet.ID); var headerData = headers?.Where(t => t.SheetID == sheet.ID);
var sheettype = 1; //特殊核算科室 4
var amount = 0m;
if (sheet.SheetType == (int)SheetType.Expend)
{
sheettype = 2;
amount = economic.FirstOrDefault(t => t.ItemName.Contains(sheetName) && t.UnitType == type)?.ItemValue ?? 0m;
}
else if (sheet.SheetType == (int)SheetType.Workload)
{
sheettype = 3;
amount = doctor.WorkloadFee ?? 0m;
}
else if (sheet.SheetType == (int)SheetType.AccountAssess)
{
sheettype = 5;
amount = sheetData.Sum(t => t.CellValue ?? 0m);
}
var item = new DetailDtos var item = new DetailDtos
{ {
ItemName = sheetName, ItemName = sheetName,
IncomeType = sheet.SheetType == (int)SheetType.Expend ? 2 : sheet.SheetType == (int)SheetType.Workload ? 3 : 1, IncomeType = sheettype,
Amount = (sheet.SheetType == (int)SheetType.Workload ? doctor.WorkloadFee Amount = amount,
: economic.FirstOrDefault(t => t.ItemName.Contains(sheetName) && t.UnitType == type)?.ItemValue) ?? 0m,
GroupBasis = groupbasis, GroupBasis = groupbasis,
}; };
......
...@@ -53,6 +53,9 @@ public static IPerSheetDataRead GetDataRead(SheetType sheetType, bool isnew = fa ...@@ -53,6 +53,9 @@ public static IPerSheetDataRead GetDataRead(SheetType sheetType, bool isnew = fa
case SheetType.AccountBasicSpecial: case SheetType.AccountBasicSpecial:
dataread = new PerSheetDataReadDeptAccountingSpecial(); dataread = new PerSheetDataReadDeptAccountingSpecial();
break; break;
case SheetType.AccountAssess:
dataread = new PerSheetDataReadAccountAssess();
break;
} }
return dataread; return dataread;
} }
......
...@@ -94,6 +94,8 @@ public SheetType GetSheetType(string sheetName) ...@@ -94,6 +94,8 @@ public SheetType GetSheetType(string sheetName)
return SheetType.AccountBasic; return SheetType.AccountBasic;
else if (sheetName.StartsWith("4.2")) else if (sheetName.StartsWith("4.2"))
return SheetType.SpecialUnit; return SheetType.SpecialUnit;
else if (sheetName.StartsWith("5.1"))
return SheetType.AccountAssess;
return SheetType.Unidentifiable; return SheetType.Unidentifiable;
} }
} }
......
using NPOI.SS.UserModel;
using Performance.DtoModels;
using Performance.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Performance.Services
{
public class PerSheetDataReadAccountAssess : IPerSheetDataRead
{
public PerSheetPoint Point => new PerSheetPoint
{
HeaderFirstRowNum = 1,
HeaderLastRowNum = 1,
HeaderFirstCellNum = 0,
DataFirstRowNum = 2,
AccountingUnit = new List<AccountingUnit>
{
new AccountingUnit
{
UnitTypeNum = 1,
AccountingUnitCellNum = 2,
DeptCellNum = 3,
}
}
};
public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
List<IPerData> dataList = new List<IPerData>();
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);
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++)
{
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,
UnitType = NopiSevice.GetCellStringValue(row.GetCell(unit.UnitTypeNum.Value)),
AccountingUnit = NopiSevice.GetCellStringValue(row.GetCell(unit.AccountingUnitCellNum.Value)),
Department = NopiSevice.GetCellStringValue(row.GetCell(unit.DeptCellNum.Value)),
TypeName = athead?.CellValue,
CellValue = cellValue,
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
FactorValue = 1,
IsFactor = true,
};
if (string.IsNullOrEmpty(data.AccountingUnit) && string.IsNullOrEmpty(data.Department))
continue;
dataList.Add(data);
}
}
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