This commit is contained in:
wyw 2026-01-20 11:05:15 +08:00
parent 8dcbfd8bc4
commit 835fa8fd00

View File

@ -1,51 +1,48 @@
using APT.BaseData.Domain.Entities; using APT.BaseData.Domain.Entities;
using APT.BaseData.Domain.Entities.FM; using APT.BaseData.Domain.Entities.FM;
using APT.BaseData.Domain.Entities.OP; using APT.BaseData.Domain.Entities.OP;
using APT.BaseData.Domain.Enums; using APT.BaseData.Domain.Enums;
using APT.BaseData.Domain.IServices.FM; using APT.BaseData.Domain.IServices.FM;
using APT.BaseData.Domain.IServices.OP; using APT.BaseData.Domain.IServices.OP;
using APT.BaseData.Services.Services.FM; using APT.BaseData.Services.Services.FM;
using APT.Infrastructure.Api; using APT.Infrastructure.Api;
using APT.Infrastructure.Core; using APT.Infrastructure.Core;
using APT.Migrations; using APT.Migrations;
using APT.MS.Domain.Entities.BI; using APT.MS.Domain.Entities.BI;
using APT.MS.Domain.Entities.BS; using APT.MS.Domain.Entities.BS;
using APT.MS.Domain.Entities.FO; using APT.MS.Domain.Entities.FO;
using APT.MS.Domain.Entities.HM; using APT.MS.Domain.Entities.HM;
using APT.MS.Domain.Entities.SC.BI; using APT.MS.Domain.Entities.SC.BI;
using APT.MS.Domain.Entities.SE; using APT.MS.Domain.Entities.SE;
using APT.MS.Domain.Enums; using APT.MS.Domain.Enums;
using APT.Utility; using APT.Utility;
using InfluxData.Net.InfluxDb.Enums; using InfluxData.Net.InfluxDb.Enums;
using log4net.Core; using log4net.Core;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Data.SqlClient; using Microsoft.Data.SqlClient;
using NPOI.SS.Formula.Functions; using NPOI.SS.Formula.Functions;
using System; using System;
using System.Collections.Generic; 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 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;
namespace APT.SC.WebApi.Controllers.Api.BI namespace APT.SC.WebApi.Controllers.Api.BI
{ {
/// <summary> /// <summary>
/// 看板 /// 看板
/// </summary> /// </summary>
[Route("api/BI/BIKanBanController")] [Route("api/BI/BIKanBanController")]
public class BIKanBanController : APTApiController<T_FM_NOTIFICATION_TASK> public class BIKanBanController : APTApiController<T_FM_NOTIFICATION_TASK>
{ {
IOPTenantDBConnService OPTenantDBConnService { get; set; } IOPTenantDBConnService OPTenantDBConnService { get; set; }
public BIKanBanController(IOPTenantDBConnService opTenantDBConnService) public BIKanBanController(IOPTenantDBConnService opTenantDBConnService)
{ {
OPTenantDBConnService = opTenantDBConnService; OPTenantDBConnService = opTenantDBConnService;
} }
#region
/// <summary> /// <summary>
/// 返回所有 /// 返回所有
/// </summary> /// </summary>
@ -62,91 +59,93 @@ 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; }
/// <summary>
public List<SETRAINSHOW> listSETrainSum { get; set; } /// 培训教育
/// </summary>
} public List<SETRAINSHOW> listSETrainSum { get; set; }
}
/// <summary> /// <summary>
/// 风险等级占比 /// 风险等级占比
/// </summary> /// </summary>
public class RiskTypeRate public class RiskTypeRate
{ {
public string riskType { get; set; } public string riskType { get; set; }
public int count { get; set; } public int count { get; set; }
public string rate { get; set; } public string rate { get; set; }
} }
/// <summary> /// <summary>
/// 当日工作票排名前三 /// 当日工作票排名前三
/// </summary> /// </summary>
public class JobTodayTop3 public class JobTodayTop3
{ {
public int totalQty { get; set; } public int totalQty { get; set; }
public int num { get; set; } public int num { get; set; }
public string company { get; set; } public string company { get; set; }
public List<JobTodayDetail> details { get; set; } public List<JobTodayDetail> details { get; set; }
} }
public class JobTodayDetail public class JobTodayDetail
{ {
public string company { get; set; } public string company { get; set; }
public string jobName { get; set; } public string jobName { get; set; }
public int qty { get; set; } public int qty { get; set; }
} }
/// <summary> /// <summary>
/// 隐患整改率 /// 隐患整改率
/// </summary> /// </summary>
public class HiddenRectify public class HiddenRectify
{ {
public int qty { get; set; } public int qty { get; set; }
public int ontimeQty { get; set; } public int ontimeQty { get; set; }
public int delayQty { get; set; } public int delayQty { get; set; }
public string rate { get; set; } public string rate { get; set; }
} }
/// <summary> /// <summary>
/// 各事项排名前三 /// 各事项排名前三
/// </summary> /// </summary>
public class TaskTopTemp public class TaskTopTemp
{ {
public int totalQty { get; set; } public int totalQty { get; set; }
public int qty { get; set; } public int qty { get; set; }
public string company { get; set; } public string company { get; set; }
public string type { get; set; } public string type { get; set; }
} }
public class TaskTop3 public class TaskTop3
{ {
public int totalQty { get; set; } public int totalQty { get; set; }
public string company { get; set; } public string company { get; set; }
public List<TaskTopDetail> details { get; set; } public List<TaskTopDetail> details { get; set; }
} }
public class TaskTopDetail public class TaskTopDetail
{ {
public string name { get; set; } public string name { get; set; }
public int qty { get; set; } public int qty { get; set; }
} }
/// <summary> /// <summary>
/// 作业现场完成情况统计 /// 作业现场完成情况统计
/// </summary> /// </summary>
public class JobFinishRate public class JobFinishRate
{ {
public string name { get; set; } public string name { get; set; }
public int qty { get; set; } public int qty { get; set; }
public int finishQty { get; set; } public int finishQty { get; set; }
public string rate { get; set; } public string rate { get; set; }
} }
/// <summary> /// <summary>
/// 各公司安全检查统计 /// 各公司安全检查统计
/// </summary> /// </summary>
public class SafeCheckSum public class SafeCheckSum
{ {
public string company { get; set; } public string company { get; set; }
public int qty { get; set; } public int qty { get; set; }
public int num { get; set; } public int num { get; set; }
} }
/// <summary> /// <summary>
/// 培训教育学时获取 /// 培训教育学时获取
/// </summary> /// </summary>
@ -224,16 +223,14 @@ namespace APT.SC.WebApi.Controllers.Api.BI
} }
#endregion /// <summary>
/// 返回看板所有接口
/// <summary> /// </summary>
/// 返回看板所有接口 /// <param name="filter">分页过滤实体</param>
/// </summary> /// <returns></returns>
/// <param name="filter">分页过滤实体</param> [HttpPost, Route("ReturnAllData")]
/// <returns></returns> public ReturnAll ReturnAllData([FromBody] KeywordFilter filter)
[HttpPost, Route("ReturnAllData")] {
public ReturnAll ReturnAllData([FromBody] KeywordFilter filter)
{
ReturnAll result = new ReturnAll(); ReturnAll result = new ReturnAll();
var ListAllORG = GetEntities<T_FM_ORGANIZATION>(e => !e.IS_DELETED && e.CODE != "003", null, null).OrderBy(e => e.TENANT_CODE).ToList(); var ListAllORG = GetEntities<T_FM_ORGANIZATION>(e => !e.IS_DELETED && e.CODE != "003", null, null).OrderBy(e => e.TENANT_CODE).ToList();
string strConn = OPTenantDBConnService.GetConnByORGID(filter.OrgId.Value);//获取数据库链接 string strConn = OPTenantDBConnService.GetConnByORGID(filter.OrgId.Value);//获取数据库链接
@ -250,8 +247,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
string connhead = ConfigurationManager.ConnectionStrings["head"];//删除吧 TPM是没有相对于配置 string connhead = ConfigurationManager.ConnectionStrings["head"];//删除吧 TPM是没有相对于配置
//风险等级占比 //风险等级占比
result.riskTypeRate = RiskTypeRateData(strConn); result.riskTypeRate = RiskTypeRateData(connhead);
//当日工作票排名前三 //当日工作票排名前三
result.jobTodayTop3 = JobTodayTopData(connhead, filter.OrgId.Value); result.jobTodayTop3 = JobTodayTopData(connhead, filter.OrgId.Value);
//隐患整改率 //隐患整改率
@ -263,7 +259,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
//各公司安全检查统计 //各公司安全检查统计
result.safeCheckSum = safeCheckSumData(connhead); result.safeCheckSum = safeCheckSumData(connhead);
return result; return result;
} }
/// <summary> /// <summary>
@ -296,25 +292,22 @@ namespace APT.SC.WebApi.Controllers.Api.BI
} }
connection.Close(); connection.Close();
} }
catch (Exception ex) catch (Exception ex)
{ {
if (!string.IsNullOrEmpty(ex.StackTrace)) if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace); throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message); throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
} }
} }
} }
#region /// <summary>
/// 风险等级占比
/// </summary>
/// <summary> /// <param name="filter">分页过滤实体</param>
/// 风险等级占比 public List<RiskTypeRate> RiskTypeRateData(string connhead)
/// </summary> {
/// <param name="filter">分页过滤实体</param>
public List<RiskTypeRate> RiskTypeRateData(string connhead)
{
List<RiskTypeRate> result = new List<RiskTypeRate>(); List<RiskTypeRate> result = new List<RiskTypeRate>();
DataTable Table = new DataTable(); DataTable Table = new DataTable();
using (SqlConnection connection = new SqlConnection(connhead)) using (SqlConnection connection = new SqlConnection(connhead))
@ -334,37 +327,37 @@ namespace APT.SC.WebApi.Controllers.Api.BI
Data.Fill(Table); Data.Fill(Table);
} }
connection.Close(); connection.Close();
if (Table != null && Table.Rows.Count > 0) if (Table != null && Table.Rows.Count > 0)
{ {
foreach (DataRow item in Table.Rows) foreach (DataRow item in Table.Rows)
{ {
result.Add(new RiskTypeRate() result.Add(new RiskTypeRate()
{ {
riskType = item["风险类别"] != null ? item["风险类别"].ToString() : null, riskType = item["风险类别"] != null ? item["风险类别"].ToString() : null,
count = int.Parse(item["数量"].ToString()) != 0 ? int.Parse(item["数量"].ToString()) : 0, count = int.Parse(item["数量"].ToString()) != 0 ? int.Parse(item["数量"].ToString()) : 0,
rate = item["占比"] != null ? item["占比"].ToString() : "0" rate = item["占比"] != null ? item["占比"].ToString() : "0"
}); });
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
if (!string.IsNullOrEmpty(ex.StackTrace)) if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace); throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message); throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
} }
} }
return result; return result;
} }
/// <summary> /// <summary>
/// 当日工作票排名前三 /// 当日工作票排名前三
/// </summary> /// </summary>
/// <param name="filter">参数</param> /// <param name="filter">参数</param>
/// <returns></returns> /// <returns></returns>
public List<JobTodayTop3> JobTodayTopData(string connhead, Guid orgId) public List<JobTodayTop3> JobTodayTopData(string connhead, Guid orgId)
{ {
List<JobTodayTop3> result = new List<JobTodayTop3>(); List<JobTodayTop3> result = new List<JobTodayTop3>();
var details = new List<JobTodayDetail>(); var details = new List<JobTodayDetail>();
DataTable Table = new DataTable(); DataTable Table = new DataTable();
@ -397,16 +390,16 @@ namespace APT.SC.WebApi.Controllers.Api.BI
Data.Fill(Table2); Data.Fill(Table2);
} }
connection.Close(); connection.Close();
if (Table != null && Table.Rows.Count > 0) if (Table != null && Table.Rows.Count > 0)
{ {
foreach (DataRow item in Table.Rows) foreach (DataRow item in Table.Rows)
{ {
var JobTodayTop3 = new JobTodayTop3(); var JobTodayTop3 = new JobTodayTop3();
JobTodayTop3.totalQty = int.Parse(item["今日总数"].ToString()) != 0 ? int.Parse(item["今日总数"].ToString()) : 0; JobTodayTop3.totalQty = int.Parse(item["今日总数"].ToString()) != 0 ? int.Parse(item["今日总数"].ToString()) : 0;
JobTodayTop3.num = int.Parse(item["排名"].ToString()) != 0 ? int.Parse(item["排名"].ToString()) : 0; JobTodayTop3.num = int.Parse(item["排名"].ToString()) != 0 ? int.Parse(item["排名"].ToString()) : 0;
JobTodayTop3.company = item["公司名称"] != null ? item["公司名称"].ToString() : ""; JobTodayTop3.company = item["公司名称"] != null ? item["公司名称"].ToString() : "";
result.Add(JobTodayTop3); result.Add(JobTodayTop3);
} }
} }
if (Table2 != null && Table2.Rows.Count > 0) if (Table2 != null && Table2.Rows.Count > 0)
{ {
@ -441,23 +434,23 @@ namespace APT.SC.WebApi.Controllers.Api.BI
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
if (!string.IsNullOrEmpty(ex.StackTrace)) if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace); throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message); throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
} }
} }
return result; return result;
} }
/// <summary> /// <summary>
/// 隐患整改率 /// 隐患整改率
/// </summary> /// </summary>
/// <param name="filter">参数</param> /// <param name="filter">参数</param>
/// <returns></returns> /// <returns></returns>
public HiddenRectify HiddenRectifyData(string connhead) public HiddenRectify HiddenRectifyData(string connhead)
{ {
HiddenRectify result = new HiddenRectify(); HiddenRectify result = new HiddenRectify();
DataTable Table = new DataTable(); DataTable Table = new DataTable();
@ -478,32 +471,32 @@ namespace APT.SC.WebApi.Controllers.Api.BI
Data.Fill(Table); Data.Fill(Table);
} }
connection.Close(); connection.Close();
if (Table != null && Table.Rows.Count > 0) if (Table != null && Table.Rows.Count > 0)
{ {
result.qty = int.Parse(Table.Rows[0]["隐患数"].ToString()) != 0 ? int.Parse(Table.Rows[0]["隐患数"].ToString()) : 0; result.qty = int.Parse(Table.Rows[0]["隐患数"].ToString()) != 0 ? int.Parse(Table.Rows[0]["隐患数"].ToString()) : 0;
result.ontimeQty = int.Parse(Table.Rows[0]["按期整改数"].ToString()) != 0 ? int.Parse(Table.Rows[0]["按期整改数"].ToString()) : 0; result.ontimeQty = int.Parse(Table.Rows[0]["按期整改数"].ToString()) != 0 ? int.Parse(Table.Rows[0]["按期整改数"].ToString()) : 0;
result.delayQty = int.Parse(Table.Rows[0]["延期整改数"].ToString()) != 0 ? int.Parse(Table.Rows[0]["延期整改数"].ToString()) : 0; result.delayQty = int.Parse(Table.Rows[0]["延期整改数"].ToString()) != 0 ? int.Parse(Table.Rows[0]["延期整改数"].ToString()) : 0;
result.rate = Table.Rows[0]["整改率"] != null ? Table.Rows[0]["整改率"].ToString() : null; result.rate = Table.Rows[0]["整改率"] != null ? Table.Rows[0]["整改率"].ToString() : null;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
if (!string.IsNullOrEmpty(ex.StackTrace)) if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace); throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message); throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
} }
} }
return result; return result;
} }
/// <summary> /// <summary>
/// 各事项排名前三 /// 各事项排名前三
/// </summary> /// </summary>
/// <param name="filter">参数</param> /// <param name="filter">参数</param>
/// <returns></returns> /// <returns></returns>
public List<TaskTop3> TaskTopData(string connhead) public List<TaskTop3> TaskTopData(string connhead)
{ {
List<TaskTop3> result = new List<TaskTop3>(); List<TaskTop3> result = new List<TaskTop3>();
var dataTemps = new List<TaskTopTemp>(); var dataTemps = new List<TaskTopTemp>();
DataTable Table = new DataTable(); DataTable Table = new DataTable();
@ -524,17 +517,17 @@ namespace APT.SC.WebApi.Controllers.Api.BI
Data.Fill(Table); Data.Fill(Table);
} }
connection.Close(); connection.Close();
if (Table != null && Table.Rows.Count > 0) if (Table != null && Table.Rows.Count > 0)
{ {
foreach (DataRow item in Table.Rows) foreach (DataRow item in Table.Rows)
{ {
var JobTodayTop3 = new TaskTopTemp(); var JobTodayTop3 = new TaskTopTemp();
JobTodayTop3.totalQty = int.Parse(item["待办总数"].ToString()) != 0 ? int.Parse(item["待办总数"].ToString()) : 0; JobTodayTop3.totalQty = int.Parse(item["待办总数"].ToString()) != 0 ? int.Parse(item["待办总数"].ToString()) : 0;
JobTodayTop3.qty = int.Parse(item["数量"].ToString()) != 0 ? int.Parse(item["数量"].ToString()) : 0; JobTodayTop3.qty = int.Parse(item["数量"].ToString()) != 0 ? int.Parse(item["数量"].ToString()) : 0;
JobTodayTop3.company = item["公司名称"] != null ? item["公司名称"].ToString() : ""; JobTodayTop3.company = item["公司名称"] != null ? item["公司名称"].ToString() : "";
JobTodayTop3.type = item["类型"] != null ? item["类型"].ToString() : ""; JobTodayTop3.type = item["类型"] != null ? item["类型"].ToString() : "";
dataTemps.Add(JobTodayTop3); dataTemps.Add(JobTodayTop3);
} }
} }
if (dataTemps != null && dataTemps.Any()) if (dataTemps != null && dataTemps.Any())
{ {
@ -561,25 +554,25 @@ namespace APT.SC.WebApi.Controllers.Api.BI
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
if (!string.IsNullOrEmpty(ex.StackTrace)) if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace); throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message); throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
} }
} }
return result; return result;
} }
/// <summary> /// <summary>
/// 作业现场完成情况统计 /// 作业现场完成情况统计
/// </summary> /// </summary>
/// <param name="filter">参数</param> /// <param name="filter">参数</param>
/// <returns></returns> /// <returns></returns>
public List<JobFinishRate> jobFinishRateData(string connhead) public List<JobFinishRate> jobFinishRateData(string connhead)
{ {
List<JobFinishRate> result = new List<JobFinishRate>(); List<JobFinishRate> result = new List<JobFinishRate>();
DataTable Table = new DataTable(); DataTable Table = new DataTable();
using (SqlConnection connection = new SqlConnection(connhead)) using (SqlConnection connection = new SqlConnection(connhead))
@ -599,39 +592,39 @@ namespace APT.SC.WebApi.Controllers.Api.BI
Data.Fill(Table); Data.Fill(Table);
} }
connection.Close(); connection.Close();
if (Table != null && Table.Rows.Count > 0) if (Table != null && Table.Rows.Count > 0)
{ {
foreach (DataRow item in Table.Rows) foreach (DataRow item in Table.Rows)
{ {
result.Add(new JobFinishRate() result.Add(new JobFinishRate()
{ {
name = item["表单名称"] != null ? item["表单名称"].ToString() : null, name = item["表单名称"] != null ? item["表单名称"].ToString() : null,
qty = int.Parse(item["总数"].ToString()) != 0 ? int.Parse(item["总数"].ToString()) : 0, qty = int.Parse(item["总数"].ToString()) != 0 ? int.Parse(item["总数"].ToString()) : 0,
finishQty = int.Parse(item["完成数"].ToString()) != 0 ? int.Parse(item["完成数"].ToString()) : 0, finishQty = int.Parse(item["完成数"].ToString()) != 0 ? int.Parse(item["完成数"].ToString()) : 0,
rate = item["完成率"] != null ? item["完成率"].ToString() : null, rate = item["完成率"] != null ? item["完成率"].ToString() : null,
}); });
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
if (!string.IsNullOrEmpty(ex.StackTrace)) if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace); throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message); throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
} }
} }
return result; return result;
} }
/// <summary> /// <summary>
/// 各公司安全检查统计 /// 各公司安全检查统计
/// </summary> /// </summary>
/// <param name="filter">参数</param> /// <param name="filter">参数</param>
/// <returns></returns> /// <returns></returns>
public List<SafeCheckSum> safeCheckSumData(string connhead) public List<SafeCheckSum> safeCheckSumData(string connhead)
{ {
List<SafeCheckSum> result = new List<SafeCheckSum>(); List<SafeCheckSum> result = new List<SafeCheckSum>();
DataTable Table = new DataTable(); DataTable Table = new DataTable();
using (SqlConnection connection = new SqlConnection(connhead)) using (SqlConnection connection = new SqlConnection(connhead))
@ -651,28 +644,28 @@ namespace APT.SC.WebApi.Controllers.Api.BI
Data.Fill(Table); Data.Fill(Table);
} }
connection.Close(); connection.Close();
if (Table != null && Table.Rows.Count > 0) if (Table != null && Table.Rows.Count > 0)
{ {
foreach (DataRow item in Table.Rows) foreach (DataRow item in Table.Rows)
{ {
result.Add(new SafeCheckSum() result.Add(new SafeCheckSum()
{ {
company = item["公司名称"] != null ? item["公司名称"].ToString() : null, company = item["公司名称"] != null ? item["公司名称"].ToString() : null,
qty = int.Parse(item["数量"].ToString()) != 0 ? int.Parse(item["数量"].ToString()) : 0, qty = int.Parse(item["数量"].ToString()) != 0 ? int.Parse(item["数量"].ToString()) : 0,
num = int.Parse(item["排名"].ToString()) != 0 ? int.Parse(item["排名"].ToString()) : 0, num = int.Parse(item["排名"].ToString()) != 0 ? int.Parse(item["排名"].ToString()) : 0,
}); });
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
if (!string.IsNullOrEmpty(ex.StackTrace)) if (!string.IsNullOrEmpty(ex.StackTrace))
throw new Exception("错误日志:[StackTrace]" + ex.StackTrace); throw new Exception("错误日志:[StackTrace]" + ex.StackTrace);
else else
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message); throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
} }
} }
return result; return result;
} }
/// <summary> /// <summary>
@ -713,8 +706,5 @@ namespace APT.SC.WebApi.Controllers.Api.BI
} }
return dtInfo; return dtInfo;
} }
}
}
#endregion
}
}