From 5bffb7dbb70647352011ea9da7518bd07ff845a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=9E=AC=ED=98=81?= Date: Fri, 29 Nov 2024 19:28:27 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B1=B0=EB=9E=98=20=ED=83=80=EC=9E=85?= =?UTF-8?q?=EB=AA=85=20=EB=B3=80=EA=B2=BD=20(#185)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 장바구니 추가 기능 구현 * feat: 장바구니 조회 기능 구현 * feat: 상품 주문과 식권 사용 기능 구현 * style: 포인트트랜잭션 레포지토리명 변경 * deploy: 재배포 * deploy: 재배포2 * deploy: 로그인 로직 수정에 따른 재배포 * deploy: 로그인 로직 수정에 따른 재배포2 * feat: 식권 사용 기능 구현 * feat: yml 수정 사항 반영 * feat: 식권 사용 로직 수정 * feat: 주문 로직 수정 완료 * fix: 장바구니에 아무것도 없을 때 주문 시 active 되는 현상 수정 * feat: 주문 완료 시 리턴 값 수정 * feat: 내 그룹 조회 기능 구현 * feat: 기본 프로필 이미지 url 추가 * feat: 그룹 멤버 전체 조회 기능 구현 * feat: 1인당 사용 가능 금액 설정 컬럼 추가 * feat: 내 지갑 조회 기능 구현 * feat: 선결제 기능 구현 * feat: 유저 홈 화면 조회 기능 구현 * feat: 그룹 상세 조회 기능 구현 * feat: 가게 상세 조회 쿼리 수정 * deploy: 변경사항 반영을 위한 커밋 * deploy: 수정 사항 반영 재배포 * deploy: rds 교체로 인한 재배포 * deploy: rds 교체로 인한 재배포2 * feat: 홈 화면 소속팀 조회 쿼리 제대로 안되던 현상 해결, 대표이미지 반환 추가 * feat: 그룹 상세 조회 응답 컬럼명 변경 * feat: memberLimit 컬럼 삭제 * feat: 선결제 시 기존 결제 내역과 멱등성 문제 해결 * fix: 팀 상세 조회 시 이미지 쿼리가 의미 없이 join 되던 쿼리 수정 * feat: 가게 검색 기능 대폭 수정 * feat: 프론트 요구사 반영 * feat: searchcondition 삭제 * feat: 팀타입 desription 리턴 하도록 수정 * feat: 카테고리별 팀 조회 시 팀 생성일 컬럼 추가 * feat: 매장찾기_상세 페이지 조회 기능 구현 * feat: 비밀 코드 조회 기능 엔드 포인트 수정 * fix: conflict fix * hotfix: 서버 복구 * hotfix: 서버 복구2 * feat: Barobill api 연동 * fix: 홈 화면에 같은 데이터가 중복되는 현상 수정 * infra: ElastiCache 연결을 위한 docker-compose 설정 * infra: cicd script 수정 * infra: cicd script ec2 주소 설정 * infra: cicd script 수정2 * infra: cicd script 수정3 * infra: cicd script 수정4 * infra: cicd script 수정5 * infra: cicd script 수정6 * infra: cicd script 수정7 * infra: cicd script 수정7 * infra: cicd script 수정8 * infra: cicd script 수정9 * infra: cicd script 수정10 * infra: cicd script 수정11 * infra: cicd script 수정12 * infra: cicd script 수정13 * infra: cicd script 수정14 * infra: cicd script 수정15 * infra: cicd script 수정16 * infra: cicd script 수정17 * infra: cicd script 수정18 * infra: cicd script 수정19 * infra: cicd script 수정20 * infra: cicd script 수정21 * infra: cicd script 수정22 * fix: 보유금액이 선결제 금액보다 작을 경우 상태값 변경(200->400) * feat: 홈화면 가게 별 선결제 디데이 추가, 쿼리문 조정 * feat: 주문하기 로직 정상화 * feat: 장바구니에 다른 가게 물건이 있는지 검증 구현 * feat: 장바구니 비우기 기능 구현 * deploy: cd retry * feat: 매장 상세 페이지 조회 메뉴 정렬 조건 추가 * feat: 세금명세서 역발행 기능 추가 * feat: 거래 타입명 변경 --- .../barobill/application/BarobillService.java | 47 ++++++++++++------- ...egistAndReverseIssueTaxInvoiceRequest.java | 8 ++++ .../presentation/BarobillController.java | 9 ++++ .../domain/point/domain/TransactionType.java | 17 ++++++- .../domain/user/service/UserService.java | 4 +- 5 files changed, 66 insertions(+), 19 deletions(-) create mode 100644 src/main/java/com/jangburich/domain/barobill/dto/request/RegistAndReverseIssueTaxInvoiceRequest.java diff --git a/src/main/java/com/jangburich/domain/barobill/application/BarobillService.java b/src/main/java/com/jangburich/domain/barobill/application/BarobillService.java index 0d62e75..6e7e017 100644 --- a/src/main/java/com/jangburich/domain/barobill/application/BarobillService.java +++ b/src/main/java/com/jangburich/domain/barobill/application/BarobillService.java @@ -6,6 +6,7 @@ import com.baroservice.ws.TaxInvoice; import com.baroservice.ws.TaxInvoiceTradeLineItem; import com.jangburich.domain.barobill.dto.request.GetCertificateRegistURLRequest; +import com.jangburich.domain.barobill.dto.request.RegistAndReverseIssueTaxInvoiceRequest; import com.jangburich.domain.barobill.dto.request.RegistCorpRequest; import java.util.regex.Pattern; import lombok.RequiredArgsConstructor; @@ -48,33 +49,34 @@ public void getCertificateRegistURL(GetCertificateRegistURLRequest getCertificat } @Transactional - public void registAndReverseIssueTaxInvoice() { + public void registAndReverseIssueTaxInvoice( + RegistAndReverseIssueTaxInvoiceRequest registAndReverseIssueTaxInvoiceRequest) { // 공급자, 공급받는자의 관리번호 채번 String invoicerMgtNum = "000001-R"; String invoiceeMgtNum = "000001-E"; // 공급자, 공급받는자의 바로빌 아이디 불러오기 - String invoicerBarobillID = "barobill"; - String invoiceeBarobillID = "barobill"; + String invoicerBarobillID = registAndReverseIssueTaxInvoiceRequest.invoicerBarobillID(); + String invoiceeBarobillID = registAndReverseIssueTaxInvoiceRequest.invoiceeBarobillID(); // 세금계산서 내용을 담은 클래스(또는 구조체) 생성 TaxInvoice taxInvoice = new TaxInvoice(); /**/ - taxInvoice.setIssueDirection(1); + taxInvoice.setIssueDirection(2); taxInvoice.setTaxInvoiceType(1); taxInvoice.setModifyCode(""); taxInvoice.setTaxType(1); taxInvoice.setTaxCalcType(1); - taxInvoice.setPurposeType(2); + taxInvoice.setPurposeType(1); - taxInvoice.setWriteDate(""); + taxInvoice.setWriteDate("20241129"); - taxInvoice.setAmountTotal(""); - taxInvoice.setTaxTotal(""); - taxInvoice.setTotalAmount(""); + taxInvoice.setAmountTotal("100"); + taxInvoice.setTaxTotal("100"); + taxInvoice.setTotalAmount("200"); taxInvoice.setCash(""); taxInvoice.setChkBill(""); taxInvoice.setNote(""); @@ -94,15 +96,15 @@ public void registAndReverseIssueTaxInvoice() { // 공급자 정보 taxInvoice.setInvoicerParty(new InvoiceParty()); - taxInvoice.getInvoicerParty().setMgtNum(""); + taxInvoice.getInvoicerParty().setMgtNum(invoicerMgtNum); taxInvoice.getInvoicerParty().setCorpNum(""); taxInvoice.getInvoicerParty().setTaxRegID(""); - taxInvoice.getInvoicerParty().setCorpName(""); + taxInvoice.getInvoicerParty().setCorpName("partisbutchershop"); taxInvoice.getInvoicerParty().setCEOName(""); taxInvoice.getInvoicerParty().setAddr(""); - taxInvoice.getInvoicerParty().setBizType(""); - taxInvoice.getInvoicerParty().setBizClass(""); - taxInvoice.getInvoicerParty().setContactID(""); + taxInvoice.getInvoicerParty().setBizType("한식"); + taxInvoice.getInvoicerParty().setBizClass("음식점업"); + taxInvoice.getInvoicerParty().setContactID(invoicerBarobillID); taxInvoice.getInvoicerParty().setContactName(""); taxInvoice.getInvoicerParty().setTEL(""); taxInvoice.getInvoicerParty().setHP(""); @@ -110,14 +112,15 @@ public void registAndReverseIssueTaxInvoice() { //공급받는자 정보 taxInvoice.setInvoiceeParty(new InvoiceParty()); + taxInvoice.getInvoiceeParty().setMgtNum(invoiceeMgtNum); taxInvoice.getInvoiceeParty().setCorpNum(""); taxInvoice.getInvoiceeParty().setTaxRegID(""); - taxInvoice.getInvoiceeParty().setCorpName(""); + taxInvoice.getInvoiceeParty().setCorpName("Jangburich"); taxInvoice.getInvoiceeParty().setCEOName(""); taxInvoice.getInvoiceeParty().setAddr(""); taxInvoice.getInvoiceeParty().setBizType(""); taxInvoice.getInvoiceeParty().setBizClass(""); - taxInvoice.getInvoiceeParty().setContactID(""); + taxInvoice.getInvoiceeParty().setContactID(invoiceeBarobillID); taxInvoice.getInvoiceeParty().setContactName(""); taxInvoice.getInvoiceeParty().setTEL(""); taxInvoice.getInvoiceeParty().setHP(""); @@ -153,5 +156,17 @@ public void registAndReverseIssueTaxInvoice() { taxInvoice.getTaxInvoiceTradeLineItems().getTaxInvoiceTradeLineItem().add(taxInvoiceTradeLineItem); + int result = barobillApiService.taxInvoice.registAndReverseIssueTaxInvoice(CERT_KEY, "", taxInvoice, + false, + false, ""); + + if (result < 0) { // API 호출 실패 + // 오류코드 내용에 따라 파라메터를 수정하여 다시 실행해주세요. + String errMessage = barobillApiService.taxInvoice.getErrString(CERT_KEY, result); + System.out.println(errMessage); + } else { // 성공 + // 파트너 프로그램의 후 처리 + System.out.println("성공"); + } } } diff --git a/src/main/java/com/jangburich/domain/barobill/dto/request/RegistAndReverseIssueTaxInvoiceRequest.java b/src/main/java/com/jangburich/domain/barobill/dto/request/RegistAndReverseIssueTaxInvoiceRequest.java new file mode 100644 index 0000000..72603ba --- /dev/null +++ b/src/main/java/com/jangburich/domain/barobill/dto/request/RegistAndReverseIssueTaxInvoiceRequest.java @@ -0,0 +1,8 @@ +package com.jangburich.domain.barobill.dto.request; + +public record RegistAndReverseIssueTaxInvoiceRequest( + String invoicerBarobillID, + String invoiceeBarobillID +) { + +} diff --git a/src/main/java/com/jangburich/domain/barobill/presentation/BarobillController.java b/src/main/java/com/jangburich/domain/barobill/presentation/BarobillController.java index c92e5ed..49e69fb 100644 --- a/src/main/java/com/jangburich/domain/barobill/presentation/BarobillController.java +++ b/src/main/java/com/jangburich/domain/barobill/presentation/BarobillController.java @@ -2,6 +2,7 @@ import com.jangburich.domain.barobill.application.BarobillService; import com.jangburich.domain.barobill.dto.request.GetCertificateRegistURLRequest; +import com.jangburich.domain.barobill.dto.request.RegistAndReverseIssueTaxInvoiceRequest; import com.jangburich.domain.barobill.dto.request.RegistCorpRequest; import com.jangburich.global.payload.Message; import com.jangburich.global.payload.ResponseCustom; @@ -35,4 +36,12 @@ public ResponseCustom getCertificateRegistURL( barobillService.getCertificateRegistURL(getCertificateRegistURLRequest); return ResponseCustom.OK(Message.builder().message("success").build()); } + + @PostMapping("/registAndReverseIssueTaxInvoice") + public ResponseCustom registAndReverseIssueTaxInvoice( + @RequestBody RegistAndReverseIssueTaxInvoiceRequest registAndReverseIssueTaxInvoiceRequest + ) { + barobillService.registAndReverseIssueTaxInvoice(registAndReverseIssueTaxInvoiceRequest); + return ResponseCustom.OK(Message.builder().message("success").build()); + } } diff --git a/src/main/java/com/jangburich/domain/point/domain/TransactionType.java b/src/main/java/com/jangburich/domain/point/domain/TransactionType.java index b224a2e..2cb7090 100644 --- a/src/main/java/com/jangburich/domain/point/domain/TransactionType.java +++ b/src/main/java/com/jangburich/domain/point/domain/TransactionType.java @@ -1,5 +1,20 @@ package com.jangburich.domain.point.domain; public enum TransactionType { - POINT_PURCHASE, FOOD_PURCHASE, REFUND, RECHARGE, PREPAY + POINT_PURCHASE("지갑 충전"), + FOOD_PURCHASE("제휴 매장 음식 구매"), + REFUND("포인트 환불"), + PREPAY("제휴 매장 선결제 금액 충전"), + PREPAY_REFUND("제휴 매장 선결제 금액 환불"), + FOOD_REFUND("제휴 매장 음식 환불"); + + private final String displayName; + + TransactionType(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } } \ No newline at end of file diff --git a/src/main/java/com/jangburich/domain/user/service/UserService.java b/src/main/java/com/jangburich/domain/user/service/UserService.java index 0d1983c..d044389 100644 --- a/src/main/java/com/jangburich/domain/user/service/UserService.java +++ b/src/main/java/com/jangburich/domain/user/service/UserService.java @@ -181,8 +181,8 @@ public WalletResponse getMyWallet(String userId) { .map(transaction -> new PurchaseHistory( transaction.getCreatedAt().format(DateTimeFormatter.ofPattern("MM.dd")), transaction.getTransactionedPoint(), - transaction.getStore() != null ? transaction.getStore().getName() : "지갑 충전", - transaction.getTransactionType().name())) + transaction.getStore() != null ? transaction.getStore().getName() : "알 수 없음", + transaction.getTransactionType().getDisplayName())) .toList(); return new WalletResponse(user.getPoint(), purchaseHistories); }