From f8741c4416f3107ecf17eb96921420be4030ee15 Mon Sep 17 00:00:00 2001 From: minuk926 Date: Fri, 29 Apr 2022 18:34:20 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=8B=AC=EC=82=AC=EC=9E=90=20-=20?= =?UTF-8?q?=EA=B1=B0=EC=A3=BC=EC=9E=90/=EC=9E=A5=EC=95=A0=EC=9D=B8=20?= =?UTF-8?q?=EC=8B=AC=EC=9D=98=EB=8C=80=EC=83=81=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xit/biz/ctgy/CtgyConstants.java | 4 ++ .../biz/ctgy/controller/BoardController.java | 6 ++ .../ctgy/controller/MinUserController.java | 3 + .../ctgy/controller/ParkingController.java | 14 +++++ .../controller/PublicBoardController.java | 5 ++ .../ResidentAndDisabledController.java | 61 +++++++++++++++---- .../com/xit/biz/ctgy/dto/JudgeListDto.java | 12 ++++ .../IResidentAndDisabledRepository.java | 8 ++- .../IResidentAndDisabledRepositoryCustom.java | 8 +++ .../IResidentAndDisabledRepositoryImpl.java | 46 +++++++++++++- .../service/IResidentAndDisabledService.java | 9 ++- .../impl/ResidentAndDisabledService.java | 13 ++++ src/main/resources/config/conf.yml | 2 +- 13 files changed, 176 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/xit/biz/ctgy/CtgyConstants.java b/src/main/java/com/xit/biz/ctgy/CtgyConstants.java index eb1217d..05a0880 100644 --- a/src/main/java/com/xit/biz/ctgy/CtgyConstants.java +++ b/src/main/java/com/xit/biz/ctgy/CtgyConstants.java @@ -18,6 +18,10 @@ public class CtgyConstants { DATA_STATE_ACCEPT("3", "수용"), DATA_STATE_NON_ACCEPT("4", "미수용"), + // 심의결과코드 + RESULT_JUDGE_PRE("0", "심의전"), + RESULT_JUDGE_IMPOSE("0", "부과"), + RESULT_JUDGE_NON_IMPOSE("0", "미부과"), // 데이타구분 DATAGB_RESIDENT("1", "거주자"), DATAGB_DISABLED("2", "장애인") 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 5fe9aea..4f89880 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/BoardController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/BoardController.java @@ -2,6 +2,8 @@ package com.xit.biz.ctgy.controller; import com.xit.biz.ctgy.dto.BoardDto; import com.xit.biz.ctgy.service.IBoardService; +import com.xit.core.annotation.Secured; +import com.xit.core.annotation.SecurityPolicy; import com.xit.core.api.IRestResponse; import com.xit.core.api.RestResponse; import com.xit.core.util.AssertUtils; @@ -32,6 +34,7 @@ public class BoardController { // TODO :: 파라메터 정의 필요 + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "게시글 목록 조회" , description = "게시글 목록 조회") @Parameters({ @Parameter(in = ParameterIn.QUERY, name = "ciTitle", description = "제목", required = false, example = " "), @@ -48,6 +51,7 @@ public class BoardController { return RestResponse.of(service.findAll(dto, pageable)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "게시글 조회수 증가" , description = "게시글 조회수 증가") @Parameters({ @Parameter(in = ParameterIn.PATH, name = "ciCode", description = "게시글번호", required = true, example = "18"), @@ -57,6 +61,7 @@ public class BoardController { return RestResponse.of(service.modifyByCiCode(ciCode)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "게시글 등록" , description = "게시글 등록") @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity saveBoard(BoardDto dto) { @@ -64,6 +69,7 @@ public class BoardController { return RestResponse.of(HttpStatus.OK); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "게시글 삭제", description = "게시글 삭제") @PostMapping(value = "/{ciCode}") public ResponseEntity removeBoard(@PathVariable @Nonnull final Long ciCode) { 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 8b179d7..884808a 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/MinUserController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/MinUserController.java @@ -36,6 +36,7 @@ public class MinUserController { private final MinUserinfoMapstruct mapstruct = Mappers.getMapper(MinUserinfoMapstruct.class); // TODO :: 파라메터 정의 필요 + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "사용자 목록 조회" , description = "사용자 목록 조회") @Parameters({ @Parameter(in = ParameterIn.QUERY, name = "userid", description = "사용자ID", required = false, example = " "), @@ -68,6 +69,7 @@ public class MinUserController { return RestResponse.of(service.findMinUserByUserid(userid)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "사용자 정보 저장" , description = "사용자 정보 저장") @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity saveMinUser( @@ -77,6 +79,7 @@ public class MinUserController { return RestResponse.of(HttpStatus.OK); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "사용자 삭제" , description = "사용자 삭제") @PutMapping(produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity removeMinUser( 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 7f62fca..b4aca1b 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java @@ -5,6 +5,8 @@ import com.xit.biz.ctgy.dto.ParkingTargetDto; import com.xit.biz.ctgy.dto.struct.JudgeListMapstruct; import com.xit.biz.ctgy.dto.struct.MinSimsa680Mapstruct; import com.xit.biz.ctgy.service.IParkingService; +import com.xit.core.annotation.Secured; +import com.xit.core.annotation.SecurityPolicy; import com.xit.core.api.IRestResponse; import com.xit.core.api.RestResponse; import io.swagger.v3.oas.annotations.Operation; @@ -35,6 +37,11 @@ public class ParkingController { private final MinSimsa680Mapstruct mapstruct = Mappers.getMapper(MinSimsa680Mapstruct.class); private final JudgeListMapstruct groupMapstruct = Mappers.getMapper(JudgeListMapstruct.class); + //--------------------------------------------------------------------------------- + // 관리자 + //--------------------------------------------------------------------------------- + + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "주정차 의견진술 심의 목록" , description = "주정차 의견진술 심의 목록") @Parameters({ @Parameter(in = ParameterIn.QUERY, name = "msYear", description = "심사년도", required = true, example = "2021"), @@ -53,6 +60,7 @@ public class ParkingController { return RestResponse.of(service.findParkings(dto, pageable)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "주정차 의견진술 심의 결과" , description = "주정차 의견진술 심의 결과") @Parameters({ @Parameter(in = ParameterIn.QUERY, name = "msSdate", description = "심사시작일", required = true, example = "2021-01-04"), @@ -68,6 +76,7 @@ public class ParkingController { return RestResponse.of(service.findParkingResults(dto)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "주정차 의견진술 심의대상 조회" , description = "주정차 의견진술 심의대상 조회") @GetMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE) @Parameters({ @@ -79,6 +88,7 @@ public class ParkingController { return RestResponse.of(service.findParkingJudgeTargets(dto)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "주정차 의견진술 심의대상 등록" , description = "주정차 의견진술 심의대상 등록") @PostMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity saveParkinJudgeTargets( @@ -89,6 +99,7 @@ public class ParkingController { return RestResponse.of(HttpStatus.OK); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "주정차 의견진술 심의 자료 삭제" , description = "주정차 의견진술 심의 자료 삭제") @PostMapping(value="/remove", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity removeParkinJudge( @@ -99,5 +110,8 @@ public class ParkingController { return RestResponse.of(HttpStatus.OK); } + //--------------------------------------------------------------------------------- + // 심사자 + //--------------------------------------------------------------------------------- } 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 764a127..bfd00e9 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/PublicBoardController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/PublicBoardController.java @@ -3,6 +3,8 @@ package com.xit.biz.ctgy.controller; import com.xit.biz.ctgy.dto.MinInfoBoard680Dto; import com.xit.biz.ctgy.dto.struct.MinInfoBoard680Mapstruct; import com.xit.biz.ctgy.service.IPublicBoardService; +import com.xit.core.annotation.Secured; +import com.xit.core.annotation.SecurityPolicy; import com.xit.core.api.IRestResponse; import com.xit.core.api.RestResponse; import io.swagger.v3.oas.annotations.Operation; @@ -30,6 +32,7 @@ public class PublicBoardController { private final MinInfoBoard680Mapstruct mapstruct = Mappers.getMapper(MinInfoBoard680Mapstruct.class); // TODO :: 파라메터 정의 필요 + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "공지사항 목록 조회" , description = "공지사항 목록 조회") @Parameters({ @Parameter(in = ParameterIn.QUERY, name = "inTitle", description = "제목", required = false, example = " "), @@ -46,6 +49,7 @@ public class PublicBoardController { return RestResponse.of(service.findAll(mapstruct.toEntity(dto), pageable)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "공지사항상세" , description = "공지사항상세") @Parameters({ @Parameter(in = ParameterIn.PATH, name = "inCode", description = "공지사항번호", required = true, example = "18"), @@ -55,6 +59,7 @@ public class PublicBoardController { return RestResponse.of(service.findByInCode(inCode)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "공지사항 조회수 증가" , description = "공지사항 조회수 증가") @Parameters({ @Parameter(in = ParameterIn.PATH, name = "inCode", description = "공지사항번호", required = true, example = "18"), 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 bada9c7..c28867c 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/ResidentAndDisabledController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/ResidentAndDisabledController.java @@ -5,6 +5,8 @@ import com.xit.biz.ctgy.dto.JudgeListDto; import com.xit.biz.ctgy.dto.JudgeTargetDto; import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct; import com.xit.biz.ctgy.service.IResidentAndDisabledService; +import com.xit.core.annotation.Secured; +import com.xit.core.annotation.SecurityPolicy; import com.xit.core.api.IRestResponse; import com.xit.core.api.RestResponse; import com.xit.core.util.AssertUtils; @@ -34,7 +36,7 @@ import javax.validation.constraints.NotNull; */ @Tag(name = "ResidentAndDisabledController", description = "거주자/장애인 의견진술 관리") @RestController -@RequestMapping("/api/v1/ctgy/judge") +@RequestMapping("/api/v1/ctgy") @Validated @RequiredArgsConstructor public class ResidentAndDisabledController { @@ -43,22 +45,28 @@ public class ResidentAndDisabledController { private final GnRecallScMapstruct mapstruct = Mappers.getMapper(GnRecallScMapstruct.class); + //--------------------------------------------------------------------------------- + // 관리자 + //--------------------------------------------------------------------------------- + // TODO :: 파라메터 정의 필요 + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "거주자/장애인 의견지술자료 목록 조회" , description = "거주자/장애인 의견진술자료 목록 조회") @Parameters({ @Parameter(in = ParameterIn.QUERY, name = "scDatagb", description = "데이타구분", required = true, example = "1"), @Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"), @Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10") }) - @GetMapping(value="/data", produces = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value="/admin/data", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity findJudgeDatas( @NotNull final String scDatagb, @Parameter(hidden = true) final Pageable pageable) { return RestResponse.of(service.findJudgeDatas(scDatagb, pageable)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "거주자/장애인 의견진술 자료 등록", description = "거주자/장애인 의견진술 자료 등록") - @PostMapping(value = "/data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @PostMapping(value = "/admin/data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public ResponseEntity saveJudgeData(@Nonnull GnRecallScDto dto) { AssertUtils.isTrue(!Checks.isEmpty(dto), "등록할 거주자 의견진술 자료가 없습니다"); AssertUtils.isTrue(!Checks.isEmpty(dto.getScDatagb()), "데이타구분 값은 필수입니다(1-거주자,2-장애인)"); @@ -67,24 +75,27 @@ public class ResidentAndDisabledController { return RestResponse.of(HttpStatus.OK); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "거주자/장애인 의견진술 자료 상세" , description = "거주자/장애인 의견진술 자료 상세") @Parameters({ @Parameter(in = ParameterIn.PATH, name = "scCode", description = "의견진술번호", required = true, example = "3778"), }) - @GetMapping(value = "/data/{scCode}", produces = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value = "/admin/data/{scCode}", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity findJudgeData(@PathVariable final Long scCode) { return RestResponse.of(service.findJudgeData(scCode)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "거주자/장애인 의견진술 자료 삭제" , description = "거주자/장애인 의견진술 자료 삭제") - @PostMapping(value="/data/remove", produces = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value="/admin/data/remove", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity removeJudgeData(final Long scCode) { service.removeJudgeData(scCode); return RestResponse.of(HttpStatus.OK); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "거주자/장애인 의견진술 심의대상 조회" , description = "거주자/장애인 의견진술 심의대상 조회") - @GetMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value="/admin/target", produces = MediaType.APPLICATION_JSON_VALUE) @Parameters({ @Parameter(in = ParameterIn.QUERY, name = "scDatagb", description = "데이타구분(1-거주자, 2-장애인)", required = true, example = "1"), @Parameter(in = ParameterIn.QUERY, name = "scTransfer", description = "전송상태(미접수-1,접수-2)", required = true, example = "1"), @@ -100,8 +111,9 @@ public class ResidentAndDisabledController { return RestResponse.of(service.findJudgeTargets(dto)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "거주자/징애인 의견진술 심의대상 등록" , description = "거주자/장애인 의견진술 심의대상 등록") - @PostMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value="/admin/target", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity saveJudgeTargets( @Valid @RequestBody @@ -111,6 +123,7 @@ public class ResidentAndDisabledController { return RestResponse.of(HttpStatus.OK); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "거주자/장애인 의견진술 심의목록 조회" , description = "거주자/장애인 의견진술 심의목록 조회") @Parameters({ @Parameter(in = ParameterIn.QUERY, name = "scDatagb", description = "데이타구분(1-거주자, 2-장애인)", required = true, example = "1"), @@ -120,8 +133,8 @@ public class ResidentAndDisabledController { @Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10") }) - @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity findResidents( + @GetMapping(value = "/admin", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findJudges( @Valid @Parameter(hidden = true) final JudgeListDto dto, @@ -133,6 +146,7 @@ public class ResidentAndDisabledController { return RestResponse.of(service.findJudges(dto, pageable)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "거주자/장애인 의견진술 심의 결과 목록" , description = "거주자/장애인 의견진술 심의 결과 목록") @Parameters({ @Parameter(in = ParameterIn.QUERY, name = "msDatagb", description = "데이타구분(1-거주자, 2-장애인)", required = true, example = "1"), @@ -141,7 +155,7 @@ public class ResidentAndDisabledController { @Parameter(in = ParameterIn.QUERY, name = "msChasu", description = "차수", required = true, example = "12"), @Parameter(in = ParameterIn.QUERY, name = "msuTeam", description = "팀코드", required = false, example = "003") }) - @GetMapping(value="/result", produces = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value="/admin/result", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity findJudgeResults( @Valid @Parameter(hidden = true) @@ -150,8 +164,9 @@ public class ResidentAndDisabledController { return RestResponse.of(service.findJudgeResults(dto)); } + @Secured(policy = SecurityPolicy.TOKEN) @Operation(summary = "거주자/장애인 의견진술 심의 자료 삭제" , description = "거주자/장애인 의견진술 심의 자료 삭제") - @PostMapping(value="/remove", produces = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value="/admin/remove", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity removeJudge( @Valid @RequestBody @@ -159,4 +174,28 @@ public class ResidentAndDisabledController { service.removeJudge(dto); return RestResponse.of(HttpStatus.OK); } + + + //--------------------------------------------------------------------------------- + // 심사자 + //--------------------------------------------------------------------------------- + //@Secured(policy = SecurityPolicy.TOKEN) + @Operation(summary = "심사자별 거주자/장애인 의견진술 심의목록 조회" , description = "심사자별 거주자/장애인 의견진술 심의목록 조회") + @Parameters({ + @Parameter(in = ParameterIn.QUERY, name = "msDatagb", description = "데이타구분(1-거주자, 2-장애인)", required = true, example = "1"), + //@Parameter(in = ParameterIn.QUERY, name = "scYear", description = "심사년도", required = true, example = "2021"), + //@Parameter(in = ParameterIn.QUERY, name = "scChasu", description = "차수", required = false, example = " "), + //@Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"), + //@Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10") + + }) + @GetMapping(value = "/judge", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findByUserJudges( + @Valid + @Parameter(hidden = true) + final JudgeListDto dto) { + AssertUtils.isTrue(!Checks.isEmpty(dto), "필수 검색 조건이 입력되지 않았습니다."); + AssertUtils.isTrue(!Checks.isEmpty(dto.getMsDatagb()), "데이타구분 값은 필수입니다(1-거주자,2-장애인)"); + return RestResponse.of(service.findByUserJudges(dto)); + } } diff --git a/src/main/java/com/xit/biz/ctgy/dto/JudgeListDto.java b/src/main/java/com/xit/biz/ctgy/dto/JudgeListDto.java index 29960e4..960ad6d 100644 --- a/src/main/java/com/xit/biz/ctgy/dto/JudgeListDto.java +++ b/src/main/java/com/xit/biz/ctgy/dto/JudgeListDto.java @@ -41,4 +41,16 @@ public class JudgeListDto { @Schema(title = "심사팀코드", example = " ", description = "심사팀코드") private String msuTeam; + + @Schema(title = "민원코드", example = " ", description = "민원코드") + private Long msMainCode; + @Schema(title = "접수번호", example = " ", description = "접수번호") + private String msSeq; + @Schema(title = "차량번호", example = " ", description = "차량번호") + private String msCarnum; + + @Schema(title = "민원별 심사결과", example = " ", description = "심의건별 심사결과") + private String msResult; + @Schema(title = "심사자별 심사결과", example = " ", description = "심사자별 심사결과") + private String msuResult; } diff --git a/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepository.java b/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepository.java index 439314e..f7a7aa0 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepository.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepository.java @@ -13,7 +13,9 @@ import org.springframework.transaction.annotation.Transactional; * 장애인 : scDatagb = "2" */ public interface IResidentAndDisabledRepository extends JpaRepository, IResidentAndDisabledRepositoryCustom { - + //--------------------------------------------------------------------------------- + // 관리자 + //--------------------------------------------------------------------------------- // TODO : Ansi - sql 미사용, 채번테이블 사용하도록 변경 필요 //@Query(value = "SELECT max(e.sc_code) + 1 FROM gn_recall_sc e, nativeQuery = true) @@ -37,4 +39,8 @@ public interface IResidentAndDisabledRepository extends JpaRepository findJudgeTargets(final JudgeTargetDto dto); + //--------------------------------------------------------------------------------- + // 심사자 + //--------------------------------------------------------------------------------- + + List findByUserJudges(JudgeListDto dto); } diff --git a/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java b/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java index 3761dcc..7dfeb13 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java @@ -12,6 +12,7 @@ import com.xit.biz.ctgy.dto.GnRecallScDto; import com.xit.biz.ctgy.dto.JudgeDetailDto; import com.xit.biz.ctgy.dto.JudgeListDto; import com.xit.biz.ctgy.dto.JudgeTargetDto; +import com.xit.core.oauth2.utils.HeaderUtil; import com.xit.core.util.Checks; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; @@ -35,9 +36,12 @@ import static com.xit.biz.ctgy.entity.QMinUserinfo.minUserinfo; */ @RequiredArgsConstructor public class IResidentAndDisabledRepositoryImpl implements IResidentAndDisabledRepositoryCustom { - private final JPAQueryFactory queryFactory; + //--------------------------------------------------------------------------------- + // 관리자 + //--------------------------------------------------------------------------------- + @Override public Page findJudgeDatas(@NotNull final String scDatagb, Pageable pageable) { @@ -310,4 +314,44 @@ public class IResidentAndDisabledRepositoryImpl implements IResidentAndDisabledR if(Checks.isEmpty(seq)) return null; return gnRecallSc.scSeq.lt(seq); } + + //--------------------------------------------------------------------------------- + // 심사자 + //--------------------------------------------------------------------------------- + @Override + public List findByUserJudges(final JudgeListDto dto) { + + BooleanBuilder builder = new BooleanBuilder(); + builder.and(minSimsa680Sc.msDatagb.eq(dto.getMsDatagb())); + + // TODO : test를 위하 임시로 코멘트 처리 + //builder.and(minSimsaUser680Sc.msuUserid.eq(HeaderUtil.getUserId())); + // 심의전 + builder.and(minSimsa680Sc.msResult.eq(CtgyConstants.Judge.RESULT_JUDGE_PRE.getCode())); + + return queryFactory + .select(Projections.fields( + JudgeListDto.class, + minSimsa680Sc.msMaincode, + minSimsa680Sc.msSeq, + minSimsa680Sc.msCarnum, + minSimsa680Sc.msResult, + minSimsaUser680Sc.msuResult, + minSimsa680Sc.msYear, + minSimsa680Sc.msChasu, + minSimsa680Sc.msSdate, + minSimsa680Sc.msStartsi, + minSimsa680Sc.msEdate, + minSimsa680Sc.msCdate, + minSimsa680Sc.msClosesi, + minSimsa680Sc.msDatagb + )) + .from(minSimsa680Sc) + .join(minSimsaUser680Sc) + .on(minSimsa680Sc.msMaincode.eq(minSimsaUser680Sc.msuMaincode)) + .where(builder) + //.groupBy(minSimsa680Sc.msDatagb, minSimsa680Sc.msYear, minSimsaUser680Sc.msuUserid, minSimsa680Sc.msChasu, minSimsa680Sc.msSdate, minSimsa680Sc.msStartsi, minSimsa680Sc.msEdate, minSimsa680Sc.msCdate, minSimsa680Sc.msClosesi) + .orderBy(minSimsa680Sc.msYear.desc(), minSimsa680Sc.msChasu.desc()) + .fetch(); + } } \ No newline at end of file diff --git a/src/main/java/com/xit/biz/ctgy/service/IResidentAndDisabledService.java b/src/main/java/com/xit/biz/ctgy/service/IResidentAndDisabledService.java index f6d1b49..8f05875 100644 --- a/src/main/java/com/xit/biz/ctgy/service/IResidentAndDisabledService.java +++ b/src/main/java/com/xit/biz/ctgy/service/IResidentAndDisabledService.java @@ -16,7 +16,9 @@ import java.util.Map; * 장애인 : scDatagb = "2" */ public interface IResidentAndDisabledService { - + //--------------------------------------------------------------------------------- + // 관리자 + //--------------------------------------------------------------------------------- /** * 거주자 / 장애인 심의자료 목록 조회 @@ -75,4 +77,9 @@ public interface IResidentAndDisabledService { void removeJudge(final JudgeListDto dto); + //--------------------------------------------------------------------------------- + // 심사자 + //--------------------------------------------------------------------------------- + List findByUserJudges(JudgeListDto dto); + } 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 dec4437..3f59abf 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 @@ -62,6 +62,9 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { private final ICmmFileService fileService; private final EntityManager entityManager; + //--------------------------------------------------------------------------------- + // 관리자 + //--------------------------------------------------------------------------------- @Override @Transactional(readOnly = true) public Page findJudgeDatas(@NotNull final String scDatagb, Pageable pageable) { @@ -276,4 +279,14 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { private void changeFileUpload(GnRecallScDto dto, MultipartFile[] mfs) { fileService.uploadFiles(mfs, rootPath, CtgyConstants.Judge.DATAGB_RESIDENT.getCode().equals(dto.getScDatagb())? uploadPath[0] : uploadPath[1]); } + + + //--------------------------------------------------------------------------------- + // 심사자 + //--------------------------------------------------------------------------------- + @Override + @Transactional(readOnly = true) + public List findByUserJudges(JudgeListDto dto) { + return gnReacallRepository.findByUserJudges(dto); + } } diff --git a/src/main/resources/config/conf.yml b/src/main/resources/config/conf.yml index 2cb251b..b12a19d 100644 --- a/src/main/resources/config/conf.yml +++ b/src/main/resources/config/conf.yml @@ -17,7 +17,7 @@ api: file: cmm: upload: - root: /data/file/upload + root: c:/data/file/upload # root: /Users/minuk/data/file/upload # 공지사항 path: /kangnamSIM/simUpFile