Commit da02d1d6 by ruyun.zhang@suvalue.com

Merge remote-tracking branch 'origin/v2020calculate' into v2020calculate

parents 30e2ee1e 04eeef60
......@@ -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);
......
......@@ -15,6 +15,8 @@ public class DeptdicResponse
public Deptdic InpatDoctorAccounting { get; set; }
public Deptdic InpatNurseAccounting { get; set; }
public Deptdic InpatTechnicAccounting { get; set; }
public Deptdic LogisticsAccounting { get; set; }
public Deptdic SpecialAccounting { get; set; }
public DateTime? CreateTime { get; set; }
}
......
......@@ -33,6 +33,8 @@ public class PersonService : IAutoInjection
{ nameof(DeptdicResponse.InpatDoctorAccounting), (UnitType.医生组.ToString(), "住院") },
{ nameof(DeptdicResponse.InpatNurseAccounting), (UnitType.护理组.ToString(), "住院") },
{ nameof(DeptdicResponse.InpatTechnicAccounting), (UnitType.医技组.ToString(), "住院") },
{ nameof(DeptdicResponse.LogisticsAccounting), (UnitType.行政后勤.ToString(), null) },
{ nameof(DeptdicResponse.SpecialAccounting), (UnitType.特殊核算组.ToString(), null) },
};
public PersonService(ILogger<PersonService> logger,
......@@ -278,12 +280,14 @@ public IEnumerable<DeptdicResponse> GetDepartments(int hospitalId)
HospitalId = hospitalId,
HISDeptName = t.Key.HISDeptName,
Department = t.Key.Department,
OutDoctorAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.UnitType == UnitType.医生组.ToString() && group.Source == "门诊")),
OutNurseAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.UnitType == UnitType.护理组.ToString() && group.Source == "门诊")),
OutTechnicAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.UnitType == UnitType.医技组.ToString() && group.Source == "门诊")),
InpatDoctorAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.UnitType == UnitType.医生组.ToString() && group.Source == "住院")),
InpatNurseAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.UnitType == UnitType.护理组.ToString() && group.Source == "住院")),
InpatTechnicAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.UnitType == UnitType.医技组.ToString() && group.Source == "住院")),
OutDoctorAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.HISDeptName == t.Key.HISDeptName && group.UnitType == UnitType.医生组.ToString() && group.Source == "门诊")),
OutNurseAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.HISDeptName == t.Key.HISDeptName && group.UnitType == UnitType.护理组.ToString() && group.Source == "门诊")),
OutTechnicAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.HISDeptName == t.Key.HISDeptName && group.UnitType == UnitType.医技组.ToString() && group.Source == "门诊")),
InpatDoctorAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.HISDeptName == t.Key.HISDeptName && group.UnitType == UnitType.医生组.ToString() && group.Source == "住院")),
InpatNurseAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.HISDeptName == t.Key.HISDeptName && group.UnitType == UnitType.护理组.ToString() && group.Source == "住院")),
InpatTechnicAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.HISDeptName == t.Key.HISDeptName && group.UnitType == UnitType.医技组.ToString() && group.Source == "住院")),
LogisticsAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.HISDeptName == t.Key.HISDeptName && group.UnitType == UnitType.行政后勤.ToString())),
SpecialAccounting = GetDeptdic(t.FirstOrDefault(group => group.Department == t.Key.Department && group.HISDeptName == t.Key.HISDeptName && group.UnitType == UnitType.特殊核算组.ToString())),
CreateTime = t.Max(group => group.CreateTime)
});
......@@ -456,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