fix: cntc 삭제 시 ci 자료 삭제 추가

main
jhseo 8 months ago
parent c192a9c5be
commit 2e32f9d765

@ -42,6 +42,7 @@ public interface IBizSisulMapper {
int insertCntcMst(CntcDTO.SndngMst dto);
int insertCntcDetail(CntcDTO.SndngMst dto);
int deleteCi(CntcDTO.SndngMst dto);
int deleteCntcMst(CntcDTO.SndngMst dto);
int deleteCntcDetail(CntcDTO.SndngMst dto);
}

@ -1253,6 +1253,8 @@ public class BizSisulService extends AbstractService implements IBizSisulService
if(ApiConstants.SndngProcessStatus.ACCEPT.getCode().equals(cntcDto.getSndngProcessSttus())){
if(mapper.insertCntcMst(cntcDto) < 1) throw BizRuntimeException.create("접수 정보 백업(마스터) 실패");
if(mapper.deleteCntcMst(cntcDto) < 1) throw BizRuntimeException.create("접수 원본 삭제(마스터) 실패");
//CI가 없을 경우 오류 안 생기도록 처리
mapper.deleteCi(cntcDto);
if(mapper.insertCntcDetail(cntcDto) < 1) throw BizRuntimeException.create("접수 정보 백업(상세) 실패");
if(mapper.deleteCntcDetail(cntcDto) < 1) throw BizRuntimeException.create("접수 정보 삭제(상세) 실패");

@ -273,6 +273,13 @@
WHERE unity_sndng_mastr_id = #{unitySndngMastrId}
</insert>
<delete id="deleteCi">
DELETE FROM tb_ens_ci
WHERE unity_sndng_detail_id in (
SELECT unity_sndng_detail_id from tb_cntc_sndng_detail WHERE unity_sndng_mastr_id = #{unitySndngMastrId}
)
</delete>
<delete id="deleteCntcMst">
DELETE FROM tb_cntc_sndng_mastr
WHERE unity_sndng_mastr_id = #{unitySndngMastrId}

Loading…
Cancel
Save