forked from 9oormthon-univ/2024_DANPOONG_TEAM_5_BE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request 9oormthon-univ#71 from 9oormthon-univ/feat/orders
Feat/orders
- Loading branch information
Showing
20 changed files
with
297 additions
and
54 deletions.
There are no files selected for viewing
5 changes: 1 addition & 4 deletions
5
src/main/java/com/jangburich/domain/menu/service/MenuService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/jangburich/domain/order/domain/repository/OrdersRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,38 @@ | ||
package com.jangburich.domain.order.domain.repository; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
import com.jangburich.domain.order.domain.OrderStatus; | ||
import com.jangburich.domain.order.domain.Orders; | ||
import com.jangburich.domain.store.domain.Store; | ||
|
||
import org.aspectj.weaver.ast.Or; | ||
import org.hibernate.query.Order; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface OrdersRepository extends JpaRepository<Orders, Long> { | ||
@Query(value = "SELECT * FROM orders WHERE store_id = :storeId AND updated_at < :updatedAt AND order_status = :orderStatus", | ||
nativeQuery = true) | ||
List<Orders> findOrdersByStoreAndDateAndStatusNative( | ||
@Param("storeId") Long storeId, | ||
@Param("updatedAt") LocalDateTime updatedAt, | ||
@Param("orderStatus") String orderStatus); | ||
|
||
@Query("SELECT o FROM Orders o " + | ||
"WHERE o.store.id = :storeId " + | ||
"AND o.updatedAt >= :startOfDay " + | ||
"AND o.updatedAt < :endOfDay " + | ||
"AND o.orderStatus = :orderStatus") | ||
List<Orders> findOrdersByStoreAndTodayDateAndStatus( | ||
@Param("storeId") Long storeId, | ||
@Param("startOfDay") LocalDateTime startOfDay, | ||
@Param("endOfDay") LocalDateTime endOfDay, | ||
@Param("orderStatus") OrderStatus orderStatus); | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/dto/condition/StoreSearchCondition.java โ ...e/dto/condition/StoreSearchCondition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ndition/StoreSearchConditionWithType.java โ ...ndition/StoreSearchConditionWithType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/com/jangburich/domain/store/dto/response/OrdersDetailResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.jangburich.domain.store.dto.response; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@RequiredArgsConstructor | ||
public class OrdersDetailResponse { | ||
private Long id; | ||
private String teamName; | ||
private String teamUserName; | ||
private List<Menu> menus; | ||
private LocalDateTime dateTime; | ||
private Integer amount; | ||
private Integer totalPrice; | ||
private Integer discountPrice; | ||
|
||
@Getter | ||
@Setter | ||
public static class Menu { | ||
private String menuName; | ||
private Integer amount; | ||
} | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
src/main/java/com/jangburich/domain/store/dto/response/OrdersGetResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.jangburich.domain.store.dto.response; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@RequiredArgsConstructor | ||
public class OrdersGetResponse { | ||
private Long id; | ||
private String menuNames; | ||
private LocalDateTime date; | ||
private Integer count; | ||
private Integer price; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/jangburich/domain/store/dto/response/OrdersTodayResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.jangburich.domain.store.dto.response; | ||
|
||
import java.util.List; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class OrdersTodayResponse { | ||
private Integer totalPrice; | ||
private List<OrdersGetResponse> ordersGetResponses; | ||
} |
2 changes: 1 addition & 1 deletion
2
.../response/PaymentGroupDetailResponse.java โ .../response/PaymentGroupDetailResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...in/dto/response/SearchStoresResponse.java โ ...re/dto/response/SearchStoresResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/com/jangburich/domain/store/exception/OrdersNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.jangburich.domain.store.exception; | ||
|
||
public class OrdersNotFoundException extends RuntimeException { | ||
public OrdersNotFoundException() { | ||
super("ํด๋น ๊ฐ๊ฒ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค."); | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
...n/repository/StoreQueryDslRepository.java โ ...e/repository/StoreQueryDslRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
...pository/StoreQueryDslRepositoryImpl.java โ ...pository/StoreQueryDslRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...re/domain/repository/StoreRepository.java โ ...ain/store/repository/StoreRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...omain/repository/StoreTeamRepository.java โ ...store/repository/StoreTeamRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.