Commit 1d47df2a by lcx

返回数据增加id

parent fe31cb71
......@@ -15,48 +15,24 @@ namespace Performance.Api.Controllers
public class OriginalController : Controller
{
/// <summary>
/// 修改数据
/// 修改header数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("")]
[Route("header")]
[HttpPost]
public ApiResponse EmployeeEdit([FromBody] OriginalRequest request)
public ApiResponse HeaderEdit([FromBody] OriginalRequest request)
{
return new ApiResponse(ResponseType.OK);
}
[Route("")]
[HttpPost]
public ApiResponse ClinicEdit()
{
return new ApiResponse(ResponseType.OK);
}
[Route("")]
[HttpPost]
public ApiResponse ImDataEdit()
{
return new ApiResponse(ResponseType.OK);
}
[Route("")]
[HttpPost]
public ApiResponse AccontEdit()
{
return new ApiResponse(ResponseType.OK);
}
[Route("")]
[HttpPost]
public ApiResponse SpecialEdit()
{
return new ApiResponse(ResponseType.OK);
}
[Route("")]
/// <summary>
/// 修改sheet数据
/// </summary>
/// <returns></returns>
[Route("sheet")]
[HttpPost]
public ApiResponse HeaderEdit()
public ApiResponse SheetEdit([FromBody] OriginalRequest request)
{
return new ApiResponse(ResponseType.OK);
}
......
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class PerSheetHeader
{
// Tuple Items: 列明, 字段名, mergeRow, mergeCell, isTotal, isNumValue, 是否含有%
public static List<(string, Func<im_employee, object>, int, int, bool, bool, bool)> employeeHeaders =
new List<(string, Func<im_employee, object>, int, int, bool, bool, bool)>
{
("核算单元类型", (t) => t.AccountType, 1, 1, false, false, false),
("核算单元", (t) => t.AccountingUnit, 1, 1, false, false, false),
("人员工号", (t) => t.PersonnelNumber, 1, 1, false, false, false),
("医生姓名", (t) => t.DoctorName, 1, 1, false, false, false),
("职称", (t) => t.JobTitle, 1, 1, false, true, false),
("绩效基数核算参考对象", (t) => t.FitPeople, 1, 1, false, false, false),
("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false),
("参加工作时间", (t) => t.WorkTime, 1, 1, false, false, false),
("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2) , 1, 1, false, true, true),
("出勤率", (t) => Math.Round(t.Attendance.Value * 100, 2), 1, 1, false, true, true),
("核算单元医生数", (t) => t.PeopleNumber, 1, 1, false, true, false),
("工作量绩效", (t) =>t.Workload, 1, 1, false, true, false),
("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false),
("医院奖罚", (t) => t.Punishment, 1, 1, false, true, false),
("调节系数", (t) => Math.Round(t.Adjust.Value * 100, 2), 1, 1, false, true, true),
("发放系数", (t) => t.Grant, 1, 1, false, true, false),
};
}
}
using NPOI.HSSF.Record.Chart;
using Performance.DtoModels;
using Performance.EntityModels;
using Performance.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Performance.Services
{
public class OriginalService : IAutoInjection
{
private readonly PerforPersheetRepository persheetRepository;
private readonly PerforImheaderRepository imheaderRepository;
private readonly PerforImemployeeRepository imemployeeRepository;
private readonly PerforImemployeeclinicRepository imemployeeclinicRepository;
private readonly PerforImdataRepository imdataRepository;
private readonly PerforImspecialunitRepository imspecialunitRepository;
public OriginalService(PerforPersheetRepository persheetRepository,
PerforImheaderRepository imheaderRepository,
PerforImemployeeRepository imemployeeRepository,
PerforImemployeeclinicRepository imemployeeclinicRepository,
PerforImdataRepository imdataRepository,
PerforImspecialunitRepository imspecialunitRepository)
{
this.persheetRepository = persheetRepository;
this.imheaderRepository = imheaderRepository;
this.imemployeeRepository = imemployeeRepository;
this.imemployeeclinicRepository = imemployeeclinicRepository;
this.imdataRepository = imdataRepository;
this.imspecialunitRepository = imspecialunitRepository;
}
public bool EditHeaderData(OriginalRequest request)
{
return true;
}
public bool EditSheetData(OriginalRequest request)
{
return SheetCommonFactory(request);
}
private bool SheetCommonFactory(OriginalRequest request)
{
var sheet = persheetRepository.GetEntity(t => t.ID == request.SheetId);
if (sheet == null)
throw new PerformanceException("参数sheetid无效");
switch (sheet.SheetType)
{
case (int)SheetType.Employee:
return EditEmployee(request);
case (int)SheetType.ClinicEmployee:
return true;
case (int)SheetType.Workload:
return true;
case (int)SheetType.AccountBasic:
return true;
case (int)SheetType.SpecialUnit:
return true;
case (int)SheetType.OtherIncome:
case (int)SheetType.Income:
case (int)SheetType.Expend:
return true;
}
return false;
}
private bool EditEmployee(OriginalRequest request)
{
var employees = imemployeeRepository.GetEntities(t => request.Cells.Select(c => c.Id).Contains(t.ID));
if (employees == null || !employees.Any(t => t.SheetID == request.SheetId))
throw new PerformanceException("提交数据无效");
return false;
}
}
}
......@@ -109,49 +109,12 @@ public SheetExportResponse SheetExport(int sheetID)
CommonExport(sheetID, response);
}
if (response.Header != null && response.Header.Any())
response.Header = response.Header.OrderBy(t => t.Rownumber).ToList();
if (response.Row != null && response.Row.Any())
response.Row = response.Row.OrderBy(t => t.Rownumber).ToList();
return response;
}
private void SpecialUnitExport(int sheetID, SheetExportResponse response)
{
var list = _perforImspecialunitRepository.GetEntities(t => t.SheetID == sheetID)?.OrderByDescending(t => t.AccountingUnit);
if (list != null && list.Count() > 0)
{
var row = new Row(0);
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(3, "人数", 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(6, "量化指标绩效分值", 1, 1, false, true));
row.Data.Add(new Cell(7, "考核得分率", 1, 1, false, true));
row.Data.Add(new Cell(8, "其他绩效", 1, 1, false, true));
row.Data.Add(new Cell(9, "医院奖罚", 1, 1, false, true));
row.Data.Add(new Cell(10, "调节系数", 1, 1, false, true));
response.Header.Add(row);
for (int i = 0; i < list.Count(); i++)
{
var item = list.ElementAt(i);
var rowbody = new Row(i);
rowbody.Data.Add(new Cell(1, item.AccountingUnit, 1, 1, false, false));
rowbody.Data.Add(new Cell(2, item.Department, 1, 1, false, false));
rowbody.Data.Add(new Cell(3, item.Number, 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(6, item.QuantitativeIndicatorsValue, 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(9, item.Punishment, 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);
}
}
}
private void CommonExport(int sheetID, SheetExportResponse response)
{
var headList = _perforImHeaderRepository.GetEntities(t => t.SheetID == sheetID)?.OrderBy(t => t.PointCell);
......@@ -188,7 +151,8 @@ private void CommonExport(int sheetID, SheetExportResponse response)
{
//var technicianvalue = new Row(response.Header.Count()); technicianvalue.Data.Add(new Cell(0, "医技组核算收入", 1, 4, false, false));
//response.Header.Add(technicianvalue);
var technicianhead = new Row(response.Header.Count()); technicianhead.Data.Add(new Cell(0, "医技组核算单元", 1, merge, false, false));
var technicianhead = new Row(response.Header.Count());
technicianhead.Data.Add(new Cell(0, "医技组核算单元", 1, merge, false, false));
response.Header.Add(technicianhead);
foreach (var header in headList)
{
......@@ -207,7 +171,7 @@ private void CommonExport(int sheetID, SheetExportResponse response)
response.Header.Add(rowhead);
foreach (var header in headList.Where(t => !t.ParentID.HasValue || t.ParentID.Value == 0))
{
rowhead.Data.Add(new Cell(header.PointCell.Value, header.CellValue, header.MergeRow.Value, header.MergeCell.Value, header.IsTotal == 1, false));
rowhead.Data.Add(new Cell(header.PointCell.Value, header.CellValue, header.MergeRow.Value, header.MergeCell.Value, header.IsTotal == 1, false, id: header.ID));
}
if (headList.Any(t => t.ParentID.HasValue && t.ParentID.Value > 0))
{
......@@ -291,9 +255,9 @@ private void CommonExport(int sheetID, SheetExportResponse response)
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, data.ID));
else
rowbody.Data.Add(new Cell(head.PointCell.Value, Math.Round(value.Value * 100, 2) + "%", 1, 1, data.IsTotal == 1, true, data.Annotation));
rowbody.Data.Add(new Cell(head.PointCell.Value, Math.Round(value.Value * 100, 2) + "%", 1, 1, data.IsTotal == 1, true, data.Annotation, data.ID));
}
}
}
......@@ -307,49 +271,48 @@ private void AccountNurseExport(int sheetID, SheetExportResponse response)
if (list != null && list.Count() > 0)
{
// Tuple Items: 列明, 字段名, mergeRow, mergeCell, isTotal
List<(string, Func<res_account, object>, int, int, bool, bool)> pairs =
new List<(string, Func<res_account, object>, int, int, bool, bool)>
{
("核算单元", (t) => t.AccountingUnit, 1, 1, false, false),
("护士长人数", (t) => t.ManagerNumber, 1, 1, false, false),
("核算单元护士数量", (t) => t.Number, 1, 1, false, false),
("医生基础系数", (t) => t.BasicFactor, 1, 1, false, false),
("倾斜系数", (t) => t.SlopeFactor, 1, 1, false, true),
("其他绩效1", (t) => t.OtherPerfor1, 1, 1, false, false),
("其他绩效2", (t) => t.OtherPerfor2, 1, 1, false, true),
("药占比奖罚", (t) => t.MedicineExtra, 1, 1, false, false),
("材料占比奖罚", (t) => t.MaterialsExtra , 1, 1, false, true),
("医院奖罚", (t) => t.Extra, 1, 1, false, true),
("考核对分率", (t) => t.ScoringAverage, 1, 1, false, true),
("调节系数", (t) =>t.AdjustFactor, 1, 1, false, true),
("科室业绩", (t) => t.Income, 1, 1, false, true),
("业绩绩效", (t) => t.PerforFee, 1, 1, false, true),
("工作量绩效", (t) => t.WorkloadFee, 1, 1, false, true),
("绩效合计", (t) => t.PerforTotal, 1, 1, false, true),
("人均绩效", (t) => t.Avg, 1, 1, false, true),
("实发绩效", (t) => t.RealGiveFee, 1, 1, false, true),
};
var row = new Row(0);
row.Data.Add(new Cell(1, "核算单元", 1, 1, false, false));
row.Data.Add(new Cell(2, "护士长人数", 1, 1, false, true));
row.Data.Add(new Cell(3, "核算单元护士数量", 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(6, "其他绩效1", 1, 1, false, true));
row.Data.Add(new Cell(7, "其他绩效2", 1, 1, false, true));
row.Data.Add(new Cell(8, "药占比奖罚", 1, 1, false, true));
row.Data.Add(new Cell(9, "材料占比奖罚", 1, 1, false, true));
row.Data.Add(new Cell(10, "医院奖罚", 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(13, "科室业绩", 1, 1, false, true));
row.Data.Add(new Cell(14, "业绩绩效", 1, 1, false, true));
row.Data.Add(new Cell(15, "工作量绩效", 1, 1, false, true));
row.Data.Add(new Cell(16, "绩效合计", 1, 1, false, true));
row.Data.Add(new Cell(17, "人均绩效", 1, 1, false, true));
row.Data.Add(new Cell(18, "实发绩效", 1, 1, false, true));
int index = 1;
foreach (var item in pairs)
{
row.Data.Add(new Cell(index, item.Item1, item.Item3, item.Item4, item.Item5, item.Item6));
index += 1;
}
response.Header.Add(row);
for (int i = 0; i < list.Count(); i++)
{
var item = list.ElementAt(i);
var account = list.ElementAt(i);
var rowbody = new Row(i);
rowbody.Data.Add(new Cell(1, item.AccountingUnit, 1, 1, false, false));
rowbody.Data.Add(new Cell(2, item.ManagerNumber, 1, 1, false, true));
rowbody.Data.Add(new Cell(3, item.Number, 1, 1, false, true));
rowbody.Data.Add(new Cell(4, item.BasicFactor, 1, 1, false, true));
rowbody.Data.Add(new Cell(5, item.SlopeFactor, 1, 1, false, true));
rowbody.Data.Add(new Cell(6, item.OtherPerfor1, 1, 1, false, true));
rowbody.Data.Add(new Cell(7, item.OtherPerfor2, 1, 1, false, true));
rowbody.Data.Add(new Cell(8, item.MedicineExtra, 1, 1, false, true));
rowbody.Data.Add(new Cell(9, item.MaterialsExtra, 1, 1, false, true));
rowbody.Data.Add(new Cell(10, item.Extra, 1, 1, false, true));
rowbody.Data.Add(new Cell(11, item.ScoringAverage, 1, 1, false, true));
rowbody.Data.Add(new Cell(12, item.AdjustFactor, 1, 1, false, true));
rowbody.Data.Add(new Cell(13, item.Income, 1, 1, false, true));
rowbody.Data.Add(new Cell(14, item.PerforFee, 1, 1, false, true));
rowbody.Data.Add(new Cell(15, item.WorkloadFee, 1, 1, false, true));
rowbody.Data.Add(new Cell(16, item.PerforTotal, 1, 1, false, true));
rowbody.Data.Add(new Cell(17, item.Avg, 1, 1, false, true));
rowbody.Data.Add(new Cell(18, item.RealGiveFee, 1, 1, false, true));
index = 1;
foreach (var item in pairs)
{
rowbody.Data.Add(new Cell(index, item.Item2.Invoke(account), item.Item3, item.Item4, item.Item5, item.Item6, id: account.ID));
index += 1;
}
response.Row.Add(rowbody);
}
}
......@@ -361,51 +324,48 @@ private void AccountDoctorExport(int sheetID, SheetExportResponse response)
if (list != null && list.Count() > 0)
{
// Tuple Items: 列明, 字段名, mergeRow, mergeCell, isTotal
List<(string, Func<res_account, object>, int, int, bool, bool)> pairs =
new List<(string, Func<res_account, object>, int, int, bool, bool)>
{
("核算单元", (t) => t.AccountingUnit, 1, 1, false, false),
("科主任人数", (t) => t.ManagerNumber, 1, 1, false, false),
("核算单元医生数量", (t) => t.Number, 1, 1, false, false),
("医生基础系数", (t) => t.BasicFactor, 1, 1, false, false),
("倾斜系数", (t) => t.SlopeFactor, 1, 1, false, true),
("其他绩效1", (t) => t.OtherPerfor1, 1, 1, false, false),
("其他绩效2", (t) => t.OtherPerfor2, 1, 1, false, true),
("药占比奖罚", (t) => t.MedicineExtra, 1, 1, false, false),
("材料占比奖罚", (t) => t.MaterialsExtra , 1, 1, false, true),
("医院奖罚", (t) => t.Extra, 1, 1, false, true),
("考核对分率", (t) => t.ScoringAverage, 1, 1, false, true),
("调节系数", (t) =>t.AdjustFactor, 1, 1, false, true),
("科室业绩", (t) => t.Income, 1, 1, false, true),
("业绩绩效", (t) => t.PerforFee, 1, 1, false, true),
("工作量绩效", (t) => t.WorkloadFee, 1, 1, false, true),
("绩效合计", (t) => t.PerforTotal, 1, 1, false, true),
("人均绩效", (t) => t.Avg, 1, 1, false, true),
("实发绩效", (t) => t.RealGiveFee, 1, 1, false, true),
};
var row = new Row(0);
row.Data.Add(new Cell(1, "核算单元", 1, 1, false, false));
row.Data.Add(new Cell(2, "科主任人数", 1, 1, false, true));
row.Data.Add(new Cell(3, "核算单元医生数量", 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(6, "其他绩效1", 1, 1, false, true));
row.Data.Add(new Cell(7, "其他绩效2", 1, 1, false, true));
row.Data.Add(new Cell(8, "药占比奖罚", 1, 1, false, true));
row.Data.Add(new Cell(9, "材料占比奖罚", 1, 1, false, true));
row.Data.Add(new Cell(10, "医院奖罚", 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(13, "科室业绩", 1, 1, false, true));
row.Data.Add(new Cell(14, "业绩绩效", 1, 1, false, true));
row.Data.Add(new Cell(15, "工作量绩效", 1, 1, false, true));
row.Data.Add(new Cell(16, "绩效合计", 1, 1, false, true));
row.Data.Add(new Cell(17, "人均绩效", 1, 1, false, true));
row.Data.Add(new Cell(18, "实发绩效", 1, 1, false, true));
int index = 1;
foreach (var item in pairs)
{
row.Data.Add(new Cell(index, item.Item1, item.Item3, item.Item4, item.Item5, item.Item6));
index += 1;
}
response.Header.Add(row);
for (int i = 0; i < list.Count(); i++)
{
var item = list.ElementAt(i);
var account = list.ElementAt(i);
var rowbody = new Row(i);
rowbody.Data.Add(new Cell(1, item.AccountingUnit, 1, 1, false, false));
rowbody.Data.Add(new Cell(2, item.ManagerNumber, 1, 1, false, true));
rowbody.Data.Add(new Cell(3, item.Number, 1, 1, false, true));
rowbody.Data.Add(new Cell(4, item.BasicFactor, 1, 1, false, true));
rowbody.Data.Add(new Cell(5, item.SlopeFactor, 1, 1, false, true));
rowbody.Data.Add(new Cell(6, item.OtherPerfor1, 1, 1, false, true));
rowbody.Data.Add(new Cell(7, item.OtherPerfor2, 1, 1, false, true));
rowbody.Data.Add(new Cell(8, item.MedicineExtra, 1, 1, false, true));
rowbody.Data.Add(new Cell(9, item.MaterialsExtra, 1, 1, false, true));
rowbody.Data.Add(new Cell(10, item.Extra, 1, 1, false, true));
rowbody.Data.Add(new Cell(11, item.ScoringAverage, 1, 1, false, true));
rowbody.Data.Add(new Cell(12, item.AdjustFactor, 1, 1, false, true));
rowbody.Data.Add(new Cell(13, item.Income, 1, 1, false, true));
rowbody.Data.Add(new Cell(14, item.PerforFee, 1, 1, false, true));
rowbody.Data.Add(new Cell(15, item.WorkloadFee, 1, 1, false, true));
rowbody.Data.Add(new Cell(16, item.PerforTotal, 1, 1, false, true));
rowbody.Data.Add(new Cell(17, item.Avg, 1, 1, false, true));
rowbody.Data.Add(new Cell(18, item.RealGiveFee, 1, 1, false, true));
index = 1;
foreach (var item in pairs)
{
rowbody.Data.Add(new Cell(index, item.Item2.Invoke(account), item.Item3, item.Item4, item.Item5, item.Item6, id: account.ID));
index += 1;
}
response.Row.Add(rowbody);
}
}
......@@ -471,47 +431,39 @@ private void EmployeeExport(int sheetID, SheetExportResponse response)
if (employeeList != null && employeeList.Count() > 0)
{
var pairs = PerSheetHeader.employeeHeaders;
var row = new Row(0);
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(3, "人员工号", 1, 1, false, false));
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(6, "绩效基数核算参考对象", 1, 1, false, true));
row.Data.Add(new Cell(7, "岗位系数", 1, 1, false, true));
row.Data.Add(new Cell(8, "参加工作时间", 1, 1, false, true));
row.Data.Add(new Cell(9, "考核得分率", 1, 1, false, true));
row.Data.Add(new Cell(10, "出勤率", 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(13, "其他绩效", 1, 1, false, true));
row.Data.Add(new Cell(14, "医院奖罚", 1, 1, false, true));
row.Data.Add(new Cell(15, "调节系数", 1, 1, false, true));
row.Data.Add(new Cell(16, "发放系数", 1, 1, false, true));
int index = 1;
foreach (var item in pairs)
{
row.Data.Add(new Cell(index, item.Item1, item.Item3, item.Item4, item.Item5, item.Item6));
index += 1;
}
response.Header.Add(row);
for (int i = 0; i < employeeList.Count(); i++)
{
var item = employeeList.ElementAt(i);
var workTime = item.WorkTime != null ? ((DateTime)item.WorkTime).ToString("yyyy-MM-dd") : "";
var employee = employeeList.ElementAt(i);
var rowbody = new Row(i);
rowbody.Data.Add(new Cell(1, item.AccountType, 1, 1, false, false, id: item.ID));
rowbody.Data.Add(new Cell(2, item.AccountingUnit, 1, 1, false, false, id: item.ID));
rowbody.Data.Add(new Cell(3, item.PersonnelNumber, 1, 1, false, false, id: item.ID));
rowbody.Data.Add(new Cell(4, item.DoctorName, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(5, item.JobTitle, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(6, item.FitPeople, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(7, item.PostCoefficient, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(8, workTime, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(9, Math.Round(item.ScoreAverageRate.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(10, Math.Round(item.Attendance.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(11, item.PeopleNumber, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(12, item.Workload, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(13, item.OtherPerfor, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(14, item.Punishment, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(15, Math.Round(item.Adjust.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(16, item.Grant, 1, 1, false, true, id: item.ID));
index = 1;
foreach (var item in pairs)
{
if (item.Item7)
rowbody.Data.Add(new Cell(index, $"{item.Item2.Invoke(employee)}%", item.Item3, item.Item4, item.Item5, item.Item6, id: employee.ID));
else
rowbody.Data.Add(new Cell(index, item.Item2.Invoke(employee), item.Item3, item.Item4, item.Item5, item.Item6, id: employee.ID));
index += 1;
}
response.Row.Add(rowbody);
}
var workDateIndex = pairs.IndexOf(("参加工作时间", (t) => t.WorkTime, 1, 1, false, false, false));
response.Row.ForEach(t =>
{
var workDate = t.Data.FirstOrDefault(f => f.PointCell == workDateIndex)?.CellValue;
if (workDate != null && workDate.ToString() != "")
t.Data.FirstOrDefault(f => f.PointCell == workDateIndex).CellValue = ((DateTime)workDate).ToString("yyyy-MM-dd");
});
}
}
......@@ -523,53 +475,95 @@ private void ClinicEmployeeExport(int sheetID, SheetExportResponse response)
if (clinicemployeeList != null && clinicemployeeList.Count() > 0)
{
List<(string, Func<im_employee_clinic>, int, int, bool, bool)> pairs = new List<(string, Func<im_employee_clinic>, int, int, bool, bool)>
// Tuple Items: 列明, 字段名, mergeRow, mergeCell, isTotal, isNumValue, 是否含有%
List<(string, Func<im_employee_clinic, object>, int, int, bool, bool, bool)> pairs =
new List<(string, Func<im_employee_clinic, object>, int, int, bool, bool, bool)>
{
("核算单元分类", (t) => t.UnitType, 1, 1, false, false, false),
("核算单元", (t) => t.AccountingUnit, 1, 1, false, false, false),
("人员工号", (t) => t.PersonnelNumber, 1, 1, false, false, false),
("医生姓名", (t) => t.DoctorName, 1, 1, false, false, false),
("职称", (t) => t.JobTitle, 1, 1, false, true, false),
("岗位系数", (t) => t.PostCoefficient, 1, 1, false, true, false),
("效率绩效系数", (t) => Math.Round(t.Efficiency.Value * 100, 2), 1, 1, false, true, true),
("规模绩效系数", (t) => Math.Round(t.Scale.Value * 100, 2), 1, 1, false, true, true),
("管理绩效发放系数", (t) => Math.Round(t.Management.Value * 100, 2), 1, 1, false, true, true),
("考核得分率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2), 1, 1, false, true, true),
("出勤率", (t) => Math.Round(t.ScoreAverageRate.Value * 100, 2), 1, 1, false, true, true),
("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false),
("医院奖罚", (t) => t.Punishment, 1, 1, false, true, false),
("调节系数", (t) => Math.Round(t.Adjust.Value * 100, 2), 1, 1, false, true, true),
};
var row = new Row(0);
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(3, "人员工号", 1, 1, false, false));
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(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(8, "规模绩效系数", 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(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(14, "调节系数", 1, 1, false, true));
//row.Data.Add(new Cell(16, "发放系数", 1, 1, false, true));
int index = 1;
foreach (var item in pairs)
{
row.Data.Add(new Cell(index, item.Item1, item.Item3, item.Item4, item.Item5, item.Item6));
index += 1;
}
response.Header.Add(row);
for (int i = 0; i < clinicemployeeList.Count(); i++)
{
var item = clinicemployeeList.ElementAt(i);
//var workTime = item.WorkTime != null ? ((DateTime)item.WorkTime).ToString("yyyy-MM-dd") : "";
var employee = clinicemployeeList.ElementAt(i);
var rowbody = new Row(i);
rowbody.Data.Add(new Cell(1, item.UnitType, 1, 1, false, false, id: item.ID));
rowbody.Data.Add(new Cell(2, item.AccountingUnit, 1, 1, false, false, id: item.ID));
rowbody.Data.Add(new Cell(3, item.PersonnelNumber, 1, 1, false, false, id: item.ID));
rowbody.Data.Add(new Cell(4, item.DoctorName, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(5, item.JobTitle, 1, 1, false, true, id: item.ID));
//rowbody.Data.Add(new Cell(6, item.FitPeople, 1, 1, false, true));
rowbody.Data.Add(new Cell(6, item.PostCoefficient, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(7, Math.Round(item.Efficiency.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(8, Math.Round(item.Scale.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(9, Math.Round(item.Management.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(10, Math.Round(item.ScoreAverageRate.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(11, Math.Round(item.Attendance.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(12, item.OtherPerfor, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(13, item.Punishment, 1, 1, false, true, id: item.ID));
rowbody.Data.Add(new Cell(14, Math.Round(item.Adjust.Value * 100, 2) + "%", 1, 1, false, true, id: item.ID));
//rowbody.Data.Add(new Cell(16, item.Grant, 1, 1, false, true));
index = 1;
foreach (var item in pairs)
{
if (item.Item7)
rowbody.Data.Add(new Cell(index, $"{item.Item2.Invoke(employee)}%", item.Item3, item.Item4, item.Item5, item.Item6, id: employee.ID));
else
rowbody.Data.Add(new Cell(index, item.Item2.Invoke(employee), item.Item3, item.Item4, item.Item5, item.Item6, id: employee.ID));
index += 1;
}
response.Row.Add(rowbody);
}
}
}
private void SpecialUnitExport(int sheetID, SheetExportResponse response)
{
var list = _perforImspecialunitRepository.GetEntities(t => t.SheetID == sheetID)?.OrderByDescending(t => t.AccountingUnit);
if (list != null && list.Count() > 0)
{
// Tuple Items: 列明, 字段名, mergeRow, mergeCell, isTotal, isNumValue, 是否含有%
List<(string, Func<im_specialunit, object>, int, int, bool, bool, bool)> pairs =
new List<(string, Func<im_specialunit, object>, int, int, bool, bool, bool)>
{
("核算单元", (t) => t.AccountingUnit, 1, 1, false, false, false),
("科室", (t) => t.Department, 1, 1, false, false, false),
("人数", (t) => t.Number, 1, 1, false, true, false),
("量化指标", (t) => t.QuantitativeIndicators, 1, 1, false, true, false),
("数量", (t) => t.Quantity, 1, 1, false, true, false),
("量化指标绩效分值", (t) => t.QuantitativeIndicatorsValue, 1, 1, false, true, false),
("考核得分率", (t) => Math.Round(t.ScoringAverage.Value * 100, 2), 1, 1, false, true, true),
("其他绩效", (t) => t.OtherPerfor, 1, 1, false, true, false),
("医院奖罚", (t) => t.Punishment, 1, 1, false, true, false),
("调节系数", (t) => Math.Round(t.Adjust.Value * 100, 2), 1, 1, false, true, true),
};
var row = new Row(0);
int index = 1;
foreach (var item in pairs)
{
row.Data.Add(new Cell(index, item.Item1, item.Item3, item.Item4, item.Item5, item.Item6));
index += 1;
}
response.Header.Add(row);
for (int i = 0; i < list.Count(); i++)
{
var specialunit = list.ElementAt(i);
var rowbody = new Row(i);
index = 1;
foreach (var item in pairs)
{
if (item.Item7)
rowbody.Data.Add(new Cell(index, $"{item.Item2.Invoke(specialunit)}%", item.Item3, item.Item4, item.Item5, item.Item6, id: specialunit.ID));
else
rowbody.Data.Add(new Cell(index, item.Item2.Invoke(specialunit), item.Item3, item.Item4, item.Item5, item.Item6, id: specialunit.ID));
index += 1;
}
response.Row.Add(rowbody);
}
}
......@@ -594,9 +588,8 @@ private SheetExportResponse AddFactor(SheetExportResponse response, Row row, Lis
{
if (!array.Contains(header.CellValue))
{
var factor = dataList.Where(t => t.AllotID == header.AllotID && t.SheetID == header.SheetID && t.IsFactor == 1
&& t.TypeName == header.CellValue);
decimal? value = factor.Any() ? factor.FirstOrDefault().FactorValue : null;
decimal? value = dataList.FirstOrDefault(t => t.AllotID == header.AllotID && t.SheetID == header.SheetID && t.IsFactor == 1
&& t.TypeName == header.CellValue)?.FactorValue;
row.Data.Add(new Cell(header.PointCell.Value, value, 1, 1, header.IsTotal == 1, false));
}
}
......@@ -608,9 +601,8 @@ private SheetExportResponse AddFactor(SheetExportResponse response, Row row, Lis
{
if (!array.Contains(header.CellValue))
{
var factor = dataList.Where(t => t.AllotID == header.AllotID && t.SheetID == header.SheetID && t.IsFactor == 1
&& t.TypeName == header.CellValue && t.UnitType == (int)unitType);
decimal? value = factor.Any() ? factor.FirstOrDefault().FactorValue : null;
decimal? value = dataList.FirstOrDefault(t => t.AllotID == header.AllotID && t.SheetID == header.SheetID && t.IsFactor == 1
&& t.TypeName == header.CellValue && t.UnitType == (int)unitType)?.FactorValue;
row.Data.Add(new Cell(header.PointCell.Value, value, 1, 1, header.IsTotal == 1, false));
}
}
......
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