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