Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG FIX] #411: 유사견적 옵션 순서 자동 sort되도록 버그수정 #412

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend-recommend/recommend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

Expand All @@ -31,6 +32,7 @@ public HistorySearchDto(int carId, int powerTrainId, int bodyTypeId, int operati

public void addAllOption(List<Integer> optionId) {
optionIds.addAll(optionId);
Collections.sort(optionIds);
}

public String getOptionIds() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -26,6 +27,7 @@ public class QuoteService {

public HistoryShortDto findMyQuote(QuoteDataDto quoteDataDto) {
List<Integer> optionIds = quoteDataDto.getOptionIdList();
Collections.sort(optionIds);

HistorySearchDto historyData = HistorySearchDto.builder()
.carId(quoteDataDto.getCarId())
Expand All @@ -40,6 +42,7 @@ public HistoryShortDto findMyQuote(QuoteDataDto quoteDataDto) {
public List<HistoryShortDto> findTopHistory(QuoteDataDto quoteDataDto) {

List<Integer> optionIds = quoteDataDto.getOptionIdList();
Collections.sort(optionIds);

if(optionIds.isEmpty()) {
throw new InvalidDataException(ErrorCode.INVALID_PARAMETER);
Expand Down