看板增加时间参数

This commit is contained in:
何美荣 2026-05-21 11:44:14 +08:00
parent 21e3451b3c
commit 22309251f2

View File

@ -283,7 +283,24 @@ namespace APT.SC.WebApi.Controllers.Api.BI
DataTable tableJobRate = new DataTable();
DataTable tableSafeCheck = new DataTable();
DataTable tableLink = new DataTable();
DateTime startDate = DateTime.Now.Date;
DateTime endDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
if (!string.IsNullOrEmpty(filter.Parameter1))
{
startDate = Convert.ToDateTime(filter.Parameter1).Date;
}
if (!string.IsNullOrEmpty(filter.Parameter2))
{
endDate = Convert.ToDateTime(Convert.ToDateTime(filter.Parameter2).Date.ToString("yyyy-MM-dd 23:59:59"));
}
if (startDate.Year != DateTime.Now.Year)
{
throw new Exception("只能查询本年度数据,请修改开始时间!");
}
if (endDate.Year != DateTime.Now.Year)
{
throw new Exception("只能查询本年度数据,请修改结束时间!");
}
//培训教育 对应统计
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);//获取数据库链接
@ -313,7 +330,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
//jobGroupData.Fill(tableJobGroup);
//result.Data.jobTodayTop3 = JobTodayTopData(filter.OrgId.Value, tableJob, tableJobGroup);
//当日工作票的统计数量
string sqlJob = "select * from vhome_jobToday ORDER BY NUM";
string sqlJob = "select name,count(*) as qty from vhome_jobTodayNew where create_time >=" + startDate + "and create_time<=" + endDate + " GROUP BY name ORDER BY qty desc";
SqlCommand comJob = new SqlCommand(sqlJob, connection);
SqlDataAdapter jobData = new SqlDataAdapter(comJob);
jobData.Fill(tableJob);