Commit 501e26f3 by lcx

修改获取工作量的系数hospitalID

parent c4b88c26
......@@ -158,7 +158,7 @@ public void ImportWorkloadData(per_allot allot, object parameters)
/// 查询工作量数据
/// </summary>
/// <param name="allotid"></param>
public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, string accountingunit, string unittype)
public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, string accountingunit, string unittype, int hospitalid)
{
using (var connection = context.Database.GetDbConnection())
{
......@@ -167,7 +167,7 @@ public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, stri
{
string clear = @"SELECT t3.AccountingUnit as Department,t1.DoctorName,t1.PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
JOIN per_employee t2 on t1.doctorname = t2.doctorname and t1.personnelnumber = t2.personnelnumber
JOIN (select distinct AccountingUnit,HISDeptName,unittype from per_dept_dic where HospitalId = 45) t3 ON t1.Department = t3.HISDeptName
JOIN (select distinct AccountingUnit,HISDeptName,unittype from per_dept_dic where HospitalId = @hospitalid) t3 ON t1.Department = t3.HISDeptName
WHERE t1.allotid = @allotid
AND t2.allotid = @allotid
AND t3.unittype = @unittype
......@@ -175,7 +175,7 @@ public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, stri
AND t1.Source LIKE CONCAT('%',@unittype,'工作量%')
AND T1.IsDelete = 0
ORDER BY t1.doctorname,t1.Category;";
return connection.Query<report_original_workload>(clear, new { allotid, accountingunit, unittype }, commandTimeout: 60 * 60);
return connection.Query<report_original_workload>(clear, new { allotid, accountingunit, unittype, hospitalid }, commandTimeout: 60 * 60);
}
catch (Exception ex)
{
......
......@@ -497,7 +497,11 @@ public object DeptWorkloadDetail(WorkDetailRequest request, int userId)
if (second == null)
return null;
var data = perallotRepository.QueryWorkloadData(request.AllotId, request.AccountingUnit, second.UnitType);
var allot = perallotRepository.GetEntity(w => w.ID == request.AllotId);
if (allot == null)
return null;
var data = perallotRepository.QueryWorkloadData(request.AllotId, request.AccountingUnit, second.UnitType, allot.HospitalId);
if (data != null && data.Any())
{
return data.GroupBy(t => new { t.Department, t.DoctorName, t.PersonnelNumber, t.Category })
......
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