看板接口
This commit is contained in:
parent
f9c566418b
commit
b77f1331d3
@ -25,6 +25,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using static APT.SC.WebApi.Controllers.Api.BI.BIKanBanController;
|
||||
using static Google.Protobuf.WireFormat;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
using static NPOI.HSSF.Util.HSSFColor;
|
||||
@ -53,7 +54,9 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
||||
//作业现场完成情况统计
|
||||
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>
|
||||
@ -133,6 +136,14 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
||||
public int qty { get; set; }
|
||||
public int num { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 各公司危险作业统计
|
||||
/// </summary>
|
||||
public class LinkSum
|
||||
{
|
||||
public string name { get; set; }
|
||||
public int qty { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 返回看板所有接口
|
||||
/// </summary>
|
||||
@ -151,6 +162,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
||||
DataTable tableTask = new DataTable();
|
||||
DataTable tableJobRate = new DataTable();
|
||||
DataTable tableSafeCheck = new DataTable();
|
||||
DataTable tableLink = new DataTable();
|
||||
using (SqlConnection connection = new SqlConnection(connhead))
|
||||
{
|
||||
try
|
||||
@ -196,6 +208,12 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
||||
SqlDataAdapter safecCheckData = new SqlDataAdapter(comSafecCheck);
|
||||
safecCheckData.Fill(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();
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -398,6 +416,27 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
||||
}
|
||||
}
|
||||
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