Commit 22d17ee5 by lcx

药品费用类别修改、发放系数

parent fb2314e2
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"SmtpServer": "smtpdm.aliyun.com", "SmtpServer": "smtpdm.aliyun.com",
"Account": "service@email.suvalue.com", "Account": "service@email.suvalue.com",
"Password": "SuValue123456", "Password": "SuValue123456",
"IsEnable": true "IsEnable": false
}, },
"Application": { "Application": {
//登录过期时间 //登录过期时间
......
...@@ -874,7 +874,7 @@ ...@@ -874,7 +874,7 @@
</member> </member>
<member name="P:Performance.DtoModels.PerDataClinicEmployee.JobTitle"> <member name="P:Performance.DtoModels.PerDataClinicEmployee.JobTitle">
<summary> <summary>
务分类
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.PerDataClinicEmployee.Basics"> <member name="P:Performance.DtoModels.PerDataClinicEmployee.Basics">
...@@ -974,7 +974,7 @@ ...@@ -974,7 +974,7 @@
</member> </member>
<member name="P:Performance.DtoModels.PerDataEmployee.JobTitle"> <member name="P:Performance.DtoModels.PerDataEmployee.JobTitle">
<summary> <summary>
务分类
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.PerDataEmployee.PostCoefficient"> <member name="P:Performance.DtoModels.PerDataEmployee.PostCoefficient">
......
...@@ -55,10 +55,10 @@ public class ComputeResult ...@@ -55,10 +55,10 @@ public class ComputeResult
/// </summary> /// </summary>
public Nullable<decimal> PostCoefficient { get; set; } public Nullable<decimal> PostCoefficient { get; set; }
///// <summary> /// <summary>
///// 发放系数(来自人员名单) /// 发放系数(来自人员名单)
///// </summary> /// </summary>
//public Nullable<decimal> Grant { get; set; } public Nullable<decimal> Grant { get; set; }
/// <summary> /// <summary>
/// 应发管理绩效(需计算) /// 应发管理绩效(需计算)
......
...@@ -67,7 +67,7 @@ public List<PerReport> Medicine(int hospitalId, List<string> date) ...@@ -67,7 +67,7 @@ public List<PerReport> Medicine(int hospitalId, List<string> date)
{ {
string sql = @"select accountingunit x,concat(year,'-',lpad(month,2,'0')) y,round((sum(if(cd.id is null,0,cellvalue)) / sum(cellvalue))*100,2) value string sql = @"select accountingunit x,concat(year,'-',lpad(month,2,'0')) y,round((sum(if(cd.id is null,0,cellvalue)) / sum(cellvalue))*100,2) value
from per_allot aot join per_sheet sht on aot.id=sht.allotid join im_data dt on dt.sheetid=sht.id from per_allot aot join per_sheet sht on aot.id=sht.allotid join im_data dt on dt.sheetid=sht.id
left join cof_drugtype cd on cd.allotid=dt.allotid and cd.charge=dt.TypeName and cd.chargetype in ('药') where unittype=1 and sheettype=3 left join cof_drugtype cd on cd.allotid=dt.allotid and cd.charge=dt.TypeName and cd.chargetype in ('药') where unittype=1 and sheettype=3
and sheetname like '%开单收入' and ifnull(accountingunit,'') not in ('') and concat(year,'-',lpad(month,2,'0')) and sheetname like '%开单收入' and ifnull(accountingunit,'') not in ('') and concat(year,'-',lpad(month,2,'0'))
in @date and hospitalid = @hospitalId group by year,month,accountingunit order by y asc,value desc;"; in @date and hospitalid = @hospitalId group by year,month,accountingunit order by y asc,value desc;";
return DapperQuery(sql, new { hospitalId, date }).ToList(); return DapperQuery(sql, new { hospitalId, date }).ToList();
...@@ -81,7 +81,7 @@ public List<PerReport> Income(int hospitalId, List<string> date) ...@@ -81,7 +81,7 @@ public List<PerReport> Income(int hospitalId, List<string> date)
{ {
string sql = @"select accountingunit x,concat(year,'-',lpad(month,2,'0')) y,round((sum(if(cd.id is null,cellvalue,0)) / sum(cellvalue))*100,2) value string sql = @"select accountingunit x,concat(year,'-',lpad(month,2,'0')) y,round((sum(if(cd.id is null,cellvalue,0)) / sum(cellvalue))*100,2) value
from per_allot aot join per_sheet sht on aot.id=sht.allotid join im_data dt on dt.sheetid=sht.id from per_allot aot join per_sheet sht on aot.id=sht.allotid join im_data dt on dt.sheetid=sht.id
left join cof_drugtype cd on cd.allotid=dt.allotid and cd.charge=dt.TypeName and cd.chargetype in ('药品','耗材') left join cof_drugtype cd on cd.allotid=dt.allotid and cd.charge=dt.TypeName and cd.chargetype in ('药费','材料费')
where unittype=1 and sheettype=3 and sheetname like '%开单收入' and ifnull(accountingunit,'') not in ('') and concat(year,'-',lpad(month,2,'0')) where unittype=1 and sheettype=3 and sheetname like '%开单收入' and ifnull(accountingunit,'') not in ('') and concat(year,'-',lpad(month,2,'0'))
in @date and hospitalid = @hospitalId group by year,month,accountingunit order by y asc,value desc;"; in @date and hospitalid = @hospitalId group by year,month,accountingunit order by y asc,value desc;";
return DapperQuery(sql, new { hospitalId, date }).ToList(); return DapperQuery(sql, new { hospitalId, date }).ToList();
...@@ -136,7 +136,7 @@ public List<PerReport> IndexPerforRatio(int hospitalId, string currentDate, stri ...@@ -136,7 +136,7 @@ public List<PerReport> IndexPerforRatio(int hospitalId, string currentDate, stri
/// <returns></returns> /// <returns></returns>
public List<PerReport> IndexDrugRatio(int hospitalId, string currentDate, string yoyDate, string chainDate) public List<PerReport> IndexDrugRatio(int hospitalId, string currentDate, string yoyDate, string chainDate)
{ {
string sql = $"select '{currentDate}' x,t1.y,round(t2.CellValue/t3.`value`*100, 2) value from (select '{currentDate}' x,'当月药占比' y union select '{yoyDate}' x,'同期药占比' y union select '{chainDate}' x,'环比药占比' y)t1 left join (select concat(year,'-',lpad(month,2,'0')) date,sum(CellValue) CellValue from report_original_income t1 inner join cof_drugtype t2 on t1.TypeName = t2.Charge and t1.AllotID = t2.AllotId and t2.ChargeType = '药' where HospitalID = @hospitalId group by year,month) t2 on t1.x = t2.date left join (select concat(year,'-',lpad(month,2,'0')) date,sum(CellValue) value from report_original_income where hospitalid = @hospitalId group by year,month)t3 on t1.x = t3.date order by y;"; string sql = $"select '{currentDate}' x,t1.y,round(t2.CellValue/t3.`value`*100, 2) value from (select '{currentDate}' x,'当月药占比' y union select '{yoyDate}' x,'同期药占比' y union select '{chainDate}' x,'环比药占比' y)t1 left join (select concat(year,'-',lpad(month,2,'0')) date,sum(CellValue) CellValue from report_original_income t1 inner join cof_drugtype t2 on t1.TypeName = t2.Charge and t1.AllotID = t2.AllotId and t2.ChargeType = '药' where HospitalID = @hospitalId group by year,month) t2 on t1.x = t2.date left join (select concat(year,'-',lpad(month,2,'0')) date,sum(CellValue) value from report_original_income where hospitalid = @hospitalId group by year,month)t3 on t1.x = t3.date order by y;";
return DapperQuery(sql, new { hospitalId }).ToList(); return DapperQuery(sql, new { hospitalId }).ToList();
} }
...@@ -150,7 +150,7 @@ public List<PerReport> IndexDrugRatio(int hospitalId, string currentDate, string ...@@ -150,7 +150,7 @@ public List<PerReport> IndexDrugRatio(int hospitalId, string currentDate, string
/// <returns></returns> /// <returns></returns>
public List<PerReport> IndexMaterialRatio(int hospitalId, string currentDate, string yoyDate, string chainDate) public List<PerReport> IndexMaterialRatio(int hospitalId, string currentDate, string yoyDate, string chainDate)
{ {
string sql = $"select '{currentDate}' x,t1.y,round(t2.CellValue/t3.`value`*100, 2) value from (select '{currentDate}' x,'当月材料占比' y union select '{yoyDate}' x,'同期材料占比' y union select '{chainDate}' x,'环比材料占比' y)t1 left join (select concat(year,'-',lpad(month,2,'0')) date,sum(CellValue) CellValue from report_original_income t1 inner join cof_drugtype t2 on t1.TypeName = t2.Charge and t1.AllotID = t2.AllotId and t2.ChargeType = '耗材' where HospitalID = @hospitalId group by year,month) t2 on t1.x = t2.date left join (select concat(year,'-',lpad(month,2,'0')) date,sum(CellValue) value from report_original_income where hospitalid = @hospitalId group by year,month)t3 on t1.x = t3.date order by y;"; string sql = $"select '{currentDate}' x,t1.y,round(t2.CellValue/t3.`value`*100, 2) value from (select '{currentDate}' x,'当月材料占比' y union select '{yoyDate}' x,'同期材料占比' y union select '{chainDate}' x,'环比材料占比' y)t1 left join (select concat(year,'-',lpad(month,2,'0')) date,sum(CellValue) CellValue from report_original_income t1 inner join cof_drugtype t2 on t1.TypeName = t2.Charge and t1.AllotID = t2.AllotId and t2.ChargeType = '材料费' where HospitalID = @hospitalId group by year,month) t2 on t1.x = t2.date left join (select concat(year,'-',lpad(month,2,'0')) date,sum(CellValue) value from report_original_income where hospitalid = @hospitalId group by year,month)t3 on t1.x = t3.date order by y;";
return DapperQuery(sql, new { hospitalId }).ToList(); return DapperQuery(sql, new { hospitalId }).ToList();
} }
...@@ -250,9 +250,9 @@ public List<PerReport> DrugRatio(ReportRequest request) ...@@ -250,9 +250,9 @@ public List<PerReport> DrugRatio(ReportRequest request)
{ {
where += $" and month in ({request.Month}) "; where += $" and month in ({request.Month}) ";
} }
string sql = $"select '药占比(年)' y,concat(t1.y,'年') x,round(CellValue/t2.`value`*100,2) value from (select year y,sum(CellValue) CellValue from report_original_income t1 inner join cof_drugtype t2 on t1.TypeName = t2.Charge and t1.AllotID = t2.AllotId and t2.ChargeType = '药' where HospitalID = @hospitalId {where} group by year) t1 inner join (select year y,sum(CellValue) value from report_original_income where hospitalid = @hospitalId {where} group by year)t2 on t1.y = t2.y order by x asc;"; string sql = $"select '药占比(年)' y,concat(t1.y,'年') x,round(CellValue/t2.`value`*100,2) value from (select year y,sum(CellValue) CellValue from report_original_income t1 inner join cof_drugtype t2 on t1.TypeName = t2.Charge and t1.AllotID = t2.AllotId and t2.ChargeType = '药' where HospitalID = @hospitalId {where} group by year) t1 inner join (select year y,sum(CellValue) value from report_original_income where hospitalid = @hospitalId {where} group by year)t2 on t1.y = t2.y order by x asc;";
if (request.OnlyYear != 1) if (request.OnlyYear != 1)
sql = $"select concat(t1.year,'年') y,concat(t1.month,'月') x,round(CellValue/t2.`value`*100,2) value from (select month,year,sum(CellValue) CellValue from report_original_income t1 inner join cof_drugtype t2 on t1.TypeName = t2.Charge and t1.AllotID = t2.AllotId and t2.ChargeType = '药' where HospitalID = @hospitalId {where} group by month,year) t1 inner join (select month,year,sum(CellValue) value from report_original_income where hospitalid = @hospitalId {where} group by month,year)t2 on t1.`month`=t2.`month` and t1.year = t2.year order by x asc;"; sql = $"select concat(t1.year,'年') y,concat(t1.month,'月') x,round(CellValue/t2.`value`*100,2) value from (select month,year,sum(CellValue) CellValue from report_original_income t1 inner join cof_drugtype t2 on t1.TypeName = t2.Charge and t1.AllotID = t2.AllotId and t2.ChargeType = '药' where HospitalID = @hospitalId {where} group by month,year) t1 inner join (select month,year,sum(CellValue) value from report_original_income where hospitalid = @hospitalId {where} group by month,year)t2 on t1.`month`=t2.`month` and t1.year = t2.year order by x asc;";
return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList(); return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList();
} }
...@@ -273,9 +273,9 @@ public List<PerReport> MaterialRatio(ReportRequest request) ...@@ -273,9 +273,9 @@ public List<PerReport> MaterialRatio(ReportRequest request)
{ {
where += $" and month in ({request.Month}) "; where += $" and month in ({request.Month}) ";
} }
string sql = $"select '材料占比(年)' y,concat(t1.y,'年') x,round(CellValue/t2.`value`*100,2) value from (select year y,sum(CellValue) CellValue from report_original_income t1 inner join cof_drugtype t2 on t1.TypeName = t2.Charge and t1.AllotID = t2.AllotId and t2.ChargeType = '耗材' where HospitalID = @hospitalId {where} group by year) t1 inner join (select year y,sum(CellValue) value from report_original_income where hospitalid = @hospitalId {where} group by year)t2 on t1.y = t2.y order by x asc;"; string sql = $"select '材料占比(年)' y,concat(t1.y,'年') x,round(CellValue/t2.`value`*100,2) value from (select year y,sum(CellValue) CellValue from report_original_income t1 inner join cof_drugtype t2 on t1.TypeName = t2.Charge and t1.AllotID = t2.AllotId and t2.ChargeType = '材料费' where HospitalID = @hospitalId {where} group by year) t1 inner join (select year y,sum(CellValue) value from report_original_income where hospitalid = @hospitalId {where} group by year)t2 on t1.y = t2.y order by x asc;";
if (request.OnlyYear != 1) if (request.OnlyYear != 1)
sql = $"select concat(t1.year,'年') y,concat(t1.month,'月') x,round(CellValue/t2.`value`*100,2) value from (select month,year,sum(CellValue) CellValue from report_original_income t1 inner join cof_drugtype t2 on t1.TypeName = t2.Charge and t1.AllotID = t2.AllotId and t2.ChargeType = '耗材' where HospitalID = @hospitalId {where} group by month,year) t1 inner join (select month,year,sum(CellValue) value from report_original_income where hospitalid = @hospitalId {where} group by month,year)t2 on t1.`month`=t2.`month` and t1.year = t2.year order by x asc;"; sql = $"select concat(t1.year,'年') y,concat(t1.month,'月') x,round(CellValue/t2.`value`*100,2) value from (select month,year,sum(CellValue) CellValue from report_original_income t1 inner join cof_drugtype t2 on t1.TypeName = t2.Charge and t1.AllotID = t2.AllotId and t2.ChargeType = '材料费' where HospitalID = @hospitalId {where} group by month,year) t1 inner join (select month,year,sum(CellValue) value from report_original_income where hospitalid = @hospitalId {where} group by month,year)t2 on t1.`month`=t2.`month` and t1.year = t2.year order by x asc;";
return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList(); return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList();
} }
......
...@@ -503,7 +503,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid) ...@@ -503,7 +503,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
var incomeSheet = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.Income && t.SheetName.Contains("门诊") && t.SheetName.Contains("开单")); var incomeSheet = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.Income && t.SheetName.Contains("门诊") && t.SheetName.Contains("开单"));
var datalist = incomeSheet.PerData.Select(t => (PerData)t); var datalist = incomeSheet.PerData.Select(t => (PerData)t);
var drugtype = perforCofdrugtypeRepository.GetEntities(t => t.AllotID == allotid && t.ChargeType == "药")?.Select(t => t.Charge).ToList(); var drugtype = perforCofdrugtypeRepository.GetEntities(t => t.AllotID == allotid && t.ChargeType == "药")?.Select(t => t.Charge).ToList();
var drugData = datalist.Where(t => drugtype.Contains(t.TypeName)).GroupBy(t => t.AccountingUnit).Select(t => new { AccountingUnit = t.Key, SumValue = t.Sum(s => s.CellValue) }); var drugData = datalist.Where(t => drugtype.Contains(t.TypeName)).GroupBy(t => t.AccountingUnit).Select(t => new { AccountingUnit = t.Key, SumValue = t.Sum(s => s.CellValue) });
if (drugtype == null) if (drugtype == null)
......
...@@ -218,7 +218,9 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno ...@@ -218,7 +218,9 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
Number = group.Number, Number = group.Number,
PerforTotal = sumValue, PerforTotal = sumValue,
Avg = group.Number == 0 ? 0 : (sumValue / group.Number), Avg = group.Number == 0 ? 0 : (sumValue / group.Number),
Adjust = empolyee.Adjust Adjust = empolyee.Adjust,
Grant = empolyee.Management
}; };
compute.Efficiency = compute.Avg * (empolyee.Efficiency ?? 1); compute.Efficiency = compute.Avg * (empolyee.Efficiency ?? 1);
......
...@@ -344,7 +344,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a ...@@ -344,7 +344,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
Efficiency = effAvg * (empolyee.Efficiency ?? 1), Efficiency = effAvg * (empolyee.Efficiency ?? 1),
Scale = resAccount.PerforTotal * (empolyee.Scale ?? 1), Scale = resAccount.PerforTotal * (empolyee.Scale ?? 1),
Adjust = empolyee.Adjust, Adjust = empolyee.Adjust,
Remark = empolyees.Count() > 1 ? "特殊科室主任,共用核算单元" : "" Remark = empolyees.Count() > 1 ? "特殊科室主任,共用核算单元" : "",
Grant = empolyee.Management
}; };
//应发管理绩效 //应发管理绩效
compute.ShouldGiveFee = (compute.Efficiency + compute.Scale) * (empolyee.Management ?? 0); compute.ShouldGiveFee = (compute.Efficiency + compute.Scale) * (empolyee.Management ?? 0);
...@@ -390,7 +391,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -390,7 +391,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
AccountingUnit = item.AccountingUnit, AccountingUnit = item.AccountingUnit,
EmployeeName = item.DoctorName, EmployeeName = item.DoctorName,
FitPeople = item.FitPeople, FitPeople = item.FitPeople,
//Grant = item.Grant ?? 1, Grant = item.Management ?? 1,
WorkTime = item.WorkTime, WorkTime = item.WorkTime,
PostCoefficient = item.PostCoefficient, PostCoefficient = item.PostCoefficient,
Attendance = item.Attendance, Attendance = item.Attendance,
......
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