[성현모] 조회 예외처리 추가
This commit is contained in:
@ -225,36 +225,39 @@ namespace Web.Tra.Services
|
||||
if (context is not null)
|
||||
{
|
||||
var prodRelease = context.PROD_Releases.Where(x => x.ProdNo_C == productNo && x.TestCodeNo == outTestCode)?.FirstOrDefault();
|
||||
var prodVariant = context.PROD_Variants.Where(x => x.No == prodRelease.VariantNo)?.FirstOrDefault();
|
||||
var prodGroup = context.PROD_Groups.Where(x => x.No == prodVariant.GroupNo)?.FirstOrDefault();
|
||||
var statTestCode = context.STAT_TestCodes.Where(x => x.No == prodRelease.TestCodeNo)?.FirstOrDefault();
|
||||
var storTestListFile = context.STOR_TestListFiles.Where(x => x.No == prodVariant.TestListFileNo)?.FirstOrDefault();
|
||||
var maxStepVersion = context.HIST_TestListFileLatestStepVersions.Where(x => x.TestListFileNo == prodVariant.TestListFileNo)?.FirstOrDefault();
|
||||
|
||||
//max version보다 크면 max로
|
||||
if (stepVersion > maxStepVersion.LatestStepVersion)
|
||||
if(prodRelease is not null)
|
||||
{
|
||||
stepVersion = maxStepVersion.LatestStepVersion;
|
||||
}
|
||||
else if (stepVersion < 0)
|
||||
{
|
||||
stepVersion = 0;
|
||||
}
|
||||
var prodVariant = context.PROD_Variants.Where(x => x.No == prodRelease.VariantNo)?.FirstOrDefault();
|
||||
var prodGroup = context.PROD_Groups.Where(x => x.No == prodVariant.GroupNo)?.FirstOrDefault();
|
||||
var statTestCode = context.STAT_TestCodes.Where(x => x.No == prodRelease.TestCodeNo)?.FirstOrDefault();
|
||||
var storTestListFile = context.STOR_TestListFiles.Where(x => x.No == prodVariant.TestListFileNo)?.FirstOrDefault();
|
||||
var maxStepVersion = context.HIST_TestListFileLatestStepVersions.Where(x => x.TestListFileNo == prodVariant.TestListFileNo)?.FirstOrDefault();
|
||||
|
||||
var findTestList = context.VRFY_TestListFileReleases
|
||||
.Where(x => x.TestListFileNo == prodVariant.TestListFileNo && x.StepVersion <= stepVersion)
|
||||
.OrderBy(x => x.StepID)
|
||||
.ThenByDescending(x => x.StepVersion)
|
||||
.AsEnumerable()
|
||||
.DistinctBy(x => x.StepID)
|
||||
.ToList();
|
||||
//max version보다 크면 max로
|
||||
if (stepVersion > maxStepVersion.LatestStepVersion)
|
||||
{
|
||||
stepVersion = maxStepVersion.LatestStepVersion;
|
||||
}
|
||||
else if (stepVersion < 0)
|
||||
{
|
||||
stepVersion = 0;
|
||||
}
|
||||
|
||||
testList.ProdRelease = prodRelease;
|
||||
testList.ProdVariant = prodVariant;
|
||||
testList.ProdGroup = prodGroup;
|
||||
testList.StatTestCode = statTestCode;
|
||||
testList.StorTestListFile = storTestListFile;
|
||||
testList.TestListFile = findTestList;
|
||||
var findTestList = context.VRFY_TestListFileReleases
|
||||
.Where(x => x.TestListFileNo == prodVariant.TestListFileNo && x.StepVersion <= stepVersion)
|
||||
.OrderBy(x => x.StepID)
|
||||
.ThenByDescending(x => x.StepVersion)
|
||||
.AsEnumerable()
|
||||
.DistinctBy(x => x.StepID)
|
||||
.ToList();
|
||||
|
||||
testList.ProdRelease = prodRelease;
|
||||
testList.ProdVariant = prodVariant;
|
||||
testList.ProdGroup = prodGroup;
|
||||
testList.StatTestCode = statTestCode;
|
||||
testList.StorTestListFile = storTestListFile;
|
||||
testList.TestListFile = findTestList;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user