二次分配人员字典

parent 0875f445
...@@ -786,32 +786,16 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request) ...@@ -786,32 +786,16 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request)
} }
/// <summary> /// <summary>
/// 二次分配人员字典带出 /// 二次分配人员字典带出
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[Route("api/second/redistribution/employee")] [Route("api/second/redistribution/employee")]
[HttpPost] [HttpPost]
public ApiResponse RedistributionEmployee([FromBody] SecondComputeDto request) public ApiResponse RedistributionEmployee([FromBody] SecondEmployeeDto request)
{ {
// 返回信息 // 返回信息
//rownumber: 11 var employees = _redistributionService.RedistributionEmployee(request);
//secondid: 1472 return new ApiResponse(ResponseType.OK, employees);
//department: "呼吸内科" nameof(ag_bodysource.Department);
//name: "付小锋" nameof(ag_bodysource.Name);
//jobtitle: "副高"
//post: "其他"
//worknumber: "197"
//workperformance: 6570.62
//titlecoefficient: 1
//actualattendance: 31
//staffcoefficient: 1
//动态
//assessmentscore_12: 100
//assessmentscore_default: 100
return new ApiResponse(ResponseType.Fail, "字典带出失败");
} }
#endregion #endregion
} }
......
...@@ -1647,10 +1647,10 @@ ...@@ -1647,10 +1647,10 @@
<param name="request"></param> <param name="request"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.SecondAllotController.RedistributionEmployee(Performance.DtoModels.SecondComputeDto)"> <member name="M:Performance.Api.Controllers.SecondAllotController.RedistributionEmployee(Performance.DtoModels.SecondEmployeeDto)">
<summary> <summary>
二次分配人员字典带出 二次分配人员字典带出
</summary> </summary>
<param name="request"></param> <param name="request"></param>
<returns></returns> <returns></returns>
</member> </member>
......
...@@ -3781,11 +3781,16 @@ ...@@ -3781,11 +3781,16 @@
纵向计算 纵向计算
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.SecondLoadDto.ComputeMode"> <member name="P:Performance.DtoModels.SecondEmployeeDto.ComputeMode">
<summary> <summary>
计算方式:1 不计算 2 横向计算 3 纵向计算 计算方式:1 不计算 2 横向计算 3 纵向计算
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.SecondLoadDto.ComputeMode">
<summary>
计算方式:11 不计算 12 横向计算 13 纵向计算
</summary>
</member>
<member name="P:Performance.DtoModels.SecondLoadDto.OverrideMode"> <member name="P:Performance.DtoModels.SecondLoadDto.OverrideMode">
<summary> <summary>
数据加载方式:0 保存,1 上次,2 字典 数据加载方式:0 保存,1 上次,2 字典
......
namespace Performance.DtoModels
{
public class SecondEmployeeDto : PersonParamsRequest
{
public int SecondId { get; set; }
/// <summary>
/// 计算方式:11 不计算 12 横向计算 13 纵向计算
/// </summary>
public int ComputeMode { get; set; }
}
}
...@@ -4,7 +4,7 @@ public class SecondLoadDto ...@@ -4,7 +4,7 @@ public class SecondLoadDto
{ {
public int SecondId { get; set; } public int SecondId { get; set; }
/// <summary> /// <summary>
/// 计算方式:1 不计算 2 横向计算 3 纵向计算 /// 计算方式:11 不计算 12 横向计算 13 纵向计算
/// </summary> /// </summary>
public int ComputeMode { get; set; } public int ComputeMode { get; set; }
/// <summary> /// <summary>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Linq.Expressions;
namespace Performance.Services namespace Performance.Services
{ {
...@@ -24,6 +25,7 @@ public class RedistributionService : IAutoInjection ...@@ -24,6 +25,7 @@ public class RedistributionService : IAutoInjection
private readonly SecondAllotDetails _secondAllotDetails; private readonly SecondAllotDetails _secondAllotDetails;
private readonly PerforPerallotRepository _perallotRepository; private readonly PerforPerallotRepository _perallotRepository;
private readonly PerforPeremployeeRepository _peremployeeRepository; private readonly PerforPeremployeeRepository _peremployeeRepository;
private readonly PerforRescomputeRepository _rescomputeRepository;
private readonly PerforAgsecondallotRepository _secondallotRepository; private readonly PerforAgsecondallotRepository _secondallotRepository;
private readonly PerforPerapramountRepository _perapramountRepository; private readonly PerforPerapramountRepository _perapramountRepository;
private readonly PerforAgothersourceRepository _agothersourceRepository; private readonly PerforAgothersourceRepository _agothersourceRepository;
...@@ -40,6 +42,7 @@ public class RedistributionService : IAutoInjection ...@@ -40,6 +42,7 @@ public class RedistributionService : IAutoInjection
SecondAllotDetails secondAllotDetails, SecondAllotDetails secondAllotDetails,
PerforPerallotRepository perallotRepository, PerforPerallotRepository perallotRepository,
PerforPeremployeeRepository peremployeeRepository, PerforPeremployeeRepository peremployeeRepository,
PerforRescomputeRepository rescomputeRepository,
PerforAgsecondallotRepository secondallotRepository, PerforAgsecondallotRepository secondallotRepository,
PerforPerapramountRepository perapramountRepository, PerforPerapramountRepository perapramountRepository,
PerforAgothersourceRepository agothersourceRepository, PerforAgothersourceRepository agothersourceRepository,
...@@ -55,6 +58,7 @@ public class RedistributionService : IAutoInjection ...@@ -55,6 +58,7 @@ public class RedistributionService : IAutoInjection
_secondAllotDetails = secondAllotDetails; _secondAllotDetails = secondAllotDetails;
_perallotRepository = perallotRepository; _perallotRepository = perallotRepository;
_peremployeeRepository = peremployeeRepository; _peremployeeRepository = peremployeeRepository;
_rescomputeRepository = rescomputeRepository;
_secondallotRepository = secondallotRepository; _secondallotRepository = secondallotRepository;
_perapramountRepository = perapramountRepository; _perapramountRepository = perapramountRepository;
_agothersourceRepository = agothersourceRepository; _agothersourceRepository = agothersourceRepository;
...@@ -685,6 +689,84 @@ public void ResultCompute(ComputeMode computeMode, Dictionary<string, object> he ...@@ -685,6 +689,84 @@ public void ResultCompute(ComputeMode computeMode, Dictionary<string, object> he
} }
/// <summary> /// <summary>
/// 科室查询人员字典
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public List<Dictionary<string, object>> RedistributionEmployee(SecondEmployeeDto request)
{
List<Dictionary<string, object>> result = new List<Dictionary<string, object>>();
var second = _secondallotRepository.GetEntity(t => t.Id == request.SecondId);
if (second == null) throw new PerformanceException("参数SecondId无效!");
var allot = _perallotRepository.GetEntity(t => t.ID == second.AllotId);
if (allot == null)
throw new PerformanceException("绩效记录不存在!");
// 当前二次分配配置工作量
var loads = GetWorkLoads(allot.HospitalId, second.UnitType, second.Department);
Expression<Func<per_employee, bool>> exp = t => t.AllotId == second.AllotId;
if (request != null && !string.IsNullOrEmpty(request.SearchQuery))
{
exp = exp.And(t => true && (t.AccountingUnit.Contains(request.SearchQuery) || t.PersonnelNumber.Contains(request.SearchQuery) || t.DoctorName.Contains(request.SearchQuery) || t.Department.Contains(request.SearchQuery)));
}
// 分页查询
var employees = _peremployeeRepository.GetEntitiesForPaging(request.PageNumber, request.PageSize, exp);
if (employees != null)
{
Func<per_employee, decimal?> getDistPerformance = (emp) => 0;
// 不计算模板时,带出工作量绩效(一次分配中的应发绩效)
if (request.ComputeMode == (int)ComputeMode.NotCalculate)
{
if (UnitTypeUtil.IsOffice(second.UnitType))
{
var distPerformance = _rescomputeRepository.GetEntities(t => t.AllotID == second.AllotId && employees.Select(s => s.PersonnelNumber).Contains(t.JobNumber));
getDistPerformance = (emp) =>
{
if (second.Department == emp.AccountingUnit)
return distPerformance?.Where(w => w.JobNumber?.Trim() == emp.PersonnelNumber?.Trim())?.Sum(w => w.GiveFee);
return 0;
};
}
}
var monthDays = DateTime.DaysInMonth(allot.Year, allot.Month);
foreach (var employee in employees)
{
Dictionary<string, object> item = new Dictionary<string, object>();
// 不计算模板时,带出工作量绩效(一次分配中的应发绩效)
if (request.ComputeMode == (int)ComputeMode.NotCalculate)
{
item.Add(nameof(ag_bodysource.WorkPerformance), getDistPerformance(employee));
}
item.Add(nameof(per_employee.UnitType), employee.UnitType);
item.Add(nameof(ag_bodysource.SecondId), request.SecondId);
item.Add(nameof(ag_bodysource.Department), employee.AccountingUnit);
item.Add(nameof(ag_bodysource.Name), employee.DoctorName);
item.Add(nameof(ag_bodysource.WorkNumber), employee.PersonnelNumber);
item.Add(nameof(ag_bodysource.JobTitle), employee.JobTitle);
item.Add(nameof(ag_bodysource.Post), "否");
item.Add(nameof(ag_bodysource.TitleCoefficient), 1);
item.Add(nameof(ag_bodysource.ActualAttendance), employee.AttendanceDay > monthDays ? monthDays : employee.AttendanceDay);
item.Add(nameof(ag_bodysource.StaffCoefficient), 1);
if (loads != null)
{
foreach (var score in loads.Where(w => w.Title.StartsWithIgnoreCase("AssessmentScore_")).ToList())
{
if (score.Value == null)
item.AddOrUpdate(score.Title, 100);
}
}
result.Add(item);
}
}
return result;
}
/// <summary>
/// 重算顶部医院其他绩效、重算行内实发绩效、重算顶部工作量 /// 重算顶部医院其他绩效、重算行内实发绩效、重算顶部工作量
/// </summary> /// </summary>
/// <param name="head"></param> /// <param name="head"></param>
......
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