feat: 거주자의견진술 등록 반영

패키지 정리
dev
minuk926 3 years ago
parent 36555df311
commit 57015faeae

@ -6,15 +6,32 @@ import lombok.Getter;
public class CtgyConstants {
@Getter
@AllArgsConstructor
public enum Judge {
// 접수(전송) 상태
TRANSFER_NONE("1", "미접수(미전송)"),
TRANSFER_ACCEPT("2", "접수(전송)"),
// 자료상태
DATA_STATE_RECEIPT("1", "접수"),
DATA_STATE_JUDGE("2", "심사중"),
DATA_STATE_ACCEPT("1", "수용"),
DATA_STATE_NON_ACCEPT("1", "미수용"),
DATAGB_1("1", ""),
DATAGB_2("2", "")
;
private final String code;
private final String desc;
}
/**
*
*/
@Getter
@AllArgsConstructor
public enum Recall {
// 접수(전송) 상태
RC_IR_TRANSFER_NONE("1", "미접수(미전송)"),
RC_IR_TRANSFER_ACCEPT("2", "접수(전송)"),
// 민원구분
RC_GB_DECL("1", "의견진술"),
// 민원구분 : 이의신청
@ -75,16 +92,6 @@ public class CtgyConstants {
private final String desc;
}
@Getter
@AllArgsConstructor
public enum Resident {
DATAGB_1("1", ""),
DATAGB_2("2", "")
;
private final String code;
private final String desc;
}
@Getter
@AllArgsConstructor
public enum PublicBoard {

@ -1,8 +1,7 @@
package com.xit.biz.ctgy.controller;
import com.xit.biz.ctgy.dto.MinSimsa680Dto;
import com.xit.biz.ctgy.dto.MinSimsa680GroupDto;
import com.xit.biz.ctgy.dto.MinSimsaTargetDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
import com.xit.biz.ctgy.dto.struct.MinSimsa680GroupMapstruct;
import com.xit.biz.ctgy.dto.struct.MinSimsa680Mapstruct;
import com.xit.biz.ctgy.service.IParkingService;
@ -17,6 +16,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.mapstruct.factory.Mappers;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@ -44,13 +44,13 @@ public class ParkingController {
})
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findSimsas(
public ResponseEntity<? extends IRestResponse> findParkings(
@Valid
@Parameter(hidden = true)
final MinSimsa680GroupDto dto,
@Parameter(hidden = true)
final Pageable pageable) {
return RestResponse.of(service.findSimsas(dto, pageable));
return RestResponse.of(service.findParkings(dto, pageable));
}
@Operation(summary = "주정차 의견진술 심의 목록-상세" , description = "주정차 의견진술 심의 목록-상세")
@ -61,11 +61,11 @@ public class ParkingController {
@Parameter(in = ParameterIn.QUERY, name = "msuTeam", description = "팀코드", required = true, example = "002")
})
@GetMapping(value="/details", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findSimsaDetails(
public ResponseEntity<? extends IRestResponse> findParkingDetails(
@Valid
@Parameter(hidden = true)
final MinSimsa680GroupDto dto) {
return RestResponse.of(service.findSimsaDetails(dto));
return RestResponse.of(service.findParkingDetails(dto));
}
@Operation(summary = "주정차 의견진술 심의대상 조회" , description = "주정차 의견진술 심의대상 조회")
@ -75,35 +75,35 @@ 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> findSimsaTargets(@Parameter(hidden = true) final MinSimsaTargetDto dto){
return RestResponse.of(service.findSimsaTargets(dto));
public ResponseEntity<? extends IRestResponse> findParkingTargets(@Parameter(hidden = true) final ParkingTargetDto dto){
return RestResponse.of(service.findParkingTargets(dto));
}
@Operation(summary = "주정차 의견진술 심의대상 등록" , description = "주정차 의견진술 심의대상 등록")
@PostMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> saveParkinSimsaTargets(
public ResponseEntity<? extends IRestResponse> saveParkinTargets(
@Valid
@RequestBody
final MinSimsaTargetDto dto) {
return RestResponse.of(service.saveParkingSimsaTargets(dto));
final ParkingTargetDto dto) {
service.saveParkingTargets(dto);
//service.saveParkingSimsaTargets(dto);
//return RestResponse.of(HttpStatus.OK);
return RestResponse.of(HttpStatus.OK);
}
@Operation(summary = "주정차 의견진술 심의등록" , description = "주정차 의견진술 심의등록")
@Parameters({
@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")
})
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> saveParkinSimsa(
@Valid
@Parameter(hidden = true)
final MinSimsa680Dto dto) {
return RestResponse.of(service.saveParkingSimsa(mapstruct.toEntity(dto)));
}
// @Operation(summary = "주정차 의견진술 심의등록" , description = "주정차 의견진술 심의등록")
// @Parameters({
// @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")
// })
// @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<? extends IRestResponse> saveParking(
// @Valid
// @Parameter(hidden = true)
// final MinSimsa680Dto dto) {
// return RestResponse.of(service.saveParking(mapstruct.toEntity(dto)));
// }
// TODO :: 파라메터 정의 필요
// @Operation(summary = "심사(대상)자 조회" , description = "심사(대상)자 조회")

@ -1,6 +1,7 @@
package com.xit.biz.ctgy.controller;
import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.ResidentTargetDto;
import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct;
import com.xit.biz.ctgy.service.IResidentService;
import com.xit.core.api.IRestResponse;
@ -22,6 +23,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Nonnull;
import javax.validation.Valid;
@Tag(name = "ResidentController", description = "거주자의견진술 관리")
@RestController
@ -64,7 +66,29 @@ public class ResidentController {
})
@GetMapping(value = "/{scCode}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findResident(@PathVariable final Long scCode) {
return RestResponse.of(service.findResident(scCode));
return RestResponse.of(service.findResidentData(scCode));
}
@Operation(summary = "거주자 의견진술 심의대상 조회" , description = "거주자 의견진술 심의대상 조회")
@GetMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE)
@Parameters({
@Parameter(in = ParameterIn.QUERY, name = "scTransfer", description = "전송상태(미접수-1,접수-2)", required = true, example = "1"),
@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));
}
@Operation(summary = "거주자 의견진술 심의대상 등록" , description = "거주자 의견진술 심의대상 등록")
@PostMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> saveResidentTargets(
@Valid
@RequestBody
final ResidentTargetDto dto) {
service.saveResidentTargets(dto);
//service.saveParkingSimsaTargets(dto);
return RestResponse.of(HttpStatus.OK);
}
}

@ -10,12 +10,12 @@ import lombok.Setter;
import java.time.LocalDate;
import java.util.List;
@Schema(name = "MinSimsTargetDto", description = "주정차의견진술심의자료대상")
@Schema(name = "ParkingTargetDto", description = "주정차의견진술심의자료대상")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class MinSimsaTargetDto {
public class ParkingTargetDto {
@Schema(title = "메인코드", example = " ", description = "메인코드-TF680_MAIN")
private Long mmCode;

@ -0,0 +1,143 @@
package com.xit.biz.ctgy.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile;
@Schema(name = "ResidentTargetDto", description = "")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ResidentTargetDto {
@Schema(required = true, title = " ", example = " ", description = " ")
private Long scCode;
@Schema(required = true, title = " ", example = " ", description = " ")
private Long scSeq;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scCarnum;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scName;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scDong;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scContDoc;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scCdate;
@Schema(required = true, title = " ", example = " ", 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 = " ")
private String scPicad4;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scTransfer;
@Schema(required = true, title = " ", example = " ", description = " ")
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 = " ", description = " ")
private String zipcode2;
@Schema(title = " ", example = " ", description = " ")
private String scJuso;
@Schema(title = " ", example = " ", description = " ")
private String scBunji;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scContDocNm;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scIngbNm;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scTransferNm;
@Schema(required = true, title = " ", example = " ", description = " ")
private String scStateNm;
@Schema(required = false, title = "단속사진파일", example = " ", description = "단속사진파일")
private MultipartFile[] picadFiles;
@Schema(required = false, title = "진술서파일", example = " ", description = "진술서파일")
private MultipartFile[] frecadFiles;
@Schema(required = false, title = "첨부자료파일", example = " ", description = "첨부자료파일")
private MultipartFile[] contadFiles;
}

@ -1,5 +1,6 @@
package com.xit.biz.ctgy.entity;
import com.xit.biz.ctgy.CtgyConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -132,7 +133,9 @@ public class GnRecallSc {
@PrePersist
public void onPrePersist(){
this.scDatagb = "1";
this.scTransfer = CtgyConstants.Judge.TRANSFER_NONE.getCode();
this.scDatagb = CtgyConstants.Judge.DATAGB_1.getCode();
this.scState = CtgyConstants.Judge.DATA_STATE_RECEIPT.getCode();
}
@PreUpdate

@ -1,11 +1,11 @@
package com.xit.biz.ctgy.mapper;
import com.xit.biz.ctgy.dto.MinSimsaTargetDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface IParkingMapper {
void insertSimsaTargetIntoSelect(MinSimsaTargetDto dto);
void insertSimsaTargetIntoSelect(ParkingTargetDto dto);
}

@ -0,0 +1,7 @@
package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.jpa.repository.JpaRepository;
public interface IParkingRepository extends JpaRepository<MinSimsa680, Long>, IParkingRepositoryCustom {
}

@ -2,18 +2,18 @@ package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.dto.MinSimsa680GroupDto;
import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto;
import com.xit.biz.ctgy.dto.MinSimsaTargetDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
public interface ISimsaRepositoryCustom {
Page<MinSimsa680GroupDto> findSimsas(final MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findSimsaDetails(final MinSimsa680GroupDto minSimsa680GroupDto);
public interface IParkingRepositoryCustom {
Page<MinSimsa680GroupDto> findParkings(final MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findParkingDetails(final MinSimsa680GroupDto minSimsa680GroupDto);
List<MinSimsaTargetDto> findSimsaTargets(final MinSimsaTargetDto dto);
List<ParkingTargetDto> findParkingTargets(final ParkingTargetDto dto);
Page<MinSimsaReviewGroupDto> findMinSimsa680s2(Pageable pageable);

@ -10,7 +10,7 @@ import com.querydsl.jpa.impl.JPAQueryFactory;
import com.xit.biz.ctgy.CtgyConstants;
import com.xit.biz.ctgy.dto.MinSimsa680GroupDto;
import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto;
import com.xit.biz.ctgy.dto.MinSimsaTargetDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
import com.xit.biz.ctgy.entity.MinSimsa680;
import com.xit.core.util.Checks;
import lombok.RequiredArgsConstructor;
@ -28,12 +28,12 @@ import static com.xit.biz.ctgy.entity.QTf680Main.tf680Main;
import static com.xit.biz.ctgy.entity.QTf680Recall.tf680Recall;
@RequiredArgsConstructor
public class ISimsaRepositoryImpl implements ISimsaRepositoryCustom {
public class IParkingRepositoryImpl implements IParkingRepositoryCustom {
private final JPAQueryFactory queryFactory;
@Override
public Page<MinSimsa680GroupDto> findSimsas(final MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable) {
public Page<MinSimsa680GroupDto> findParkings(final MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable) {
BooleanBuilder builder = new BooleanBuilder();
if (!Checks.isEmpty(pMinSimsa680GroupDto.getMsYear())) {
@ -68,7 +68,7 @@ public class ISimsaRepositoryImpl implements ISimsaRepositoryCustom {
}
@Override
public List<MinSimsa680> findSimsaDetails(final MinSimsa680GroupDto dto) {
public List<MinSimsa680> findParkingDetails(final MinSimsa680GroupDto dto) {
BooleanBuilder builder = new BooleanBuilder();
builder.and(minSimsa680.msSdate.eq(dto.getMsSdate()));
@ -100,7 +100,7 @@ public class ISimsaRepositoryImpl implements ISimsaRepositoryCustom {
}
@Override
public List<MinSimsaTargetDto> findSimsaTargets(final MinSimsaTargetDto dto) {
public List<ParkingTargetDto> findParkingTargets(final ParkingTargetDto dto) {
BooleanBuilder builder = new BooleanBuilder();
// 과태료 코드 : 11-'주정차위반과태료 12-버스전용차로위반과태료
@ -116,9 +116,9 @@ public class ISimsaRepositoryImpl implements ISimsaRepositoryCustom {
builder.and(tf680Recall.rcSeq.lt(dto.getRcSeq2()));
List<MinSimsaTargetDto> rslt =
List<ParkingTargetDto> rslt =
queryFactory
.select(Projections.fields(MinSimsaTargetDto.class,
.select(Projections.fields(ParkingTargetDto.class,
tf680Main.mmCode,
tf680Recall.rcCode,
tf680Recall.rcSeq,

@ -9,8 +9,8 @@ public interface IResidentRepository extends JpaRepository<GnRecallSc, Long>, IR
// TODO : Ansi - sql 미사용
//@Query(value = "SELECT max(e.sc_code) + 1 FROM gn_recall_sc e, nativeQuery = true)
@Query(value = "SELECT rpad(nvl(max(e.sc_seq), :year), 10, '0') + 1 FROM gn_recall_sc e WHERE e.sc_datagb = '1' AND e.sc_seq LIKE :year||'%' ", nativeQuery = true)
Long getGnRecallScMaxScSeq(@Param("year") String year);
@Query(value = "SELECT rpad(nvl(max(e.sc_seq), :year), 10, '0') + 1 FROM gn_recall_sc e WHERE e.sc_datagb = :scDatagb AND e.sc_seq LIKE :year||'%' ", nativeQuery = true)
Long getGnRecallScMaxScSeq(@Param("year") String year, @Param("scDatagb") String scDatagb);
GnRecallSc findByScCode(final Long scCode);
}

@ -1,15 +1,9 @@
package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.MinSimsa680GroupDto;
import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto;
import com.xit.biz.ctgy.dto.MinSimsaTargetDto;
import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
public interface IResidentRepositoryCustom {
Page<GnRecallScDto> findResidentDatas(Pageable pageable);

@ -32,7 +32,7 @@ public class IResidentRepositoryImpl implements IResidentRepositoryCustom {
QueryResults<Long> scCodeList = queryFactory
.select(gnRecallSc.scCode)
.from(gnRecallSc)
.where(gnRecallSc.scDatagb.eq(CtgyConstants.Resident.DATAGB_1.getCode()))
.where(gnRecallSc.scDatagb.eq(CtgyConstants.Judge.DATAGB_1.getCode()))
.orderBy(gnRecallSc.scCode.desc())
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
@ -81,7 +81,7 @@ public class IResidentRepositoryImpl implements IResidentRepositoryCustom {
@Override
public GnRecallScDto findResident(final Long scCode) {
BooleanBuilder builder = new BooleanBuilder();
builder.and(gnRecallSc.scDatagb.eq(CtgyConstants.Resident.DATAGB_1.getCode()));
builder.and(gnRecallSc.scDatagb.eq(CtgyConstants.Judge.DATAGB_1.getCode()));
builder.and(gnRecallSc.scCode.eq(scCode));
return queryFactory
@ -134,21 +134,21 @@ public class IResidentRepositoryImpl implements IResidentRepositoryCustom {
.where(gnRecallSc.scIngb.eq(cmmCodeS.codeCd), cmmCodeS.codeGrpId.eq("TRAFFIC"),
cmmCodeS.codeLcd.eq("GANGNAM_SIMSA"),
cmmCodeS.codeMcd.eq("RC_INGB")),
"scIngbNm")
// 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("SC_TRANSFER")),
// "scTransferNm"),
// 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("SC_STATE")),
// "scStateNm")
"scIngbNm"),
ExpressionUtils.as(
JPAExpressions.select(cmmCodeS.codeNm)
.from(cmmCodeS)
.where(gnRecallSc.scTransfer.eq(cmmCodeS.codeCd), cmmCodeS.codeGrpId.eq("TRAFFIC"),
cmmCodeS.codeLcd.eq("GANGNAM_SIMSA"),
cmmCodeS.codeMcd.eq("SC_TRANSFER")),
"scTransferNm"),
ExpressionUtils.as(
JPAExpressions.select(cmmCodeS.codeNm)
.from(cmmCodeS)
.where(gnRecallSc.scState.eq(cmmCodeS.codeCd), cmmCodeS.codeGrpId.eq("TRAFFIC"),
cmmCodeS.codeLcd.eq("GANGNAM_SIMSA"),
cmmCodeS.codeMcd.eq("SC_STATE")),
"scStateNm")
))
.from(gnRecallSc)
.where(builder)

@ -1,12 +0,0 @@
package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import javax.annotation.Nonnull;
import java.time.LocalDate;
public interface ISimsaRepository extends JpaRepository<MinSimsa680, Long>, ISimsaRepositoryCustom {
}

@ -1,28 +1,26 @@
package com.xit.biz.ctgy.service;
import com.xit.biz.ctgy.dto.MinSimsa680GroupDto;
import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto;
import com.xit.biz.ctgy.dto.MinSimsaTargetDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
public interface IParkingService {
//Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680 minSimsa680, Pageable pageable);
Page<MinSimsa680GroupDto> findSimsas(final MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findSimsaDetails(final MinSimsa680GroupDto minSimsa680GroupDto);
List<MinSimsaTargetDto> findSimsaTargets(final MinSimsaTargetDto dto) ;
Page<MinSimsa680GroupDto> findParkings(final MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findParkingDetails(final MinSimsa680GroupDto minSimsa680GroupDto);
List<ParkingTargetDto> findParkingTargets(final ParkingTargetDto dto) ;
Page<MinSimsa680> findAll(final MinSimsa680 minSimsa680, Pageable pageable);
// Page<MinSimsa680> findAll(final MinSimsa680 minSimsa680, Pageable pageable);
List<MinSimsaTargetDto> saveParkingSimsaTargets(MinSimsaTargetDto dto);
void saveParkingTargets(ParkingTargetDto dto);
Page<MinSimsaReviewGroupDto> findMinSimsa680s2(final MinSimsa680 minSimsa680, Pageable pageable);
// Page<MinSimsaReviewGroupDto> findMinSimsa680s2(final MinSimsa680 minSimsa680, Pageable pageable);
MinSimsa680 saveParkingSimsa(final MinSimsa680 toEntity);
// MinSimsa680 saveParking(final MinSimsa680 toEntity);
}

@ -1,21 +1,22 @@
package com.xit.biz.ctgy.service;
import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.entity.GnRecallSc;
import com.xit.biz.ctgy.dto.ResidentTargetDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Nonnull;
import java.util.List;
public interface IResidentService {
Page<GnRecallScDto> findResidentDatas(Pageable pageable);
GnRecallScDto findResident(final Long scCode);
GnRecallScDto findResidentData(final Long scCode);
Page<GnRecallSc> findAll(final GnRecallSc entity, Pageable pageable);
//Page<GnRecallSc> findAll(final GnRecallSc entity, Pageable pageable);
void saveResidentData(GnRecallScDto entity);
List<ResidentTargetDto> findResidentTargets(final ResidentTargetDto dto) ;
void saveResidentTargets(ResidentTargetDto dto);
}

@ -2,77 +2,71 @@ package com.xit.biz.ctgy.service.impl;
import com.xit.biz.ctgy.CtgyConstants;
import com.xit.biz.ctgy.dto.MinSimsa680GroupDto;
import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto;
import com.xit.biz.ctgy.dto.MinSimsaTargetDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
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.entity.Tf680Recall;
import com.xit.biz.ctgy.mapper.IParkingMapper;
import com.xit.biz.ctgy.repository.IMinUserRepository;
import com.xit.biz.ctgy.repository.ISimsaRepository;
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.service.IParkingService;
import com.xit.core.support.jpa.JpaUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.ExampleMatcher;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.stream.Collectors;
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
@Service
@RequiredArgsConstructor
public class ParkingService implements IParkingService {
private final ISimsaRepository simsaRepository;
private final IParkingRepository simsaRepository;
private final IRecallRepository recallRepository;
private final IMinUserRepository userRepository;
private final ISimsaUserRepository simsaUserRepository;
private final IParkingMapper mapper;
@Override
@Transactional(readOnly = true)
public Page<MinSimsa680> findAll(@Nonnull final MinSimsa680 entity, Pageable pageable) {
pageable = JpaUtil.getPagingInfo(pageable);
ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll()
.withMatcher("ciTitle", contains())
.withMatcher("ciName", contains());
Example<MinSimsa680> example = Example.of(entity, exampleMatcher);
Page<MinSimsa680> page = simsaRepository.findAll(example, pageable);
// List<CmmUser> userList = page.getContent();
return page;
}
// @Override
// @Transactional(readOnly = true)
// public Page<MinSimsa680> findAll(@Nonnull final MinSimsa680 entity, Pageable pageable) {
// pageable = JpaUtil.getPagingInfo(pageable);
// ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll()
// .withMatcher("ciTitle", contains())
// .withMatcher("ciName", contains());
// Example<MinSimsa680> example = Example.of(entity, exampleMatcher);
// Page<MinSimsa680> page = simsaRepository.findAll(example, pageable);
// // List<CmmUser> userList = page.getContent();
// return page;
// }
@Override
@Transactional(readOnly = true)
public Page<MinSimsa680GroupDto> findSimsas(final MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable) {
return simsaRepository.findSimsas(minSimsa680GroupDto, pageable);
public Page<MinSimsa680GroupDto> findParkings(final MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable) {
return simsaRepository.findParkings(minSimsa680GroupDto, pageable);
}
@Override
@Transactional(readOnly = true)
public List<MinSimsa680> findSimsaDetails(final MinSimsa680GroupDto minSimsa680GroupDto) {
return simsaRepository.findSimsaDetails(minSimsa680GroupDto);
public List<MinSimsa680> findParkingDetails(final MinSimsa680GroupDto minSimsa680GroupDto) {
return simsaRepository.findParkingDetails(minSimsa680GroupDto);
}
@Override
@Transactional(readOnly = true)
public List<MinSimsaTargetDto> findSimsaTargets(MinSimsaTargetDto dto) {
return simsaRepository.findSimsaTargets(dto);
public List<ParkingTargetDto> findParkingTargets(ParkingTargetDto dto) {
return simsaRepository.findParkingTargets(dto);
}
@Override
@Transactional
public List<MinSimsaTargetDto> saveParkingSimsaTargets(MinSimsaTargetDto dto) {
public void saveParkingTargets(ParkingTargetDto dto) {
boolean isFirst = true;
for(Long rcCode : dto.getRcCodes()) {
@ -89,7 +83,7 @@ public class ParkingService implements IParkingService {
// 등록된 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수
Tf680Recall recallEntity = recallRepository.findById(dto.getRcCode()).orElseGet(Tf680Recall::new);
recallEntity.setRcIrTransfer(CtgyConstants.Recall.RC_IR_TRANSFER_ACCEPT.getCode());
recallEntity.setRcIrTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode());
JpaUtil.saveIfNullId(recallEntity.getRcCode(), recallRepository, recallEntity);
// 심사자 등록
@ -111,23 +105,18 @@ public class ParkingService implements IParkingService {
simsaUserRepository.saveAll(simsaUserList);
}
// userinfoList.stream().forEach(user => simsaRepository.save(MinSimsa680));
// simsaRepository.save
return simsaRepository.findSimsaTargets(dto);
}
@Override
@Transactional(readOnly = true)
public Page<MinSimsaReviewGroupDto> findMinSimsa680s2(MinSimsa680 minSimsa680, Pageable pageable) {
return simsaRepository.findMinSimsa680s2(pageable);
}
@Override
@Transactional
public MinSimsa680 saveParkingSimsa(MinSimsa680 entity) {
return simsaRepository.saveAndFlush(entity);
}
// @Override
// @Transactional(readOnly = true)
// public Page<MinSimsaReviewGroupDto> findMinSimsa680s2(MinSimsa680 minSimsa680, Pageable pageable) {
// return simsaRepository.findMinSimsa680s2(pageable);
// }
//
// @Override
// @Transactional
// public MinSimsa680 saveParking(MinSimsa680 entity) {
// return simsaRepository.saveAndFlush(entity);
// }
}

@ -1,7 +1,9 @@
package com.xit.biz.ctgy.service.impl;
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.struct.GnRecallScMapstruct;
import com.xit.biz.ctgy.entity.*;
import com.xit.biz.ctgy.repository.*;
@ -21,8 +23,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Objects;
import java.util.List;
@Service
@RequiredArgsConstructor
@ -53,26 +54,27 @@ public class ResidentService implements IResidentService {
@Override
@Transactional(readOnly = true)
public GnRecallScDto findResident(final Long scCode) {
public GnRecallScDto findResidentData(final Long scCode) {
GnRecallScDto dto = repository.findResident(scCode);
return repository.findResident(scCode);
}
@Override
@Transactional(readOnly = true)
public Page<GnRecallSc> findAll(final GnRecallSc entity, Pageable pageable) {
// Sort sort = Sort.by(Sort.Direction.DESC, "inCode");
pageable = JpaUtil.getPagingInfo(pageable);
// pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("inCode").descending())
ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll();
//.withMatcher("inTitle", contains())
//.withMatcher("inName", contains());
Example<GnRecallSc> example = Example.of(entity, exampleMatcher);
Page<GnRecallSc> page = repository.findAll(
example,
PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("scCode").descending()));
// List<CmmUser> userList = page.getContent();
return page;
}
// @Override
// @Transactional(readOnly = true)
// public Page<GnRecallSc> findAll(final GnRecallSc entity, Pageable pageable) {
// // Sort sort = Sort.by(Sort.Direction.DESC, "inCode");
// pageable = JpaUtil.getPagingInfo(pageable);
// // pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("inCode").descending())
// ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll();
// //.withMatcher("inTitle", contains())
// //.withMatcher("inName", contains());
// Example<GnRecallSc> example = Example.of(entity, exampleMatcher);
// Page<GnRecallSc> page = repository.findAll(
// example,
// PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("scCode").descending()));
// // List<CmmUser> userList = page.getContent();
// return page;
// }
@Override
public void saveResidentData(GnRecallScDto dto) {
@ -90,7 +92,7 @@ public class ResidentService implements IResidentService {
}
// 접수번호 채번 : 년도 + seq 10자리
dto.setScSeq(repository.getGnRecallScMaxScSeq(String.valueOf(DateUtil.getCurrentYear())));
dto.setScSeq(repository.getGnRecallScMaxScSeq(String.valueOf(DateUtil.getCurrentYear()), CtgyConstants.Judge.DATAGB_1.getCode()));
GnRecallSc entity = mapstruct.toEntity(dto);
repository.save(entity);
@ -110,4 +112,58 @@ public class ResidentService implements IResidentService {
}
}
}
@Override
@Transactional(readOnly = true)
public List<ResidentTargetDto> findResidentTargets(ResidentTargetDto dto) {
return null ;//simsaRepository.findResidentTargets(dto);
}
@Override
@Transactional
public void saveResidentTargets(ResidentTargetDto dto) {
// boolean isFirst = true;
//
// for(Long rcCode : dto.getRcCodes()) {
// dto.setRcCode(rcCode);
//
// if (isFirst) {
// dto.setMsYear(dto.getMsSdate().toString().substring(0, 4));
// dto.setMsResult("0");
// isFirst = false;
// }
//
// // 심사대상 등록
// mapper.insertSimsaTargetIntoSelect(dto);
//
// // 등록된 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수
// Tf680Recall recallEntity = recallRepository.findById(dto.getRcCode()).orElseGet(Tf680Recall::new);
// recallEntity.setRcIrTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode());
// JpaUtil.saveIfNullId(recallEntity.getRcCode(), recallRepository, recallEntity);
//
// // 심사자 등록
// List<MinUserinfo> userinfoList = userRepository.findAllByTeamAndIsenableAndAccesstype(
// dto.getMsuTeam(),
// CtgyConstants.UserInfo.ISENABLED_USE.getCode(),
// CtgyConstants.UserInfo.ACCESSTYPE_SIMSA.getCode());
//
// List<MinSimsaUser680> simsaUserList = userinfoList.stream().map(u ->
// MinSimsaUser680.builder()
// .msuMaincode(rcCode)
// .msuUserid(u.getUserid())
// .msuResult(CtgyConstants.SimsaUserInfo.MSU_RESULT_NONE.getCode())
// //.msuReason()
// .msuTeam(dto.getMsuTeam())
// //.msuIndate()
// .build()
// ).collect(Collectors.toList());
// simsaUserRepository.saveAll(simsaUserList);
//
// }
//
//
//// userinfoList.stream().forEach(user => simsaRepository.save(MinSimsa680));
//// simsaRepository.save
// return simsaRepository.findParkingTargets(dto);
}
}

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xit.biz.ctgy.mapper.IParkingMapper">
<insert id="insertSimsaTargetIntoSelect" parameterType="com.xit.biz.ctgy.dto.MinSimsaTargetDto">
<insert id="insertSimsaTargetIntoSelect" parameterType="com.xit.biz.ctgy.dto.ParkingTargetDto">
/* parking-mapper|insertSimsaTargetIntoSelect|julim */
insert
into min_simsa680(
@ -42,7 +42,7 @@
on TJ.mj_dong = TD.do_code
</insert>
<insert id="insertSimaUserinfo" parameterType="com.xit.biz.ctgy.dto.MinSimsaTargetDto">
<insert id="insertSimaUserinfo" parameterType="com.xit.biz.ctgy.dto.ParkingTargetDto">
/* parking-mapper|insertSimsaTargetIntoSelect|julim */
/*
insert

@ -26,7 +26,7 @@ import static org.junit.jupiter.api.Assertions.*;
@SpringBootTest
@Transactional
@ActiveProfiles({"dev"})
class IMinSimsa680RepositoryTest {
class IMinJudge680RepositoryTest {
@Autowired
EntityManager em;
Loading…
Cancel
Save