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