Commit 756d5f58 by 纪旭 韦

修复绩效提取报错

parent ee49cb91
......@@ -3409,6 +3409,11 @@
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.Source">
<summary>
来源
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.AccountingUnit">
<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; }
}
}
......@@ -666,7 +666,7 @@ 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 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>;
......
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