修改进度计划编制
This commit is contained in:
parent
14c5600240
commit
06e3944166
|
|
@ -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
|
||||
|
|
@ -245,7 +245,7 @@ namespace BLL
|
|||
/// 获取模拟树表格
|
||||
/// </summary>
|
||||
/// <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))
|
||||
{
|
||||
|
|
@ -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<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)
|
||||
{
|
||||
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<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)
|
||||
{
|
||||
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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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++)
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@
|
|||
word-break: break-all;
|
||||
}
|
||||
|
||||
.f-grid-row.red {
|
||||
background-color: red;
|
||||
.f-grid-row.yellow {
|
||||
background-color: yellow;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
|
@ -39,6 +39,11 @@
|
|||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="结束日期" ID="txtEndTime"
|
||||
LabelAlign="right" >
|
||||
</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>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -84,6 +84,15 @@ namespace FineUIPro.Web.JDGL.Check {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtEndTime;
|
||||
|
||||
/// <summary>
|
||||
/// rblIsOK 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rblIsOK;
|
||||
|
||||
/// <summary>
|
||||
/// btnQuery 控件。
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -290795,6 +290795,8 @@ namespace Model
|
|||
|
||||
private System.Nullable<System.DateTime> _PlanEndDate;
|
||||
|
||||
private System.Nullable<System.DateTime> _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<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)")]
|
||||
public string WBSCode
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue