Compare commits

..

No commits in common. "8a61b5638953a794d5696561d0dc932590483dfb" and "f2ad3f60c10559da591ce36f222319e77c23bd2a" have entirely different histories.

4 changed files with 9 additions and 124 deletions

View File

@ -1,5 +1,4 @@
using BLL;
using FineUIPro.Web.Person;
using System;
using System.Collections.Generic;
using System.Data;
@ -79,47 +78,18 @@ namespace FineUIPro.Web.HSSE.SitePerson
var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
if (project != null)
{
// var personLists = BLL.PersonService.GetPersonList(project.ProjectId);
String strSql1 = @"select UnitId,count( * ) num from SitePerson_Person
where ProjectId='" + this.CurrUser.LoginProjectId + @"'
group by UnitId";
String strSql2 = @" select UnitId,count( * ) num from SitePerson_Person
where ProjectId='" + this.CurrUser.LoginProjectId + @"' and IsUsed =1 and InTime<='" + DateTime.Now.ToString("yyyy-MM-dd") + "' and (OutTime is null or OutTime>'" + DateTime.Now.ToString("yyyy-MM-dd") + @"' )
group by UnitId";
DataTable dt1 = SQLHelper.GetDataTableRunText(strSql1, null);
DataTable dt2 = SQLHelper.GetDataTableRunText(strSql2, null);
int proTotal = 0;
int proIn = 0;
if (dt1 != null && dt1.Rows.Count > 0)
{
foreach (DataRow row in dt1.Rows)
{
proTotal += int.Parse(row["num"].ToString());
}
}
if (dt2 != null && dt2.Rows.Count > 0)
{
foreach (DataRow row in dt2.Rows)
{
proIn += int.Parse(row["num"].ToString());
}
}
var personLists = BLL.PersonService.GetPersonList(project.ProjectId);
TreeNode rootNode = new TreeNode();
rootNode = new TreeNode
{
Text = project.ProjectName,
NodeID = project.ProjectId
};
// if (personLists.Count() > 0)
if (proTotal > 0)
if (personLists.Count() > 0)
{
//var personIn = personLists.Where(x => x.ProjectId == project.ProjectId && x.IsUsed == true
// && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)).ToList();
//rootNode.ToolTip = "当前项目人员总数:" + personLists.Count() + ";在场人员数:" + personIn.Count() + ";离场人员数:" + (personLists.Count() - personIn.Count());
rootNode.ToolTip = "当前项目人员总数:" + proTotal + ";在场人员数:" + proIn + ";离场人员数:" + (proTotal - proIn);
var personIn = personLists.Where(x => x.ProjectId == project.ProjectId && x.IsUsed == true
&& x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)).ToList();
rootNode.ToolTip = "当前项目人员总数:" + personLists.Count() + ";在场人员数:" + personIn.Count() + ";离场人员数:" + (personLists.Count() - personIn.Count());
}
else
{
@ -128,85 +98,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
rootNode.Expanded = true;
rootNode.EnableClickEvent = true;
this.tvProjectAndUnit.Nodes.Add(rootNode);
//GetUnitLists(rootNode.Nodes, project.ProjectId, personLists);
GetUnitLists(rootNode.Nodes, this.ProjectId, dt1, dt2);
}
}
private void GetUnitLists(TreeNodeCollection nodes, string parentId, DataTable dt1, DataTable dt2)
{
List<Model.Base_Unit> unitLists = BLL.UnitService.GetUnitByProjectIdList(parentId);
if (unitLists.Count() > 0)
{
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(parentId, this.CurrUser.UnitId))
{
unitLists = unitLists.Where(x => x.UnitId == this.CurrUser.UnitId).ToList();
}
//添加其他单位/无单位人员
Model.Base_Unit otherUnit = new Model.Base_Unit
{
UnitId = "0",
UnitName = "其他"
};
unitLists.Add(otherUnit);
TreeNode newNode = null;
foreach (var q in unitLists)
{
newNode = new TreeNode
{
Text = q.UnitName,
NodeID = q.UnitId + "|" + parentId,
ToolTip = q.UnitName
};
int proTotal = 0;
int proIn = 0;
if (dt1 != null && dt1.Rows.Count > 0)
{
foreach (DataRow row in dt1.Rows)
{
if (q.UnitId == "0" && string.IsNullOrEmpty(row["UnitId"].ToString()))
{
proTotal = int.Parse(row["num"].ToString());
break;
}
else if (q.UnitId == row["UnitId"].ToString())
{
proTotal = int.Parse(row["num"].ToString());
break;
}
}
}
if (dt2 != null && dt2.Rows.Count > 0)
{
foreach (DataRow row in dt2.Rows)
{
if (q.UnitId == "0" && string.IsNullOrEmpty(row["UnitId"].ToString()))
{
proIn = int.Parse(row["num"].ToString());
break;
}
else if (q.UnitId == row["UnitId"].ToString())
{
proIn = int.Parse(row["num"].ToString());
break;
}
}
}
if (proTotal > 0)
{
newNode.ToolTip = q.UnitName + "人员总数:" + proTotal + ";在场人员数:" + proIn + ";离场人员数:" + (proTotal - proIn);
}
else
{
newNode.ToolTip = q.UnitName + "人员总数0";
}
newNode.EnableClickEvent = true;
nodes.Add(newNode);
}
GetUnitLists(rootNode.Nodes, project.ProjectId, personLists);
}
}

View File

@ -432,14 +432,7 @@ namespace WebAPI.Controllers
{
person.PersonId = getPerson.PersonId;
}
if (!string.IsNullOrEmpty(person.UnitId))
{
var unit = db.Base_Unit.FirstOrDefault(x => x.UnitCode == person.UnitId|| x.UnitName == person.UnitId);
if (unit != null)
{
person.UnitId = unit.UnitId;
}
}
person.PersonId = APIPersonService.SaveSitePerson(person);
var getProject = ProjectService.GetProjectByProjectId(person.ProjectId);
if (!string.IsNullOrEmpty(photourl) && getProject != null && getProject.IsFace == true)

View File

@ -12,7 +12,7 @@
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<publishUrl>D:\发布\五环WebApi</publishUrl>
<publishUrl>G:\发布\五环WebApi</publishUrl>
<DeleteExistingFiles>true</DeleteExistingFiles>
<PrecompileBeforePublish>true</PrecompileBeforePublish>
<EnableUpdateable>true</EnableUpdateable>

View File

@ -9,7 +9,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<NameOfLastUsedPublishProfile>D:\project\vs\47\CNCEC_SUBQHSE_WUHUAN\SGGL\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<NameOfLastUsedPublishProfile>G:\公司项目\五环\SGGL\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ControllerDialogWidth>1440</WebStackScaffolding_ControllerDialogWidth>