Commit 8457538f by 钟博

Merge branch 'develop' into release/v20210707Develop新二次分配合并

# Conflicts:
#	performance/Performance.Services/SecondAllotService.cs
parents 573d7557 f6a324b8
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
}, },
"AppConnection": { "AppConnection": {
//"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;", //"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"PerformanceConnectionString": "server=192.168.18.166;database=db_performance_screen;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;", "PerformanceConnectionString": "server=192.168.18.166;database=db_test_yubei;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"HangfireConnectionString": "server=192.168.18.166;database=db_hangfire;uid=root;pwd=1234qwer;port=3306;allow user variables=true;", "HangfireConnectionString": "server=192.168.18.166;database=db_hangfire;uid=root;pwd=1234qwer;port=3306;allow user variables=true;",
"RedisConnectionString": "116.62.245.55:6379,defaultDatabase=2" "RedisConnectionString": "116.62.245.55:6379,defaultDatabase=2"
}, },
......
...@@ -6642,6 +6642,11 @@ ...@@ -6642,6 +6642,11 @@
调节后其他绩效 调节后其他绩效
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.res_compute.AssessLaterManagementFee">
<summary>
考核后管理绩效
</summary>
</member>
<member name="P:Performance.EntityModels.res_compute.NeedSecondAllot"> <member name="P:Performance.EntityModels.res_compute.NeedSecondAllot">
<summary> <summary>
是否需要二次分配 是否需要二次分配
......
...@@ -245,7 +245,12 @@ public class res_compute ...@@ -245,7 +245,12 @@ public class res_compute
/// 调节后其他绩效 /// 调节后其他绩效
/// </summary> /// </summary>
public Nullable<decimal> AdjustLaterOtherFee { get; set; } public Nullable<decimal> AdjustLaterOtherFee { get; set; }
/// <summary>
/// 考核后管理绩效
/// </summary>
public Nullable<decimal> AssessLaterManagementFee { get; set; }
/// <summary> /// <summary>
/// 是否需要二次分配 /// 是否需要二次分配
/// </summary> /// </summary>
......
...@@ -388,11 +388,17 @@ public void SaveSecondReserved(int secondId) ...@@ -388,11 +388,17 @@ public void SaveSecondReserved(int secondId)
/// 绩效生成完成后修改绩效预留金额 /// 绩效生成完成后修改绩效预留金额
/// </summary> /// </summary>
/// <param name="allot"></param> /// <param name="allot"></param>
public void SaveReserved(per_allot allot) public void SaveReserved(per_allot allot, int hospitalId)
{ {
var mTypes = new[] { AccountUnitType.护士长.ToString(), AccountUnitType.科主任.ToString(), AccountUnitType.行政中层.ToString(), AccountUnitType.行政高层.ToString() }; var mTypes = new List<string> { AccountUnitType.行政中层.ToString(), AccountUnitType.行政高层.ToString(), AccountUnitType.行政工勤.ToString() };
var resComputes = perforRescomputeRepository.GetEntities(t => t.AllotID == allot.ID && mTypes.Contains(t.AccountType))?.OrderByDescending(t => t.AccountingUnit); var hospital = hospitalRepository.GetEntity(w => w.ID == hospitalId);
if (hospital?.IsShowManage == 1)
mTypes.AddRange(new List<string> { AccountUnitType.护士长.ToString(), AccountUnitType.科主任.ToString() });
var resComputes = perforRescomputeRepository
.GetEntities(t => t.AllotID == allot.ID && mTypes.Contains(t.AccountType) && (string.IsNullOrEmpty(t.NeedSecondAllot) || t.NeedSecondAllot == "否"))
?.OrderByDescending(t => t.AccountingUnit);
if (resComputes != null && resComputes.Any()) if (resComputes != null && resComputes.Any())
{ {
......
...@@ -433,7 +433,7 @@ public void Generate(per_allot allot) ...@@ -433,7 +433,7 @@ public void Generate(per_allot allot)
// 保存预留绩效 // 保存预留绩效
logManageService.WriteMsg("正在生成绩效", "保存预留绩效金额", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成绩效", "保存预留绩效金额", 1, allot.ID, "ReceiveMessage", true);
resultComputeService.SaveReserved(allot); resultComputeService.SaveReserved(allot, allot.HospitalId);
// 科室下发 // 科室下发
resultComputeService.GenerateSecondAllot(allot); resultComputeService.GenerateSecondAllot(allot);
......
...@@ -981,8 +981,12 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int hospitalId, i ...@@ -981,8 +981,12 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int hospitalId, i
// 科主任/护士长 // 科主任/护士长
if (types1.Contains(t.AccountType)) if (types1.Contains(t.AccountType))
{ {
comp.PerforManagementFee = t.AssessLaterManagementFee ?? 0;
// 等同于考核后管理绩效 AssessLaterManagementFee // 等同于考核后管理绩效 AssessLaterManagementFee
comp.PerforManagementFee = Math.Round(t.ShouldGiveFee * t.ScoreAverageRate * t.Attendance + t.Punishment ?? 0, 2); // 兼容历史数据
if (comp.PerforManagementFee == 0)
comp.PerforManagementFee = Math.Round(t.ShouldGiveFee * t.ScoreAverageRate * t.Attendance + t.Punishment ?? 0);
// 仅显示管理绩效 // 仅显示管理绩效
if (isShowManage == 2) if (isShowManage == 2)
comp.PerforSumFee = 0; comp.PerforSumFee = 0;
......
...@@ -2128,18 +2128,48 @@ public List<SecPrintResponse> Print(int secondId) ...@@ -2128,18 +2128,48 @@ public List<SecPrintResponse> Print(int secondId)
var second = agsecondallotRepository.GetEntity(t => t.Id == secondId); var second = agsecondallotRepository.GetEntity(t => t.Id == secondId);
if (second == null) return new List<SecPrintResponse>(); if (second == null) return new List<SecPrintResponse>();
var allot = perallotRepository.GetEntity(t => t.ID == second.AllotId);
if (allot == null) return new List<SecPrintResponse>();
var temps = agusetempRepository.GetEntities(w => w.HospitalId == allot.HospitalId && w.UnitType == second.UnitType && w.Department == second.Department);
var useTempId = second.UseTempId ?? temps?.OrderByDescending(w => w.Id).FirstOrDefault().UseTempId;
//var computes = agcomputeRepository.GetEntities(t => t.SecondId == secondId); //var computes = agcomputeRepository.GetEntities(t => t.SecondId == secondId);
//if (computes == null || !computes.Any()) //if (computes == null || !computes.Any())
// return new List<SecPrintResponse>(); // return new List<SecPrintResponse>();
List<SecPrintResponse> result = new List<SecPrintResponse>(); List<SecPrintResponse> result = new List<SecPrintResponse>();
if (second.UseTempId.HasValue && second.UseTempId == 6) if (useTempId.HasValue && useTempId == 6)
{ {
var data = agothersourceRepository.GetEntities(t => t.SecondId == secondId); var data = agothersourceRepository.GetEntities(t => t.SecondId == secondId);
if (data == null || !data.Any()) return new List<SecPrintResponse>(); if (data == null || !data.Any()) return new List<SecPrintResponse>();
result = Mapper.Map<List<SecPrintResponse>>(data); result = Mapper.Map<List<SecPrintResponse>>(data);
} }
else if (second.UseTempId.HasValue && (new int[] { 7, 8 }).Contains(second.UseTempId.Value)) else if (useTempId.HasValue && (new int[] { 9, 10 }).Contains(useTempId.Value))
{
var data = agbodysourceRepository.GetEntities(t => t.SecondId == secondId);
if (data == null || !data.Any()) return new List<SecPrintResponse>();
var bodyDynamic = agworkloadsourceRepository.GetEntities(t => data.Select(w => w.Id).Contains(t.BodyId));
if (data == null || !data.Any()) return new List<SecPrintResponse>();
result = data.Select(w => new SecPrintResponse
{
JobNumber = w.WorkNumber,
PersonName = w.Name,
Department = w.Department,
RealAmount = w.RealAmount,
WorkPost = w.Post,
TitlePerfor = w.TitlePerformance,
WorkPerformance = bodyDynamic?.Where(b => b.BodyId == w.Id && b.ItemId.StartsWith("WorkPerformance_")).Sum(b => b.Value) ?? 0,
DeptReward = w.DeptReward,
DistPerformance = w.DistPerformance,
OtherPerformance = w.OtherPerformance,
NightWorkPerformance = w.NightWorkPerformance,
}).ToList();
}
else if (useTempId.HasValue && (new int[] { 7, 8 }).Contains(useTempId.Value))
{ {
var itemname = new List<string> { "人员工号", "姓名", "职称", "职称绩效", "工作量绩效工资", "单项奖励小计", "可分配绩效", "医院其他绩效", "夜班工作量绩效" }; var itemname = new List<string> { "人员工号", "姓名", "职称", "职称绩效", "工作量绩效工资", "单项奖励小计", "可分配绩效", "医院其他绩效", "夜班工作量绩效" };
var fixaitems = agfixatitemRepository.GetEntities(t => t.SecondId == secondId && itemname.Contains(t.ItemName)); var fixaitems = agfixatitemRepository.GetEntities(t => t.SecondId == secondId && itemname.Contains(t.ItemName));
......
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