Skip to content

Commit

Permalink
Merge pull request #140 from UMC-WOWMARKET/feat/v2fix
Browse files Browse the repository at this point in the history
[feat]projectName 변경 반영
  • Loading branch information
yunji118 authored Dec 28, 2023
2 parents 470ae10 + df49754 commit 5ac68c5
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 37 deletions.
9 changes: 5 additions & 4 deletions src/main/java/wowmarket/wow_server/demand/dto/DemandDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@
import wowmarket.wow_server.domain.DemandProject;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Getter
@NoArgsConstructor
public class DemandDto {
private Long project_id;
private String project_name;
private String seller_name;
private LocalDate start_date;
private LocalDate end_date;
private LocalDateTime start_date;
private LocalDateTime end_date;
private String thumbnail;
private int achieved; //달성률 분자: 모든 주문상세의 '주문개수' 컬럼의 합
private int goal; //달성률 분모: 상품 테이블에서 프로젝트 번호로 조회하여 해당 프로젝트에 들어있는 상품의 목표치의 합

public DemandDto(DemandProject demandProject, int demandProject_total_count, int demandProject_total_goal) {
this.project_id = demandProject.getId();
this.project_name = demandProject.getName();
this.seller_name = demandProject.getNickname();
this.project_name = demandProject.getProjectName();
this.seller_name = demandProject.getSellerName();
this.start_date = demandProject.getStartDate();
this.end_date = demandProject.getEndDate();
this.thumbnail = demandProject.getThumbnail();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import wowmarket.wow_server.domain.DemandProject;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Getter
public class DemandProjectInfoResponseDto {
Expand All @@ -13,18 +14,18 @@ public class DemandProjectInfoResponseDto {
private String univ; //판매자의 대학교
private String nickname; //프로젝트 담당자명
private String description; //프로젝트 설명
private LocalDate start_date; //시작날짜
private LocalDate end_date; //종료날짜
private LocalDateTime start_date; //시작날짜
private LocalDateTime end_date; //종료날짜
private int participant_number; //참여인원
private int achieved; //달성률 분자
private int goal; //달성률 분모

public DemandProjectInfoResponseDto(DemandProject project, int achieved, int goal) {
this.thumbnail = project.getThumbnail(); //대표이미지
this.category = project.getCategory().getName(); //카테고리
this.name = project.getName(); //프로젝트 이름
this.name = project.getProjectName(); //프로젝트 이름
this.univ = project.getUser().getUniv(); //판매자의 대학교
this.nickname = project.getNickname(); //프로젝트 담당자명
this.nickname = project.getSellerName(); //프로젝트 담당자명
this.description = project.getDescription(); //프로젝트 설명
this.start_date = project.getStartDate(); //시작날짜
this.end_date = project.getEndDate(); //종료날짜
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class OrderResponseDto {
private List<ItemResponseDto> itemResponseDtoList;

public OrderResponseDto(Project project, List<ItemResponseDto> itemResponseDtoList) {
this.receive_type=project.getReceive_type();
this.receive_type=project.getReceive_type().toString();
this.receive_address=project.getReceive_address();
this.delivery_fee=project.getDelivery_fee();
this.bank=project.getBank();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import wowmarket.wow_server.domain.Project;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Getter
public class ProjectInfoResponseDto {
Expand All @@ -13,8 +14,8 @@ public class ProjectInfoResponseDto {
private String univ; //판매자의 대학교
private String nickname; //프로젝트 담당자명
private String description; //프로젝트 설명
private LocalDate start_date; //시작날짜
private LocalDate end_date; //종료날짜
private LocalDateTime start_date; //시작날짜
private LocalDateTime end_date; //종료날짜
private int participant_number; //참여인원
private int achieved; //달성률 분자: 모든 주문상세의 '주문개수' 컬럼의 합
private int goal; //달성률 분모: 상품 테이블에서 프로젝트 번호로 조회하여 해당 프로젝트에 들어있는 상품의 목표치의 합
Expand All @@ -23,9 +24,9 @@ public class ProjectInfoResponseDto {
public ProjectInfoResponseDto(Project project, int achieved, int goal) {
this.thumbnail = project.getThumbnail(); //대표이미지
this.category = project.getCategory().getName(); //카테고리
this.name = project.getName(); //프로젝트 이름
this.name = project.getProjectName(); //프로젝트 이름
this.univ = project.getUser().getUniv(); //판매자의 대학교
this.nickname = project.getNickname(); //프로젝트 담당자명
this.nickname = project.getSellerName(); //프로젝트 담당자명
this.description = project.getDescription(); //프로젝트 설명
this.start_date = project.getStartDate(); //시작날짜
this.end_date = project.getEndDate(); //종료날짜
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public MyOrderFormDetailResponseDto(List<MyOrderFormDetailDto> itemList, Orders
this.buyer_account = orders.getAccount();
this.buyer_account_name = orders.getDepositor();
this.deposittime = orders.getDepositTime();
this.project_name = orders.getProject().getName();
this.project_name = orders.getProject().getProjectName();
this.description = orders.getProject().getDescription();
this.total_price = orders.getTotal_price();
this.thumbnail = orders.getProject().getThumbnail();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class MyOrderFormResponseDto {

public MyOrderFormResponseDto(Orders order){
this.orderId = order.getId();
this.name = order.getProject().getName();
this.name = order.getProject().getProjectName();
this.createdtime = order.getCreated_time();
this.status = order.getOrder_status();
this.is_del = order.getIsDel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import wowmarket.wow_server.mypage.myproject.MyDemandProject.dto.MyDemandItemDto;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Getter
Expand All @@ -18,13 +19,13 @@ public class MyDemandDetailResponseDto {
private String image1;
private String image2;
private String image3;
private LocalDate startdate;
private LocalDate enddate;
private String seller_nickname;
private LocalDateTime startdate;
private LocalDateTime enddate;
private String seller_name;

public MyDemandDetailResponseDto(List<MyDemandItemDto> itemList, DemandProject demandProject){
this.projectId = demandProject.getId();
this.projectname = demandProject.getName();
this.projectname = demandProject.getProjectName();
this.description = demandProject.getDescription();
this.thumbnail = demandProject.getThumbnail();
this.itemList = itemList;
Expand All @@ -34,7 +35,7 @@ public MyDemandDetailResponseDto(List<MyDemandItemDto> itemList, DemandProject d
this.image3 = demandProject.getImage3();
this.startdate = demandProject.getStartDate();
this.enddate = demandProject.getEndDate();
this.seller_nickname = demandProject.getNickname();
this.seller_name = demandProject.getSellerName();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class MyDemandDto {

public MyDemandDto(DemandProject demandProject){
this.id = demandProject.getId();
this.name = demandProject.getName();
this.name = demandProject.getProjectName();
this.createdtime = demandProject.getCreated_time();
this.status = (demandProject.isEnd() == false ? 0 : 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class MySalesOrderDto {
public MySalesOrderDto(Orders orders){
this.id = orders.getId();
this.id = orders.getId();
this.name = orders.getProject().getName();
this.name = orders.getProject().getProjectName();
this.createdtime = orders.getCreated_time();
this.status = orders.getOrder_status();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import wowmarket.wow_server.domain.Project;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Getter
Expand All @@ -19,13 +20,13 @@ public class MySalesDetailResponseDto {
private String image2;
private String image3;
private List<MySalesItemDto> itemList;
private LocalDate startdate;
private LocalDate enddate;
private LocalDateTime startdate;
private LocalDateTime enddate;
private String receive_type;
private String seller_bank;
private String seller_account;
private String seller_account_name;
private String seller_nickname;
private String seller_name;
private Long delivery_fee;
private String seller_phone_number;
private String seller_email;
Expand All @@ -34,7 +35,7 @@ public class MySalesDetailResponseDto {

public MySalesDetailResponseDto(Project project, List<MySalesItemDto> itemDtos){
this.projectId = project.getId();
this.projectname = project.getName();
this.projectname = project.getProjectName();
this.description = project.getDescription();
this.thumbnail = project.getThumbnail();
this.image1 = project.getImage1();
Expand All @@ -44,10 +45,14 @@ public MySalesDetailResponseDto(Project project, List<MySalesItemDto> itemDtos){
this.itemList = itemDtos;
this.startdate = project.getStartDate();
this.enddate = project.getEndDate();
this.receive_type = project.getReceive_type();
this.receive_type = project.getReceive_type().toString();
this.seller_bank = project.getBank();
this.seller_account = project.getAccount();
this.seller_account_name = project.getAccount_holder_name();
this.seller_nickname = project.getNickname();
this.seller_name = project.getSellerName();
this.delivery_fee = project.getDelivery_fee();
this.seller_phone_number = project.getPhoneNumber();
this.seller_email = project.getEmail();
this.seller_etc = project.getSellerEtc();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class MySalesFormDto {

public MySalesFormDto(Project project){
this.id = project.getId();
this.name = project.getName();
this.name = project.getProjectName();
this.createdtime = project.getCreated_time();
this.status = (project.isEnd() == false? 0 : 1);
this.description = project.getDescription();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public interface DemandProjectRepository extends JpaRepository<DemandProject, Lo
@Query("SELECT dp FROM DemandProject dp " +
"WHERE dp.isEnd = false " +
"AND dp.startDate <= :current_date AND dp.endDate >= :current_date " +
"AND dp.name LIKE CONCAT('%', :search, '%') " +
"AND dp.projectName LIKE CONCAT('%', :search, '%') " +
"AND dp.user.univ = :user_univ")
Page<DemandProject> findBySearchUserUniv(@Param("current_date") LocalDate current_date, @Param("search") String search,
@Param("user_univ") String user_univ, Pageable pageable);

@Query("SELECT dp FROM DemandProject dp " +
"WHERE dp.isEnd = false " +
"AND dp.startDate <= :current_date AND dp.endDate >= :current_date " +
"AND dp.name LIKE CONCAT('%', :search, '%')")
"AND dp.projectName LIKE CONCAT('%', :search, '%')")
Page<DemandProject> findBySearch(@Param("current_date") LocalDate current_date, @Param("search") String search, Pageable pageable);

Page<DemandProject> findDemandProjectByUser_Id(Long seller_id, Pageable pageable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ public interface ProjectRepository extends JpaRepository<Project, Long> {
@Query("SELECT p FROM Project p " +
"WHERE p.isDel = false AND p.isEnd = false " +
"AND p.startDate <= :current_date AND p.endDate >= :current_date " +
"AND p.name LIKE CONCAT('%', :search, '%') " +
"AND p.projectName LIKE CONCAT('%', :search, '%') " +
"AND p.user.univ = :user_univ")
Page<Project> findBySearchUserUniv(@Param("current_date") LocalDate current_date, @Param("search") String search,
@Param("user_univ") String user_univ, Pageable pageable);

@Query("SELECT p FROM Project p " +
"WHERE p.isDel = false AND p.isEnd = false " +
"AND p.startDate <= :current_date AND p.endDate >= :current_date " +
"AND p.name LIKE CONCAT('%', :search, '%')")
"AND p.projectName LIKE CONCAT('%', :search, '%')")
Page<Project> findBySearch(@Param("current_date") LocalDate current_date, @Param("search") String search, Pageable pageable);

Page<Project> findByUser_Id(Long sellerId, Pageable pageable);
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/wowmarket/wow_server/sale/dto/SaleDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@
import wowmarket.wow_server.domain.Project;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Getter
@NoArgsConstructor
public class SaleDto {
private Long project_id;
private String project_name;
private String seller_name;
private LocalDate start_date;
private LocalDate end_date;
private LocalDateTime start_date;
private LocalDateTime end_date;
private String thumbnail;
private int achieved; //달성률 분자: 모든 주문상세의 '주문개수' 컬럼의 합
private int goal; //달성률 분모: 상품 테이블에서 프로젝트 번호로 조회하여 해당 프로젝트에 들어있는 상품의 목표치의 합

public SaleDto(Project project, int project_total_count, int project_total_goal) {
this.project_id = project.getId();
this.project_name = project.getName();
this.seller_name = project.getNickname();
this.project_name = project.getProjectName();
this.seller_name = project.getSellerName();
this.start_date = project.getStartDate();
this.end_date = project.getEndDate();
this.thumbnail = project.getThumbnail();
Expand Down

0 comments on commit 5ac68c5

Please sign in to comment.