Commit 14107b79 by ruyun.zhang@suvalue.com

Merge branch 'v20201230yubei' into v2020morge

parents a915da7e 5bee29a3
......@@ -375,28 +375,46 @@ public void ComputeOffice(per_allot allot, PerExcel excel)
//var materialsExtra = materialsExtras.FirstOrDefault(w => w.UnitType == account.AccountType.ToString() && w.AccountingUnit == resAccount.AccountingUnit)?.TotelValue;
var dept = new PerDataAccountBaisc();
//dept.ManagerNumber = resAccount?.ManagerNumber ?? 0;
dept.Number = empolyees.Count();
dept.AccountingUnit = account.AccountingUnit;
dept.UnitType = account.AccountType;
dept.ScoringAverage = resAccount?.ScoringAverage == null ? 0 : resAccount.ScoringAverage;
dept.AdjustFactor = (isBudget ? adjust : resAccount?.AdjustFactor) ?? 1;
dept.Income = empolyees.Sum(w => w.PerforTotal ?? 0);
dept.NeedSecondAllot = empolyees.Any(w => w.NeedSecondAllot == "是") ? "是" : "否";
if (resAccount?.UnitType == UnitType.行政后勤.ToString() && resAccount?.NeedSecondAllot == "是")
{
dept.ScoringAverage = resAccount?.ScoringAverage == null ? 0 : resAccount.ScoringAverage;
dept.AdjustFactor = (isBudget ? adjust : resAccount?.AdjustFactor) ?? 1;
dept.Extra = resAccount?.Extra ?? 0;
dept.MedicineExtra = resAccount?.MedicineExtra ?? 0;// (drugExtra ?? 0);
dept.MaterialsExtra = resAccount?.MaterialsExtra ?? 0;//(materialsExtra ?? 0);
dept.AssessBeforeOtherFee = resAccount?.AssessBeforeOtherFee ?? 0;
dept.AssessLaterOtherFee = resAccount?.AssessLaterOtherFee ?? 0;
// 行政后勤 没有 调节后其他绩效
//dept.AdjustLaterOtherFee = resAccount?.AdjustLaterOtherFee ?? 0;
}
else
{
dept.ScoringAverage = 1;
dept.AdjustFactor = 1;
dept.Extra = empolyees?.Sum(w => w.Punishment) ?? 0;
dept.MedicineExtra = 0;// (drugExtra ?? 0);
dept.MaterialsExtra = 0;//(materialsExtra ?? 0);
dept.AssessBeforeOtherFee = empolyees?.Sum(w => w.AssessBeforeOtherFee) ?? 0;
dept.AssessLaterOtherFee = empolyees?.Sum(w => w.AssessLaterOtherFee) ?? 0;
dept.AdjustLaterOtherFee = empolyees?.Sum(w => w.AdjustLaterOtherFee) ?? 0;
}
//dept.Extra = (extra ?? 0);
//dept.MedicineExtra = 0;// (drugExtra ?? 0);
//dept.MaterialsExtra = 0;//(materialsExtra ?? 0);
dept.Extra = resAccount?.Extra ?? 0;
dept.MedicineExtra = resAccount?.MedicineExtra ?? 0;// (drugExtra ?? 0);
dept.MaterialsExtra = resAccount?.MaterialsExtra ?? 0;//(materialsExtra ?? 0);
dept.AssessBeforeOtherFee = resAccount?.AssessBeforeOtherFee ?? 0;
dept.AssessLaterOtherFee = resAccount?.AssessLaterOtherFee ?? 0;
dept.AdjustLaterOtherFee = resAccount?.AdjustLaterOtherFee ?? 0;
dept.PerforFee = empolyees.Sum(w => w.PerforTotal ?? 0);
dept.PerforTotal = Math.Round(empolyees.Sum(w => w.GiveFee ?? 0));
dept.RealGiveFee = Math.Round(((dept.PerforTotal * dept.ScoringAverage + dept.MedicineExtra + dept.MaterialsExtra + dept.Extra) * dept.AdjustFactor) ?? 0);
dept.RealGiveFee = Math.Round(((dept.PerforTotal * dept.ScoringAverage + dept.MedicineExtra + dept.MaterialsExtra + dept.Extra) * dept.AdjustFactor + dept.AdjustLaterOtherFee) ?? 0);
//dept.Avg = dept.ManagerNumber + dept.Number == 0 ? 0 : dept.PerforTotal / (dept.ManagerNumber + dept.Number);
dept.Avg = dept.Number == 0 ? 0 : dept.PerforTotal / dept.Number;
......
......@@ -319,7 +319,8 @@ public List<DeptResponse> GetOfficePerformance(int allotId)
public List<DeptResponse> GetAdminPerformance(int allotId)
{
var result = new List<DeptResponse>();
//var types = new[] { (int)UnitType.行政高层, (int)UnitType.行政中层 };
//var resData = perforResaccountRepository.GetEntities(t => t.AllotID == allotId && !types.Contains(t.UnitType ?? 0));
var resData = perforResaccountRepository.GetEntities(t => t.AllotID == allotId);
if (resData != null && resData.Any())
{
......@@ -327,11 +328,10 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
result.ForEach(t =>
{
t.UnitName = ((UnitType)t.UnitType).ToString();
t.AssessLaterPerforTotal = Math.Round((t.PerforTotal * t.ScoringAverage + t.MedicineExtra + t.MaterialsExtra + t.Extra + t.AssessLaterOtherFee) ?? 0);
t.AssessLaterPerforTotal = Math.Round((t.PerforTotal * t.ScoringAverage + (t.MedicineExtra ?? 0) + (t.MaterialsExtra ?? 0) + (t.Extra ?? 0) + (t.AssessLaterOtherFee ?? 0)) ?? 0);
});
result = result.OrderBy(t => t.UnitType).ThenBy(t => t.AccountingUnit).ToList();
}
var list = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId);
if (list == null || !list.Any()) return result;
......@@ -1455,12 +1455,12 @@ public res_baiscnorm EditHospitalAvg(ComputerAvgRequest request)
public List<Dictionary<string, string>> GetOtherPerStats(List<per_apr_amount> employees)
{
var others = new List<Dictionary<string, string>>();
if (employees==null)
if (employees == null)
return others;
var perForType = employees.Where(c=>c.Status==3).Select(t => t.PerforType).Distinct();
var doctorNum = employees.Where(c=>c.Status==3).Select(t => t.PersonnelNumber).Distinct().ToList();
var perForType = employees.Where(c => c.Status == 3).Select(t => t.PerforType).Distinct();
var doctorNum = employees.Where(c => c.Status == 3).Select(t => t.PersonnelNumber).Distinct().ToList();
if (!doctorNum.Any())
return others;
......@@ -1470,21 +1470,21 @@ public res_baiscnorm EditHospitalAvg(ComputerAvgRequest request)
var amount = employees.Find(t => t.PersonnelNumber == num);
if (amount == null)
continue;
dicData.Add("核算单元",amount?.AccountingUnit??"");
dicData.Add("工号",amount?.PersonnelNumber??"");
dicData.Add("人员姓名",amount?.DoctorName??"");
dicData.Add("核算单元", amount?.AccountingUnit ?? "");
dicData.Add("工号", amount?.PersonnelNumber ?? "");
dicData.Add("人员姓名", amount?.DoctorName ?? "");
foreach (var type in perForType)
{
var emp = employees.Where(t => t.PerforType == type && t.PersonnelNumber == num)?.ToList();
if (!emp.Any())
dicData.Add(type,"0");
dicData.Add(type, "0");
else
dicData.Add(type,Math.Round(Convert.ToDecimal(emp?.First()?.Amount),0).ToString());
dicData.Add(type, Math.Round(Convert.ToDecimal(emp?.First()?.Amount), 0).ToString());
}
var sum = employees.Where(c=>c.PersonnelNumber==num)?.Sum(t => t.Amount);
dicData.Add("合计",Math.Round(Convert.ToDecimal(sum),0).ToString());
var sum = employees.Where(c => c.PersonnelNumber == num)?.Sum(t => t.Amount);
dicData.Add("合计", Math.Round(Convert.ToDecimal(sum), 0).ToString());
others.Add(dicData);
}
......
......@@ -74,7 +74,7 @@ public static string GetValue(this ICell cell)
return cell?.StringCellValue.ToString();
case CellType.Formula:
cell?.SetCellType(CellType.String);
return cell?.StringCellValue.ToString();
return cell?.StringCellValue?.ToString();
case CellType.Boolean:
return cell?.BooleanCellValue.ToString();
case CellType.Unknown:
......
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