Commit 8dd3403e by lcx

二次绩效管理绩效内容调整

parent 4c41cfe9
......@@ -33,6 +33,7 @@ public class SecondAllotController : ControllerBase
}
#region 二次绩效列表、录入数据展示,保存数据
/// <summary>
/// 二次绩效列表(没有需要初始化)
/// </summary>
......@@ -134,7 +135,8 @@ public ApiResponse SecondDetail([CustomizeValidator(RuleSet = "Refresh"), FromBo
// var result = secondAllotService.GetSecondDetail(secondid);
// return new ApiResponse(ResponseType.OK, result);
//}
#endregion
#endregion 二次绩效列表、录入数据展示,保存数据
/// <summary>
/// 二次绩效录入页面自动补全
......@@ -161,10 +163,11 @@ public ApiResponse OtherAutoComplete([FromBody] SecondEmpRequest request)
}
#region 模板使用
/// <summary>
/// 选择二次绩效模板
/// </summary>
/// <returns></returns>
/// <returns></returns>
[HttpPost]
[Route("api/temp/list")]
public ApiResponse<List<SecondTempResponse>> Temp([FromBody] AllotDeptRequest request)
......@@ -197,9 +200,11 @@ public ApiResponse RefreshTemp([CustomizeValidator(RuleSet = "Refresh"), FromBod
secondAllotService.RefreshTemp(request);
return new ApiResponse(ResponseType.OK);
}
#endregion
#endregion 模板使用
#region 二次绩效工作量配置
/// <summary>
/// 二次绩效工作量列表
/// </summary>
......@@ -300,9 +305,11 @@ public ApiResponse SingleDelete([CustomizeValidator(RuleSet = "Delete"), FromBod
var result = secondAllotService.DeleteWorkType(request);
return result ? new ApiResponse(ResponseType.OK, "删除成功") : new ApiResponse(ResponseType.Fail, "删除失败");
}
#endregion
#endregion 二次绩效工作量配置
#region 二次绩效审核
/// <summary>
/// 提交审核
/// </summary>
......@@ -352,7 +359,6 @@ public ApiResponse AuditResult([FromBody] SecondAuditRequest request)
return result ? new ApiResponse(ResponseType.OK, "操作成功") : new ApiResponse(ResponseType.Fail, "操作失败");
}
/// <summary>
/// 护理部二次绩效审核列表
/// </summary>
......@@ -377,9 +383,11 @@ public ApiResponse NursingDeptAuditResult([FromBody] SecondAuditRequest request)
var result = secondAllotService.NursingDeptAudit(userid, request);
return result ? new ApiResponse(ResponseType.OK, "操作成功") : new ApiResponse(ResponseType.Fail, "操作失败");
}
#endregion
#endregion 二次绩效审核
#region 二次绩效其他绩效
/// <summary>
/// 二次绩效其他绩效详情
/// </summary>
......@@ -408,7 +416,8 @@ public ApiResponse OtherSave([FromBody] AgOtherRequest request)
var result = secondAllotService.OtherSave(request.SecondId, request.Othersources);
return new ApiResponse(ResponseType.OK, result);
}
#endregion
#endregion 二次绩效其他绩效
/// <summary>
/// 二次绩效结果打印
......@@ -428,11 +437,11 @@ public ApiResponse SecondPrint(int secondid)
/// <returns></returns>
[Route("api/second/deptcompute/{allotId}")]
[HttpPost]
public ApiResponse<List<SecondPerforResponse>> DeptComputeDetail(int allotId)
public ApiResponse DeptComputeDetail(int allotId)
{
var userId = claimService.GetUserId();
var data = secondAllotService.DeptComputeDetail(userId, allotId);
return new ApiResponse<List<SecondPerforResponse>>(ResponseType.OK, data);
var data = secondAllotService.DeptComputeDetail(userId, allotId, out int isShowManage);
return new ApiResponse(ResponseType.OK, new { isShowManage, data });
}
}
}
\ No newline at end of file
......@@ -4,22 +4,22 @@
namespace Performance.DtoModels
{
public class SecondPerforResponse
public class SecondPerforResponse : ComputeResponse
{
/// <summary>
/// 人员姓名
/// </summary>
public string EmployeeName { get; set; }
///// <summary>
///// 人员姓名
///// </summary>
//public string EmployeeName { get; set; }
/// <summary>
/// 职务
/// </summary>
public string JobTitle { get; set; }
///// <summary>
///// 职务
///// </summary>
//public string JobTitle { get; set; }
/// <summary>
/// 人员工号
/// </summary>
public string JobNumber { get; set; }
///// <summary>
///// 人员工号
///// </summary>
//public string JobNumber { get; set; }
/// <summary>
/// 效率绩效
......@@ -41,19 +41,19 @@ public class SecondPerforResponse
/// </summary>
public Nullable<decimal> Grant { get; set; }
/// <summary>
/// 应发管理绩效
/// </summary>
public Nullable<decimal> ShouldGiveFee { get; set; }
///// <summary>
///// 应发管理绩效
///// </summary>
//public Nullable<decimal> ShouldGiveFee { get; set; }
/// <summary>
/// 绩效合计
/// </summary>
public Nullable<decimal> PerforSumFee { get; set; }
///// <summary>
///// 绩效合计
///// </summary>
//public Nullable<decimal> PerforSumFee { get; set; }
/// <summary>
/// 考核对分率
/// </summary>
public Nullable<decimal> ScoreAverageRate { get; set; }
///// <summary>
///// 考核对分率
///// </summary>
//public Nullable<decimal> ScoreAverageRate { get; set; }
}
}
}
\ No newline at end of file
......@@ -1724,14 +1724,14 @@ public List<SecPrintResponse> Print(int secondId)
#endregion 打印
public List<SecondPerforResponse> DeptComputeDetail(int userId, int allotId)
public List<SecondPerforResponse> DeptComputeDetail(int userId, int allotId, out int isShowManage)
{
var user = perforUserRepository.GetEntity(t => t.ID == userId);
if (user == null)
throw new NotImplementedException("人员ID无效");
var allot = perforPerallotRepository.GetEntity(t => t.ID == allotId);
var isShowManage = computeService.IsShowManage(allotId);
isShowManage = computeService.IsShowManage(allotId);
var userrole = userroleRepository.GetEntity(t => t.UserID == userId);
var role = roleRepository.GetEntity(t => t.ID == userrole.RoleID);
......@@ -1749,7 +1749,7 @@ public List<SecondPerforResponse> DeptComputeDetail(int userId, int allotId)
var data = GetAllotPerformance(allotId, computes, isShowManage);
// 补充医院其他绩效
var result = computeService.AddAprAmount(allotId, data);
var result = AddAprAmount(allotId, data);
// 预留比例
if (result != null)
......@@ -1770,7 +1770,7 @@ public List<SecondPerforResponse> DeptComputeDetail(int userId, int allotId)
}
}
return Mapper.Map<List<SecondPerforResponse>>(computes);
return result;
}
/// <summary>
......@@ -1778,9 +1778,9 @@ public List<SecondPerforResponse> DeptComputeDetail(int userId, int allotId)
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
private List<ComputeResponse> GetAllotPerformance(int allotId, List<res_compute> computes, int isShowManage)
private List<SecondPerforResponse> GetAllotPerformance(int allotId, List<res_compute> computes, int isShowManage)
{
if (computes == null || !computes.Any()) return new List<ComputeResponse>();
if (computes == null || !computes.Any()) return new List<SecondPerforResponse>();
var types1 = new List<string> { AccountUnitType.护士长.ToString(), AccountUnitType.科主任.ToString() };
var types2 = new List<string> { AccountUnitType.行政中层.ToString(), AccountUnitType.行政高层.ToString() };
......@@ -1789,8 +1789,24 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, List<res_compute>
return computes.Select(t =>
{
var comp = new ComputeResponse("一次绩效", t.AccountingUnit, t.EmployeeName, t.JobNumber, t.JobTitle);
comp.UnitType = t.AccountType;
var comp = new SecondPerforResponse()
{
AccountingUnit = t.AccountingUnit,
EmployeeName = t.EmployeeName,
JobNumber = t.JobNumber,
JobTitle = t.JobTitle,
UnitType = t.AccountType,
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;
......@@ -1807,15 +1823,30 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, List<res_compute>
else
comp.PerforSumFee = Math.Round((t.Avg * (basics ?? 1)) + t.ShouldGiveFee + t.AssessBeforeOtherFee ?? 0);
comp.Punishment = t.Punishment;
comp.ShouldGiveFee = t.ShouldGiveFee;
comp.PerforSumFee = t.PerforSumFee;
comp.GiveFee = t.GiveFee * t.Adjust;
comp.AdjustLaterOtherFee = t.AdjustLaterOtherFee ?? 0;
comp.OthePerfor = t.OtherPerfor;
comp.RealGiveFee = t.RealGiveFee;
return comp;
}).ToList();
}
public List<SecondPerforResponse> AddAprAmount(int allotId, List<SecondPerforResponse> computes)
{
if (computes == null || !computes.Any())
return computes;
var list = perapramountRepository.GetEntities(t => t.AllotId == allotId && t.Status == 3);
if (list == null || !list.Any())
return computes;
foreach (var item in computes.GroupBy(w => new { w.AccountingUnit, w.JobNumber }))
{
// 补充过一次就不在补充了
var emp = computes.Where(w => w.AccountingUnit == item.Key.AccountingUnit && w.JobNumber == item.Key.JobNumber)
.OrderByDescending(w => w.Source).FirstOrDefault();
var apramount = list.Where(t => t.AccountingUnit == emp.AccountingUnit
&& !string.IsNullOrEmpty(t.PersonnelNumber) && emp.JobNumber?.Trim() == t.PersonnelNumber?.Trim());
emp.OthePerfor = apramount?.Sum(w => w.Amount) ?? 0;
}
return computes;
}
}
}
\ No newline at end of file
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