人员字典

parent 72c8f8e3
...@@ -565,6 +565,10 @@ public ApiResponse RedistributionLoad([FromBody] SecondLoadDto request) ...@@ -565,6 +565,10 @@ public ApiResponse RedistributionLoad([FromBody] SecondLoadDto request)
var result = _redistributionService.Load(request.SecondId, (ComputeMode)request.ComputeMode, overrideMode); var result = _redistributionService.Load(request.SecondId, (ComputeMode)request.ComputeMode, overrideMode);
return new ApiResponse(ResponseType.OK, result); return new ApiResponse(ResponseType.OK, result);
} }
catch (PerformanceException ex)
{
throw ex;
}
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError($"二次绩效录入页面:{ex}"); _logger.LogError($"二次绩效录入页面:{ex}");
...@@ -609,6 +613,10 @@ public ApiResponse RedistributionCheck([FromBody] SecondComputeDto request) ...@@ -609,6 +613,10 @@ public ApiResponse RedistributionCheck([FromBody] SecondComputeDto request)
var result = _redistributionService.CheckData(second, request.Body); var result = _redistributionService.CheckData(second, request.Body);
return new ApiResponse(ResponseType.OK, result); return new ApiResponse(ResponseType.OK, result);
} }
catch (PerformanceException ex)
{
throw ex;
}
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError($"提交数据正确性检验:{ex}"); _logger.LogError($"提交数据正确性检验:{ex}");
...@@ -673,6 +681,10 @@ public ApiResponse RedistributionCompute([FromBody] SecondComputeDto request) ...@@ -673,6 +681,10 @@ public ApiResponse RedistributionCompute([FromBody] SecondComputeDto request)
var dic = _redistributionService.GetTableHeaderDictionary((ComputeMode)request.ComputeMode, second, loads, workloadGroups); var dic = _redistributionService.GetTableHeaderDictionary((ComputeMode)request.ComputeMode, second, loads, workloadGroups);
return new ApiResponse(ResponseType.OK, new { Head = request.Head, Body = cleanDatas, Dic = dic }); return new ApiResponse(ResponseType.OK, new { Head = request.Head, Body = cleanDatas, Dic = dic });
} }
catch (PerformanceException ex)
{
throw ex;
}
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError($"二次绩效结果计算:{ex}"); _logger.LogError($"二次绩效结果计算:{ex}");
...@@ -710,6 +722,10 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request) ...@@ -710,6 +722,10 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request)
var result = secondAllotService.RedistributionSave(allot, second, request.Head, cleanDatas); var result = secondAllotService.RedistributionSave(allot, second, request.Head, cleanDatas);
return result ? new ApiResponse(ResponseType.OK) : new ApiResponse(ResponseType.Fail, "保存失败"); return result ? new ApiResponse(ResponseType.OK) : new ApiResponse(ResponseType.Fail, "保存失败");
} }
catch (PerformanceException ex)
{
throw ex;
}
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError($"二次绩效保存:{ex}"); _logger.LogError($"二次绩效保存:{ex}");
...@@ -758,12 +774,45 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request) ...@@ -758,12 +774,45 @@ public ApiResponse RedistributionSubmit([FromBody] SecondComputeDto request)
} }
return new ApiResponse(ResponseType.Fail, "提交失败"); return new ApiResponse(ResponseType.Fail, "提交失败");
} }
catch (PerformanceException ex)
{
throw ex;
}
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError($"二次绩效提交:{ex}"); _logger.LogError($"二次绩效提交:{ex}");
return new ApiResponse(ResponseType.Fail, "提交失败"); return new ApiResponse(ResponseType.Fail, "提交失败");
} }
} }
/// <summary>
/// 二次分配人员字典带出
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("api/second/redistribution/employee")]
[HttpPost]
public ApiResponse RedistributionEmployee([FromBody] SecondComputeDto request)
{
// 返回信息
//rownumber: 11
//secondid: 1472
//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
} }
} }
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
<summary> 正在生成绩效 </summary> <summary> 正在生成绩效 </summary>
</member> </member>
<member name="F:Performance.DtoModels.AllotStates.GenerateSucceed"> <member name="F:Performance.DtoModels.AllotStates.GenerateSucceed">
<summary> 绩效结果通过审核,允许下发 </summary> <summary> 绩效下发 </summary>
</member> </member>
<member name="F:Performance.DtoModels.AllotStates.GenerateFail"> <member name="F:Performance.DtoModels.AllotStates.GenerateFail">
<summary> 绩效解析失败 </summary> <summary> 绩效解析失败 </summary>
......
...@@ -65,8 +65,8 @@ public enum AllotStates ...@@ -65,8 +65,8 @@ public enum AllotStates
/// <summary> 正在生成绩效 </summary> /// <summary> 正在生成绩效 </summary>
[Description("正在生成绩效")] [Description("正在生成绩效")]
InGenerate = 5, InGenerate = 5,
/// <summary> 绩效结果通过审核,允许下发 </summary> /// <summary> 绩效下发 </summary>
[Description("数据验证通过")] [Description("绩效下发")]
GenerateSucceed = 6, GenerateSucceed = 6,
/// <summary> 绩效解析失败 </summary> /// <summary> 绩效解析失败 </summary>
[Description("绩效解析失败")] [Description("绩效解析失败")]
......
...@@ -271,8 +271,8 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute ...@@ -271,8 +271,8 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
head.AddOrUpdate(nameof(ag_headsource.SecondId), second.Id); head.AddOrUpdate(nameof(ag_headsource.SecondId), second.Id);
head.AddOrUpdate(nameof(ag_headsource.PaymentOfTheMonth), $"{allot.Year}{allot.Month.ToString().PadLeft(2, '0')}月"); head.AddOrUpdate(nameof(ag_headsource.PaymentOfTheMonth), $"{allot.Year}{allot.Month.ToString().PadLeft(2, '0')}月");
head.AddOrUpdate(nameof(ag_headsource.TotalDistPerformance), second.RealGiveFee ?? 0); head.AddOrUpdate(nameof(ag_headsource.TotalDistPerformance), (allot.States == (int)AllotStates.GenerateSucceed) ? (second.RealGiveFee ?? 0) : 1000);
head.AddOrUpdate(nameof(ag_headsource.NightShiftWorkPerforTotal), second.NightShiftWorkPerforFee ?? 0); head.AddOrUpdate(nameof(ag_headsource.NightShiftWorkPerforTotal), (allot.States == (int)AllotStates.GenerateSucceed) ? (second.NightShiftWorkPerforFee ?? 0) : 0);
head.AddOrUpdate(nameof(ag_headsource.TotalPerformance), (second.RealGiveFee ?? 0) - (second.NightShiftWorkPerforFee ?? 0)); head.AddOrUpdate(nameof(ag_headsource.TotalPerformance), (second.RealGiveFee ?? 0) - (second.NightShiftWorkPerforFee ?? 0));
// 横向 纵向 特有顶部信息 // 横向 纵向 特有顶部信息
if (computeMode != ComputeMode.NotCalculate) if (computeMode != ComputeMode.NotCalculate)
......
...@@ -1611,9 +1611,13 @@ bool VerifySubmissioAmount(decimal? submitDataAmount, decimal? realGiveFee) ...@@ -1611,9 +1611,13 @@ bool VerifySubmissioAmount(decimal? submitDataAmount, decimal? realGiveFee)
if (data == null || !data.Any()) if (data == null || !data.Any())
throw new PerformanceException("提交时未检测到数据!"); throw new PerformanceException("提交时未检测到数据!");
var nightShiftWorkPerforFee = data.Sum(w => w.NightWorkPerformance ?? 0);
if (!VerifySubmissioAmount(nightShiftWorkPerforFee, second.NightShiftWorkPerforFee))
throw new PerformanceException($"夜班绩效金额不一致!夜班绩效金额:{second.NightShiftWorkPerforFee ?? 0:0.####},提交金额:{nightShiftWorkPerforFee:0.####}");
var total = data.Sum(t => (t.DistPerformance ?? 0) + (t.NightWorkPerformance ?? 0)); var total = data.Sum(t => (t.DistPerformance ?? 0) + (t.NightWorkPerformance ?? 0));
if (!VerifySubmissioAmount(total, second.RealGiveFee)) if (!VerifySubmissioAmount(total, second.RealGiveFee))
throw new PerformanceException($"总金额与考核后金额不一致!可分配金额:{second.RealGiveFee},提交金额:{total}"); throw new PerformanceException($"总金额与考核后金额不一致!可分配金额:{second.RealGiveFee:0.####},提交金额:{total:0.####}");
} }
second.UseTempId = temp.UseTempId; second.UseTempId = temp.UseTempId;
second.Status = 2; second.Status = 2;
......
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