From 57139b1169e3db9677f37afdcac6688a8fb0639e Mon Sep 17 00:00:00 2001 From: haeri Date: Thu, 9 Nov 2023 03:23:52 +0000 Subject: [PATCH 1/3] =?UTF-8?q?Chore=20:=20=EC=B5=9C=EC=A2=85=ED=99=95?= =?UTF-8?q?=EC=9D=B8=EC=84=9C,=20=ED=85=9C=ED=94=8C=EB=A6=BF,=20=EC=8A=A4?= =?UTF-8?q?=EC=BC=80=EC=A4=84=ED=91=9C=20content=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=ED=83=80=EC=9E=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/lab/cherry/nw/model/FinalTemplEntity.java | 12 ++++++++---- .../java/lab/cherry/nw/model/FinaldocsEntity.java | 8 ++++---- .../java/lab/cherry/nw/model/ScheduleEntity.java | 8 +++----- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java b/nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java index a793c99..c347cba 100644 --- a/nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java +++ b/nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java @@ -17,6 +17,7 @@ import java.io.Serializable; import java.time.Instant; +import java.util.List; import java.util.Map; /** @@ -53,7 +54,9 @@ public class FinalTemplEntity implements Serializable { @JsonProperty("content") @Schema(title = "최종확인서 템플릿 내용", example = "문서 내용") - private Map content; + // private Map content; + private List content; + @JsonProperty("updated_at") @JsonFormat(pattern="yyyy-MM-dd hh:mm:ss", locale = "ko_KR", timezone = "Asia/Seoul") @@ -81,8 +84,8 @@ public static class FinalTemplCreateDto { private String orgId; @Schema(title = "최종확인서 템플릿 내용", example = "문서 내용") - private Map content; - + private List content; + } @Getter @@ -97,7 +100,8 @@ public static class FinalTemplUpdateDto { private String orgId; @Schema(title = "최종확인서 템플릿 내용", example = "문서 내용") - private Map content; + private List content; + } diff --git a/nw/src/main/java/lab/cherry/nw/model/FinaldocsEntity.java b/nw/src/main/java/lab/cherry/nw/model/FinaldocsEntity.java index c9a6030..0ef4f54 100644 --- a/nw/src/main/java/lab/cherry/nw/model/FinaldocsEntity.java +++ b/nw/src/main/java/lab/cherry/nw/model/FinaldocsEntity.java @@ -17,6 +17,7 @@ import java.io.Serializable; import java.time.Instant; +import java.util.List; import java.util.Map; /** @@ -64,8 +65,7 @@ public class FinaldocsEntity implements Serializable { @JsonProperty("content") @Schema(title = "최종확인서 내용", example = "") - private Map content; - + private List content; @JsonProperty("updated_at") @@ -109,7 +109,7 @@ public static class FinaldocsCreateDto { // @NotBlank @JsonProperty("content") @Schema(title = "최종확인서 내용", example = "") - private Map content; + private List content; } @@ -133,7 +133,7 @@ public static class FinaldocsUpdateDto { private String org; @Schema(title = "최종확인서 내용", example = "") - private Map content; + private List content; } diff --git a/nw/src/main/java/lab/cherry/nw/model/ScheduleEntity.java b/nw/src/main/java/lab/cherry/nw/model/ScheduleEntity.java index edafddb..cbdcf47 100644 --- a/nw/src/main/java/lab/cherry/nw/model/ScheduleEntity.java +++ b/nw/src/main/java/lab/cherry/nw/model/ScheduleEntity.java @@ -48,7 +48,7 @@ public class ScheduleEntity implements Serializable { @JsonProperty("scheduleContent") @Schema(title = "스케줄표 내용", example = "[]") - private Map content; + private List content; @JsonProperty("column") @Schema(title = "스케줄표 컬럼", example = "") @@ -65,14 +65,12 @@ public class ScheduleEntity implements Serializable { @NoArgsConstructor @AllArgsConstructor public static class ScheduleCreateDto { - @NotBlank @Schema(title = "조직 고유번호", example = "64ed89aa9e813b5ab16da6de") private String orgId; - @Schema(title = "스케줄표 템플릿 내용", example = "문서 내용") - private Map content; + private List content; } @@ -93,7 +91,7 @@ public static class transDto { @JsonProperty("scheduleContent") @Schema(title = "스케줄표 내용", example = "[]") - private Map content; + private List content; } From 5bca22132baf7874fdbfc576be92f7fd2e5861ac Mon Sep 17 00:00:00 2001 From: haeri Date: Thu, 9 Nov 2023 03:27:14 +0000 Subject: [PATCH 2/3] =?UTF-8?q?Chore=20:=20=EC=B5=9C=EC=A2=85=ED=99=95?= =?UTF-8?q?=EC=9D=B8=EC=84=9C,=20=ED=85=9C=ED=94=8C=EB=A6=BF,=20=EC=8A=A4?= =?UTF-8?q?=EC=BC=80=EC=A4=84=ED=91=9C=20content=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=ED=83=80=EC=9E=85=20list=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/lab/cherry/nw/model/FinalTemplEntity.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java b/nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java index c347cba..363bbea 100644 --- a/nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java +++ b/nw/src/main/java/lab/cherry/nw/model/FinalTemplEntity.java @@ -93,15 +93,14 @@ public static class FinalTemplCreateDto { @NoArgsConstructor @AllArgsConstructor public static class FinalTemplUpdateDto { - @Schema(title = "사용자 고유 번호", example = "64ed89aa9e813b5ab16da6de") - private String userSeq; + @Schema(title = "사용자 고유 번호", example = "64ed89aa9e813b5ab16da6de") + private String userSeq; - @Schema(title = "조직 고유 번호", example = "64ed89aa9e813b5ab16da6de") - private String orgId; + @Schema(title = "조직 고유 번호", example = "64ed89aa9e813b5ab16da6de") + private String orgId; - @Schema(title = "최종확인서 템플릿 내용", example = "문서 내용") - private List content; - + @Schema(title = "최종확인서 템플릿 내용", example = "문서 내용") + private List content; } From 74b317c2e3aa8867d55f897fde4eec0c83d81b4c Mon Sep 17 00:00:00 2001 From: haeri Date: Thu, 9 Nov 2023 03:32:24 +0000 Subject: [PATCH 3/3] =?UTF-8?q?Chore=20:=20=EC=8A=A4=EC=BC=80=EC=A4=84?= =?UTF-8?q?=ED=91=9C=20=EC=95=88=EC=93=B0=EB=8A=94=20API=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nw/controller/ScheduleController.java | 70 +------------------ .../lab/cherry/nw/model/ScheduleEntity.java | 21 ------ .../nw/service/Impl/ScheduleServiceImpl.java | 40 ----------- .../cherry/nw/service/ScheduleService.java | 1 - 4 files changed, 1 insertion(+), 131 deletions(-) diff --git a/nw/src/main/java/lab/cherry/nw/controller/ScheduleController.java b/nw/src/main/java/lab/cherry/nw/controller/ScheduleController.java index 7fe8335..45642a2 100644 --- a/nw/src/main/java/lab/cherry/nw/controller/ScheduleController.java +++ b/nw/src/main/java/lab/cherry/nw/controller/ScheduleController.java @@ -8,7 +8,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lab.cherry.nw.error.ErrorResponse; -import lab.cherry.nw.model.FinalTemplEntity; import lab.cherry.nw.model.ScheduleEntity; import lab.cherry.nw.service.ScheduleService; import lab.cherry.nw.util.Common; @@ -23,9 +22,6 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import java.time.Instant; -import java.time.LocalDate; -import java.time.ZoneId; /** *
@@ -93,34 +89,7 @@ public ResponseEntity findByScheduleId(@PathVariable("id") String id) {
 		return new ResponseEntity<>(scheduleService.findById(id), new HttpHeaders(), HttpStatus.OK);
 	}
 
-    /**
-     * [ScheduleController] 스케줄표 컬럼 변경 함수
-     *
-     * @param tranClounm 최종확인서에서 스케줄표에 필요한 컬럼만 담고 있는 객체입니다.
-     * @return
-     * 
-     * true  : 성공(200)을 반환합니다.
-     * false : 에러(400)를 반환합니다.
-     * 
- * - * Author : hhhaeri(yhoo0020@gmail.com) - */ - @PostMapping("/column") - @Operation(summary = "스케줄표 컬럼 변환", description = "최종확인서에 있는 컬럼을 스케줄표로 변환.") - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "스케줄표 컬럼 변환이 완료되었습니다.", content = @Content(schema = @Schema(implementation = ResponseEntity.class))), - @ApiResponse(responseCode = "400", description = "입력 값이 잘못되었습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) - }) - public ResponseEntity fianlToSchedule(@Valid @RequestBody(required = false) ScheduleEntity.transDto scheduleTransDto) { - - log.info("[ScheduleController] fianlToSchedule...!"); - - ScheduleEntity scheduleEntity = scheduleService.transColumn(scheduleTransDto); - - return new ResponseEntity<>(scheduleEntity, new HttpHeaders(), HttpStatus.OK); - } - - + /** * [ScheduleController] 스케줄표 생성 함수 * @@ -148,41 +117,4 @@ public ResponseEntity createFinalTemplate(@Valid @RequestBody(required = fals return new ResponseEntity<>(scheduleEntity, new HttpHeaders(), HttpStatus.OK); } - - - - // /** - // * [ScheduleController] 스케줄표 날짜 기준 조회 - // * - // * @param 날짜 기준으로 스케줄표를 조회합니다. - // * @return - // *
-	//  * true  : 성공(200)을 반환합니다.
-	//  * false : 에러(400)를 반환합니다.
-	//  * 
- // * - // * Author : hhhaeri(yhoo0020@gmail.com) - // */ - // @PostMapping("/date/{start}/{end}") - // @Operation(summary = "스케줄표 날짜 조회", description = "최종확인서에 있는 날짜 기준 조회") - // @ApiResponses(value = { - // @ApiResponse(responseCode = "200", description = "날짜 기준으로 조회를 완료되었습니다.", content = @Content(schema = @Schema(implementation = ResponseEntity.class))), - // @ApiResponse(responseCode = "400", description = "입력 값이 잘못되었습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) - // }) - // public ResponseEntity fianlToDateSchedule(@Valid @PathVariable("start") String start, @PathVariable("end") String end) { - - // log.info("[ScheduleController] fianlToDateSchedule...!"); - - // LocalDate localStartDate = LocalDate.parse(start); - // LocalDate localEndDate = LocalDate.parse(end); - - // // LocalDate를 Instant로 변환 (00:00:00 시간으로 설정) - // Instant startDate = localStartDate.atStartOfDay(ZoneId.systemDefault()).toInstant(); - // Instant endDate = localEndDate.atStartOfDay(ZoneId.systemDefault()).toInstant(); - - // ScheduleEntity scheduleEntity = scheduleService.scheduleByDate(startDate,endDate); - - // return new ResponseEntity<>(scheduleEntity, new HttpHeaders(), HttpStatus.OK); - // } - } diff --git a/nw/src/main/java/lab/cherry/nw/model/ScheduleEntity.java b/nw/src/main/java/lab/cherry/nw/model/ScheduleEntity.java index cbdcf47..4affc70 100644 --- a/nw/src/main/java/lab/cherry/nw/model/ScheduleEntity.java +++ b/nw/src/main/java/lab/cherry/nw/model/ScheduleEntity.java @@ -74,25 +74,4 @@ public static class ScheduleCreateDto { } - - ////////////////////////////////////////////////////////////////////////// - - @Getter - @Setter - @Builder - @NoArgsConstructor @AllArgsConstructor - public static class transDto { - - @Schema(title = "스케줄표 고유번호", example = "64ed89aa9e813b5ab16da6de") - private String finalTemplId; - - @Schema(title = "조직 고유번호", example = "64ed89aa9e813b5ab16da6de") - private String orgId; - - @JsonProperty("scheduleContent") - @Schema(title = "스케줄표 내용", example = "[]") - private List content; - - } - } \ No newline at end of file diff --git a/nw/src/main/java/lab/cherry/nw/service/Impl/ScheduleServiceImpl.java b/nw/src/main/java/lab/cherry/nw/service/Impl/ScheduleServiceImpl.java index 9872e49..9f9bfa9 100644 --- a/nw/src/main/java/lab/cherry/nw/service/Impl/ScheduleServiceImpl.java +++ b/nw/src/main/java/lab/cherry/nw/service/Impl/ScheduleServiceImpl.java @@ -82,46 +82,6 @@ public ScheduleEntity createSchedule(ScheduleEntity.ScheduleCreateDto scheduleCr return scheduleRepository.save(scheduleEntity); } - - - /** - * [scheduleServiceImpl] 스케줄표 생성 함수 - * - * @param scheduleTransDto 스케줄표 생성에 필요한 최종확인서 정보를 담은 개체입니다. - * @return 최종확인서에서 스케줄표에 필요한 컬럼을 저장한 정보를 리턴합니다. - *
-     * 스케줄표 컬럼을 등록합니다.
-     * 
- * - * Author : hhhaeri(yhoo0020@gmail.com) - */ - @Transactional(readOnly = true) - @Override - public ScheduleEntity transColumn(ScheduleEntity.transDto scheduleTransDto) { - - OrgEntity orgEntity = orgService.findById(scheduleTransDto.getOrgId()); - FinalTemplEntity finalTemplEntity = finalTemplService.findById(scheduleTransDto.getFinalTemplId()); - - Map content = finalTemplEntity.getContent(); - - // Null 값을 가진 값만 가져오기 - Map nullEntries = new HashMap<>(); - - for (Map.Entry entry : content.entrySet()) { - if (!entry.getValue().equals("")) { - nullEntries.put(entry.getKey(), entry.getValue()); - } - } - - ScheduleEntity scheduleEntity = ScheduleEntity.builder() - .column(nullEntries) - .org(orgEntity) - .build(); - - return scheduleRepository.save(scheduleEntity); - - } - /** * [scheduleServiceImpl] 스케줄표 삭제 함수 * diff --git a/nw/src/main/java/lab/cherry/nw/service/ScheduleService.java b/nw/src/main/java/lab/cherry/nw/service/ScheduleService.java index e90ab99..b2d544f 100644 --- a/nw/src/main/java/lab/cherry/nw/service/ScheduleService.java +++ b/nw/src/main/java/lab/cherry/nw/service/ScheduleService.java @@ -20,7 +20,6 @@ public interface ScheduleService { Page getSchedule(Pageable pageable); // ScheduleEntity scheduleByDate(Instant fromDate, Instant toDate); ScheduleEntity createSchedule(ScheduleEntity.ScheduleCreateDto scheduleCreateDto); - ScheduleEntity transColumn(ScheduleEntity.transDto scheduleTransDto); ScheduleEntity findById(String id); // ScheduleEntity findByName(String name); void deleteById(String id);