diff --git a/.gitignore b/.gitignore index 88e5506..bf58d53 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ build/ /.gradle/ /src/main/generated/ /LOG_PATH_IS_UNDEFINED/ +.DS_Store 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 a520ad1..22d37e0 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java @@ -60,7 +60,7 @@ public class ParkingController { @Parameter(in = ParameterIn.QUERY, name = "msChasu", description = "차수", required = false, example = "3"), @Parameter(in = ParameterIn.QUERY, name = "msuTeam", description = "팀코드", required = true, example = "002") }) - @GetMapping(value="/details", produces = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value="/detail", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity findParkingDetails( @Valid @Parameter(hidden = true) 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 adf1910..70e5406 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/ResidentAndDisabledController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/ResidentAndDisabledController.java @@ -60,7 +60,8 @@ public class ResidentAndDisabledController { @Operation(summary = "거주자/장애인 의견진술 자료 등록", description = "거주자/장애인 의견진술 자료 등록") @PostMapping(value = "/data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public ResponseEntity saveJudgeData(@Nonnull GnRecallScDto dto) { - AssertUtils.isTrue(!Checks.isEmpty(dto), "등록할 거주자 의견진술 자료가 존재하지 않습니다."); + AssertUtils.isTrue(!Checks.isEmpty(dto), "등록할 거주자 의견진술 자료가 없습니다"); + AssertUtils.isTrue(!Checks.isEmpty(dto.getScDatagb()), "데이타구분 값은 필수입니다(1-거주자,2-장애인)"); service.saveJudgeData(dto); //service.saveResidentData(mapstruct.toEntity(dto), dto.getPicadFiles(), dto.getFrecadFiles(), dto.getContadFiles()); @@ -86,6 +87,11 @@ public class ResidentAndDisabledController { @Parameter(in = ParameterIn.QUERY, name = "scSeq2", description = "접수번호-종료", required = true, example = "2022999999"), }) public ResponseEntity findResidentJudgeTargets(@Parameter(hidden = true) final JudgeTargetDto dto){ + AssertUtils.isTrue(!Checks.isEmpty(dto), "필수 검색 조건이 입력되지 않았습니다."); + AssertUtils.isTrue(!Checks.isEmpty(dto.getScDatagb()), "데이타구분 값은 필수입니다(1-거주자,2-장애인)"); + AssertUtils.isTrue(!Checks.isEmpty(dto.getScTransfer()), "전송상태를 선택하지 않았습니다(1-미전송,2-전송)"); + AssertUtils.isTrue(!Checks.isEmpty(dto.getScSeq1()), "조회할 접수번호(시작)가 입력되지 않았습니다"); + AssertUtils.isTrue(!Checks.isEmpty(dto.getScSeq2()), "조회할 접수번호(종료)가 입력되지 않았습니다"); return RestResponse.of(service.findJudgeTargets(dto)); } @@ -102,6 +108,7 @@ public class ResidentAndDisabledController { @Operation(summary = "거주자/장애인 의견진술 심의목록 조회" , description = "거주자/장애인 의견진술 심의목록 조회") @Parameters({ + @Parameter(in = ParameterIn.QUERY, name = "scDatagb", 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"), @@ -115,7 +122,27 @@ public class ResidentAndDisabledController { final JudgeListDto dto, @Parameter(hidden = true) final Pageable pageable) { + AssertUtils.isTrue(!Checks.isEmpty(dto), "필수 검색 조건이 입력되지 않았습니다."); + AssertUtils.isTrue(!Checks.isEmpty(dto.getMsDatagb()), "데이타구분 값은 필수입니다(1-거주자,2-장애인)"); + AssertUtils.isTrue(!Checks.isEmpty(dto.getMsYear()), "심사년도를 선택하셔야 합니다"); return RestResponse.of(service.findJudges(dto, pageable)); } + @Operation(summary = "거주자/장애인 의견진술 심의등록 상세 목록" , description = "거주자/장애인 의견진술 심의등록 상세 목록") + @Parameters({ + @Parameter(in = ParameterIn.QUERY, name = "msDatagb", description = "데이타구분(1-거주자, 2-장애인)", required = true, example = "1"), + @Parameter(in = ParameterIn.QUERY, name = "msSdate", description = "심사시작일", required = true, example = "2021-01-04"), + @Parameter(in = ParameterIn.QUERY, name = "msEdate", description = "심사종료일", required = true, example = "2021-01-05"), + @Parameter(in = ParameterIn.QUERY, name = "msChasu", description = "차수", required = false, example = "3"), + @Parameter(in = ParameterIn.QUERY, name = "msuTeam", description = "팀코드", required = true, example = "002") + }) + @GetMapping(value="/detail", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findJudgeDetails( + @Valid + @Parameter(hidden = true) + final JudgeListDto dto) { + AssertUtils.isTrue(!Checks.isEmpty(dto), "필수 검색 조건이 입력되지 않았습니다."); + return RestResponse.of(service.findJudgeDetails(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 54d7700..ee25546 100644 --- a/src/main/java/com/xit/biz/ctgy/dto/JudgeListDto.java +++ b/src/main/java/com/xit/biz/ctgy/dto/JudgeListDto.java @@ -1,10 +1,12 @@ package com.xit.biz.ctgy.dto; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import javax.validation.constraints.Size; import java.sql.Date; +import java.time.LocalDate; @Schema(name = "JudgeListDto", description = "심의목록 조회: 주정차/거주자/장애인") @Getter @@ -18,10 +20,20 @@ public class JudgeListDto { @Schema(title = "차수", example = " ", description = "차수") private Long msChasu; - private Date msSdate; + + @Schema(title = "심사시작일", example = "2022-03-23", description = "심사시작일") + @JsonFormat(pattern="yyyy-MM-dd") + private LocalDate msSdate; private String msStartsi; - private Date msEdate; - private Date msCdate; + + @Schema(title = "심사종료일", example = "2022-03-23", description = "심사종료일") + @JsonFormat(pattern="yyyy-MM-dd") + private LocalDate msEdate; + + @Schema(title = "심사마감일", example = "2022-03-23", description = "심사마감일") + @JsonFormat(pattern="yyyy-MM-dd") + private LocalDate msCdate; + private String msClosesi; private Long cnt; diff --git a/src/main/java/com/xit/biz/ctgy/dto/MinSimsa680Dto.java b/src/main/java/com/xit/biz/ctgy/dto/MinSimsa680Dto.java index 1d42e85..ea72f3e 100644 --- a/src/main/java/com/xit/biz/ctgy/dto/MinSimsa680Dto.java +++ b/src/main/java/com/xit/biz/ctgy/dto/MinSimsa680Dto.java @@ -1,11 +1,14 @@ package com.xit.biz.ctgy.dto; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; +import java.time.LocalDate; + @Schema(name = "MinSimsa680Dto", description = "민원심사") @Getter @Setter @@ -29,23 +32,27 @@ public class MinSimsa680Dto { @Schema(required = true, title = "차수", example = " ", description = "Input Description...") private Long msChasu; - @Schema(required = true, title = "심사시작일시", example = " ", description = "Input Description...") - private java.sql.Date msSdate; + @Schema(required = true, title = "심사시작일", example = " ", description = "Input Description...") + @JsonFormat(pattern="yyyy-MM-dd") + private LocalDate msSdate; @Schema(required = true, title = "심사시작시간", example = " ", description = "Input Description...") private String msStartsi; - @Schema(required = true, title = "심사종료일시", example = " ", description = "Input Description...") - private java.sql.Date msEdate; + @Schema(required = true, title = "심사종료일", example = " ", description = "Input Description...") + @JsonFormat(pattern="yyyy-MM-dd") + private LocalDate msEdate; - @Schema(required = true, title = "심사마감일시", example = " ", description = "Input Description...") - private java.sql.Date msCdate; + @Schema(required = true, title = "심사마감일", example = " ", description = "Input Description...") + @JsonFormat(pattern="yyyy-MM-dd") + private LocalDate msCdate; @Schema(required = true, title = "심사마감시간", example = " ", description = "Input Description...") private String msClosesi; @Schema(required = false, title = "단속일자", example = " ", description = "Input Description...") - private java.sql.Date msWdate; + @JsonFormat(pattern="yyyy-MM-dd") + private LocalDate msWdate; @Schema(required = false, title = "단속장소", example = " ", description = "Input Description...") private String msPos; diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java index 8d0c6f1..b0af7a7 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java @@ -6,13 +6,14 @@ import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; import javax.persistence.*; +import java.time.LocalDate; @Schema(name = "MinSimsa680", description = "민원심사") @Table(name = "min_simsa680", schema = "", catalog = "") @Entity @DynamicInsert @DynamicUpdate -@NoArgsConstructor(access = AccessLevel.PROTECTED) +@NoArgsConstructor //(access = AccessLevel.PROTECTED) @AllArgsConstructor @Getter @Builder @@ -43,7 +44,7 @@ public class MinSimsa680 { //implements Serializable { @Schema(required = true, title = "심사시작일시", example = " ", description = "Input Description...") @Column(name = "ms_sdate", nullable = false) - private java.sql.Date msSdate; + private LocalDate msSdate; @Schema(required = true, title = "심사시작시간", example = " ", description = "Input Description...") @Column(name = "ms_startsi", nullable = false) @@ -51,7 +52,7 @@ public class MinSimsa680 { //implements Serializable { @Schema(required = true, title = "심사종료일시", example = " ", description = "Input Description...") @Column(name = "ms_edate", nullable = false) - private java.sql.Date msEdate; + private LocalDate msEdate; @Schema(required = true, title = "심사마감일시", example = " ", description = "Input Description...") @Column(name = "ms_cdate", nullable = false) @@ -63,7 +64,7 @@ public class MinSimsa680 { //implements Serializable { @Schema(required = false, title = "단속일자", example = " ", description = "Input Description...") @Column(name = "ms_wdate", nullable = true) - private java.sql.Date msWdate; + private LocalDate msWdate; @Schema(required = false, title = "단속장소", example = " ", description = "Input Description...") @Column(name = "ms_pos", nullable = true) diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680Sc.java b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680Sc.java index 23f53c4..ee5eaed 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680Sc.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680Sc.java @@ -9,6 +9,7 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; +import java.time.LocalDate; @Schema(name = "MinSimsa680Sc", description = "민원심사") @Table(name = "min_simsa680_sc", schema = "", catalog = "") @@ -46,7 +47,7 @@ public class MinSimsa680Sc { //implements Serializable { @Schema(required = true, title = "심사시작일시", example = " ", description = "Input Description...") @Column(name = "ms_sdate", nullable = false) - private java.sql.Date msSdate; + private LocalDate msSdate; @Schema(required = true, title = "심사시작시간", example = " ", description = "Input Description...") @Column(name = "ms_startsi", nullable = false) @@ -54,11 +55,11 @@ public class MinSimsa680Sc { //implements Serializable { @Schema(required = true, title = "심사종료일시", example = " ", description = "Input Description...") @Column(name = "ms_edate", nullable = false) - private java.sql.Date msEdate; + private LocalDate msEdate; @Schema(required = true, title = "심사마감일시", example = " ", description = "Input Description...") @Column(name = "ms_cdate", nullable = false) - private java.sql.Date msCdate; + private LocalDate msCdate; @Schema(required = true, title = "심사마감시간", example = " ", description = "Input Description...") @Column(name = "ms_closesi", nullable = false) @@ -66,7 +67,7 @@ public class MinSimsa680Sc { //implements Serializable { @Schema(required = false, title = "단속일자", example = " ", description = "Input Description...") @Column(name = "ms_wdate", nullable = true) - private java.sql.Date msWdate; + private LocalDate msWdate; @Schema(required = false, title = "단속장소", example = " ", description = "Input Description...") @Column(name = "ms_pos", nullable = true) diff --git a/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryCustom.java b/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryCustom.java index 7f79766..d714fb8 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryCustom.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryCustom.java @@ -10,7 +10,7 @@ import java.util.List; public interface IParkingRepositoryCustom { Page findParkings(final JudgeListDto dto, Pageable pageable); - //List findParkingDetails(final JudgeListDto minSimsa680GroupDto); + List findParkingDetails(final JudgeListDto dto); List findParkingJudgeTargets(final ParkingTargetDto dto); 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 8fe7dcc..ceb0a00 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryImpl.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryImpl.java @@ -9,6 +9,7 @@ import com.querydsl.jpa.impl.JPAQueryFactory; import com.xit.biz.ctgy.CtgyConstants; import com.xit.biz.ctgy.dto.JudgeListDto; import com.xit.biz.ctgy.dto.ParkingTargetDto; +import com.xit.biz.ctgy.entity.MinSimsa680; import com.xit.core.util.Checks; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; @@ -19,6 +20,8 @@ import java.util.List; import static com.xit.biz.cmm.entity.QCmmCodeS.cmmCodeS; import static com.xit.biz.ctgy.entity.QMinSimsa680.minSimsa680; +import static com.xit.biz.ctgy.entity.QMinSimsaUser680.minSimsaUser680; +import static com.xit.biz.ctgy.entity.QMinUserinfo.minUserinfo; import static com.xit.biz.ctgy.entity.QTf680Main.tf680Main; import static com.xit.biz.ctgy.entity.QTf680Recall.tf680Recall; @@ -62,37 +65,37 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom { return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal()); } -// @Override -// public List findParkingDetails(final JudgeListDto dto) { -// -// BooleanBuilder builder = new BooleanBuilder(); -// builder.and(minSimsa680.msSdate.eq(dto.getMsSdate())); -// builder.and(minSimsa680.msEdate.eq(dto.getMsEdate())); -// -// if (!Checks.isEmpty(dto.getMsuTeam())) { -// builder.and(minSimsaUser680.msuTeam.eq(dto.getMsuTeam())); -// } -// -// List rslt = -// queryFactory -// .select(Projections.fields(MinSimsa680.class, -// minSimsa680.msSeq, -// minSimsa680.msCarnum, -// minSimsa680.msMaincode)) -// .from(minSimsaUser680) -// .join(minSimsa680) -// .on(minSimsa680.msMaincode.eq(minSimsaUser680.msuMaincode)) -// .join(minUserinfo) -// .on(minSimsaUser680.msuUserid.eq(minUserinfo.userid)) -// .where(builder) -// .groupBy(minSimsa680.msCarnum, -// minSimsa680.msSeq, -// minSimsa680.msMaincode) -// .orderBy(minSimsa680.msSeq.asc()) -// .fetch(); -// -// return rslt; -// } + @Override + public List findParkingDetails(final JudgeListDto dto) { + + BooleanBuilder builder = new BooleanBuilder(); + builder.and(minSimsa680.msSdate.gt(dto.getMsSdate())); + builder.and(minSimsa680.msEdate.lt(dto.getMsEdate())); + + if (!Checks.isEmpty(dto.getMsuTeam())) { + builder.and(minSimsaUser680.msuTeam.eq(dto.getMsuTeam())); + } + + List rslt = + queryFactory + .select(Projections.fields(MinSimsa680.class, + minSimsa680.msSeq, + minSimsa680.msCarnum, + minSimsa680.msMaincode)) + .from(minSimsaUser680) + .join(minSimsa680) + .on(minSimsa680.msMaincode.eq(minSimsaUser680.msuMaincode)) + .join(minUserinfo) + .on(minSimsaUser680.msuUserid.eq(minUserinfo.userid)) + .where(builder) + .groupBy(minSimsa680.msCarnum, + minSimsa680.msSeq, + minSimsa680.msMaincode) + .orderBy(minSimsa680.msSeq.asc()) + .fetch(); + + return rslt; + } @Override public List findParkingJudgeTargets(final ParkingTargetDto dto) { @@ -148,42 +151,14 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom { return rslt; } -// @Override -// public Page findMinSimsa680s2(Pageable pageable) { -// /* -// SELECT MS_EDATE, MSU_TEAM, NAME, SUM(DECODE(MSU_RESULT, 0, 0, 1)) CLCNT, COUNT(*) TOTCNT -// FROM MIN_USERINFO, MIN_SIMSA_USER680, MIN_SIMSA680 -// WHERE USERID = MSU_USERID AND MS_MAINCODE = MSU_MAINCODE -// GROUP BY MS_EDATE, MSU_TEAM, NAME -// ORDER BY MS_EDATE DESC, MSU_TEAM, NAME -// */ -// -//// Expression rsltEa = new CaseBuilder() -//// .when(minSimsaUser680.msuResult.eq("0")).then(0L) -//// .otherwise(1L).sum().as("clcnt"); -// QueryResults rslt = -// queryFactory -// .select(Projections.fields( -// MinSimsaReviewGroupDto.class, -// minSimsa680.msEdate, -// minSimsaUser680.msuTeam, -// minUserinfo.name, -// new CaseBuilder() -// .when(minSimsaUser680.msuResult.eq("0")).then(0L) -// .otherwise(1L).sum().as("clcnt"), -// minSimsa680.count().as("totcnt") -// )) -// .from(minSimsaUser680) -// .join(minSimsa680) -// .on(minSimsa680.msMaincode.eq(minSimsaUser680.msuMaincode)) -// .join(minUserinfo) -// .on(minSimsaUser680.msuUserid.eq(minUserinfo.userid)) -// .groupBy(minSimsa680.msEdate, minSimsaUser680.msuTeam, minUserinfo.name) -// .orderBy(minSimsa680.msEdate.desc(), minSimsaUser680.msuTeam.asc(), minUserinfo.name.asc()) -// .offset(pageable.getOffset()) -// .limit(pageable.getPageSize()) -// .fetchResults(); +// private BooleanExpression startDateGt(LocalDate sDate){ +// if(sDate == null) return null; +// return minSimsa680.msSdate.gt(sDate); +// } // -// return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal()); +// private BooleanExpression endDateGt(LocalDate eDate){ +// if(eDate == null) return null; +// return minSimsa680.msEdate.gt(eDate); // } + } diff --git a/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryCustom.java b/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryCustom.java index 636ddf5..7ea6f35 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryCustom.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryCustom.java @@ -3,6 +3,7 @@ package com.xit.biz.ctgy.repository; 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.MinSimsa680; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -31,13 +32,20 @@ public interface IResidentAndDisabledRepositoryCustom { GnRecallScDto findJudgeData(final Long scCode); /** - * 거주자 / 장애인 의견진술 목로 조회 + * 거주자 / 장애인 의견진술 목록 조회 * @param dto JudgeListDto * @param pageable Pageable * @return Page */ Page findJudges(JudgeListDto dto, Pageable pageable); + /** + * 거주자 / 장애인 의견진술 상세 목록 조회 + * @param dto JudgeListDto + * @return List + */ + List findJudgeDetails(final JudgeListDto dto); + /** * 거주자 / 장애인 심의 대상 목록 조회 * @param dto JudgeTargetDto 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 b16a3eb..2df26f6 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java @@ -11,6 +11,7 @@ import com.xit.biz.ctgy.CtgyConstants; 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.MinSimsa680; import com.xit.core.util.Checks; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; @@ -23,7 +24,10 @@ import java.util.List; import static com.xit.biz.cmm.entity.QCmmCodeS.cmmCodeS; import static com.xit.biz.ctgy.entity.QGnRecallSc.gnRecallSc; +import static com.xit.biz.ctgy.entity.QMinSimsa680.minSimsa680; import static com.xit.biz.ctgy.entity.QMinSimsa680Sc.minSimsa680Sc; +import static com.xit.biz.ctgy.entity.QMinSimsaUser680.minSimsaUser680; +import static com.xit.biz.ctgy.entity.QMinUserinfo.minUserinfo; /** * 거주자 / 장애인 의견 진술 @@ -161,33 +165,22 @@ public class IResidentAndDisabledRepositoryImpl implements IResidentAndDisabledR .from(gnRecallSc) .where(gnRecallSc.scCode.eq(scCode)) .fetchOne(); -/* -SELECT SC_CODE, SC_SEQ, SC_CARNUM, SC_NAME, SC_DONG, -GET_RECALL_CONTID(SC_CONT_DOC) SC_CONT_DOC, SC_CDATE, GET_RECALL_INGB_STR(SC_INGB) SC_INGB, SC_WDATE, SC_JBTIME, -SC_POS, SC_FRECAD1, SC_FRECAD2, SC_FRECAD3, SC_FRECAD4, -SC_CONTAD1, SC_CONTAD2, SC_CONTAD3, SC_CONTAD4, SC_CONTAD5, -SC_CONTAD6, SC_CONTAD7, SC_CONTAD8, SC_PICAD1, SC_PICAD2, -SC_PICAD3, SC_PICAD4, (SELECT CDNAME FROM MIN_MAINCODE WHERE C2='6' AND C3=SC_TRANSFER) SC_TRANSFER, SC_ANSWER, -(SELECT CDNAME FROM MIN_MAINCODE WHERE C2='7' AND C3=SC_STATE) SC_STATE, ZIPCODE1, ZIPCODE2, SC_JUSO, SC_BUNJI -FROM GN_RECALL_SC -WHERE SC_DATAGB = '1' -AND SC_CODE = - */ } @Override public Page findJudges(final JudgeListDto dto, Pageable pageable) { BooleanBuilder builder = new BooleanBuilder(); + if (!Checks.isEmpty(dto.getMsDatagb())) { + builder.and(minSimsa680Sc.msDatagb.eq(dto.getMsDatagb())); + } if (!Checks.isEmpty(dto.getMsYear())) { builder.and(minSimsa680Sc.msYear.eq(dto.getMsYear())); } if (!Checks.isEmpty(dto.getMsChasu())) { builder.and(minSimsa680Sc.msChasu.eq(dto.getMsChasu())); } - if (!Checks.isEmpty(dto.getMsDatagb())) { - builder.and(minSimsa680Sc.msDatagb.eq(dto.getMsDatagb())); - } + QueryResults rslt = queryFactory .select(Projections.fields( @@ -214,6 +207,38 @@ AND SC_CODE = return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal()); } + @Override + public List findJudgeDetails(final JudgeListDto dto) { + + BooleanBuilder builder = new BooleanBuilder(); + builder.and(minSimsa680.msSdate.gt(dto.getMsSdate()).or(minSimsa680.msSdate.eq(dto.getMsSdate()))); + builder.and(minSimsa680.msEdate.lt(dto.getMsEdate()).or(minSimsa680.msEdate.eq(dto.getMsEdate()))); + + if (!Checks.isEmpty(dto.getMsuTeam())) { + builder.and(minSimsaUser680.msuTeam.eq(dto.getMsuTeam())); + } + + List rslt = + queryFactory + .select(Projections.fields(MinSimsa680.class, + minSimsa680.msSeq, + minSimsa680.msCarnum, + minSimsa680.msMaincode)) + .from(minSimsaUser680) + .join(minSimsa680) + .on(minSimsa680.msMaincode.eq(minSimsaUser680.msuMaincode)) + .join(minUserinfo) + .on(minSimsaUser680.msuUserid.eq(minUserinfo.userid)) + .where(builder) + .groupBy(minSimsa680.msCarnum, + minSimsa680.msSeq, + minSimsa680.msMaincode) + .orderBy(minSimsa680.msSeq.asc()) + .fetch(); + + return rslt; + } + @Override public List findJudgeTargets(final JudgeTargetDto dto) { diff --git a/src/main/java/com/xit/biz/ctgy/service/IParkingService.java b/src/main/java/com/xit/biz/ctgy/service/IParkingService.java index 2d2ada0..441bf0f 100644 --- a/src/main/java/com/xit/biz/ctgy/service/IParkingService.java +++ b/src/main/java/com/xit/biz/ctgy/service/IParkingService.java @@ -11,8 +11,8 @@ import java.util.List; public interface IParkingService { //Page findMinSimsa680Groups(MinSimsa680 minSimsa680, Pageable pageable); - Page findParkings(final JudgeListDto minSimsa680GroupDto, Pageable pageable); - List findParkingDetails(final JudgeListDto minSimsa680GroupDto); + Page findParkings(final JudgeListDto dto, Pageable pageable); + List findParkingDetails(final JudgeListDto dto); List findParkingJudgeTargets(final ParkingTargetDto dto) ; // Page findAll(final MinSimsa680 minSimsa680, Pageable pageable); 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 e7ee6af..7463d44 100644 --- a/src/main/java/com/xit/biz/ctgy/service/IResidentAndDisabledService.java +++ b/src/main/java/com/xit/biz/ctgy/service/IResidentAndDisabledService.java @@ -3,8 +3,10 @@ package com.xit.biz.ctgy.service; 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.MinSimsa680; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; +import org.springframework.transaction.annotation.Transactional; import javax.validation.constraints.NotNull; import java.util.List; @@ -41,19 +43,31 @@ public interface IResidentAndDisabledService { */ void saveJudgeData(GnRecallScDto entity); + /** + * 거주자 / 장애인 의견진술 심의 목록 조회 + * @param dto JudgeListDto + * @param pageable Pageable + * @return Page + */ + Page findJudges(JudgeListDto dto, Pageable pageable); + + /** + * 거주자 / 장애인 의견진술 심의등록 상세 목록 + * @param dto JudgeListDto + * @return List + */ + List findJudgeDetails(final JudgeListDto dto); + /** * 거주자 / 장애인 심의대상 목록 조회 * @param dto JufgeTargetDto * @return List */ List findJudgeTargets(final JudgeTargetDto dto) ; - void saveJudgeTargets(JudgeTargetDto dto); /** - * 거주자 / 장애인 의견진술 심의 목록 조회 - * @param dto JudgeListDto - * @param pageable Pageable - * @return Page + * 거주자 / 장애인 심의대상 목록 저장 + * @param dto JudgeTargetDto */ - Page findJudges(JudgeListDto dto, Pageable pageable); + void saveJudgeTargets(JudgeTargetDto dto); } 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 cc766bf..f84b674 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 @@ -50,14 +50,14 @@ public class ParkingService implements IParkingService { @Override @Transactional(readOnly = true) - public Page findParkings(final JudgeListDto minSimsa680GroupDto, Pageable pageable) { - return repository.findParkings(minSimsa680GroupDto, pageable); + public Page findParkings(final JudgeListDto dto, Pageable pageable) { + return repository.findParkings(dto, pageable); } @Override @Transactional(readOnly = true) - public List findParkingDetails(final JudgeListDto minSimsa680GroupDto) { - return null; //simsaRepository.findParkingDetails(minSimsa680GroupDto); + public List findParkingDetails(final JudgeListDto dto) { + return repository.findParkingDetails(dto); } @Override 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 bc47aa1..519fe4f 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 @@ -7,6 +7,7 @@ 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.entity.GnRecallSc; +import com.xit.biz.ctgy.entity.MinSimsa680; import com.xit.biz.ctgy.entity.MinSimsaUser680; import com.xit.biz.ctgy.entity.MinUserinfo; import com.xit.biz.ctgy.mapper.IResidentAndDisabledMapper; @@ -114,14 +115,6 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { } } - - @Override - public Page findJudges(JudgeListDto dto, Pageable pageable) { - - pageable = JpaUtil.getPagingInfo(pageable); - return repository.findJudges(dto, pageable); - } - @Override @Transactional(readOnly = true) public List findJudgeTargets(JudgeTargetDto dto) { @@ -177,4 +170,15 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { } } + @Override + public Page findJudges(JudgeListDto dto, Pageable pageable) { + + pageable = JpaUtil.getPagingInfo(pageable); + return repository.findJudges(dto, pageable); + } + + @Override + public List findJudgeDetails(JudgeListDto dto) { + return repository.findJudgeDetails(dto); + } } diff --git a/src/main/java/com/xit/core/util/AssertUtils.java b/src/main/java/com/xit/core/util/AssertUtils.java index e72f2e7..66f6488 100644 --- a/src/main/java/com/xit/core/util/AssertUtils.java +++ b/src/main/java/com/xit/core/util/AssertUtils.java @@ -162,7 +162,7 @@ public class AssertUtils extends Assert { throw exceptionClass.getDeclaredConstructor( String.class ).newInstance( message ); } catch (Exception e) { e.printStackTrace(); - throw new CustomBaseException("예외 처리 중 오류가 발생했습니다. "+e.getLocalizedMessage()); + throw new CustomBaseException(e.getLocalizedMessage()); } }