Commit ff42a0f6 by lcx

显示系数修改为百分比,抽取时收入列头取提取数据中的category

parent a53d3791
...@@ -413,7 +413,7 @@ public DeptDataDetails DeptDetail(int accountId) ...@@ -413,7 +413,7 @@ public DeptDataDetails DeptDetail(int accountId)
{ {
ItemName = t.TypeName, ItemName = t.TypeName,
CellValue = t.CellValue, CellValue = t.CellValue,
Factor = t.FactorValue, Factor = t.FactorValue * 100,
ItemValue = t.IsFactor == 1 ? (t.CellValue * (t.FactorValue ?? 0)) : t.CellValue ItemValue = t.IsFactor == 1 ? (t.CellValue * (t.FactorValue ?? 0)) : t.CellValue
}).ToList() }).ToList()
}; };
......
...@@ -409,8 +409,6 @@ private void WriteIncome(ISheet sheet, IPerSheetDataRead sheetRead, List<Account ...@@ -409,8 +409,6 @@ private void WriteIncome(ISheet sheet, IPerSheetDataRead sheetRead, List<Account
logger.LogInformation($"item有{itemList?.Count ?? 0}个."); logger.LogInformation($"item有{itemList?.Count ?? 0}个.");
if (itemList == null || !itemList.Any()) return; if (itemList == null || !itemList.Any()) return;
WriteHeaderAndFactor(sheet, sheetRead, itemList, isNewTemp);
//查询数据 //查询数据
var extractList = extracts.Where(t => module.ExtractId == t.Id).ToList(); var extractList = extracts.Where(t => module.ExtractId == t.Id).ToList();
if (extractList == null || extractList.Count == 0) return; if (extractList == null || extractList.Count == 0) return;
...@@ -428,7 +426,11 @@ private void WriteIncome(ISheet sheet, IPerSheetDataRead sheetRead, List<Account ...@@ -428,7 +426,11 @@ private void WriteIncome(ISheet sheet, IPerSheetDataRead sheetRead, List<Account
allExtract.AddRange(result); allExtract.AddRange(result);
} }
WriteSheetData(sheet, sheetRead, unitList, allExtract, itemList.Select(t => t.ItemName), isNewTemp, true); logger.LogInformation($"{sheet.SheetName}合计值为: " + allExtract.Sum(t => t.Value));
var category = allExtract.Select(t => t.Category).Distinct().ToList();
WriteIncomeHeaderAndFactor(sheet, sheetRead, category, isNewTemp);
WriteSheetData(sheet, sheetRead, unitList, allExtract, category, isNewTemp, true);
logger.LogInformation($"{sheet.SheetName}提取结束."); logger.LogInformation($"{sheet.SheetName}提取结束.");
} }
...@@ -503,6 +505,7 @@ private void WriteWorkload(ISheet sheet, IPerSheetDataRead sheetRead, List<Accou ...@@ -503,6 +505,7 @@ private void WriteWorkload(ISheet sheet, IPerSheetDataRead sheetRead, List<Accou
var result = QueryDatabase(config, item, Allot, moditem.ItemName); var result = QueryDatabase(config, item, Allot, moditem.ItemName);
if (result != null) if (result != null)
allExtract.AddRange(result); allExtract.AddRange(result);
logger.LogInformation($"{module.ModuleName}提取{moditem.ItemName}的合计值为: " + allExtract.Sum(t => t.Value));
} }
} }
...@@ -711,6 +714,7 @@ private void WriteHeaderAndFactor(ISheet sheet, IPerSheetDataRead sheetRead, Lis ...@@ -711,6 +714,7 @@ private void WriteHeaderAndFactor(ISheet sheet, IPerSheetDataRead sheetRead, Lis
cellItems.AddRange(items); cellItems.AddRange(items);
if (!isNewTemp) if (!isNewTemp)
{ {
List<string> original = new List<string>();
#region 过滤历史模板中已有的列头 #region 过滤历史模板中已有的列头
//写入列头信息 //写入列头信息
int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 4; int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 4;
...@@ -749,6 +753,69 @@ private void WriteHeaderAndFactor(ISheet sheet, IPerSheetDataRead sheetRead, Lis ...@@ -749,6 +753,69 @@ private void WriteHeaderAndFactor(ISheet sheet, IPerSheetDataRead sheetRead, Lis
#endregion #endregion
} }
/// <summary>
/// 写入列头
/// </summary>
/// <param name="sheet"></param>
/// <param name="sheetRead"></param>
/// <param name="items">列头数据(列名、系数)</param>
/// <param name="isNewTemp">是否为空白模板</param>
private void WriteIncomeHeaderAndFactor(ISheet sheet, IPerSheetDataRead sheetRead, List<string> items, bool isNewTemp)
{
var nurseFactor = sheet.GetRow(sheetRead.Point.AccountingUnit.First(t => t.UnitType == "护理组").FactorRow.Value);
var doctorFactor = sheet.GetRow(sheetRead.Point.AccountingUnit.First(t => t.UnitType == "医生组").FactorRow.Value);
var technicianFactor = sheet.GetRow(sheetRead.Point.AccountingUnit.First(t => t.UnitType == "医技组").FactorRow.Value);
var head = GetOrCreate(sheet, sheetRead.Point.HeaderFirstRowNum.Value);
logManageService.WriteMsg("提取绩效数据", $"写入列头信息 -- {sheet.SheetName}", 1, Allot.ID, "ReceiveMessage");
logger.LogInformation($"提取绩效数据 提取绩效数据 写入列头信息 -- {sheet.SheetName}");
logger.LogInformation($"{sheet.SheetName}查询出的列头有:" + string.Join(", ", items));
if (!isNewTemp)
{
List<string> original = new List<string>();
#region 过滤历史模板中已有的列头
//写入列头信息
int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 4;
for (int i = cellStartIndex; i < head.LastCellNum; i++)
{
var cellvalue = head.GetCell(i)?.ToString();
if (string.IsNullOrEmpty(cellvalue)) continue;
items.Remove(cellvalue);
}
#endregion
}
if (items == null || !items.Any()) return;
logger.LogInformation($"{sheet.SheetName}需要新增的列头有:" + string.Join(", ", items));
#region 新增模板中不存在的列头
var lastcellIndex = isNewTemp ? sheetRead.Point.HeaderFirstCellNum.Value + 4 : head.LastCellNum;
foreach (var item in items)
{
var headcell = GetOrCreate(head, lastcellIndex);
headcell.SetCellValue(item);
headcell.CellStyle = CellStyle.CreateCellStyle(workbook, StyleType.列头);
var doctorcell = GetOrCreate(doctorFactor, lastcellIndex);
doctorcell.SetCellValue(0);
doctorcell.CellStyle = CellStyle.CreateCellStyle(workbook, StyleType.系数, CellFormat.百分比);
var nursecell = GetOrCreate(nurseFactor, lastcellIndex);
nursecell.SetCellValue(0);
nursecell.CellStyle = CellStyle.CreateCellStyle(workbook, StyleType.系数, CellFormat.百分比);
var techniciancell = GetOrCreate(technicianFactor, lastcellIndex);
techniciancell.SetCellValue(0);
techniciancell.CellStyle = CellStyle.CreateCellStyle(workbook, StyleType.系数, CellFormat.百分比);
lastcellIndex++;
}
#endregion
}
/// <summary> /// <summary>
/// 写入数据 /// 写入数据
/// </summary> /// </summary>
...@@ -1026,7 +1093,7 @@ private List<ExtractDto> QueryDatabase(sys_hospitalconfig config, mod_extract ex ...@@ -1026,7 +1093,7 @@ private List<ExtractDto> QueryDatabase(sys_hospitalconfig config, mod_extract ex
item.Category = category; item.Category = category;
} }
} }
return result.ToList(); return result.Where(t => !string.IsNullOrEmpty(t.Category)).ToList();
} }
} }
return null; return null;
......
...@@ -25,6 +25,7 @@ public class SheetSevice : IAutoInjection ...@@ -25,6 +25,7 @@ public class SheetSevice : IAutoInjection
//private PerforResaccountnurseRepository _perforImaccountnurseRepository; //private PerforResaccountnurseRepository _perforImaccountnurseRepository;
private PerforImspecialunitRepository _perforImspecialunitRepository; private PerforImspecialunitRepository _perforImspecialunitRepository;
private PerforImemployeeclinicRepository _perforImemployeeclinicRepository; private PerforImemployeeclinicRepository _perforImemployeeclinicRepository;
private readonly string[] percentparam = new string[] { "预算比例", "考核得分率", "调节系数" };
public SheetSevice(PerforPerallotRepository perforAllotRepository, public SheetSevice(PerforPerallotRepository perforAllotRepository,
PerforPersheetRepository perforImSheetRepository, PerforPersheetRepository perforImSheetRepository,
...@@ -139,10 +140,10 @@ private void SpecialUnitExport(int sheetID, SheetExportResponse response) ...@@ -139,10 +140,10 @@ private void SpecialUnitExport(int sheetID, SheetExportResponse response)
rowbody.Data.Add(new Cell(4, item.QuantitativeIndicators, 1, 1, false, true)); rowbody.Data.Add(new Cell(4, item.QuantitativeIndicators, 1, 1, false, true));
rowbody.Data.Add(new Cell(5, item.Quantity, 1, 1, false, true)); rowbody.Data.Add(new Cell(5, item.Quantity, 1, 1, false, true));
rowbody.Data.Add(new Cell(6, item.QuantitativeIndicatorsValue, 1, 1, false, true)); rowbody.Data.Add(new Cell(6, item.QuantitativeIndicatorsValue, 1, 1, false, true));
rowbody.Data.Add(new Cell(7, item.ScoringAverage, 1, 1, false, true)); rowbody.Data.Add(new Cell(7, Math.Round(item.ScoringAverage.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(8, item.OtherPerfor, 1, 1, false, true)); rowbody.Data.Add(new Cell(8, item.OtherPerfor, 1, 1, false, true));
rowbody.Data.Add(new Cell(9, item.Punishment, 1, 1, false, true)); rowbody.Data.Add(new Cell(9, item.Punishment, 1, 1, false, true));
rowbody.Data.Add(new Cell(10, item.Adjust, 1, 1, false, true)); rowbody.Data.Add(new Cell(10, Math.Round(item.Adjust.Value * 100, 2) + "%", 1, 1, false, true));
response.Row.Add(rowbody); response.Row.Add(rowbody);
} }
} }
...@@ -285,7 +286,12 @@ private void CommonExport(int sheetID, SheetExportResponse response) ...@@ -285,7 +286,12 @@ private void CommonExport(int sheetID, SheetExportResponse response)
var data = dataList.FirstOrDefault(t => t.RowNumber == rowNumber && t.SignID == head.SignID); var data = dataList.FirstOrDefault(t => t.RowNumber == rowNumber && t.SignID == head.SignID);
var value = data?.CellValue; var value = data?.CellValue;
if (value.HasValue) if (value.HasValue)
{
if (!percentparam.Contains(head.CellValue))
rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1, data.IsTotal == 1, true, data.Annotation)); rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1, data.IsTotal == 1, true, data.Annotation));
else
rowbody.Data.Add(new Cell(head.PointCell.Value, Math.Round(value.Value * 100, 2) + "%", 1, 1, data.IsTotal == 1, true, data.Annotation));
}
} }
} }
} }
...@@ -453,7 +459,7 @@ private void EmployeeExport(int sheetID, SheetExportResponse response) ...@@ -453,7 +459,7 @@ private void EmployeeExport(int sheetID, SheetExportResponse response)
var row = new Row(0); var row = new Row(0);
row.Data.Add(new Cell(1, "核算单元类型", 1, 1, false, false)); row.Data.Add(new Cell(1, "核算单元类型", 1, 1, false, false));
row.Data.Add(new Cell(2, "核算单元", 1, 1, false, false)); row.Data.Add(new Cell(2, "核算单元", 1, 1, false, false));
row.Data.Add(new Cell(3, "科室", 1, 1, false, false)); row.Data.Add(new Cell(3, "人员工号", 1, 1, false, false));
row.Data.Add(new Cell(4, "医生姓名", 1, 1, false, true)); row.Data.Add(new Cell(4, "医生姓名", 1, 1, false, true));
row.Data.Add(new Cell(5, "职称", 1, 1, false, true)); row.Data.Add(new Cell(5, "职称", 1, 1, false, true));
row.Data.Add(new Cell(6, "绩效基数核算参考对象", 1, 1, false, true)); row.Data.Add(new Cell(6, "绩效基数核算参考对象", 1, 1, false, true));
...@@ -475,19 +481,19 @@ private void EmployeeExport(int sheetID, SheetExportResponse response) ...@@ -475,19 +481,19 @@ private void EmployeeExport(int sheetID, SheetExportResponse response)
var rowbody = new Row(i); var rowbody = new Row(i);
rowbody.Data.Add(new Cell(1, item.AccountType, 1, 1, false, false)); rowbody.Data.Add(new Cell(1, item.AccountType, 1, 1, false, false));
rowbody.Data.Add(new Cell(2, item.AccountingUnit, 1, 1, false, false)); rowbody.Data.Add(new Cell(2, item.AccountingUnit, 1, 1, false, false));
rowbody.Data.Add(new Cell(3, item.Department, 1, 1, false, false)); rowbody.Data.Add(new Cell(3, item.PersonnelNumber, 1, 1, false, false));
rowbody.Data.Add(new Cell(4, item.DoctorName, 1, 1, false, true)); rowbody.Data.Add(new Cell(4, item.DoctorName, 1, 1, false, true));
rowbody.Data.Add(new Cell(5, item.JobTitle, 1, 1, false, true)); rowbody.Data.Add(new Cell(5, item.JobTitle, 1, 1, false, true));
rowbody.Data.Add(new Cell(6, item.FitPeople, 1, 1, false, true)); rowbody.Data.Add(new Cell(6, item.FitPeople, 1, 1, false, true));
rowbody.Data.Add(new Cell(7, item.PostCoefficient, 1, 1, false, true)); rowbody.Data.Add(new Cell(7, item.PostCoefficient, 1, 1, false, true));
rowbody.Data.Add(new Cell(8, workTime, 1, 1, false, true)); rowbody.Data.Add(new Cell(8, workTime, 1, 1, false, true));
rowbody.Data.Add(new Cell(9, item.ScoreAverageRate, 1, 1, false, true)); rowbody.Data.Add(new Cell(9, Math.Round(item.ScoreAverageRate.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(10, item.Attendance, 1, 1, false, true)); rowbody.Data.Add(new Cell(10, Math.Round(item.Attendance.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(11, item.PeopleNumber, 1, 1, false, true)); rowbody.Data.Add(new Cell(11, item.PeopleNumber, 1, 1, false, true));
rowbody.Data.Add(new Cell(12, item.Workload, 1, 1, false, true)); rowbody.Data.Add(new Cell(12, item.Workload, 1, 1, false, true));
rowbody.Data.Add(new Cell(13, item.OtherPerfor, 1, 1, false, true)); rowbody.Data.Add(new Cell(13, item.OtherPerfor, 1, 1, false, true));
rowbody.Data.Add(new Cell(14, item.Punishment, 1, 1, false, true)); rowbody.Data.Add(new Cell(14, item.Punishment, 1, 1, false, true));
rowbody.Data.Add(new Cell(15, item.Adjust, 1, 1, false, true)); rowbody.Data.Add(new Cell(15, Math.Round(item.Adjust.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(16, item.Grant, 1, 1, false, true)); rowbody.Data.Add(new Cell(16, item.Grant, 1, 1, false, true));
response.Row.Add(rowbody); response.Row.Add(rowbody);
} }
...@@ -505,22 +511,22 @@ private void ClinicEmployeeExport(int sheetID, SheetExportResponse response) ...@@ -505,22 +511,22 @@ private void ClinicEmployeeExport(int sheetID, SheetExportResponse response)
var row = new Row(0); var row = new Row(0);
row.Data.Add(new Cell(1, "核算单元分类", 1, 1, false, false)); row.Data.Add(new Cell(1, "核算单元分类", 1, 1, false, false));
row.Data.Add(new Cell(2, "核算单元", 1, 1, false, false)); row.Data.Add(new Cell(2, "核算单元", 1, 1, false, false));
row.Data.Add(new Cell(3, "科室", 1, 1, false, false)); row.Data.Add(new Cell(3, "人员工号", 1, 1, false, false));
row.Data.Add(new Cell(4, "医生姓名", 1, 1, false, true)); row.Data.Add(new Cell(4, "医生姓名", 1, 1, false, true));
row.Data.Add(new Cell(5, "职称", 1, 1, false, true)); row.Data.Add(new Cell(5, "职称", 1, 1, false, true));
//row.Data.Add(new Cell(6, "绩效基数核算参考对象", 1, 1, false, true)); //row.Data.Add(new Cell(6, "绩效基数核算参考对象", 1, 1, false, true));
row.Data.Add(new Cell(7, "岗位系数", 1, 1, false, true)); row.Data.Add(new Cell(6, "岗位系数", 1, 1, false, true));
row.Data.Add(new Cell(8, "效率绩效系数", 1, 1, false, true)); row.Data.Add(new Cell(7, "效率绩效系数", 1, 1, false, true));
row.Data.Add(new Cell(9, "规模绩效系数", 1, 1, false, true)); row.Data.Add(new Cell(8, "规模绩效系数", 1, 1, false, true));
row.Data.Add(new Cell(10, "管理绩效发放系数", 1, 1, false, true)); row.Data.Add(new Cell(9, "管理绩效发放系数", 1, 1, false, true));
//row.Data.Add(new Cell(8, "效率绩效系数", 1, 1, false, true)); //row.Data.Add(new Cell(8, "效率绩效系数", 1, 1, false, true));
row.Data.Add(new Cell(11, "考核得分率", 1, 1, false, true)); row.Data.Add(new Cell(10, "考核得分率", 1, 1, false, true));
row.Data.Add(new Cell(12, "出勤率", 1, 1, false, true)); row.Data.Add(new Cell(11, "出勤率", 1, 1, false, true));
//row.Data.Add(new Cell(11, "核算单元医生数", 1, 1, false, true)); //row.Data.Add(new Cell(11, "核算单元医生数", 1, 1, false, true));
//row.Data.Add(new Cell(12, "工作量绩效", 1, 1, false, true)); //row.Data.Add(new Cell(12, "工作量绩效", 1, 1, false, true));
row.Data.Add(new Cell(13, "其他绩效", 1, 1, false, true)); row.Data.Add(new Cell(12, "其他绩效", 1, 1, false, true));
row.Data.Add(new Cell(14, "医院奖罚", 1, 1, false, true)); row.Data.Add(new Cell(13, "医院奖罚", 1, 1, false, true));
row.Data.Add(new Cell(15, "调节系数", 1, 1, false, true)); row.Data.Add(new Cell(14, "调节系数", 1, 1, false, true));
//row.Data.Add(new Cell(16, "发放系数", 1, 1, false, true)); //row.Data.Add(new Cell(16, "发放系数", 1, 1, false, true));
response.Header.Add(row); response.Header.Add(row);
for (int i = 0; i < clinicemployeeList.Count(); i++) for (int i = 0; i < clinicemployeeList.Count(); i++)
...@@ -530,19 +536,19 @@ private void ClinicEmployeeExport(int sheetID, SheetExportResponse response) ...@@ -530,19 +536,19 @@ private void ClinicEmployeeExport(int sheetID, SheetExportResponse response)
var rowbody = new Row(i); var rowbody = new Row(i);
rowbody.Data.Add(new Cell(1, item.UnitType, 1, 1, false, false)); rowbody.Data.Add(new Cell(1, item.UnitType, 1, 1, false, false));
rowbody.Data.Add(new Cell(2, item.AccountingUnit, 1, 1, false, false)); rowbody.Data.Add(new Cell(2, item.AccountingUnit, 1, 1, false, false));
rowbody.Data.Add(new Cell(3, item.Department, 1, 1, false, false)); rowbody.Data.Add(new Cell(3, item.PersonnelNumber, 1, 1, false, false));
rowbody.Data.Add(new Cell(4, item.DoctorName, 1, 1, false, true)); rowbody.Data.Add(new Cell(4, item.DoctorName, 1, 1, false, true));
rowbody.Data.Add(new Cell(5, item.JobTitle, 1, 1, false, true)); rowbody.Data.Add(new Cell(5, item.JobTitle, 1, 1, false, true));
//rowbody.Data.Add(new Cell(6, item.FitPeople, 1, 1, false, true)); //rowbody.Data.Add(new Cell(6, item.FitPeople, 1, 1, false, true));
rowbody.Data.Add(new Cell(7, item.PostCoefficient, 1, 1, false, true)); rowbody.Data.Add(new Cell(6, item.PostCoefficient, 1, 1, false, true));
rowbody.Data.Add(new Cell(8, item.Efficiency, 1, 1, false, true)); rowbody.Data.Add(new Cell(7, Math.Round(item.Efficiency.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(9, item.Scale, 1, 1, false, true)); rowbody.Data.Add(new Cell(8, Math.Round(item.Scale.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(10, item.Management, 1, 1, false, true)); rowbody.Data.Add(new Cell(9, Math.Round(item.Management.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(11, item.ScoreAverageRate, 1, 1, false, true)); rowbody.Data.Add(new Cell(10, Math.Round(item.ScoreAverageRate.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(12, item.Attendance, 1, 1, false, true)); rowbody.Data.Add(new Cell(11, Math.Round(item.Attendance.Value * 100, 2) + "%", 1, 1, false, true));
rowbody.Data.Add(new Cell(13, item.OtherPerfor, 1, 1, false, true)); rowbody.Data.Add(new Cell(12, item.OtherPerfor, 1, 1, false, true));
rowbody.Data.Add(new Cell(14, item.Punishment, 1, 1, false, true)); rowbody.Data.Add(new Cell(13, item.Punishment, 1, 1, false, true));
rowbody.Data.Add(new Cell(15, item.Adjust, 1, 1, false, true)); rowbody.Data.Add(new Cell(14, Math.Round(item.Adjust.Value * 100, 2) + "%", 1, 1, false, true));
//rowbody.Data.Add(new Cell(16, item.Grant, 1, 1, false, true)); //rowbody.Data.Add(new Cell(16, item.Grant, 1, 1, false, true));
response.Row.Add(rowbody); response.Row.Add(rowbody);
} }
......
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