Commit 2c276221 by lcx

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

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