看板接口
This commit is contained in:
parent
f9c566418b
commit
b77f1331d3
@ -25,6 +25,7 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using static APT.SC.WebApi.Controllers.Api.BI.BIKanBanController;
|
||||||
using static Google.Protobuf.WireFormat;
|
using static Google.Protobuf.WireFormat;
|
||||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||||
using static NPOI.HSSF.Util.HSSFColor;
|
using static NPOI.HSSF.Util.HSSFColor;
|
||||||
@ -54,6 +55,8 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
public List<JobFinishRate> jobFinishRate { get; set; }
|
public List<JobFinishRate> jobFinishRate { get; set; }
|
||||||
//各公司安全检查统计
|
//各公司安全检查统计
|
||||||
public List<SafeCheckSum> safeCheckSum { get; set; }
|
public List<SafeCheckSum> safeCheckSum { get; set; }
|
||||||
|
//各公司危险作业统计
|
||||||
|
public List<LinkSum> linkSum { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -134,6 +137,14 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
public int num { get; set; }
|
public int num { get; set; }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 各公司危险作业统计
|
||||||
|
/// </summary>
|
||||||
|
public class LinkSum
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public int qty { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// 返回看板所有接口
|
/// 返回看板所有接口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="filter">分页过滤实体</param>
|
/// <param name="filter">分页过滤实体</param>
|
||||||
@ -151,6 +162,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
DataTable tableTask = new DataTable();
|
DataTable tableTask = new DataTable();
|
||||||
DataTable tableJobRate = new DataTable();
|
DataTable tableJobRate = new DataTable();
|
||||||
DataTable tableSafeCheck = new DataTable();
|
DataTable tableSafeCheck = new DataTable();
|
||||||
|
DataTable tableLink = new DataTable();
|
||||||
using (SqlConnection connection = new SqlConnection(connhead))
|
using (SqlConnection connection = new SqlConnection(connhead))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -196,6 +208,12 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
SqlDataAdapter safecCheckData = new SqlDataAdapter(comSafecCheck);
|
SqlDataAdapter safecCheckData = new SqlDataAdapter(comSafecCheck);
|
||||||
safecCheckData.Fill(tableSafeCheck);
|
safecCheckData.Fill(tableSafeCheck);
|
||||||
result.Data.safeCheckSum = safeCheckSumData(connhead, tableSafeCheck);
|
result.Data.safeCheckSum = safeCheckSumData(connhead, tableSafeCheck);
|
||||||
|
//各公司危险分类统计
|
||||||
|
string sqlLink = "select * from vhome_operationLink_data ";
|
||||||
|
SqlCommand comLink = new SqlCommand(sqlLink, connection);
|
||||||
|
SqlDataAdapter linkData = new SqlDataAdapter(comLink);
|
||||||
|
linkData.Fill(tableLink);
|
||||||
|
result.Data.linkSum = linkSumData(connhead, tableLink);
|
||||||
connection.Close();
|
connection.Close();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -399,5 +417,26 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 各公司危险作业统计
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filter">参数</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<LinkSum> linkSumData(string connhead, DataTable Table)
|
||||||
|
{
|
||||||
|
List<LinkSum> result = new List<LinkSum>();
|
||||||
|
if (Table != null && Table.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (DataRow item in Table.Rows)
|
||||||
|
{
|
||||||
|
result.Add(new LinkSum()
|
||||||
|
{
|
||||||
|
name = item["NAME"] != null ? item["NAME"].ToString() : null,
|
||||||
|
qty = int.Parse(item["cnt"].ToString()) != 0 ? int.Parse(item["cnt"].ToString()) : 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user