修改进度计划编制

This commit is contained in:
高飞 2023-09-01 15:12:14 +08:00
parent 14c5600240
commit 06e3944166
7 changed files with 140 additions and 28 deletions

View File

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

View File

@ -245,7 +245,7 @@ namespace BLL
/// 获取模拟树表格 /// 获取模拟树表格
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
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)) using (var db = new Model.SGGLDB(Funs.ConnString))
{ {
@ -308,11 +308,11 @@ namespace BLL
newList.Add(item); newList.Add(item);
if (string.IsNullOrEmpty(IsOut)) 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 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++; a++;
} }
@ -454,7 +454,9 @@ namespace BLL
} }
} }
private static void AddDetail(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode, string startTime, string endTime) private static void AddDetail(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode, string startTime, string endTime, string isOK)
{
if (isOK == "0")
{ {
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); 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; int b = 1;
@ -462,12 +464,39 @@ namespace BLL
{ {
item.Code = preCode + "." + b.ToString(); item.Code = preCode + "." + b.ToString();
newList.Add(item); newList.Add(item);
AddDetail(newList, oldList, item.Id, item.Code, startTime, endTime); AddDetail(newList, oldList, item.Id, item.Code, startTime, endTime, isOK);
b++; 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<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode, string prefix, string startTime, string endTime) private static void AddDetail(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode, string prefix, string startTime, string endTime, string isOK)
{
if (isOK == "0")
{ {
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); 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; int b = 1;
@ -476,10 +505,37 @@ namespace BLL
item.Code = preCode + "." + b.ToString(); item.Code = preCode + "." + b.ToString();
item.Name = prefix + "...." + item.Name; item.Name = prefix + "...." + item.Name;
newList.Add(item); newList.Add(item);
AddDetail(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime); AddDetail(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime, isOK);
b++; 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++;
}
}
}
#region #region
/// <summary> /// <summary>

View File

@ -132,7 +132,7 @@ namespace FineUIPro.Web.JDGL.Check
{ {
errorInfos = string.Empty; errorInfos = string.Empty;
string Id = Request.Params["Id"]; 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.DataSource = table;
Grid1.DataBind(); Grid1.DataBind();
for (int i = 0; i < this.Grid1.Rows.Count; i++) for (int i = 0; i < this.Grid1.Rows.Count; i++)

View File

@ -15,8 +15,8 @@
word-break: break-all; word-break: break-all;
} }
.f-grid-row.red { .f-grid-row.yellow {
background-color: red; background-color: yellow;
} }
</style> </style>
</head> </head>
@ -39,6 +39,11 @@
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="结束日期" ID="txtEndTime" <f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="结束日期" ID="txtEndTime"
LabelAlign="right" > LabelAlign="right" >
</f:DatePicker> </f:DatePicker>
<f:RadioButtonList runat="server" ID="rblIsOK" AutoColumnWidth="true">
<f:RadioItem Value="0" Selected="true" Text="全部" />
<f:RadioItem Value="1" Text="已完成" />
<f:RadioItem Value="2" Text="未完成" />
</f:RadioButtonList>
<f:Button ID="btnQuery" OnClick="btnQuery_Click" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true" runat="server" > <f:Button ID="btnQuery" OnClick="btnQuery_Click" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true" runat="server" >
</f:Button> </f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill> <f:ToolbarFill runat="server"></f:ToolbarFill>

View File

@ -28,7 +28,7 @@ namespace FineUIPro.Web.JDGL.Check
private void BindGrid() 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.DataSource = table;
Grid1.DataBind(); Grid1.DataBind();
for (int i = 0; i < this.Grid1.Rows.Count; i++) 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()); DateTime realEndDate = Funs.GetNewDateTimeOrNow(this.Grid1.Rows[i].Values[12].ToString());
if (planEndDate < realEndDate) if (planEndDate < realEndDate)
{ {
Grid1.Rows[i].RowCssClass = "red"; Grid1.Rows[i].RowCssClass = "yellow";
} }
} }
} }
@ -189,7 +189,7 @@ namespace FineUIPro.Web.JDGL.Check
{ {
try 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); string projectNmae = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
if (!string.IsNullOrEmpty(projectNmae)) if (!string.IsNullOrEmpty(projectNmae))
{ {

View File

@ -84,6 +84,15 @@ namespace FineUIPro.Web.JDGL.Check {
/// </remarks> /// </remarks>
protected global::FineUIPro.DatePicker txtEndTime; protected global::FineUIPro.DatePicker txtEndTime;
/// <summary>
/// rblIsOK 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rblIsOK;
/// <summary> /// <summary>
/// btnQuery 控件。 /// btnQuery 控件。
/// </summary> /// </summary>

View File

@ -290795,6 +290795,8 @@ namespace Model
private System.Nullable<System.DateTime> _PlanEndDate; private System.Nullable<System.DateTime> _PlanEndDate;
private System.Nullable<System.DateTime> _RealEndDate;
private string _WBSCode; private string _WBSCode;
private string _ProjectId; 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 public string Name
{ {
get get
@ -290915,6 +290917,22 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RealEndDate", DbType="DateTime")]
public System.Nullable<System.DateTime> RealEndDate
{
get
{
return this._RealEndDate;
}
set
{
if ((this._RealEndDate != value))
{
this._RealEndDate = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WBSCode", DbType="NVarChar(50)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WBSCode", DbType="NVarChar(50)")]
public string WBSCode public string WBSCode
{ {