Compare commits

..

No commits in common. "eb62e9a2d8aafc9c3c0cb5f5fb1ebb53049f9ebb" and "76668143e5b81b33a96fb66e6e630a83f38cedfd" have entirely different histories.

1 changed files with 15 additions and 51 deletions

View File

@ -13,7 +13,6 @@ using System.Web.UI;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using Org.BouncyCastle.Ocsp; using Org.BouncyCastle.Ocsp;
using FineUIPro.Web.HJGL.FL; using FineUIPro.Web.HJGL.FL;
using System.Data;
namespace FineUIPro.Web.common namespace FineUIPro.Web.common
{ {
@ -982,50 +981,22 @@ namespace FineUIPro.Web.common
{ {
await Task.Run(() => await Task.Run(() =>
{ {
int AllCount = 0; int AllCount = 0;
int MCount = 0; int MCount = 0;
//var getallin = new List<Model.PageDataPersonInOutItem>(); var getallin = new List<Model.PageDataPersonInOutItem>();
//if (pids == null) if (pids == null)
//{
// getallin = APIPageDataService.getPersonNum(new List<string>(), DateTime.Now);
//}
//else
//{
// getallin = APIPageDataService.getPersonNum(pids.ToList(), DateTime.Now);
//}
var startDate = DateTime.Now.Date;
var endDate = startDate.AddDays(1);
string strSql = @"select ProjectId,PostType,COUNT(distinct PersonId)PersonNum from SitePerson_PersonInOutNow
where ChangeTime >= '" + startDate.ToString("yyyy-MM-dd") + "' and ChangeTime <='" + endDate.ToString("yyyy-MM-dd") + "' and ProjectId in ('" + string.Join("','", allProjects.Select(x => x.ProjectId)) + @"')
group by ProjectId,PostType";
DataTable dt = SQLHelper.GetDataTableRunText(strSql, null);
Dictionary<string, int> dic = new Dictionary<string, int>();
foreach (DataRow row in dt.Rows)
{ {
string projectid = row["ProjectId"].ToString(); getallin = APIPageDataService.getPersonNum(new List<string>(), DateTime.Now);
string postType = row["PostType"].ToString(); }
int PersonNum = int.Parse(row["PersonNum"].ToString()); else
if (!dic.ContainsKey(projectid)) {
{ getallin = APIPageDataService.getPersonNum(pids.ToList(), DateTime.Now);
dic.Add(projectid, PersonNum); }
} AllCount = getallin.Count();
else if (AllCount > 0)
{ {
dic[projectid] = dic[projectid] + PersonNum; MCount = getallin.Count(x => x.PostType == Const.PostType_1);
}
AllCount += PersonNum;
if(postType == Const.PostType_1)
{
MCount += PersonNum;
}
} }
div_xcrs.InnerHtml = AllCount.ToString(); div_xcrs.InnerHtml = AllCount.ToString();
div_zyxcrs.InnerHtml = (AllCount - MCount).ToString(); div_zyxcrs.InnerHtml = (AllCount - MCount).ToString();
@ -1035,14 +1006,7 @@ namespace FineUIPro.Web.common
foreach (var item in allProjects) foreach (var item in allProjects)
{ {
ProjectPersonMc += "'" + item.ShortName + "',"; ProjectPersonMc += "'" + item.ShortName + "',";
if (dic.ContainsKey(item.ProjectId)) ProjectPersonCount += "'" + getallin.Count(x => x.ProjectId == item.ProjectId) + "',";
{
ProjectPersonCount += "'" + dic[item.ProjectId] + "',";
}
else
{
ProjectPersonCount += "'0',";
}
} }
ProjectPersonMc = !string.IsNullOrWhiteSpace(ProjectPersonMc) ? ProjectPersonMc.TrimEnd(',') : string.Empty; ProjectPersonMc = !string.IsNullOrWhiteSpace(ProjectPersonMc) ? ProjectPersonMc.TrimEnd(',') : string.Empty;
ProjectPersonCount = !string.IsNullOrWhiteSpace(ProjectPersonCount) ? ProjectPersonCount.TrimEnd(',') : string.Empty; ProjectPersonCount = !string.IsNullOrWhiteSpace(ProjectPersonCount) ? ProjectPersonCount.TrimEnd(',') : string.Empty;