feat: 거주자심의 반영

dev
minuk926 3 years ago
parent 29fa93e2fe
commit bf04e4499e

@ -113,8 +113,6 @@ dependencies {
// implementation 'p6spy:p6spy:3.9.1'
// JPA querydsl
// compileOnly 'com.querydsl:querydsl-jpa:' + String.valueOf(queryDslVersion)
// compileOnly 'com.querydsl:querydsl-apt:' + String.valueOf(queryDslVersion)
implementation "com.querydsl:querydsl-jpa:${queryDslVersion}"
implementation "com.querydsl:querydsl-core:${queryDslVersion}"
implementation "com.querydsl:querydsl-apt:${queryDslVersion}"
@ -123,14 +121,6 @@ dependencies {
"javax.annotation:javax.annotation-api",
"com.querydsl:querydsl-apt:${queryDslVersion}:jpa")
// JPA mapstruct : lombok - lombok
// implementation 'org.projectlombok:lombok-mapstruct-binding:0.2.0'
// implementation 'org.projectlombok:lombok'
// implementation 'org.mapstruct:mapstruct:1.4.2.Final'
// annotationProcessor "org.projectlombok:lombok-mapstruct-binding:0.2.0"
// annotationProcessor 'org.projectlombok:lombok'
// annotationProcessor 'org.mapstruct:mapstruct-processor:1.4.2.Final'
// JPA mapstruct : lombok - mapstruct
// target class @Builder + setter Mapper Generation
// @NoArgsConstructor, @Setter

@ -15,11 +15,12 @@ public class CtgyConstants {
// 자료상태
DATA_STATE_RECEIPT("1", "접수"),
DATA_STATE_JUDGE("2", "심사중"),
DATA_STATE_ACCEPT("1", "수용"),
DATA_STATE_NON_ACCEPT("1", "미수용"),
DATA_STATE_ACCEPT("3", "수용"),
DATA_STATE_NON_ACCEPT("4", "미수용"),
DATAGB_1("1", ""),
DATAGB_2("2", "")
// 데이타구분
DATAGB_RESIDENT("1", "거주자"),
DATAGB_DISABLED("2", "장애인")
;
private final String code;
private final String desc;

@ -1,8 +1,8 @@
package com.xit.biz.ctgy.controller;
import com.xit.biz.ctgy.dto.SimsaListDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
import com.xit.biz.ctgy.dto.struct.MinSimsa680GroupMapstruct;
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.api.IRestResponse;
@ -33,7 +33,7 @@ public class ParkingController {
private final IParkingService service;
private final MinSimsa680Mapstruct mapstruct = Mappers.getMapper(MinSimsa680Mapstruct.class);
private final MinSimsa680GroupMapstruct groupMapstruct = Mappers.getMapper(MinSimsa680GroupMapstruct.class);
private final JudgeListMapstruct groupMapstruct = Mappers.getMapper(JudgeListMapstruct.class);
@Operation(summary = "주정차 의견진술 심의 목록" , description = "주정차 의견진술 심의 목록")
@Parameters({
@ -47,7 +47,7 @@ public class ParkingController {
public ResponseEntity<? extends IRestResponse> findParkings(
@Valid
@Parameter(hidden = true)
final SimsaListDto dto,
final JudgeListDto dto,
@Parameter(hidden = true)
final Pageable pageable) {
return RestResponse.of(service.findParkings(dto, pageable));
@ -64,7 +64,7 @@ public class ParkingController {
public ResponseEntity<? extends IRestResponse> findParkingDetails(
@Valid
@Parameter(hidden = true)
final SimsaListDto dto) {
final JudgeListDto dto) {
return RestResponse.of(service.findParkingDetails(dto));
}
@ -75,18 +75,18 @@ public class ParkingController {
@Parameter(in = ParameterIn.QUERY, name = "rcSeq1", description = "접수번호-시작", required = true, example = "2022200801"),
@Parameter(in = ParameterIn.QUERY, name = "rcSeq2", description = "접수번호-종료", required = true, example = "2022200899"),
})
public ResponseEntity<? extends IRestResponse> findParkingTargets(@Parameter(hidden = true) final ParkingTargetDto dto){
return RestResponse.of(service.findParkingTargets(dto));
public ResponseEntity<? extends IRestResponse> findParkingJudgeTargets(@Parameter(hidden = true) final ParkingTargetDto dto){
return RestResponse.of(service.findParkingJudgeTargets(dto));
}
@Operation(summary = "주정차 의견진술 심의대상 등록" , description = "주정차 의견진술 심의대상 등록")
@PostMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> saveParkinTargets(
public ResponseEntity<? extends IRestResponse> saveParkinJudgeTargets(
@Valid
@RequestBody
final ParkingTargetDto dto) {
service.saveParkingTargets(dto);
//service.saveParkingSimsaTargets(dto);
service.saveParkingJudgeTargets(dto);
//service.saveParkingSimsaJudgeTargets(dto);
return RestResponse.of(HttpStatus.OK);
}

@ -1,9 +1,8 @@
package com.xit.biz.ctgy.controller;
import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.ResidentDto;
import com.xit.biz.ctgy.dto.ResidentTargetDto;
import com.xit.biz.ctgy.dto.SimsaListDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct;
import com.xit.biz.ctgy.service.IResidentService;
import com.xit.core.api.IRestResponse;
@ -78,18 +77,18 @@ public class ResidentController {
@Parameter(in = ParameterIn.QUERY, name = "scSeq1", description = "접수번호-시작", required = true, example = "2022200801"),
@Parameter(in = ParameterIn.QUERY, name = "scSeq2", description = "접수번호-종료", required = true, example = "2022200899"),
})
public ResponseEntity<? extends IRestResponse> findResidentTargets(@Parameter(hidden = true) final ResidentTargetDto dto){
return RestResponse.of(service.findResidentTargets(dto));
public ResponseEntity<? extends IRestResponse> findResidentJudgeTargets(@Parameter(hidden = true) final ResidentTargetDto dto){
return RestResponse.of(service.findResidentJudgeTargets(dto));
}
@Operation(summary = "거주자 의견진술 심의대상 등록" , description = "거주자 의견진술 심의대상 등록")
@PostMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> saveResidentTargets(
public ResponseEntity<? extends IRestResponse> saveResidentJudgeTargets(
@Valid
@RequestBody
final ResidentTargetDto dto) {
service.saveResidentTargets(dto);
//service.saveParkingSimsaTargets(dto);
service.saveResidentJudgeTargets(dto);
//service.saveParkingSimsaJudgeTargets(dto);
return RestResponse.of(HttpStatus.OK);
}
@ -105,7 +104,7 @@ public class ResidentController {
public ResponseEntity<? extends IRestResponse> findResidents(
@Valid
@Parameter(hidden = true)
final SimsaListDto dto,
final JudgeListDto dto,
@Parameter(hidden = true)
final Pageable pageable) {
return RestResponse.of(service.findResidents(dto, pageable));

@ -6,13 +6,12 @@ import lombok.*;
import javax.validation.constraints.Size;
import java.sql.Date;
@Schema(name = "MinSimsa680GroupDto", description = "심의목록 조회: 주정차/거주자/장애인")
@Schema(name = "JudgeListDto", description = "심의목록 조회: 주정차/거주자/장애인")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SimsaListDto {
public class JudgeListDto {
@Schema(required = true, title = "심사년도", example = "2021", description = "심사년도")
@Size(min = 4, max = 4)
private String msYear;

@ -1,19 +1,12 @@
package com.xit.biz.ctgy.dto;
import com.xit.biz.ctgy.entity.MinSimsaUser680;
import com.xit.biz.ctgy.entity.Tf680Recall;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.*;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
@Schema(name = "MinSimsa680Dto", description = "민원심사")
@Schema(name = "JudgeDto", description = "민원심사")
@Getter
@Setter
@AllArgsConstructor
@ -24,17 +17,6 @@ public class MinSimsa680Dto {
@Schema(required = true, title = "민원코드", example = " ", description = "민원코드")
private Long msMaincode;
// private Tf680Recall tf680Recall;
// private final Set<MinSimsaUser680> minSimsaUser680s = new HashSet<>();
@Schema(required = true, title = "접수번호", example = " ", description = "Input Description...")
private String msSeq;
@ -74,4 +56,7 @@ public class MinSimsa680Dto {
@Schema(required = false, title = "단속시간", example = " ", description = "Input Description...")
private String msJbtime;
@Schema(title = "데이타구분", example = "1", description = "데이타구분: 1-거주자,2-장애인")
private String msDatagb;
}

@ -1,19 +0,0 @@
package com.xit.biz.ctgy.dto;
import com.querydsl.core.annotations.QueryProjection;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.sql.Date;
@Schema(name = "MinSimsaReviewGroupDto", description = "심사자 조회")
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class MinSimsaReviewGroupDto {
private Date msEdate;
private String msuTeam;
private String name;
private Long clcnt;
private Long totcnt;
}

@ -1,5 +1,6 @@
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;
@ -7,137 +8,87 @@ import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile;
import java.time.LocalDate;
import java.util.List;
@Schema(name = "ResidentTargetDto", description = "")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ResidentTargetDto {
@Schema(required = true, title = " ", example = " ", description = " ")
@Schema(title = "메인코드", example = " ", description = "메인코드")
private Long scCode;
@Schema(required = true, title = " ", example = " ", description = " ")
@Schema(title = "접수번호", example = " ", description = "접수번호")
private Long scSeq;
@Schema(required = true, title = " ", example = " ", description = " ")
@Schema(title = "차량번호", example = " ", description = "차량번호")
private String scCarnum;
@Schema(required = true, title = " ", example = " ", description = " ")
@Schema(title = "이름", example = " ", description = "")
private String scName;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scDong;
@Schema(required = true, title = " ", example = " ", description = " ")
@Schema(title = "진술유형코드", example = " ", description = "Input Description...")
private String scContDoc;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scCdate;
@Schema(title = "진술유형코드명", example = " ", description = "Input Description...")
private String scContDocNm;
@Schema(required = true, title = " ", example = " ", description = " ")
@Schema(title = "접수방법코드", example = " ", description = "Input Description...")
private String scIngb;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scWdate;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scJbtime;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scPos;
@Schema(title = " ", example = " ", description = " ")
private String scFrecad1;
@Schema(title = " ", example = " ", description = " ")
private String scFrecad2;
@Schema(title = " ", example = " ", description = " ")
private String scFrecad3;
@Schema(title = " ", example = " ", description = " ")
private String scFrecad4;
@Schema(title = " ", example = " ", description = " ")
private String scContad1;
@Schema(title = " ", example = " ", description = " ")
private String scContad2;
@Schema(title = " ", example = " ", description = " ")
private String scContad3;
@Schema(title = " ", example = " ", description = " ")
private String scContad4;
@Schema(title = " ", example = " ", description = " ")
private String scContad5;
@Schema(title = " ", example = " ", description = " ")
private String scContad6;
@Schema(title = " ", example = " ", description = " ")
private String scContad7;
@Schema(title = " ", example = " ", description = " ")
private String scContad8;
@Schema(title = " ", example = " ", description = " ")
private String scPicad1;
@Schema(title = " ", example = " ", description = " ")
private String scPicad2;
@Schema(title = " ", example = " ", description = " ")
private String scPicad3;
@Schema(title = "접수방법코드명", example = " ", description = "Input Description...")
private String scIngbNm;
@Schema(title = " ", example = " ", description = " ")
private String scPicad4;
@Schema(title = "접수일자", example = " ", description = "Input Description...")
private String scCdate;
@Schema(required = true, title = " ", example = " ", description = " ")
@Schema(title = "전송상태-심사", example = "1", description = "전송상태-1:미전송(미심사), 2:전송(심사)")
private String scTransfer;
@Schema(required = true, title = " ", example = " ", description = " ")
@Schema(title = "데이타구분", example = "1", description = "데이타구분: 1-거주자,2-장애인")
private String scDatagb;
@Schema(title = " ", example = " ", description = " ")
private String scAnswer;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scState;
@Schema(title = " ", example = " ", description = " ")
private String zipcode1;
//------------------------------------------------------------------
// 심사대상 저장을 위한 속성
//------------------------------------------------------------------
@Schema(title = "심사시작일", example = "2022-03-23", description = "Input Description...")
@JsonFormat(pattern="yyyy-MM-dd")
private LocalDate msSdate;
@Schema(title = " ", example = " ", description = " ")
private String zipcode2;
@Schema(title = "심사시작시간", example = " ", description = "Input Description...")
private String msStartsi;
@Schema(title = " ", example = " ", description = " ")
private String scJuso;
@Schema(title = "심사종료일", example = "2022-03-24", description = "Input Description...")
@JsonFormat(pattern="yyyy-MM-dd")
private LocalDate msEdate;
@Schema(title = " ", example = " ", description = " ")
private String scBunji;
@Schema(title = "심사마감일", example = "2022-03-25", description = "Input Description...")
@JsonFormat(pattern="yyyy-MM-dd")
private LocalDate msCdate;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scContDocNm;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scIngbNm;
@Schema(title = "심사마감시간", example = " ", description = "Input Description...")
private String msClosesi;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scTransferNm;
@Schema(title = "접수번호", example = " ", description = "Input Description...")
private Long scSeq1;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scStateNm;
@Schema(title = "접수번호", example = " ", description = "Input Description...")
private Long scSeq2;
@Schema(required = false, title = "단속사진파일", example = " ", description = "단속사진파일")
private MultipartFile[] picadFiles;
@Schema(title = "민원코드목록", example = " ", description = "등록할 민원코드목록")
private List<Long> scCodes;
@Schema(required = false, title = "진술서파일", example = " ", description = "진술서파일")
private MultipartFile[] frecadFiles;
@Schema(title = "년도", example = "2022", description = "년도(심사시작일기준)")
private String msYear;
@Schema(required = false, title = "첨부자료파일", example = " ", description = "첨부자료파일")
private MultipartFile[] contadFiles;
@Schema(title = "결과코드", example = "0", description = "결과코드")
private String msResult;
@Schema(title = "", example = "0", description = "결과코드")
private Long msChasu;
@Schema(title = "팀코드", example = "001", description = "팀코드")
private String msuTeam;
}

@ -1,9 +1,7 @@
package com.xit.biz.ctgy.dto.struct;
import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.MinSimsa680Dto;
import com.xit.biz.ctgy.entity.GnRecallSc;
import com.xit.biz.ctgy.entity.MinSimsa680;
import com.xit.core.support.jpa.mapstruct.IMapstruct;
import com.xit.core.support.jpa.mapstruct.MapStructMapperConfig;
import org.mapstruct.Mapper;

@ -1,12 +1,12 @@
package com.xit.biz.ctgy.dto.struct;
import com.xit.biz.ctgy.dto.SimsaListDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.entity.MinSimsa680;
import com.xit.core.support.jpa.mapstruct.IMapstruct;
import com.xit.core.support.jpa.mapstruct.MapStructMapperConfig;
import org.mapstruct.Mapper;
@Mapper(config = MapStructMapperConfig.class)
public interface MinSimsa680GroupMapstruct extends IMapstruct<SimsaListDto, MinSimsa680> {
public interface JudgeListMapstruct extends IMapstruct<JudgeListDto, MinSimsa680> {
}

@ -135,7 +135,7 @@ public class GnRecallSc {
@PrePersist
public void onPrePersist(){
this.scTransfer = CtgyConstants.Judge.TRANSFER_NONE.getCode();
this.scDatagb = CtgyConstants.Judge.DATAGB_1.getCode();
this.scDatagb = CtgyConstants.Judge.DATAGB_RESIDENT.getCode();
this.scState = CtgyConstants.Judge.DATA_STATE_RECEIPT.getCode();
}

@ -3,5 +3,5 @@ package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.entity.MinSimsaUser680;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ISimsaUserRepository extends JpaRepository<MinSimsaUser680, Long> {
public interface IJudgeUserRepository extends JpaRepository<MinSimsaUser680, Long> {
}

@ -1,7 +1,6 @@
package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.dto.SimsaListDto;
import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.domain.Page;
@ -10,11 +9,11 @@ import org.springframework.data.domain.Pageable;
import java.util.List;
public interface IParkingRepositoryCustom {
Page<SimsaListDto> findParkings(final SimsaListDto pMinSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findParkingDetails(final SimsaListDto minSimsa680GroupDto);
Page<JudgeListDto> findParkings(final JudgeListDto dto, Pageable pageable);
//List<MinSimsa680> findParkingDetails(final JudgeListDto minSimsa680GroupDto);
List<ParkingTargetDto> findParkingTargets(final ParkingTargetDto dto);
List<ParkingTargetDto> findParkingJudgeTargets(final ParkingTargetDto dto);
Page<MinSimsaReviewGroupDto> findMinSimsa680s2(Pageable pageable);
//Page<MinSimsaReviewGroupDto> findMinSimsa680s2(Pageable pageable);
}

@ -4,14 +4,11 @@ import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.QueryResults;
import com.querydsl.core.types.ExpressionUtils;
import com.querydsl.core.types.Projections;
import com.querydsl.core.types.dsl.CaseBuilder;
import com.querydsl.jpa.JPAExpressions;
import com.querydsl.jpa.impl.JPAQueryFactory;
import com.xit.biz.ctgy.CtgyConstants;
import com.xit.biz.ctgy.dto.SimsaListDto;
import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto;
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;
@ -22,8 +19,6 @@ 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;
@ -33,7 +28,7 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom {
private final JPAQueryFactory queryFactory;
@Override
public Page<SimsaListDto> findParkings(final SimsaListDto dto, Pageable pageable) {
public Page<JudgeListDto> findParkings(final JudgeListDto dto, Pageable pageable) {
BooleanBuilder builder = new BooleanBuilder();
if (!Checks.isEmpty(dto.getMsYear())) {
@ -42,10 +37,10 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom {
if (!Checks.isEmpty(dto.getMsChasu())) {
builder.and(minSimsa680.msChasu.like(String.valueOf(dto.getMsChasu())));
}
QueryResults<SimsaListDto> rslt =
QueryResults<JudgeListDto> rslt =
queryFactory
.select(Projections.fields(
SimsaListDto.class,
JudgeListDto.class,
minSimsa680.msYear,
minSimsa680.msChasu,
minSimsa680.msSdate,
@ -67,40 +62,40 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom {
return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal());
}
@Override
public List<MinSimsa680> findParkingDetails(final SimsaListDto 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<MinSimsa680> 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<MinSimsa680> 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<MinSimsa680> 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<ParkingTargetDto> findParkingTargets(final ParkingTargetDto dto) {
public List<ParkingTargetDto> findParkingJudgeTargets(final ParkingTargetDto dto) {
BooleanBuilder builder = new BooleanBuilder();
// 과태료 코드 : 11-'주정차위반과태료 12-버스전용차로위반과태료
@ -153,42 +148,42 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom {
return rslt;
}
@Override
public Page<MinSimsaReviewGroupDto> 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<Long> rsltEa = new CaseBuilder()
// @Override
// public Page<MinSimsaReviewGroupDto> 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<Long> rsltEa = new CaseBuilder()
//// .when(minSimsaUser680.msuResult.eq("0")).then(0L)
//// .otherwise(1L).sum().as("clcnt");
// QueryResults<MinSimsaReviewGroupDto> 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");
QueryResults<MinSimsaReviewGroupDto> 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();
return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal());
}
// .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();
//
// return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal());
// }
}

@ -1,15 +1,20 @@
package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.SimsaListDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.ResidentTargetDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
public interface IResidentRepositoryCustom {
Page<GnRecallScDto> findResidentDatas(Pageable pageable);
GnRecallScDto findResident(final Long scCode);
Page<SimsaListDto> findResidents(SimsaListDto dto, Pageable pageable);
Page<JudgeListDto> findResidents(JudgeListDto dto, Pageable pageable);
List<ResidentTargetDto> findResidentJudgeTargets(final ResidentTargetDto dto);
}

@ -4,12 +4,12 @@ import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.QueryResults;
import com.querydsl.core.types.ExpressionUtils;
import com.querydsl.core.types.Projections;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.jpa.JPAExpressions;
import com.querydsl.jpa.impl.JPAQueryFactory;
import com.xit.biz.ctgy.CtgyConstants;
import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.SimsaListDto;
import com.xit.biz.ctgy.dto.ResidentDto;
import com.xit.biz.ctgy.dto.*;
import com.xit.biz.ctgy.entity.GnRecallSc;
import com.xit.core.util.Checks;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
@ -22,6 +22,8 @@ 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.QMinSimsa680Sc.minSimsa680Sc;
import static com.xit.biz.ctgy.entity.QTf680Main.tf680Main;
import static com.xit.biz.ctgy.entity.QTf680Recall.tf680Recall;
@RequiredArgsConstructor
public class IResidentRepositoryImpl implements IResidentRepositoryCustom {
@ -35,7 +37,7 @@ public class IResidentRepositoryImpl implements IResidentRepositoryCustom {
QueryResults<Long> scCodeList = queryFactory
.select(gnRecallSc.scCode)
.from(gnRecallSc)
.where(gnRecallSc.scDatagb.eq(CtgyConstants.Judge.DATAGB_1.getCode()))
.where(gnRecallSc.scDatagb.eq(CtgyConstants.Judge.DATAGB_RESIDENT.getCode()))
.orderBy(gnRecallSc.scCode.desc())
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
@ -84,7 +86,7 @@ public class IResidentRepositoryImpl implements IResidentRepositoryCustom {
@Override
public GnRecallScDto findResident(final Long scCode) {
BooleanBuilder builder = new BooleanBuilder();
builder.and(gnRecallSc.scDatagb.eq(CtgyConstants.Judge.DATAGB_1.getCode()));
builder.and(gnRecallSc.scDatagb.eq(CtgyConstants.Judge.DATAGB_RESIDENT.getCode()));
builder.and(gnRecallSc.scCode.eq(scCode));
return queryFactory
@ -171,7 +173,7 @@ AND SC_CODE =
}
@Override
public Page<SimsaListDto> findResidents(final SimsaListDto dto, Pageable pageable) {
public Page<JudgeListDto> findResidents(final JudgeListDto dto, Pageable pageable) {
BooleanBuilder builder = new BooleanBuilder();
if (!Checks.isEmpty(dto.getMsYear())) {
@ -183,10 +185,10 @@ AND SC_CODE =
if (!Checks.isEmpty(dto.getMsDatagb())) {
builder.and(minSimsa680Sc.msDatagb.eq(dto.getMsDatagb()));
}
QueryResults<SimsaListDto> rslt =
QueryResults<JudgeListDto> rslt =
queryFactory
.select(Projections.fields(
SimsaListDto.class,
JudgeListDto.class,
minSimsa680Sc.msYear,
minSimsa680Sc.msChasu,
minSimsa680Sc.msSdate,
@ -199,7 +201,7 @@ AND SC_CODE =
))
.from(minSimsa680Sc)
.where(builder)
.groupBy(minSimsa680Sc.msYear, minSimsa680Sc.msChasu, minSimsa680Sc.msSdate, minSimsa680Sc.msStartsi, minSimsa680Sc.msEdate, minSimsa680Sc.msCdate, minSimsa680Sc.msClosesi)
.groupBy(minSimsa680Sc.msYear, minSimsa680Sc.msDatagb, minSimsa680Sc.msChasu, minSimsa680Sc.msSdate, minSimsa680Sc.msStartsi, minSimsa680Sc.msEdate, minSimsa680Sc.msCdate, minSimsa680Sc.msClosesi)
.orderBy(minSimsa680Sc.msYear.desc(), minSimsa680Sc.msChasu.desc())
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
@ -208,4 +210,71 @@ AND SC_CODE =
return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal());
}
@Override
public List<ResidentTargetDto> findResidentJudgeTargets(final ResidentTargetDto dto) {
// 데이타구분 : 1-거주자 2-장애인
String dataGbCond = CtgyConstants.Judge.DATAGB_RESIDENT.getCode();
// 자료상태 : 1-접수
String stateCond = CtgyConstants.Judge.DATA_STATE_RECEIPT.getCode();
return queryReultResidentJudgeTargets(dataGbCond, stateCond, dto.getScTransfer(), dto.getScSeq1(), dto.getScSeq2());
}
private List<ResidentTargetDto> queryReultResidentJudgeTargets(String dataGb, String state, String transfer, Long seq1, Long seq2){
return queryFactory
.select(Projections.fields(ResidentTargetDto.class,
gnRecallSc.scCode,
gnRecallSc.scSeq,
gnRecallSc.scCarnum,
gnRecallSc.scName,
gnRecallSc.scContDoc,
gnRecallSc.scIngb,
gnRecallSc.scCdate,
ExpressionUtils.as(
JPAExpressions.select(cmmCodeS.codeNm)
.from(cmmCodeS)
.where(gnRecallSc.scContDoc.eq(cmmCodeS.codeCd),cmmCodeS.codeGrpId.eq("TRAFFIC"),
cmmCodeS.codeLcd.eq("GANGNAM_SIMSA"),
cmmCodeS.codeMcd.eq("RC_CONT_DOC")),
"rcContDocNm"),
ExpressionUtils.as(
JPAExpressions.select(cmmCodeS.codeNm)
.from(cmmCodeS)
.where(gnRecallSc.scIngb.eq(cmmCodeS.codeCd),cmmCodeS.codeGrpId.eq("TRAFFIC"),
cmmCodeS.codeLcd.eq("GANGNAM_SIMSA"),
cmmCodeS.codeMcd.eq("RC_INGB")),
"rcIngbNm")
))
.from(gnRecallSc)
.where(datagbEq(dataGb), stateEq(state), transferEq(transfer), seqGt(seq1), seqLt(seq2))
.orderBy(gnRecallSc.scSeq.asc())
.fetch();
}
private BooleanExpression datagbEq(String dataGb){
if(Checks.isEmpty(dataGb)) return null;
return gnRecallSc.scDatagb.eq(dataGb);
}
private BooleanExpression stateEq(String state){
if(Checks.isEmpty(state)) return null;
return gnRecallSc.scState.eq(state);
}
private BooleanExpression transferEq(String transfer){
if(Checks.isEmpty(transfer)) return null;
return gnRecallSc.scTransfer.eq(transfer);
}
private BooleanExpression seqGt(Long seq){
if(Checks.isEmpty(seq)) return null;
return gnRecallSc.scSeq.gt(seq);
}
private BooleanExpression seqLt(Long seq){
if(Checks.isEmpty(seq)) return null;
return gnRecallSc.scSeq.lt(seq);
}
}

@ -1,6 +1,6 @@
package com.xit.biz.ctgy.service;
import com.xit.biz.ctgy.dto.SimsaListDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.domain.Page;
@ -11,13 +11,13 @@ import java.util.List;
public interface IParkingService {
//Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680 minSimsa680, Pageable pageable);
Page<SimsaListDto> findParkings(final SimsaListDto minSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findParkingDetails(final SimsaListDto minSimsa680GroupDto);
List<ParkingTargetDto> findParkingTargets(final ParkingTargetDto dto) ;
Page<JudgeListDto> findParkings(final JudgeListDto minSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findParkingDetails(final JudgeListDto minSimsa680GroupDto);
List<ParkingTargetDto> findParkingJudgeTargets(final ParkingTargetDto dto) ;
// Page<MinSimsa680> findAll(final MinSimsa680 minSimsa680, Pageable pageable);
void saveParkingTargets(ParkingTargetDto dto);
void saveParkingJudgeTargets(ParkingTargetDto dto);
// Page<MinSimsaReviewGroupDto> findMinSimsa680s2(final MinSimsa680 minSimsa680, Pageable pageable);

@ -1,9 +1,8 @@
package com.xit.biz.ctgy.service;
import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.ResidentDto;
import com.xit.biz.ctgy.dto.ResidentTargetDto;
import com.xit.biz.ctgy.dto.SimsaListDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@ -19,8 +18,8 @@ public interface IResidentService {
void saveResidentData(GnRecallScDto entity);
List<ResidentTargetDto> findResidentTargets(final ResidentTargetDto dto) ;
void saveResidentTargets(ResidentTargetDto dto);
List<ResidentTargetDto> findResidentJudgeTargets(final ResidentTargetDto dto) ;
void saveResidentJudgeTargets(ResidentTargetDto dto);
Page<SimsaListDto> findResidents(SimsaListDto dto, Pageable pageable);
Page<JudgeListDto> findResidents(JudgeListDto dto, Pageable pageable);
}

@ -1,7 +1,7 @@
package com.xit.biz.ctgy.service.impl;
import com.xit.biz.ctgy.CtgyConstants;
import com.xit.biz.ctgy.dto.SimsaListDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
import com.xit.biz.ctgy.entity.MinSimsa680;
import com.xit.biz.ctgy.entity.MinSimsaUser680;
@ -11,7 +11,7 @@ import com.xit.biz.ctgy.mapper.IParkingMapper;
import com.xit.biz.ctgy.repository.IMinUserRepository;
import com.xit.biz.ctgy.repository.IParkingRepository;
import com.xit.biz.ctgy.repository.IRecallRepository;
import com.xit.biz.ctgy.repository.ISimsaUserRepository;
import com.xit.biz.ctgy.repository.IJudgeUserRepository;
import com.xit.biz.ctgy.service.IParkingService;
import com.xit.core.support.jpa.JpaUtil;
import lombok.RequiredArgsConstructor;
@ -30,7 +30,7 @@ public class ParkingService implements IParkingService {
private final IParkingRepository simsaRepository;
private final IRecallRepository recallRepository;
private final IMinUserRepository userRepository;
private final ISimsaUserRepository simsaUserRepository;
private final IJudgeUserRepository simsaUserRepository;
private final IParkingMapper mapper;
// @Override
@ -48,25 +48,25 @@ public class ParkingService implements IParkingService {
@Override
@Transactional(readOnly = true)
public Page<SimsaListDto> findParkings(final SimsaListDto minSimsa680GroupDto, Pageable pageable) {
public Page<JudgeListDto> findParkings(final JudgeListDto minSimsa680GroupDto, Pageable pageable) {
return simsaRepository.findParkings(minSimsa680GroupDto, pageable);
}
@Override
@Transactional(readOnly = true)
public List<MinSimsa680> findParkingDetails(final SimsaListDto minSimsa680GroupDto) {
return simsaRepository.findParkingDetails(minSimsa680GroupDto);
public List<MinSimsa680> findParkingDetails(final JudgeListDto minSimsa680GroupDto) {
return null; //simsaRepository.findParkingDetails(minSimsa680GroupDto);
}
@Override
@Transactional(readOnly = true)
public List<ParkingTargetDto> findParkingTargets(ParkingTargetDto dto) {
return simsaRepository.findParkingTargets(dto);
public List<ParkingTargetDto> findParkingJudgeTargets(ParkingTargetDto dto) {
return simsaRepository.findParkingJudgeTargets(dto);
}
@Override
@Transactional
public void saveParkingTargets(ParkingTargetDto dto) {
public void saveParkingJudgeTargets(ParkingTargetDto dto) {
boolean isFirst = true;
for(Long rcCode : dto.getRcCodes()) {

@ -4,7 +4,7 @@ import com.xit.biz.cmm.service.ICmmFileService;
import com.xit.biz.ctgy.CtgyConstants;
import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.ResidentTargetDto;
import com.xit.biz.ctgy.dto.SimsaListDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct;
import com.xit.biz.ctgy.entity.*;
import com.xit.biz.ctgy.repository.*;
@ -93,7 +93,7 @@ public class ResidentService implements IResidentService {
}
// 접수번호 채번 : 년도 + seq 10자리
dto.setScSeq(repository.getGnRecallScMaxScSeq(String.valueOf(DateUtil.getCurrentYear()), CtgyConstants.Judge.DATAGB_1.getCode()));
dto.setScSeq(repository.getGnRecallScMaxScSeq(String.valueOf(DateUtil.getCurrentYear()), CtgyConstants.Judge.DATAGB_RESIDENT.getCode()));
GnRecallSc entity = mapstruct.toEntity(dto);
repository.save(entity);
@ -116,20 +116,20 @@ public class ResidentService implements IResidentService {
@Override
public Page<SimsaListDto> findResidents(SimsaListDto dto, Pageable pageable) {
public Page<JudgeListDto> findResidents(JudgeListDto dto, Pageable pageable) {
pageable = JpaUtil.getPagingInfo(pageable);
return repository.findResidents(dto, pageable);
}
@Override
@Transactional(readOnly = true)
public List<ResidentTargetDto> findResidentTargets(ResidentTargetDto dto) {
return null ;//simsaRepository.findResidentTargets(dto);
public List<ResidentTargetDto> findResidentJudgeTargets(ResidentTargetDto dto) {
return repository.findResidentJudgeTargets(dto);
}
@Override
@Transactional
public void saveResidentTargets(ResidentTargetDto dto) {
public void saveResidentJudgeTargets(ResidentTargetDto dto) {
// boolean isFirst = true;
//
// for(Long rcCode : dto.getRcCodes()) {

Loading…
Cancel
Save