Skip to content

Commit

Permalink
Merge pull request #121 from Orange-Co/feature/fcm
Browse files Browse the repository at this point in the history
chore: change checking date
  • Loading branch information
Kang1221 authored Oct 15, 2024
2 parents c119106 + 3579540 commit f299543
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/co/orange/ddanzi/service/OrderService.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public Order getOrderRecord(String orderId){
@Transactional
public void checkOrderPlacedOrder(){
//입금 후 1일(24시간)이 지났는데, 판매확정이 되지 않았을 시 - 거래 취소
LocalDateTime oneDayLimit = LocalDateTime.now().minusMinutes(1);
LocalDateTime oneDayLimit = LocalDateTime.now().minusDays(1);
List<Order> orderPlaceOrders = orderRepository.findOverLimitTimeOrders(OrderStatus.ORDER_PLACE, oneDayLimit);
for(Order order : orderPlaceOrders){
paymentService.refundPayment(order.getBuyer(), order, "고객이 판매확정을 하지 않아 거래가 취소되어 결제 금액을 환불합니다.");
Expand All @@ -186,7 +186,7 @@ public void checkOrderPlacedOrder(){
@Transactional
public void checkShippingOrder(){
//판매확정 후 3일 (72시간)이 지났는데, 구매확정이 되지 않았을 시
LocalDateTime threeDayLimit = LocalDateTime.now().minusMinutes(3);
LocalDateTime threeDayLimit = LocalDateTime.now().minusDays(3);
List<Order> shippingOrders = orderRepository.findOverLimitTimeOrders(OrderStatus.SHIPPING, threeDayLimit);
for(Order order : shippingOrders){
fcmService.sendMessageToUser(order.getBuyer(), FcmCase.B3, order);
Expand All @@ -197,7 +197,7 @@ public void checkShippingOrder(){
@Transactional
public void checkDelayedShippingOrder(){
//판매확정 후 6일 (144시간)이 지났는데, 구매확정이 되지 않았고, 신고도 하지 않았을 시
LocalDateTime sixDayLimit = LocalDateTime.now().minusMinutes(3);
LocalDateTime sixDayLimit = LocalDateTime.now().minusDays(3);
List<Order> delayedShippingOrders = orderRepository.findOverLimitTimeOrders(OrderStatus.DELAYED_SHIPPING, sixDayLimit);
for(Order order : delayedShippingOrders){
fcmService.sendMessageToUser(order.getBuyer(), FcmCase.B4, order);
Expand All @@ -208,7 +208,7 @@ public void checkDelayedShippingOrder(){
@Transactional
public void checkWarningOrder(){
//판매확정 후 7일 (168시간)이 지났는데, 구매확정이 되지 않았고, 신고도 하지 않았을 시
LocalDateTime sevenDayLimit = LocalDateTime.now().minusMinutes(1);
LocalDateTime sevenDayLimit = LocalDateTime.now().minusDays(1);
List<Order> delayedShippingOrders = orderRepository.findOverLimitTimeOrders(OrderStatus.WARNING, sevenDayLimit);
for(Order order : delayedShippingOrders){
fcmService.sendMessageToUser(order.getItem().getSeller(), FcmCase.A3, order);
Expand Down

0 comments on commit f299543

Please sign in to comment.