Commit 7e47f334 by lcx

Merge branch 'v2020morge' into v2020morge-graphql

parents d9c5858d cfddeca9
......@@ -2880,19 +2880,19 @@
</summary>
</member>
<member name="P:Performance.DtoModels.DeptResponse.ID">
<summary>
<summary>
</summary>
</summary>
</member>
<member name="P:Performance.DtoModels.DeptResponse.AllotID">
<summary>
<summary>
</summary>
</summary>
</member>
<member name="P:Performance.DtoModels.DeptResponse.SheetID">
<summary>
<summary>
</summary>
</summary>
</member>
<member name="P:Performance.DtoModels.DeptResponse.UnitName">
<summary>
......@@ -3034,6 +3034,21 @@
调节后其他绩效
</summary>
</member>
<member name="P:Performance.DtoModels.DeptResponse.AssessLaterPerforTotal">
<summary>
考核后绩效
</summary>
</member>
<member name="P:Performance.DtoModels.DeptResponse.AssessLaterManagementFee">
<summary>
考核后管理绩效
</summary>
</member>
<member name="P:Performance.DtoModels.DeptResponse.AprPerforAmount">
<summary>
其他绩效
</summary>
</member>
<member name="P:Performance.DtoModels.DirectorResponse.TypeName">
<summary>
绩效类型
......
......@@ -7,17 +7,17 @@ namespace Performance.DtoModels
public class DeptResponse
{
/// <summary>
///
///
/// </summary>
public int ID { get; set; }
/// <summary>
///
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
///
///
/// </summary>
public Nullable<int> SheetID { get; set; }
......@@ -152,13 +152,30 @@ public class DeptResponse
/// 考核前其他绩效
/// </summary>
public Nullable<decimal> AssessBeforeOtherFee { get; set; }
/// <summary>
/// 考核后其他绩效
/// </summary>
public Nullable<decimal> AssessLaterOtherFee { get; set; }
/// <summary>
/// 调节后其他绩效
/// </summary>
public Nullable<decimal> AdjustLaterOtherFee { get; set; }
/// <summary>
/// 考核后绩效
/// </summary>
public Nullable<decimal> AssessLaterPerforTotal { get; set; }
/// <summary>
/// 考核后管理绩效
/// </summary>
public Nullable<decimal> AssessLaterManagementFee { get; set; }
/// <summary>
/// 其他绩效
/// </summary>
public Nullable<decimal> AprPerforAmount { get; set; }
}
}
......@@ -248,7 +248,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
JobTitle = empolyee.JobTitle,
JobNumber = empolyee.JobNumber,
ScoreAverageRate = empolyee.ScoreAverageRate,
Punishment = 0,
Punishment = empolyee.Punishment ?? 0,
//OtherPerfor = empolyee.OtherPerfor,
OtherManagePerfor = empolyee?.OtherManagePerfor ?? 0,
Number = group.Number,
......
......@@ -316,36 +316,84 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
result.ForEach(t =>
{
t.UnitName = ((UnitType)t.UnitType).ToString();
t.ScoringPerfor = t.PerforFee * (t.ScoringAverage ?? 0);
t.AssessLaterPerforTotal = Math.Round((t.PerforTotal * t.ScoringAverage + t.MedicineExtra + t.MaterialsExtra + t.Extra + t.AssessLaterOtherFee) ?? 0);
});
result = result.OrderBy(t => t.UnitType).ThenBy(t => t.AccountingUnit).ToList();
}
var accountType = new List<AccountUnitType> { AccountUnitType.行政高层, AccountUnitType.行政中层, AccountUnitType.行政工勤 };
var list = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId && accountType.Select(a => a.ToString()).Contains(t.AccountType));
var list = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId);
if (list == null || !list.Any()) return result;
List<DeptResponse> adminPerfor = list.GroupBy(t => new { t.AccountingUnit, t.AccountType })
.Select(t => new DeptResponse
{
UnitName = t.Key.AccountType,
AccountingUnit = t.Key.AccountingUnit,
Department = t.Key.AccountingUnit,
Number = t.Count(),
//Extra = t.FirstOrDefault(group => group.Punishment > 0)?.Punishment, // 医院奖罚
//ScoringAverage = t.FirstOrDefault(group => group.ScoreAverageRate > 0)?.ScoreAverageRate, //考核得分率
//AdjustFactor = t.FirstOrDefault(group => group.Adjust > 0)?.Adjust, //调节系数
//WorkloadFee = t.Sum(group => group.Workload), //工作量绩效
//PerforTotal = t.Sum(group => group.RealGiveFee), //绩效合计
//ScoringPerfor = t.Sum(group => group.RealGiveFee) * (t.FirstOrDefault(group => group.ScoreAverageRate > 0)?.ScoreAverageRate ?? 0),
Avg = t.Sum(group => group.RealGiveFee) / t.Count(), //人均绩效
OtherPerfor1 = t.Sum(group => group.OtherPerfor),
RealGiveFee = t.Sum(group => group.RealGiveFee) + t.Sum(group => group.OtherPerfor), //实发绩效
}).ToList();
var enumItems = EnumHelper.GetItems<AccountUnitType>();
adminPerfor = adminPerfor.OrderBy(t => enumItems.FirstOrDefault(e => e.Name == t.UnitName).Value).ThenBy(t => t.AccountingUnit).ToList();
var isShowManage = IsShowManage(allotId);
Dictionary<string, string> dict = new Dictionary<string, string>
{
{ "科主任", "医生组" },
{ "护士长", "护理组" },
{ AccountUnitType.行政高层.ToString(), AccountUnitType.行政高层.ToString() },
{ AccountUnitType.行政中层.ToString(), AccountUnitType.行政中层.ToString() },
{ AccountUnitType.行政工勤.ToString(), AccountUnitType.行政工勤.ToString() }
};
List<DeptResponse> adminPerfor = list.GroupBy(t => new { t.AccountingUnit, t.AccountType }).Select(t =>
{
string unitName = result.Where(w => !dict.Values.Contains(w.UnitName)).FirstOrDefault(w => w.AccountingUnit == t.Key.AccountingUnit)?.UnitName ?? "";
return new DeptResponse
{
UnitName = !dict.Values.Contains(unitName) && !string.IsNullOrEmpty(unitName) ? unitName : dict.ContainsKey(t.Key.AccountType) ? dict[t.Key.AccountType] : "未知",
AccountingUnit = t.Key.AccountingUnit,
Department = t.Key.AccountingUnit,
Number = t.Count(),
// OtherPerfor1 = t.Sum(group => group.OtherPerfor),
AssessLaterManagementFee = isShowManage == 1 ? t.Sum(group => group.RealGiveFee ?? 0) + t.Sum(group => group.OtherPerfor ?? 0) //实发绩效
: Math.Round((t.Max(m => m.ShouldGiveFee) * t.Max(m => m.ScoreAverageRate) * t.Max(m => m.Attendance) ?? 0.0M) + t.Max(m => m.Punishment ?? 0.0M)) //考核后管理绩效
};
}).ToList();
result.AddRange(adminPerfor);
var aprAmounts = perapramountRepository.GetEntities(t => t.AllotId == allotId && t.Status == 3) ?? new List<per_apr_amount>();
var employees = perforPeremployeeRepository.GetEntities(t => t.AllotId == allotId) ?? new List<per_employee>();
var otherPerformances = aprAmounts.Join(employees, outer => new { outer.AccountingUnit, outer.PersonnelNumber }, inner => new { inner.AccountingUnit, inner.PersonnelNumber }, (outer, inner) => new
{
AccountingUnit = outer.AccountingUnit,
UnitType = inner.UnitType,
PersonnelNumber = outer.PersonnelNumber,
PersonnelName = inner.DoctorName,
Amount = outer.Amount
})?.GroupBy(t => new { t.AccountingUnit, t.UnitType }).Select(t => new
{
AccountingUnit = t.Key.AccountingUnit,
UnitType = t.Key.UnitType,
Amount = t.Sum(s => s.Amount)
});
result = result.GroupBy(t => new { t.AccountingUnit, t.UnitName }).Select(t => new DeptResponse
{
UnitName = t.Key.UnitName,
AccountingUnit = t.Key.AccountingUnit,
Department = t.Key.AccountingUnit,
PerforFee = t.Sum(group => group.PerforFee),
WorkloadFee = t.Sum(group => group.WorkloadFee),
AssessBeforeOtherFee = t.Sum(group => group.AssessBeforeOtherFee),
ScoringAverage = t.Sum(group => group.ScoringAverage),
MedicineExtra = t.Sum(group => group.MedicineExtra),
Extra = t.Sum(group => group.Extra),
AssessLaterOtherFee = t.Sum(group => group.AssessLaterOtherFee),
AdjustFactor = t.Sum(group => group.AdjustFactor),
AdjustLaterOtherFee = t.Sum(group => group.AdjustLaterOtherFee),
PerforTotal = t.Sum(group => group.PerforTotal),
AssessLaterPerforTotal = t.Sum(group => group.AssessLaterPerforTotal),
AssessLaterManagementFee = t.Sum(group => group.AssessLaterManagementFee),
AprPerforAmount = otherPerformances?.FirstOrDefault(w => w.AccountingUnit == t.Key.AccountingUnit && w.UnitType == t.Key.UnitName)?.Amount ?? 0,
RealGiveFee = t.Sum(group => group.RealGiveFee) + t.Sum(group => group.AssessLaterManagementFee)
+ (otherPerformances?.FirstOrDefault(w => w.AccountingUnit == t.Key.AccountingUnit && w.UnitType == t.Key.UnitName)?.Amount ?? 0),
}).ToList();
var enumItems = EnumHelper.GetItems<AccountUnitType>();
result = result.OrderBy(t => enumItems.FirstOrDefault(e => e.Name == t.UnitName)?.Value)/*.ThenBy(t => t.AccountingUnit)*/.ToList();
return result;
}
......
......@@ -19,6 +19,7 @@ public class PerSheetDataReadPersonExtra : IPerSheetDataRead
HeaderLastRowNum = 1,
HeaderFirstCellNum = 0,
DataFirstRowNum = 2,
DataFirstCellNum = 4,
TotalCellNum = 0,
AccountingUnit = new List<AccountingUnit>
{
......@@ -45,7 +46,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
var row = sheet.GetRow(r);
if (row == null) continue;
for (int c = 0; c < vhead.Count(); c++)
for (int c = Point.DataFirstCellNum.Value; c < vhead.Count(); c++)
{
var athead = vhead.ElementAt(c);
//var cellValue = NopiSevice.GetCellValue(row.GetCell(athead.PointCell));
......@@ -74,7 +75,6 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
if (unit.JobCellNum.HasValue)
data.JobNumber = row.GetCell(unit.JobCellNum.Value).GetValue();
if (string.IsNullOrEmpty(data.AccountingUnit) && string.IsNullOrEmpty(data.Department))
continue;
dataList.Add(data);
......
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