Commit 10e8a37c by ruyun.zhang@suvalue.com

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

parents f9a5fd77 543d34be
......@@ -3403,6 +3403,11 @@
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.Source">
<summary>
来源
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.AccountingUnit">
<summary>
核算单元
......
......@@ -25,6 +25,11 @@ public class EmployeeReservedDto
///
/// </summary>
public string UnitType { get; set; }
/// <summary>
/// 来源
/// </summary>
public string Source { get; set; }
/// <summary>
/// 核算单元
......
......@@ -33,7 +33,7 @@ public class ex_script
/// <summary>
/// ExTypeId
/// </summary>
public int TypeId { get; set; }
public int? TypeId { get; set; }
/// <summary>
/// 配置Id
......@@ -63,6 +63,6 @@ public class ex_script
/// <summary>
/// 是否使用原始科室 1 是 2 否
/// </summary>
public int IsOrgDepartment { get; set; }
public int? IsOrgDepartment { get; set; }
}
}
......@@ -71,7 +71,7 @@ public DtoModels.Comparison<view_check_emp> CheckEmployeeRealGiveFeeDiff(Compari
) TAB
WHERE if(@searchQuery='','',AccountingUnit) LIKE @parm OR if(@searchQuery='','',JobNumber) LIKE @parm OR if(@searchQuery='','',EmployeeName) LIKE @parm
GROUP BY HospitalId,Year,Month,AllotID,UnitType,AccountingUnit,JobNumber
ORDER BY HospitalId,Year,Month,ABS(SUM(RealGiveFeeExecl) - SUM(RealGiveFeeCompute)) DESC LIMIT {(request.PageIndex-1) * request.PageSize},{request.PageSize}
ORDER BY HospitalId,Year,Month,ABS(SUM(RealGiveFeeExecl) - SUM(RealGiveFeeCompute)) DESC LIMIT {(request.PageIndex - 1) * request.PageSize},{request.PageSize}
";
var queryCount = @"
......
......@@ -388,6 +388,7 @@ public List<PerReport> NurseAvg(ReportRequest request)
public List<EmployeeReservedDto> GetEmployeeReserved(ReservedRequest request)
{
string view = request.Source == 1 ? "view_allot_result_report_emp" : request.Source == 2 ? "view_allot_result_report_issue_source" : request.Source == 3 ? "view_allot_result_report":"";
string view = request.Source == 1 ? "view_allot_result_report_emp" : request.Source == 2 ? "view_allot_result_report_issue_source" : request.Source == 3 ? "view_allot_result_report" : "";
string sql = $"SELECT * FROM {view} WHERE HospitalID=@HospitalID AND Year=@Year";
return DapperQuery<EmployeeReservedDto>(sql, new { HospitalID = request.HospitalId, Year = request.Year }, commandTimeout: 60 * 10)?.ToList();
......
......@@ -666,8 +666,8 @@ public string Judge(int allotId, int hospitalId, int useTemplate, ref bool isSin
if (itemsList == null || itemsList.Count == 0)
throw new PerformanceException("当前医院还未配置模版项");
// 获取当前模板所有相关抽取SQL语句
var extypeIds = itemsList.Select(t => t.TypeId).Union(modulesList.Select(t => t.TypeId)).Distinct().ToList();
var extractList = exscriptRepository.GetEntities(t => extypeIds.Contains(t.TypeId));
var extypeIds = itemsList.Select(t => t.TypeId).Union(modulesList.Where(w=>w.TypeId.HasValue).Select(t => t.TypeId)).Distinct().ToList();
var extractList = exscriptRepository.GetEntities(t => extypeIds.Contains(t.TypeId));
if (extractList == null || extractList.Count == 0)
throw new PerformanceException("当前医院配置模板无需抽取");
}
......
......@@ -62,14 +62,14 @@ public void Handler(int hospitalId, per_allot allot, string groupName, bool isSi
var types = extypeRepository.GetEntities(t => t.HospitalId == hospitalId && new int[] { (int)SheetType.Employee, (int)SheetType.OnlyExtract }.Contains(t.Source));
if (types != null && types.Any())
{
var scripts = exscriptRepository.GetEntities(t => types.Select(s => s.Id).Contains(t.TypeId) && t.IsEnable == 1);
var scripts = exscriptRepository.GetEntities(t => t.TypeId.HasValue && types.Select(s => s.Id).Contains(t.TypeId.Value) && t.IsEnable == 1);
if (scripts != null && scripts.Any())
{
if (types.Any(t => t.Source == (int)SheetType.Employee)) //人员字典抽取配置
{
logService.ReturnTheLog(allot.ID, groupName, 2, "提取数据", $"提取人员信息数据", isSingle: isSingle);
var typeIds = types.Where(t => t.Source == (int)SheetType.Employee).Select(t => t.Id);
var script = scripts.Where(t => typeIds.Contains(t.TypeId));
var script = scripts.Where(t => t.TypeId.HasValue && typeIds.Contains(t.TypeId.Value));
if (script != null)
Employee(allot, configs, scripts, isSingle);
}
......
......@@ -171,7 +171,7 @@ public List<ExtractConfigResponse> GetExtractTypeAndScript(int hospitalId)
if (result == null || !result.Any()) return new List<ExtractConfigResponse>();
var list = mapper.Map<List<ExtractConfigResponse>>(data);
var scripts = exscriptRepository.GetEntities(w => data.Select(x => x.Id).Contains(w.TypeId)) ?? new List<ex_script>();
var scripts = exscriptRepository.GetEntities(w => w.TypeId.HasValue && data.Select(x => x.Id).Contains(w.TypeId.Value)) ?? new List<ex_script>();
var configs = hospitalconfigRepository.GetEntities(w => w.HospitalId == hospitalId) ?? new List<sys_hospitalconfig>();
foreach (var source in result)
......
......@@ -94,7 +94,7 @@ public List<ex_result> Handler(int hospitalId, per_allot allot, string groupName
logService.ReturnTheLog(allot.ID, groupName, 2, "提取数据", $"开始提取数据", isSingle: isSingle);
scripts = exscriptRepository.GetEntities(t => extypeIds.Contains(t.TypeId));
scripts = exscriptRepository.GetEntities(t => t.TypeId.HasValue && extypeIds.Contains(t.TypeId.Value));
if (scripts != null && scripts.Any())
{
var allmodules = dict[ExDataDict.ExModule] as List<ex_module>;
......
......@@ -994,6 +994,8 @@ public void ResultCompute(ComputeMode computeMode, Dictionary<string, object> he
if (computeMode == ComputeMode.NotCalculate)
{
// 清空行内主任基础绩效
clearBasisPerformance(rows, specialPostName);
// 清空无效数据
clearPerformanceWorkload(rows, workloadGroups);
// 行内计算单项奖励
......@@ -1071,6 +1073,23 @@ private void clearPerformanceWorkload(List<Dictionary<string, object>> rows, Lis
}
/// <summary>
/// 清空行内主任基础绩效
/// </summary>
/// <param name="rows"></param>
/// <param name="workloadGroups"></param>
private void clearBasisPerformance(List<Dictionary<string, object>> rows, string[] specialPostName)
{
foreach (var row in rows)
{
var post = row.GetString(nameof(ag_bodysource.Post));
if (specialPostName.Contains(post))
{
row.AddOrUpdate(nameof(ag_bodysource.BasisPerformance), 0m);
}
}
}
/// <summary>
/// 行内计算单项奖励
/// </summary>
/// <param name="rows"></param>
......
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