功能完善

parent a8ab812c
......@@ -48,7 +48,7 @@ public ApiResponse Info([FromBody]SelectionRequest report)
[HttpPost]
public ApiResponse Search([FromBody]SearchReportRequest report)
{
var result = reportDataService.GetReportData(report.HospitalId, report.GroupId, report.Values);
var result = reportDataService.GetReportData(report.HospitalId, report.GroupId, report.ReportId, report.Values);
return new ApiResponse(ResponseType.OK, result);
}
......
......@@ -2599,7 +2599,7 @@
绩效系数
</summary>
</member>
<member name="P:Performance.DtoModels.SelectionOptions.ID">
<member name="P:Performance.DtoModels.SelectionOptions.SelectionID">
<summary>
ID
</summary>
......
......@@ -7,13 +7,13 @@ namespace Performance.DtoModels
{
public class SelectionRequest
{
public int HospitalId { get; set; }
public int GroupId { get; set; }
}
public class SearchReportRequest
{
public int HospitalId { get; set; }
public int GroupId { get; set; }
public int ReportId { get; set; }
public List<SelectionValues> Values { get; set; }
}
public class SelectionValues
......
......@@ -90,7 +90,7 @@ public object GetReportInfo(int groupId)
/// <param name="groupId"></param>
/// <param name="values"></param>
/// <returns></returns>
public List<ReportData> GetReportData(int hospitalId, int groupId, List<SelectionValues> values)
public List<ReportData> GetReportData(int hospitalId, int groupId, int reportId, List<SelectionValues> values)
{
var groups = groupRepository.GetEntities(w => w.GroupId == groupId);
var arr1 = groups.Select(w => w.ReportId);
......@@ -99,6 +99,9 @@ public List<ReportData> GetReportData(int hospitalId, int groupId, List<Selectio
if (reports == null || !reports.Any())
throw new PerformanceException("报表信息无效");
if (reportId > 0)
reports = reports.Where(w => w.ID == reportId).ToList();
var formats = GetParameterFormats();
var groupSelections = groupselectionRepository.GetEntities(w => w.GroupId == groupId);
var arr2 = groupSelections.Select(w => w.SelectionId);
......@@ -116,6 +119,7 @@ public List<ReportData> GetReportData(int hospitalId, int groupId, List<Selectio
string @where = GetFilterSelection(selections, values);
var pairs = PredefinePlaceholder(values);
pairs.Add("hospitalid", hospitalId);
pairs.Add("wh", @where);
pairs.Add("w", $"where 1=1 {@where}");
......@@ -282,14 +286,6 @@ private string AddSelectionToReportTitle(List<rep_selection> selections, List<Se
pairs.Add("lastmonth", val - 1);
}
string[] keys3 = new string[] { "hospitalid" };
foreach (var key in keys3)
{
var vals = values.FirstOrDefault(w => w.Title.ToLower() == key)?.Values;
if (vals != null && vals.Any())
pairs.Add(key, string.Join(",", vals));
}
return pairs;
}
......
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