Skip to content

Commit

Permalink
로그 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
ehBeak committed Nov 15, 2023
1 parent c953d20 commit 88c0064
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@ public ResponseEntity getRoommateSettlement(@AuthenticationPrincipal UserDetails

String userEmail = userDetails.getUsername();

System.out.println("userEmail = " + userEmail);





HouseholdSettlementCommand command = getHouseholdSettlementUseCase.getRoommateSettlement(
userEmail, startDate, endDate);
System.out.println(
"command.getRoommateSettlementCommands().size() = " + command.getRoommateSettlementCommands().size());

HouseholdSettlementResponse response = new HouseholdSettlementResponse(command, startDate, endDate);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public HouseholdSettlementCommand getRoommateSettlement(String userEmail, LocalD
User user = getUserPort.findUserWithHousehold(userEmail);
BigDecimal userSettlement = getUserSettlement(user, startDate, endDate);


addSettlementToMap(userSettlement, user, creditorMap, debtorMap);

List<User> householdMembers = findHouseholdUserListPort.findHouseholdMembers(user.getHousehold().getHouseholdId());
Expand All @@ -62,6 +63,13 @@ public HouseholdSettlementCommand getRoommateSettlement(String userEmail, LocalD
List<Long> keySetDesc = sortMap(creditorMap);
List<Long> keySetAsc = sortMap(debtorMap);

for (Long hi : keySetDesc) {
System.out.println("hi = " + hi);
}
for (Long hi : keySetAsc) {
System.out.println("hi = " + hi);
}

// 1. 먼저 같은 얘들은 빼기
findEqualSettlement(keySetDesc, keySetAsc, creditorMap, debtorMap, settlements);

Expand Down Expand Up @@ -104,12 +112,15 @@ public HouseholdSettlementCommand getRoommateSettlement(String userEmail, LocalD

boolean isSender;

System.out.println(" =========");
if (filteredSettlements.get(0).getSenderId().equals(user.getUserId())) {
isSender = true;
} else {
isSender = false;
}

System.out.println(" =========");

List<RoommateSettlementCommand> RoommateSettlementCommands;
BigDecimal totalAmount = filteredSettlements.stream().map(SettlementCommand::getSettlementAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
Expand Down

0 comments on commit 88c0064

Please sign in to comment.