From ccc4571b1be7858d5255bef47918a6472be69af4 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Tue, 27 Aug 2024 14:15:56 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=AF=B8=EC=82=AC=EC=9A=A9=20?= =?UTF-8?q?=ED=81=B4=EB=9E=98=EC=8A=A4=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/ccn/mapper/IBizChuncheonMapper.java | 47 ---- .../ccn/model/ChuncheonSndngResultDTO.java | 148 ----------- .../biz/ccn/service/BizChuncheonService.java | 126 ---------- .../biz/ccn/service/IBizChuncheonService.java | 29 --- .../biz/ccn/web/BizChuncheonController.java | 70 ------ .../mapper/biz/ens-chuncheon-mysql-mapper.xml | 234 ------------------ 6 files changed, 654 deletions(-) delete mode 100644 mens-api/src/main/java/kr/xit/biz/ccn/mapper/IBizChuncheonMapper.java delete mode 100644 mens-api/src/main/java/kr/xit/biz/ccn/model/ChuncheonSndngResultDTO.java delete mode 100644 mens-api/src/main/java/kr/xit/biz/ccn/service/BizChuncheonService.java delete mode 100644 mens-api/src/main/java/kr/xit/biz/ccn/service/IBizChuncheonService.java delete mode 100644 mens-api/src/main/java/kr/xit/biz/ccn/web/BizChuncheonController.java delete mode 100644 mens-api/src/main/resources/egovframework/mapper/biz/ens-chuncheon-mysql-mapper.xml diff --git a/mens-api/src/main/java/kr/xit/biz/ccn/mapper/IBizChuncheonMapper.java b/mens-api/src/main/java/kr/xit/biz/ccn/mapper/IBizChuncheonMapper.java deleted file mode 100644 index ea2ea94..0000000 --- a/mens-api/src/main/java/kr/xit/biz/ccn/mapper/IBizChuncheonMapper.java +++ /dev/null @@ -1,47 +0,0 @@ -package kr.xit.biz.ccn.mapper; - -import java.util.List; -import java.util.Optional; - -import org.egovframe.rte.psl.dataaccess.mapper.Mapper; -import org.springframework.context.annotation.Conditional; - -import kr.xit.biz.ccn.model.ChuncheonSndngResultDTO; -import kr.xit.biz.ens.model.cmm.TmplatManage; -import kr.xit.biz.ens.model.cntc.CntcDTO; -import kr.xit.core.spring.config.support.ProfileConditionOfChuncheon; - -/** - *
- * description : 전자고지 File mapper
- *
- * packageName : kr.xit.biz.sisul.mapper
- * fileName    : IBizSisulMapper
- * author      : seojh
- * date        : 2023-10-19
- * ======================================================================
- * 변경일         변경자        변경 내용
- * ----------------------------------------------------------------------
- * 2023-10-19    seojh       최초 생성
- *
- * 
- */ -@Mapper -@Conditional(ProfileConditionOfChuncheon.class) -public interface IBizChuncheonMapper { - Optional selectDeptInfoByTmplId(final String tmplatId); - int insertCntcSndngMst(CntcDTO.SndngMst dto); - int insertCntcSndngDtl(CntcDTO.SndngDtl dto); - int insertPostPlusJson(CntcDTO.PostPlusJson dto); - - Optional selectSndngResultMaster(final ChuncheonSndngResultDTO.RsltChuncheonRequest dto); - List selectSndngResultDetails(final ChuncheonSndngResultDTO.RsltChuncheonRequest dto); - - Optional selectCntcMst(final CntcDTO.SndngMst dto); - - 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); -} diff --git a/mens-api/src/main/java/kr/xit/biz/ccn/model/ChuncheonSndngResultDTO.java b/mens-api/src/main/java/kr/xit/biz/ccn/model/ChuncheonSndngResultDTO.java deleted file mode 100644 index c00446a..0000000 --- a/mens-api/src/main/java/kr/xit/biz/ccn/model/ChuncheonSndngResultDTO.java +++ /dev/null @@ -1,148 +0,0 @@ -package kr.xit.biz.ccn.model; - -import javax.validation.constraints.Size; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.Getter; -import lombok.NoArgsConstructor; - -/** - *
- * description :
- *
- * packageName : kr.xit.biz.sisul.model
- * fileName    : SisulSndngResultDTO
- * author      : limju
- * date        : 2023-11-02
- * ======================================================================
- * 변경일         변경자        변경 내용
- * ----------------------------------------------------------------------
- * 2023-11-02    limju       최초 생성
- *
- * 
- */ -public class ChuncheonSndngResultDTO { - - @Schema(name = "RsltChuncheonRequest", description = "발송결과정보 조회 request DTO") - @Data - @NoArgsConstructor - @AllArgsConstructor - @Builder - public static class RsltChuncheonRequest { - /** - * 통합발송마스터 ID - 파일유일키 - */ - @Schema(requiredMode = RequiredMode.REQUIRED, title = "파일유일키", example = "DPMKK271000000777777") - @Size(min = 1, max = 20, message = "파일유일키는 필수 입니다(max:20)") - private String unitySndngMastrId; - - /** - * 통합발송상세 ID - 우편물 일련 번호 - */ - @Schema(requiredMode = RequiredMode.AUTO, title = "우편물 일련번호", example = " ") - @Size(max = 20, message = "우편물 일련번호는 20자를 넘을 수 없습니다.") - private String unitySndngDetailId; - } - - @Schema(name = "RsltChuncheonResMstData", description = "발송결과정보 master 조회 response DTO") - @Getter - @NoArgsConstructor - @AllArgsConstructor - @Builder - public static class RsltChuncheonResMstData { - - /** - * 통합발송마스터 ID - 파일유일키 - */ - private String unitySndngMastrId; - - /** - * 발송구분코드 - KKO-MY-DOC|KT-BC|POST-PLUS - */ - private String sndngSeCode; - - /** - * 템플릿ID - */ - private String tmplatId; - - /** - * 발송건수 - */ - private Integer sndngCo; - - /** - * 발송처리 상태 - */ - private String sndngProcessSttus; - - /** - * 발송일시 : yyyyMMddHHmiss - */ - private String sndngDt; - } - - @Schema(name = "RsltChuncheonResDtlData", description = "발송결과정보 details 조회 response DTO") - @Getter - @NoArgsConstructor - @AllArgsConstructor - @Builder - public static class RsltChuncheonResDtlData { - /** - * 통합발송마스터 ID - 파일유일키 - */ - private String unitySndngMastrId; - - /** - * 통합발송상세 ID - 우편물 일련 번호 - */ - private String unitySndngDetailId; - - /** - * 발송구분코드 - KKO-MY-DOC|KT-BC|POST-PLUS - */ - private String sndngSeCode; - - /** - * 템플릿ID - */ - private String tmplatId; - - /** - * 발송일시 : yyyyMMddHHmiss - */ - @JsonProperty("sndngDt") - private String requstDt; - - /** - * 수신일시 : yyyyMMddHHmiss - * recvDt 로 전송 - */ - @JsonProperty("recvDt") - private String inqireDt; - - /** - * 열람일시 : yyyyMMddHHmiss - * readDt 로 전송 - */ - @JsonProperty("readDt") - private String readngDt; - - /** - * 등기번호 - */ - private String rgistno; - - /** - * 발송결과 상태 - resultCode 로 전송 - */ - @JsonProperty("resultCode") - private String sndngResultSttus; - } -} diff --git a/mens-api/src/main/java/kr/xit/biz/ccn/service/BizChuncheonService.java b/mens-api/src/main/java/kr/xit/biz/ccn/service/BizChuncheonService.java deleted file mode 100644 index dc72094..0000000 --- a/mens-api/src/main/java/kr/xit/biz/ccn/service/BizChuncheonService.java +++ /dev/null @@ -1,126 +0,0 @@ -package kr.xit.biz.ccn.service; - -import java.util.List; - -import org.json.simple.JSONObject; -import org.springframework.context.annotation.Conditional; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import kr.xit.biz.ccn.mapper.IBizChuncheonMapper; -import kr.xit.biz.ccn.model.ChuncheonSndngResultDTO; -import kr.xit.biz.common.ApiConstants; -import kr.xit.biz.ens.model.cntc.CntcDTO; -import kr.xit.core.exception.BizRuntimeException; -import kr.xit.core.service.AbstractService; -import kr.xit.core.spring.config.support.ProfileConditionOfChuncheon; -import kr.xit.ens.cmm.CmmEnsUtils; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -/** - *
- * description :
- *
- * packageName : kr.xit.biz.sisul.service
- * fileName    : BizSisulService
- * author      : limju
- * date        : 2023-09-05
- * ======================================================================
- * 변경일         변경자        변경 내용
- * ----------------------------------------------------------------------
- * 2023-09-05    limju       최초 생성
- *
- * 
- */ -@Slf4j -@RequiredArgsConstructor -@Service -@Conditional(ProfileConditionOfChuncheon.class) -public class BizChuncheonService extends AbstractService implements IBizChuncheonService { - private final IBizChuncheonMapper mapper; - - @Override - @Transactional(readOnly = true) - public ChuncheonSndngResultDTO.RsltChuncheonResMstData findSndngResultMaster(final ChuncheonSndngResultDTO.RsltChuncheonRequest reqDTO) { - CmmEnsUtils.validate(reqDTO); - return mapper.selectSndngResultMaster(reqDTO) - .orElseThrow(() -> BizRuntimeException.create(String.format("[%s] 데이타를 찾을 수 없습니다", reqDTO.getUnitySndngMastrId()))); - } - - @Override - @Transactional(readOnly = true) - public List findSndngResultDetails(final ChuncheonSndngResultDTO.RsltChuncheonRequest reqDTO) { - CmmEnsUtils.validate(reqDTO); - List resList = mapper.selectSndngResultDetails(reqDTO); - if(resList.isEmpty()) throw BizRuntimeException.create(String.format("[%s] 데이타를 찾을 수 없습니다", reqDTO.getUnitySndngMastrId())); - return mapper.selectSndngResultDetails(reqDTO); - } - - //------------------------------------------------------------------------ - // private method - //------------------------------------------------------------------------ - - - @SuppressWarnings("unchecked") - private JSONObject getElementsObj(final String title, final String itemType, final Object elements){ - JSONObject dt = new JSONObject(); - dt.put("title", title); - dt.put("item_type", itemType); - dt.put("elements", elements); - return dt; - } - - @SuppressWarnings("unchecked") - private JSONObject getPropertiesObj(final String title, final String itemType, final Object properties, final Object elements){ - JSONObject dt = new JSONObject(); - dt.put("title", title); - dt.put("item_type", itemType); - dt.put("properties", properties); - dt.put("elements", elements); - return dt; - } - - @SuppressWarnings("unchecked") - private JSONObject getKeyValueObj(final String key, final String value){ - JSONObject json = new JSONObject(); - json.put("key", key); - json.put("value", value); - json.put("level", 1); - return json; - } - - private JSONObject getUseClipboard(){ - JSONObject json = new JSONObject(); - json.put("use-clipboard", true); - return json; - } - -// 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()) || - ApiConstants.SndngProcessStatus.ACCEPT_FAIL.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("접수 정보 삭제(상세) 실패"); - - rtnMsg = "Y"; - } - - return rtnMsg; - } -} diff --git a/mens-api/src/main/java/kr/xit/biz/ccn/service/IBizChuncheonService.java b/mens-api/src/main/java/kr/xit/biz/ccn/service/IBizChuncheonService.java deleted file mode 100644 index 28fe997..0000000 --- a/mens-api/src/main/java/kr/xit/biz/ccn/service/IBizChuncheonService.java +++ /dev/null @@ -1,29 +0,0 @@ -package kr.xit.biz.ccn.service; - -import java.util.List; - -import kr.xit.biz.ccn.model.ChuncheonSndngResultDTO; -import kr.xit.biz.ens.model.cntc.CntcDTO; - -/** - *
- * description :
- *
- * packageName : kr.xit.biz.sisul.service
- * fileName    : IBizSisulService
- * author      : limju
- * date        : 2023-09-05
- * ======================================================================
- * 변경일         변경자        변경 내용
- * ----------------------------------------------------------------------
- * 2023-09-05    limju       최초 생성
- *
- * 
- */ -public interface IBizChuncheonService { - ChuncheonSndngResultDTO.RsltChuncheonResMstData findSndngResultMaster(final ChuncheonSndngResultDTO.RsltChuncheonRequest dto); - - List findSndngResultDetails(final ChuncheonSndngResultDTO.RsltChuncheonRequest dto); - - String procCntcData(final CntcDTO.SndngMst dto); -} diff --git a/mens-api/src/main/java/kr/xit/biz/ccn/web/BizChuncheonController.java b/mens-api/src/main/java/kr/xit/biz/ccn/web/BizChuncheonController.java deleted file mode 100644 index 25e5695..0000000 --- a/mens-api/src/main/java/kr/xit/biz/ccn/web/BizChuncheonController.java +++ /dev/null @@ -1,70 +0,0 @@ -package kr.xit.biz.ccn.web; - -import org.springframework.context.annotation.Conditional; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import kr.xit.biz.ccn.model.ChuncheonSndngResultDTO; -import kr.xit.biz.ccn.service.IBizChuncheonService; -import kr.xit.biz.ens.model.cntc.CntcDTO; -import kr.xit.core.model.ApiResponseDTO; -import kr.xit.core.model.IApiResponse; -import kr.xit.core.spring.config.support.ProfileConditionOfChuncheon; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -/** - *
- * description : 전자고지 시설관리 시스템 연계 관련 처리
- *
- * packageName : kr.xit.biz.sisul.web
- * fileName    : BizSisulController
- * author      : limju
- * date        : 2023-09-04
- * ======================================================================
- * 변경일         변경자        변경 내용
- * ----------------------------------------------------------------------
- * 2023-09-04    limju       최초 생성
- *
- * 
- */ -@Slf4j -@Tag(name = "BizChuncheonController", description = "전자고지 춘천 시스템 연계 관련 처리") -@RequiredArgsConstructor -@RestController -@RequestMapping(value = "/api/biz/chuncheon/v1") -@Conditional(ProfileConditionOfChuncheon.class) -public class BizChuncheonController { - - private final IBizChuncheonService service; - - @Operation(summary = "발송결과정보 마스터 조회 - 춘천 내부시스템에서 호출", description = "발송결과정보 마스터 조회 - 춘천 내부시스템에서 호출") - @PostMapping(value = "/sndng/result/master", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public IApiResponse findSndngResultMaster(@RequestBody ChuncheonSndngResultDTO.RsltChuncheonRequest reqDTO) { - return ApiResponseDTO.success(service.findSndngResultMaster(reqDTO)); - } - - @Operation(summary = "발송결과정보 상세 조회 - 춘천 내부시스템에서 호출", description = "발송결과정보 상세 조회 - 춘천 내부시스템에서 호출") - @PostMapping(value = "/sndng/result/details", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public IApiResponse findSndngResultDetails(@RequestBody ChuncheonSndngResultDTO.RsltChuncheonRequest 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/resources/egovframework/mapper/biz/ens-chuncheon-mysql-mapper.xml b/mens-api/src/main/resources/egovframework/mapper/biz/ens-chuncheon-mysql-mapper.xml deleted file mode 100644 index 7904669..0000000 --- a/mens-api/src/main/resources/egovframework/mapper/biz/ens-chuncheon-mysql-mapper.xml +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - /** ens-sysul-mysql-mapper|insertCntcSndngMst-연계발송마스터 생성|seojh */ - INSERT - INTO tb_cntc_sndng_mastr ( - unity_sndng_mastr_id, /* 통합발송마스터 id */ - signgu_code, /* 시군구코드 */ - ffnlg_code, /* 과태료코드 */ - tmplat_id, /* 템플릿ID */ - sndng_ty_code, /* 발송유형 코드 */ - sndng_co, /* 발송 건수 */ - sndng_process_sttus, /* 발송처리 상태 */ - sndng_dt, /* 발송일시 */ - clos_dt, /* 마감일시 */ - regist_dt, - register - ) - SELECT #{unitySndngMastrId} - , tetm.signgu_code - , tetm.ffnlg_code - , tetm.tmplat_id - , tetm.sndng_ty_code - , #{sndngCo} - , #{sndngProcessSttus} - , #{sndngDt} - , #{closDt} - , now() - , #{register} - FROM tb_ens_tmplat_manage tetm - WHERE tmplat_id = #{tmplatId} - - - - /** ens-sysul-mysql-mapper|insertCntcSndngDtl-연계발송상세 생성|seojh */ - INSERT - INTO tb_cntc_sndng_detail ( - unity_sndng_detail_id, /* 통합발송 상세ID */ - unity_sndng_mastr_id, /* 통합발송 마스터ID */ - signgu_code, /* 시군구 코드 */ - ffnlg_code, /* 과태료 코드 */ - main_code, /* 메인 코드 - 자료 식별 코드 */ - tmplt_msg_data, /* 템플릿 메시지 데이터 - 가변 항목 자료 */ - mobile_page_cn, /* 모바일 페이지 내용 */ - use_instt_idntfc_id, /* 이용 기관 식별 ID - 교통시설 운영처 제목 가변 */ - regist_dt, - register - ) - SELECT #{unitySndngDetailId} - , #{unitySndngMastrId} - , tetm.signgu_code - , tetm.ffnlg_code - , #{mainCode} - , #{tmpltMsgData} - , #{mobilePageCn} - , #{useInsttIdntfcId} - , now() - , #{register} - FROM tb_ens_tmplat_manage tetm - WHERE tmplat_id = #{tmplatId} - - - - /** ens-sysul-mysql-mapper|insertCi-CI자료 생성|seojh */ - INSERT - INTO tb_ens_ci ( - unity_sndng_detail_id, - ci, - result_cd, - message, - regist_dt, - register - ) VALUES ( - #{unitySndngDetailId} - , NVL(#{ci1}, #{ci2}) - , #{resultCd} - , #{message} - , now() - , #{register} - ) - - - - - - - - - - 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 in ('accept', 'accept-fail') - - - - 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_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 FROM tb_cntc_sndng_mastr - WHERE unity_sndng_mastr_id = #{unitySndngMastrId} - AND sndng_process_sttus in ('accept', 'accept-fail') - - - - DELETE FROM tb_cntc_sndng_detail - WHERE unity_sndng_mastr_id = #{unitySndngMastrId} - - -