From f00ecf6a7fc12ff2cd4439bc7292a1f949930b60 Mon Sep 17 00:00:00 2001 From: kim ye jin <108534554+dPwls0125@users.noreply.github.com> Date: Mon, 25 Sep 2023 16:50:28 +0900 Subject: [PATCH] =?UTF-8?q?[What=20135]=20fix:=20=EC=B2=AD=EA=B5=AC=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20(#79)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 개인별 출공결 확인 * fix:checkedlistbyuser findby 네이밍수정 * feat :출석 종료시 유저별 출성 상황 반영 * feat: 청구 리스트 조회 * fix : 멤버 주석처리 풀음 * fix : 청구 리스트 반환 --- .../gdg/whatssue/entity/ApplyOfficialAbsent.java | 1 + .../java/gdg/whatssue/service/AccountService.java | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/gdg/whatssue/entity/ApplyOfficialAbsent.java b/src/main/java/gdg/whatssue/entity/ApplyOfficialAbsent.java index 661244b..b92d76d 100644 --- a/src/main/java/gdg/whatssue/entity/ApplyOfficialAbsent.java +++ b/src/main/java/gdg/whatssue/entity/ApplyOfficialAbsent.java @@ -15,6 +15,7 @@ public class ApplyOfficialAbsent { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long applyOfficialAbsentId; + private String absentReason; private LocalDate absentDate; private String absentIsAccepted; diff --git a/src/main/java/gdg/whatssue/service/AccountService.java b/src/main/java/gdg/whatssue/service/AccountService.java index c73dfec..d8a6882 100644 --- a/src/main/java/gdg/whatssue/service/AccountService.java +++ b/src/main/java/gdg/whatssue/service/AccountService.java @@ -8,6 +8,7 @@ import gdg.whatssue.service.dto.AccountClaimDto; import jakarta.persistence.EntityNotFoundException; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -22,6 +23,7 @@ @Service @RequiredArgsConstructor +@Slf4j public class AccountService { private final ClaimRepository claimRepository; private final ClubRepository clubRepository; @@ -63,8 +65,16 @@ public ResponseEntity getClaimList(Long ClubId) { Club club = clubRepository.findById(ClubId).orElseThrow(() -> ( new ResponseStatusException(HttpStatus.NOT_FOUND, "클럽을 찾을 수 없습니다.") )); + log.info("club = " + club); List claimList = claimRepository.findAllByClub(club); - return ResponseEntity.ok(claimList); + if(claimList.size() != 0){ + List accountClaimDtoList = claimList.stream().map(claim -> AccountClaimDto.builder() + .claimName(claim.getClaimName()) + .claimAmount(claim.getClaimAmount().toString()) + .claimDate(claim.getClaimDate().toString()) + .build()).toList(); + return ResponseEntity.ok(accountClaimDtoList); + }else return ResponseEntity.status(HttpStatus.NOT_FOUND).body("클럽을 찾을 수 없습니다."); } public ResponseEntity checkMemberPaid(Long memberId, Long claimId){ Member member = memberRepository.findById(memberId).orElseThrow(() -> ( @@ -92,8 +102,6 @@ public ResponseEntity createBook(AccountBookCreateDto accountBookCreateDto) { if (optionalClub.isPresent()) { Club club = optionalClub.get(); //MoneyBook moneyBook = MoneyBookCreateMapper.INSTANCE.toEntity(accountBookCreateDto); - - try { //기존에 clubId 와 일치하는 리스트 가져오기 List moneyBookList = moneyBookRepository.findAllByClub(club);