Merge branch 'master' of https://gitee.com/frane-yang/SGGL_SeDin_New
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Apache.NMS.ActiveMQ">
|
||||
|
||||
@@ -245,7 +245,7 @@ namespace BLL
|
||||
/// 获取模拟树表格
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetAllTreeDataTable(string projectId, string IsOut)
|
||||
public static DataTable GetAllTreeDataTable(string projectId, string IsOut, string startTime, string endTime)
|
||||
{
|
||||
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());
|
||||
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty);
|
||||
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime);
|
||||
}
|
||||
a++;
|
||||
}
|
||||
@@ -328,12 +328,12 @@ namespace BLL
|
||||
if (item.WBSType == "WorkPackage")
|
||||
{
|
||||
var childWorkPackages = from x in workPackages where x.SuperWorkPackageId == item.Id && x.IsApprove == true select x;
|
||||
if (childWorkPackages.Count() == 0)
|
||||
var workPackage = workPackages.FirstOrDefault(x => x.WorkPackageId == item.Id);
|
||||
if (workPackage != null)
|
||||
{
|
||||
row[5] = item.Id;
|
||||
var workPackage = workPackages.FirstOrDefault(x => x.WorkPackageId == item.Id);
|
||||
if (workPackage != null)
|
||||
if (childWorkPackages.Count() == 0)
|
||||
{
|
||||
row[5] = item.Id;
|
||||
if (workPackage.JDWeights != null)
|
||||
{
|
||||
row[6] = decimal.Round(Convert.ToDecimal(workPackage.JDWeights), 2);
|
||||
@@ -386,6 +386,33 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (workPackage.JDWeights != null)
|
||||
{
|
||||
row[6] = decimal.Round(Convert.ToDecimal(workPackage.JDWeights), 2);
|
||||
}
|
||||
if (workPackage.PlanStartDate != null)
|
||||
{
|
||||
row[10] = workPackage.PlanStartDate;
|
||||
}
|
||||
if (workPackage.PlanEndDate != null)
|
||||
{
|
||||
row[11] = workPackage.PlanEndDate;
|
||||
}
|
||||
if (workPackage.RealStartDate != null)
|
||||
{
|
||||
row[12] = workPackage.RealStartDate;
|
||||
}
|
||||
if (workPackage.RealEndDate != null)
|
||||
{
|
||||
row[13] = workPackage.RealEndDate;
|
||||
}
|
||||
if (workPackage.PlanCost != null)
|
||||
{
|
||||
row[15] = decimal.Round(Convert.ToDecimal(workPackage.PlanCost), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (item.WBSType == "UnitWork")
|
||||
@@ -427,29 +454,29 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddDetail(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode)
|
||||
private static void AddDetail(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode, string startTime, string endTime)
|
||||
{
|
||||
var items = oldList.Where(x => x.SupId == id).OrderBy(x => x.Code);
|
||||
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);
|
||||
AddDetail(newList, oldList, item.Id, item.Code, startTime, endTime);
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddDetail(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode, string prefix)
|
||||
private static void AddDetail(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode, string prefix, string startTime, string endTime)
|
||||
{
|
||||
var items = oldList.Where(x => x.SupId == id).OrderBy(x => x.Code);
|
||||
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 + "....");
|
||||
AddDetail(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime);
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3293,6 +3293,10 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string WBSWorkPackageTemplateUrl = "File\\Excel\\DataIn\\WBS定制导入模板.xls";
|
||||
/// <summary>
|
||||
/// WBS编码规则
|
||||
/// </summary>
|
||||
public const string WBSCodeTemplateUrl = "File\\Excel\\DataIn\\WBS编码规则.xlsx";
|
||||
/// <summary>
|
||||
/// 管道等级导入模板
|
||||
/// </summary>
|
||||
public const string PipingClassTemplateUrl = "File\\Excel\\DataIn\\管道等级导入模板.xls";
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
if (workPostIds.Count() > 0)
|
||||
if (workPostIds != null && workPostIds.Count() > 0)
|
||||
{
|
||||
getDataList = getDataList.Where(e => workPostIds.Contains(e.WorkPostId));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user