看板首页接口
This commit is contained in:
parent
30f03e6f11
commit
291d804250
@ -55,8 +55,13 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
public List<RiskTypeRate> riskTypeRate { get; set; }
|
public List<RiskTypeRate> riskTypeRate { get; set; }
|
||||||
//当日工作票排名前三
|
//当日工作票排名前三
|
||||||
public List<JobTodayTop3> jobTodayTop3 { get; set; }
|
public List<JobTodayTop3> jobTodayTop3 { get; set; }
|
||||||
|
//当日工作票统计数量
|
||||||
|
public List<JobTodayQty> jobTodayQty { get; set; }
|
||||||
//隐患整改率
|
//隐患整改率
|
||||||
public HiddenRectify hiddenRectify { get; set; }
|
public HiddenRectify hiddenRectify { get; set; }
|
||||||
|
|
||||||
|
//隐患统计数据
|
||||||
|
public HiddenSummary hiddenSummary { get; set; }
|
||||||
//各事项排名前三
|
//各事项排名前三
|
||||||
public List<TaskTop3> taskTop3 { get; set; }
|
public List<TaskTop3> taskTop3 { get; set; }
|
||||||
//作业现场完成情况统计
|
//作业现场完成情况统计
|
||||||
@ -95,6 +100,16 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
public int qty { get; set; }
|
public int qty { get; set; }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 当日工作票统计数量
|
||||||
|
/// </summary>
|
||||||
|
public class JobTodayQty
|
||||||
|
{
|
||||||
|
public int qty { get; set; }
|
||||||
|
public Guid workTypeId { get; set; }
|
||||||
|
|
||||||
|
public string name { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// 隐患整改率
|
/// 隐患整改率
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class HiddenRectify
|
public class HiddenRectify
|
||||||
@ -107,6 +122,22 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
public string rate { get; set; }
|
public string rate { get; set; }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 隐患统计数据
|
||||||
|
/// </summary>
|
||||||
|
public class HiddenSummary
|
||||||
|
{
|
||||||
|
public int majorQty { get; set; }
|
||||||
|
|
||||||
|
public int generalQty { get; set; }
|
||||||
|
public int unfinishQty { get; set; }
|
||||||
|
|
||||||
|
public int monthMajorQty { get; set; }
|
||||||
|
|
||||||
|
public int unfinishMonthMajorQty { get; set; }
|
||||||
|
public int monthGeneralQty { get; set; }
|
||||||
|
public int unfinishMonthGeneralQty { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// 各事项排名前三
|
/// 各事项排名前三
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TaskTopTemp
|
public class TaskTopTemp
|
||||||
@ -268,45 +299,57 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
riskData.Fill(tableRisk);
|
riskData.Fill(tableRisk);
|
||||||
result.Data.riskTypeRate = RiskTypeRateData(tableRisk);
|
result.Data.riskTypeRate = RiskTypeRateData(tableRisk);
|
||||||
//当日工作票排名前三
|
//当日工作票排名前三
|
||||||
string sqlJob = "select * from vhome_jobtop3_today ";
|
//string sqlJob = "select * from vhome_jobtop3_today ";
|
||||||
|
//SqlCommand comJob = new SqlCommand(sqlJob, connection);
|
||||||
|
//SqlDataAdapter jobData = new SqlDataAdapter(comJob);
|
||||||
|
//jobData.Fill(tableJob);
|
||||||
|
//string sqlJobGroup = "select* from vhome_jobdata_today_group";
|
||||||
|
//SqlCommand comJobGroup = new SqlCommand(sqlJobGroup, connection);
|
||||||
|
//SqlDataAdapter jobGroupData = new SqlDataAdapter(comJobGroup);
|
||||||
|
//jobGroupData.Fill(tableJobGroup);
|
||||||
|
//result.Data.jobTodayTop3 = JobTodayTopData(filter.OrgId.Value, tableJob, tableJobGroup);
|
||||||
|
//当日工作票的统计数量
|
||||||
|
string sqlJob = "select * from vhome_jobToday ";
|
||||||
SqlCommand comJob = new SqlCommand(sqlJob, connection);
|
SqlCommand comJob = new SqlCommand(sqlJob, connection);
|
||||||
SqlDataAdapter jobData = new SqlDataAdapter(comJob);
|
SqlDataAdapter jobData = new SqlDataAdapter(comJob);
|
||||||
jobData.Fill(tableJob);
|
jobData.Fill(tableJob);
|
||||||
string sqlJobGroup = "select* from vhome_jobdata_today_group";
|
result.Data.jobTodayQty = JobTodayQtyData(tableJob);
|
||||||
SqlCommand comJobGroup = new SqlCommand(sqlJobGroup, connection);
|
//隐患统计数据
|
||||||
SqlDataAdapter jobGroupData = new SqlDataAdapter(comJobGroup);
|
string sqlHidden = "select * from vhome_hiddenSummary";
|
||||||
jobGroupData.Fill(tableJobGroup);
|
|
||||||
result.Data.jobTodayTop3 = JobTodayTopData(filter.OrgId.Value, tableJob, tableJobGroup);
|
|
||||||
//隐患整改率
|
|
||||||
string sqlHidden = "select * from vhome_hidden_data_result ";
|
|
||||||
SqlCommand comHidden = new SqlCommand(sqlHidden, connection);
|
SqlCommand comHidden = new SqlCommand(sqlHidden, connection);
|
||||||
SqlDataAdapter hiddenData = new SqlDataAdapter(comHidden);
|
SqlDataAdapter hiddenData = new SqlDataAdapter(comHidden);
|
||||||
hiddenData.Fill(tableHidden);
|
hiddenData.Fill(tableHidden);
|
||||||
result.Data.hiddenRectify = HiddenRectifyData(tableHidden);
|
result.Data.hiddenSummary = HiddenSummaryData(tableHidden);
|
||||||
|
//隐患整改率
|
||||||
|
//string sqlHidden = "select * from vhome_hidden_data_result ";
|
||||||
|
//SqlCommand comHidden = new SqlCommand(sqlHidden, connection);
|
||||||
|
//SqlDataAdapter hiddenData = new SqlDataAdapter(comHidden);
|
||||||
|
//hiddenData.Fill(tableHidden);
|
||||||
|
//result.Data.hiddenRectify = HiddenRectifyData(tableHidden);
|
||||||
//各事项排名前三
|
//各事项排名前三
|
||||||
string sqlTask = "select * from vhome_task_data_result ";
|
//string sqlTask = "select * from vhome_task_data_result ";
|
||||||
SqlCommand comTask = new SqlCommand(sqlTask, connection);
|
//SqlCommand comTask = new SqlCommand(sqlTask, connection);
|
||||||
SqlDataAdapter taskData = new SqlDataAdapter(comTask);
|
//SqlDataAdapter taskData = new SqlDataAdapter(comTask);
|
||||||
taskData.Fill(tableTask);
|
//taskData.Fill(tableTask);
|
||||||
result.Data.taskTop3 = TaskTopData(tableTask);
|
//result.Data.taskTop3 = TaskTopData(tableTask);
|
||||||
//作业现场完成情况统计
|
//作业现场完成情况统计
|
||||||
string sqlJobRate = "select * from vhome_jobrecord_data ";
|
//string sqlJobRate = "select * from vhome_jobrecord_data ";
|
||||||
SqlCommand comJobRate = new SqlCommand(sqlJobRate, connection);
|
//SqlCommand comJobRate = new SqlCommand(sqlJobRate, connection);
|
||||||
SqlDataAdapter jobRateData = new SqlDataAdapter(comJobRate);
|
//SqlDataAdapter jobRateData = new SqlDataAdapter(comJobRate);
|
||||||
jobRateData.Fill(tableJobRate);
|
//jobRateData.Fill(tableJobRate);
|
||||||
result.Data.jobFinishRate = jobFinishRateData(tableJobRate);
|
//result.Data.jobFinishRate = jobFinishRateData(tableJobRate);
|
||||||
//各公司安全检查统计
|
//各公司安全检查统计
|
||||||
string sqlSafecCheck = "select * from vhome_check_total ";
|
//string sqlSafecCheck = "select * from vhome_check_total ";
|
||||||
SqlCommand comSafecCheck = new SqlCommand(sqlSafecCheck, connection);
|
//SqlCommand comSafecCheck = new SqlCommand(sqlSafecCheck, connection);
|
||||||
SqlDataAdapter safecCheckData = new SqlDataAdapter(comSafecCheck);
|
//SqlDataAdapter safecCheckData = new SqlDataAdapter(comSafecCheck);
|
||||||
safecCheckData.Fill(tableSafeCheck);
|
//safecCheckData.Fill(tableSafeCheck);
|
||||||
result.Data.safeCheckSum = safeCheckSumData(tableSafeCheck);
|
//result.Data.safeCheckSum = safeCheckSumData(tableSafeCheck);
|
||||||
//各公司危险分类统计
|
//各公司危险分类统计
|
||||||
string sqlLink = "select * from vhome_operationLink_data ";
|
//string sqlLink = "select * from vhome_operationLink_data ";
|
||||||
SqlCommand comLink = new SqlCommand(sqlLink, connection);
|
//SqlCommand comLink = new SqlCommand(sqlLink, connection);
|
||||||
SqlDataAdapter linkData = new SqlDataAdapter(comLink);
|
//SqlDataAdapter linkData = new SqlDataAdapter(comLink);
|
||||||
linkData.Fill(tableLink);
|
//linkData.Fill(tableLink);
|
||||||
result.Data.linkSum = linkSumData(tableLink);
|
//result.Data.linkSum = linkSumData(tableLink);
|
||||||
|
|
||||||
connection.Close();
|
connection.Close();
|
||||||
}
|
}
|
||||||
@ -434,7 +477,28 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 当日工作票统计数量
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filter">参数</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<JobTodayQty> JobTodayQtyData(DataTable Table)
|
||||||
|
{
|
||||||
|
List<JobTodayQty> result = new List<JobTodayQty>();
|
||||||
|
if (Table != null && Table.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (DataRow item in Table.Rows)
|
||||||
|
{
|
||||||
|
result.Add(new JobTodayQty()
|
||||||
|
{
|
||||||
|
qty = int.Parse(Table.Rows[0]["QTY"].ToString()) != 0 ? int.Parse(Table.Rows[0]["QTY"].ToString()) : 0,
|
||||||
|
workTypeId = Guid.Parse(Table.Rows[0]["WORK_PERMIT_TYPE_ID"].ToString()),
|
||||||
|
name = Table.Rows[0]["NAME"] != null ? Table.Rows[0]["NAME"].ToString() : null
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 隐患整改率
|
/// 隐患整改率
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -452,7 +516,26 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 隐患统计数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filter">参数</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public HiddenSummary HiddenSummaryData(DataTable Table)
|
||||||
|
{
|
||||||
|
HiddenSummary result = new HiddenSummary();
|
||||||
|
if (Table != null && Table.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
result.majorQty = int.Parse(Table.Rows[0]["majorQty"].ToString()) != 0 ? int.Parse(Table.Rows[0]["majorQty"].ToString()) : 0;
|
||||||
|
result.generalQty = int.Parse(Table.Rows[0]["generalQty"].ToString()) != 0 ? int.Parse(Table.Rows[0]["generalQty"].ToString()) : 0;
|
||||||
|
result.unfinishQty = int.Parse(Table.Rows[0]["unfinishQty"].ToString()) != 0 ? int.Parse(Table.Rows[0]["unfinishQty"].ToString()) : 0;
|
||||||
|
result.monthMajorQty = int.Parse(Table.Rows[0]["monthMajorQty"].ToString()) != 0 ? int.Parse(Table.Rows[0]["monthMajorQty"].ToString()) : 0;
|
||||||
|
result.unfinishMonthMajorQty = int.Parse(Table.Rows[0]["unfinishMonthMajorQty"].ToString()) != 0 ? int.Parse(Table.Rows[0]["unfinishMonthMajorQty"].ToString()) : 0;
|
||||||
|
result.monthGeneralQty = int.Parse(Table.Rows[0]["monthGeneralQty"].ToString()) != 0 ? int.Parse(Table.Rows[0]["monthGeneralQty"].ToString()) : 0;
|
||||||
|
result.unfinishMonthGeneralQty = int.Parse(Table.Rows[0]["unfinishMonthGeneralQty"].ToString()) != 0 ? int.Parse(Table.Rows[0]["unfinishMonthGeneralQty"].ToString()) : 0;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 各事项排名前三
|
/// 各事项排名前三
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user