20230915wbs数据分析页面框架实现

This commit is contained in:
杨红卫 2023-09-15 10:27:20 +08:00
parent 578bb8bfa7
commit 508d10c3e5
11 changed files with 191 additions and 252 deletions

View File

@ -341,6 +341,7 @@
<Compile Include="CQMS\WBS\WorkPackageService.cs" />
<Compile Include="DigData\CQMSDataCollectService.cs" />
<Compile Include="DigData\CQMSDataDWService .cs" />
<Compile Include="DigData\ProjectWBSAnalysisService.cs" />
<Compile Include="DigData\WBSAnalysisService.cs" />
<Compile Include="DigData\HTGLDataDWService.cs" />
<Compile Include="DigData\JDGLDataDWService.cs" />

View File

@ -0,0 +1,123 @@
using FineUIPro;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web.Util;
namespace BLL
{
/// <summary>
/// WBS分析
/// </summary>
public static class ProjectWBSAnalysisService
{
public static Model.SGGLDB db = Funs.DB;
#region WBS分析
/// <summary>
/// 记录数
/// </summary>
public static int count
{
get;
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.WBS_WorkPackage> getDataLists = from x in db.WBS_WorkPackage
where x.IsApprove == true
select x;
/// <summary>
/// 合同管理数据仓库
/// </summary>
/// <param name="projectId"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getDataDWList(string projectId, string workPackageId, Grid Grid1)
{
var getDataList = getDataLists.Where(x => x.ProjectId == projectId);
if (string.IsNullOrEmpty(workPackageId))
{
List<Model.WBS_WorkPackage> listWork = new List<Model.WBS_WorkPackage>();
Model.WBS_WorkPackage work1 = new Model.WBS_WorkPackage
{
WorkPackageCode = "1",
PackageContent = "建筑工程",
};
listWork.Add(work1);
Model.WBS_WorkPackage work2 = new Model.WBS_WorkPackage
{
WorkPackageCode = "2",
PackageContent = "安装工程",
};
listWork.Add(work2);
getDataList = listWork.AsQueryable();
}
else
{
if (workPackageId != "1" && workPackageId != "2")
{
var getUnitWork = db.WBS_UnitWork.FirstOrDefault(x => x.ProjectId == projectId && x.UnitWorkId == workPackageId);
if (getUnitWork != null)
{
getDataList = getDataList.Where(x => x.UnitWorkId == workPackageId && x.SuperWorkPack == null);
}
else
{
getDataList = getDataList.Where(x => x.SuperWorkPack == workPackageId);
if (getDataList.Count() == 0)
{
getDataList = getDataLists.Where(x => x.WorkPackageId == workPackageId);
}
}
}
else
{
var getUnitWork = from x in db.WBS_UnitWork
where x.ProjectId == projectId && x.SuperUnitWork == null && x.ProjectType == workPackageId
select x;
List<Model.WBS_WorkPackage> listWork = new List<Model.WBS_WorkPackage>();
foreach (var item in getUnitWork)
{
Model.WBS_WorkPackage workItem = new Model.WBS_WorkPackage
{
WorkPackageCode = item.UnitWorkId,
PackageContent = item.UnitWorkCode + "-" + item.UnitWorkName,
};
listWork.Add(workItem);
}
getDataList = listWork.AsQueryable();
}
}
count = getDataList.Count();
if (count == 0)
{
return null;
}
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in getDataList
select new
{
x.WorkPackageCode,
x.PackageContent,
Count1 = 0,
Count2 = 0,
Count3 = 0,
Count4 = 0,
Count5 = 0,
Count6 = 0,
};
}
#endregion
}
}

View File

@ -38,49 +38,39 @@ namespace BLL
/// <param name="endTime"></param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getDataDWList(string level,string workPackageId, Grid Grid1)
public static IEnumerable getDataDWList(string workPackageId, Grid Grid1)
{
var getDataList = getDataLists;
if (level == "0")
if (string.IsNullOrEmpty(workPackageId) )
{
List<Model.WBS_WorkPackageInit> listWork = new List<Model.WBS_WorkPackageInit>();
if (string.IsNullOrEmpty(workPackageId) || workPackageId == "1")
{
Model.WBS_WorkPackageInit work1 = new Model.WBS_WorkPackageInit
{
WorkPackageCode = "1",
PackageContent = "建筑工程",
};
listWork.Add(work1);
}
if (string.IsNullOrEmpty(workPackageId) || workPackageId == "2")
{
Model.WBS_WorkPackageInit work2 = new Model.WBS_WorkPackageInit
{
WorkPackageCode = "2",
PackageContent = "安装工程",
};
listWork.Add(work2);
}
getDataList = listWork.AsQueryable();
}
else
{
if (level == "1")
{
getDataList = getDataList.Where(x => x.SuperWorkPack == null);
}
if (!string.IsNullOrEmpty(workPackageId))
{
if (workPackageId != "1" && workPackageId != "2")
{
getDataList = getDataList.Where(x => x.SuperWorkPack == workPackageId);
if (getDataList.Count() == 0)
{
getDataList = getDataLists.Where(x => x.WorkPackageCode == workPackageId);
}
}
else
{
getDataList = getDataList.Where(x => x.ProjectType == workPackageId);
}
getDataList = getDataList.Where(x => x.ProjectType == workPackageId && x.SuperWorkPack == null);
}
}

View File

@ -23,6 +23,13 @@ namespace FineUIPro.Web.Controls
}
}
public bool IsShowLevel
{
get;
set;
} = true;
/// <summary>
/// 项目ID
/// </summary>
@ -49,6 +56,7 @@ namespace FineUIPro.Web.Controls
{
if (!IsPostBack)
{
this.Toolbar1.Hidden = !IsShowLevel;
////加载树
SetSubUnitProjectTree(this.trWBS);
}

View File

@ -19,19 +19,7 @@ namespace FineUIPro.Web.Controls
}
}
public string Level
{
get
{
return (string)ViewState["Level"];
}
set
{
ViewState["Level"] = value;
}
}
public bool IsShowAll
public bool IsShowLevel
{
get;
set;
@ -48,12 +36,7 @@ namespace FineUIPro.Web.Controls
{
if (!IsPostBack)
{
if (!IsShowAll)
{
this.ckLevel.Items.Remove(this.ckLevel.Items[0]);
this.ckLevel.SelectedIndex = 0;
}
this.Toolbar1.Hidden = !IsShowLevel;
////加载树
SetSubUnitProjectTree(this.trWBS);
@ -68,7 +51,7 @@ namespace FineUIPro.Web.Controls
/// <param name="e"></param>
protected void trWBS_NodeCommand(object sender, TreeCommandEventArgs e)
{
this.Level = this.ckLevel.SelectedValue;
//this.Level = this.ckLevel.SelectedValue;
if (this.trWBS != null && !string.IsNullOrEmpty(this.trWBS.SelectedNodeID))
{
this.WorkPackageCode = this.trWBS.SelectedNodeID;
@ -79,26 +62,18 @@ namespace FineUIPro.Web.Controls
}
}
protected void ckLevel_SelectedIndexChanged(object sender, EventArgs e)
{
this.Level = this.ckLevel.SelectedValue;
if (this.trWBS != null && !string.IsNullOrEmpty(this.trWBS.SelectedNodeID))
{
this.WorkPackageCode = this.trWBS.SelectedNodeID;
}
////加载树
SetSubUnitProjectTree(this.trWBS);
if (this.change != null)
{
this.change(this, e);
}
}
public delegate void userEvent(object sender, EventArgs arg);
public event userEvent change;
protected void ckLevel_SelectedIndexChanged(object sender, EventArgs e)
{
////加载树
SetSubUnitProjectTree(this.trWBS);
}
#region -
/// <summary>
/// 绑定分公司 单位-项目树

View File

@ -1,6 +1,6 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectWBSAnalysis.aspx.cs" Inherits="FineUIPro.Web.DigData.ProjectWBSAnalysis" %>
<%@ Register Src="~/Controls/WBSControl.ascx" TagName="WBSControl" TagPrefix="uc1" %>
<%@ Register Src="~/Controls/ProjectWBSControl.ascx" TagName="WBSControl" TagPrefix="uc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

View File

@ -9,6 +9,21 @@ namespace FineUIPro.Web.DigData
{
public partial class ProjectWBSAnalysis : PageBase
{
/// <summary>
/// 项目ID
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
/// <summary>
/// 加载页面
/// </summary>
@ -18,16 +33,16 @@ namespace FineUIPro.Web.DigData
{
if (!IsPostBack)
{
this.ucTree.IsShowAll = false;
this.ucTree.Level= this.hdLevel.Text = "0";
this.ProjectId = this.CurrUser.LoginProjectId;
this.ucTree.ProjectId = this.ProjectId;
this.ucTree.IsShowLevel = false;
BindGrid();
}
}
protected void changeTree(object sender, EventArgs e)
{
this.hdWorkPackageCode.Text = this.ucTree.WorkPackageCode;
this.hdLevel.Text = this.ucTree.Level;
this.hdWorkPackageCode.Text = this.ucTree.WorkPackageId;
BindGrid();
}
@ -37,8 +52,8 @@ namespace FineUIPro.Web.DigData
/// </summary>
private void BindGrid()
{
var getData = WBSAnalysisService.getDataDWList(this.hdLevel.Text,this.hdWorkPackageCode.Text, this.Grid1);
Grid1.RecordCount = WBSAnalysisService.count;
var getData = ProjectWBSAnalysisService.getDataDWList(this.ProjectId, this.hdWorkPackageCode.Text, this.Grid1);
Grid1.RecordCount = ProjectWBSAnalysisService.count;
Grid1.DataSource = getData;
Grid1.DataBind();
}

View File

@ -66,7 +66,7 @@ namespace FineUIPro.Web.DigData
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Web.Controls.WBSControl ucTree;
protected global::FineUIPro.Web.Controls.ProjectWBSControl ucTree;
/// <summary>
/// hdWorkPackageCode 控件。

View File

@ -18,8 +18,7 @@ namespace FineUIPro.Web.DigData
{
if (!IsPostBack)
{
this.ucTree.IsShowAll = false;
this.ucTree.Level= this.hdLevel.Text = "0";
this.ucTree.IsShowLevel = false;
BindGrid();
}
}
@ -27,7 +26,6 @@ namespace FineUIPro.Web.DigData
protected void changeTree(object sender, EventArgs e)
{
this.hdWorkPackageCode.Text = this.ucTree.WorkPackageCode;
this.hdLevel.Text = this.ucTree.Level;
BindGrid();
}
@ -37,7 +35,7 @@ namespace FineUIPro.Web.DigData
/// </summary>
private void BindGrid()
{
var getData = WBSAnalysisService.getDataDWList(this.hdLevel.Text,this.hdWorkPackageCode.Text, this.Grid1);
var getData = WBSAnalysisService.getDataDWList(this.hdWorkPackageCode.Text, this.Grid1);
Grid1.RecordCount = WBSAnalysisService.count;
Grid1.DataSource = getData;
Grid1.DataBind();

View File

@ -1,171 +0,0 @@
错误信息开始=====>
错误类型:NullReferenceException
错误信息:未将对象引用设置到对象的实例。
错误堆栈:
在 (TreeNode )
在 FineUIPro.TreeCommandEventArgs..ctor(TreeNode node, String commandName, String commandArgument)
在 (TreeNode , String , String )
在 FineUIPro.Tree.RaisePostBackEvent(String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:09/07/2023 21:53:15
出错文件:http://localhost:6422/DigData/WBSAnalysis.aspx
IP地址:::1
操作人员:JT
出错时间:09/07/2023 21:53:15
错误信息开始=====>
错误类型:NullReferenceException
错误信息:未将对象引用设置到对象的实例。
错误堆栈:
在 FineUIPro.Web.CQMS.Check.EditCheckMonth.Page_Load(Object sender, EventArgs e) 位置 E:\工作\赛鼎施工平台\SGGL_SeDin(New)\SGGL_SeDin_New\SGGL\FineUIPro.Web\CQMS\Check\EditCheckMonth.aspx.cs:行号 39
在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
在 System.EventHandler.Invoke(Object sender, EventArgs e)
在 System.Web.UI.Control.OnLoad(EventArgs e)
在 System.Web.UI.Control.LoadRecursive()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:09/11/2023 11:02:10
出错文件:http://localhost:6422/CQMS/Check/EditCheckMonth.aspx?months=2023-09-01
IP地址:::1
出错时间:09/11/2023 11:02:10
错误信息开始=====>
错误类型:HttpRequestValidationException
错误信息:从客户端(Panel1$Grid1$ctl04$txtUnit="m&#179;")中检测到有潜在危险的 Request.Form 值。
错误堆栈:
在 System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
在 System.Web.HttpRequest.ValidateHttpValueCollection(HttpValueCollection collection, RequestValidationSource requestCollection)
在 System.Web.HttpRequest.get_Form()
在 System.Web.HttpRequest.get_HasForm()
在 System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)
在 System.Web.UI.Page.DeterminePostBackMode()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest()
在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
在 System.Web.UI.Page.ProcessRequest(HttpContext context)
在 ASP.jdgl_check_planset_aspx.ProcessRequest(HttpContext context)
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
出错时间:09/12/2023 09:47:37
出错文件:http://localhost:6422/JDGL/Check/PlanSet.aspx
IP地址:::1
操作人员:JT
出错时间:09/12/2023 09:47:37
错误信息开始=====>
错误类型:HttpRequestValidationException
错误信息:从客户端(Panel1$Grid1$ctl04$txtUnit="m&#179;")中检测到有潜在危险的 Request.Form 值。
错误堆栈:
在 System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
在 System.Web.HttpRequest.ValidateHttpValueCollection(HttpValueCollection collection, RequestValidationSource requestCollection)
在 System.Web.HttpRequest.get_Form()
在 System.Web.HttpRequest.get_HasForm()
在 System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)
在 System.Web.UI.Page.DeterminePostBackMode()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest()
在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
在 System.Web.UI.Page.ProcessRequest(HttpContext context)
在 ASP.jdgl_check_planset_aspx.ProcessRequest(HttpContext context)
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
出错时间:09/12/2023 09:47:40
出错文件:http://localhost:6422/JDGL/Check/PlanSet.aspx
IP地址:::1
操作人员:JT
出错时间:09/12/2023 09:47:40
错误信息开始=====>
错误类型:HttpRequestValidationException
错误信息:从客户端(Panel1$Grid1$ctl04$txtUnit="m&#179;")中检测到有潜在危险的 Request.Form 值。
错误堆栈:
在 System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
在 System.Web.HttpRequest.ValidateHttpValueCollection(HttpValueCollection collection, RequestValidationSource requestCollection)
在 System.Web.HttpRequest.get_Form()
在 System.Web.HttpRequest.get_HasForm()
在 System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)
在 System.Web.UI.Page.DeterminePostBackMode()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest()
在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
在 System.Web.UI.Page.ProcessRequest(HttpContext context)
在 ASP.jdgl_check_planset_aspx.ProcessRequest(HttpContext context)
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
出错时间:09/12/2023 09:47:42
出错文件:http://localhost:6422/JDGL/Check/PlanSet.aspx
IP地址:::1
操作人员:JT
出错时间:09/12/2023 09:47:42
错误信息开始=====>
错误类型:HttpRequestValidationException
错误信息:从客户端(Panel1$Grid1$ctl04$txtUnit="m&#179;")中检测到有潜在危险的 Request.Form 值。
错误堆栈:
在 System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
在 System.Web.HttpRequest.ValidateHttpValueCollection(HttpValueCollection collection, RequestValidationSource requestCollection)
在 System.Web.HttpRequest.get_Form()
在 System.Web.HttpRequest.get_HasForm()
在 System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)
在 System.Web.UI.Page.DeterminePostBackMode()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest()
在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
在 System.Web.UI.Page.ProcessRequest(HttpContext context)
在 ASP.jdgl_check_planset_aspx.ProcessRequest(HttpContext context)
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
出错时间:09/12/2023 09:48:38
出错文件:http://localhost:6422/JDGL/Check/PlanSet.aspx
IP地址:::1
操作人员:JT
出错时间:09/12/2023 09:48:38
错误信息开始=====>
错误类型:HttpRequestValidationException
错误信息:从客户端(Panel1$Grid1$ctl04$txtUnit="m&#179;")中检测到有潜在危险的 Request.Form 值。
错误堆栈:
在 System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
在 System.Web.HttpRequest.ValidateHttpValueCollection(HttpValueCollection collection, RequestValidationSource requestCollection)
在 System.Web.HttpRequest.get_Form()
在 System.Web.HttpRequest.get_HasForm()
在 System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)
在 System.Web.UI.Page.DeterminePostBackMode()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest()
在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
在 System.Web.UI.Page.ProcessRequest(HttpContext context)
在 ASP.jdgl_check_planset_aspx.ProcessRequest(HttpContext context)
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
出错时间:09/12/2023 09:48:39
出错文件:http://localhost:6422/JDGL/Check/PlanSet.aspx
IP地址:::1
操作人员:JT
出错时间:09/12/2023 09:48:39

View File

@ -14225,7 +14225,7 @@
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:6422/</IISUrl>
<IISUrl>http://localhost:9243/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>