feat: 게시판 관리 반영

dev
minuk926 3 years ago
parent 34e8471afd
commit 0afc804e2c

@ -13,6 +13,6 @@ import org.springframework.data.repository.query.Param;
import java.util.List;
public interface ICmmCodeLRepostory extends JpaRepository<CmmCodeL, CmmCodeLIds>, JpaSpecificationExecutor<CmmCodeDto> {
@Query(value = "select new com.xit.biz.cmm.dto.ComboCodeDto(c.codeCd, c.codeNm) from #{#entityName} c where c.codeGrpId = :codeGrpId and c.useYn = 'Y' order by c.codeOrdr asc")
@Query(value = "SELECT new com.xit.biz.cmm.dto.ComboCodeDto(c.codeCd, c.codeNm) FROM #{#entityName} c WHERE c.codeGrpId = :codeGrpId AND c.useYn = 'Y' ORDER BY c.codeOrdr ASC")
List<ComboCodeDto> queryComboCode(@Param("codeGrpId") String codeGrpId);
}

@ -12,6 +12,6 @@ import org.springframework.data.repository.query.Param;
import java.util.List;
public interface ICmmCodeMRepository extends JpaRepository<CmmCodeM, CmmCodeMIds>, JpaSpecificationExecutor<CmmCodeDto> {
@Query(value = "select new com.xit.biz.cmm.dto.ComboCodeDto(c.codeCd, c.codeNm) from #{#entityName} c where c.codeGrpId = :codeGrpId and c.codeLcd = :codeLcd and c.useYn = 'Y' order by c.codeOrdr asc")
@Query(value = "SELECT new com.xit.biz.cmm.dto.ComboCodeDto(c.codeCd, c.codeNm) FROM #{#entityName} c WHERE c.codeGrpId = :codeGrpId AND c.codeLcd = :codeLcd AND c.useYn = 'Y' ORDER BY c.codeOrdr ASC")
List<ComboCodeDto> queryComboCode(@Param("codeGrpId")String codeGrpId, @Param("codeLcd")String codeLcd);
}

@ -13,9 +13,9 @@ import org.springframework.data.repository.query.Param;
import java.util.List;
public interface ICmmCodeSRepository extends JpaRepository<CmmCodeS, CmmCodeSIds>, JpaSpecificationExecutor<CmmCodeDto> {
@Query(value = "select c.codeCd as code, c.codeNm as value from #{#entityName} c where c.codeGrpId = :codeGrpId and c.codeLcd = :codeLcd and c.codeMcd = :codeMcd and c.useYn = 'Y' order by c.codeOrdr asc")
@Query(value = "SELECT c.codeCd AS code, c.codeNm AS value FROM #{#entityName} c WHERE c.codeGrpId = :codeGrpId AND c.codeLcd = :codeLcd AND c.codeMcd = :codeMcd AND c.useYn = 'Y' ORDER BY c.codeOrdr ASC")
List<IComboCodeDto> queryComboCodeInterface(@Param("codeGrpId")String codeGrpId, @Param("codeLcd")String codeLcd, @Param("codeMcd")String codeMcd);
@Query(value = "select new com.xit.biz.cmm.dto.ComboCodeDto(c.codeCd, c.codeNm) from #{#entityName} c where c.codeGrpId = :codeGrpId and c.codeLcd = :codeLcd and c.codeMcd = :codeMcd and c.useYn = 'Y' order by c.codeOrdr asc")
@Query(value = "SELECT new com.xit.biz.cmm.dto.ComboCodeDto(c.codeCd, c.codeNm) FROM #{#entityName} c WHERE c.codeGrpId = :codeGrpId AND c.codeLcd = :codeLcd AND c.codeMcd = :codeMcd AND c.useYn = 'Y' ORDER BY c.codeOrdr ASC")
List<ComboCodeDto> queryComboCodeClass(@Param("codeGrpId")String codeGrpId, @Param("codeLcd")String codeLcd, @Param("codeMcd")String codeMcd);
}

@ -86,40 +86,18 @@ public class ParkingController {
@RequestBody
final ParkingTargetDto dto) {
service.saveParkingJudgeTargets(dto);
//service.saveParkingSimsaJudgeTargets(dto);
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> saveParking(
// @Valid
// @Parameter(hidden = true)
// final MinSimsa680Dto dto) {
// return RestResponse.of(service.saveParking(mapstruct.toEntity(dto)));
// }
// TODO :: 파라메터 정의 필요
// @Operation(summary = "심사(대상)자 조회" , description = "심사(대상)자 조회")
// @Parameters({
// @Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"),
// @Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10")
// })
// @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
//// @Transactional(readOnly = true)
// public ResponseEntity<? extends IRestResponse> findMinSimsa680s(
// @Parameter(hidden = true)
// final MinSimsa680Dto minSimsa680Dto,
// @Parameter(hidden = true)
// final Pageable pageable) {
// return RestResponse.of(service.findMinSimsa680s2(mapstruct.toEntity(minSimsa680Dto), pageable));
// }
@Operation(summary = "주정차 의견진술 심의 자료 삭제" , description = "주정차 의견진술 심의 자료 삭제")
@PostMapping(value="/remove", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> removeParkinJudge(
@Valid
@RequestBody
final ParkingTargetDto dto) {
service.removeParkingJudge(dto);
return RestResponse.of(HttpStatus.OK);
}
}

@ -145,4 +145,13 @@ public class ResidentAndDisabledController {
return RestResponse.of(service.findJudgeResults(dto));
}
@Operation(summary = "거주자/장애인 의견진술 심의 자료 삭제" , description = "거주자/장애인 의견진술 심의 자료 삭제")
@PostMapping(value="/remove", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> removeParkinJudge(
@Valid
@RequestBody
final JudgeListDto dto) {
service.removeJudge(dto);
return RestResponse.of(HttpStatus.OK);
}
}

@ -8,6 +8,8 @@ import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@Schema(name = "MinSimsaUser680", description = "민원심사사용자매핑")
@Table(name = "min_simsa_user680", schema = "", catalog = "")
@ -56,19 +58,11 @@ public class MinSimsaUser680 implements Serializable {
@Column(name = "msu_indate", nullable = true)
private LocalDate msuIndate;
//@JsonIgnore
// @Setter
// @ManyToOne(fetch = FetchType.LAZY)
// @JoinColumn(name = "msu_userid")
// private MinUserinfo minUserinfo;
//
// @Setter
// @ManyToOne(fetch = FetchType.LAZY)
// @JoinColumn(name = "msu_maincode")
// private MinSimsa680 minSimsa680;
/*
@PrePersist
public void onPrePersist(){
LocalDateTime localDateTime = LocalDateTime.now();
this.msuIndate = LocalDate.parse(localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
}
*/
}

@ -1,10 +1,6 @@
package com.xit.biz.ctgy.repository;
import com.xit.biz.cmm.entity.CmmUser;
import com.xit.biz.ctgy.entity.MinCivBoard680;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
@ -13,6 +9,7 @@ public interface IBoardRepository extends JpaRepository<MinCivBoard680, Long>, I
@Query(value = "SELECT max(e.ci_code) + 1 FROM min_civ_board680 e", nativeQuery = true)
Long getCiCode();
@Modifying(clearAutomatically = true)
@Query("UPDATE MinCivBoard680 m SET m.ciHit = m.ciHit + 1 WHERE m.ciCode = :ciCode")
int updateInHitForMinCivBoard680(Long ciCode);

@ -0,0 +1,17 @@
package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.entity.MinSimsa680Sc;
import com.xit.biz.ctgy.entity.Tf680Recall;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.time.LocalDate;
import java.util.List;
public interface IJudgeRepository extends JpaRepository<MinSimsa680Sc, Long> {
@Query(value = "SELECT e.msMaincode FROM #{#entityName} e WHERE e.msDatagb = :msDatagb AND e.msChasu = :msChasu AND e.msSdate >= :msSdate AND e.msEdate <= :msEdate")
List<Long> findAllMsMaincode(@Param("msDatagb") String msDatagb, @Param("msChasu") Long msChasu, @Param("msSdate") LocalDate msSdate, @Param("msEdate")LocalDate msEdate);
}

@ -2,6 +2,10 @@ package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.entity.MinSimsaUser680Sc;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
public interface IJudgeUserRepository extends JpaRepository<MinSimsaUser680Sc, Long> {
@Modifying
int deleteByMsuMaincode(Long msMaincode);
}

@ -2,6 +2,11 @@ package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.entity.MinSimsaUser680;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.transaction.annotation.Transactional;
public interface IParkingJudgeUserRepository extends JpaRepository<MinSimsaUser680, Long> {
@Modifying
int deleteByMsuMaincode(Long maincode);
}

@ -2,6 +2,15 @@ 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 java.time.LocalDate;
import java.util.List;
public interface IParkingRepository extends JpaRepository<MinSimsa680, Long>, IParkingRepositoryCustom {
@Query(value = "SELECT e.msMaincode FROM #{#entityName} e WHERE e.msChasu = :msChasu AND e.msSdate >= :msSdate AND e.msEdate <= :msEdate")
List<Long> findAllMsMaincode(@Param("msChasu") Long msChasu, @Param("msSdate")LocalDate msSdate, @Param("msEdate")LocalDate msEdate);
}

@ -2,6 +2,13 @@ package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.entity.Tf680Recall;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
public interface IRecallRepository extends JpaRepository<Tf680Recall, Long> {
@Modifying
@Query(value = "UPDATE #{#entityName} m SET m.rcIrTransfer = '1' WHERE m.rcCode = :msMaincode")
int updateRcIrTransfer(@Param("msMaincode")Long msMaincode);
}

@ -2,8 +2,10 @@ package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.entity.GnRecallSc;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;
/**
* /
@ -30,4 +32,9 @@ public interface IResidentAndDisabledRepository extends JpaRepository<GnRecallSc
* @return
*/
GnRecallSc findByScCode(final Long scCode);
//@Transactional
@Modifying
@Query(value = "UPDATE #{#entityName} m SET m.scTransfer = '1', m.scState = '1' WHERE m.scDatagb = :scDatagb AND m.scCode = :msMaincode")
int updateScTransferAndScState(@Param("scDatagb") String scDatagb, @Param("msMaincode")Long msMaincode);
}

@ -25,6 +25,8 @@ public interface IParkingService {
void saveParkingJudgeTargets(ParkingTargetDto dto);
void removeParkingJudge(final ParkingTargetDto dto);
// Page<MinSimsaReviewGroupDto> findMinSimsa680s2(final MinSimsa680 minSimsa680, Pageable pageable);
// MinSimsa680 saveParking(final MinSimsa680 toEntity);

@ -69,4 +69,6 @@ public interface IResidentAndDisabledService {
* @param dto JudgeTargetDto
*/
void saveJudgeTargets(JudgeTargetDto dto);
void removeJudge(final JudgeListDto dto);
}

@ -158,15 +158,25 @@ public class ParkingService implements IParkingService {
}
// @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. : min_simsa680 : ms_chasu, ms_sdate, ms_edate ms_maincode
* 2. : min_simsa_user680 : msu_maincode = ms_maincode
* 3. : tf680_recall : rc_ir_transfer = '1', rc_code = ms_maincode
* 4. : min_simsa680 ms_maincode = ms_maincode
* @param dto ParkingTargetDto
*/
@Override
@Transactional
public void removeParkingJudge(final ParkingTargetDto dto) {
List<Long> msMaincodes = repository.findAllMsMaincode(dto.getMsChasu(), dto.getMsSdate(), dto.getMsEdate());
msMaincodes.forEach(msMaincode -> {
parkingJudgeUserRepository.deleteByMsuMaincode(msMaincode);
recallRepository.updateRcIrTransfer(msMaincode);
repository.deleteById(msMaincode);
});
}
}

@ -8,6 +8,7 @@ import com.xit.biz.ctgy.dto.JudgeTargetDto;
import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct;
import com.xit.biz.ctgy.entity.*;
import com.xit.biz.ctgy.mapper.IResidentAndDisabledMapper;
import com.xit.biz.ctgy.repository.IJudgeRepository;
import com.xit.biz.ctgy.repository.IJudgeUserRepository;
import com.xit.biz.ctgy.repository.IMinUserRepository;
import com.xit.biz.ctgy.repository.IResidentAndDisabledRepository;
@ -53,16 +54,15 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
@Value("${file.cmm.upload.simsaPath:[simUpFile_sc1]}")
private String[] uploadPath;
private final IResidentAndDisabledRepository repository;
private final GnRecallScMapstruct mapstruct = Mappers.getMapper(GnRecallScMapstruct.class);
private final ICmmFileService fileService;
private final IResidentAndDisabledRepository gnReacallRepository;
private final IMinUserRepository userRepository;
private final IJudgeUserRepository judgeUserRepository;
private final IJudgeRepository judgeRepository;
private final IResidentAndDisabledMapper residentAndDisabledMapper;
private final ICmmFileService fileService;
private final EntityManager entityManager;
@Override
@ -70,7 +70,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
public Page<GnRecallScDto> findJudgeDatas(@NotNull final String scDatagb, Pageable pageable) {
// Sort sort = Sort.by(Sort.Direction.DESC, "inCode");
pageable = JpaUtil.getPagingInfo(pageable);
return repository.findJudgeDatas(
return gnReacallRepository.findJudgeDatas(
scDatagb,
PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("scCode").descending()));
// List<CmmUser> userList = page.getContent();
@ -79,7 +79,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
@Override
@Transactional(readOnly = true)
public GnRecallScDto findJudgeData(final Long scCode) {
return repository.findJudgeData(scCode);
return gnReacallRepository.findJudgeData(scCode);
}
@Override
@ -99,9 +99,9 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
}
// 접수번호 채번 : 년도 + seq 10자리
dto.setScSeq(repository.getGnRecallScMaxScSeq(String.valueOf(DateUtil.getCurrentYear()), CtgyConstants.Judge.DATAGB_RESIDENT.getCode()));
dto.setScSeq(gnReacallRepository.getGnRecallScMaxScSeq(String.valueOf(DateUtil.getCurrentYear()), CtgyConstants.Judge.DATAGB_RESIDENT.getCode()));
GnRecallSc entity = mapstruct.toEntity(dto);
repository.save(entity);
gnReacallRepository.save(entity);
}
@ -123,7 +123,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
@Override
@Transactional(readOnly = true)
public List<JudgeTargetDto> findJudgeTargets(JudgeTargetDto dto) {
return repository.findJudgeTargets(dto);
return gnReacallRepository.findJudgeTargets(dto);
}
@Override
@ -148,11 +148,11 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
//---------------------------------------------------------
// 등록한 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수
//---------------------------------------------------------
GnRecallSc entity = repository.findById(dto.getScCode()).orElseThrow(() -> new CustomBaseException(ErrorCode.DATA_NOT_FOUND));
GnRecallSc entity = gnReacallRepository.findById(dto.getScCode()).orElseThrow(() -> new CustomBaseException(ErrorCode.DATA_NOT_FOUND));
entity.setScTransfer(CtgyConstants.Judge.TRANSFER_ACCEPT.getCode());
//entity.setScState(CtgyConstants.Judge.DATA_STATE_JUDGE.getCode());
//JpaUtil.saveIfNullId(dto.getScCode(), repository, entity);
repository.save(entity);
gnReacallRepository.save(entity);
//---------------------------------------------------------
// 심사자 등록
@ -180,7 +180,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
public Page<JudgeListDto> findJudges(JudgeListDto dto, Pageable pageable) {
pageable = JpaUtil.getPagingInfo(pageable);
return repository.findJudges(dto, pageable);
return gnReacallRepository.findJudges(dto, pageable);
}
@Override
@ -232,4 +232,26 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
resultMap.put("judgeUserData", jurgeUserList);
return resultMap;
}
/**
*
* 1. : min_simsa680_sc : ms_datagb, ms_chasu, ms_sdate, ms_edate ms_maincode
* 2. : min_simsa_user680_sc : msu_maincode = ms_maincode
* 3. : gn_recall_sc : sc_transfer = '1', sc_state = '1', sc_code = ms_maincode
* 4. : min_simsa680_sc ms_maincode = ms_maincode
* @param dto ParkingTargetDto
*/
@Override
@Transactional
public void removeJudge(final JudgeListDto dto) {
List<Long> msMaincodes = judgeRepository.findAllMsMaincode(dto.getMsDatagb(), dto.getMsChasu(), dto.getMsSdate(), dto.getMsEdate());
msMaincodes.forEach(msMaincode -> {
//List<MinSimsaUser680Sc> judgeUsers = judgeUserRepository.findByMsuMaincode()
judgeUserRepository.deleteByMsuMaincode(msMaincode);
gnReacallRepository.updateScTransferAndScState(dto.getMsDatagb(), msMaincode);
judgeRepository.deleteById(msMaincode);
});
}
}

@ -59,13 +59,13 @@ logging:
orm:
jpa: TRACE
# hibernate sql log 출력시 변수 바인딩
hibernate:
SQL:
debug
type:
descriptor:
sql:
BasicBinder: debug
#hibernate:
# SQL:
# debug
# type:
# descriptor:
# sql:
# BasicBinder: debug
# ==================================================================================================================

Loading…
Cancel
Save