feat: 접수(accept) 자료 삭제 기능 추가

fix: Oracle DB update 항목 추가
main
jhseo 8 months ago
parent c9249a2a1c
commit c192a9c5be

@ -37,4 +37,11 @@ public interface IBizSisulMapper {
Optional<RsltSisulResMstData> selectSndngResultMaster(final RsltSisulRequest dto); Optional<RsltSisulResMstData> selectSndngResultMaster(final RsltSisulRequest dto);
List<RsltSisulResDtlData> selectSndngResultDetails(final RsltSisulRequest dto); List<RsltSisulResDtlData> selectSndngResultDetails(final RsltSisulRequest dto);
List<Elecnoticedtl> selectOhterResult(); List<Elecnoticedtl> selectOhterResult();
Optional<CntcDTO.SndngMst> selectCntcMst(final CntcDTO.SndngMst dto);
int insertCntcMst(CntcDTO.SndngMst dto);
int insertCntcDetail(CntcDTO.SndngMst dto);
int deleteCntcMst(CntcDTO.SndngMst dto);
int deleteCntcDetail(CntcDTO.SndngMst dto);
} }

@ -1241,4 +1241,24 @@ public class BizSisulService extends AbstractService implements IBizSisulService
// public static void main(String[] args) { // public static void main(String[] args) {
// System.out.println(jsonCn11(null)); // System.out.println(jsonCn11(null));
// } // }
@Transactional
@Override
public String procCntcData(CntcDTO.SndngMst dto) {
String rtnMsg = "";
final CntcDTO.SndngMst cntcDto = mapper.selectCntcMst(dto)
.orElseThrow(() -> BizRuntimeException.create("접수 정보를 찾을 수 없습니다."));
if(ApiConstants.SndngProcessStatus.ACCEPT.getCode().equals(cntcDto.getSndngProcessSttus())){
if(mapper.insertCntcMst(cntcDto) < 1) throw BizRuntimeException.create("접수 정보 백업(마스터) 실패");
if(mapper.deleteCntcMst(cntcDto) < 1) throw BizRuntimeException.create("접수 원본 삭제(마스터) 실패");
if(mapper.insertCntcDetail(cntcDto) < 1) throw BizRuntimeException.create("접수 정보 백업(상세) 실패");
if(mapper.deleteCntcDetail(cntcDto) < 1) throw BizRuntimeException.create("접수 정보 삭제(상세) 실패");
rtnMsg = "Y";
}
return rtnMsg;
}
} }

@ -2,6 +2,7 @@ package kr.xit.biz.sisul.service;
import java.util.List; import java.util.List;
import kr.xit.biz.ens.model.cmm.CmmEnsFileInfDTO.FmcExcelUpload; import kr.xit.biz.ens.model.cmm.CmmEnsFileInfDTO.FmcExcelUpload;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulRequest; import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulRequest;
import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulResDtlData; import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulResDtlData;
import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulResMstData; import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulResMstData;
@ -24,7 +25,9 @@ import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulResMstData;
public interface IBizSisulService { public interface IBizSisulService {
String fmcExcelUpload(final FmcExcelUpload fileReq); String fmcExcelUpload(final FmcExcelUpload fileReq);
RsltSisulResMstData findSndngResultMaster(final RsltSisulRequest dto); RsltSisulResMstData findSndngResultMaster(final RsltSisulRequest dto);
List<RsltSisulResDtlData> findSndngResultDetails(final RsltSisulRequest dto); List<RsltSisulResDtlData> findSndngResultDetails(final RsltSisulRequest dto);
String procCntcData(final CntcDTO.SndngMst dto);
} }

@ -3,6 +3,7 @@ package kr.xit.biz.sisul.web;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import kr.xit.biz.ens.model.cmm.CmmEnsFileInfDTO.FmcExcelUpload; import kr.xit.biz.ens.model.cmm.CmmEnsFileInfDTO.FmcExcelUpload;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulRequest; import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulRequest;
import kr.xit.biz.sisul.service.IBizSisulService; import kr.xit.biz.sisul.service.IBizSisulService;
import kr.xit.core.model.ApiResponseDTO; import kr.xit.core.model.ApiResponseDTO;
@ -63,4 +64,17 @@ public class BizSisulController {
public IApiResponse findSndngResultDetails(@RequestBody RsltSisulRequest reqDTO) { public IApiResponse findSndngResultDetails(@RequestBody RsltSisulRequest reqDTO) {
return ApiResponseDTO.success(service.findSndngResultDetails(reqDTO)); return ApiResponseDTO.success(service.findSndngResultDetails(reqDTO));
} }
/**
* <pre>
* XIT cntc
* @param reqDTO CntcDTO.SndngMst
* @return IApiResponse
* </pre>
*/
@Operation(summary = "XIT cntc 데이타 처리 - 시설공단 내부시스템에서 호출", description = "XIT cntc 데이타 처리 - 시설공단 내부시스템에서 호출")
@PostMapping(value = "/cntc/proc", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse procCntcData(@RequestBody final CntcDTO.SndngMst reqDTO) {
return ApiResponseDTO.success(service.procCntcData(reqDTO));
}
} }

@ -49,6 +49,10 @@ public class OtherService extends AbstractService implements IOtherService {
if((Checks.isEmpty(elecnoticedtl)) if((Checks.isEmpty(elecnoticedtl))
|| (Checks.isEmpty(elecnoticedtl.getSndngprocesssttus())) || (Checks.isEmpty(elecnoticedtl.getSndngprocesssttus()))
|| (Checks.isNotEmpty(elecnoticedtl) && !Checks.checkVal(dto.getSndngprocesssttus(),"").equals(Checks.checkVal(elecnoticedtl.getSndngprocesssttus(),""))) || (Checks.isNotEmpty(elecnoticedtl) && !Checks.checkVal(dto.getSndngprocesssttus(),"").equals(Checks.checkVal(elecnoticedtl.getSndngprocesssttus(),"")))
|| (Checks.isNotEmpty(elecnoticedtl) && !Checks.checkVal(dto.getSndngco(),"").equals(Checks.checkVal(elecnoticedtl.getSndngco(),"")))
|| (Checks.isNotEmpty(elecnoticedtl) && !Checks.checkVal(dto.getSndngdt(),"").equals(Checks.checkVal(elecnoticedtl.getSndngdt(),"")))
|| (Checks.isNotEmpty(elecnoticedtl) && !Checks.checkVal(dto.getTmplatid(),"").equals(Checks.checkVal(elecnoticedtl.getTmplatid(),"")))
|| (Checks.isNotEmpty(elecnoticedtl) && !Checks.checkVal(dto.getMessage(),"").equals(Checks.checkVal(elecnoticedtl.getMessage(),"")))
){ ){
mapper.saveElecnoticemst(dto); mapper.saveElecnoticemst(dto);
mapper.saveElecnoticedtl(dto); mapper.saveElecnoticedtl(dto);

@ -185,6 +185,103 @@
INNER JOIN tb_cntc_sndng_detail tcsd ON (tcsm.unity_sndng_mastr_id = tcsd.unity_sndng_mastr_id) INNER JOIN tb_cntc_sndng_detail tcsd ON (tcsm.unity_sndng_mastr_id = tcsd.unity_sndng_mastr_id)
LEFT OUTER JOIN tb_cntc_sndng_result tcsr ON (tcsd.unity_sndng_detail_id = tcsr.unity_sndng_detail_id) LEFT OUTER JOIN tb_cntc_sndng_result tcsr ON (tcsd.unity_sndng_detail_id = tcsr.unity_sndng_detail_id)
WHERE str_to_date(tcsm.clos_dt, '%Y%m%d%H%i%S') > date_add(now(), interval -7 day) WHERE str_to_date(tcsm.clos_dt, '%Y%m%d%H%i%S') > date_add(now(), interval -7 day)
AND tcsm.sndng_process_sttus != 'accept'
</select> </select>
<select id="selectCntcMst" resultType="kr.xit.biz.ens.model.cntc.CntcDTO$SndngMst">
SELECT unity_sndng_mastr_id as unitysndngmastrid
, sndng_process_sttus as sndngProcessSttus
FROM tb_cntc_sndng_mastr
WHERE unity_sndng_mastr_id = #{unitySndngMastrId}
AND sndng_process_sttus = 'accept'
</select>
<insert id="insertCntcMst">
INSERT INTO tb_cntc_sndng_del (
unity_sndng_mastr_id,
signgu_code,
ffnlg_code,
tmplat_id,
sndng_ty_code,
sndng_co,
sndng_process_sttus,
sndng_dt,
clos_dt,
error_code,
error_mssage,
regist_dt,
register )
SELECT
tcsm.unity_sndng_mastr_id,
tcsm.signgu_code,
tcsm.ffnlg_code,
tcsm.tmplat_id,
tcsm.sndng_ty_code,
tcsm.sndng_co,
tcsm.sndng_process_sttus,
tcsm.sndng_dt,
tcsm.clos_dt,
tcsm.error_code,
tcsm.error_mssage,
tcsm.regist_dt,
tcsm.register
from tb_cntc_sndng_mastr tcsm
WHERE tcsm.unity_sndng_mastr_id = #{unitySndngMastrId}
AND tcsm.sndng_process_sttus = 'accept'
</insert>
<insert id="insertCntcDetail">
INSERT INTO tb_cntc_sndng_detail_del (
unity_sndng_detail_id,
unity_sndng_mastr_id,
signgu_code,
ffnlg_code,
main_code,
vhcle_no,
ihidnum,
moblphon_no,
nm,
adres,
detail_adres,
zip,
tmplt_msg_data,
mobile_page_cn,
use_instt_idntfc_id,
external_document_uuid,
regist_dt,
register )
SELECT
unity_sndng_detail_id,
unity_sndng_mastr_id,
signgu_code,
ffnlg_code,
main_code,
vhcle_no,
ihidnum,
moblphon_no,
nm,
adres,
detail_adres,
zip,
tmplt_msg_data,
mobile_page_cn,
use_instt_idntfc_id,
external_document_uuid,
regist_dt,
register
FROM tb_cntc_sndng_detail
WHERE unity_sndng_mastr_id = #{unitySndngMastrId}
</insert>
<delete id="deleteCntcMst">
DELETE FROM tb_cntc_sndng_mastr
WHERE unity_sndng_mastr_id = #{unitySndngMastrId}
AND sndng_process_sttus = 'accept'
</delete>
<delete id="deleteCntcDetail">
DELETE FROM tb_cntc_sndng_detail
WHERE unity_sndng_mastr_id = #{unitySndngMastrId}
</delete>
</mapper> </mapper>

@ -41,11 +41,13 @@
ON (a.unitysndngmastrid = #{unitysndngmastrid}) ON (a.unitysndngmastrid = #{unitysndngmastrid})
WHEN MATCHED THEN WHEN MATCHED THEN
UPDATE UPDATE
SET a.sndngprocesssttus = #{sndngprocesssttus} SET a.sndngco = #{sndngco}
, a.sndngprocesssttus = #{sndngprocesssttus}
, a.sndngdt = TO_DATE(#{sndngdt},'YYYYMMDDHH24MISS')
, a.tmplatid = #{tmplatid}
, a.message = SUBSTRB(#{message}, 1, 100)
, a.upduser = #{upduser} , a.upduser = #{upduser}
, a.upddate = sysdate , a.upddate = sysdate
, a.success = #{success}
, a.message = SUBSTRB(#{message}, 1, 100)
WHEN NOT MATCHED THEN WHEN NOT MATCHED THEN
INSERT (a.unitysndngmastrid INSERT (a.unitysndngmastrid
, a.sndngco , a.sndngco
@ -82,7 +84,9 @@
ON (b.unitysndngmastrid = #{unitysndngmastrid} AND b.unitysndngdetailid = #{unitysndngdetailid}) ON (b.unitysndngmastrid = #{unitysndngmastrid} AND b.unitysndngdetailid = #{unitysndngdetailid})
WHEN MATCHED THEN WHEN MATCHED THEN
UPDATE UPDATE
SET b.readdt = TO_DATE(#{readdt},'YYYYMMDDHH24MISS') SET b.tmplatid = #{tmplatid}
, b.recvdt = TO_DATE(#{recvdt},'YYYYMMDDHH24MISS')
, b.readdt = TO_DATE(#{readdt},'YYYYMMDDHH24MISS')
, b.resultcode = #{resultcode} , b.resultcode = #{resultcode}
, b.upduser = #{upduser} , b.upduser = #{upduser}
, b.upddate = sysdate , b.upddate = sysdate

Loading…
Cancel
Save