Commit 26dc5992 by 1391696987

修复预留金额bug

parent e98888c7
......@@ -390,28 +390,14 @@ 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 })?.ToList();
}
/// <summary>
/// 获取医院预留绩效
/// </summary>
/// <param name="hospitalId"></param>
/// <param name="year"></param>
/// <returns></returns>
public List<EmployeeReservedDto> GetEmployeeReserved(int hospitalId, int year, string[] unitTypes, string accountingUnit)
{
string sql = @"
SELECT * FROM view_allot_result_report WHERE HospitalID=@HospitalID AND Year=@Year
AND ((UnitType IN @unitTypes AND AccountingUnit = @accountingUnit) OR (NewUnitType IN @unitTypes AND NewAccountingUnit = @accountingUnit))
";
return DapperQuery<EmployeeReservedDto>(sql, new { HospitalID = hospitalId, Year = year, unitTypes, accountingUnit })?.ToList();
return DapperQuery<EmployeeReservedDto>(sql, new { HospitalID = request.HospitalId, Year = request.Year }, commandTimeout : 60 * 60 )?.ToList();
}
public List<view_allot_result> GetOwnerPerformance(List<int> hospitalId, string jobNumber)
{
string sql = "SELECT * FROM view_allot_result WHERE States IN (6,8) AND HospitalID IN @HospitalID AND JobNumber=@JobNumber";
return DapperQuery<view_allot_result>(sql, new { HospitalID = hospitalId, JobNumber = jobNumber })?.ToList();
return DapperQuery<view_allot_result>(sql, new { HospitalID = hospitalId, JobNumber = jobNumber }, commandTimeout: 60 * 60)?.ToList();
}
public List<dynamic> QueryCompute(int allotId, string viewName)
......
......@@ -662,18 +662,8 @@ public List<EmployeeReservedDto> GetReserved(ReservedRequest request, int userid
var role = roleService.GetUserRole(userid)?.FirstOrDefault()?.Type;
if (!role.HasValue)
throw new PerformanceException("用户信息错误");
var reserveds = _reportRepository.GetEmployeeReserved(request);
if (reserveds != null && reserveds.Any())
{
var unitTpes = UnitTypeUtil.GetMaps(userInfo?.URole.Type);
return _reportRepository.GetEmployeeReserved(request.HospitalId, request.Year, unitTpes, userInfo.User.Department);
}
else
{
return _reportRepository.GetEmployeeReserved(request);
}
return _reportRepository.GetEmployeeReserved(request);
}
/// <summary>
/// 查询个人绩效
......
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