Commit 62f8a819 by ruyun.zhang@suvalue.com

Merge branch 'hotfix/科室预发修复'

parents 34930cfb 1ee5181d
...@@ -520,141 +520,141 @@ private IEnumerable<PerDataSpecialUnit> CalculateSpecialUnit(PerSheet specialUni ...@@ -520,141 +520,141 @@ private IEnumerable<PerDataSpecialUnit> CalculateSpecialUnit(PerSheet specialUni
#endregion 预留金额 #endregion 预留金额
///// <summary> /// <summary>
///// 创建科室二次分配 /// 创建科室二次分配
///// </summary> /// </summary>
///// <param name="allot"></param> /// <param name="allot"></param>
//public void GenerateSecondAllot(per_allot allot) public void GenerateSecondAllot(per_allot allot)
//{ {
// List<ag_secondallot> tempSecond = new List<ag_secondallot>(); List<ag_secondallot> tempSecond = new List<ag_secondallot>();
// List<ag_secondallot> insSecond = new List<ag_secondallot>(); List<ag_secondallot> insSecond = new List<ag_secondallot>();
// List<ag_secondallot> updSecond = new List<ag_secondallot>(); List<ag_secondallot> updSecond = new List<ag_secondallot>();
// List<ag_secondallot> delSecond = new List<ag_secondallot>(); List<ag_secondallot> delSecond = new List<ag_secondallot>();
// var types = new List<int> { (int)UnitType.行政高层, (int)UnitType.行政中层, (int)UnitType.行政后勤 }; var types = new List<int> { (int)UnitType.行政高层, (int)UnitType.行政中层, (int)UnitType.行政后勤 };
// //// 获取医院是否开启后勤二次分配 //// 获取医院是否开启后勤二次分配
// //var hospital = hospitalRepository.GetEntity(w => w.ID == allot.HospitalId); //var hospital = hospitalRepository.GetEntity(w => w.ID == allot.HospitalId);
// //if (hospital?.IsOpenLogisticsSecondAllot != 1) //if (hospital?.IsOpenLogisticsSecondAllot != 1)
// // types.Add((int)UnitType.行政后勤); // types.Add((int)UnitType.行政后勤);
// var accountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allot.ID && !types.Contains(t.UnitType.Value)); var accountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allot.ID && !types.Contains(t.UnitType.Value));
// // 查询需要进行二次分配的行政后勤科室 // 查询需要进行二次分配的行政后勤科室
// var xzAccountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allot.ID && t.UnitType.Value == (int)UnitType.行政后勤 && t.NeedSecondAllot == "是"); var xzAccountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allot.ID && t.UnitType.Value == (int)UnitType.行政后勤 && t.NeedSecondAllot == "是");
// if (xzAccountUnit != null && xzAccountUnit.Count > 0) if (xzAccountUnit != null && xzAccountUnit.Count > 0)
// (accountUnit ?? new List<res_account>()).AddRange(xzAccountUnit); (accountUnit ?? new List<res_account>()).AddRange(xzAccountUnit);
// var specialList = perforResspecialunitRepository.GetEntities(t => t.AllotID == allot.ID); var specialList = perforResspecialunitRepository.GetEntities(t => t.AllotID == allot.ID);
// if (accountUnit != null) if (accountUnit != null)
// { {
// foreach (var item in accountUnit) foreach (var item in accountUnit)
// { {
// if (!tempSecond.Any(f => f.UnitType == ((UnitType)item.UnitType).ToString() && f.Department == item.AccountingUnit)) if (!tempSecond.Any(f => f.UnitType == ((UnitType)item.UnitType).ToString() && f.Department == item.AccountingUnit))
// { {
// tempSecond.Add(new ag_secondallot tempSecond.Add(new ag_secondallot
// { {
// AllotId = allot.ID, AllotId = allot.ID,
// Year = allot.Year, Year = allot.Year,
// Month = allot.Month, Month = allot.Month,
// UnitType = ((UnitType)item.UnitType).ToString(), UnitType = ((UnitType)item.UnitType).ToString(),
// Department = item.AccountingUnit, Department = item.AccountingUnit,
// NightShiftWorkPerforFee = item.NightShiftWorkPerforFee, NightShiftWorkPerforFee = item.NightShiftWorkPerforFee,
// PreRealGiveFee = item.RealGiveFee, PreRealGiveFee = item.RealGiveFee,
// }); });
// } }
// } }
// } }
// if (specialList != null) if (specialList != null)
// { {
// foreach (var item in specialList.Select(w => new { w.AccountingUnit, w.NightShiftWorkPerforFee, w.RealGiveFee }).Distinct()) foreach (var item in specialList.Select(w => new { w.AccountingUnit, w.NightShiftWorkPerforFee, w.RealGiveFee }).Distinct())
// { {
// if (!tempSecond.Any(f => f.UnitType == UnitType.特殊核算组.ToString() && f.Department == item.AccountingUnit)) if (!tempSecond.Any(f => f.UnitType == UnitType.特殊核算组.ToString() && f.Department == item.AccountingUnit))
// { {
// tempSecond.Add(new ag_secondallot tempSecond.Add(new ag_secondallot
// { {
// AllotId = allot.ID, AllotId = allot.ID,
// Year = allot.Year, Year = allot.Year,
// Month = allot.Month, Month = allot.Month,
// UnitType = UnitType.特殊核算组.ToString(), UnitType = UnitType.特殊核算组.ToString(),
// Department = item.AccountingUnit, Department = item.AccountingUnit,
// NightShiftWorkPerforFee = item.NightShiftWorkPerforFee, NightShiftWorkPerforFee = item.NightShiftWorkPerforFee,
// PreRealGiveFee = item.RealGiveFee, PreRealGiveFee = item.RealGiveFee,
// }); });
// } }
// } }
// } }
// var secondList = perforAgsecondallotRepository.GetEntities(t => t.AllotId == allot.ID && t.Year == allot.Year && t.Month == allot.Month); var secondList = perforAgsecondallotRepository.GetEntities(t => t.AllotId == allot.ID && t.Year == allot.Year && t.Month == allot.Month);
// foreach (var item in tempSecond) foreach (var item in tempSecond)
// { {
// var second = secondList?.FirstOrDefault(f => f.UnitType == item.UnitType && f.Department == item.Department); var second = secondList?.FirstOrDefault(f => f.UnitType == item.UnitType && f.Department == item.Department);
// if (second == null) if (second == null)
// { {
// insSecond.Add(new ag_secondallot insSecond.Add(new ag_secondallot
// { {
// AllotId = allot.ID, AllotId = allot.ID,
// Year = allot.Year, Year = allot.Year,
// Month = allot.Month, Month = allot.Month,
// UnitType = item.UnitType, UnitType = item.UnitType,
// Department = item.Department, Department = item.Department,
// PreRealGiveFee = item.PreRealGiveFee, PreRealGiveFee = item.PreRealGiveFee,
// NightShiftWorkPerforFee = item.NightShiftWorkPerforFee, NightShiftWorkPerforFee = item.NightShiftWorkPerforFee,
// Status = 1, Status = 1,
// NursingDeptStatus = 1, NursingDeptStatus = 1,
// }); });
// } }
// else else
// { {
// /* /*
// var backResult = Math.Abs((second.PreRealGiveFee ?? 0) - (item.RealGiveFee ?? 0)) >= 0.5m var backResult = Math.Abs((second.PreRealGiveFee ?? 0) - (item.RealGiveFee ?? 0)) >= 0.5m
// || Math.Abs((second.NightShiftWorkPerforFee ?? 0) - (item.NightShiftWorkPerforFee ?? 0)) >= 0.5m; || Math.Abs((second.NightShiftWorkPerforFee ?? 0) - (item.NightShiftWorkPerforFee ?? 0)) >= 0.5m;
// if (backResult && second.Status > 1) if (backResult && second.Status > 1)
// { {
// second.Status = 4; second.Status = 4;
// second.Remark = "科室绩效结果发生变更,需要重新提交"; second.Remark = "科室绩效结果发生变更,需要重新提交";
// second.NursingDeptStatus = 4; second.NursingDeptStatus = 4;
// second.NursingDeptRemark = "科室绩效结果发生变更,需要重新提交"; second.NursingDeptRemark = "科室绩效结果发生变更,需要重新提交";
// } }
// */ */
// second.PreRealGiveFee = item.PreRealGiveFee; second.PreRealGiveFee = item.PreRealGiveFee;
// second.NightShiftWorkPerforFee = item.NightShiftWorkPerforFee; second.NightShiftWorkPerforFee = item.NightShiftWorkPerforFee;
// updSecond.Add(second); updSecond.Add(second);
// } }
// } }
// if (secondList != null && secondList.Any()) if (secondList != null && secondList.Any())
// { {
// foreach (var item in secondList) foreach (var item in secondList)
// { {
// var second = tempSecond?.FirstOrDefault(f => f.UnitType == item.UnitType && f.Department == item.Department); var second = tempSecond?.FirstOrDefault(f => f.UnitType == item.UnitType && f.Department == item.Department);
// if (second == null) if (second == null)
// { {
// item.PreRealGiveFee = 0; item.PreRealGiveFee = 0;
// delSecond.Add(item); delSecond.Add(item);
// } }
// } }
// } }
// if (insSecond.Any()) if (insSecond.Any())
// perforAgsecondallotRepository.AddRange(insSecond.ToArray()); perforAgsecondallotRepository.AddRange(insSecond.ToArray());
// if (updSecond.Any()) if (updSecond.Any())
// { {
// perforAgsecondallotRepository.UpdateRange(updSecond.ToArray()); perforAgsecondallotRepository.UpdateRange(updSecond.ToArray());
// /* /*
// foreach (var item in updSecond.Where(w => w.Status == 4)) foreach (var item in updSecond.Where(w => w.Status == 4))
// { {
// // 自动驳回,需要清空该科室历史数据 // 自动驳回,需要清空该科室历史数据
// perforAgsecondallotRepository.DeleteComputeHistory(item.Id); perforAgsecondallotRepository.DeleteComputeHistory(item.Id);
// } }
// */ */
// } }
// if (delSecond.Any()) if (delSecond.Any())
// perforAgsecondallotRepository.UpdateRange(delSecond.ToArray()); perforAgsecondallotRepository.UpdateRange(delSecond.ToArray());
//} }
/// <summary> /// <summary>
/// 获取所有二次分配记录 /// 获取所有二次分配记录
......
...@@ -450,8 +450,8 @@ public void Generate(per_allot allot) ...@@ -450,8 +450,8 @@ public void Generate(per_allot allot)
//logManageService.WriteMsg("正在生成绩效", "保存预留绩效金额", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在生成绩效", "保存预留绩效金额", 1, allot.ID, "ReceiveMessage", true);
//resultComputeService.SaveReserved(allot, allot.HospitalId); //resultComputeService.SaveReserved(allot, allot.HospitalId);
//// 科室下发 // 科室创建但不下发
//resultComputeService.GenerateSecondAllot(allot); resultComputeService.GenerateSecondAllot(allot);
UpdateAllotStates(allot.ID, (int)AllotStates.GenerateAccomplish, EnumHelper.GetDescription(AllotStates.GenerateAccomplish), generate); UpdateAllotStates(allot.ID, (int)AllotStates.GenerateAccomplish, EnumHelper.GetDescription(AllotStates.GenerateAccomplish), generate);
perforCofdirectorRepository.SupplementaryData(allot.ID); perforCofdirectorRepository.SupplementaryData(allot.ID);
......
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