From ab9bfdfc18ebcecf73dab3ed33afb06de3222fe6 Mon Sep 17 00:00:00 2001 From: SHM Date: Fri, 19 Sep 2025 09:17:40 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=84=B1=ED=98=84=EB=AA=A8]=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=98=88=EC=99=B8=EC=B2=98=EB=A6=AC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Web.Tra/Services/CPXV2LogService.cs | 57 ++++++++++--------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/Projects/WebClient/Web.Tra/Services/CPXV2LogService.cs b/Projects/WebClient/Web.Tra/Services/CPXV2LogService.cs index 46bc6ae..c99ec3e 100644 --- a/Projects/WebClient/Web.Tra/Services/CPXV2LogService.cs +++ b/Projects/WebClient/Web.Tra/Services/CPXV2LogService.cs @@ -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; + } } } }