修改进度模块
This commit is contained in:
@@ -972,7 +972,26 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
if (!string.IsNullOrEmpty(c.HGForms) || !string.IsNullOrEmpty(c.SHForms))
|
||||
{
|
||||
isExitForms = true;
|
||||
break;
|
||||
}
|
||||
//处理工作包实际完成时间
|
||||
if (c.CheckNum != null && c.CheckNum != 0) //检查次数为0表示一直检查
|
||||
{
|
||||
if (c.CheckNum == 1) //检查一次
|
||||
{
|
||||
c.RealEndDate = DateTime.Now;
|
||||
BLL.ControlItemAndCycleService.UpdateControlItemAndCycle(c);
|
||||
BLL.WorkPackageService.UpdateWorkPackageRealEndDate(c.WorkPackageId);
|
||||
}
|
||||
else //检查多次
|
||||
{
|
||||
List<Model.Check_SpotCheckDetail> details = BLL.SpotCheckDetailService.GetSpotCheckDetailsByControlItemAndCycleId(c.ControlItemAndCycleId);
|
||||
if (details.Count == c.CheckNum) //检查次数已达到最大值
|
||||
{
|
||||
c.RealEndDate = DateTime.Now;
|
||||
BLL.ControlItemAndCycleService.UpdateControlItemAndCycle(c);
|
||||
BLL.WorkPackageService.UpdateWorkPackageRealEndDate(c.WorkPackageId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,6 +567,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
}
|
||||
else
|
||||
{
|
||||
oldWorkPackage.WorkPackageCode = workPackageProject.WorkPackageCode;
|
||||
oldWorkPackage.PackageContent = workPackageProject.PackageContent + name;
|
||||
oldWorkPackage.SubItemType = GetSubItemTypeId(values.Value<string>("SubItemType"));
|
||||
BLL.WorkPackageService.UpdateWorkPackage(oldWorkPackage);
|
||||
@@ -670,6 +671,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
}
|
||||
else
|
||||
{
|
||||
oldWorkPackage.WorkPackageCode = workPackageProject.WorkPackageCode;
|
||||
oldWorkPackage.PackageContent = workPackageProject.PackageContent + name;
|
||||
oldWorkPackage.IsApprove = true;
|
||||
oldWorkPackage.SubItemType = GetSubItemTypeId(values.Value<string>("SubItemType"));
|
||||
|
||||
@@ -599,6 +599,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
}
|
||||
else
|
||||
{
|
||||
oldWorkPackage.WorkPackageCode = workPackageProject.WorkPackageCode;
|
||||
oldWorkPackage.PackageContent = workPackageProject.PackageContent + name;
|
||||
oldWorkPackage.SubItemType = GetSubItemTypeId(values.Value<string>("SubItemType"));
|
||||
BLL.WorkPackageService.UpdateWorkPackage(oldWorkPackage);
|
||||
@@ -699,6 +700,7 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
}
|
||||
else
|
||||
{
|
||||
oldWorkPackage.WorkPackageCode = workPackageProject.WorkPackageCode;
|
||||
oldWorkPackage.PackageContent = workPackageProject.PackageContent + name;
|
||||
oldWorkPackage.IsApprove = true;
|
||||
oldWorkPackage.SubItemType = GetSubItemTypeId(values.Value<string>("SubItemType"));
|
||||
|
||||
@@ -40,6 +40,12 @@
|
||||
<%--<f:RowNumberField HeaderText="序号"/>--%>
|
||||
<f:BoundField Width="350px" ColumnID="Name" DataField="Name" HeaderTextAlign="Center"
|
||||
HeaderText="工作内容" />
|
||||
<f:RenderField Width="100px" ColumnID="PreWorkCode" DataField="PreWorkCode" FieldType="String"
|
||||
HeaderText="前置工作内容编号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:TextBox runat="server" ID="txtPreWorkCode" MaxLength="50"></f:TextBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:TemplateField Width="90px" HeaderText="里程碑点" HeaderTextAlign="Center" ID="IsMileStone" TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="cbIsMileStone" runat="server"></asp:CheckBox>
|
||||
@@ -67,6 +73,9 @@
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PlanCost" DataField="PlanCost" FieldType="Double"
|
||||
HeaderText="概算费用" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="RealProjectQuantity" DataField="RealProjectQuantity" FieldType="Double"
|
||||
HeaderText="实际工程量" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
@@ -91,6 +100,10 @@
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="RealStartDate" DataField="RealStartDate" FieldType="Date"
|
||||
Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="实际开始时间" HeaderTextAlign="Center">
|
||||
<Editor>
|
||||
<f:DatePicker ID="txtRealStartDate" Required="true" runat="server">
|
||||
</f:DatePicker>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="RealEndDate" DataField="RealEndDate" FieldType="Date"
|
||||
Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="实际完成时间" HeaderTextAlign="Center">
|
||||
|
||||
@@ -104,6 +104,8 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
string realProjectQuantity = values.Value<string>("RealProjectQuantity");
|
||||
string planStartDate = values.Value<string>("PlanStartDate");
|
||||
string planEndDate = values.Value<string>("PlanEndDate");
|
||||
string realStartDate = values.Value<string>("RealStartDate");
|
||||
string preWorkCode = values.Value<string>("PreWorkCode");
|
||||
System.Web.UI.WebControls.CheckBox cbIsMileStone = (System.Web.UI.WebControls.CheckBox)(this.Grid1.Rows[i].FindControl("cbIsMileStone"));
|
||||
workPackage.Weights = Funs.GetNewDecimal(weights);
|
||||
workPackage.Unit = unit;
|
||||
@@ -111,11 +113,13 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
workPackage.RealProjectQuantity = Funs.GetNewDecimal(realProjectQuantity);
|
||||
workPackage.PlanStartDate = Funs.GetNewDateTime(planStartDate);
|
||||
workPackage.PlanEndDate = Funs.GetNewDateTime(planEndDate);
|
||||
workPackage.RealStartDate = Funs.GetNewDateTime(realStartDate);
|
||||
workPackage.IsMileStone = cbIsMileStone.Checked;
|
||||
workPackage.PreWorkCode = preWorkCode;
|
||||
BLL.WorkPackageService.UpdateWorkPackage(workPackage);
|
||||
if (workPackage.PlanStartDate != null || workPackage.PlanEndDate != null)
|
||||
if (workPackage.PlanStartDate != null || workPackage.PlanEndDate != null || workPackage.RealStartDate != null)
|
||||
{
|
||||
UpdateWorkPackages(db, workPackage, workPackage.PlanStartDate, workPackage.PlanEndDate);
|
||||
BLL.WorkPackageService.UpdateWorkPackages(db, workPackage, workPackage.PlanStartDate, workPackage.PlanEndDate, workPackage.RealStartDate, null);
|
||||
var unitWork = unitWorks.FirstOrDefault(x => x.UnitWorkId == workPackage.UnitWorkId);
|
||||
if (workPackage.PlanStartDate != null)
|
||||
{
|
||||
@@ -145,6 +149,20 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
}
|
||||
}
|
||||
}
|
||||
if (workPackage.RealStartDate != null)
|
||||
{
|
||||
if (unitWork.RealStartDate == null)
|
||||
{
|
||||
unitWork.RealStartDate = workPackage.RealStartDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (unitWork.RealStartDate > workPackage.RealStartDate)
|
||||
{
|
||||
unitWork.RealStartDate = workPackage.RealStartDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -152,55 +170,6 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region 更新工作包、工作项
|
||||
/// <summary>
|
||||
/// 更新月工作包、工作项
|
||||
/// </summary>
|
||||
/// <param name="years"></param>
|
||||
/// <param name="months"></param>
|
||||
/// <param name="planValue"></param>
|
||||
/// <param name="parentId"></param>
|
||||
private void UpdateWorkPackages(Model.SGGLDB db, Model.WBS_WorkPackage workPackage, DateTime? planStartDate, DateTime? planEndDate)
|
||||
{
|
||||
if (workPackage != null)
|
||||
{
|
||||
Model.WBS_WorkPackage parentWorkPackage = BLL.WorkPackageService.GetWorkPackageByWorkPackageId(workPackage.SuperWorkPackageId);
|
||||
if (parentWorkPackage != null)
|
||||
{
|
||||
if (planStartDate != null)
|
||||
{
|
||||
if (parentWorkPackage.PlanStartDate == null)
|
||||
{
|
||||
parentWorkPackage.PlanStartDate = planStartDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (parentWorkPackage.PlanStartDate > planStartDate)
|
||||
{
|
||||
parentWorkPackage.PlanStartDate = planStartDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (planEndDate != null)
|
||||
{
|
||||
if (parentWorkPackage.PlanEndDate == null)
|
||||
{
|
||||
parentWorkPackage.PlanEndDate = planEndDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (parentWorkPackage.PlanEndDate < planEndDate)
|
||||
{
|
||||
parentWorkPackage.PlanEndDate = planEndDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
UpdateWorkPackages(db, parentWorkPackage, planStartDate, planEndDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -75,6 +75,15 @@ namespace FineUIPro.Web.JDGL.Check {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// txtPreWorkCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtPreWorkCode;
|
||||
|
||||
/// <summary>
|
||||
/// IsMileStone 控件。
|
||||
/// </summary>
|
||||
@@ -146,5 +155,14 @@ namespace FineUIPro.Web.JDGL.Check {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtPlanEndDate;
|
||||
|
||||
/// <summary>
|
||||
/// txtRealStartDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtRealStartDate;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user