Commit 2aebe274 by ruyun.zhang@suvalue.com

V20200414正式版发布

文本修改
parents 12a2b71e cccf0e4a
...@@ -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": {
//登录过期时间 //登录过期时间
......
...@@ -483,6 +483,11 @@ ...@@ -483,6 +483,11 @@
岗位系数 岗位系数
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ComputeResult.Grant">
<summary>
发放系数(来自人员名单)
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResult.ShouldGiveFee"> <member name="P:Performance.DtoModels.ComputeResult.ShouldGiveFee">
<summary> <summary>
应发管理绩效(需计算) 应发管理绩效(需计算)
...@@ -558,6 +563,21 @@ ...@@ -558,6 +563,21 @@
工号 工号
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ComputeResult.ManagerNumber">
<summary>
科主任/护士长人数
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResult.MedicalNumber">
<summary>
核算单元人员数量
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResult.PermanentStaff">
<summary>
效率绩效人数
</summary>
</member>
<member name="T:Performance.DtoModels.UnitType"> <member name="T:Performance.DtoModels.UnitType">
<summary> 核算单元类型 </summary> <summary> 核算单元类型 </summary>
</member> </member>
...@@ -874,7 +894,7 @@ ...@@ -874,7 +894,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 +994,7 @@ ...@@ -974,7 +994,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">
...@@ -2471,6 +2491,21 @@ ...@@ -2471,6 +2491,21 @@
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.ResComputeResponse.ManagerNumber">
<summary>
科主任/护士长人数
</summary>
</member>
<member name="P:Performance.DtoModels.ResComputeResponse.MedicalNumber">
<summary>
核算单元人员数量
</summary>
</member>
<member name="P:Performance.DtoModels.ResComputeResponse.PermanentStaff">
<summary>
效率绩效人数
</summary>
</member>
<member name="P:Performance.DtoModels.RoleResponse.RoleName"> <member name="P:Performance.DtoModels.RoleResponse.RoleName">
<summary> <summary>
角色名称 角色名称
......
...@@ -3318,6 +3318,21 @@ ...@@ -3318,6 +3318,21 @@
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.res_compute.ManagerNumber">
<summary>
科主任/护士长人数
</summary>
</member>
<member name="P:Performance.EntityModels.res_compute.MedicalNumber">
<summary>
核算单元人员数量
</summary>
</member>
<member name="P:Performance.EntityModels.res_compute.PermanentStaff">
<summary>
效率绩效人数
</summary>
</member>
<member name="T:Performance.EntityModels.res_specialunit"> <member name="T:Performance.EntityModels.res_specialunit">
<summary> <summary>
......
...@@ -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>
/// 应发管理绩效(需计算) /// 应发管理绩效(需计算)
...@@ -143,5 +143,20 @@ public class ComputeResult ...@@ -143,5 +143,20 @@ public class ComputeResult
///// 工作量绩效 ///// 工作量绩效
///// </summary> ///// </summary>
//public decimal? Workload { get; set; } //public decimal? Workload { get; set; }
/// <summary>
/// 科主任/护士长人数
/// </summary>
public Nullable<decimal> ManagerNumber { get; set; }
/// <summary>
/// 核算单元人员数量
/// </summary>
public Nullable<decimal> MedicalNumber { get; set; }
/// <summary>
/// 效率绩效人数
/// </summary>
public Nullable<decimal> PermanentStaff { get; set; }
} }
} }
...@@ -23,8 +23,8 @@ public enum UnitType ...@@ -23,8 +23,8 @@ public enum UnitType
医技组 = 3, 医技组 = 3,
[Description("专家组")] [Description("专家组")]
专家组 = 4, 专家组 = 4,
[Description("其他")] [Description("其他")]
其他 = 5, 其他 = 5,
[Description("特殊核算组")] [Description("特殊核算组")]
特殊核算组 = 6, 特殊核算组 = 6,
} }
......
...@@ -32,7 +32,7 @@ public class PerDataClinicEmployee : IPerData ...@@ -32,7 +32,7 @@ public class PerDataClinicEmployee : IPerData
public string DoctorName { get; set; } public string DoctorName { get; set; }
/// <summary> /// <summary>
/// 职 /// 职务分类
/// </summary> /// </summary>
public string JobTitle { get; set; } public string JobTitle { get; set; }
......
...@@ -42,7 +42,7 @@ public class PerDataEmployee : IPerData ...@@ -42,7 +42,7 @@ public class PerDataEmployee : IPerData
public string DoctorName { get; set; } public string DoctorName { get; set; }
/// <summary> /// <summary>
/// 职 /// 职务分类
/// </summary> /// </summary>
public string JobTitle { get; set; } public string JobTitle { get; set; }
......
...@@ -150,5 +150,20 @@ public class ResComputeResponse ...@@ -150,5 +150,20 @@ public class ResComputeResponse
/// ///
/// </summary> /// </summary>
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 科主任/护士长人数
/// </summary>
public Nullable<decimal> ManagerNumber { get; set; }
/// <summary>
/// 核算单元人员数量
/// </summary>
public Nullable<decimal> MedicalNumber { get; set; }
/// <summary>
/// 效率绩效人数
/// </summary>
public Nullable<decimal> PermanentStaff { get; set; }
} }
} }
...@@ -7,168 +7,183 @@ ...@@ -7,168 +7,183 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels namespace Performance.EntityModels
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
[Table("res_compute")] [Table("res_compute")]
public class res_compute public class res_compute
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
[Key] [Key]
public int ID { get; set; } public int ID { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public Nullable<int> AllotID { get; set; } public Nullable<int> AllotID { get; set; }
/// <summary> /// <summary>
/// sheet页id /// sheet页id
/// </summary> /// </summary>
public Nullable<int> SheetID { get; set; } public Nullable<int> SheetID { get; set; }
/// <summary> /// <summary>
/// 核算单元类型(医技科室、临床科室等) /// 核算单元类型(医技科室、临床科室等)
/// </summary> /// </summary>
public string AccountType { get; set; } public string AccountType { get; set; }
/// <summary> /// <summary>
/// 核算单元 /// 核算单元
/// </summary> /// </summary>
public string AccountingUnit { get; set; } public string AccountingUnit { get; set; }
/// <summary> /// <summary>
/// 绩效基数核算参考对象 /// 绩效基数核算参考对象
/// </summary> /// </summary>
public string FitPeople { get; set; } public string FitPeople { get; set; }
/// <summary> /// <summary>
/// 人员姓名 /// 人员姓名
/// </summary> /// </summary>
public string EmployeeName { get; set; } public string EmployeeName { get; set; }
/// <summary> /// <summary>
/// 职称 /// 职称
/// </summary> /// </summary>
public string JobTitle { get; set; } public string JobTitle { get; set; }
/// <summary> /// <summary>
/// 工号 /// 工号
/// </summary> /// </summary>
public string JobNumber { get; set; } public string JobNumber { get; set; }
/// <summary> /// <summary>
/// 绩效合计(来自科室经济测算表) /// 绩效合计(来自科室经济测算表)
/// </summary> /// </summary>
public Nullable<decimal> PerforTotal { get; set; } public Nullable<decimal> PerforTotal { get; set; }
/// <summary> /// <summary>
/// 核算单元医生数量(来自科室经济测算表) /// 核算单元医生数量(来自科室经济测算表)
/// </summary> /// </summary>
public Nullable<decimal> Number { get; set; } public Nullable<decimal> Number { get; set; }
/// <summary> /// <summary>
/// 人均绩效(来自科室经济测算表) /// 人均绩效(来自科室经济测算表)
/// </summary> /// </summary>
public Nullable<decimal> Avg { get; set; } public Nullable<decimal> Avg { get; set; }
/// <summary> /// <summary>
/// 效率绩效(需计算) /// 效率绩效(需计算)
/// </summary> /// </summary>
public Nullable<decimal> Efficiency { get; set; } public Nullable<decimal> Efficiency { get; set; }
/// <summary> /// <summary>
/// 规模绩效(需计算) /// 规模绩效(需计算)
/// </summary> /// </summary>
public Nullable<decimal> Scale { get; set; } public Nullable<decimal> Scale { get; set; }
/// <summary> /// <summary>
/// 岗位系数 /// 岗位系数
/// </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>
/// 应发管理绩效(需计算,科主任护士长独有) /// 应发管理绩效(需计算,科主任护士长独有)
/// </summary> /// </summary>
public Nullable<decimal> ShouldGiveFee { get; set; } public Nullable<decimal> ShouldGiveFee { get; set; }
/// <summary> /// <summary>
/// 绩效合计(需计算) /// 绩效合计(需计算)
/// </summary> /// </summary>
public Nullable<decimal> PerforSumFee { get; set; } public Nullable<decimal> PerforSumFee { get; set; }
/// <summary> /// <summary>
/// 考核对分率(来自人员名单) /// 考核对分率(来自人员名单)
/// </summary> /// </summary>
public Nullable<decimal> ScoreAverageRate { get; set; } public Nullable<decimal> ScoreAverageRate { get; set; }
/// <summary> /// <summary>
/// 医院奖罚(来自人员名单) /// 医院奖罚(来自人员名单)
/// </summary> /// </summary>
public Nullable<decimal> Punishment { get; set; } public Nullable<decimal> Punishment { get; set; }
/// <summary> /// <summary>
/// 其他绩效(来自人员名单) /// 其他绩效(来自人员名单)
/// </summary> /// </summary>
public Nullable<decimal> OtherPerfor { get; set; } public Nullable<decimal> OtherPerfor { get; set; }
/// <summary> /// <summary>
/// 应发绩效(需计算) /// 应发绩效(需计算)
/// </summary> /// </summary>
public Nullable<decimal> GiveFee { get; set; } public Nullable<decimal> GiveFee { get; set; }
/// <summary> /// <summary>
/// 出勤率(来自人员名单) /// 出勤率(来自人员名单)
/// </summary> /// </summary>
public Nullable<decimal> Attendance { get; set; } public Nullable<decimal> Attendance { get; set; }
/// <summary> /// <summary>
/// 参加工作时间(来自人员名单) /// 参加工作时间(来自人员名单)
/// </summary> /// </summary>
public Nullable<DateTime> WorkTime { get; set; } public Nullable<DateTime> WorkTime { get; set; }
/// <summary> /// <summary>
/// 绩效基础金额(计算) /// 绩效基础金额(计算)
/// </summary> /// </summary>
public Nullable<decimal> BaiscNormValue { get; set; } public Nullable<decimal> BaiscNormValue { get; set; }
/// <summary> /// <summary>
/// 年资系数(来自人员名单) /// 年资系数(来自人员名单)
/// </summary> /// </summary>
public Nullable<decimal> WorkYear { get; set; } public Nullable<decimal> WorkYear { get; set; }
/// <summary> /// <summary>
/// 调节系数 /// 调节系数
/// </summary> /// </summary>
public Nullable<decimal> Adjust { get; set; } public Nullable<decimal> Adjust { get; set; }
/// <summary> /// <summary>
/// 工作量绩效 /// 工作量绩效
/// </summary> /// </summary>
public Nullable<decimal> Workload { get; set; } public Nullable<decimal> Workload { get; set; }
/// <summary> /// <summary>
/// 实发绩效 /// 实发绩效
/// </summary> /// </summary>
public Nullable<decimal> RealGiveFee { get; set; } public Nullable<decimal> RealGiveFee { get; set; }
/// <summary> /// <summary>
/// 变更日志 /// 变更日志
/// </summary> /// </summary>
public string ChangeLog { get; set; } public string ChangeLog { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 科主任/护士长人数
/// </summary>
public Nullable<decimal> ManagerNumber { get; set; }
/// <summary>
/// 核算单元人员数量
/// </summary>
public Nullable<decimal> MedicalNumber { get; set; }
/// <summary>
/// 效率绩效人数
/// </summary>
public Nullable<decimal> PermanentStaff { get; set; }
} }
} }
...@@ -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();
...@@ -94,9 +94,9 @@ public List<PerReport> Income(int hospitalId, List<string> date) ...@@ -94,9 +94,9 @@ public List<PerReport> Income(int hospitalId, List<string> date)
/// <returns></returns> /// <returns></returns>
public List<PerReport> InHosIncome(int hospitalId, string currentDate) public List<PerReport> InHosIncome(int hospitalId, string currentDate)
{ {
string sql = $"select '{currentDate}' x,'住院收入占比' y,round(t.InHos/(t.InHos+t.Outpatient) * 100, 2) value from (select year,month,sum(case SourceType when '住院' then CellValue else 0 end) InHos,sum(case SourceType when '门诊' then CellValue else 0 end) Outpatient from report_original_income where hospitalid = @hospitalId and concat(year,'-',lpad(month,2,'0')) = '{currentDate}' group by year,month)t" + string sql = $"select '{currentDate}' x,'住院收入占比' y,round(t.InHos/(t.InHos+t.Outpatient) * 100, 2) value from (select year,month,sum(case SourceType when '住院' then CellValue else 0 end) InHos,sum(case SourceType when '门诊' then CellValue else 0 end) Outpatient from view_report_original_income where hospitalid = @hospitalId and concat(year,'-',lpad(month,2,'0')) = '{currentDate}' group by year,month)t" +
$" union " + $" union " +
$"select '{currentDate}' x,'门诊收入占比' y,round(t.Outpatient/(t.InHos+t.Outpatient) * 100, 2) value from (select year,month,sum(case SourceType when '住院' then CellValue else 0 end) InHos,sum(case SourceType when '门诊' then CellValue else 0 end) Outpatient from report_original_income where hospitalid = @hospitalId and concat(year,'-',lpad(month,2,'0')) = '{currentDate}' group by year,month)t;"; $"select '{currentDate}' x,'门诊收入占比' y,round(t.Outpatient/(t.InHos+t.Outpatient) * 100, 2) value from (select year,month,sum(case SourceType when '住院' then CellValue else 0 end) InHos,sum(case SourceType when '门诊' then CellValue else 0 end) Outpatient from view_report_original_income where hospitalid = @hospitalId and concat(year,'-',lpad(month,2,'0')) = '{currentDate}' group by year,month)t;";
return DapperQuery(sql, new { hospitalId }).ToList(); return DapperQuery(sql, new { hospitalId }).ToList();
} }
...@@ -109,7 +109,7 @@ public List<PerReport> InHosIncome(int hospitalId, string currentDate) ...@@ -109,7 +109,7 @@ public List<PerReport> InHosIncome(int hospitalId, string currentDate)
/// <returns></returns> /// <returns></returns>
public List<PerReport> PerforPayment(int hospitalId, string currentDate, string yoyDate, string chainDate) public List<PerReport> PerforPayment(int hospitalId, string currentDate, string yoyDate, string chainDate)
{ {
string sql = $"select '{currentDate}' x,t1.y,ifnull(t2.RealGiveFee, 0.0000) value from (select '{currentDate}' x,'当月发放金额' y union select '{yoyDate}' x,'同期发放金额' y union select '{chainDate}' x,'环比发放金额' y)t1 left join report_allot_summary t2 on t1.x = concat(t2.year,'-',lpad(t2.month,2,'0')) and t2.HospitalId = @hospitalId order by y;"; string sql = $"select '{currentDate}' x,t1.y,ifnull(t2.RealGiveFee, 0.0000) value from (select '{currentDate}' x,'当月发放金额' y union select '{yoyDate}' x,'同期发放金额' y union select '{chainDate}' x,'环比发放金额' y)t1 left join view_report_allot_summary t2 on t1.x = concat(t2.year,'-',lpad(t2.month,2,'0')) and t2.HospitalId = @hospitalId order by y;";
return DapperQuery(sql, new { hospitalId }).ToList(); return DapperQuery(sql, new { hospitalId }).ToList();
} }
...@@ -122,7 +122,7 @@ public List<PerReport> PerforPayment(int hospitalId, string currentDate, string ...@@ -122,7 +122,7 @@ public List<PerReport> PerforPayment(int hospitalId, string currentDate, string
/// <returns></returns> /// <returns></returns>
public List<PerReport> IndexPerforRatio(int hospitalId, string currentDate, string yoyDate, string chainDate) public List<PerReport> IndexPerforRatio(int hospitalId, string currentDate, string yoyDate, string chainDate)
{ {
string sql = $"select '{currentDate}' x,t1.y, round(ifnull(t2.RealGiveFee, 0.0000)/t3.income*100, 2)value from(select '{currentDate}' x,'当月发放占比' y union select '{yoyDate}' x,'同期发放占比' y union select '{chainDate}' x,'环比发放占比' y)t1 left join report_allot_summary t2 on t1.x = concat(t2.year,'-', lpad(t2.month,2,'0')) and t2.HospitalId = @hospitalId left join (select year, month, sum(CellValue) income from report_original_income where HospitalId = @hospitalId group by year, month)t3 on t1.x = concat(t3.year,'-', lpad(t3.month,2,'0')) order by y;"; string sql = $"select '{currentDate}' x,t1.y, round(ifnull(t2.RealGiveFee, 0.0000)/t3.income*100, 2)value from(select '{currentDate}' x,'当月发放占比' y union select '{yoyDate}' x,'同期发放占比' y union select '{chainDate}' x,'环比发放占比' y)t1 left join view_report_allot_summary t2 on t1.x = concat(t2.year,'-', lpad(t2.month,2,'0')) and t2.HospitalId = @hospitalId left join (select year, month, sum(CellValue) income from view_report_original_income where HospitalId = @hospitalId group by year, month)t3 on t1.x = concat(t3.year,'-', lpad(t3.month,2,'0')) order by y;";
return DapperQuery(sql, new { hospitalId }).ToList(); return DapperQuery(sql, new { hospitalId }).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 view_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 view_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 view_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 view_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();
} }
...@@ -160,7 +160,7 @@ public List<PerReport> IndexMaterialRatio(int hospitalId, string currentDate, st ...@@ -160,7 +160,7 @@ public List<PerReport> IndexMaterialRatio(int hospitalId, string currentDate, st
/// <returns></returns> /// <returns></returns>
public List<PerReport> IndexStructRatio(int hospitalId, string currentDate) public List<PerReport> IndexStructRatio(int hospitalId, string currentDate)
{ {
string sql = $"select TypeName y,t1.y x,round(CellValue/t2.`value`*100,2) value from (select '{currentDate}' y,TypeName,sum(CellValue) CellValue from report_original_income where HospitalID = @hospitalId and concat(year,'-',lpad(month,2,'0')) = '{currentDate}' group by TypeName) t1 inner join (select '{currentDate}' y,sum(CellValue) value from report_original_income where hospitalid = @hospitalId and concat(year,'-',lpad(month,2,'0')) = '{currentDate}')t2 on t1.y = t2.y order by value desc;"; string sql = $"select TypeName y,t1.y x,round(CellValue/t2.`value`*100,2) value from (select '{currentDate}' y,TypeName,sum(CellValue) CellValue from view_report_original_income where HospitalID = @hospitalId and concat(year,'-',lpad(month,2,'0')) = '{currentDate}' group by TypeName) t1 inner join (select '{currentDate}' y,sum(CellValue) value from view_report_original_income where hospitalid = @hospitalId and concat(year,'-',lpad(month,2,'0')) = '{currentDate}')t2 on t1.y = t2.y order by value desc;";
return DapperQuery(sql, new { hospitalId }).ToList(); return DapperQuery(sql, new { hospitalId }).ToList();
} }
#endregion #endregion
...@@ -181,9 +181,9 @@ public List<PerReport> GeneralIncome(ReportRequest request) ...@@ -181,9 +181,9 @@ public List<PerReport> GeneralIncome(ReportRequest request)
{ {
where += $" and month in ({request.Month}) "; where += $" and month in ({request.Month}) ";
} }
string sql = $"select concat(year,'年') x,'业务总收入(年)' y,sum(CellValue) value from report_original_income where hospitalid = @hospitalId {where} group by year order by x;"; string sql = $"select concat(year,'年') x,'业务总收入(年)' y,sum(CellValue) value from view_report_original_income where hospitalid = @hospitalId {where} group by year order by x;";
if (request.OnlyYear != 1) if (request.OnlyYear != 1)
sql = $"select concat(month,'月') x,concat(year,'年') y,sum(CellValue) value from report_original_income where hospitalid = @hospitalId {where} group by year,month order by x;"; sql = $"select concat(month,'月') x,concat(year,'年') y,sum(CellValue) value from view_report_original_income where hospitalid = @hospitalId {where} group by year,month order by x;";
return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList(); return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList();
} }
...@@ -202,13 +202,13 @@ public List<PerReport> InHosIncome(ReportRequest request) ...@@ -202,13 +202,13 @@ public List<PerReport> InHosIncome(ReportRequest request)
{ {
where += $" and month in ({request.Month}) "; where += $" and month in ({request.Month}) ";
} }
string sql = $"select * from (select '住院' y,concat(year,'年') x,round(t.InHos/(t.InHos + t.Outpatient) * 100, 2) value from (select year,sum(case SourceType when '住院' then CellValue else 0 end) InHos,sum(case SourceType when '门诊' then CellValue else 0 end) Outpatient from report_original_income where hospitalid = @hospitalId {where} group by year)t" + string sql = $"select * from (select '住院' y,concat(year,'年') x,round(t.InHos/(t.InHos + t.Outpatient) * 100, 2) value from (select year,sum(case SourceType when '住院' then CellValue else 0 end) InHos,sum(case SourceType when '门诊' then CellValue else 0 end) Outpatient from view_report_original_income where hospitalid = @hospitalId {where} group by year)t" +
$" union " + $" union " +
$"select '门诊' y,concat(year,'年') x,round(t.Outpatient/(t.InHos + t.Outpatient) * 100, 2) value from (select year,sum(case SourceType when '住院' then CellValue else 0 end) InHos,sum(case SourceType when '门诊' then CellValue else 0 end) Outpatient from report_original_income where hospitalid = @hospitalId {where} group by year)t)t order by t.x;"; $"select '门诊' y,concat(year,'年') x,round(t.Outpatient/(t.InHos + t.Outpatient) * 100, 2) value from (select year,sum(case SourceType when '住院' then CellValue else 0 end) InHos,sum(case SourceType when '门诊' then CellValue else 0 end) Outpatient from view_report_original_income where hospitalid = @hospitalId {where} group by year)t)t order by t.x;";
if (request.OnlyYear != 1) if (request.OnlyYear != 1)
sql = $"select * from (select '住院' y,concat(month,'月') x,round(t.InHos/(t.InHos+t.Outpatient) * 100, 2) value from (select year,month,sum(case SourceType when '住院' then CellValue else 0 end) InHos,sum(case SourceType when '门诊' then CellValue else 0 end) Outpatient from report_original_income where hospitalid = @hospitalId {where} group by month)t" + sql = $"select * from (select '住院' y,concat(month,'月') x,round(t.InHos/(t.InHos+t.Outpatient) * 100, 2) value from (select year,month,sum(case SourceType when '住院' then CellValue else 0 end) InHos,sum(case SourceType when '门诊' then CellValue else 0 end) Outpatient from view_report_original_income where hospitalid = @hospitalId {where} group by month)t" +
$" union " + $" union " +
$"select '门诊' y,concat(month,'月') x,round(t.Outpatient/(t.InHos+t.Outpatient) * 100, 2) value from (select year,month,sum(case SourceType when '住院' then CellValue else 0 end) InHos,sum(case SourceType when '门诊' then CellValue else 0 end) Outpatient from report_original_income where hospitalid = @hospitalId {where} group by month)t)t order by t.x;"; $"select '门诊' y,concat(month,'月') x,round(t.Outpatient/(t.InHos+t.Outpatient) * 100, 2) value from (select year,month,sum(case SourceType when '住院' then CellValue else 0 end) InHos,sum(case SourceType when '门诊' then CellValue else 0 end) Outpatient from view_report_original_income where hospitalid = @hospitalId {where} group by month)t)t order by t.x;";
return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList(); return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList();
} }
...@@ -227,9 +227,9 @@ public List<PerReport> StructRatio(ReportRequest request) ...@@ -227,9 +227,9 @@ public List<PerReport> StructRatio(ReportRequest request)
{ {
where += $" and month in ({request.Month}) "; where += $" and month in ({request.Month}) ";
} }
string sql = $"select TypeName y,concat(t1.y,'年') x,round(CellValue/t2.`value`*100,2) value from (select year y,TypeName,sum(CellValue) CellValue from report_original_income where HospitalID = @hospitalId {where} group by year,TypeName) 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,value desc;"; string sql = $"select TypeName y,concat(t1.y,'年') x,round(CellValue/t2.`value`*100,2) value from (select year y,TypeName,sum(CellValue) CellValue from view_report_original_income where HospitalID = @hospitalId {where} group by year,TypeName) t1 inner join (select year y,sum(CellValue) value from view_report_original_income where hospitalid = @hospitalId {where} group by year)t2 on t1.y = t2.y order by x asc,value desc;";
if (request.OnlyYear != 1) if (request.OnlyYear != 1)
sql = $"select TypeName y,concat(t1.y,'月') x,round(CellValue/t2.`value`*100,2) value from (select month y,TypeName,sum(CellValue) CellValue from report_original_income where HospitalID = @hospitalId {where} group by month,TypeName) t1 inner join (select month y,sum(CellValue) value from report_original_income where hospitalid = @hospitalId {where} group by month)t2 on t1.y = t2.y order by x asc,value desc;"; sql = $"select TypeName y,concat(t1.y,'月') x,round(CellValue/t2.`value`*100,2) value from (select month y,TypeName,sum(CellValue) CellValue from view_report_original_income where HospitalID = @hospitalId {where} group by month,TypeName) t1 inner join (select month y,sum(CellValue) value from view_report_original_income where hospitalid = @hospitalId {where} group by month)t2 on t1.y = t2.y order by x asc,value desc;";
return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList(); return DapperQuery(sql, new { hospitalId = request.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 view_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 view_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 view_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 view_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 view_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 view_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 view_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 view_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();
} }
...@@ -296,9 +296,9 @@ public List<PerReport> PerforRatio(ReportRequest request) ...@@ -296,9 +296,9 @@ public List<PerReport> PerforRatio(ReportRequest request)
{ {
where += $" and month in ({request.Month}) "; where += $" and month in ({request.Month}) ";
} }
string sql = $"select concat(t2.x,'年') x,'绩效发放金额占全院收入占比(年)' y,round(t1.RealGiveFee/t2.income * 100, 2) value from (select `year`,sum(realgivefee) realgivefee from report_allot_summary where HospitalID = @hospitalId {where} group by year) t1 inner join (select year x,sum(CellValue) income from report_original_income where HospitalId = @hospitalId {where} group by year)t2 on t1.`Year` = t2.x order by x asc;"; string sql = $"select concat(t2.x,'年') x,'绩效发放金额占全院收入占比(年)' y,round(t1.RealGiveFee/t2.income * 100, 2) value from (select `year`,sum(realgivefee) realgivefee from view_report_allot_summary where HospitalID = @hospitalId {where} group by year) t1 inner join (select year x,sum(CellValue) income from view_report_original_income where HospitalId = @hospitalId {where} group by year)t2 on t1.`Year` = t2.x order by x asc;";
if (request.OnlyYear != 1) if (request.OnlyYear != 1)
sql = $"select concat(t2.month,'月') x,concat(t2.year,'年') y,round(t1.RealGiveFee/t2.income * 100, 2) value from (select `year`,`month`,sum(realgivefee) realgivefee from report_allot_summary where HospitalID = @hospitalId {where} group by year,month) t1 inner join (select `year`,`month`,sum(CellValue) income from report_original_income where HospitalId = @hospitalId {where} group by year,month)t2 on t1.month = t2.month and t1.year = t2.year order by x asc;"; sql = $"select concat(t2.month,'月') x,concat(t2.year,'年') y,round(t1.RealGiveFee/t2.income * 100, 2) value from (select `year`,`month`,sum(realgivefee) realgivefee from view_report_allot_summary where HospitalID = @hospitalId {where} group by year,month) t1 inner join (select `year`,`month`,sum(CellValue) income from view_report_original_income where HospitalId = @hospitalId {where} group by year,month)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();
} }
...@@ -319,9 +319,9 @@ public List<PerReport> PerforGroup(ReportRequest request) ...@@ -319,9 +319,9 @@ public List<PerReport> PerforGroup(ReportRequest request)
{ {
where += $" and month in ({request.Month}) "; where += $" and month in ({request.Month}) ";
} }
string sql = $"select PositionName y,concat(year,'年') x,round(sum(avgvalue), 2) value from (select t1.PositionName,year,AvgValue from res_baiscnorm t1 inner join per_allot t2 on t1.AllotID = t2.Id and t2.states in (6,8) and t2.HospitalId = @hospitalId {where} and locate('保底', t1.PositionName) = 0)t group by PositionName,year order by x asc,value desc;"; string sql = $"select PositionName y,concat(year,'年') x,round(sum(avgvalue), 2) value from (select t1.PositionName,year,AvgValue from res_baiscnorm t1 inner join per_allot t2 on t1.AllotID = t2.Id and t2.states in (6,8,10) and t2.HospitalId = @hospitalId {where} and locate('保底', t1.PositionName) = 0)t group by PositionName,year order by x asc,value desc;";
if (request.OnlyYear != 1) if (request.OnlyYear != 1)
sql = $"select PositionName y,concat(month,'月') x,round(sum(avgvalue), 2) value from (select t1.PositionName,month,AvgValue from res_baiscnorm t1 inner join per_allot t2 on t1.AllotID = t2.Id and t2.states in (6,8) and t2.HospitalId = @hospitalId {where} and locate('保底', t1.PositionName) = 0)t group by PositionName,month order by x asc,value desc;"; sql = $"select PositionName y,concat(month,'月') x,round(sum(avgvalue), 2) value from (select t1.PositionName,month,AvgValue from res_baiscnorm t1 inner join per_allot t2 on t1.AllotID = t2.Id and t2.states in (6,8,10) and t2.HospitalId = @hospitalId {where} and locate('保底', t1.PositionName) = 0)t group by PositionName,month order by x asc,value desc;";
return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList(); return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList();
} }
...@@ -342,9 +342,9 @@ public List<PerReport> DoctorAvg(ReportRequest request) ...@@ -342,9 +342,9 @@ public List<PerReport> DoctorAvg(ReportRequest request)
{ {
where += $" and t2.month in ({request.Month}) "; where += $" and t2.month in ({request.Month}) ";
} }
string sql = $"select concat(`Year`,'年') x,AccountingUnit y,round(sum(avg),2) value from (select t1.AccountingUnit,t1.Avg,t2.`Year`,t2.`Month`,t2.ID from res_account t1 inner join per_allot t2 on t1.AllotID = t2.ID and t2.states in (6,8) and t2.HospitalId = @hospitalId and t1.UnitType != 2 where 1=1 {where})t group by year,AccountingUnit order by x asc,value desc;"; string sql = $"select concat(`Year`,'年') x,AccountingUnit y,round(sum(avg),2) value from (select t1.AccountingUnit,t1.Avg,t2.`Year`,t2.`Month`,t2.ID from res_account t1 inner join per_allot t2 on t1.AllotID = t2.ID and t2.states in (6,8,10) and t2.HospitalId = @hospitalId and t1.UnitType != 2 where 1=1 {where})t group by year,AccountingUnit order by x asc,value desc;";
if (request.OnlyYear != 1) if (request.OnlyYear != 1)
sql = $"select concat(`Month`,'月') x,AccountingUnit y,round(sum(avg),2) value from (select t1.AccountingUnit,t1.Avg,t2.`Year`,t2.`Month`,t2.ID from res_account t1 inner join per_allot t2 on t1.AllotID = t2.ID and t2.states in (6,8) and t2.HospitalId = @hospitalId and t1.UnitType != 2 where 1=1 {where})t group by month,AccountingUnit order by x asc,value desc;"; sql = $"select concat(`Month`,'月') x,AccountingUnit y,round(sum(avg),2) value from (select t1.AccountingUnit,t1.Avg,t2.`Year`,t2.`Month`,t2.ID from res_account t1 inner join per_allot t2 on t1.AllotID = t2.ID and t2.states in (6,8,10) and t2.HospitalId = @hospitalId and t1.UnitType != 2 where 1=1 {where})t group by month,AccountingUnit order by x asc,value desc;";
return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList(); return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList();
} }
...@@ -365,9 +365,9 @@ public List<PerReport> NurseAvg(ReportRequest request) ...@@ -365,9 +365,9 @@ public List<PerReport> NurseAvg(ReportRequest request)
{ {
where += $" and t2.month in ({request.Month}) "; where += $" and t2.month in ({request.Month}) ";
} }
string sql = $"select concat(`Year`,'年') x,AccountingUnit y,round(sum(avg),2) value from (select t1.AccountingUnit,t1.Avg,t2.`Year`,t2.`Month`,t2.ID from res_account t1 inner join per_allot t2 on t1.AllotID = t2.ID and t2.states in (6,8) and t2.HospitalId = @hospitalId and t1.UnitType = 2 where 1=1 {where})t group by year,AccountingUnit order by x asc,value desc;"; string sql = $"select concat(`Year`,'年') x,AccountingUnit y,round(sum(avg),2) value from (select t1.AccountingUnit,t1.Avg,t2.`Year`,t2.`Month`,t2.ID from res_account t1 inner join per_allot t2 on t1.AllotID = t2.ID and t2.states in (6,8,10) and t2.HospitalId = @hospitalId and t1.UnitType = 2 where 1=1 {where})t group by year,AccountingUnit order by x asc,value desc;";
if (request.OnlyYear != 1) if (request.OnlyYear != 1)
sql = $"select concat(`Month`,'月') x,AccountingUnit y,round(sum(avg),2) value from (select t1.AccountingUnit,t1.Avg,t2.`Year`,t2.`Month`,t2.ID from res_account t1 inner join per_allot t2 on t1.AllotID = t2.ID and t2.states in (6,8) and t2.HospitalId = @hospitalId and t1.UnitType = 2 where 1=1 {where})t group by month,AccountingUnit order by x asc,value desc;"; sql = $"select concat(`Month`,'月') x,AccountingUnit y,round(sum(avg),2) value from (select t1.AccountingUnit,t1.Avg,t2.`Year`,t2.`Month`,t2.ID from res_account t1 inner join per_allot t2 on t1.AllotID = t2.ID and t2.states in (6,8,10) and t2.HospitalId = @hospitalId and t1.UnitType = 2 where 1=1 {where})t group by month,AccountingUnit order by x asc,value desc;";
return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList(); return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList();
} }
#endregion #endregion
......
...@@ -252,7 +252,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_ ...@@ -252,7 +252,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_
var pairs = new[] var pairs = new[]
{ {
new { Name = "医生组临床科室单元核算表", Data = doctorWorkloadData, SheetType = SheetType.ComputeDoctorAccount, UnitTypes = new List<UnitType> { UnitType.医生组, UnitType.医技组, UnitType.专家组, UnitType.其他 } }, new { Name = "医生组临床科室单元核算表", Data = doctorWorkloadData, SheetType = SheetType.ComputeDoctorAccount, UnitTypes = new List<UnitType> { UnitType.医生组, UnitType.医技组, UnitType.专家组, UnitType.其他 } },
new { Name = "护理组临床科室单元核算表", Data = nurseWorkloadData, SheetType = SheetType.ComputeNurseAccount, UnitTypes = new List<UnitType> { UnitType.护理组 } }, new { Name = "护理组临床科室单元核算表", Data = nurseWorkloadData, SheetType = SheetType.ComputeNurseAccount, UnitTypes = new List<UnitType> { UnitType.护理组 } },
}; };
List<PerSheet> result = new List<PerSheet>(); List<PerSheet> result = new List<PerSheet>();
...@@ -270,7 +270,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_ ...@@ -270,7 +270,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, List<res_
continue; continue;
var econDoctor = economicData.FirstOrDefault(t => t.UnitType == unitType.ToString() && t.AccountingUnit == dept.Department); var econDoctor = economicData.FirstOrDefault(t => t.UnitType == unitType.ToString() && t.AccountingUnit == dept.Department);
var workDoctor = info.Data.FirstOrDefault(t => t.UnitType == unitType.ToString() && t.AccountingUnit == dept.Department); var workDoctor = info.Data.FirstOrDefault(t => t.UnitType == unitType.ToString() && t.AccountingUnit == dept.Department);
if (UnitType.专家组 == unitType || UnitType.其他 == unitType) if (UnitType.专家组 == unitType || UnitType.其他 == unitType)
{ {
econDoctor = economicData.FirstOrDefault(t => t.AccountingUnit == dept.Department); econDoctor = economicData.FirstOrDefault(t => t.AccountingUnit == dept.Department);
workDoctor = info.Data.FirstOrDefault(t => t.AccountingUnit == dept.Department); workDoctor = info.Data.FirstOrDefault(t => t.AccountingUnit == dept.Department);
...@@ -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,8 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno ...@@ -218,7 +218,8 @@ 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);
......
...@@ -128,7 +128,7 @@ public List<DeptResponse> GetNursePerformance(int allotId) ...@@ -128,7 +128,7 @@ public List<DeptResponse> GetNursePerformance(int allotId)
/// <returns></returns> /// <returns></returns>
public List<DeptResponse> GetOtherPerformance(int allotId) public List<DeptResponse> GetOtherPerformance(int allotId)
{ {
var unitType = new List<int> { (int)UnitType.其他, (int)UnitType.专家组 }; var unitType = new List<int> { (int)UnitType.其他, (int)UnitType.专家组 };
var list = perforResaccountRepository.GetEntities(t => unitType.Contains(t.UnitType.Value) && t.AllotID == allotId)?.OrderBy(t => t.UnitType).ThenByDescending(t => t.AccountingUnit); var list = perforResaccountRepository.GetEntities(t => unitType.Contains(t.UnitType.Value) && t.AllotID == allotId)?.OrderBy(t => t.UnitType).ThenByDescending(t => t.AccountingUnit);
List<DeptResponse> other = Mapper.Map<List<DeptResponse>>(list); List<DeptResponse> other = Mapper.Map<List<DeptResponse>>(list);
other?.ForEach(t => t.UnitName = ((UnitType)t.UnitType).ToString()); other?.ForEach(t => t.UnitName = ((UnitType)t.UnitType).ToString());
...@@ -324,7 +324,7 @@ public DeptDataDetails DeptDetail(int accountId) ...@@ -324,7 +324,7 @@ public DeptDataDetails DeptDetail(int accountId)
Detail = new List<DetailDtos>() Detail = new List<DetailDtos>()
}; };
int type = doctor.UnitType.Value; int type = doctor.UnitType.Value;
if (type == (int)UnitType.专家组 || type == (int)UnitType.其他) if (type == (int)UnitType.专家组 || type == (int)UnitType.其他)
type = 1; type = 1;
var basicData = _perforImDataRepository.GetEntities(t => t.AllotID == doctor.AllotID && t.UnitType == type && t.AccountingUnit == doctor.AccountingUnit); var basicData = _perforImDataRepository.GetEntities(t => t.AllotID == doctor.AllotID && t.UnitType == type && t.AccountingUnit == doctor.AccountingUnit);
var persheet = _perforPerSheetRepository.GetEntities(t => t.AllotID == doctor.AllotID); var persheet = _perforPerSheetRepository.GetEntities(t => t.AllotID == doctor.AllotID);
......
...@@ -301,18 +301,34 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a ...@@ -301,18 +301,34 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a
var empolyee = empolyees.ElementAt(i); var empolyee = empolyees.ElementAt(i);
var resAccount = dataList.FirstOrDefault(t => ((UnitType)t.UnitType).ToString() == empolyee.UnitType && t.AccountingUnit == empolyee.AccountingUnit); var resAccount = dataList.FirstOrDefault(t => ((UnitType)t.UnitType).ToString() == empolyee.UnitType && t.AccountingUnit == empolyee.AccountingUnit);
if (resAccount == null) if (resAccount == null && empolyees.Count() > 1)
{ {
// 如果没有找到科室,则找相同用户的其他核算单元类型 // 如果没有找到科室,则找相同用户的其他核算单元类型
for (int j = 0; j < empolyees.Count(); j++) //for (int j = 0; j < empolyees.Count(); j++)
//{
// if (i == j) continue;
// var empolyee2 = empolyees.ElementAt(j);
// resAccount = dataList.FirstOrDefault(t => ((UnitType)t.UnitType).ToString() == empolyee2.UnitType && t.AccountingUnit == empolyee2.AccountingUnit);
// if (resAccount != null) continue;
//}
//if (resAccount == null) continue;
var unitTypes = new[]
{ {
if (i == j) continue; new { UnitType = new List<int>{ (int)UnitType.医生组, (int)UnitType.医技组 }, JobTitle = "主任" },
var empolyee2 = empolyees.ElementAt(j); new { UnitType = new List<int>{ (int)UnitType.护理组 }, JobTitle = "护士长" },
resAccount = dataList.FirstOrDefault(t => ((UnitType)t.UnitType).ToString() == empolyee2.UnitType && t.AccountingUnit == empolyee2.AccountingUnit); };
if (resAccount != null) continue; foreach (var type in unitTypes)
{
if (empolyee.JobTitle.IndexOf(type.JobTitle) == -1) continue;
foreach (var item in type.UnitType)
{
resAccount = dataList.FirstOrDefault(t => t.UnitType == item && t.AccountingUnit == empolyee.AccountingUnit);
if (resAccount != null) continue;
}
} }
if (resAccount == null) continue;
} }
if (resAccount == null) continue;
var basicRule = basicRuleList.FirstOrDefault(t => t.UnitType == (UnitType)resAccount.UnitType); var basicRule = basicRuleList.FirstOrDefault(t => t.UnitType == (UnitType)resAccount.UnitType);
if (basicRule == null) continue; if (basicRule == null) continue;
...@@ -344,7 +360,11 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<im_a ...@@ -344,7 +360,11 @@ 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,
ManagerNumber = resAccount.ManagerNumber,
MedicalNumber = resAccount.Number,
PermanentStaff = resAccount.PermanentStaff
}; };
//应发管理绩效 //应发管理绩效
compute.ShouldGiveFee = (compute.Efficiency + compute.Scale) * (empolyee.Management ?? 0); compute.ShouldGiveFee = (compute.Efficiency + compute.Scale) * (empolyee.Management ?? 0);
...@@ -390,7 +410,7 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot ...@@ -390,7 +410,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,
......
...@@ -83,7 +83,7 @@ public SheetType GetSheetType(string sheetName) ...@@ -83,7 +83,7 @@ public SheetType GetSheetType(string sheetName)
{ {
if (sheetName.StartsWith("行政人员名单")) if (sheetName.StartsWith("行政人员名单"))
return SheetType.Employee; return SheetType.Employee;
else if (sheetName.StartsWith("临床人员名单")) else if (sheetName.StartsWith("业务中层"))
return SheetType.ClinicEmployee; return SheetType.ClinicEmployee;
else if (sheetName.StartsWith("1.0")) else if (sheetName.StartsWith("1.0"))
return SheetType.OtherIncome; return SheetType.OtherIncome;
......
...@@ -35,7 +35,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -35,7 +35,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue, Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue,
PersonnelNumber = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员工号").PointCell)?.StringCellValue, PersonnelNumber = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员工号").PointCell)?.StringCellValue,
DoctorName = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医生姓名").PointCell)?.StringCellValue, DoctorName = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医生姓名").PointCell)?.StringCellValue,
JobTitle = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "职").PointCell)?.StringCellValue, JobTitle = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "职务分类").PointCell)?.StringCellValue,
Basics = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "基础绩效系数").PointCell)?.NumericCellValue), Basics = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "基础绩效系数").PointCell)?.NumericCellValue),
PostCoefficient = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "岗位系数").PointCell)?.NumericCellValue), PostCoefficient = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "岗位系数").PointCell)?.NumericCellValue),
Efficiency = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "效率绩效系数").PointCell)?.NumericCellValue), Efficiency = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "效率绩效系数").PointCell)?.NumericCellValue),
......
...@@ -37,7 +37,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -37,7 +37,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue, Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue,
PersonnelNumber = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员工号").PointCell)?.StringCellValue, PersonnelNumber = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员工号").PointCell)?.StringCellValue,
DoctorName = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医生姓名").PointCell)?.StringCellValue, DoctorName = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医生姓名").PointCell)?.StringCellValue,
JobTitle = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "职").PointCell)?.StringCellValue, JobTitle = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "职务分类").PointCell)?.StringCellValue,
FitPeople = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "绩效基数核算参考对象").PointCell)?.StringCellValue, FitPeople = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "绩效基数核算参考对象").PointCell)?.StringCellValue,
FitPeopleRatio = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "绩效基数核算系数").PointCell)?.NumericCellValue), FitPeopleRatio = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "绩效基数核算系数").PointCell)?.NumericCellValue),
AccountType = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员分类").PointCell)?.StringCellValue, AccountType = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员分类").PointCell)?.StringCellValue,
......
...@@ -284,7 +284,7 @@ private void CommonExport(int sheetID, SheetExportResponse response) ...@@ -284,7 +284,7 @@ private void CommonExport(int sheetID, SheetExportResponse response)
{ {
var data = dataList.FirstOrDefault(t => t.RowNumber == rowNumber && t.SignID == head.SignID); var data = dataList.FirstOrDefault(t => t.RowNumber == rowNumber && t.SignID == head.SignID);
var value = data?.CellValue; var value = data?.CellValue;
if (value.HasValue && value.Value > 0) if (value.HasValue)
rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1, data.IsTotal == 1, true, data.Annotation)); rowbody.Data.Add(new Cell(head.PointCell.Value, value, 1, 1, data.IsTotal == 1, true, data.Annotation));
} }
} }
......
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