diff --git a/src/main/java/com/xit/biz/ctgy/mapper/IParkingMapper.java b/src/main/java/com/xit/biz/ctgy/mapper/IParkingMapper.java index f4c7321..7ccb39c 100644 --- a/src/main/java/com/xit/biz/ctgy/mapper/IParkingMapper.java +++ b/src/main/java/com/xit/biz/ctgy/mapper/IParkingMapper.java @@ -10,7 +10,7 @@ import java.util.Map; @Mapper public interface IParkingMapper { - void insertParkingJudgeTargetIntoSelect(ParkingTargetDto dto); + int insertParkingJudgeTargetIntoSelect(ParkingTargetDto dto); /** * 팀 && 차수 별 total diff --git a/src/main/java/com/xit/biz/ctgy/mapper/IResidentAndDisabledMapper.java b/src/main/java/com/xit/biz/ctgy/mapper/IResidentAndDisabledMapper.java index 2e8e331..355a0a7 100644 --- a/src/main/java/com/xit/biz/ctgy/mapper/IResidentAndDisabledMapper.java +++ b/src/main/java/com/xit/biz/ctgy/mapper/IResidentAndDisabledMapper.java @@ -11,7 +11,7 @@ import java.util.Map; @Mapper public interface IResidentAndDisabledMapper { - void insertJudgeTargetIntoSelect(JudgeTargetDto dto); + int insertJudgeTargetIntoSelect(JudgeTargetDto dto); /** * 팀 && 차수 별 total diff --git a/src/main/java/com/xit/biz/ctgy/repository/IRecallRepository.java b/src/main/java/com/xit/biz/ctgy/repository/IRecallRepository.java index 76f83d6..25c95d0 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IRecallRepository.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IRecallRepository.java @@ -9,6 +9,6 @@ import org.springframework.data.repository.query.Param; public interface IRecallRepository extends JpaRepository { @Modifying - @Query(value = "UPDATE #{#entityName} m SET m.rcIrTransfer = '1' WHERE m.rcCode = :msMaincode") - int updateRcIrTransfer(@Param("msMaincode")Long msMaincode); + @Query(value = "UPDATE #{#entityName} m SET m.rcIrTransfer = '1', m.rcState = '0' WHERE m.rcCode = :msMaincode") + int updateRcIrTransferAndRcState(@Param("msMaincode")Long msMaincode); } diff --git a/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java b/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java index 3f04de6..3761dcc 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IResidentAndDisabledRepositoryImpl.java @@ -252,10 +252,10 @@ public class IResidentAndDisabledRepositoryImpl implements IResidentAndDisabledR // 자료상태 : 1-접수 String stateCond = CtgyConstants.Judge.DATA_STATE_RECEIPT.getCode(); - return queryReultResidentJudgeTargets(dto.getScDatagb(), stateCond, dto.getScTransfer(), dto.getScSeq1(), dto.getScSeq2()); + return queryResidentJudgeTargets(dto.getScDatagb(), stateCond, dto.getScTransfer(), dto.getScSeq1(), dto.getScSeq2()); } - private List queryReultResidentJudgeTargets(String dataGb, String state, String transfer, Long seq1, Long seq2){ + private List queryResidentJudgeTargets(String dataGb, String state, String transfer, Long seq1, Long seq2){ return queryFactory .select(Projections.fields(JudgeTargetDto.class, gnRecallSc.scCode, diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java b/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java index 6386de9..8aa4000 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java @@ -34,19 +34,6 @@ public class ParkingService implements IParkingService { private final IParkingJudgeUserRepository parkingJudgeUserRepository; private final IParkingMapper mapper; -// @Override -// @Transactional(readOnly = true) -// public Page findAll(@Nonnull final MinSimsa680 entity, Pageable pageable) { -// pageable = JpaUtil.getPagingInfo(pageable); -// ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll() -// .withMatcher("ciTitle", contains()) -// .withMatcher("ciName", contains()); -// Example example = Example.of(entity, exampleMatcher); -// Page page = simsaRepository.findAll(example, pageable); -// // List userList = page.getContent(); -// return page; -// } - @Override @Transactional(readOnly = true) public Page findParkings(final JudgeListDto dto, Pageable pageable) { @@ -125,7 +112,7 @@ public class ParkingService implements IParkingService { dto.setMsResult("0"); isFirst = false; } - mapper.insertParkingJudgeTargetIntoSelect(dto); + if(mapper.insertParkingJudgeTargetIntoSelect(dto) == 0) throw new CustomBaseException(String.format("처리된 데이타가 있습니다[ %s ]", dto.getMmOcarno())); //--------------------------------------------------------- // 등록한 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수 @@ -174,7 +161,8 @@ public class ParkingService implements IParkingService { msMaincodes.forEach(msMaincode -> { parkingJudgeUserRepository.deleteByMsuMaincode(msMaincode); - recallRepository.updateRcIrTransfer(msMaincode); + // 전송상태 -> 미접수(1), 심의결과 -> 심의전(0) + recallRepository.updateRcIrTransferAndRcState(msMaincode); repository.deleteById(msMaincode); }); } diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/ResidentAndDisabledService.java b/src/main/java/com/xit/biz/ctgy/service/impl/ResidentAndDisabledService.java index 61fbe44..5f6cce4 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/ResidentAndDisabledService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/ResidentAndDisabledService.java @@ -143,14 +143,14 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { dto.setMsResult("0"); isFirst = false; } - residentAndDisabledMapper.insertJudgeTargetIntoSelect(dto); + if(residentAndDisabledMapper.insertJudgeTargetIntoSelect(dto) == 0) throw new CustomBaseException(String.format("처리된 데이타가 있습니다[ %s ]", dto.getScCarnum())); //--------------------------------------------------------- - // 등록한 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수 + // 등록한 심사대상 데이타 등록 상태 변경 : 미접수 -> 접수, 심의결과 : 접수 -> 심사중 //--------------------------------------------------------- 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()); + entity.setScState(CtgyConstants.Judge.DATA_STATE_JUDGE.getCode()); //JpaUtil.saveIfNullId(dto.getScCode(), repository, entity); gnReacallRepository.save(entity); @@ -250,6 +250,7 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { msMaincodes.forEach(msMaincode -> { //List judgeUsers = judgeUserRepository.findByMsuMaincode() judgeUserRepository.deleteByMsuMaincode(msMaincode); + // 전송상태 -> 미접수(1), 심의결과 -> 접수(1) gnReacallRepository.updateScTransferAndScState(dto.getMsDatagb(), msMaincode); judgeRepository.deleteById(msMaincode); }); diff --git a/src/main/resources/mybatis-mapper/biz/ctgy/parking-mapper.xml b/src/main/resources/mybatis-mapper/biz/ctgy/parking-mapper.xml index 8c30e7e..d105988 100644 --- a/src/main/resources/mybatis-mapper/biz/ctgy/parking-mapper.xml +++ b/src/main/resources/mybatis-mapper/biz/ctgy/parking-mapper.xml @@ -37,6 +37,8 @@ from tf680_recall TR join tf680_main TM on TR.rc_code = #{rcCode} and TM.mm_code = TR.rc_maincode + and TR.rc_ir_transfer = '1' + and TR.rc_state = '0' join tf680_jucha TJ on TM.mm_code = TJ.mj_code join tf680_dong TD on TJ.mj_dong = TD.do_code diff --git a/src/main/resources/mybatis-mapper/biz/ctgy/residentanddisabled-mapper.xml b/src/main/resources/mybatis-mapper/biz/ctgy/residentanddisabled-mapper.xml index c506f94..1817f3d 100644 --- a/src/main/resources/mybatis-mapper/biz/ctgy/residentanddisabled-mapper.xml +++ b/src/main/resources/mybatis-mapper/biz/ctgy/residentanddisabled-mapper.xml @@ -38,6 +38,8 @@ sc_datagb from gn_recall_sc where sc_code = #{scCode} + and sc_transfer = '1' + and sc_state = '1'