Commit 756d5f58 by 纪旭 韦

修复绩效提取报错

parent ee49cb91
...@@ -3409,6 +3409,11 @@ ...@@ -3409,6 +3409,11 @@
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.Source">
<summary>
来源
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.AccountingUnit"> <member name="P:Performance.DtoModels.EmployeeReservedDto.AccountingUnit">
<summary> <summary>
核算单元 核算单元
......
...@@ -33,7 +33,7 @@ public class ex_script ...@@ -33,7 +33,7 @@ public class ex_script
/// <summary> /// <summary>
/// ExTypeId /// ExTypeId
/// </summary> /// </summary>
public int TypeId { get; set; } public int? TypeId { get; set; }
/// <summary> /// <summary>
/// 配置Id /// 配置Id
...@@ -63,6 +63,6 @@ public class ex_script ...@@ -63,6 +63,6 @@ public class ex_script
/// <summary> /// <summary>
/// 是否使用原始科室 1 是 2 否 /// 是否使用原始科室 1 是 2 否
/// </summary> /// </summary>
public int IsOrgDepartment { get; set; } public int? IsOrgDepartment { get; set; }
} }
} }
...@@ -666,8 +666,8 @@ public string Judge(int allotId, int hospitalId, int useTemplate, ref bool isSin ...@@ -666,8 +666,8 @@ public string Judge(int allotId, int hospitalId, int useTemplate, ref bool isSin
if (itemsList == null || itemsList.Count == 0) if (itemsList == null || itemsList.Count == 0)
throw new PerformanceException("当前医院还未配置模版项"); throw new PerformanceException("当前医院还未配置模版项");
// 获取当前模板所有相关抽取SQL语句 // 获取当前模板所有相关抽取SQL语句
var extypeIds = itemsList.Select(t => t.TypeId).Union(modulesList.Select(t => t.TypeId)).Distinct().ToList(); 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)); var extractList = exscriptRepository.GetEntities(t => extypeIds.Contains(t.TypeId));
if (extractList == null || extractList.Count == 0) if (extractList == null || extractList.Count == 0)
throw new PerformanceException("当前医院配置模板无需抽取"); throw new PerformanceException("当前医院配置模板无需抽取");
} }
......
...@@ -62,14 +62,14 @@ public void Handler(int hospitalId, per_allot allot, string groupName, bool isSi ...@@ -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)); var types = extypeRepository.GetEntities(t => t.HospitalId == hospitalId && new int[] { (int)SheetType.Employee, (int)SheetType.OnlyExtract }.Contains(t.Source));
if (types != null && types.Any()) 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 (scripts != null && scripts.Any())
{ {
if (types.Any(t => t.Source == (int)SheetType.Employee)) //人员字典抽取配置 if (types.Any(t => t.Source == (int)SheetType.Employee)) //人员字典抽取配置
{ {
logService.ReturnTheLog(allot.ID, groupName, 2, "提取数据", $"提取人员信息数据", isSingle: isSingle); logService.ReturnTheLog(allot.ID, groupName, 2, "提取数据", $"提取人员信息数据", isSingle: isSingle);
var typeIds = types.Where(t => t.Source == (int)SheetType.Employee).Select(t => t.Id); 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) if (script != null)
Employee(allot, configs, scripts, isSingle); Employee(allot, configs, scripts, isSingle);
} }
......
...@@ -171,7 +171,7 @@ public List<ExtractConfigResponse> GetExtractTypeAndScript(int hospitalId) ...@@ -171,7 +171,7 @@ public List<ExtractConfigResponse> GetExtractTypeAndScript(int hospitalId)
if (result == null || !result.Any()) return new List<ExtractConfigResponse>(); if (result == null || !result.Any()) return new List<ExtractConfigResponse>();
var list = mapper.Map<List<ExtractConfigResponse>>(data); 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>(); var configs = hospitalconfigRepository.GetEntities(w => w.HospitalId == hospitalId) ?? new List<sys_hospitalconfig>();
foreach (var source in result) foreach (var source in result)
......
...@@ -94,7 +94,7 @@ public List<ex_result> Handler(int hospitalId, per_allot allot, string groupName ...@@ -94,7 +94,7 @@ public List<ex_result> Handler(int hospitalId, per_allot allot, string groupName
logService.ReturnTheLog(allot.ID, groupName, 2, "提取数据", $"开始提取数据", isSingle: isSingle); 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()) if (scripts != null && scripts.Any())
{ {
var allmodules = dict[ExDataDict.ExModule] as List<ex_module>; var allmodules = dict[ExDataDict.ExModule] as List<ex_module>;
......
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