推送数据
This commit is contained in:
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
@@ -71,7 +72,7 @@ namespace FineUIPro.Web.common
|
||||
var ProjectTotal = (from x in Funs.DB.HSSE_MonthReportItem
|
||||
join y in Funs.DB.HSSE_MonthReport on x.MonthReportId equals y.MonthReportId
|
||||
where y.ProjectId == this.ProjectId && "安全生产人工时数" == x.ReportItem
|
||||
select x.ProjectTotal).Sum();
|
||||
select x.YearTotal).Sum();
|
||||
|
||||
if (ProjectTotal.HasValue)
|
||||
{
|
||||
@@ -117,19 +118,33 @@ namespace FineUIPro.Web.common
|
||||
/// </summary>
|
||||
private void getSitePerson()
|
||||
{
|
||||
int AllCount = 0;
|
||||
int MCount = 0;
|
||||
var getallin = APIPageDataService.getPersonInOutNum(this.ProjectId, DateTime.Now.AddDays(-1));
|
||||
AllCount = getallin.Count();
|
||||
if (AllCount > 0)
|
||||
|
||||
string sql = @"select c.ConstText,b.PostType,count( *) num from SitePerson_Person a left join Base_WorkPost b on a.WorkPostId=b.WorkPostId
|
||||
LEFT JOIN Sys_Const AS c ON c.ConstValue = b.PostType and c.GroupId = 'PostType' and IsUsed =1 and InTime<='" + DateTime.Now.ToString("yyyy-MM-dd") + "' and (OutTime is null or OutTime>'" + DateTime.Now.ToString("yyyy-MM-dd") + @"' )
|
||||
where ProjectId='" + this.ProjectId + @"'
|
||||
group by c.ConstText,b.PostType ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter);
|
||||
int allcount = 0;
|
||||
int mcount = 0;
|
||||
if (tb != null)
|
||||
{
|
||||
this.divALLPerson.InnerHtml = AllCount.ToString();
|
||||
MCount = getallin.Where(x => x.PostType == Const.PostType_1).Count();
|
||||
/////管理人数
|
||||
this.divGLPerson.InnerHtml = MCount.ToString();
|
||||
/////作业人数
|
||||
this.divZYPerson.InnerHtml = (AllCount - MCount).ToString();
|
||||
foreach (DataRow row in tb.Rows)
|
||||
{
|
||||
allcount += int.Parse(row["num"].ToString());
|
||||
if (!string.IsNullOrEmpty(row["ConstText"].ToString()) && row["ConstText"].ToString().Contains("管理"))
|
||||
{
|
||||
mcount += int.Parse(row["num"].ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
this.divALLPerson.InnerHtml = allcount.ToString();
|
||||
this.divGLPerson.InnerHtml = mcount.ToString();
|
||||
this.divZYPerson.InnerHtml = (allcount - mcount).ToString();
|
||||
|
||||
|
||||
var getallin = APIPageDataService.getPersonInOutNum(this.ProjectId, DateTime.Now.AddDays(-1));
|
||||
|
||||
WorkPostS = "[]";
|
||||
InPostCounts = "[]";
|
||||
@@ -138,7 +153,7 @@ namespace FineUIPro.Web.common
|
||||
List<int> InDutyCountList = new List<int>();
|
||||
List<string> worksList = new List<string>();
|
||||
var getPersons = Funs.DB.SitePerson_Person.Where(x => x.ProjectId == this.ProjectId && x.IsUsed == 1 && x.InTime <= DateTime.Now
|
||||
&& !x.OutTime.HasValue && x.CardNo.Length > 1);
|
||||
&& !x.OutTime.HasValue);
|
||||
if (getPersons.Count() > 0)
|
||||
{
|
||||
var getWorkIds = getPersons.Where(x => x.WorkPostId != null).Select(x => x.WorkPostId).Distinct();
|
||||
|
||||
Reference in New Issue
Block a user