0118-gaofei
This commit is contained in:
@@ -344,24 +344,35 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<string> GetWbsSetIdByInstallationIdAndCNCodeAndUnitProjectCodeAndWbsSetCode(string installationId, string cnCode, string unitProjectCode, string wbsSetCode)
|
||||
{
|
||||
List<string> ids = new List<string>();
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string inId = string.Empty;
|
||||
Model.Project_Installation ins = db.Project_Installation.FirstOrDefault(x => x.InstallationId == installationId);
|
||||
if (ins.IsEnd == true)
|
||||
var childInss = from x in db.Project_Installation where x.SuperInstallationId == installationId select x;
|
||||
if (childInss.Count() == 0)
|
||||
{
|
||||
inId = installationId;
|
||||
var cn = (from x in db.WBS_CnProfession where x.InstallationId == inId && x.OldId.ToString() == cnCode select x).FirstOrDefault();
|
||||
if (cn != null)
|
||||
{
|
||||
var list = (from x in db.Wbs_WbsSet
|
||||
join y in db.Wbs_UnitProject
|
||||
on x.UnitProjectId equals y.UnitProjectId
|
||||
where x.CnProfessionId == cn.CnProfessionId && y.UnitProjectCode == unitProjectCode && x.WbsSetCode == wbsSetCode
|
||||
select x.WbsSetId).ToList();
|
||||
ids.AddRange(list);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
inId = Project_InstallationService.GetEndInstallationId(installationId);
|
||||
var childIns = from x in db.Project_Installation where x.SuperInstallationId == installationId select x;
|
||||
foreach (var childIn in childIns)
|
||||
{
|
||||
ids.AddRange(GetWbsSetIdByInstallationIdAndCNCodeAndUnitProjectCodeAndWbsSetCode(childIn.InstallationId, cnCode, unitProjectCode, wbsSetCode));
|
||||
}
|
||||
}
|
||||
var cn = (from x in db.WBS_CnProfession where x.InstallationId == inId && x.OldId.ToString() == cnCode select x).FirstOrDefault();
|
||||
var list = (from x in db.Wbs_WbsSet
|
||||
join y in db.Wbs_UnitProject
|
||||
on x.UnitProjectId equals y.UnitProjectId
|
||||
where x.CnProfessionId == cn.CnProfessionId && y.UnitProjectCode == unitProjectCode && x.WbsSetCode == wbsSetCode
|
||||
select x.WbsSetId).ToList();
|
||||
return list;
|
||||
|
||||
return ids;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user