From 991eb07f0bbdede38f85d550fccc9b559db20e51 Mon Sep 17 00:00:00 2001
From: gaofei1985 <181547018@qq.com>
Date: Wed, 30 Aug 2023 14:52:34 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9B=E5=BA=A6=E6=A8=A1?=
=?UTF-8?q?=E5=9D=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
DataBase/版本日志/SGGLDB_V2023-08-30.sql | 124 ++++++
SGGL/BLL/BLL.csproj | 1 +
SGGL/BLL/CQMS/WBS/WorkPackageService.cs | 18 +-
SGGL/BLL/Common/Const.cs | 4 +
.../CQMS/WBS/ControlItemAndCycleShow.aspx | 14 +-
.../CQMS/WBS/ControlItemAndCycleShow.aspx.cs | 99 +++++
.../ControlItemAndCycleShow.aspx.designer.cs | 27 ++
.../CQMS/WBS/WorkPackageSet1.aspx.cs | 6 +-
.../CQMS/WBS/WorkPackageSet2.aspx.cs | 6 +-
.../CQMS/WBS/WorkPackageSet2In.aspx.cs | 2 +-
.../Controls/ChartControl.ascx.cs | 48 +--
SGGL/FineUIPro.Web/ErrLog.txt | 51 +++
.../File/Excel/DataIn/WBS编码规则.xlsx | Bin 0 -> 15695 bytes
.../HJGL/PreDesign/MaterialManageIn.aspx.cs | 10 +-
.../JDGL/Check/CompleteInput.aspx | 18 +-
.../JDGL/Check/CompleteInput.aspx.cs | 44 ++-
.../JDGL/Check/EarnedValueCurve.aspx | 16 +-
.../JDGL/Check/EarnedValueCurve.aspx.cs | 44 +--
SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx | 12 +
SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.cs | 18 +-
.../JDGL/Check/PlanSet.aspx.designer.cs | 27 ++
SGGL/Model/Model.cs | 368 +++++++++++++++++-
22 files changed, 862 insertions(+), 95 deletions(-)
create mode 100644 DataBase/版本日志/SGGLDB_V2023-08-30.sql
create mode 100644 SGGL/FineUIPro.Web/File/Excel/DataIn/WBS编码规则.xlsx
diff --git a/DataBase/版本日志/SGGLDB_V2023-08-30.sql b/DataBase/版本日志/SGGLDB_V2023-08-30.sql
new file mode 100644
index 00000000..f1429d8a
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2023-08-30.sql
@@ -0,0 +1,124 @@
+
+ALTER VIEW [dbo].[View_WBS]
+AS
+select '1' as Id,'0' as SupId ,'JZ' as Code, '' as Name,'ProjectType' as WBSType,null as PlanStartDate,null as PlanEndDate,
+ProjectId from dbo.WBS_UnitWork
+Union
+select '2' as Id,'0' as SupId ,'AZ' as Code, 'װ' as Name,'ProjectType' as WBSType,null as PlanStartDate,null as PlanEndDate,
+ProjectId from dbo.WBS_UnitWork
+Union
+select UnitWorkId as Id,ProjectType as SupId ,UnitWorkCode as Code, UnitWorkCode+'-'+UnitWorkName as Name,'UnitWork' as WBSType,PlanStartDate, PlanEndDate,
+ProjectId from dbo.WBS_UnitWork
+Union all
+select WorkPackageId as id,UnitWorkId as SupId,WorkPackageCode as Code,WorkPackageCode+'-'+PackageContent as Name,'WorkPackage' as WBSType,PlanStartDate, PlanEndDate,
+ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is null
+Union all
+select WorkPackageId as id,SuperWorkPackageId as SupId,WorkPackageCode as Code, WorkPackageCode+'-'+PackageContent as Name,'WorkPackage' as WBSType,PlanStartDate, PlanEndDate,
+ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is not null
+
+
+
+
+
+
+GO
+
+
+alter table WBS_UnitWork add WBSCode nvarchar(50) null
+GO
+alter table WBS_WorkPackage add WBSCode nvarchar(50) null
+GO
+alter table WBS_ControlItemAndCycle add WBSCode nvarchar(50) null
+GO
+
+
+ALTER VIEW [dbo].[View_WBS]
+AS
+select '1' as Id,'0' as SupId ,'JZ' as Code, '' as Name,'ProjectType' as WBSType,null as PlanStartDate,null as PlanEndDate,null as WBSCode,
+ProjectId from dbo.WBS_UnitWork
+Union
+select '2' as Id,'0' as SupId ,'AZ' as Code, 'װ' as Name,'ProjectType' as WBSType,null as PlanStartDate,null as PlanEndDate,null as WBSCode,
+ProjectId from dbo.WBS_UnitWork
+Union
+select UnitWorkId as Id,ProjectType as SupId ,UnitWorkCode as Code, WBSCode+'-'+UnitWorkName as Name,'UnitWork' as WBSType,PlanStartDate, PlanEndDate,WBSCode,
+ProjectId from dbo.WBS_UnitWork
+Union all
+select WorkPackageId as id,UnitWorkId as SupId,WorkPackageCode as Code,WBSCode+'-'+PackageContent as Name,'WorkPackage' as WBSType,PlanStartDate, PlanEndDate,WBSCode,
+ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is null
+Union all
+select WorkPackageId as id,SuperWorkPackageId as SupId,WorkPackageCode as Code, WBSCode+'-'+PackageContent as Name,'WorkPackage' as WBSType,PlanStartDate, PlanEndDate,WBSCode,
+ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is not null
+
+
+
+
+
+
+
+GO
+
+
+update WBS_WorkPackage set PackageCode=(select PackageCode from WBS_WorkPackageInit w where w.WorkPackageCode=InitWorkPackageCode)
+GO
+
+alter table [dbo].[WBS_WorkPackageDetail] add PlanValue decimal(18,2) null
+alter table [dbo].[WBS_WorkPackageDetail] add ThisValue decimal(18,2) null
+alter table [dbo].[WBS_WorkPackageParentDetail] add PlanValue decimal(18,2) null
+alter table [dbo].[WBS_WorkPackageParentDetail] add ThisValue decimal(18,2) null
+GO
+
+
+
+ALTER VIEW [dbo].[View_WBS_WorkPackageDetail]
+AS
+/********ϸ********/
+SELECT detail.WorkPackageDetailId,
+detail.WorkPackageId,
+detail.Months,
+c.WorkPackageCode,
+c.PackageContent,
+c.ProjectId,
+c.Unit, --λ
+c.PlanProjectQuantity, --㹤
+c.RealProjectQuantity, --ʵʹ
+CONVERT(FLOAT,(select sum(ISNULL(PlanNum,0)) from WBS_WorkPackageDetail where WorkPackageId=detail.WorkPackageId and Months<=detail.Months)) as TotalPlanNum, --ۼƼƻ
+CONVERT(FLOAT,(select sum(ISNULL(ThisNum,0)) from WBS_WorkPackageDetail where WorkPackageId=detail.WorkPackageId and Months<=detail.Months)) as TotalThisNum, --ۼ
+CONVERT(FLOAT,(select sum(ISNULL(PlanValue,0)) from WBS_WorkPackageDetail where WorkPackageId=detail.WorkPackageId and Months<=detail.Months)) as TotalPlanValue, --ۼƸ
+CONVERT(FLOAT,(select sum(ISNULL(ThisValue,0)) from WBS_WorkPackageDetail where WorkPackageId=detail.WorkPackageId and Months<=detail.Months)) as TotalThisValue, --ۼʵʷ
+CONVERT(FLOAT,ISNULL(detail.PlanNum,0)) as PlanNum, --¼ƻ
+CONVERT(FLOAT,ISNULL(detail.ThisNum,0)) as ThisNum, --
+CONVERT(FLOAT,ISNULL(detail.PlanValue,0)) as PlanValue, --¸
+CONVERT(FLOAT,ISNULL(detail.ThisValue,0)) as ThisValue --ʵʷ
+FROM dbo.WBS_WorkPackageDetail AS detail
+LEFT JOIN WBS_WorkPackage AS c ON c.WorkPackageId=detail.WorkPackageId
+
+
+GO
+
+
+
+ALTER VIEW [dbo].[View_WBS_WorkPackageParentDetail]
+AS
+/********ϸ********/
+SELECT detail.WorkPackageParentDetailId,
+detail.ParentId,
+detail.ProjectId,
+detail.Months,
+CONVERT(FLOAT,ISNULL(detail.PlanNum,0)) as PlanNum, --¼ƻ
+CONVERT(FLOAT,ISNULL(detail.ThisNum,0)) as ThisNum, --ʵ
+CONVERT(FLOAT,ISNULL(detail.PlanValue,0)) as PlanValue, --¸
+CONVERT(FLOAT,ISNULL(detail.ThisValue,0)) as ThisValue, --ʵʷ
+CONVERT(FLOAT,(select sum(ISNULL(PlanNum,0)) from WBS_WorkPackageParentDetail
+where ParentId=detail.ParentId and Months<=detail.Months)) as TotalPlanNum, --ۼƼƻ
+CONVERT(FLOAT,(select sum(ISNULL(ThisNum,0)) from WBS_WorkPackageParentDetail
+where ParentId=detail.ParentId and Months<=detail.Months)) as TotalThisNum, --ۼ
+CONVERT(FLOAT,(select sum(ISNULL(PlanValue,0)) from WBS_WorkPackageParentDetail
+where ParentId=detail.ParentId and Months<=detail.Months)) as TotalPlanValue, --ۼƸ
+CONVERT(FLOAT,(select sum(ISNULL(ThisValue,0)) from WBS_WorkPackageParentDetail
+where ParentId=detail.ParentId and Months<=detail.Months)) as TotalThisValue --ۼʵʷ
+FROM dbo.WBS_WorkPackageParentDetail AS detail
+
+
+GO
+
+
diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj
index 1625bc72..b528abf7 100644
--- a/SGGL/BLL/BLL.csproj
+++ b/SGGL/BLL/BLL.csproj
@@ -41,6 +41,7 @@
prompt
4
false
+ latest
diff --git a/SGGL/BLL/CQMS/WBS/WorkPackageService.cs b/SGGL/BLL/CQMS/WBS/WorkPackageService.cs
index 3489bc14..99ffa9fa 100644
--- a/SGGL/BLL/CQMS/WBS/WorkPackageService.cs
+++ b/SGGL/BLL/CQMS/WBS/WorkPackageService.cs
@@ -245,7 +245,7 @@ namespace BLL
/// 获取模拟树表格
///
///
- public static DataTable GetAllTreeDataTable(string projectId, string IsOut)
+ public static DataTable GetAllTreeDataTable(string projectId, string IsOut, string startTime, string endTime)
{
using (var db = new Model.SGGLDB(Funs.ConnString))
{
@@ -308,11 +308,11 @@ namespace BLL
newList.Add(item);
if (string.IsNullOrEmpty(IsOut))
{
- AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString());
+ AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime);
}
else
{
- AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty);
+ AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime);
}
a++;
}
@@ -427,29 +427,29 @@ namespace BLL
}
}
- private static void AddDetail(List newList, List oldList, string id, string preCode)
+ private static void AddDetail(List newList, List oldList, string id, string preCode, string startTime, string endTime)
{
- var items = oldList.Where(x => x.SupId == id).OrderBy(x => x.Code);
+ var items = oldList.Where(x => x.SupId == id && (x.PlanStartDate <= Funs.GetNewDateTime(startTime) || string.IsNullOrEmpty(startTime)) && (x.PlanEndDate >= Funs.GetNewDateTime(endTime) || string.IsNullOrEmpty(endTime))).OrderBy(x => x.WBSCode);
int b = 1;
foreach (var item in items)
{
item.Code = preCode + "." + b.ToString();
newList.Add(item);
- AddDetail(newList, oldList, item.Id, item.Code);
+ AddDetail(newList, oldList, item.Id, item.Code, startTime, endTime);
b++;
}
}
- private static void AddDetail(List newList, List oldList, string id, string preCode, string prefix)
+ private static void AddDetail(List newList, List oldList, string id, string preCode, string prefix, string startTime, string endTime)
{
- var items = oldList.Where(x => x.SupId == id).OrderBy(x => x.Code);
+ var items = oldList.Where(x => x.SupId == id && (x.PlanStartDate <= Funs.GetNewDateTime(startTime) || string.IsNullOrEmpty(startTime)) && (x.PlanEndDate >= Funs.GetNewDateTime(endTime) || string.IsNullOrEmpty(endTime))).OrderBy(x => x.WBSCode);
int b = 1;
foreach (var item in items)
{
item.Code = preCode + "." + b.ToString();
item.Name = prefix + "...." + item.Name;
newList.Add(item);
- AddDetail(newList, oldList, item.Id, item.Code, prefix + "....");
+ AddDetail(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime);
b++;
}
}
diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs
index 38850782..7de98660 100644
--- a/SGGL/BLL/Common/Const.cs
+++ b/SGGL/BLL/Common/Const.cs
@@ -3290,6 +3290,10 @@ namespace BLL
///
public const string WBSWorkPackageTemplateUrl = "File\\Excel\\DataIn\\WBS定制导入模板.xls";
///
+ /// WBS编码规则
+ ///
+ public const string WBSCodeTemplateUrl = "File\\Excel\\DataIn\\WBS编码规则.xlsx";
+ ///
/// 管道等级导入模板
///
public const string PipingClassTemplateUrl = "File\\Excel\\DataIn\\管道等级导入模板.xls";
diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemAndCycleShow.aspx b/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemAndCycleShow.aspx
index 1967decd..380318f7 100644
--- a/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemAndCycleShow.aspx
+++ b/SGGL/FineUIPro.Web/CQMS/WBS/ControlItemAndCycleShow.aspx
@@ -21,7 +21,7 @@