公司级首页优化

This commit is contained in:
李鹏飞 2025-03-14 18:25:51 +08:00
parent 8a7efa5b3a
commit 20d8a06e6b
9 changed files with 330 additions and 599 deletions

View File

@ -0,0 +1,24 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.2.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FineUIPro.Web", "FineUIPro.Web.csproj", "{5BFDC841-2DBC-F866-44C3-59D17FD957BC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5BFDC841-2DBC-F866-44C3-59D17FD957BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5BFDC841-2DBC-F866-44C3-59D17FD957BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5BFDC841-2DBC-F866-44C3-59D17FD957BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5BFDC841-2DBC-F866-44C3-59D17FD957BC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A9E8FD10-65F9-4E22-92C9-035EDA2902F7}
EndGlobalSection
EndGlobal

View File

@ -22,6 +22,4 @@
<TreeNode id="7EC1FBAF-BEC9-46CD-9E3B-0D0093B4E1C2" Text="仪表完成情况" NavigateUrl="JDGL/Check/MeterCompletion.aspx"></TreeNode>
<TreeNode id="C7037A5D-D8A6-4C1C-A5B8-2083C31C0A7B" Text="全厂地下管网完成情况" NavigateUrl="JDGL/Check/UndergroundPipeCompletion.aspx"></TreeNode>
</TreeNode>
<TreeNode id="1FBC729D-0A8E-423C-B133-B64583BF9611" Text="进度软件(新)" NavigateUrl=""><TreeNode id="368DB90C-8A47-44F7-A69A-D2D60A6E338C" Text="费用项裁剪" NavigateUrl="JDGL/Progress/WbsManager.aspx"></TreeNode>
</TreeNode>
</Tree>

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Tree>
<TreeNode id="168A94C7-E37D-4B9C-8684-51DF4F8C5134" Text="关键事项(内部)" NavigateUrl="">
<TreeNode id="0BEA2126-7A48-40EB-8E21-99148E91A22B" Text="我创建的" NavigateUrl="PZHGL/GJSX/GJSXList.aspx?classify=0">
<TreeNode id="4A9E60ED-24FF-4410-B3B7-2A5079615A78" Text="待我处理" NavigateUrl="PZHGL/GJSX/GJSXList.aspx?classify=1">
</TreeNode>
<TreeNode id="4A9E60ED-24FF-4410-B3B7-2A5079615A78" Text="待我处理" NavigateUrl="PZHGL/GJSX/GJSXList.aspx?classify=1"></TreeNode>
<TreeNode id="BEF7850D-1BA5-45F9-BD40-E52F6D813E7C" Text="我已处理" NavigateUrl="PZHGL/GJSX/GJSXList.aspx?classify=2"></TreeNode>
<TreeNode id="3C129205-F6A9-480D-B36C-E35DED5D7CEC" Text="我参与的" NavigateUrl="PZHGL/GJSX/GJSXList.aspx?classify=3"></TreeNode>
</TreeNode>

View File

@ -22,8 +22,7 @@
<TreeNode id="179F286B-6DF8-414E-947F-82267076D4C8" Text="施工方案类型" NavigateUrl="BaseInfo/SolutionTempleteType.aspx"></TreeNode>
<TreeNode id="2181FB42-22F2-4342-B604-96F5770FE892" Text="分部分项工程定义" NavigateUrl="BaseInfo/SpecialSchemeType.aspx"></TreeNode>
<TreeNode id="D95CA72C-182C-4718-92A4-3F665E0FB660" Text="项目亮点类型定义" NavigateUrl="BaseInfo/PictureType.aspx"></TreeNode>
<TreeNode id="3044D68E-5018-4B57-BFC4-FBE4BCCA8B8B" Text="紧急程度定义" NavigateUrl="BaseInfo/QuestionType.aspx"></TreeNode>
<TreeNode id="C7E69F5F-04A8-41F9-8EA1-C41B13248421" Text="关键事项类别定义" NavigateUrl="BaseInfo/GJSXType.aspx"></TreeNode>
<TreeNode id="3044D68E-5018-4B57-BFC4-FBE4BCCA8B8B" Text="问题类别定义" NavigateUrl="BaseInfo/QuestionType.aspx"></TreeNode>
<TreeNode id="F0DF2F2B-7C12-4A0F-B7D4-0B00BADE1D64" Text="文档类别定义" NavigateUrl="BaseInfo/DocType.aspx"></TreeNode>
<TreeNode id="D0850615-BF32-4CFA-84CA-EEA261676EA8" Text="移交专业设置" NavigateUrl="BaseInfo/TransferMajor.aspx"></TreeNode>
</TreeNode>
@ -65,8 +64,6 @@
</TreeNode>
<TreeNode id="24A40837-0756-49B0-8B3C-EFB8A9879336" Text="合同设置" NavigateUrl=""><TreeNode id="E40C8FCE-3530-47D6-85EB-5C7E7E0A89FC" Text="施工分包方式定义" NavigateUrl=""></TreeNode>
</TreeNode>
<TreeNode id="88E597DD-D725-4991-8253-22C2626233D0" Text="邮箱管理" NavigateUrl=""><TreeNode id="32009B4F-3802-4C2F-824B-DBAA62876E7C" Text="邮箱配置" NavigateUrl="Email_Send/Email_Pop_Edit.aspx"></TreeNode>
</TreeNode>
</TreeNode>
<TreeNode id="75AA6177-8AAD-4AA4-BC4E-3883FB095A65" Text="项目设置" NavigateUrl=""><TreeNode id="B830399C-CA36-4C23-A170-21E556D052DD" Text="项目成立" NavigateUrl="ProjectData/ProjectSet.aspx"></TreeNode>
</TreeNode>

View File

@ -49,9 +49,9 @@
<TreeNode id="F7A324D0-2410-4B37-858C-10F0A3059C90" Text="尾项处理" NavigateUrl="TestRun/BeforeTestRun/TailTermHandleList.aspx"></TreeNode>
<TreeNode id="8542644D-BD9B-4188-9FDE-AE5D6D6D9A40" Text="尾项审核" NavigateUrl="TestRun/BeforeTestRun/TailTermApproveList.aspx"></TreeNode>
<TreeNode id="2254D22A-94EF-435F-9916-F07BD7082689" Text="检查表会签" NavigateUrl="TestRun/BeforeTestRun/InspectWanderAboutList.aspx"></TreeNode>
<TreeNode id="AF88737F-D665-4C81-99D5-A07A8910C1E0" Text="检查表流转全部通过" NavigateUrl="TestRun/BeforeTestRun/InspectWanderAboutAllPassList.aspx"></TreeNode>
<TreeNode id="F184E0FC-96E3-48A5-9515-21EAD37053B3" Text="现场实施" NavigateUrl="TestRun/BeforeTestRun/SiteImplementationList.aspx"></TreeNode>
<TreeNode id="19865B64-E0AA-4D32-9712-05C14FE6288F" Text="试车记录上传" NavigateUrl="TestRun/BeforeTestRun/TestRunRecordUploadList.aspx"></TreeNode>
<TreeNode id="AF88737F-D665-4C81-99D5-A07A8910C1E0" Text="检查表流转全部通过" NavigateUrl="TestRun/BeforeTestRun/InspectWanderAboutAllPassList.aspx"></TreeNode>
<TreeNode id="FCC050F0-0F13-4CE5-BE33-623377562965" Text="三查四定尾项清单" NavigateUrl="TestRun/BeforeTestRun/SubThreeChecksFourDecisionList.aspx"></TreeNode>
<TreeNode id="4822760B-395B-4979-B547-EA0D715C8A2C" Text="三查四定提出人处理" NavigateUrl="TestRun/BeforeTestRun/FourDecisionProposerHandle.aspx"></TreeNode>
<TreeNode id="E673FC27-74F1-479C-8DE1-950183566725" Text="三查四定责任人销项" NavigateUrl="TestRun/BeforeTestRun/FourDecisionResponsibilityConfirm.aspx"></TreeNode>
@ -69,11 +69,9 @@
<TreeNode id="0217CE50-3ABB-44F8-A38A-C9792C436639" Text="试车管理" NavigateUrl=""><TreeNode id="E3E38073-1DF4-4C02-AFC0-5C93EE7C23A8" Text="系统划分" NavigateUrl="TestRun/TestRunManage/DeviceRun.aspx"></TreeNode>
<TreeNode id="4B964B32-D5CC-48A2-8750-48BC4460C264" Text="工作包设置" NavigateUrl="TestRun/TestRunManage/SetWorkPackage.aspx"></TreeNode>
<TreeNode id="B6EE8E3B-77E2-416E-8985-3C78A2169B89" Text="工作包裁剪" NavigateUrl="TestRun/TestRunManage/SubSysWorkPackage.aspx"></TreeNode>
<TreeNode id="AF2B0CAD-DE15-4F15-A5EE-C8FB558D00C8" Text="检查项分组信息" NavigateUrl="TestRun/TestRunManage/TemplateItemGroup.aspx"></TreeNode>
<TreeNode id="545AACE6-34BE-4BAA-A495-B73198F1BDE2" Text="检查表模板" NavigateUrl="TestRun/TestRunManage/InspectTemplate.aspx"></TreeNode>
<TreeNode id="086DBD12-5649-4330-807A-44ABB257495F" Text="联动试车管理" NavigateUrl="TestRun/TestRunManage/SubInspectTerm.aspx"></TreeNode>
<TreeNode id="4041089F-5CC2-4070-9556-7DAB83CF6292" Text="检查表尾项管理" NavigateUrl="TestRun/TestRunManage/InspectTailTermList.aspx"></TreeNode>
<TreeNode id="A593B611-82C1-40D8-BB6A-DD025DB62F8C" Text="联动试车确认" NavigateUrl="TestRun/TestRunManage/SubWorkInspect.aspx"></TreeNode>
<TreeNode id="2232ED9A-EA3C-4CB5-A53C-D96D3F5E0527" Text="尾项处理" NavigateUrl="TestRun/TestRunManage/TailTermHandleList.aspx"></TreeNode>
<TreeNode id="9489BD6A-1A95-43BC-85C0-A65751C2C85E" Text="尾项审核" NavigateUrl="TestRun/TestRunManage/TailTermApproveList.aspx"></TreeNode>
<TreeNode id="26F8468D-4358-4E2A-895D-8720A6F1FA89" Text="检查表会签" NavigateUrl="TestRun/TestRunManage/InspectWanderAboutList.aspx"></TreeNode>

View File

@ -3,17 +3,4 @@
<TreeNode id="197F9A9A-480C-4CC3-B6B7-3A7D382DC3EB" Text="工艺系统清单" NavigateUrl="Transfer/LHCSystemList.aspx?Type=0">
</TreeNode>
<TreeNode id="022428DC-FC99-4916-B8AF-6A9DC885DFAF" Text="非工艺系统清单" NavigateUrl="Transfer/LHCSystemList.aspx?Type=1"></TreeNode>
<TreeNode id="3517DBE2-9728-4BA0-9EA5-AE2147DB883B" Text="移交图表" NavigateUrl=""><TreeNode id="2352E44F-BE12-4012-B43F-AAF649EDAC32" Text="尾项完成统计表" NavigateUrl="Transfer/Chart/PunchlistFromChartNew.aspx"></TreeNode>
<TreeNode id="E305689E-5D84-4C1A-BF67-85FA2D828115" Text="移交统计表" NavigateUrl="Transfer/Chart/Systemstatus.aspx"></TreeNode>
<TreeNode id="60838E30-4A46-4878-B299-C234900B10B7" Text="移交统计图表" NavigateUrl="Transfer/Chart/SystemstatusChart.aspx"></TreeNode>
<TreeNode id="25C13642-AE77-42E2-B0FB-32663B68F93F" Text="移交状态汇总表" NavigateUrl="Transfer/Chart/SystemStatusSummary.aspx"></TreeNode>
</TreeNode>
<TreeNode id="D94C1BA4-9DFD-4514-AE12-6F886C5D8C9B" Text="管道" NavigateUrl="Transfer/Piping.aspx"></TreeNode>
<TreeNode id="982F746C-084C-445C-9AE8-8C37BDFE7994" Text="静设备" NavigateUrl="Transfer/StaticEquipment.aspx"></TreeNode>
<TreeNode id="7E2FB5F9-FB99-4455-B68F-460F1F9A2676" Text="动设备" NavigateUrl="Transfer/RotatingEquipment.aspx"></TreeNode>
<TreeNode id="88F51059-55B4-4CD5-A38C-36404E5029F6" Text="仪表" NavigateUrl="Transfer/Instrumentation.aspx"></TreeNode>
<TreeNode id="296E75D2-192A-4D1F-8471-DD34263F8691" Text="电气" NavigateUrl="Transfer/Electrical.aspx"></TreeNode>
<TreeNode id="95C39F86-C060-452E-BA37-D891C466A39B" Text="土建/建筑/结构" NavigateUrl="Transfer/CivilStructure.aspx"></TreeNode>
<TreeNode id="58FFBD80-ACB9-4830-A18A-E025D9600D94" Text="电信" NavigateUrl="Transfer/Telecom.aspx"></TreeNode>
<TreeNode id="016903B1-3B86-4CF5-AFF8-FF8BE389BEE5" Text="尾项管理" NavigateUrl="Transfer/PunchlistFrom.aspx"></TreeNode>
</Tree>

View File

@ -27,8 +27,8 @@
<TreeNode id="ECDD89AC-1E16-4D82-B3BE-5D62F31B7A14" Text="化工行业能源节约与生态环境保护汇总表" NavigateUrl="ZHGL/Environmental/ChemicalReport.aspx"></TreeNode>
<TreeNode id="7652D239-1897-4886-8DF2-B71E3B060D21" Text="中央企业节能环保产业企业基本情况和经营情况报表" NavigateUrl="ZHGL/Environmental/OperationReport.aspx"></TreeNode>
<TreeNode id="30579BFE-AB4B-49A7-A73D-B7CE902A8B69" Text="中央企业节能环保产业企业生产和服务业务情况报表" NavigateUrl="ZHGL/Environmental/EnergyReport.aspx"></TreeNode>
<TreeNode id="CB76394B-BDEB-4F45-9D19-F38612DC6591" Text="中央企业安全生产治本攻坚三年行动工作台账" NavigateUrl="ZHGL/Information/ActionWorkLedger.aspx"></TreeNode>
<TreeNode id="C48087A8-4C9F-485D-B0A4-C85E112BA705" Text="中央企业安全生产管理评价工作调度台账" NavigateUrl="ZHGL/Information/SafetyProductionEvaluation.aspx"></TreeNode>
<TreeNode id="CB76394B-BDEB-4F45-9D19-F38612DC6591" Text="安全生产治本攻坚三年行动工作台账" NavigateUrl="ZHGL/Information/ActionWorkLedger.aspx"></TreeNode>
<TreeNode id="C48087A8-4C9F-485D-B0A4-C85E112BA705" Text="安全生产管理评价工作调度台账" NavigateUrl="ZHGL/Information/SafetyProductionEvaluation.aspx"></TreeNode>
</TreeNode>
<TreeNode id="C0F4A4A5-D5D3-4952-9A90-9B27F5FA9DFA" Text="安全信息分析" NavigateUrl=""><TreeNode id="598568A0-A338-499F-888C-1B73665837F9" Text="人工时费用分析" NavigateUrl="ZHGL/Information/AnalyseWorkTimeCost.aspx"></TreeNode>
<TreeNode id="8396C9E2-3376-4144-978A-CC6041EC6C6A" Text="安全事故分析" NavigateUrl="ZHGL/Information/AnalyseSafeAccident.aspx"></TreeNode>
@ -88,6 +88,4 @@
</TreeNode>
<TreeNode id="EA413D2A-8D29-4DE2-932D-8511BB7F6CB2" Text="各项目巡查汇总" NavigateUrl="ZHGL/InspectionSummary/InspectionSummary.aspx"></TreeNode>
<TreeNode id="F2133BD6-C786-407A-AD6F-3EEF613229A8" Text="施工管理绩效数据" NavigateUrl="ZHGL/Performance/PerformanceAllData.aspx"></TreeNode>
<TreeNode id="53D8CED2-9AA7-43EA-B27D-EA10A06DF713" Text="开车人员绩效管理" NavigateUrl=""><TreeNode id="383290E0-60AE-4D16-8B5E-3899B85EC2ED" Text="开车绩效评分标准" NavigateUrl="ZHGL/TestRunPerformance/TestRunPerformanceStandard.aspx"></TreeNode>
</TreeNode>
</Tree>

View File

@ -1,4 +1,4 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="main_new.aspx.cs" Inherits="FineUIPro.Web.common.main_new" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="main_new.aspx.cs" Inherits="FineUIPro.Web.common.main_new" Async="true"%>
<!DOCTYPE html>

View File

@ -1,10 +1,12 @@
using BLL;
using FineUIPro.Web.DataShow;
using Model;
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
@ -17,278 +19,38 @@ namespace FineUIPro.Web.common
public static List<Model.Solution_LargerHazard> LargerHazard = new List<Model.Solution_LargerHazard>();
public string[] pids { get; set; }
protected void Page_Load(object sender, EventArgs e)
protected async void Page_Load(object sender, EventArgs e)
{
/* if (!IsPostBack)
{
Model.SGGLDB db = Funs.DB;
if (!string.IsNullOrEmpty(CurrUser.CompanyProjectId))
{
pids = CurrUser.CompanyProjectId.Split(',');
}
else
{
//加载所有在建项目的数据
var pidArray = Funs.DB.Base_Project.Where(x => x.ProjectState == "1").Select(x => x.ProjectId).ToArray();
if (pidArray.Length > 0)
{
pids = pidArray;
}
}
//未遂事故
this.divWS.InnerHtml = GetNearMissNum().ToString();
//安全人工时
var countAqrgsSum = Convert.ToDecimal(0);
if (pids == null)
{
countAqrgsSum = CountAqrgs();
}
else
{
countAqrgsSum = CountAqrgs(null, null, pids);
}
if (countAqrgsSum > 10000)
{
countAqrgsSum = countAqrgsSum / Convert.ToDecimal(10000.00);
this.divSafeWorkTime.InnerHtml = Math.Round(countAqrgsSum, 2).ToString() + "万";
}
else
{
this.divSafeWorkTime.InnerHtml = countAqrgsSum.ToString().Split('.')[0];
}
//本月安全人工时
//int wHoursMonth = 0;
//DateTime? sDate = Funs.GetNewDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString());
//var dayReports = getMonthReportsByCompany(sDate);
//if (dayReports.Count > 0)
//{
// wHoursMonth = Convert.ToInt32(dayReports[0].DayWorkTime);
//}
DateTime d1 = getStartMonth();
DateTime d2 = getEndMonth();
var countMonthAqrgs = Convert.ToDecimal(0);
if (pids == null)
{
countMonthAqrgs = CountAqrgs(d1, d2);
}
else
{
countMonthAqrgs = CountAqrgs(d1, d2, pids);
}
if (countMonthAqrgs > 10000)
{
countMonthAqrgs = countMonthAqrgs / Convert.ToDecimal(10000.00);
this.divSafeWorkTimeMonth.InnerHtml = Math.Round(countMonthAqrgs, 2).ToString() + "万";
}
else
{
this.divSafeWorkTimeMonth.InnerHtml = CountAqrgs(d1, d2).ToString().Split('.')[0];
}
//int wHoursMonth = db.SitePerson_PersonInOutNumber.Where(x => x.InOutDate > DateTime.Now.AddDays(-Convert.ToInt32(DateTime.Now.Date.Day)))
// .Max(x => x.WorkHours) ?? 0;
//this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString();
//安全培训累计人员
var getTrainRecord = 0;
var boShengCount = 0;
if (pids == null)
{
getTrainRecord = db.EduTrain_TrainRecord.Sum(x => x.TrainPersonNum) ?? 0;
//修改:增加博晟教育中的人数
boShengCount = db.Bo_Sheng_TrainPerson.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null)).ToList().Count;
this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString();
}
else
{
getTrainRecord = db.EduTrain_TrainRecord.Where(x => pids.Contains(x.ProjectId)).Sum(x => x.TrainPersonNum) ?? 0;
//修改:增加博晟教育中的人数
boShengCount = db.Bo_Sheng_TrainPerson.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null)
&& pids.Contains(x.ProjectId)).ToList().Count;
this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString();
}
if (pids == null)
{
//安全管理人员
var allSum = from x in Funs.DB.SitePerson_Person
where x.IsUsed == true && x.InTime < DateTime.Now && (x.OutTime == null || x.OutTime > DateTime.Now)
select x;
var glAllPerson = from x in allSum
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
//where (y.PostType == "1" || y.PostType == "4") //一般管理岗位和特种管理人员
where y.IsHsse == true
select x;
this.divSafeManagePersonNum.InnerText = glAllPerson.Count().ToString();
}
else
{
//安全管理人员
var allSum = from x in Funs.DB.SitePerson_Person
where x.IsUsed == true && x.InTime < DateTime.Now && (x.OutTime == null || x.OutTime > DateTime.Now)
&& pids.Contains(x.ProjectId)
select x;
var glAllPerson = from x in allSum
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
//where (y.PostType == "1" || y.PostType == "4") //一般管理岗位和特种管理人员
where y.IsHsse == true
select x;
this.divSafeManagePersonNum.InnerText = glAllPerson.Count().ToString();
}
#region
int CqmsManageNum = 0;
int CqmsPxNum = 0;
//质量培训人员
DateTime date = DateTime.Now.AddDays(-1);
if (pids == null)
{
CqmsManageNum = (from x in Funs.DB.Person_CompanyBranchPerson
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where x.IsOnJob == true && y.IsCQMS == true
select x).Count() +
(from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where x.IsUsed == true && y.IsCQMS == true
select x).Count();
this.divCqmsManageNum.InnerText = CqmsManageNum.ToString();
CqmsPxNum = (from x in Funs.DB.Comprehensive_InspectionPerson
where x.IsTrain == true
select x).Count();
divCqmsPxNum.InnerText = CqmsPxNum.ToString();
}
else
{
CqmsManageNum = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where x.IsUsed == true && y.IsCQMS == true && pids.Contains(x.ProjectId)
select x).Count();
this.divCqmsManageNum.InnerText = CqmsManageNum.ToString();
CqmsPxNum = (from x in Funs.DB.Comprehensive_InspectionPerson
where x.IsTrain == true && pids.Contains(x.ProjectId)
select x).Count();
divCqmsPxNum.InnerText = CqmsPxNum.ToString();
}
#endregion
//在建项目
if (pids == null)
{
allProjects = ProjectService.GetAllProjectDropDownList();
}
else
{
allProjects = ProjectService.GetAllProjectDropDownList(pids);
}
int acount = allProjects.Count();
int pcount1 = 0;
int pcount2 = 0;
int pcount3 = 0;
if (acount > 0)
{
pcount1 = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Count();
var pidzjsg = string.Join(",", allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x => x.ProjectId)).Split(',');
if (pids == null)
{
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pidzjsg.Contains(x.ProjectId) select x).Count();
}
else
{
pidzjsg = pids;
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pids.Contains(x.ProjectId) select x).Count();
}
pcount3 = Count3(pidzjsg);
}
div_zjxmCount.InnerHtml = pcount1.ToString() + "<div class=\"th\">个</div>";
div_cjrsCount.InnerHtml = pcount2.ToString() + "<div class=\"th\">人</div>";
div_wdgcCount.InnerHtml = pcount3.ToString() + "<div class=\"th\">个</div>";
//质量问题
getZlwt();
//质量共检
getZlgj();
//焊接
getHj();
//关键事项
getGjsx();
//人员信息
getSitePerson();
//项目人员图表
getProjectSitePerson();
//进度
getJd();
//整改数据
getZgsj();
//材料到货表格
getCldh();
}
*/
if (!IsPostBack)
{
InitializeProjectIds(); // 项目ID初始化封装
BindSafetyStatistics(); // 安全统计模块
BindQualityStatistics(); // 质量统计模块
BindProjectStatistics(); // 项目统计模块
getZlwt();
//质量共检
getZlgj();
var projectTask = GetProjectAsync();
var project2Task = GetProject2Async();
var otherTasks = new List<Task>
{
BindSafetyStatisticsAsync(), // 安全统计模块
BindQualityStatisticsAsync(), // 质量统计模块
BindProjectStatisticsAsync(), // 项目统计模块
GetZlwtAsync(), // 质量问题
GetZlgjAsync(), // 质量共检
GetHjAsync(), // 焊接
GetGjsxAsync(), // 关键事项
GetSitePersonAsync(), // 人员信息
GetProjectSitePersonAsync(), // 项目人员图表
GetJdAsync(), // 进度
GetZgsjAsync(), // 整改数据
GetCldhAsync() // 材料到货表格
};
//焊接
getHj();
await Task.WhenAll(otherTasks.Concat(new[] { projectTask, project2Task }));
//关键事项
getGjsx();
//人员信息
getSitePerson();
//项目人员图表
getProjectSitePerson();
//进度
getJd();
//整改数据
getZgsj();
//材料到货表格
getCldh();
// 设置项目信息
Project = await projectTask;
Project2 = await project2Task;
}
}
// 初始化项目ID集合
private void InitializeProjectIds()
{
@ -299,9 +61,20 @@ namespace FineUIPro.Web.common
.Where(x => x.ProjectState == "1")
.Select(x => x.ProjectId)
.ToArray();
//在建项目
if (pids == null)
{
allProjects = ProjectService.GetAllProjectDropDownList();
}
else
{
allProjects = ProjectService.GetAllProjectDropDownList(pids);
}
}
// 安全统计模块封装
private void BindSafetyStatistics()
private async Task BindSafetyStatisticsAsync()
{
await Task.Run(() =>
{
var db = Funs.DB;
// 未遂事故
@ -367,9 +140,10 @@ namespace FineUIPro.Web.common
(person, post) => person)
.Count();
divSafeManagePersonNum.InnerText = safetyStaffCount.ToString();
});
}
// 质量统计模块封装
private void BindQualityStatistics()
private async Task BindQualityStatisticsAsync()
{
var db = Funs.DB;
// 质量管理人员(合并公司+项目级查询)
@ -389,18 +163,10 @@ namespace FineUIPro.Web.common
.Count(x => x.IsTrain == true).ToString();
}
// 项目统计优化
private void BindProjectStatistics()
private async Task BindProjectStatisticsAsync()
{
var db = Funs.DB;
//在建项目
if (pids == null)
{
allProjects = ProjectService.GetAllProjectDropDownList();
}
else
{
allProjects = ProjectService.GetAllProjectDropDownList(pids);
}
int acount = allProjects.Count();
int pcount1 = 0;
@ -573,7 +339,13 @@ namespace FineUIPro.Web.common
#region
protected string Project
{
get
get;
set;
}
protected async Task<string> GetProjectAsync()
{
return await Task.Run(() =>
{
Model.SingleSerie series = new Model.SingleSerie();
var project1s = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null);
@ -782,14 +554,20 @@ namespace FineUIPro.Web.common
series.convert = convert;
series.loc = loc;
return JsonConvert.SerializeObject(series);
}
});
}
#endregion
#region
protected string Project2
{
get
get;
set;
}
protected async Task<string> GetProject2Async()
{
return await Task.Run(() =>
{
Model.SingleSerie series = new Model.SingleSerie();
var project1s = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null);
@ -809,7 +587,6 @@ namespace FineUIPro.Web.common
if (item.EndDate != null)
{
endDate = string.Format("{0:yyyy-MM-dd}", item.EndDate);
//获取剩余天数
residueDay = DateDiff(DateTime.Now, Convert.ToDateTime(item.EndDate)).ToString();
}
decimal jdNum = 0;
@ -826,7 +603,7 @@ namespace FineUIPro.Web.common
str = str.Substring(0, str.Length - 1);
}
return str;
}
});
}
/// <summary>
@ -867,7 +644,9 @@ namespace FineUIPro.Web.common
protected string zlzgl;
protected string zgzglDataValue;
protected void getZlwt()
private async Task GetZlwtAsync()
{
await Task.Run(() =>
{
if (pids == null)
{
@ -911,7 +690,7 @@ namespace FineUIPro.Web.common
zgzglDataValue = (100 - (100.0 * num2 / (num2 + num3))).ToString();
}
});
}
#endregion
@ -921,13 +700,14 @@ namespace FineUIPro.Web.common
protected string zlgjzgl;
protected string zggjzglDataValue;
protected void getZlgj()
private async Task GetZlgjAsync()
{
await Task.Run(() =>
{
if (pids == null)
{
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
select x).Count();
//Check_JointCheck
zlgjallNumber = num1.ToString();
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
@ -944,7 +724,6 @@ namespace FineUIPro.Web.common
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where pids.Contains(x.ProjectId)
select x).Count();
//Check_JointCheck
zlgjallNumber = num1.ToString();
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
@ -956,7 +735,7 @@ namespace FineUIPro.Web.common
zlgjzgl = zgl.ToString();
zggjzglDataValue = (100 - (100.0 * num2 / num1)).ToString();
}
});
}
#endregion
@ -967,7 +746,9 @@ namespace FineUIPro.Web.common
protected string hjzgl = "0";
protected string hjDataValue = "0";
protected void getHj()
private async Task GetHjAsync()
{
await Task.Run(() =>
{
Model.SingleSerie series = new Model.SingleSerie();
Model.BusinessColumn businessColumn = new Model.BusinessColumn();
@ -981,7 +762,6 @@ namespace FineUIPro.Web.common
}
decimal a = 0, b = 0;
var sumResult = ndtLists
.GroupBy(x => x.ProjectId)
.Select(g => new {
@ -999,24 +779,7 @@ namespace FineUIPro.Web.common
});
a = sumResult.Sum(x=>x.A);
b = sumResult.Sum(x => x.B);
/* if (ndtLists.Count() > 0)
{
foreach (var project in allProjects)
{
var ndt = (from x in ndtLists
where x.ProjectId == project.ProjectId
orderby x.CreateDate descending
select x).FirstOrDefault();
if (ndt != null)
{
if (ndt.TotalQuantity.HasValue)
{
a += Math.Floor(ndt.TotalQuantity.Value * Funs.GetNewDecimalOrZero(ndt.TotalRate) / 100);
b += ndt.TotalQuantity.Value;
}
}
}
}*/
if (b > 0)
{
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2));
@ -1026,25 +789,7 @@ namespace FineUIPro.Web.common
hjzgl = result.ToString();
hjDataValue = (100 - result).ToString();
}
//if (ndtLists.Count() > 0)
//{
// foreach (var item in ndtLists)
// {
// //a += Funs.GetNewDecimalOrZero(item.OneTimeFilmQualifiedAmount);
// //b += Funs.GetNewDecimalOrZero(item.OneTimeFilmAmount);
// }
// if (b > 0)
// {
// result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2));
// hjallNumber = b.ToString();
// hjfinishNumber = a.ToString();
// hjzgl = result.ToString();
// hjDataValue = (100 - result).ToString();
// }
//}
});
}
#endregion
@ -1052,29 +797,26 @@ namespace FineUIPro.Web.common
#region
//准点率
protected string gjsxZdl = "0";
protected void getGjsx()
private async Task GetGjsxAsync()
{
await Task.Run(() =>
{
if (pids == null)
{
//Check_JointCheck
var znum = (from x in Funs.DB.GJSX
select x).Count();
var znum = (from x in Funs.DB.GJSX select x).Count();
divGjsxzj.InnerHtml = znum.ToString();
//到期应完成
var dqnum = (from x in Funs.DB.GJSX
where x.CompleteDate <= DateTime.Now
select x).Count().ToString();
divGjsxdq.InnerHtml = dqnum;
//未准点完成
var wzdnum = (from x in Funs.DB.GJSX
where x.CompleteDate <= DateTime.Now
&& x.State != "0"
select x).Count().ToString();
divGjsxwzd.InnerHtml = wzdnum;
//准点率,已完成/总数*100
var ywcnum = (from x in Funs.DB.GJSX
where x.CompleteDate <= DateTime.Now
&& x.State == "0"
@ -1083,39 +825,37 @@ namespace FineUIPro.Web.common
}
else
{
//Check_JointCheck
var znum = (from x in Funs.DB.GJSX
where pids.Contains(x.ProjectId)
select x).Count();
divGjsxzj.InnerHtml = znum.ToString();
//到期应完成
var dqnum = (from x in Funs.DB.GJSX
where x.CompleteDate <= DateTime.Now && pids.Contains(x.ProjectId)
select x).Count().ToString();
divGjsxdq.InnerHtml = dqnum;
//未准点完成
var wzdnum = (from x in Funs.DB.GJSX
where x.CompleteDate <= DateTime.Now
&& x.State != "0" && pids.Contains(x.ProjectId)
select x).Count().ToString();
divGjsxwzd.InnerHtml = wzdnum;
//准点率,已完成/总数*100
var ywcnum = (from x in Funs.DB.GJSX
where x.CompleteDate <= DateTime.Now
&& x.State == "0" && pids.Contains(x.ProjectId)
select x).Count();
gjsxZdl = Math.Round((100.0 * ywcnum / znum), 2).ToString();
}
});
}
#endregion
#region
private void getSitePerson()
private async Task GetSitePersonAsync()
{
await Task.Run(() =>
{
int AllCount = 0;
int MCount = 0;
@ -1134,19 +874,19 @@ namespace FineUIPro.Web.common
MCount = getallin.Where(x => x.PostType == Const.PostType_1).Count();
}
////当前现场总人数
div_xcrs.InnerHtml = AllCount.ToString();
//作业人数
div_zyxcrs.InnerHtml = (AllCount - MCount).ToString();
//管理人数
div_glxcrs.InnerHtml = MCount.ToString();
});
}
#endregion
#region
protected string ProjectPersonCount;
protected string ProjectPersonMc;
private void getProjectSitePerson()
private async Task GetProjectSitePersonAsync()
{
await Task.Run(() =>
{
var list = new List<Model.Base_Project>();
if (pids == null)
@ -1158,7 +898,6 @@ namespace FineUIPro.Web.common
list = Funs.DB.Base_Project.Where(x => pids.Contains(x.ProjectId)).ToList();
}
foreach (var item in list)
{
ProjectPersonMc += "'" + item.ShortName + "',";
@ -1166,13 +905,14 @@ namespace FineUIPro.Web.common
}
ProjectPersonMc = ProjectPersonMc.TrimEnd(',');
ProjectPersonCount = ProjectPersonCount.TrimEnd(',');
});
}
#endregion
#region
protected string ProjectJd;
protected string ProjectMc;
protected void getJd()
protected async Task GetJdAsync()
{
var list = new List<Model.Base_Project>();
if (pids == null)
@ -1195,12 +935,11 @@ namespace FineUIPro.Web.common
ProjectJd = ProjectJd.TrimEnd(',');
ProjectMc = ProjectMc.TrimEnd(',');
}
}
#endregion
#region
protected void getZgsj()
protected async Task GetZgsjAsync()
{
div_zgsj.InnerHtml = (GetGeneralClosedNum() + GetGeneralNotClosedNum()).ToString();
div_zgywc.InnerHtml = GetGeneralClosedNum().ToString();
@ -1260,10 +999,8 @@ namespace FineUIPro.Web.common
protected string gdclHead = "<div class=\"th-p\">项目</div><div class=\"th-p\">管子</div><div class=\"th-p\">管件</div><div class=\"th-p\">阀门</div><div class=\"th-p\">垫片</div><div class=\"th-p\">紧固件</div>";
protected string sbclHead = "<div class=\"th-p\">项目</div><div class=\"th-p\">采购量</div><div class=\"th-p\">到货量</div><div class=\"th-p\">已到货百分比</div>";
private void getCldh()
private async Task GetCldhAsync()
{
//项目
var list = new List<Model.Base_Project>();
if (pids == null)
{
@ -1382,12 +1119,6 @@ namespace FineUIPro.Web.common
sbclHtml += " </div>";
#endregion
}
}
#endregion
@ -1414,7 +1145,6 @@ namespace FineUIPro.Web.common
select x).Count();
return result;
}
}
}
}