Commit 73103dad by Licx

Merge branch 'release/v22.4.18-Beta-wuzhou' into develop

parents 363a8768 5e3b9fd4
......@@ -109,7 +109,8 @@ public bool ModifyBudgetData(List<BudgetResponse> request)
if (request == null || !request.Any(t => t.Type == 1) || !request.Any(t => t.Type == 2))
throw new PerformanceException("提交数据中含无效数据");
var amounts = perbudgetamountRepository.GetEntities(w => request.Where(t => t.Type == 1).Select(t => t.Id).Contains(w.Id));
var requestType1Ids = request.Where(t => t.Type == 1).Select(t => t.Id);
var amounts = perbudgetamountRepository.GetEntities(w => requestType1Ids.Contains(w.Id));
if (amounts != null && amounts.Any())
{
foreach (var item in amounts)
......@@ -139,7 +140,9 @@ public bool ModifyBudgetData(List<BudgetResponse> request)
perbudgetamountRepository.UpdateRange(amounts.ToArray());
}
var ratios = perbudgetratioRepository.GetEntities(w => request.Where(t => t.Type == 2).Select(t => t.Id).Contains(w.Id));
var requestType2Ids = request.Where(t => t.Type == 2).Select(t => t.Id);
var ratios = perbudgetratioRepository.GetEntities(w => requestType2Ids.Contains(w.Id));
if (ratios != null && ratios.Any())
{
foreach (var item in ratios)
......
......@@ -41,6 +41,7 @@ public class RedistributionService : IAutoInjection
private readonly PerforAgworkloadtypeRepository _agworkloadtypeRepository;
private readonly PerforImemployeeclinicRepository _imemployeeclinicRepository;
private readonly PerforImemployeelogisticsRepository _imemployeelogisticsRepository;
private ag_secondallot prevSecondAllot;
public RedistributionService(
ILogger<RedistributionService> logger,
......@@ -100,6 +101,10 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
var allot = _perallotRepository.GetEntity(t => t.ID == second.AllotId);
if (allot == null) throw new PerformanceException("绩效记录不存在!");
// 前二次绩效
prevSecondAllot = _secondAllotDetails.GetPreviousSecondAllot(allot.HospitalId, second);
// 填报模板带出 行政工勤 绩效
var computes = _rescomputeRepository.GetEntities(w => w.AllotID == allot.ID && UnitTypeUtil.Office.Contains(w.AccountType));
......@@ -138,7 +143,7 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
}
}
var head = LoadHead(computeMode, allot, second);
var head = LoadHead(computeMode, allot, second, overrideMode);
var dic = GetTableHeaderDictionary(computeMode, allot, second, loads, isAttachFactor: false);
return new SecondDetailDto { Head = head, Body = handson, Dic = dic };
}
......@@ -424,7 +429,7 @@ public void RowsExpand(per_allot allot, List<SecondColumnDictionary> dic, List<D
/// <param name="second"></param>
/// <param name="allot"></param>
/// <returns></returns>
private Dictionary<string, object> LoadHead(ComputeMode computeMode, per_allot allot, ag_secondallot second)
private Dictionary<string, object> LoadHead(ComputeMode computeMode, per_allot allot, ag_secondallot second, EmployeeSource overrideMode = 0)
{
/*
此处数据需要额外注意,前端显示规则:接口返回则显示
......@@ -461,7 +466,8 @@ public void RowsExpand(per_allot allot, List<SecondColumnDictionary> dic, List<D
// 横向 纵向 特有顶部信息
if (computeMode != ComputeMode.NotCalculate)
{
var history = _agheadsourceRepository.GetEntity(t => t.SecondId == second.Id);
int secondId = overrideMode == EmployeeSource.PrevSecondAllot ? prevSecondAllot.Id : second.Id;
var history = _agheadsourceRepository.GetEntity(t => t.SecondId == secondId);
head.AddOrUpdate(nameof(ag_headsource.SeniorityTitlesAccountedPerformance), history?.SeniorityTitlesAccountedPerformance ?? 0.2m);
head.AddOrUpdate(nameof(ag_headsource.Workload_Ratio_Default), history?.Workload_Ratio_Default ?? 0.8m);
......@@ -469,7 +475,9 @@ public void RowsExpand(per_allot allot, List<SecondColumnDictionary> dic, List<D
// 多工作量加载
var status = (new int[] { (int)SecondAllotStatus.WaitReview, (int)SecondAllotStatus.PassAudit });
var headDynamic = _agworktypesourceRepository.GetEntities(t => t.SecondId == second.Id) ?? new List<ag_worktype_source>();
var headDynamic = _agworktypesourceRepository.GetEntities(t => t.SecondId == secondId) ?? new List<ag_worktype_source>();
// 已提交
if (second.Status.HasValue && status.Contains(second.Status.Value))
{
......@@ -630,7 +638,7 @@ private List<ag_bodysource> LoadEmployees_PrevSecondAllot(per_allot allot, ag_se
{
List<ag_bodysource> numbers = new List<ag_bodysource>();
// 上次二次分配分三种情况,1.其他来源 2.单工作量 3.多工作量
var prevSecondAllot = _secondAllotDetails.GetPreviousSecondAllot(allot.HospitalId, second);
// var prevSecondAllot = _secondAllotDetails.GetPreviousSecondAllot(allot.HospitalId, second);
var status = new int[] { (int)SecondAllotStatus.WaitReview, (int)SecondAllotStatus.PassAudit };
if (prevSecondAllot != null && status.Contains(prevSecondAllot.Status ?? (int)SecondAllotStatus.Uncommitted))
{
......
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