Commit 04eeef60 by lcx

获取科室字典

parent d4bd9f65
......@@ -145,13 +145,13 @@ public ApiResponse DeleteDeptDic([FromBody] DeptdicResponse request)
/// 系统/标准科室字典
/// </summary>
/// <param name="hospitalId">医院Id</param>
/// <param name="type">1系统科室 2标准科室 3核算单元</param>
/// <param name="type">1系统科室 2标准科室 3核算单元 4行政后勤 5特殊核算组</param>
/// <returns></returns>
[Route("deptdic/{hospitalId}/dict/{type}")]
[HttpPost]
public ApiResponse DeptDics(int hospitalId, int type)
{
if (!new int[] { 1, 2, 3 }.Contains(type))
if (!new int[] { 1, 2, 3, 4, 5 }.Contains(type))
return new ApiResponse(ResponseType.ParameterError, "参数错误!");
var result = personService.DeptDics(hospitalId, type);
......
......@@ -460,7 +460,15 @@ public List<TitleValue> DeptDics(int hospitalId, int type)
}
else if (type == 3)
{
result = deptdics.Select(t => t.AccountingUnit).Distinct().ToList();
result = deptdics.Where(t => !new string[] { UnitType.行政后勤.ToString(), UnitType.特殊核算组.ToString() }.Contains(t.UnitType)).Select(t => t.AccountingUnit).Distinct().ToList();
}
else if (type == 4)
{
result = deptdics.Where(t => t.UnitType == UnitType.行政后勤.ToString()).Select(t => t.AccountingUnit).Distinct().ToList();
}
else if (type == 5)
{
result = deptdics.Where(t => t.UnitType == UnitType.特殊核算组.ToString()).Select(t => t.AccountingUnit).Distinct().ToList();
}
return result.Select(t => new TitleValue { Title = t, Value = t }).ToList();
}
......
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