Merge branch 'master' of https://gitee.com/frane-yang/SGGL_SeDin_New
This commit is contained in:
@@ -41,6 +41,7 @@ namespace BLL
|
||||
newSpotCheckDetail.SpotCheckDetailId = SpotCheckDetail.SpotCheckDetailId;
|
||||
newSpotCheckDetail.SpotCheckCode = SpotCheckDetail.SpotCheckCode;
|
||||
newSpotCheckDetail.ControlItemAndCycleId = SpotCheckDetail.ControlItemAndCycleId;
|
||||
newSpotCheckDetail.WorkPackageId = WorkPackageService.getWorkPageIdsByControlItemAndCycle(SpotCheckDetail.ControlItemAndCycleId);
|
||||
newSpotCheckDetail.IsOnesOK = SpotCheckDetail.IsOnesOK;
|
||||
newSpotCheckDetail.IsOK = SpotCheckDetail.IsOK;
|
||||
newSpotCheckDetail.ConfirmDate = SpotCheckDetail.ConfirmDate;
|
||||
@@ -58,6 +59,7 @@ namespace BLL
|
||||
newSpotCheckDetail.SpotCheckDetailId = SpotCheckDetail.SpotCheckDetailId;
|
||||
newSpotCheckDetail.SpotCheckCode = SpotCheckDetail.SpotCheckCode;
|
||||
newSpotCheckDetail.ControlItemAndCycleId = SpotCheckDetail.ControlItemAndCycleId;
|
||||
newSpotCheckDetail.WorkPackageId = WorkPackageService.getWorkPageIdsByControlItemAndCycle(SpotCheckDetail.ControlItemAndCycleId);
|
||||
newSpotCheckDetail.IsOnesOK = SpotCheckDetail.IsOnesOK;
|
||||
newSpotCheckDetail.IsOK = SpotCheckDetail.IsOK;
|
||||
newSpotCheckDetail.ConfirmDate = SpotCheckDetail.ConfirmDate;
|
||||
@@ -80,6 +82,7 @@ namespace BLL
|
||||
{
|
||||
newSpotCheckDetail.SpotCheckCode = SpotCheckDetail.SpotCheckCode;
|
||||
newSpotCheckDetail.ControlItemAndCycleId = SpotCheckDetail.ControlItemAndCycleId;
|
||||
newSpotCheckDetail.WorkPackageId = WorkPackageService.getWorkPageIdsByControlItemAndCycle(SpotCheckDetail.ControlItemAndCycleId);
|
||||
newSpotCheckDetail.IsOnesOK = SpotCheckDetail.IsOnesOK;
|
||||
newSpotCheckDetail.IsOK = SpotCheckDetail.IsOK;
|
||||
newSpotCheckDetail.ConfirmDate = SpotCheckDetail.ConfirmDate;
|
||||
@@ -334,6 +337,7 @@ namespace BLL
|
||||
newSpotCheckDetail.SpotCheckCode = SpotCheckDetail.SpotCheckCode;
|
||||
if (!string.IsNullOrEmpty(SpotCheckDetail.ControlItemAndCycleId))
|
||||
newSpotCheckDetail.ControlItemAndCycleId = SpotCheckDetail.ControlItemAndCycleId;
|
||||
newSpotCheckDetail.WorkPackageId = WorkPackageService.getWorkPageIdsByControlItemAndCycle(SpotCheckDetail.ControlItemAndCycleId);
|
||||
if (SpotCheckDetail.IsOnesOK.HasValue)
|
||||
newSpotCheckDetail.IsOnesOK = SpotCheckDetail.IsOnesOK;
|
||||
if (SpotCheckDetail.IsOK.HasValue)
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -626,5 +682,62 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region 根据工作包ID获取wbs节点及父节点字符串
|
||||
/// <summary>
|
||||
/// 根据工作包ID获取wbs节点及父节点字符串
|
||||
/// </summary>
|
||||
/// <param name="controlItemAndCycleId"></param>
|
||||
/// <returns></returns>
|
||||
public static string getWorkPageIdsByControlItemAndCycle(string controlItemAndCycleId)
|
||||
{
|
||||
string returnValues = string.Empty;
|
||||
var getControlItemAndCycle = Funs.DB.WBS_ControlItemAndCycle.FirstOrDefault(x => x.ControlItemAndCycleId == controlItemAndCycleId);
|
||||
if (getControlItemAndCycle != null)
|
||||
{
|
||||
var getWorkPackage = Funs.DB.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == getControlItemAndCycle.WorkPackageId);
|
||||
if (getWorkPackage != null)
|
||||
{
|
||||
returnValues = getSelectIds(getWorkPackage.WorkPackageId, getWorkPackage.WorkPackageId + "[" + getWorkPackage.InitWorkPackageCode + "]$" + controlItemAndCycleId);
|
||||
}
|
||||
}
|
||||
|
||||
return returnValues;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// id
|
||||
/// </summary>
|
||||
/// <param name="node"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public static string getSelectIds(string workPageId, string returnValues)
|
||||
{
|
||||
var getWorkPackage = Funs.DB.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == workPageId);
|
||||
if (getWorkPackage != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(getWorkPackage.SuperWorkPackageId))
|
||||
{
|
||||
var getSupWorkPackage = Funs.DB.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == getWorkPackage.SuperWorkPackageId);
|
||||
if (getSupWorkPackage != null)
|
||||
{
|
||||
returnValues = getWorkPackage.SuperWorkPackageId + "[" + getWorkPackage.InitWorkPackageCode + "]" + "|" + returnValues;
|
||||
returnValues = getSelectIds(getWorkPackage.SuperWorkPackageId, returnValues);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var getUnitWork = Funs.DB.WBS_UnitWork.FirstOrDefault(x => x.UnitWorkId == getWorkPackage.UnitWorkId);
|
||||
if (getUnitWork != null)
|
||||
{
|
||||
returnValues = ("Type" + getUnitWork.ProjectType ?? "1") + "|" + getUnitWork.UnitWorkId + "|" + returnValues;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnValues;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,6 +191,7 @@ namespace BLL
|
||||
LargerHazardListId = LargerHazardListItem.LargerHazardListId,
|
||||
UnitWorkId = LargerHazardListItem.UnitWorkId,
|
||||
WorkPackageId = LargerHazardListItem.WorkPackageId,
|
||||
WorkPackageName = LargerHazardListItem.WorkPackageName,
|
||||
WorkPackageSize = LargerHazardListItem.WorkPackageSize,
|
||||
ExpectedStartTime = LargerHazardListItem.ExpectedStartTime,
|
||||
ExpectedEndTime = LargerHazardListItem.ExpectedEndTime,
|
||||
@@ -215,6 +216,7 @@ namespace BLL
|
||||
newLargerHazardListItem.SortIndex = LargerHazardListItem.SortIndex;
|
||||
newLargerHazardListItem.UnitWorkId = LargerHazardListItem.UnitWorkId;
|
||||
newLargerHazardListItem.WorkPackageId = LargerHazardListItem.WorkPackageId;
|
||||
newLargerHazardListItem.WorkPackageName = LargerHazardListItem.WorkPackageName;
|
||||
newLargerHazardListItem.WorkPackageSize = LargerHazardListItem.WorkPackageSize;
|
||||
newLargerHazardListItem.ExpectedStartTime = LargerHazardListItem.ExpectedStartTime;
|
||||
newLargerHazardListItem.ExpectedEndTime = LargerHazardListItem.ExpectedEndTime;
|
||||
|
||||
@@ -338,7 +338,7 @@
|
||||
}
|
||||
|
||||
var pcount = (from x in db.Sys_Log
|
||||
where x.ProjectId != null && x.OperationTime > DateTime.Now.AddDays(-2)
|
||||
where x.ProjectId != null && x.OperationTime > DateTime.Now.AddDays(-1)
|
||||
group x by x.ProjectId into g
|
||||
select new { g.First().ProjectId, count = g.Count() }).Distinct();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user