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 @@