提交代码
This commit is contained in:
@@ -444,7 +444,7 @@ namespace BLL
|
||||
List<Model.View_WBS> newList = new List<Model.View_WBS>();
|
||||
if (getWBSs.Count() > 0)
|
||||
{
|
||||
|
||||
|
||||
var projectTypes = getWBSs.Where(x => x.WBSType == "ProjectType" && x.SupId == "0");
|
||||
int a = 1;
|
||||
foreach (var item in projectTypes)
|
||||
@@ -827,6 +827,45 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新分部分项工程实际完成时间
|
||||
/// </summary>
|
||||
/// <param name="WorkPackage"></param>
|
||||
public static void UpdateWorkPackageRealEndDate2(string workPackageId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var workPackage = db.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == workPackageId);
|
||||
if (workPackage != null)
|
||||
{
|
||||
workPackage.RealEndDate = DateTime.Now;
|
||||
UpdateWorkPackages(db, workPackage, null, null, null, workPackage.RealEndDate);
|
||||
db.SubmitChanges();
|
||||
var unitWork = db.WBS_UnitWork.FirstOrDefault(x => x.UnitWorkId == workPackage.UnitWorkId);
|
||||
//获取是否存在其他未完成的分部分项
|
||||
var notEndOthenWorkPackage = db.WBS_WorkPackage.FirstOrDefault(x => x.UnitWorkId == unitWork.UnitWorkId && x.IsApprove == true && x.RealEndDate == null);
|
||||
if (notEndOthenWorkPackage == null)
|
||||
{
|
||||
if (workPackage.RealEndDate != null)
|
||||
{
|
||||
if (unitWork.RealEndDate == null)
|
||||
{
|
||||
unitWork.RealEndDate = workPackage.RealEndDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (unitWork.RealEndDate < workPackage.RealEndDate)
|
||||
{
|
||||
unitWork.RealEndDate = workPackage.RealEndDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
#region 根据工作包ID获取wbs节点及父节点字符串
|
||||
/// <summary>
|
||||
/// 根据工作包ID获取wbs节点及父节点字符串
|
||||
|
||||
Reference in New Issue
Block a user