Compare commits

..

4 Commits

Author SHA1 Message Date
李超 8a61b56389 11 2026-03-29 12:03:57 +08:00
李超 8259e4c4bf 优化 菜单 2026-03-29 12:01:01 +08:00
李超 2063ad795e Merge branch 'master' of http://47.104.102.122:3000/panhf/CNCEC_SUBQHSE_WUHUAN 2025-12-12 10:16:36 +08:00
李超 ea67b3a5b9 11 2025-12-12 10:16:32 +08:00
4 changed files with 124 additions and 9 deletions

View File

@ -1,4 +1,5 @@
using BLL; using BLL;
using FineUIPro.Web.Person;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
@ -78,18 +79,47 @@ namespace FineUIPro.Web.HSSE.SitePerson
var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId); var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
if (project != null) if (project != null)
{ {
var personLists = BLL.PersonService.GetPersonList(project.ProjectId); // 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());
}
}
TreeNode rootNode = new TreeNode(); TreeNode rootNode = new TreeNode();
rootNode = new TreeNode rootNode = new TreeNode
{ {
Text = project.ProjectName, Text = project.ProjectName,
NodeID = project.ProjectId NodeID = project.ProjectId
}; };
if (personLists.Count() > 0) // if (personLists.Count() > 0)
if (proTotal > 0)
{ {
var personIn = personLists.Where(x => x.ProjectId == project.ProjectId && x.IsUsed == true //var personIn = personLists.Where(x => x.ProjectId == project.ProjectId && x.IsUsed == true
&& x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)).ToList(); // && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)).ToList();
rootNode.ToolTip = "当前项目人员总数:" + personLists.Count() + ";在场人员数:" + personIn.Count() + ";离场人员数:" + (personLists.Count() - personIn.Count()); //rootNode.ToolTip = "当前项目人员总数:" + personLists.Count() + ";在场人员数:" + personIn.Count() + ";离场人员数:" + (personLists.Count() - personIn.Count());
rootNode.ToolTip = "当前项目人员总数:" + proTotal + ";在场人员数:" + proIn + ";离场人员数:" + (proTotal - proIn);
} }
else else
{ {
@ -98,7 +128,85 @@ namespace FineUIPro.Web.HSSE.SitePerson
rootNode.Expanded = true; rootNode.Expanded = true;
rootNode.EnableClickEvent = true; rootNode.EnableClickEvent = true;
this.tvProjectAndUnit.Nodes.Add(rootNode); this.tvProjectAndUnit.Nodes.Add(rootNode);
GetUnitLists(rootNode.Nodes, project.ProjectId, personLists); //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);
}
} }
} }

View File

@ -432,7 +432,14 @@ namespace WebAPI.Controllers
{ {
person.PersonId = getPerson.PersonId; 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); person.PersonId = APIPersonService.SaveSitePerson(person);
var getProject = ProjectService.GetProjectByProjectId(person.ProjectId); var getProject = ProjectService.GetProjectByProjectId(person.ProjectId);
if (!string.IsNullOrEmpty(photourl) && getProject != null && getProject.IsFace == true) if (!string.IsNullOrEmpty(photourl) && getProject != null && getProject.IsFace == true)

View File

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

View File

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