Commit 0998f72f by lcx

绩效计算科主任使用实发绩效改为核算总额,使用excel中的绩效参数,抽取bug修改,工作量详情接口和人员字典匹配

parent 08837348
......@@ -166,7 +166,7 @@ public ApiResponse DeptDics(int hospitalId, int type)
[Route("dept/workdetail")]
public ApiResponse DeptWorkloadDetail([CustomizeValidator(RuleSet = "Select"), FromBody] WorkDetailRequest request)
{
var data = personService.DeptWorkloadDetail(request);
var data = personService.DeptWorkloadDetail(request, claimService.GetUserId());
return new ApiResponse(ResponseType.OK, data);
}
}
......
......@@ -67,6 +67,16 @@ public ApiResponse Info([FromBody] SelectionRequest report)
[HttpPost]
public ApiResponse Search([FromBody] SearchReportRequest report)
{
if (report.Values == null || !report.Values.Any())
return new ApiResponse(ResponseType.OK, new List<ReportData>());
string[] keys = new string[] { "year", "month", };
foreach (var item in report.Values.Where(t => keys.Contains(t.Title)))
{
if (item.Values == null || !item.Values.Any(t => !string.IsNullOrEmpty(t)))
return new ApiResponse(ResponseType.OK, new List<ReportData>());
}
var userId = claimService.GetUserId();
var result = reportDataService.GetReportData(report.HospitalId, report.GroupId, report.ReportId, report.Values ?? new List<SelectionValues>(), userId);
return new ApiResponse(ResponseType.OK, result);
......
......@@ -353,6 +353,11 @@
绩效基数核算参考对象
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeEmployee.FitPeopleValue">
<summary>
绩效基础核算参考值
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeEmployee.FitPeopleRatio">
<summary>
绩效基数核算参考对象取值比例(如临床科室护士*95%)
......@@ -990,6 +995,11 @@
绩效基数核算参考对象
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataEmployee.FitPeopleValue">
<summary>
绩效基础核算参考值
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataEmployee.FitPeopleRatio">
<summary>
绩效基数核算参考对象取值比例(如临床科室护士*95%)
......
......@@ -2118,6 +2118,11 @@
绩效基数核算参考对象
</summary>
</member>
<member name="P:Performance.EntityModels.im_employee.FitPeopleValue">
<summary>
绩效基础核算参考值
</summary>
</member>
<member name="P:Performance.EntityModels.im_employee.FitPeopleRatio">
<summary>
绩效基数核算参考对象取值比例(如临床科室护士*95%)
......
......@@ -27,6 +27,11 @@ public class ComputeEmployee
public string FitPeople { get; set; }
/// <summary>
/// 绩效基础核算参考值
/// </summary>
public Nullable<decimal> FitPeopleValue { get; set; }
/// <summary>
/// 绩效基数核算参考对象取值比例(如临床科室护士*95%)
/// </summary>
public Nullable<decimal> FitPeopleRatio { get; set; }
......
......@@ -22,6 +22,11 @@ public class PerDataEmployee : IPerData
public string FitPeople { get; set; }
/// <summary>
/// 绩效基础核算参考值
/// </summary>
public Nullable<decimal> FitPeopleValue { get; set; }
/// <summary>
/// 绩效基数核算参考对象取值比例(如临床科室护士*95%)
/// </summary>
public Nullable<decimal> FitPeopleRatio { get; set; }
......
......@@ -55,7 +55,12 @@ public class im_employee
/// 绩效基数核算参考对象
/// </summary>
public string FitPeople { get; set; }
/// <summary>
/// 绩效基础核算参考值
/// </summary>
public Nullable<decimal> FitPeopleValue { get; set; }
/// <summary>
/// 绩效基数核算参考对象取值比例(如临床科室护士*95%)
/// </summary>
......
......@@ -155,15 +155,15 @@ public void ImportWorkloadData(per_allot allot, object parameters)
/// 查询工作量数据
/// </summary>
/// <param name="allotid"></param>
public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, string accountingunit)
public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, string accountingunit, string[] unittype)
{
using (var connection = context.Database.GetDbConnection())
{
if (connection.State != ConnectionState.Open) connection.Open();
try
{
string clear = "select * from report_original_workload where allotid = @allotid and accountingunit = @accountingunit order by fee desc,convert(doctorname using gbk);";
return connection.Query<report_original_workload>(clear, new { allotid, accountingunit }, commandTimeout: 60 * 60);
string clear = "select * from report_original_workload t1 join per_employee t2 on t1.doctorname = t2.doctorname and t1.personnelnumber = t2.personnelnumber where t1.allotid = @allotid and t1.accountingunit = @accountingunit and t1.accountingunit = @accountingunit and t2.unittype in @unittype order by fee desc,convert(t1.doctorname using gbk);";
return connection.Query<report_original_workload>(clear, new { allotid, accountingunit, unittype }, commandTimeout: 60 * 60);
}
catch (Exception ex)
{
......
......@@ -122,7 +122,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
var doctor = baiscNormService.GetBaiscNorm(baiscnormList, PerforType.临床医生) ?? 0;
var nurse = baiscNormService.GetBaiscNorm(baiscnormList, PerforType.护士) ?? 0;
// 添加参数计算
item.Quantity = (doctor + nurse) / 2;
item.Quantity = item.Quantity ?? (doctor + nurse) / 2;
}
else
{
......@@ -130,7 +130,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
// ?.FirstOrDefault().FitPeopleRatio ?? 1;
var basic = baiscNormService.GetBaiscNorm(baiscnormList, (PerforType)type.Value);
// 添加参数计算
item.Quantity = basic != null ? basic : null;
item.Quantity = item.Quantity ?? (basic ?? 0);
}
}
}
......@@ -245,7 +245,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
//实发绩效
compute.RealGiveFee = (compute.GiveFee * compute.ScoreAverageRate + (compute.Punishment ?? 0) + (compute.OtherPerfor ?? 0)) * (compute.Adjust ?? 1m);
// 参考基数专用绩效合计
compute.BaiscNormPerforTotal = compute.RealGiveFee;
compute.BaiscNormPerforTotal = compute.PerforTotal;
computeList.Add(compute);
}
......
......@@ -103,7 +103,8 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
var employees = _perforImemployeeclinicRepository.GetEntities(t => t.AllotID == allotId && pairs[type].Contains(t.UnitType));
if (employees == null || !employees.Any()) return new List<ResComputeResponse>();
var computes = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId);
string[] accountunittype = new string[] { AccountUnitType.行政中层.ToString(), AccountUnitType.行政工勤.ToString(), AccountUnitType.行政高层.ToString() };
var computes = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId && !accountunittype.Contains(t.AccountType));
if (computes == null || !computes.Any()) return new List<ResComputeResponse>();
var joinData = employees.Join(computes, outer => new { outer.AccountingUnit, EmployeeName = outer.DoctorName },
......@@ -119,7 +120,7 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
accountUnit.ToList().ForEach(t =>
{
var compute = joinData.First(join => join.EmployeeName == t.EmployeeName);
if (compute.AccountingUnit != t.AccountingUnit)
if (compute.AccountingUnit != t.AccountingUnit && !joinData.Any(w => w.EmployeeName == t.EmployeeName && w.AccountingUnit == t.AccountingUnit))
joinData.Add(t);
});
}
......@@ -142,8 +143,10 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
joinData.RemoveAll(t => delData.Select(d => d.ID).Contains(t.ID));
}
}
if (joinData == null || !joinData.Any()) return new List<ResComputeResponse>();
data = Mapper.Map<List<ResComputeResponse>>(joinData);
data?.ForEach(t =>
data.ForEach(t =>
{
t.WorkTime = string.IsNullOrEmpty(t.WorkTime) ? null : Convert.ToDateTime(t.WorkTime).ToString("yyyy-MM-dd");
if (isShowManage == 2)
......@@ -157,15 +160,18 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
t.BaiscNormValue = t.RealGiveFee;
}
});
return data?.OrderByDescending(t => t.AccountingUnit).ToList();
return data.Distinct().OrderByDescending(t => t.AccountingUnit).ToList();
}
else
{
var compute = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId && t.AccountType == items.FirstOrDefault(p => p.Value == type).Name)
?.OrderByDescending(t => t.RealGiveFee).ThenBy(t => t.FitPeople).ThenBy(t => t.AccountingUnit).ToList();
var compute = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId && t.AccountType == items.FirstOrDefault(p => p.Value == type).Name);
if (compute == null || !compute.Any()) return new List<ResComputeResponse>();
data = Mapper.Map<List<ResComputeResponse>>(compute);
data?.ForEach(t => t.WorkTime = string.IsNullOrEmpty(t.WorkTime) ? null : Convert.ToDateTime(t.WorkTime).ToString("yyyy-MM-dd"));
return data?.OrderByDescending(t => t.AccountingUnit).ToList();
data = data.OrderByDescending(t => t.RealGiveFee).ThenBy(t => t.FitPeople).ThenBy(t => t.AccountingUnit).ToList();
data.ForEach(t => t.WorkTime = string.IsNullOrEmpty(t.WorkTime) ? null : Convert.ToDateTime(t.WorkTime).ToString("yyyy-MM-dd"));
return data.Distinct().OrderByDescending(t => t.AccountingUnit).ToList();
}
}
......@@ -662,13 +668,26 @@ private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details
}
else
{
items = data.First().Items.Select(t => new DetailModuleExtend
if (data.FirstOrDefault().ItemName.IndexOf("执行") > -1)
{
ItemName = t.ItemName,
ItemValue = t.ItemValue,
CellValue = t.CellValue,
Factor = t.Factor,
}).ToList();
items = data.First().Items.Select(t => new DetailModuleExtend
{
ItemName = t.ItemName,
ItemValue2 = t.ItemValue,
CellValue2 = t.CellValue,
Factor2 = t.Factor,
}).ToList();
}
else
{
items = data.First().Items.Select(t => new DetailModuleExtend
{
ItemName = t.ItemName,
ItemValue = t.ItemValue,
CellValue = t.CellValue,
Factor = t.Factor,
}).ToList();
}
}
result.Detail.Add(new DetailDtos<DetailModuleExtend>
......
......@@ -590,7 +590,8 @@ private List<NewExtractDto> StandData(IEnumerable<ex_result> results)
InpatTechnicAccounting = t.inner.FirstOrDefault(l => l.Department == dept)?.InpatTechnicAccounting?.AccountingUnit,
};
});
new Task(() => SaveWorkload(data.Where(t => t.SheetName.Contains("3.")))).Start();
//new Task(() => SaveWorkload(data.Where(t => t.SheetName.Contains("3.")))).Start();
SaveWorkload(data.Where(t => t.SheetName.Contains("3.")));
var groupdata = data.GroupBy(t => new { t.Department, t.Category, t.SheetName }).Select(t => new NewExtractDto
{
SheetName = t.Key.SheetName,
......
......@@ -341,7 +341,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
};
foreach (var type in unitTypes)
{
if (empolyee.JobTitle.IndexOf(type.JobTitle) == -1) continue;
if ((empolyee.JobTitle?.IndexOf(type.JobTitle) ?? -1) == -1) continue;
foreach (var item in type.UnitType)
{
resAccount = dataList.FirstOrDefault(t => t.UnitType == item && t.AccountingUnit == empolyee.AccountingUnit);
......@@ -354,10 +354,10 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
var basicRule = basicRuleList.FirstOrDefault(t => t.UnitType == (UnitType)resAccount.UnitType);
if (basicRule == null) continue;
var avg = (resAccount.ManagerNumber + resAccount.Number) == 0 ? 0 : resAccount.RealGiveFee / (resAccount.ManagerNumber + resAccount.Number);
var effAvg = resAccount.PermanentStaff == 0 ? 0 : resAccount.RealGiveFee / resAccount.PermanentStaff;
var avg = (resAccount.ManagerNumber + resAccount.Number) == 0 ? 0 : resAccount.PerforTotal / (resAccount.ManagerNumber + resAccount.Number);
var effAvg = resAccount.PermanentStaff == 0 ? 0 : resAccount.PerforTotal / resAccount.PermanentStaff;
var efficiency = avg * (empolyee.Efficiency ?? 1);
//var efficiency = avg * (empolyee.Efficiency ?? 1);
var scale = resAccount.PerforTotal * (empolyee.Scale ?? 1);
var compute = new ComputeResult
{
......@@ -375,7 +375,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
OtherPerfor = empolyee.OtherPerfor,
Number = resAccount.ManagerNumber + resAccount.Number,
PerforTotal = resAccount.RealGiveFee,
PerforTotal = resAccount.PerforTotal,
Avg = avg,
Efficiency = effAvg * (empolyee.Efficiency ?? 1),
Scale = resAccount.PerforTotal * (empolyee.Scale ?? 1),
......@@ -398,7 +398,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
//compute.RealGiveFee = (compute.GiveFee * compute.ScoreAverageRate * (compute.Attendance ?? 0) + (compute.Punishment ?? 0) + (compute.OtherPerfor ?? 0)) * (compute.Adjust ?? 1m);
compute.RealGiveFee = compute.GiveFee * (compute.Adjust ?? 1m);
// 参考基数专用绩效合计
compute.BaiscNormPerforTotal = compute.RealGiveFee;
compute.BaiscNormPerforTotal = compute.PerforTotal;
computeList.Add(compute);
}
......@@ -454,7 +454,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
if (perforTypeItem != null)
{
var perforType = (PerforType)perforTypeItem.Value;
baiscnorm = baiscNormService.GetBaiscNorm(baiscnormList, perforType);
baiscnorm = item.FitPeopleValue ?? baiscNormService.GetBaiscNorm(baiscnormList, perforType);
//年资系数
if (item.FitPeople == AccountUnitType.行政工勤.ToString() && item.WorkTime.HasValue && item.WorkTime.Value > new DateTime(1970, 1, 1))
......
......@@ -31,6 +31,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
"医生姓名",
"职务分类",
"绩效基数核算参考对象",
"绩效基础核算参考值",
"绩效基数核算系数",
"人员分类",
"岗位系数",
......@@ -60,6 +61,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
DoctorName = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医生姓名").PointCell)?.StringCellValue,
JobTitle = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "职务分类").PointCell)?.StringCellValue,
FitPeople = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "绩效基数核算参考对象").PointCell)?.StringCellValue,
FitPeopleValue = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "绩效基础核算参考值").PointCell)?.ToString()),
FitPeopleRatio = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "绩效基数核算系数").PointCell)?.NumericCellValue),
AccountType = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员分类").PointCell)?.StringCellValue,
PostCoefficient = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "岗位系数").PointCell)?.NumericCellValue),
......
......@@ -53,7 +53,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
//AccountingUnit = accountingUnit,
//Department = accountingUnit,
QuantitativeIndicators = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "量化指标").PointCell)?.StringCellValue,
Quantity = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "数量").PointCell)?.NumericCellValue),
Quantity = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "数量").PointCell)?.ToString()),
QuantitativeIndicatorsValue = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "量化指标绩效分值").PointCell)?.NumericCellValue),
};
var cell = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室").PointCell);//?.ToString();
......
......@@ -464,18 +464,22 @@ public List<TitleValue> DeptDics(int hospitalId, int type)
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public object DeptWorkloadDetail(WorkDetailRequest request)
public object DeptWorkloadDetail(WorkDetailRequest request, int userId)
{
var data = perallotRepository.QueryWorkloadData(request.AllotId, request.AccountingUnit);
var (dept, unittype) = GetDeptByUser(userId);
var data = perallotRepository.QueryWorkloadData(request.AllotId, request.AccountingUnit, unittype);
if (data != null && data.Any())
return data.Select(t => new
{
return data.GroupBy(t => new { t.Department, t.DoctorName, t.PersonnelNumber, t.Category }).Select(t => new
{
t.Department,
t.DoctorName,
t.PersonnelNumber,
t.Category,
t.Fee
});
t.Key.Department,
t.Key.DoctorName,
t.Key.PersonnelNumber,
t.Key.Category,
Fee = t.Sum(group => group.Fee ?? 0)
}).OrderBy(t => t.PersonnelNumber).ThenBy(t => t.Category);
}
return new string[] { };
}
}
......
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