Commit 092702d5 by 1391696987

预留金额返回字段添加Source,修复bug

parent 26dc5992
......@@ -19,6 +19,11 @@ public class EmployeeReservedDto
/// <summary>
///
/// </summary>
public int Source { get; set; }
/// <summary>
///
/// </summary>
public string UnitType { get; set; }
/// <summary>
......
......@@ -390,7 +390,9 @@ 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 sql = $"SELECT * FROM {view} WHERE HospitalID=@HospitalID AND Year=@Year";
return DapperQuery<EmployeeReservedDto>(sql, new { HospitalID = request.HospitalId, Year = request.Year }, commandTimeout : 60 * 60 )?.ToList();
var reserveds = DapperQuery<EmployeeReservedDto>(sql, new { HospitalID = request.HospitalId, Year = request.Year }, commandTimeout : 60 * 60 )?.ToList();
reserveds.ForEach(t=>t.Source = request.Source);
return reserveds;
}
......
......@@ -662,8 +662,15 @@ public List<EmployeeReservedDto> GetReserved(ReservedRequest request, int userid
var role = roleService.GetUserRole(userid)?.FirstOrDefault()?.Type;
if (!role.HasValue)
throw new PerformanceException("用户信息错误");
return _reportRepository.GetEmployeeReserved(request);
var reserveds = _reportRepository.GetEmployeeReserved(request);
if (reserveds != null && reserveds.Any() && userInfo.IsSecondAdmin)
{
var unitTpes = UnitTypeUtil.GetMaps(userInfo?.URole.Type);
reserveds = reserveds.Where(w => UnitTypeUtil.Is(w.UnitType, unitTpes) && w.AccountingUnit == userInfo.User.Department)?.ToList();
}
return reserveds;
}
/// <summary>
/// 查询个人绩效
......
......@@ -88,9 +88,9 @@ public static int GetUnitTypeValue(string unitType)
return 0;
}
public static bool Is(string unit, params UnitType[] types)
public static bool Is(string unit, params string[] types)
{
return !string.IsNullOrEmpty(unit) && types.Any(w => IsEqualsUnitType(w.ToString(), unit));
return !string.IsNullOrEmpty(unit) && types.Any(w => IsEqualsUnitType(w, unit));
}
}
......
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