diff --git a/mens-api/src/main/java/kr/xit/biz/sisul/mapper/IBizSisulMapper.java b/mens-api/src/main/java/kr/xit/biz/sisul/mapper/IBizSisulMapper.java index bb6c0c8..de6d205 100644 --- a/mens-api/src/main/java/kr/xit/biz/sisul/mapper/IBizSisulMapper.java +++ b/mens-api/src/main/java/kr/xit/biz/sisul/mapper/IBizSisulMapper.java @@ -37,4 +37,11 @@ public interface IBizSisulMapper { Optional selectSndngResultMaster(final RsltSisulRequest dto); List selectSndngResultDetails(final RsltSisulRequest dto); List selectOhterResult(); + + Optional 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); } diff --git a/mens-api/src/main/java/kr/xit/biz/sisul/service/BizSisulService.java b/mens-api/src/main/java/kr/xit/biz/sisul/service/BizSisulService.java index 2ece32d..c6411d5 100644 --- a/mens-api/src/main/java/kr/xit/biz/sisul/service/BizSisulService.java +++ b/mens-api/src/main/java/kr/xit/biz/sisul/service/BizSisulService.java @@ -1241,4 +1241,24 @@ public class BizSisulService extends AbstractService implements IBizSisulService // public static void main(String[] args) { // 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; + } } diff --git a/mens-api/src/main/java/kr/xit/biz/sisul/service/IBizSisulService.java b/mens-api/src/main/java/kr/xit/biz/sisul/service/IBizSisulService.java index fb3c363..ba3a414 100644 --- a/mens-api/src/main/java/kr/xit/biz/sisul/service/IBizSisulService.java +++ b/mens-api/src/main/java/kr/xit/biz/sisul/service/IBizSisulService.java @@ -2,6 +2,7 @@ package kr.xit.biz.sisul.service; import java.util.List; 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.RsltSisulResDtlData; import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulResMstData; @@ -24,7 +25,9 @@ import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulResMstData; public interface IBizSisulService { String fmcExcelUpload(final FmcExcelUpload fileReq); - RsltSisulResMstData findSndngResultMaster(final RsltSisulRequest dto); + List findSndngResultDetails(final RsltSisulRequest dto); + + String procCntcData(final CntcDTO.SndngMst dto); } diff --git a/mens-api/src/main/java/kr/xit/biz/sisul/web/BizSisulController.java b/mens-api/src/main/java/kr/xit/biz/sisul/web/BizSisulController.java index ae057af..681f52d 100644 --- a/mens-api/src/main/java/kr/xit/biz/sisul/web/BizSisulController.java +++ b/mens-api/src/main/java/kr/xit/biz/sisul/web/BizSisulController.java @@ -3,6 +3,7 @@ package kr.xit.biz.sisul.web; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; 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.service.IBizSisulService; import kr.xit.core.model.ApiResponseDTO; @@ -63,4 +64,17 @@ public class BizSisulController { public IApiResponse findSndngResultDetails(@RequestBody RsltSisulRequest reqDTO) { return ApiResponseDTO.success(service.findSndngResultDetails(reqDTO)); } + + /** + *
+     *  XIT cntc 데이타 처리
+     * @param reqDTO CntcDTO.SndngMst
+     * @return IApiResponse
+     * 
+ */ + @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)); + } } diff --git a/mens-api/src/main/java/kr/xit/other/service/OtherService.java b/mens-api/src/main/java/kr/xit/other/service/OtherService.java index 32e709b..2f201a4 100644 --- a/mens-api/src/main/java/kr/xit/other/service/OtherService.java +++ b/mens-api/src/main/java/kr/xit/other/service/OtherService.java @@ -49,6 +49,10 @@ public class OtherService extends AbstractService implements IOtherService { if((Checks.isEmpty(elecnoticedtl)) || (Checks.isEmpty(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.saveElecnoticedtl(dto); diff --git a/mens-api/src/main/resources/egovframework/mapper/biz/ens-sisul-mysql-mapper.xml b/mens-api/src/main/resources/egovframework/mapper/biz/ens-sisul-mysql-mapper.xml index b1831f1..dd41479 100644 --- a/mens-api/src/main/resources/egovframework/mapper/biz/ens-sisul-mysql-mapper.xml +++ b/mens-api/src/main/resources/egovframework/mapper/biz/ens-sisul-mysql-mapper.xml @@ -185,6 +185,103 @@ 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) 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' + + + + 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 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} + + + + DELETE FROM tb_cntc_sndng_mastr + WHERE unity_sndng_mastr_id = #{unitySndngMastrId} + AND sndng_process_sttus = 'accept' + + + + DELETE FROM tb_cntc_sndng_detail + WHERE unity_sndng_mastr_id = #{unitySndngMastrId} + + diff --git a/mens-api/src/main/resources/egovframework/mapper/other/other-oracle-mapper.xml b/mens-api/src/main/resources/egovframework/mapper/other/other-oracle-mapper.xml index de65315..4177e14 100644 --- a/mens-api/src/main/resources/egovframework/mapper/other/other-oracle-mapper.xml +++ b/mens-api/src/main/resources/egovframework/mapper/other/other-oracle-mapper.xml @@ -41,11 +41,13 @@ ON (a.unitysndngmastrid = #{unitysndngmastrid}) WHEN MATCHED THEN 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.upddate = sysdate - , a.success = #{success} - , a.message = SUBSTRB(#{message}, 1, 100) WHEN NOT MATCHED THEN INSERT (a.unitysndngmastrid , a.sndngco @@ -82,7 +84,9 @@ ON (b.unitysndngmastrid = #{unitysndngmastrid} AND b.unitysndngdetailid = #{unitysndngdetailid}) WHEN MATCHED THEN 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.upduser = #{upduser} , b.upddate = sysdate