From be29c34e596efbbdd701375234b43964f772139b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=80=E1=85=B5=E1=86=B7=E1=84=8C=E1=85=A9=E1=86=BC?= =?UTF-8?q?=E1=84=8B=E1=85=AF=E1=86=AB=20Jongwon?= Date: Tue, 22 Aug 2023 22:01:28 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[BUG=20FIX]=20#411:=20=EC=9C=A0=EC=82=AC?= =?UTF-8?q?=EA=B2=AC=EC=A0=81=20=EC=98=B5=EC=85=98=20=EC=88=9C=EC=84=9C=20?= =?UTF-8?q?=EC=9E=90=EB=8F=99=20sort=EB=90=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend-recommend/recommend.py | 2 +- .../java/autoever2/cartag/domain/quote/HistorySearchDto.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend-recommend/recommend.py b/backend-recommend/recommend.py index 0460a72..6cd4c9a 100644 --- a/backend-recommend/recommend.py +++ b/backend-recommend/recommend.py @@ -54,7 +54,7 @@ def recByApriori(body): antecedents = set(row.antecedents) consequents = set(row.consequents) - if antecedents.issubset(input) and len(consequents) <= 2 and not antecedents.union(consequents).issubset(input): + if antecedents.isdisjoint(input) and len(consequents) <= 2 and antecedents.union(consequents).isdisjoint(input): key = tuple(consequents) if key not in matching_itemsets or confidence > matching_itemsets[key]: matching_itemsets[key] = confidence diff --git a/backend/src/main/java/autoever2/cartag/domain/quote/HistorySearchDto.java b/backend/src/main/java/autoever2/cartag/domain/quote/HistorySearchDto.java index 42da0ec..457fe78 100644 --- a/backend/src/main/java/autoever2/cartag/domain/quote/HistorySearchDto.java +++ b/backend/src/main/java/autoever2/cartag/domain/quote/HistorySearchDto.java @@ -27,10 +27,12 @@ public HistorySearchDto(int carId, int powerTrainId, int bodyTypeId, int operati this.optionIds = new ArrayList<>(); this.optionIds.addAll(optionIds); + optionIds.sort(null); } public void addAllOption(List optionId) { optionIds.addAll(optionId); + optionIds.sort(null); } public String getOptionIds() { From e333a98f474da5c8e8b12fc215c5ffe5277bbad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=80=E1=85=B5=E1=86=B7=E1=84=8C=E1=85=A9=E1=86=BC?= =?UTF-8?q?=E1=84=8B=E1=85=AF=E1=86=AB=20Jongwon?= Date: Tue, 22 Aug 2023 22:11:26 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[BUG=20FIX]=20#411:=20builder=20=ED=8C=A8?= =?UTF-8?q?=ED=84=B4=20=EB=82=B4=EB=B6=80=EC=97=90=EC=84=9C=20sort?= =?UTF-8?q?=EC=95=88=EB=90=98=EB=8A=94=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/autoever2/cartag/domain/quote/HistorySearchDto.java | 4 ++-- .../src/main/java/autoever2/cartag/service/QuoteService.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/autoever2/cartag/domain/quote/HistorySearchDto.java b/backend/src/main/java/autoever2/cartag/domain/quote/HistorySearchDto.java index 457fe78..295dd07 100644 --- a/backend/src/main/java/autoever2/cartag/domain/quote/HistorySearchDto.java +++ b/backend/src/main/java/autoever2/cartag/domain/quote/HistorySearchDto.java @@ -5,6 +5,7 @@ import lombok.NoArgsConstructor; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Objects; @@ -27,12 +28,11 @@ public HistorySearchDto(int carId, int powerTrainId, int bodyTypeId, int operati this.optionIds = new ArrayList<>(); this.optionIds.addAll(optionIds); - optionIds.sort(null); } public void addAllOption(List optionId) { optionIds.addAll(optionId); - optionIds.sort(null); + Collections.sort(optionIds); } public String getOptionIds() { diff --git a/backend/src/main/java/autoever2/cartag/service/QuoteService.java b/backend/src/main/java/autoever2/cartag/service/QuoteService.java index 2596837..fa951a5 100644 --- a/backend/src/main/java/autoever2/cartag/service/QuoteService.java +++ b/backend/src/main/java/autoever2/cartag/service/QuoteService.java @@ -13,6 +13,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -26,6 +27,7 @@ public class QuoteService { public HistoryShortDto findMyQuote(QuoteDataDto quoteDataDto) { List optionIds = quoteDataDto.getOptionIdList(); + Collections.sort(optionIds); HistorySearchDto historyData = HistorySearchDto.builder() .carId(quoteDataDto.getCarId()) @@ -40,6 +42,7 @@ public HistoryShortDto findMyQuote(QuoteDataDto quoteDataDto) { public List findTopHistory(QuoteDataDto quoteDataDto) { List optionIds = quoteDataDto.getOptionIdList(); + Collections.sort(optionIds); if(optionIds.isEmpty()) { throw new InvalidDataException(ErrorCode.INVALID_PARAMETER);