From 06e3944166fa1dadfda9f93abebba386d7e4efe5 Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Fri, 1 Sep 2023 15:12:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9B=E5=BA=A6=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E7=BC=96=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBase/版本日志/SGGLDB_V2023-09-01.sql | 24 +++++ SGGL/BLL/CQMS/WBS/WorkPackageService.cs | 98 +++++++++++++++---- .../JDGL/Check/CompleteInput.aspx.cs | 2 +- SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx | 9 +- SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.cs | 6 +- .../JDGL/Check/PlanSet.aspx.designer.cs | 9 ++ SGGL/Model/Model.cs | 20 +++- 7 files changed, 140 insertions(+), 28 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2023-09-01.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-09-01.sql b/DataBase/版本日志/SGGLDB_V2023-09-01.sql new file mode 100644 index 00000000..03a531df --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-09-01.sql @@ -0,0 +1,24 @@ + +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 RealEndDate,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 RealEndDate,null as WBSCode, +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,RealEndDate,WBSCode, +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,RealEndDate,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, WorkPackageCode+'-'+PackageContent as Name,'WorkPackage' as WBSType,PlanStartDate, PlanEndDate,RealEndDate,WBSCode, +ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is not null + + + + + + +GO \ No newline at end of file diff --git a/SGGL/BLL/CQMS/WBS/WorkPackageService.cs b/SGGL/BLL/CQMS/WBS/WorkPackageService.cs index 426d539e..62b28f1b 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, string startTime, string endTime) + public static DataTable GetAllTreeDataTable(string projectId, string IsOut, string startTime, string endTime, string isOK) { 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(), startTime, endTime); + AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime, isOK); } else { - AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime); + AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime, isOK); } a++; } @@ -405,7 +405,7 @@ namespace BLL row[12] = workPackage.RealStartDate; } if (workPackage.RealEndDate != null) - { + { row[13] = workPackage.RealEndDate; } if (workPackage.PlanCost != null) @@ -454,30 +454,86 @@ namespace BLL } } - private static void AddDetail(List newList, List oldList, string id, string preCode, string startTime, string endTime) + private static void AddDetail(List newList, List oldList, string id, string preCode, string startTime, string endTime, string isOK) { - 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) + if (isOK == "0") { - item.Code = preCode + "." + b.ToString(); - newList.Add(item); - AddDetail(newList, oldList, item.Id, item.Code, startTime, endTime); - b++; + 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, startTime, endTime, isOK); + b++; + } + } + else if (isOK == "1") + { + var items = oldList.Where(x => x.SupId == id && x.RealEndDate != null && (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, startTime, endTime, isOK); + b++; + } + } + else if (isOK == "2") + { + var items = oldList.Where(x => x.SupId == id && x.RealEndDate == null && (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, startTime, endTime, isOK); + b++; + } } } - private static void AddDetail(List newList, List oldList, string id, string preCode, string prefix, string startTime, string endTime) + private static void AddDetail(List newList, List oldList, string id, string preCode, string prefix, string startTime, string endTime, string isOK) { - 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) + if (isOK == "0") { - item.Code = preCode + "." + b.ToString(); - item.Name = prefix + "...." + item.Name; - newList.Add(item); - AddDetail(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime); - b++; + 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 + "....", startTime, endTime, isOK); + b++; + } + } + else if (isOK == "1") + { + var items = oldList.Where(x => x.SupId == id && x.RealEndDate != null && (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 + "....", startTime, endTime, isOK); + b++; + } + } + else if (isOK == "2") + { + var items = oldList.Where(x => x.SupId == id && x.RealEndDate == null && (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 + "....", startTime, endTime, isOK); + b++; + } } } diff --git a/SGGL/FineUIPro.Web/JDGL/Check/CompleteInput.aspx.cs b/SGGL/FineUIPro.Web/JDGL/Check/CompleteInput.aspx.cs index 1fd43eaa..23ee103f 100644 --- a/SGGL/FineUIPro.Web/JDGL/Check/CompleteInput.aspx.cs +++ b/SGGL/FineUIPro.Web/JDGL/Check/CompleteInput.aspx.cs @@ -132,7 +132,7 @@ namespace FineUIPro.Web.JDGL.Check { errorInfos = string.Empty; string Id = Request.Params["Id"]; - DataTable table = BLL.WorkPackageService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, null, null); + DataTable table = BLL.WorkPackageService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, null, null, "0"); Grid1.DataSource = table; Grid1.DataBind(); for (int i = 0; i < this.Grid1.Rows.Count; i++) diff --git a/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx b/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx index 7ae0a73d..b9838b9d 100644 --- a/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx +++ b/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx @@ -15,8 +15,8 @@ word-break: break-all; } - .f-grid-row.red { - background-color: red; + .f-grid-row.yellow { + background-color: yellow; } @@ -39,6 +39,11 @@ + + + + + diff --git a/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.cs b/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.cs index a4f42f4c..c4024ee5 100644 --- a/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.cs +++ b/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.cs @@ -28,7 +28,7 @@ namespace FineUIPro.Web.JDGL.Check private void BindGrid() { - DataTable table = BLL.WorkPackageService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty,this.txtStartTime.Text.Trim(),this.txtEndTime.Text.Trim()); + DataTable table = BLL.WorkPackageService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty,this.txtStartTime.Text.Trim(),this.txtEndTime.Text.Trim(),this.rblIsOK.SelectedValue); Grid1.DataSource = table; Grid1.DataBind(); for (int i = 0; i < this.Grid1.Rows.Count; i++) @@ -60,7 +60,7 @@ namespace FineUIPro.Web.JDGL.Check DateTime realEndDate = Funs.GetNewDateTimeOrNow(this.Grid1.Rows[i].Values[12].ToString()); if (planEndDate < realEndDate) { - Grid1.Rows[i].RowCssClass = "red"; + Grid1.Rows[i].RowCssClass = "yellow"; } } } @@ -189,7 +189,7 @@ namespace FineUIPro.Web.JDGL.Check { try { - DataTable table = BLL.WorkPackageService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, "Out",this.txtStartTime.Text.Trim(),this.txtEndTime.Text.Trim()); + DataTable table = BLL.WorkPackageService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, "Out",this.txtStartTime.Text.Trim(),this.txtEndTime.Text.Trim(), this.rblIsOK.SelectedValue); string projectNmae = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId); if (!string.IsNullOrEmpty(projectNmae)) { diff --git a/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.designer.cs b/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.designer.cs index 77af5e57..0b915840 100644 --- a/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/JDGL/Check/PlanSet.aspx.designer.cs @@ -84,6 +84,15 @@ namespace FineUIPro.Web.JDGL.Check { /// protected global::FineUIPro.DatePicker txtEndTime; + /// + /// rblIsOK 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rblIsOK; + /// /// btnQuery 控件。 /// diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index f8da4e25..557f37ad 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -290795,6 +290795,8 @@ namespace Model private System.Nullable _PlanEndDate; + private System.Nullable _RealEndDate; + private string _WBSCode; private string _ProjectId; @@ -290851,7 +290853,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(101)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(81)")] public string Name { get @@ -290915,6 +290917,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RealEndDate", DbType="DateTime")] + public System.Nullable RealEndDate + { + get + { + return this._RealEndDate; + } + set + { + if ((this._RealEndDate != value)) + { + this._RealEndDate = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WBSCode", DbType="NVarChar(50)")] public string WBSCode {