报表结构

parent b3fc5681
using System; using Performance.EntityModels;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
...@@ -6,6 +7,26 @@ namespace Performance.DtoModels ...@@ -6,6 +7,26 @@ namespace Performance.DtoModels
{ {
public class ReportData public class ReportData
{ {
public ReportData(rep_report report)
{
ReportID = report.ID;
ChartType = report.ChartType;
Sort = report.Sort;
Title = report.Title;
XTitle = report.XTitle;
XUnit = report.XUnit;
YTitle = report.YTitle;
YUnit = report.YUnit;
VTitle = report.VTitle;
VUnit = report.VUnit;
NTitle = report.NTitle;
NUnit = report.NUnit;
Formula = report.Formula;
DataType = report.DataType;
FilterValue = report.FilterValue;
ChartData = new List<ChartData>();
}
public int ReportID { get; set; } public int ReportID { get; set; }
/// <summary> /// <summary>
......
...@@ -9,20 +9,21 @@ public class SelectionOptions ...@@ -9,20 +9,21 @@ public class SelectionOptions
{ {
public SelectionOptions(rep_selection item) public SelectionOptions(rep_selection item)
{ {
ID = item.ID; SelectionID = item.ID;
Title = item.Title; Title = item.Title;
InputType = item.InputType; InputType = item.InputType;
InputName = item.InputName; InputName = item.InputName;
Required = item.Required ?? 0; Required = item.Required ?? 0;
Sort = item.Sort ?? 0m; Sort = item.Sort ?? 0m;
LoadType = item.LoadType; LoadType = item.LoadType;
DefaultValue = item.DefaultValue;
Options = new List<TitleValue>(); Options = new List<TitleValue>();
ParentItems = new List<TitleValue>(); ParentItems = new List<TitleValue>();
} }
/// <summary> /// <summary>
/// ID /// ID
/// </summary> /// </summary>
public int ID { get; } public int SelectionID { get; }
/// <summary> /// <summary>
/// 排序 /// 排序
/// </summary> /// </summary>
......
...@@ -130,7 +130,7 @@ public List<ReportData> GetReportData(int hospitalId, int groupId, List<Selectio ...@@ -130,7 +130,7 @@ public List<ReportData> GetReportData(int hospitalId, int groupId, List<Selectio
var chartData = reportRepository.DapperQuery<ChartData>(sql, null); var chartData = reportRepository.DapperQuery<ChartData>(sql, null);
ReportData reportData = new ReportData(); ReportData reportData = new ReportData(report);
reportData.Title = AddSelectionToReportTitle(selections, values, report.Title); reportData.Title = AddSelectionToReportTitle(selections, values, report.Title);
reportData.ChartData = chartData != null && chartData.Any() ? chartData.ToList() : new List<ChartData>(); reportData.ChartData = chartData != null && chartData.Any() ? chartData.ToList() : new List<ChartData>();
result.Add(reportData); result.Add(reportData);
......
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