Commit 2c276221 by lcx

二次绩效管理绩效列表,特殊科室合并值为文本

parent bff24da9
...@@ -14,7 +14,6 @@ public class SpecialUnitDataWrite : ISheetDataWrite ...@@ -14,7 +14,6 @@ public class SpecialUnitDataWrite : ISheetDataWrite
{ {
public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects) public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, List<collect_data> collects)
{ {
} }
public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, object data, Dictionary<ExDataDict, object> exdict = null) public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetType, ExcelStyle style, object data, Dictionary<ExDataDict, object> exdict = null)
...@@ -53,7 +52,6 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetTyp ...@@ -53,7 +52,6 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType sheetTyp
} }
catch (Exception) catch (Exception)
{ {
} }
} }
...@@ -119,14 +117,9 @@ private void SupplyMergedRegionData(ISheet sheet, ExcelStyle style, List<Special ...@@ -119,14 +117,9 @@ private void SupplyMergedRegionData(ISheet sheet, ExcelStyle style, List<Special
var basicStyle = style.GetCellStyle(); var basicStyle = style.GetCellStyle();
foreach (var merged in mergedRegions.Where(t => t.FirstRow > 1)) foreach (var merged in mergedRegions.Where(t => t.FirstRow > 1))
{ {
string value = ""; CellType cellType = CellType.Unknown;
var valueCell = sheet.GetRow(merged.FirstRow)?.GetCell(merged.FirstColumn); var valueCell = sheet.GetRow(merged.FirstRow)?.GetCell(merged.FirstColumn);
if (valueCell != null)
{ string value = valueCell != null ? valueCell.ToString() : "";
cellType = valueCell.CellType;
valueCell.SetCellType(CellType.String);
value = valueCell.StringCellValue;
}
merged.Single = value; merged.Single = value;
if (string.IsNullOrEmpty(value)) continue; if (string.IsNullOrEmpty(value)) continue;
...@@ -187,6 +180,7 @@ private void SupplySpecialQuantity(ISheet sheet, ExcelStyle style, List<SpecialD ...@@ -187,6 +180,7 @@ private void SupplySpecialQuantity(ISheet sheet, ExcelStyle style, List<SpecialD
if (special != null) if (special != null)
{ {
var cell = row.GetOrCreate(quantityIndex); var cell = row.GetOrCreate(quantityIndex);
cell.SetCellType(CellType.Numeric);
cell.SetCellValue<double>(special.Quantity); cell.SetCellValue<double>(special.Quantity);
cell.CellStyle = cellStyle; cell.CellStyle = cellStyle;
...@@ -291,7 +285,10 @@ private void WriteSpecialData(IRow row, ICellStyle style, SpecialDto special, Li ...@@ -291,7 +285,10 @@ private void WriteSpecialData(IRow row, ICellStyle style, SpecialDto special, Li
if (new string[] { SpecialUnitColumns.Department, SpecialUnitColumns.Target }.Contains(item.Key)) if (new string[] { SpecialUnitColumns.Department, SpecialUnitColumns.Target }.Contains(item.Key))
cell.SetCellValue(item.Value.Invoke(special)?.ToString()); cell.SetCellValue(item.Value.Invoke(special)?.ToString());
else else
{
cell.SetCellType(CellType.Numeric);
cell.SetCellValue<double>(item.Value.Invoke(special)); cell.SetCellValue<double>(item.Value.Invoke(special));
}
cell.CellStyle = style; cell.CellStyle = style;
} }
} }
...@@ -326,14 +323,20 @@ private void AddMergedRegion(ISheet sheet, List<SpecialCellRange> ranges, List<s ...@@ -326,14 +323,20 @@ private void AddMergedRegion(ISheet sheet, List<SpecialCellRange> ranges, List<s
public void SetCellValue(ICell cell, string value) public void SetCellValue(ICell cell, string value)
{ {
switch (value) if (string.IsNullOrEmpty(value)) return;
switch (value.Trim())
{ {
case string reg when Regex.IsMatch(reg, @"^[+-]?\d*[.]?\d*$"): case string reg when Regex.IsMatch(reg, @"^[+-]?\d*[.]?\d*$"):
cell.SetCellType(CellType.Numeric);
cell.SetCellValue(ConvertHelper.To<double>(value)); cell.SetCellValue(ConvertHelper.To<double>(value));
break; break;
case string reg when Regex.IsMatch(reg, @"^[+-]?\d*$"): case string reg when Regex.IsMatch(reg, @"^[+-]?\d*$"):
cell.SetCellType(CellType.Numeric);
cell.SetCellValue(ConvertHelper.To<int>(value)); cell.SetCellValue(ConvertHelper.To<int>(value));
break; break;
default: default:
cell.SetCellValue(value); cell.SetCellValue(value);
break; break;
......
...@@ -1757,16 +1757,16 @@ public List<SecondPerforResponse> DeptComputeDetail(int userId, int allotId, out ...@@ -1757,16 +1757,16 @@ public List<SecondPerforResponse> DeptComputeDetail(int userId, int allotId, out
var empDic = peremployeeRepository.GetEntities(w => w.AllotId == allotId); var empDic = peremployeeRepository.GetEntities(w => w.AllotId == allotId);
foreach (var item in result) foreach (var item in result)
{ {
var perfor = ((item.GiveFee ?? 0) != 0 ? item.GiveFee : item.PerforSumFee) ?? 0;
item.PerforSumFee = Math.Round(item.PerforSumFee ?? 0, 0, MidpointRounding.AwayFromZero); item.PerforSumFee = Math.Round(item.PerforSumFee ?? 0, 0, MidpointRounding.AwayFromZero);
item.PerforManagementFee = Math.Round(item.PerforManagementFee ?? 0, 0, MidpointRounding.AwayFromZero); item.PerforManagementFee = Math.Round(item.PerforManagementFee ?? 0, 0, MidpointRounding.AwayFromZero);
item.GiveFee = Math.Round(perfor, 0, MidpointRounding.AwayFromZero); var real = Math.Round((item.PerforSumFee ?? 0) + (item.PerforManagementFee ?? 0), 0) * item.Adjust + (item.AdjustLaterOtherFee ?? 0);
item.AdjustLaterOtherFee = Math.Round(item.AdjustLaterOtherFee ?? 0, 0, MidpointRounding.AwayFromZero);
item.OthePerfor = Math.Round(item.OthePerfor ?? 0, 0, MidpointRounding.AwayFromZero); item.OthePerfor = Math.Round(item.OthePerfor ?? 0, 0, MidpointRounding.AwayFromZero);
item.NightWorkPerfor = Math.Round(item.NightWorkPerfor ?? 0, 0, MidpointRounding.AwayFromZero); item.NightWorkPerfor = Math.Round(item.NightWorkPerfor ?? 0, 0, MidpointRounding.AwayFromZero);
item.ShouldGiveFee = Math.Round((perfor + item.AdjustLaterOtherFee + item.NightWorkPerfor) ?? 0, 0, MidpointRounding.AwayFromZero); item.ShouldGiveFee = Math.Round((real ?? 0) + (item.OthePerfor ?? 0) + (item.NightWorkPerfor ?? 0), 0, MidpointRounding.AwayFromZero);
item.RealGiveFee = Math.Round((perfor + item.AdjustLaterOtherFee + item.NightWorkPerfor) ?? 0, 0, MidpointRounding.AwayFromZero); item.ReservedRatio = empDic?.FirstOrDefault(w => w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0;
item.ReservedRatioFee = Math.Round((real ?? 0) * (item.ReservedRatio ?? 0), 0, MidpointRounding.AwayFromZero);
item.RealGiveFee = Math.Round(item.ShouldGiveFee - (item.ReservedRatioFee ?? 0) ?? 0, 0, MidpointRounding.AwayFromZero);
} }
} }
...@@ -1788,43 +1788,40 @@ private List<SecondPerforResponse> GetAllotPerformance(int allotId, List<res_com ...@@ -1788,43 +1788,40 @@ private List<SecondPerforResponse> GetAllotPerformance(int allotId, List<res_com
var empolyeeList = imemployeeclinicRepository.GetEntities(t => t.AllotID == allotId); var empolyeeList = imemployeeclinicRepository.GetEntities(t => t.AllotID == allotId);
return computes.Select(t => return computes.Select(t =>
{ {
var comp = new SecondPerforResponse() var comp = new SecondPerforResponse()
{ {
AccountingUnit = t.AccountingUnit, AccountingUnit = t.AccountingUnit,
EmployeeName = t.EmployeeName, EmployeeName = t.EmployeeName,
JobNumber = t.JobNumber, JobNumber = t.JobNumber,
JobTitle = t.JobTitle, JobTitle = t.JobTitle,
UnitType = t.AccountType, UnitType = t.AccountType,
Scale = t.Scale, Adjust = t.Adjust,
Efficiency = t.Efficiency, AdjustLaterOtherFee = t.AdjustLaterOtherFee,
Grant = t.Grant, Scale = t.Scale,
Punishment = t.Punishment, Efficiency = t.Efficiency,
ShouldGiveFee = t.ShouldGiveFee, Grant = t.Grant,
PerforSumFee = t.PerforSumFee, ShouldGiveFee = t.ShouldGiveFee,
GiveFee = t.GiveFee * t.Adjust, };
AdjustLaterOtherFee = t.AdjustLaterOtherFee ?? 0,
OthePerfor = t.OtherPerfor, // 行政中层 行政高层 补充 夜班费
RealGiveFee = t.RealGiveFee if (types2.Contains(t.AccountType))
}; comp.NightWorkPerfor = t.NightWorkPerfor;
if (types1.Contains(t.AccountType)) // 科主任/护士长
comp.PerforManagementFee = ((t.Efficiency + t.Scale) * t.Grant + t.OtherManagePerfor) * t.Attendance * t.ScoreAverageRate; if (types1.Contains(t.AccountType))
else {
comp.PerforManagementFee = t.RealGiveFee; // 等同于考核后管理绩效 AssessLaterManagementFee
// 行政中层 行政高层 补充 夜班费 comp.PerforManagementFee = Math.Round(t.ShouldGiveFee * t.ScoreAverageRate * t.Attendance + t.Punishment ?? 0);
if (types2.Contains(t.AccountType)) // 仅显示管理绩效
comp.NightWorkPerfor = t.NightWorkPerfor; if (isShowManage == 2)
// 获取科主任系数,解决共用科主任重复计算人均问题 comp.PerforSumFee = 0;
var basics = empolyeeList?.FirstOrDefault(w => w.AccountingUnit == t.AccountingUnit && w.DoctorName == t.EmployeeName && w.PersonnelNumber == t.JobNumber)?.Basics; else
// 仅显示管理绩效 comp.PerforSumFee = t.Avg;
if (isShowManage == 2) }
comp.PerforSumFee = 0;
else return comp;
comp.PerforSumFee = Math.Round((t.Avg * (basics ?? 1)) + t.ShouldGiveFee + t.AssessBeforeOtherFee ?? 0); }).ToList();
return comp;
}).ToList();
} }
public List<SecondPerforResponse> AddAprAmount(int allotId, List<SecondPerforResponse> computes) public List<SecondPerforResponse> AddAprAmount(int allotId, List<SecondPerforResponse> computes)
......
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