报表分析签字表汇总BUG修复

parent b4901199
...@@ -4,25 +4,26 @@ public class view_allot_sign_dept ...@@ -4,25 +4,26 @@ public class view_allot_sign_dept
{ {
public int HospitalId { get; set; } public int HospitalId { get; set; }
public int AllotID { get; set; } public int AllotID { get; set; }
public int Year { get; set; } public string Year { get; set; }
public int Month { get; set; } public string Month { get; set; }
public int UnitType { get; set; } public string Code { get; set; }
public int AccountingUnit { get; set; } public string UnitType { get; set; }
public int PerforFee { get; set; } public string AccountingUnit { get; set; }
public int WorkloadFee { get; set; } public decimal PerforFee { get; set; }
public int AssessBeforeOtherFee { get; set; } public decimal WorkloadFee { get; set; }
public int PerforTotal { get; set; } public decimal AssessBeforeOtherFee { get; set; }
public int ScoringAverage { get; set; } public decimal PerforTotal { get; set; }
public int Extra { get; set; } public decimal ScoringAverage { get; set; }
public int MedicineExtra { get; set; } public decimal Extra { get; set; }
public int MaterialsExtra { get; set; } public decimal MedicineExtra { get; set; }
public int AssessLaterOtherFee { get; set; } public decimal MaterialsExtra { get; set; }
public int AssessLaterPerforTotal { get; set; } public decimal AssessLaterOtherFee { get; set; }
public int AdjustFactor { get; set; } public decimal AssessLaterPerforTotal { get; set; }
public int AdjustLaterOtherFee { get; set; } public decimal AdjustFactor { get; set; }
public int AprPerforAmount { get; set; } public decimal AdjustLaterOtherFee { get; set; }
public int HideAprOtherPerforAmount { get; set; } public decimal AprPerforAmount { get; set; }
public int AssessLaterManagementFee { get; set; } public decimal HideAprOtherPerforAmount { get; set; }
public int RealGiveFee { get; set; } public decimal AssessLaterManagementFee { get; set; }
public decimal RealGiveFee { get; set; }
} }
} }
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class view_allot_sign_emp public class view_allot_sign_emp_finance
{ {
public int HospitalID { get; set; } public string HospitalID { get; set; }
public int Year { get; set; } public string Year { get; set; }
public int Month { get; set; } public string Month { get; set; }
public int Source { get; set; } public string AllotId { get; set; }
public int AllotId { get; set; }
public int SecondId { get; set; }
public int States { get; set; }
public string UnitType { get; set; }
public string Code { get; set; }
public string AccountingUnit { get; set; }
public string IsShowManage { get; set; }
public string EmployeeName { get; set; }
public string JobNumber { get; set; } public string JobNumber { get; set; }
public string EmployeeName { get; set; }
public string JobTitle { get; set; } public string JobTitle { get; set; }
public string Emp_UnitType { get; set; } public string Code { get; set; }
public string Emp_AccountingUnit { get; set; } public string UnitType { get; set; }
public string AccountingUnit { get; set; }
public string BankCard { get; set; } public string BankCard { get; set; }
public string Batch { get; set; }
public string JobCategory { get; set; } public string JobCategory { get; set; }
public string Duty { get; set; } public string Duty { get; set; }
public string TitlePosition { get; set; } public string TitlePosition { get; set; }
public string PerforSumFee { get; set; } public decimal PerforSumFee { get; set; }
public decimal PerforManagementFee { get; set; } public decimal PerforManagementFee { get; set; }
public decimal NightWorkPerfor { get; set; } public decimal NightWorkPerfor { get; set; }
public decimal AdjustLaterOtherFee { get; set; } public decimal AdjustLaterOtherFee { get; set; }
...@@ -33,4 +26,15 @@ public class view_allot_sign_emp ...@@ -33,4 +26,15 @@ public class view_allot_sign_emp
public decimal ReservedRatioFee { get; set; } public decimal ReservedRatioFee { get; set; }
public decimal RealGiveFee { get; set; } public decimal RealGiveFee { get; set; }
} }
public class view_allot_sign_emp : view_allot_sign_emp_finance
{
public int Source { get; set; }
public int SecondId { get; set; }
public int States { get; set; }
public string IsShowManage { get; set; }
public string Emp_UnitType { get; set; }
public string Emp_AccountingUnit { get; set; }
public string Batch { get; set; }
}
} }
...@@ -418,7 +418,8 @@ public List<dynamic> QueryComputeByDate(string viewName, BeginEndTime request) ...@@ -418,7 +418,8 @@ public List<dynamic> QueryComputeByDate(string viewName, BeginEndTime request)
if (!string.IsNullOrEmpty(request.SortBy)) if (!string.IsNullOrEmpty(request.SortBy))
sql += $" order by {request.SortBy} "; sql += $" order by {request.SortBy} ";
else
sql += $" order by hospitalid,code,unittype,accountingunit";
return DapperQuery<dynamic>(sql, new { beginTime = request.BeginTime, endTime = request.EndTime }).ToList(); return DapperQuery<dynamic>(sql, new { beginTime = request.BeginTime, endTime = request.EndTime }).ToList();
} }
...@@ -432,16 +433,16 @@ public List<dynamic> QueryComputeByDateAndTotal(string viewName, HospitalGrantSu ...@@ -432,16 +433,16 @@ public List<dynamic> QueryComputeByDateAndTotal(string viewName, HospitalGrantSu
Dictionary<string, List<string>> dict = new Dictionary<string, List<string>> Dictionary<string, List<string>> dict = new Dictionary<string, List<string>>
{ {
{ "view_allot_sign_emp_group", new List<string>{ /* "year", "month", "allotid", "secondid",*/ "hospitalid", "source", "states", "unittype", "code", "accountingunit", "isshowmanage", "employeename", "jobnumber", "jobtitle", "emp_unittype", "emp_accountingunit", "bankcard", "batch", "jobcategory", "duty", "titleposition" } }, { "view_allot_sign_emp_group", new List<string>{ "hospitalid", "code", "unittype", "accountingunit", "source", "jobnumber", "employeename", "jobtitle", "bankcard", "batch", "jobcategory", "duty", "titleposition" } },
{ "view_allot_sign_emp_sum", new List<string>{ "perforsumfee", "performanagementfee", "nightworkperfor", "adjustlaterotherfee", "otherperfor", "hideotherperfor", "shouldgivefee", "reservedratiofee", "realgivefee" } }, { "view_allot_sign_emp_sum", new List<string>{ "perforsumfee", "performanagementfee", "nightworkperfor", "adjustlaterotherfee", "otherperfor", "hideotherperfor", "shouldgivefee", "reservedratiofee", "realgivefee" } },
{ "view_allot_sign_dept_group", new List<string>{ "hospitalid",/* "allotid", "year", "month", */"unittype", "code", "accountingunit" } }, { "view_allot_sign_dept_group", new List<string>{ "hospitalid", "code", "unittype", "accountingunit" } },
{ "view_allot_sign_dept_sum", new List<string>{ "perforfee", "workloadfee", "assessbeforeotherfee", "perfortotal", "scoringaverage", "extra", "medicineextra", "materialsextra", "assesslaterotherfee", "assesslaterperfortotal", "adjustfactor", "adjustlaterotherfee", "aprperforamount", "hideaprotherperforamount", "assesslatermanagementfee", "realgivefee" } }, { "view_allot_sign_dept_sum", new List<string>{ "perforfee", "workloadfee", "assessbeforeotherfee", "perfortotal", "scoringaverage", "extra", "medicineextra", "materialsextra", "assesslaterotherfee", "assesslaterperfortotal", "adjustfactor", "adjustlaterotherfee", "aprperforamount", "hideaprotherperforamount", "assesslatermanagementfee", "realgivefee" } },
{ "view_allot_sign_emp_finance_group", new List<string>{ "hospitalid",/* "year", "month", "allotid",*/ "jobnumber", "employeename", "jobtitle", "unittype", "code", "accountingunit", "bankcard", "jobcategory", "duty", "titleposition" } }, { "view_allot_sign_emp_finance_group", new List<string>{ "hospitalid", "code", "unittype", "accountingunit","jobnumber", "employeename", } },
{ "view_allot_sign_emp_finance_sum", new List<string>{ "perforsumfee", "performanagementfee", "nightworkperfor", "adjustlaterotherfee", "otherperfor", "hideotherperfor", "shouldgivefee", "reservedratiofee", "realgivefee" } }, { "view_allot_sign_emp_finance_sum", new List<string>{ "perforsumfee", "performanagementfee", "nightworkperfor", "adjustlaterotherfee", "otherperfor", "hideotherperfor", "shouldgivefee", "reservedratiofee", "realgivefee" } },
}; };
request.GroupBy.Remove(""); request.GroupBy.Remove("");
if (request.SumBy == null || !request.SumBy.Any(t => !string.IsNullOrEmpty(t))) request.SumBy = dict[viewName + "_sum"]; if (request.SumBy == null || !request.SumBy.Any(t => !string.IsNullOrEmpty(t))) request.SumBy = dict[viewName + "_sum"];
...@@ -453,22 +454,11 @@ public List<dynamic> QueryComputeByDateAndTotal(string viewName, HospitalGrantSu ...@@ -453,22 +454,11 @@ public List<dynamic> QueryComputeByDateAndTotal(string viewName, HospitalGrantSu
if (!string.IsNullOrEmpty(request.SortBy)) if (!string.IsNullOrEmpty(request.SortBy))
sql += $" order by {request.SortBy} "; sql += $" order by {request.SortBy} ";
else
sql += $" order by hospitalid,code,unittype,accountingunit";
if (request.GroupBy == null || !request.GroupBy.Any(t => !string.IsNullOrEmpty(t))) /*request.GroupBy = dict[viewName + "_group"];*/ if (request.GroupBy == null || !request.GroupBy.Any(t => !string.IsNullOrEmpty(t))) /*request.GroupBy = dict[viewName + "_group"];*/
{ {
switch (viewName) sql = $"select {string.Join(",", dict[viewName + "_group"])}, {string.Join(",", request.SumBy.Select(t => $"sum({t}) {t}"))} from ({sql}) tab group by {string.Join(",", dict[viewName + "_group"])}";
{
case "view_allot_sign_emp":
request.GroupBy.AddRange(new[] { "Source", "UnitType", "AccountingUnit", "JobNumber", "EmployeeName", "JobCategory" });
break;
case "view_allot_sign_dept":
request.GroupBy.AddRange(new[] { "UnitType", "AccountingUnit" });
break;
case "view_allot_sign_emp_finance":
request.GroupBy.AddRange(new[] { "UnitType", "AccountingUnit", "JobNumber", "EmployeeName" });
break;
}
sql = $"select {string.Join(",", dict[viewName + "_group"])}, {string.Join(",", request.SumBy.Select(t => $"sum({t}) {t}"))} from ({sql}) tab group by {string.Join(",", request.GroupBy)}";
} }
else else
{ {
......
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