20230907
This commit is contained in:
@@ -340,6 +340,7 @@
|
||||
<Compile Include="CQMS\WBS\WorkPackageProjectService.cs" />
|
||||
<Compile Include="CQMS\WBS\WorkPackageService.cs" />
|
||||
<Compile Include="DigData\CQMSDataDWService .cs" />
|
||||
<Compile Include="DigData\WBSAnalysisService.cs" />
|
||||
<Compile Include="DigData\HTGLDataDWService.cs" />
|
||||
<Compile Include="DigData\JDGLDataDWService.cs" />
|
||||
<Compile Include="DigData\HSEDataDWService.cs" />
|
||||
|
||||
@@ -57,19 +57,6 @@ namespace BLL
|
||||
x.ProjectName,
|
||||
x.ProjectCode,
|
||||
Count1=0,
|
||||
Count2 =0,
|
||||
Count3 =0,
|
||||
Count4 = 0,
|
||||
Count5 = 0,
|
||||
Count6 = 0,
|
||||
Count7 = 0,
|
||||
Count8 = 0,
|
||||
Count9 = 0,
|
||||
Count10 = 0,
|
||||
Count11 = 0,
|
||||
Count12 = 0,
|
||||
Count13 = 0,
|
||||
Count14 = 0,
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
using FineUIPro;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// WBS分析
|
||||
/// </summary>
|
||||
public static class WBSAnalysisService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
#region WBS分析
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.WBS_WorkPackageInit> getDataLists = from x in db.WBS_WorkPackageInit
|
||||
select x;
|
||||
|
||||
/// <summary>
|
||||
/// 合同管理数据仓库
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <param name="Grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getDataDWList(string level,string workPackageId, Grid Grid1)
|
||||
{
|
||||
var getDataList = getDataLists;
|
||||
if (level == "0")
|
||||
{
|
||||
List<Model.WBS_WorkPackageInit> listWork = new List<Model.WBS_WorkPackageInit>();
|
||||
if (string.IsNullOrEmpty(workPackageId) || workPackageId == "1")
|
||||
{
|
||||
Model.WBS_WorkPackageInit work1 = new Model.WBS_WorkPackageInit
|
||||
{
|
||||
WorkPackageCode = "1",
|
||||
PackageContent = "建筑工程",
|
||||
};
|
||||
listWork.Add(work1);
|
||||
}
|
||||
if (string.IsNullOrEmpty(workPackageId) || workPackageId == "2")
|
||||
{
|
||||
Model.WBS_WorkPackageInit work2 = new Model.WBS_WorkPackageInit
|
||||
{
|
||||
WorkPackageCode = "2",
|
||||
PackageContent = "安装工程",
|
||||
};
|
||||
listWork.Add(work2);
|
||||
}
|
||||
getDataList = listWork.AsQueryable();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (level == "1")
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.SuperWorkPack == null);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(workPackageId))
|
||||
{
|
||||
if (workPackageId != "1" && workPackageId != "2")
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.SuperWorkPack == workPackageId);
|
||||
}
|
||||
else
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.ProjectType == workPackageId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
count = getDataList.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in getDataList
|
||||
select new
|
||||
{
|
||||
x.WorkPackageCode,
|
||||
x.PackageContent,
|
||||
Count1=0,
|
||||
Count2 = 0,
|
||||
Count3 = 0,
|
||||
Count4 = 0,
|
||||
Count5 = 0,
|
||||
Count6 = 0,
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -464,6 +464,28 @@
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目各单位类型单位名称
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitType"></param>
|
||||
/// <returns></returns>
|
||||
public static string getProjectUnitIdByUnitType(string projectId, string unitType)
|
||||
{
|
||||
string unitId = string.Empty;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
var getUnit = from x in Funs.DB.Project_ProjectUnit
|
||||
where x.ProjectId == projectId && x.UnitType == unitType
|
||||
select x.UnitId;
|
||||
if (getUnit.Count() > 0)
|
||||
{
|
||||
unitId = Funs.GetStringByArray(getUnit.ToArray());
|
||||
}
|
||||
}
|
||||
return unitId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目各单位类型单位名称
|
||||
/// </summary>
|
||||
@@ -477,7 +499,7 @@
|
||||
{
|
||||
var getUnitName = from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == projectId.ToString() && x.UnitType == unitType
|
||||
where x.ProjectId == projectId && x.UnitType == unitType
|
||||
select y.UnitName;
|
||||
if (getUnitName.Count() > 0)
|
||||
{
|
||||
@@ -500,7 +522,7 @@
|
||||
{
|
||||
var getShortUnitName = from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == projectId.ToString() && x.UnitType == unitType
|
||||
where x.ProjectId == projectId && x.UnitType == unitType
|
||||
select y.ShortUnitName;
|
||||
if (getShortUnitName.Count() > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user