From ce0bada8467519fdca26a30bb5d8800c9681e349 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Mon, 4 Jul 2022 21:39:47 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20mpower=20=EC=A0=81=EC=9A=A9=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cmm/controller/CmmCodeMgtController.java | 2 +- .../biz/cmm/controller/CmmFileController.java | 2 +- .../biz/cmm/service/impl/CmmCodeService.java | 2 +- .../biz/cmm/service/impl/CmmFileService.java | 2 +- .../biz/cmm/service/impl/CmmUserService.java | 2 +- .../biz/ctgy/controller/BoardController.java | 2 +- .../controller/CtgyFileMgtController.java | 2 +- .../ctgy/controller/MinUserController.java | 2 +- .../ctgy/controller/OAuth2MinController.java | 2 +- .../ctgy/controller/ParkingController.java | 2 +- .../controller/PublicBoardController.java | 2 +- .../ResidentAndDisabledController.java | 2 +- .../repository/IParkingRepositoryImpl.java | 2 +- .../biz/ctgy/service/impl/BoardService.java | 2 +- .../ctgy/service/impl/CtgyFileService.java | 2 +- .../biz/ctgy/service/impl/MinUserService.java | 2 +- .../biz/ctgy/service/impl/ParkingService.java | 2 +- .../ctgy/service/impl/PublicBoardService.java | 2 +- .../impl/ResidentAndDisabledService.java | 2 +- .../v2/controller/CmmCodeMgtController.java | 120 ++++++------ .../biz/ctgy/v2/repository/ParkingDao.java | 32 +++- .../v2/repository/ResidentAndDisabledDao.java | 35 ++++ .../biz/ctgy/v2/service/ICmmCodeService.java | 20 +- .../biz/ctgy/v2/service/ICmmFileService.java | 12 ++ .../ctgy/v2/service/impl/CmmCodeService.java | 177 +++++++----------- .../ctgy/v2/service/impl/CmmFileService.java | 93 +++++++++ .../ctgy/v2/service/impl/ParkingService.java | 7 +- .../impl/ResidentAndDisabledService.java | 92 +-------- src/main/resources/sql/parking-mapper.xml | 40 +++- .../sql/residentAndDisabled-mapper.xml | 53 +++++- 30 files changed, 428 insertions(+), 291 deletions(-) create mode 100644 src/main/java/com/xit/biz/ctgy/v2/service/ICmmFileService.java create mode 100644 src/main/java/com/xit/biz/ctgy/v2/service/impl/CmmFileService.java diff --git a/src/main/java/com/xit/biz/cmm/controller/CmmCodeMgtController.java b/src/main/java/com/xit/biz/cmm/controller/CmmCodeMgtController.java index ab19b68..e41d27c 100644 --- a/src/main/java/com/xit/biz/cmm/controller/CmmCodeMgtController.java +++ b/src/main/java/com/xit/biz/cmm/controller/CmmCodeMgtController.java @@ -24,7 +24,7 @@ import javax.annotation.Nonnull; import java.util.List; @Tag(name = "CmmCodeMgtController", description = "코드 관리") -@RestController +//@RestController @RequiredArgsConstructor @RequestMapping("/api/v1/biz/cmm") public class CmmCodeMgtController { diff --git a/src/main/java/com/xit/biz/cmm/controller/CmmFileController.java b/src/main/java/com/xit/biz/cmm/controller/CmmFileController.java index f34555a..243250b 100644 --- a/src/main/java/com/xit/biz/cmm/controller/CmmFileController.java +++ b/src/main/java/com/xit/biz/cmm/controller/CmmFileController.java @@ -31,7 +31,7 @@ import java.nio.file.Paths; import java.util.Arrays; @Tag(name = "CmmFileController", description = "파일 관리") -@RestController +//@RestController @RequiredArgsConstructor @RequestMapping("/api/v1/ctgy/cmm") public class CmmFileController { diff --git a/src/main/java/com/xit/biz/cmm/service/impl/CmmCodeService.java b/src/main/java/com/xit/biz/cmm/service/impl/CmmCodeService.java index fa4632d..7ceaba0 100644 --- a/src/main/java/com/xit/biz/cmm/service/impl/CmmCodeService.java +++ b/src/main/java/com/xit/biz/cmm/service/impl/CmmCodeService.java @@ -28,7 +28,7 @@ import java.util.List; @Slf4j -@Service +//@Service @RequiredArgsConstructor public class CmmCodeService implements ICmmCodeService { diff --git a/src/main/java/com/xit/biz/cmm/service/impl/CmmFileService.java b/src/main/java/com/xit/biz/cmm/service/impl/CmmFileService.java index 417e672..9dfcfe1 100644 --- a/src/main/java/com/xit/biz/cmm/service/impl/CmmFileService.java +++ b/src/main/java/com/xit/biz/cmm/service/impl/CmmFileService.java @@ -16,7 +16,7 @@ import java.io.IOException; import java.util.Objects; @Slf4j -@Service +//@Service @RequiredArgsConstructor public class CmmFileService implements ICmmFileService { diff --git a/src/main/java/com/xit/biz/cmm/service/impl/CmmUserService.java b/src/main/java/com/xit/biz/cmm/service/impl/CmmUserService.java index ccec430..1acfb92 100644 --- a/src/main/java/com/xit/biz/cmm/service/impl/CmmUserService.java +++ b/src/main/java/com/xit/biz/cmm/service/impl/CmmUserService.java @@ -17,7 +17,7 @@ import java.util.Optional; import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains; -@Service +//@Service public class CmmUserService extends AbstractJpaService implements ICmmUserService { private final ICmmUserRepository cmmUserRepository; diff --git a/src/main/java/com/xit/biz/ctgy/controller/BoardController.java b/src/main/java/com/xit/biz/ctgy/controller/BoardController.java index 946620e..19cb8ef 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/BoardController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/BoardController.java @@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Nonnull; @Tag(name = "BoardController", description = "게시글 관리") -@RestController +//@RestController @RequestMapping("/api/v1/ctgy/board") @Validated @RequiredArgsConstructor diff --git a/src/main/java/com/xit/biz/ctgy/controller/CtgyFileMgtController.java b/src/main/java/com/xit/biz/ctgy/controller/CtgyFileMgtController.java index b7f50ae..38965b2 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/CtgyFileMgtController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/CtgyFileMgtController.java @@ -34,7 +34,7 @@ import java.nio.file.Paths; import java.util.Arrays; @Tag(name = "CtgyFileMgtController", description = "공지사항 / 게시판 관리") -@RestController +//@RestController @RequiredArgsConstructor @RequestMapping("/api/v1/ctgy/file") public class CtgyFileMgtController { diff --git a/src/main/java/com/xit/biz/ctgy/controller/MinUserController.java b/src/main/java/com/xit/biz/ctgy/controller/MinUserController.java index 730d41d..0bc2cb2 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/MinUserController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/MinUserController.java @@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @Tag(name = "MinUserController", description = "사용자 관리") -@RestController +//@RestController @RequestMapping("/api/v1/ctgy/user") @Validated @RequiredArgsConstructor diff --git a/src/main/java/com/xit/biz/ctgy/controller/OAuth2MinController.java b/src/main/java/com/xit/biz/ctgy/controller/OAuth2MinController.java index 54dd6cd..62f3b05 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/OAuth2MinController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/OAuth2MinController.java @@ -24,7 +24,7 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; @Tag(name = "OAuth2MinController", description = "인증 관리") -@RestController +//@RestController @RequestMapping("/api/v1/ctgy/account") @Validated @RequiredArgsConstructor diff --git a/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java b/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java index 5a69ebe..1282e35 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java @@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @Tag(name = "ParkingController", description = "주정차 의견진술 관리") -@RestController +//@RestController @RequiredArgsConstructor @Slf4j @RequestMapping("/api/v1/ctgy/parking") diff --git a/src/main/java/com/xit/biz/ctgy/controller/PublicBoardController.java b/src/main/java/com/xit/biz/ctgy/controller/PublicBoardController.java index 34e8204..698bc52 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/PublicBoardController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/PublicBoardController.java @@ -21,7 +21,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @Tag(name = "PublicBoardController", description = "공지사항 관리") -@RestController +//@RestController @RequestMapping("/api/v1/ctgy/pboard") @Validated @RequiredArgsConstructor diff --git a/src/main/java/com/xit/biz/ctgy/controller/ResidentAndDisabledController.java b/src/main/java/com/xit/biz/ctgy/controller/ResidentAndDisabledController.java index a3711ff..5c4b44a 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/ResidentAndDisabledController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/ResidentAndDisabledController.java @@ -36,7 +36,7 @@ import javax.validation.constraints.NotNull; * 장애인 : scDatagb = "2" */ @Tag(name = "ResidentAndDisabledController", description = "거주자/장애인 의견진술 관리") -@RestController +//@RestController @RequestMapping("/api/v1/ctgy") @Validated @RequiredArgsConstructor diff --git a/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryImpl.java b/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryImpl.java index b525076..809a55f 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryImpl.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryImpl.java @@ -194,7 +194,7 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom { minSimsaUser680.msuCode, minSimsaUser680.msuResult, minSimsaUser680.msuReason, - tf680Main.mmWdate.as("msWdate") + tf680Main.mmWdate.as("scWdate") //tf680Recall.scPos )) .from(minSimsa680) diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/BoardService.java b/src/main/java/com/xit/biz/ctgy/service/impl/BoardService.java index c833b52..55a44ee 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/BoardService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/BoardService.java @@ -26,7 +26,7 @@ import java.util.List; import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains; -@Service +//@Service @AllArgsConstructor public class BoardService implements IBoardService { diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/CtgyFileService.java b/src/main/java/com/xit/biz/ctgy/service/impl/CtgyFileService.java index d9efb8e..a08718b 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/CtgyFileService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/CtgyFileService.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.Objects; @Slf4j -@Service +//@Service @RequiredArgsConstructor public class CtgyFileService implements ICtgyFileService { diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/MinUserService.java b/src/main/java/com/xit/biz/ctgy/service/impl/MinUserService.java index 3cf67f5..f6fb0f9 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/MinUserService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/MinUserService.java @@ -18,7 +18,7 @@ import org.springframework.transaction.annotation.Transactional; import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains; @AllArgsConstructor -@Service +//@Service public class MinUserService implements IMinUserService { private final PasswordEncoder passwordEncoder; diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java b/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java index 5891ae9..c658c77 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -@Service +//@Service @RequiredArgsConstructor public class ParkingService implements IParkingService { diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/PublicBoardService.java b/src/main/java/com/xit/biz/ctgy/service/impl/PublicBoardService.java index 0e29f7b..28e1cb6 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/PublicBoardService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/PublicBoardService.java @@ -12,7 +12,7 @@ import org.springframework.transaction.annotation.Transactional; import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains; -@Service +//@Service @AllArgsConstructor public class PublicBoardService implements IPublicBoardService { diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/ResidentAndDisabledService.java b/src/main/java/com/xit/biz/ctgy/service/impl/ResidentAndDisabledService.java index 2df3951..f19bc12 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/ResidentAndDisabledService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/ResidentAndDisabledService.java @@ -43,7 +43,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -@Service +//@Service @RequiredArgsConstructor @Slf4j public class ResidentAndDisabledService implements IResidentAndDisabledService { diff --git a/src/main/java/com/xit/biz/ctgy/v2/controller/CmmCodeMgtController.java b/src/main/java/com/xit/biz/ctgy/v2/controller/CmmCodeMgtController.java index 5c8037b..8381b3f 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/controller/CmmCodeMgtController.java +++ b/src/main/java/com/xit/biz/ctgy/v2/controller/CmmCodeMgtController.java @@ -39,60 +39,63 @@ public class CmmCodeMgtController { //return RestResponse.of(cmmCodeService.findComboCodes(searchKeyDto)); } - @Operation(summary = "코드그룹 목록 조회") - @Parameters({ - @Parameter(in = ParameterIn.QUERY, name = "codeGrpId", description = "코드그룹ID", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "codeNm", description = "코드그룹명", required = false, example = " "), - @Parameter(name = "codeCd", hidden = true), - @Parameter(name = "codeMeta1", hidden = true), - @Parameter(name = "codeMeta2", hidden = true), - @Parameter(name = "codeMeta3", hidden = true), - @Parameter(name = "codeMeta4", hidden = true), - @Parameter(name = "codeMeta5", hidden = true), - @Parameter(name = "createdBy", hidden = true), - @Parameter(name = "modifiedBy", hidden = true), - @Parameter(name = "createdDate", hidden = true), - @Parameter(name = "modifiedDate", hidden = true), - @Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"), - @Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10") - //@Parameter(in = ParameterIn.QUERY, name = "sort", description = "정렬", required = true, example = "codeOrdr"), - }) - @GetMapping(value="/grp", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findCmmCodeGrps( - @Parameter(hidden = true) - final CmmCodeDto codeDto, - @Parameter(hidden = true) - @Nonnull final Pageable pageable) { - return RestResponse.of(cmmCodeService.findCmmCodeGrps(codeDto, pageable)); - } +// @Operation(summary = "코드그룹 목록 조회") +// @Parameters({ +// @Parameter(in = ParameterIn.QUERY, name = "codeGrpId", description = "코드그룹ID", required = false, example = " "), +// @Parameter(in = ParameterIn.QUERY, name = "codeNm", description = "코드그룹명", required = false, example = " "), +// @Parameter(name = "codeCd", hidden = true), +// @Parameter(name = "codeMeta1", hidden = true), +// @Parameter(name = "codeMeta2", hidden = true), +// @Parameter(name = "codeMeta3", hidden = true), +// @Parameter(name = "codeMeta4", hidden = true), +// @Parameter(name = "codeMeta5", hidden = true), +// @Parameter(name = "createdBy", hidden = true), +// @Parameter(name = "modifiedBy", hidden = true), +// @Parameter(name = "createdDate", hidden = true), +// @Parameter(name = "modifiedDate", hidden = true), +// @Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"), +// @Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10") +// //@Parameter(in = ParameterIn.QUERY, name = "sort", description = "정렬", required = true, example = "codeOrdr"), +// }) +// @GetMapping(value="/grp", produces = MediaType.APPLICATION_JSON_VALUE) +// public ResponseEntity findCmmCodeGrps( +// @Parameter(hidden = true) +// final CmmCodeDto codeDto, +// @Parameter(hidden = true) +// @Nonnull final Pageable pageable) { +// return RestResponse.of(cmmCodeService.findCmmCodeGrps(codeDto, pageable)); +// } +// +// @Operation(summary = "코드 목록 조회") +// @Parameters({ +// @Parameter(in = ParameterIn.QUERY, name = "codeGrpId", description = "코드그룹ID", required = true, example = "TRAFFIC"), +// @Parameter(in = ParameterIn.QUERY, name = "codeLcd", description = "대분류코드", required = false, example = "GANGNAM_SIMSA"), +// @Parameter(in = ParameterIn.QUERY, name = "codeMcd", description = "중분류코드", required = false, example = " "), +// @Parameter(in = ParameterIn.QUERY, name = "codeCd", description = "코드", required = false, example = " "), +// @Parameter(in = ParameterIn.QUERY, name = "codeNm", description = "코드명", required = false, example = " "), +// @Parameter(in = ParameterIn.QUERY, name = "codeMeta1", description = "코드메타1", required = false, example = " "), +// @Parameter(in = ParameterIn.QUERY, name = "codeMeta2", description = "코드메타2", required = false, example = " "), +// @Parameter(in = ParameterIn.QUERY, name = "codeMeta3", description = "코드메타3", required = false, example = " "), +// @Parameter(in = ParameterIn.QUERY, name = "codeMeta4", description = "코드메타4", required = false, example = " "), +// @Parameter(in = ParameterIn.QUERY, name = "codeMeta5", description = "코드메타5", required = false, example = " "), +// @Parameter(in = ParameterIn.QUERY, name = "createdBy", hidden = true), +// @Parameter(in = ParameterIn.QUERY, name = "modifiedBy", hidden = true), +// @Parameter(in = ParameterIn.QUERY, name = "createdDate", hidden = true), +// @Parameter(in = ParameterIn.QUERY, name = "modifiedDate", hidden = true) +// }) +// @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) +// public ResponseEntity findCmmCodes(@Parameter(hidden = true) @Nonnull final CmmCodeDto codeDto) { +// return RestResponse.of(cmmCodeService.findCmmCodes(codeDto)); +// } +// +// @Operation(summary = "코드그룹저장" , description = "코드그룹저장") +// @PostMapping(value="/grp", produces = MediaType.APPLICATION_JSON_VALUE) +// public ResponseEntity saveCmmCodeGrp(@RequestBody @Nonnull CmmCodeGrp cmmCodeGrp) { +// return RestResponse.of(cmmCodeService.saveCmmCodeGrp(cmmCodeGrp)); +// } + - @Operation(summary = "코드 목록 조회") - @Parameters({ - @Parameter(in = ParameterIn.QUERY, name = "codeGrpId", description = "코드그룹ID", required = true, example = "TRAFFIC"), - @Parameter(in = ParameterIn.QUERY, name = "codeLcd", description = "대분류코드", required = false, example = "GANGNAM_SIMSA"), - @Parameter(in = ParameterIn.QUERY, name = "codeMcd", description = "중분류코드", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "codeCd", description = "코드", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "codeNm", description = "코드명", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "codeMeta1", description = "코드메타1", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "codeMeta2", description = "코드메타2", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "codeMeta3", description = "코드메타3", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "codeMeta4", description = "코드메타4", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "codeMeta5", description = "코드메타5", required = false, example = " "), - @Parameter(in = ParameterIn.QUERY, name = "createdBy", hidden = true), - @Parameter(in = ParameterIn.QUERY, name = "modifiedBy", hidden = true), - @Parameter(in = ParameterIn.QUERY, name = "createdDate", hidden = true), - @Parameter(in = ParameterIn.QUERY, name = "modifiedDate", hidden = true) - }) - @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findCmmCodes(@Parameter(hidden = true) @Nonnull final CmmCodeDto codeDto) { - return RestResponse.of(cmmCodeService.findCmmCodes(codeDto)); - } - @Operation(summary = "코드그룹저장" , description = "코드그룹저장") - @PostMapping(value="/grp", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity saveCmmCodeGrp(@RequestBody @Nonnull CmmCodeGrp cmmCodeGrp) { - return RestResponse.of(cmmCodeService.saveCmmCodeGrp(cmmCodeGrp)); - } // @Operation(summary = "대분류코드저장" , description = "대분류코드저장") // @PostMapping("/lcode") @@ -112,9 +115,12 @@ public class CmmCodeMgtController { // return RestResult.of(cmmCodeService.saveCmmCodeS(cmmCodeS)); // } - @Operation(summary = "코드 저장") - @PostMapping - public ResponseEntity saveCmmCode(@RequestBody @Nonnull CmmCodeDto cmmCodeDto) { - return RestResponse.of(cmmCodeService.saveCmmCode(cmmCodeDto)); - } + + + +// @Operation(summary = "코드 저장") +// @PostMapping +// public ResponseEntity saveCmmCode(@RequestBody @Nonnull CmmCodeDto cmmCodeDto) { +// return RestResponse.of(cmmCodeService.saveCmmCode(cmmCodeDto)); +// } } diff --git a/src/main/java/com/xit/biz/ctgy/v2/repository/ParkingDao.java b/src/main/java/com/xit/biz/ctgy/v2/repository/ParkingDao.java index 97b59e6..5b4e38f 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/repository/ParkingDao.java +++ b/src/main/java/com/xit/biz/ctgy/v2/repository/ParkingDao.java @@ -1,12 +1,10 @@ package com.xit.biz.ctgy.v2.repository; -import com.xit.biz.ctgy.dto.BoardDto; -import com.xit.biz.ctgy.dto.JudgeListDto; -import com.xit.biz.ctgy.dto.JudgeTargetDto; -import com.xit.biz.ctgy.dto.ParkingTargetDto; +import com.xit.biz.ctgy.dto.*; import com.xit.biz.ctgy.entity.MinSimsaUser680; import com.xit.biz.ctgy.entity.MinSimsaUser680Sc; import com.xit.core.config.database.BaseMpowerDaoSupport; +import com.xit.core.oauth2.utils.HeaderUtil; import com.xit.core.support.sql.parser.QueryGenerator; import com.xit.core.util.ConvertUtils; import org.springframework.data.domain.Page; @@ -189,4 +187,30 @@ public class ParkingDao extends BaseMpowerDaoSupport { .getQueryString(); delete(sql); } + + public List findDashboardJudgeList() { + final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectDashboardJudgeList") + .getQueryString(); + final String fieldStrs = "msEdate, msuTeam, name, jcnt, tcnt"; + return selectList(DashboardJudgeListDto.class, sql, fieldStrs); + } + + public List findByUserJudges() { + final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectByUserJudgeList") + .setParameter("msuUserid", HeaderUtil.getUserId()) + .getQueryString(); + final String fieldStrs = "msMaincode, msSeq, msCarnum, msResult, msYear, msChasu, msSdate, msStartsi, msEdate, msCdate, " + + "msClosesi, msDatgb, msuCode, msuResult, msuReason, scWdate, scPos"; + return selectList(JudgeListDto.class, sql, fieldStrs); + } + + public void updateMsuResonAndMsuResultByMsuCode(@NotNull final Long msuCode, @NotNull final String msuResult, @NotNull final String msuReason, @NotNull final LocalDate msuIndate) { + final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMsuResonAndMsuResultByMsuCode") + .setParameter("msuCode", msuCode) + .setParameter("msuResult", msuResult) + .setParameter("msuReason", msuReason) + .setParameter("msuIndate", msuIndate) + .getQueryString(); + update(sql); + } } diff --git a/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java b/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java index 2950c91..80cca2b 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java +++ b/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java @@ -1,10 +1,14 @@ package com.xit.biz.ctgy.v2.repository; +import com.querydsl.core.BooleanBuilder; +import com.querydsl.core.types.Projections; +import com.xit.biz.ctgy.dto.DashboardJudgeListDto; import com.xit.biz.ctgy.dto.GnRecallScDto; import com.xit.biz.ctgy.dto.JudgeListDto; import com.xit.biz.ctgy.dto.JudgeTargetDto; import com.xit.biz.ctgy.entity.MinSimsaUser680Sc; import com.xit.core.config.database.BaseMpowerDaoSupport; +import com.xit.core.oauth2.utils.HeaderUtil; import com.xit.core.support.sql.parser.QueryGenerator; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -15,6 +19,10 @@ import java.time.LocalDate; import java.util.List; import java.util.Map; +import static com.xit.biz.ctgy.entity.QGnRecallSc.gnRecallSc; +import static com.xit.biz.ctgy.entity.QMinSimsa680Sc.minSimsa680Sc; +import static com.xit.biz.ctgy.entity.QMinSimsaUser680Sc.minSimsaUser680Sc; + @Repository public class ResidentAndDisabledDao extends BaseMpowerDaoSupport { private static final String NAME_SPACE = "residentAndDisabled"; @@ -275,4 +283,31 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport { .getQueryString(); } + + public List findDashboardJudgeList(@NotNull final String msDatagb) { + final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectDashboardJudgeList") + .getQueryString(); + final String fieldStrs = "msEdate, msuTeam, name, jcnt, tcnt"; + return selectList(DashboardJudgeListDto.class, sql, fieldStrs); + } + + public List findByUserJudges(@NotNull final JudgeListDto dto) { + final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectByUserJudgeList") + .setParameter("msDatagb", dto.getMsDatagb()) + .setParameter("msuUserid", HeaderUtil.getUserId()) + .getQueryString(); + final String fieldStrs = "msMaincode, msSeq, msCarnum, msResult, msYear, msChasu, msSdate, msStartsi, msEdate, msCdate, " + + "msClosesi, msDatgb, msuCode, msuResult, msuReason, scWdate, scPos"; + return selectList(JudgeListDto.class, sql, fieldStrs); + } + + public void updateMsuResonAndMsuResultByMsuCode(@NotNull final Long msuCode, @NotNull final String msuResult, @NotNull final String msuReason, @NotNull final LocalDate msuIndate) { + final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMsuResonAndMsuResultByMsuCode") + .setParameter("msuCode", msuCode) + .setParameter("msuResult", msuResult) + .setParameter("msuReason", msuReason) + .setParameter("msuIndate", msuIndate) + .getQueryString(); + update(sql); + } } diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/ICmmCodeService.java b/src/main/java/com/xit/biz/ctgy/v2/service/ICmmCodeService.java index a731c3a..761b60b 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/service/ICmmCodeService.java +++ b/src/main/java/com/xit/biz/ctgy/v2/service/ICmmCodeService.java @@ -16,14 +16,14 @@ import java.util.List; public interface ICmmCodeService { List findComboCodes(CmmCodeSIds searchKeyDto); - CmmCodeGrp saveCmmCodeGrp(CmmCodeGrp cmmCodeGrp); -// CmmCodeL saveCmmCodeL(CmmCodeL cmmCodeL); -// CmmCodeM saveCmmCodeM(CmmCodeM cmmCodeM); -// CmmCodeS saveCmmCodeS(CmmCodeS cmmCodeS); - - Page findCmmCodeGrps(CmmCodeDto cmmCodeDto, Pageable pageable); - - List findCmmCodes(CmmCodeDto cmmCodeDto); - - Object saveCmmCode(CmmCodeDto cmmCodeDto); +// CmmCodeGrp saveCmmCodeGrp(CmmCodeGrp cmmCodeGrp); +//// CmmCodeL saveCmmCodeL(CmmCodeL cmmCodeL); +//// CmmCodeM saveCmmCodeM(CmmCodeM cmmCodeM); +//// CmmCodeS saveCmmCodeS(CmmCodeS cmmCodeS); +// +// Page findCmmCodeGrps(CmmCodeDto cmmCodeDto, Pageable pageable); +// +// List findCmmCodes(CmmCodeDto cmmCodeDto); +// +// Object saveCmmCode(CmmCodeDto cmmCodeDto); } diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/ICmmFileService.java b/src/main/java/com/xit/biz/ctgy/v2/service/ICmmFileService.java new file mode 100644 index 0000000..fe2bedb --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/v2/service/ICmmFileService.java @@ -0,0 +1,12 @@ +package com.xit.biz.ctgy.v2.service; + +import org.springframework.web.multipart.MultipartFile; + +/** + * @author Lim, Jong Uk (minuk926) + * @since 2021-07-16 + */ +public interface ICmmFileService { + String uploadFiles(MultipartFile[] files, String rootPath, String uploadPath); + +} diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/impl/CmmCodeService.java b/src/main/java/com/xit/biz/ctgy/v2/service/impl/CmmCodeService.java index d620f02..bce85c2 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/service/impl/CmmCodeService.java +++ b/src/main/java/com/xit/biz/ctgy/v2/service/impl/CmmCodeService.java @@ -32,16 +32,16 @@ import java.util.List; @RequiredArgsConstructor public class CmmCodeService implements ICmmCodeService { - private final ICmmCodeGrpRepository cmmCodeGrpRepository; - private final ICmmCodeLRepostory cmmCodeLRepository; - private final ICmmCodeMRepository cmmCodeMRepository; - private final ICmmCodeSRepository cmmCodeSRepository; +// private final ICmmCodeGrpRepository cmmCodeGrpRepository; +// private final ICmmCodeLRepostory cmmCodeLRepository; +// private final ICmmCodeMRepository cmmCodeMRepository; +// private final ICmmCodeSRepository cmmCodeSRepository; private final CmmCodeDao cmmCodeDao; - private CmmCodeGrpMapstruct codeGrpstruct = Mappers.getMapper(CmmCodeGrpMapstruct.class); - private CmmCodeLMapstruct codeLstruct = Mappers.getMapper(CmmCodeLMapstruct.class); - private CmmCodeMMapstruct codeMstruct = Mappers.getMapper(CmmCodeMMapstruct.class); - private CmmCodeSMapstruct codeSstruct = Mappers.getMapper(CmmCodeSMapstruct.class); +// private CmmCodeGrpMapstruct codeGrpstruct = Mappers.getMapper(CmmCodeGrpMapstruct.class); +// private CmmCodeLMapstruct codeLstruct = Mappers.getMapper(CmmCodeLMapstruct.class); +// private CmmCodeMMapstruct codeMstruct = Mappers.getMapper(CmmCodeMMapstruct.class); +// private CmmCodeSMapstruct codeSstruct = Mappers.getMapper(CmmCodeSMapstruct.class); @Override public List findComboCodes(CmmCodeSIds searchKeyDto) { @@ -50,121 +50,82 @@ public class CmmCodeService implements ICmmCodeService { // 소분류 코드 조회 if(StringUtils.hasText(searchKeyDto.getCodeMcd())){ AssertUtils.isTrue(!Checks.isEmpty(searchKeyDto.getCodeLcd()), "대분류 코드가 선택되지 않았습니다."); - List list = cmmCodeDao.queryComboCodeClass(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd(), searchKeyDto.getCodeMcd()); + //List list = cmmCodeDao.queryComboCodeClass(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd(), searchKeyDto.getCodeMcd()); //List list = cmmComboCodeRepository.queryComboCode(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd(), searchKeyDto.getCodeMcd()); - return list; + //return list; //return cmmCodeSRepository.queryComboCode(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd(), searchKeyDto.getCodeMcd()); } + return cmmCodeDao.queryComboCodeClass(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd(), searchKeyDto.getCodeMcd()); - // 중분류 코드 조회 - if(StringUtils.hasText(searchKeyDto.getCodeLcd())){ - return cmmCodeMRepository.queryComboCode(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd()); - } - - // 대분류 코드 조회 - return cmmCodeLRepository.queryComboCode(searchKeyDto.getCodeGrpId()); - } - - @Override - public Page findCmmCodeGrps(CmmCodeDto cmmCodeDto, Pageable pageable) { - Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr"); - pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), sort); - Example example = Example.of(codeGrpstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny()); - return cmmCodeGrpRepository.findAll(example, pageable); - } - - @Override - public List findCmmCodes(CmmCodeDto cmmCodeDto) { - Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr"); - AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeGrpId()), "조회할 코드그룹을 선택해 주세요."); - - // 소분류 코드 조회 - if(StringUtils.hasText(cmmCodeDto.getCodeMcd())){ - AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeLcd()), "대분류 코드가 선택되지 않았습니다."); - Example example = Example.of(codeSstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny()); - return cmmCodeSRepository.findAll(example, sort); - } - - // 중분류 코드 조회 - if(StringUtils.hasText(cmmCodeDto.getCodeLcd())){ - Example example = Example.of(codeMstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny()); - return cmmCodeMRepository.findAll(example, sort); - } - - // 대분류 코드 조회 - Example example = Example.of(codeLstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny()); - return cmmCodeLRepository.findAll(example, sort); - } - - @Override - @Transactional - public CmmCodeGrp saveCmmCodeGrp(CmmCodeGrp cmmCodeGrp) { - AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeGrpId()), "코드 그룹을 입력해 주세요."); - AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeNm()), "코드 그룹명 입력해 주세요."); - AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeOrdr()), "정렬 순서를 입력해 주세요."); - return cmmCodeGrpRepository.save(cmmCodeGrp); +// // 중분류 코드 조회 +// if(StringUtils.hasText(searchKeyDto.getCodeLcd())){ +// return cmmCodeMRepository.queryComboCode(searchKeyDto.getCodeGrpId(), searchKeyDto.getCodeLcd()); +// } +// +// // 대분류 코드 조회 +// return cmmCodeLRepository.queryComboCode(searchKeyDto.getCodeGrpId()); } // @Override -// @Transactional -// public CmmCodeL saveCmmCodeL(CmmCodeL cmmCodeL) { -// AssertUtils.state(!Checks.isEmpty(cmmCodeL.getCodeGrpId()), "코드 그룹을 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeL.getCodeCd()), "대분류 코드를 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeL.getCodeNm()), "대분류 코드명 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeL.getCodeOrdr()), "정렬 순서를 입력해 주세요."); -// return cmmCodeLRepository.save(cmmCodeL); +// public Page findCmmCodeGrps(CmmCodeDto cmmCodeDto, Pageable pageable) { +// Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr"); +// pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), sort); +// Example example = Example.of(codeGrpstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny()); +// return cmmCodeGrpRepository.findAll(example, pageable); // } // // @Override -// @Transactional -// public CmmCodeM saveCmmCodeM(CmmCodeM cmmCodeM) { -// AssertUtils.state(!Checks.isEmpty(cmmCodeM.getCodeGrpId()), "코드 그룹을 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeM.getCodeLcd()), "대분류 코드를 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeM.getCodeCd()), "중분류 코드를 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeM.getCodeNm()), "중분류 코드명 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeM.getCodeOrdr()), "정렬 순서를 입력해 주세요."); -// return cmmCodeMRepository.save(cmmCodeM); +// public List findCmmCodes(CmmCodeDto cmmCodeDto) { +// Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr"); +// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeGrpId()), "조회할 코드그룹을 선택해 주세요."); +// +// // 소분류 코드 조회 +// if(StringUtils.hasText(cmmCodeDto.getCodeMcd())){ +// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeLcd()), "대분류 코드가 선택되지 않았습니다."); +// Example example = Example.of(codeSstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny()); +// return cmmCodeSRepository.findAll(example, sort); +// } +// +// // 중분류 코드 조회 +// if(StringUtils.hasText(cmmCodeDto.getCodeLcd())){ +// Example example = Example.of(codeMstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny()); +// return cmmCodeMRepository.findAll(example, sort); +// } +// +// // 대분류 코드 조회 +// Example example = Example.of(codeLstruct.toEntity(cmmCodeDto), ExampleMatcher.matchingAny()); +// return cmmCodeLRepository.findAll(example, sort); // } // // @Override // @Transactional -// public CmmCodeS saveCmmCodeS(CmmCodeS cmmCodeS) { -// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeGrpId()), "코드그룹을 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeLcd()), "대분류 코드를 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeMcd()), "중분류 코드를 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeCd()), "소분류 코드를 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeNm()), "소분류 코드명 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeOrdr()), "정렬 순서를 입력해 주세요."); -// return cmmCodeSRepository.save(cmmCodeS); +// public CmmCodeGrp saveCmmCodeGrp(CmmCodeGrp cmmCodeGrp) { +// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeGrpId()), "코드 그룹을 입력해 주세요."); +// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeNm()), "코드 그룹명 입력해 주세요."); +// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeGrp.getCodeOrdr()), "정렬 순서를 입력해 주세요."); +// return cmmCodeGrpRepository.save(cmmCodeGrp); // } - -// private void validate(Class clz){ -// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeGrpId()), "코드그룹을 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeCd()), "대분류코드를 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeNm()), "대분류코드명 입력해 주세요."); -// AssertUtils.state(!Checks.isEmpty(cmmCodeS.getCodeOrdr()), "정렬순서를 입력해 주세요."); +// +// @Transactional +// @Override +// public Object saveCmmCode(CmmCodeDto cmmCodeDto) { +// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeGrpId()), "코드그룹을 입력해 주세요."); +// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeCd()), "코드를 입력해 주세요."); +// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeNm()), "코드명을 입력해 주세요."); +// +// // 소분류 코드 +// if(StringUtils.hasText(cmmCodeDto.getCodeMcd())){ +// AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeLcd()), "대분류 코드를 입력해 주세요."); +// return cmmCodeSRepository.save(codeSstruct.toEntity(cmmCodeDto)); +// } +// +// // 중분류 코드 +// if(StringUtils.hasText(cmmCodeDto.getCodeLcd())){ +// return cmmCodeMRepository.save(codeMstruct.toEntity(cmmCodeDto)); +// } +// +// // 대분류 코드 +// return cmmCodeLRepository.save(codeLstruct.toEntity(cmmCodeDto)); // } - @Transactional - @Override - public Object saveCmmCode(CmmCodeDto cmmCodeDto) { - AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeGrpId()), "코드그룹을 입력해 주세요."); - AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeCd()), "코드를 입력해 주세요."); - AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeNm()), "코드명을 입력해 주세요."); - - // 소분류 코드 - if(StringUtils.hasText(cmmCodeDto.getCodeMcd())){ - AssertUtils.isTrue(!Checks.isEmpty(cmmCodeDto.getCodeLcd()), "대분류 코드를 입력해 주세요."); - return cmmCodeSRepository.save(codeSstruct.toEntity(cmmCodeDto)); - } - - // 중분류 코드 - if(StringUtils.hasText(cmmCodeDto.getCodeLcd())){ - return cmmCodeMRepository.save(codeMstruct.toEntity(cmmCodeDto)); - } - - // 대분류 코드 - return cmmCodeLRepository.save(codeLstruct.toEntity(cmmCodeDto)); - } - } diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/impl/CmmFileService.java b/src/main/java/com/xit/biz/ctgy/v2/service/impl/CmmFileService.java new file mode 100644 index 0000000..adda10a --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/v2/service/impl/CmmFileService.java @@ -0,0 +1,93 @@ +package com.xit.biz.ctgy.v2.service.impl; + +import com.xit.biz.ctgy.v2.service.ICmmFileService; +import com.xit.core.util.AssertUtils; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.util.Objects; + +@Slf4j +@Service +@RequiredArgsConstructor +public class CmmFileService implements ICmmFileService { + + @Value("${file.cmm.upload.url}") + private String serviceUrl; + + @Value("${file.cmm.upload.allow.ext:}") + private String allowExt; + + @Value("${file.cmm.upload.max.size:1024}") + private long maxSize; + + /** + * 파일 업로드 + * 업로드된 최종 경로 return(ex : 20220406) + * -> rootPath + uploadPath + 해당경로 + fileName + * @param files MultipartFile[] + * @return String makePath + */ + @Override + @Transactional + public String uploadFiles(MultipartFile[] files, String rootPath, String uploadPath) { + String makePath = ""; + + if(files != null && files.length > 0){ + //makePath = File.separator + DateUtil.getToday(""); + + // 파일 경로 : upload root 제외 + String urlPath = uploadPath + makePath; + // 물리적인 파일 저장 위치 + String fileUploadPath = rootPath + urlPath; + File file = new File(fileUploadPath); + if(!file.exists()) file.mkdirs(); + + for(MultipartFile mf : files) { + if (!mf.isEmpty()) { + String orgFileName = ""; + try { + orgFileName = StringUtils.cleanPath(Objects.requireNonNull(mf.getOriginalFilename())); + mf.transferTo(new File(fileUploadPath + File.separator + orgFileName)); + + // inputStream을 가져와 + // copyOfLocation (저장위치)로 파일을 쓴다. + // copy의 옵션은 기존에 존재하면 REPLACE(대체한다), 오버라이딩 한다 + //Files.copy(multipartFile.getInputStream(), copyOfLocation, StandardCopyOption.REPLACE_EXISTING); + + } catch (IOException e) { + String errMsg = String.format("File Upload Error :: %s[ %s ]", e.getLocalizedMessage(), orgFileName); + //TODO : 에러처리 + //return RestError.of(String.format("File Upload Error :: %s", orgFileName)); + AssertUtils.isTrue(false, errMsg); + } + } + } + } + return makePath; + } +} + + + +/* + // File.seperator 는 OS종속적이다. + // Spring에서 제공하는 cleanPath()를 통해서 ../ 내부 점들에 대해서 사용을 억제한다 + Path copyOfLocation = Paths.get(uploadDir + File.separator + StringUtils.cleanPath(multipartFile.getOriginalFilename())); + try { + // inputStream을 가져와서 + // copyOfLocation (저장위치)로 파일을 쓴다. + // copy의 옵션은 기존에 존재하면 REPLACE(대체한다), 오버라이딩 한다 + Files.copy(multipartFile.getInputStream(), copyOfLocation, StandardCopyOption.REPLACE_EXISTING); + } catch (IOException e) { + e.printStackTrace(); + throw new FileStorageException("Could not store file : " + multipartFile.getOriginalFilename()); + } +*/ diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/impl/ParkingService.java b/src/main/java/com/xit/biz/ctgy/v2/service/impl/ParkingService.java index 6799252..51491cb 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/service/impl/ParkingService.java +++ b/src/main/java/com/xit/biz/ctgy/v2/service/impl/ParkingService.java @@ -36,11 +36,8 @@ import java.util.stream.Collectors; @Service @RequiredArgsConstructor public class ParkingService implements IParkingService { - - private final IParkingRepository repository; private final ParkingDao parkingDao; private final UserDao userDao; - private final IParkingJudgeUserRepository parkingJudgeUserRepository; @Override @Transactional(readOnly = true) @@ -182,13 +179,13 @@ public class ParkingService implements IParkingService { @Override @Transactional(readOnly = true) public List findByUserJudges() { - return repository.findByUserJudges(); + return parkingDao.findByUserJudges(); } @Override @Transactional public void saveJudgeResult(JudgeListDto dto){ - parkingJudgeUserRepository.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(), + parkingDao.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(), dto.getMsuResult(), dto.getMsuReason(), LocalDate.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))); diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java b/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java index df728be..eb61466 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java +++ b/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java @@ -1,18 +1,12 @@ package com.xit.biz.ctgy.v2.service.impl; -import com.xit.biz.cmm.service.ICmmFileService; +import com.xit.biz.ctgy.v2.service.ICmmFileService; import com.xit.biz.ctgy.CtgyConstants; import com.xit.biz.ctgy.dto.*; -import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct; import com.xit.biz.ctgy.entity.GnRecallSc; -import com.xit.biz.ctgy.entity.MinInfoBoard680; import com.xit.biz.ctgy.entity.MinSimsaUser680Sc; -import com.xit.biz.ctgy.entity.MinUserinfo; -import com.xit.biz.ctgy.mapper.IParkingMapper; -import com.xit.biz.ctgy.mapper.IResidentAndDisabledMapper; -import com.xit.biz.ctgy.repository.*; -import com.xit.biz.ctgy.service.IPublicBoardService; import com.xit.biz.ctgy.v2.repository.ParkingDao; +import com.xit.biz.ctgy.v2.repository.PublicBoardDao; import com.xit.biz.ctgy.v2.repository.ResidentAndDisabledDao; import com.xit.biz.ctgy.v2.repository.UserDao; import com.xit.biz.ctgy.v2.service.IResidentAndDisabledService; @@ -23,18 +17,15 @@ import com.xit.core.util.Checks; import com.xit.core.util.DateUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.mapstruct.factory.Mappers; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StringUtils; import org.springframework.web.multipart.MultipartFile; -import javax.persistence.EntityManager; import javax.validation.constraints.NotNull; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -50,26 +41,17 @@ import java.util.stream.Collectors; @RequiredArgsConstructor @Slf4j public class ResidentAndDisabledService implements IResidentAndDisabledService { - @Value("${file.cmm.upload.root:c:/data/file/upload}") private String rootPath; @Value("${file.cmm.upload.simsaPath:[simUpFile_sc1]}") private String[] uploadPath; - private final GnRecallScMapstruct mapstruct = Mappers.getMapper(GnRecallScMapstruct.class); - private final IResidentAndDisabledRepository gnReacallRepository; private final ResidentAndDisabledDao residentAndDisabledDao; private final UserDao userDao; - private final IJudgeUserRepository judgeUserRepository; - - private final IResidentAndDisabledMapper residentAndDisabledMapper; - private final ParkingDao parkingDao; - private final ICmmFileService fileService; - private final IPublicBoardService pBoardService; - private final IParkingMapper parkingMapper; + private final PublicBoardDao publicBoardDao; //--------------------------------------------------------------------------------- @@ -78,11 +60,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { @Override @Transactional(readOnly = true) public Page findJudgeDatas(@NotNull final String scDatagb, Pageable pageable) { - // Sort sort = Sort.by(Sort.Direction.DESC, "inCode"); pageable = JpaUtil.getPagingInfo(pageable); -// return gnReacallRepository.findJudgeDatas( -// scDatagb, -// PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("scCode").descending())); return residentAndDisabledDao.findJudgeDatas(scDatagb, pageable); } @@ -247,57 +225,6 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { return resultMap; } -// @Override -// @Transactional(readOnly = true) -// public Map findJudgeResults2(JudgeListDto dto) { -// Map resultMap = new HashMap<>(); -// -// // team && 팀별 부과현황 조회 : 팀이 선택되지 않은 경우 모두 -//// Map teamMap = residentAndDisabledMapper.selectTotJudgeResultGroupByTeamAndChasu(dto); -//// if (Checks.isEmpty(teamMap)) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND); -//// List> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto); -//// totJudgeUserList.add(teamMap); -// -// List> teamList = residentAndDisabledMapper.selectJudgeTeamGroupByChasuAndTeamList(dto); -// if (Checks.isEmpty(teamList) || teamList.size() == 0) throw new CustomBaseException(ErrorCode.DATA_NOT_FOUND); -// -// // 차수별 심사자별 심사결과 합산 -// dto.setMsuTeam(String.valueOf(teamList.get(0).get("msuTeam"))); -// List> totJudgeUserList = residentAndDisabledMapper.selectTotJudgeResultGroupByUser(dto); -// totJudgeUserList.add(teamList.get(0)); -// -// // 심사대상 차량 목록 -// List> judgeCarList = residentAndDisabledMapper.selectJudgeResultGroupByCarnum(dto); -// -// // 차량별 심사자 심사결과 목록 -// Map paramMap = new HashMap<>(); -// paramMap.put("msDatagb", dto.getMsDatagb()); -// paramMap.put("msChasu", dto.getMsChasu()); -// paramMap.put("msSdate", dto.getMsSdate()); -// paramMap.put("msEdate", dto.getMsEdate()); -// paramMap.put("msuTeam", dto.getMsuTeam()); -// -// paramMap.put("seqList", judgeCarList.stream().map(m -> m.get("msSeq")).collect(Collectors.toList())); -// paramMap.put("carnumList", judgeCarList.stream().map(m -> m.get("msCarnum")).collect(Collectors.toList())); -// List> jurgeUserList = residentAndDisabledMapper.selectJudgeResultList(paramMap); -// -//// List> resultList = judgeCarList.stream().peek((m) -> { -//// paramMap.put("msSeq", m.get("msSeq")); -//// paramMap.put("msCarnum", m.get("msCarnum")); -//// m.put("simsa", residentAndDisabledMapper.selectJudgeResultList(paramMap)); -//// }).collect(Collectors.toList()); -// -// -// resultMap.put("teamList", teamList); -// // 차수별 심사자별 심사결과 합산 -// resultMap.put("totJudgeUserData", totJudgeUserList); -// // 심사대상 차량 목록 -// resultMap.put("judgeCarData", judgeCarList); -// // 차량별 심사자 심사결과 목록 -// resultMap.put("judgeUserData", jurgeUserList); -// return resultMap; -// } - /** * 심사자료 삭제 * 1. 삭제 대상 조회 : min_simsa680_sc 테이블 : ms_datagb, ms_chasu, ms_sdate, ms_edate 조건으로 ms_maincode 삭제 대상 조회 @@ -353,10 +280,11 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { @Transactional(readOnly = true) public Map findDashboard(){ Map resultMap = new HashMap<>(); - resultMap.put("pBoardList", pBoardService.findAll(MinInfoBoard680.builder().build(), PageRequest.of(0, 7))); - resultMap.put("parkJudgeList", parkingMapper.selectDashboardJudgeList()); - resultMap.put("residentJudgeList", residentAndDisabledMapper.selectDashboardJudgeList(CtgyConstants.Judge.DATAGB_RESIDENT.getCode())); - resultMap.put("disabledJudgeList", residentAndDisabledMapper.selectDashboardJudgeList(CtgyConstants.Judge.DATAGB_DISABLED.getCode())); + + resultMap.put("pBoardList", publicBoardDao.findAll(new MinInfoBoard680Dto(), PageRequest.of(0, 7))); + resultMap.put("parkJudgeList", parkingDao.findDashboardJudgeList()); + resultMap.put("residentJudgeList", residentAndDisabledDao.findDashboardJudgeList(CtgyConstants.Judge.DATAGB_RESIDENT.getCode())); + resultMap.put("disabledJudgeList", residentAndDisabledDao.findDashboardJudgeList(CtgyConstants.Judge.DATAGB_DISABLED.getCode())); return resultMap; } @@ -388,13 +316,13 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { @Override @Transactional(readOnly = true) public List findByUserJudges(JudgeListDto dto) { - return gnReacallRepository.findByUserJudges(dto); + return residentAndDisabledDao.findByUserJudges(dto); } @Override @Transactional public void saveJudgeResult(JudgeListDto dto){ - judgeUserRepository.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(), + residentAndDisabledDao.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(), dto.getMsuResult(), dto.getMsuReason(), LocalDate.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))); diff --git a/src/main/resources/sql/parking-mapper.xml b/src/main/resources/sql/parking-mapper.xml index f75ace6..1c9dc53 100644 --- a/src/main/resources/sql/parking-mapper.xml +++ b/src/main/resources/sql/parking-mapper.xml @@ -338,7 +338,7 @@ , (SELECT * FROM (SELECT ms_edate FROM min_simsa680 - WHERE MS_RESULT = '0' + WHERE ms_result = '0' ORDER BY ms_edate DESC) WHERE ROWNUM = 1) T WHERE MS.ms_maincode = MSU.msu_maincode @@ -349,4 +349,42 @@ ORDER BY MSU.msu_team, MU.name + + /* parking-mapper|selectByUserJudgeList|julim */ + SELECT MS.ms_maincode + , MS.ms_seq + , MS.ms_carnum + , MS.ms_result + , MS.ms_year + , MS.ms_chasu + , MS.ms_sdate + , MS.ms_startsi + , MS.ms_edate + , MS.ms_cdate + , MS.ms_closesi + , MS.ms_datagb + , MSU.msu_code + , MSU.msu_result + , MSU.msu_reason + , TM.mm_wdate as scWdate + FROM min_simsa680 MS + , min_simsa_user680 MSU + , tf680_recall TR + , tf680_main TM + WHERE MS.ms_maincode = MSU.msu_maincode + AND MS.ms_maincode = TR.rc_code + AND TR.rc_maincode = TM.mm_code + AND MSU.msu_userid = #{msuUserid} + ORDER BY MS.ms_sdate, MS.ms_edate, MS.ms_seq + + + + /* parking-mapper|updateMsuResonAndMsuResultByMsuCode|julim */ + UPDATE min_simsa_user680 + SET msu_reason = #{msuReason} + , msu_result = #{msuResult} + , msu_indate = #{msuIndate} + WHERE msu_code = #{msuCode} + + \ No newline at end of file diff --git a/src/main/resources/sql/residentAndDisabled-mapper.xml b/src/main/resources/sql/residentAndDisabled-mapper.xml index 439871d..5b5bccf 100644 --- a/src/main/resources/sql/residentAndDisabled-mapper.xml +++ b/src/main/resources/sql/residentAndDisabled-mapper.xml @@ -589,21 +589,64 @@ , MU.name , SUM(DECODE(MSU.msu_result, 0, 0, 1)) jcnt , COUNT(*) tcnt - FROM min_simsa680 MS - , min_simsa_user680 MSU + FROM min_simsa680_sc MS + , min_simsa_user680_sc MSU , min_userinfo MU , (SELECT * FROM (SELECT ms_edate - FROM min_simsa680 - WHERE MS_RESULT = '0' + FROM min_simsa680_sc + WHERE ms_datagb = #{msDatagb} + AND ms_result = '0' ORDER BY ms_edate DESC) WHERE ROWNUM = 1) T - WHERE MS.ms_maincode = MSU.msu_maincode + WHERE MS.ms_datagb = #{msDatagb} AND MS.ms_result = '0' + MS.ms_maincode = MSU.msu_maincode AND MSU.msu_userid = MU.userid AND MS.ms_edate = T.ms_edate GROUP BY MS.ms_edate, MSU.msu_team, MU.name ORDER BY MSU.msu_team, MU.name + + /* residentAndDisabled-mapper|selectByUserJudgeList|julim */ + SELECT MS.ms_maincode + , MS.ms_seq + , MS.ms_carnum + , MS.ms_result + , MS.ms_year + , MS.ms_chasu + , MS.ms_sdate + , MS.ms_startsi + , MS.ms_edate + , MS.ms_cdate + , MS.ms_closesi + , MS.ms_datagb + , MSU.msu_code + , MSU.msu_result + , MSU.msu_reason + , GR.sc_wdate + , GR.sc_pos + FROM min_simsa680_sc MS + , min_simsa_user680_sc MSU + , gn_recall_sc GR + WHERE MS.ms_maincode = MSU.msu_maincode + AND MS.ms_maincode = GR.sc_code + AND MSU.msu_userid = #{msuUserid} + + AND MS.ms_datagb = #{msDatagb} + + ORDER BY MS.ms_sdate, MS.ms_edate, MS.ms_seq + + + + /* residentAndDisabled-mapper|updateMsuResonAndMsuResultByMsuCode|julim */ + UPDATE min_simsa_user680_sc + SET msu_reason = #{msuReason} + , msu_result = #{msuResult} + , msu_indate = #{msuIndate} + WHERE msu_code = #{msuCode} + + + \ No newline at end of file