Commit 0fb16ca5 by lcx

Merge branch 'v2020calculate' into v2020morge

parents f8223899 d68572ee
...@@ -188,6 +188,9 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A ...@@ -188,6 +188,9 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A
logManageService.WriteMsg("等待绩效生成", $"等待绩效生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效!", 1, allot.ID, "ReceiveMessage"); logManageService.WriteMsg("等待绩效生成", $"等待绩效生成{allot.Year}-{allot.Month.ToString().PadLeft(2, '0')}月份绩效!", 1, allot.ID, "ReceiveMessage");
//_allotService.Generate(allot, email); //_allotService.Generate(allot, email);
////BackgroundJob.Enqueue(() => _allotService.Generate(allot, email)); ////BackgroundJob.Enqueue(() => _allotService.Generate(allot, email));
///
// 科室下发
resultComputeService.GenerateSecondAllot(allot);
return new ApiResponse(ResponseType.OK); return new ApiResponse(ResponseType.OK);
} }
...@@ -269,8 +272,6 @@ public ApiResponse Issued([FromBody] AllotRequest request) ...@@ -269,8 +272,6 @@ public ApiResponse Issued([FromBody] AllotRequest request)
if (null == allot) if (null == allot)
throw new PerformanceException("当前绩效记录不存在"); throw new PerformanceException("当前绩效记录不存在");
_allotService.UpdateAllotStates(allot.ID, (int)AllotStates.GenerateSucceed, EnumHelper.GetDescription(AllotStates.GenerateSucceed)); _allotService.UpdateAllotStates(allot.ID, (int)AllotStates.GenerateSucceed, EnumHelper.GetDescription(AllotStates.GenerateSucceed));
// 科室下发
resultComputeService.GenerateSecondAllot(allot);
return new ApiResponse(ResponseType.OK); return new ApiResponse(ResponseType.OK);
} }
......
...@@ -267,6 +267,41 @@ public ApiResponse AllManageCompute([FromBody] ComputerRequest request) ...@@ -267,6 +267,41 @@ public ApiResponse AllManageCompute([FromBody] ComputerRequest request)
} }
/// <summary> /// <summary>
/// 获取全院绩效列表(人事科)
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("allcompute/personnel")]
[HttpPost]
public ApiResponse AllComputeByPM([FromBody] ComputerRequest request)
{
var allot = _allotService.GetAllot(request.AllotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var isShowManage = _computeService.IsShowManage(request.AllotId);
var list = _computeService.AllCompute(request.AllotId, isShowManage);
if (list == null || !list.Any())
return new ApiResponse(ResponseType.OK, "ok", list);
var result = list.GroupBy(t => new { t.Source, t.EmployeeName, t.JobNumber }).Select(t => new ComputeResponse
{
Source = t.Key.Source,
EmployeeName = t.Key.EmployeeName,
JobNumber = t.Key.JobNumber,
PerforSumFee = t.Sum(s => s.PerforSumFee),
PerforManagementFee = t.Sum(s => s.PerforManagementFee),
ShouldGiveFee = t.Sum(s => s.ShouldGiveFee),
OthePerfor = t.Sum(s => s.OthePerfor),
NightWorkPerfor = t.Sum(s => s.NightWorkPerfor),
RealGiveFee = t.Sum(s => s.RealGiveFee),
//ReservedRatio = t.Sum(s => s.ReservedRatio),
//ReservedRatioFee = t.Sum(s => s.ReservedRatioFee),
});
return new ApiResponse(ResponseType.OK, "ok", result);
}
/// <summary>
/// 修改实发绩效 /// 修改实发绩效
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
......
...@@ -398,6 +398,13 @@ ...@@ -398,6 +398,13 @@
<param name="request"></param> <param name="request"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.ComputeController.AllComputeByPM(Performance.DtoModels.ComputerRequest)">
<summary>
获取全院绩效列表(人事科)
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ComputeController.UpdateRealfee(Performance.DtoModels.ComputerRequest)"> <member name="M:Performance.Api.Controllers.ComputeController.UpdateRealfee(Performance.DtoModels.ComputerRequest)">
<summary> <summary>
修改实发绩效 修改实发绩效
......
...@@ -3229,6 +3229,13 @@ ...@@ -3229,6 +3229,13 @@
<member name="P:Performance.DtoModels.SecondListResponse.IsArchive"> <member name="P:Performance.DtoModels.SecondListResponse.IsArchive">
<summary> 是否归档 </summary> <summary> 是否归档 </summary>
</member> </member>
<member name="P:Performance.DtoModels.SecondListResponse.States">
<summary>
0 数据未上传 1 数据已上传 2 正在校验数据 3 数据验证通过
4 数据错误 5 正在生成绩效 6 下发绩效 7 绩效解析失败
8 归档 9 等待生成 10 绩效结果解析成功
</summary>
</member>
<member name="P:Performance.DtoModels.SecondPerforResponse.EmployeeName"> <member name="P:Performance.DtoModels.SecondPerforResponse.EmployeeName">
<summary> <summary>
人员姓名 人员姓名
......
...@@ -83,5 +83,25 @@ public ComputeResponse(string source, string accountingUnit, string employeeName ...@@ -83,5 +83,25 @@ public ComputeResponse(string source, string accountingUnit, string employeeName
/// 预留比例金额 /// 预留比例金额
/// </summary> /// </summary>
public Nullable<decimal> ReservedRatioFee { get; set; } public Nullable<decimal> ReservedRatioFee { get; set; }
/// <summary>
///
/// </summary>
public Nullable<decimal> Punishment { get; set; }
/// <summary>
///
/// </summary>
public Nullable<decimal> GiveFee { get; set; }
/// <summary>
///
/// </summary>
public Nullable<decimal> Adjust { get; set; }
/// <summary>
///
/// </summary>
public Nullable<decimal> AdjustLaterOtherFee { get; set; }
} }
} }
...@@ -9,5 +9,12 @@ public class SecondListResponse : ag_secondallot ...@@ -9,5 +9,12 @@ public class SecondListResponse : ag_secondallot
{ {
/// <summary> 是否归档 </summary> /// <summary> 是否归档 </summary>
public int IsArchive { get; set; } public int IsArchive { get; set; }
/// <summary>
/// 0 数据未上传 1 数据已上传 2 正在校验数据 3 数据验证通过
/// 4 数据错误 5 正在生成绩效 6 下发绩效 7 绩效解析失败
/// 8 归档 9 等待生成 10 绩效结果解析成功
/// </summary>
public int States { get; set; }
} }
} }
...@@ -165,8 +165,8 @@ public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, stri ...@@ -165,8 +165,8 @@ public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, stri
if (connection.State != ConnectionState.Open) connection.Open(); if (connection.State != ConnectionState.Open) connection.Open();
try try
{ {
string clear = @"SELECT t3.AccountingUnit as Department,t1.DoctorName,t1.PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1 string clear = @"SELECT t3.AccountingUnit as Department,t1.DoctorName,if(ifnull(t2.PersonnelNumber,'')='', t2.JobNumber, t2.PersonnelNumber) PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
JOIN per_employee t2 on t1.doctorname = t2.doctorname and t1.personnelnumber = t2.personnelnumber JOIN per_employee t2 on t1.doctorname = t2.doctorname and t1.personnelnumber = t2.jobnumber
JOIN (select distinct AccountingUnit,HISDeptName,unittype from per_dept_dic where HospitalId = @hospitalid) t3 ON t1.Department = t3.HISDeptName JOIN (select distinct AccountingUnit,HISDeptName,unittype from per_dept_dic where HospitalId = @hospitalid) t3 ON t1.Department = t3.HISDeptName
WHERE t1.allotid = @allotid WHERE t1.allotid = @allotid
AND t2.allotid = @allotid AND t2.allotid = @allotid
...@@ -195,8 +195,8 @@ public IEnumerable<ex_result> QueryIncomeData(int allotid, string accountingunit ...@@ -195,8 +195,8 @@ public IEnumerable<ex_result> QueryIncomeData(int allotid, string accountingunit
if (connection.State != ConnectionState.Open) connection.Open(); if (connection.State != ConnectionState.Open) connection.Open();
try try
{ {
string clear = @"SELECT t3.AccountingUnit as Department,t1.DoctorName,t1.PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1 string clear = @"SELECT t3.AccountingUnit as Department,t1.DoctorName,if(ifnull(t2.PersonnelNumber,'')='', t2.JobNumber, t2.PersonnelNumber) PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
JOIN per_employee t2 on t1.doctorname = t2.doctorname and t1.personnelnumber = t2.personnelnumber JOIN per_employee t2 on t1.doctorname = t2.doctorname and t1.personnelnumber = t2.jobnumber
JOIN (select distinct AccountingUnit,HISDeptName,unittype from per_dept_dic where HospitalId = @hospitalid) t3 ON t1.Department = t3.HISDeptName JOIN (select distinct AccountingUnit,HISDeptName,unittype from per_dept_dic where HospitalId = @hospitalid) t3 ON t1.Department = t3.HISDeptName
WHERE t1.allotid = @allotid WHERE t1.allotid = @allotid
AND t2.allotid = @allotid AND t2.allotid = @allotid
......
...@@ -471,14 +471,18 @@ public List<ComputeResponse> AllCompute(int allotId, int isShowManage) ...@@ -471,14 +471,18 @@ public List<ComputeResponse> AllCompute(int allotId, int isShowManage)
var empDic = perforPeremployeeRepository.GetEntities(w => w.AllotId == allotId); var empDic = perforPeremployeeRepository.GetEntities(w => w.AllotId == allotId);
foreach (var item in result) foreach (var item in result)
{ {
var perfor = ((item.GiveFee ?? 0) != 0 ? item.GiveFee : item.PerforSumFee) ?? 0;
item.PerforSumFee = Math.Round(item.PerforSumFee ?? 0, 0, MidpointRounding.AwayFromZero); item.PerforSumFee = Math.Round(item.PerforSumFee ?? 0, 0, MidpointRounding.AwayFromZero);
item.PerforManagementFee = Math.Round(item.PerforManagementFee ?? 0, 0, MidpointRounding.AwayFromZero); item.PerforManagementFee = Math.Round(item.PerforManagementFee ?? 0, 0, MidpointRounding.AwayFromZero);
item.GiveFee = Math.Round(perfor, 0, MidpointRounding.AwayFromZero);
item.AdjustLaterOtherFee = Math.Round(item.AdjustLaterOtherFee ?? 0, 0, MidpointRounding.AwayFromZero);
item.OthePerfor = Math.Round(item.OthePerfor ?? 0, 0, MidpointRounding.AwayFromZero); item.OthePerfor = Math.Round(item.OthePerfor ?? 0, 0, MidpointRounding.AwayFromZero);
item.NightWorkPerfor = Math.Round(item.NightWorkPerfor ?? 0, 0, MidpointRounding.AwayFromZero); item.NightWorkPerfor = Math.Round(item.NightWorkPerfor ?? 0, 0, MidpointRounding.AwayFromZero);
item.ShouldGiveFee = Math.Round((item.PerforSumFee ?? 0) + (item.PerforManagementFee ?? 0) + (item.OthePerfor ?? 0) + (item.NightWorkPerfor ?? 0), 0, MidpointRounding.AwayFromZero); item.ShouldGiveFee = Math.Round((perfor + item.AdjustLaterOtherFee + item.NightWorkPerfor) ?? 0, 0, MidpointRounding.AwayFromZero);
item.ReservedRatio = empDic?.FirstOrDefault(w => w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0; //item.ReservedRatio = empDic?.FirstOrDefault(w => w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0;
item.ReservedRatioFee = Math.Round(((item.PerforSumFee ?? 0) + (item.PerforManagementFee ?? 0)) * item.ReservedRatio ?? 0, 0, MidpointRounding.AwayFromZero); //item.ReservedRatioFee = Math.Round(((item.PerforSumFee ?? 0) + (item.PerforManagementFee ?? 0)) * item.ReservedRatio ?? 0, 0, MidpointRounding.AwayFromZero);
item.RealGiveFee = Math.Round(item.ShouldGiveFee - (item.ReservedRatioFee ?? 0) ?? 0, 0, MidpointRounding.AwayFromZero); item.RealGiveFee = Math.Round((perfor + item.AdjustLaterOtherFee + item.NightWorkPerfor) ?? 0, 0, MidpointRounding.AwayFromZero);
} }
} }
...@@ -507,7 +511,7 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int isShowManage) ...@@ -507,7 +511,7 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int isShowManage)
comp.UnitType = t.AccountType; comp.UnitType = t.AccountType;
if (types1.Contains(t.AccountType)) if (types1.Contains(t.AccountType))
comp.PerforManagementFee = (t.ShouldGiveFee ?? 0) + (t.OtherPerfor ?? 0) + (t.Punishment ?? 0); comp.PerforManagementFee = ((t.Efficiency + t.Scale) * t.Grant + t.OtherManagePerfor) * t.Attendance * t.ScoreAverageRate;
else else
comp.PerforManagementFee = t.RealGiveFee; comp.PerforManagementFee = t.RealGiveFee;
// 行政中层 行政高层 补充 夜班费 // 行政中层 行政高层 补充 夜班费
...@@ -519,8 +523,15 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int isShowManage) ...@@ -519,8 +523,15 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int isShowManage)
if (isShowManage == 2) if (isShowManage == 2)
comp.PerforSumFee = 0; comp.PerforSumFee = 0;
else else
comp.PerforSumFee = basics.HasValue ? t.Avg * basics : t.Avg; 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; return comp;
}).ToList(); }).ToList();
} }
......
...@@ -121,7 +121,12 @@ public List<SecondListResponse> GetSecondList(int userId) ...@@ -121,7 +121,12 @@ public List<SecondListResponse> GetSecondList(int userId)
var secondList = perforAgsecondallotRepository.GetEntities(exp); var secondList = perforAgsecondallotRepository.GetEntities(exp);
var list = Mapper.Map<List<SecondListResponse>>(secondList); var list = Mapper.Map<List<SecondListResponse>>(secondList);
list?.ForEach(t => t.IsArchive = allotList.FirstOrDefault(a => a.ID == t.AllotId).States == 8 ? 1 : 0); list?.ForEach(t =>
{
var states = allotList.FirstOrDefault(a => a.ID == t.AllotId).States;
t.IsArchive = states == 8 ? 1 : 0;
t.States = states;
});
return list; return list;
} }
......
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