Commit 8c7b0c16 by lcx

二次查看科室人员收入数据

parent 6b0c884e
...@@ -188,7 +188,7 @@ public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, stri ...@@ -188,7 +188,7 @@ public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, stri
/// 查询门诊收入数据 /// 查询门诊收入数据
/// </summary> /// </summary>
/// <param name="allotid"></param> /// <param name="allotid"></param>
public IEnumerable<ex_result> QueryIncomeData(int allotid, string accountingunit, string unittype) public IEnumerable<ex_result> QueryIncomeData(int allotid, string accountingunit, string unittype, int hospitalid)
{ {
using (var connection = context.Database.GetDbConnection()) using (var connection = context.Database.GetDbConnection())
{ {
...@@ -197,7 +197,7 @@ public IEnumerable<ex_result> QueryIncomeData(int allotid, string accountingunit ...@@ -197,7 +197,7 @@ public IEnumerable<ex_result> QueryIncomeData(int allotid, string accountingunit
{ {
string clear = @"SELECT t3.AccountingUnit as Department,t1.DoctorName,t1.PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1 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 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 WHERE t1.allotid = @allotid
AND t2.allotid = @allotid AND t2.allotid = @allotid
AND t3.unittype = @unittype AND t3.unittype = @unittype
...@@ -205,7 +205,7 @@ public IEnumerable<ex_result> QueryIncomeData(int allotid, string accountingunit ...@@ -205,7 +205,7 @@ public IEnumerable<ex_result> QueryIncomeData(int allotid, string accountingunit
AND t1.Source like '%门诊开单%' AND t1.Source like '%门诊开单%'
AND T1.IsDelete = 0 AND T1.IsDelete = 0
ORDER BY t1.doctorname,t1.Category;"; ORDER BY t1.doctorname,t1.Category;";
return connection.Query<ex_result>(clear, new { allotid, accountingunit, unittype }, commandTimeout: 60 * 60); return connection.Query<ex_result>(clear, new { allotid, accountingunit, unittype, hospitalid }, commandTimeout: 60 * 60);
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -529,7 +529,11 @@ public object DeptIncomeDetail(WorkDetailRequest request, int userId) ...@@ -529,7 +529,11 @@ public object DeptIncomeDetail(WorkDetailRequest request, int userId)
if (second == null) if (second == null)
return null; return null;
var data = perallotRepository.QueryIncomeData(request.AllotId, request.AccountingUnit, second.UnitType); var allot = perallotRepository.GetEntity(w => w.ID == request.AllotId);
if (allot == null)
return null;
var data = perallotRepository.QueryIncomeData(request.AllotId, request.AccountingUnit, second.UnitType, allot.HospitalId);
if (data != null && data.Any()) if (data != null && data.Any())
{ {
return data.GroupBy(t => new { t.Department, t.DoctorName, t.PersonnelNumber, t.Category }) 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