Compare commits
No commits in common. "9b367d7889d26755ac18d70915ad6ee2014c0f32" and "87bf5bbe61551c0bd6b4a029481300b1366fb4ef" have entirely different histories.
9b367d7889
...
87bf5bbe61
@ -25,7 +25,6 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using Microsoft.Data.SqlClient;
|
using Microsoft.Data.SqlClient;
|
||||||
using MySqlX.XDevAPI.Common;
|
using MySqlX.XDevAPI.Common;
|
||||||
using NPOI.SS.Formula.Functions;
|
using NPOI.SS.Formula.Functions;
|
||||||
using NPOI.Util;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
@ -110,7 +109,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
public class JobTodayQty
|
public class JobTodayQty
|
||||||
{
|
{
|
||||||
public int qty { get; set; }
|
public int qty { get; set; }
|
||||||
public Guid? workTypeId { get; set; }
|
public Guid workTypeId { get; set; }
|
||||||
|
|
||||||
public string name { get; set; }
|
public string name { get; set; }
|
||||||
}
|
}
|
||||||
@ -1056,11 +1055,11 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
}
|
}
|
||||||
result.Data.jobList = list.ToList();
|
result.Data.jobList = list.ToList();
|
||||||
//当日工作票的统计数量
|
//当日工作票的统计数量
|
||||||
//string sqlJob = "select WORK_PERMIT_TYPE_ID,NAME,count(*) as QTY from vhome_jobTodayNew where create_time >='" + startDate + "' and create_time<='" + endDate + "' GROUP BY WORK_PERMIT_TYPE_ID,NAME ORDER BY QTY DESC";
|
string sqlJob = "select WORK_PERMIT_TYPE_ID,NAME,count(*) as QTY from vhome_jobTodayNew where create_time >='" + startDate + "' and create_time<='" + endDate + "' GROUP BY WORK_PERMIT_TYPE_ID,NAME ORDER BY QTY DESC";
|
||||||
//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);
|
||||||
//result.Data.jobTodayQty = JobTodayQtyData(tableJob);
|
result.Data.jobTodayQty = JobTodayQtyData(tableJob);
|
||||||
connection.Close();
|
connection.Close();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -1070,24 +1069,6 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
|||||||
else
|
else
|
||||||
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
|
throw new Exception("【" + HttpContext.Request.Path + "】错误日志:[Message]" + ex.Message);
|
||||||
}
|
}
|
||||||
List<JobTodayQty> jobTodayQtys = new List<JobTodayQty>();
|
|
||||||
if (list != null && list.Any())
|
|
||||||
{
|
|
||||||
var groupBy = list.GroupBy(t=>t.jobName);
|
|
||||||
if (groupBy != null && groupBy.Any())
|
|
||||||
{
|
|
||||||
foreach (var item in groupBy)
|
|
||||||
{
|
|
||||||
jobTodayQtys.Add(new JobTodayQty()
|
|
||||||
{
|
|
||||||
qty = item.Count(),
|
|
||||||
workTypeId = null,
|
|
||||||
name = item.Key.ToString(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result.Data.jobTodayQty = jobTodayQtys.ToList();
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user