refactor: 미사용 클래스 제거

main
Jonguk. Lim 3 months ago
parent 20081b89ab
commit ccc4571b1b

@ -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;
/**
* <pre>
* description : File mapper
*
* packageName : kr.xit.biz.sisul.mapper
* fileName : IBizSisulMapper
* author : seojh
* date : 2023-10-19
* ======================================================================
*
* ----------------------------------------------------------------------
* 2023-10-19 seojh
*
* </pre>
*/
@Mapper
@Conditional(ProfileConditionOfChuncheon.class)
public interface IBizChuncheonMapper {
Optional<TmplatManage> selectDeptInfoByTmplId(final String tmplatId);
int insertCntcSndngMst(CntcDTO.SndngMst dto);
int insertCntcSndngDtl(CntcDTO.SndngDtl dto);
int insertPostPlusJson(CntcDTO.PostPlusJson dto);
Optional<ChuncheonSndngResultDTO.RsltChuncheonResMstData> selectSndngResultMaster(final ChuncheonSndngResultDTO.RsltChuncheonRequest dto);
List<ChuncheonSndngResultDTO.RsltChuncheonResDtlData> selectSndngResultDetails(final ChuncheonSndngResultDTO.RsltChuncheonRequest dto);
Optional<CntcDTO.SndngMst> 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);
}

@ -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;
/**
* <pre>
* description :
*
* packageName : kr.xit.biz.sisul.model
* fileName : SisulSndngResultDTO
* author : limju
* date : 2023-11-02
* ======================================================================
*
* ----------------------------------------------------------------------
* 2023-11-02 limju
*
* </pre>
*/
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;
}
}

@ -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;
/**
* <pre>
* description :
*
* packageName : kr.xit.biz.sisul.service
* fileName : BizSisulService
* author : limju
* date : 2023-09-05
* ======================================================================
*
* ----------------------------------------------------------------------
* 2023-09-05 limju
*
* </pre>
*/
@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<ChuncheonSndngResultDTO.RsltChuncheonResDtlData> findSndngResultDetails(final ChuncheonSndngResultDTO.RsltChuncheonRequest reqDTO) {
CmmEnsUtils.validate(reqDTO);
List<ChuncheonSndngResultDTO.RsltChuncheonResDtlData> 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;
}
}

@ -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;
/**
* <pre>
* description :
*
* packageName : kr.xit.biz.sisul.service
* fileName : IBizSisulService
* author : limju
* date : 2023-09-05
* ======================================================================
*
* ----------------------------------------------------------------------
* 2023-09-05 limju
*
* </pre>
*/
public interface IBizChuncheonService {
ChuncheonSndngResultDTO.RsltChuncheonResMstData findSndngResultMaster(final ChuncheonSndngResultDTO.RsltChuncheonRequest dto);
List<ChuncheonSndngResultDTO.RsltChuncheonResDtlData> findSndngResultDetails(final ChuncheonSndngResultDTO.RsltChuncheonRequest dto);
String procCntcData(final CntcDTO.SndngMst dto);
}

@ -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;
/**
* <pre>
* description :
*
* packageName : kr.xit.biz.sisul.web
* fileName : BizSisulController
* author : limju
* date : 2023-09-04
* ======================================================================
*
* ----------------------------------------------------------------------
* 2023-09-04 limju
*
* </pre>
*/
@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));
}
/**
* <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));
}
}

@ -1,234 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.biz.ccn.mapper.IBizChuncheonMapper">
<select id="selectDeptInfoByTmplId" resultType="kr.xit.biz.ens.model.cmm.TmplatManage">
/** ens-sysul-mysql-mapper|selectDeptInfoByTmplId-템플릿ID로 부서정보 조회|seojh */
SELECT tetm.signgu_code
, tetm.ffnlg_code
, tetm.try1
, tetm.post_dlvr_se
, tetm.post_tmplat_code
FROM tb_ens_tmplat_manage tetm
WHERE tmplat_id = #{tmplatId}
</select>
<insert id="insertCntcSndngMst">
/** 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}
</insert>
<insert id="insertCntcSndngDtl">
/** 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}
</insert>
<insert id="insertCi">
/** 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>
<select id="selectSndngResultMaster" resultType="kr.xit.biz.ccn.model.ChuncheonSndngResultDTO$RsltChuncheonResMstData">
/** ens-sysul-mysql-mapper|selectSndngResultMaster-발송결과정보 마스터 조회|julim */
SELECT tesn.unity_sndng_mastr_id /* 통합발송마스터 ID - 파일유일키 */
, tesn.sndng_se_code /* 발송구분코드 */
, tesn.tmplat_id /* 템플릿 ID */
, tesn.sndng_dt /* 발송일시 */
, tesn.sndng_co /* 발송건수 */
, tesn.sndng_process_sttus /* 발송처리 상태 */
FROM tb_ens_sndng_mastr tesn
WHERE tesn.unity_sndng_mastr_id = #{unitySndngMastrId}
</select>
<select id="selectSndngResultDetails" resultType="kr.xit.biz.ccn.model.ChuncheonSndngResultDTO$RsltChuncheonResDtlData">
/** ens-sysul-mysql-mapper|selectSndngResultDetails-발송결과정보 상세 조회|julim */
SELECT tesn.unity_sndng_mastr_id /* 통합발송마스터 ID - 파일유일키 */
, tcsnd.unity_sndng_detail_id /* 통합발송상세 ID - 우편물 일련번호 */
, tesn.sndng_se_code /* 발송구분코드 */
, tesn.tmplat_id /* 템플릿 ID */
, tcsr.requst_dt /* 발송일시 - sndngDt */
, tcsr.inqire_dt /* 수신일시 - recvDt */
, tcsr.readng_dt /* 열람일시 - readDt */
, tcsr.rgist_no /* 등기번호 */
, tcsr.sndng_result_sttus /* 발송결과상태 - resultCode */
FROM tb_ens_sndng_mastr tesn
JOIN tb_cntc_sndng_detail tcsnd
ON tesn.unity_sndng_mastr_id = tcsnd.unity_sndng_mastr_id
JOIN tb_cntc_sndng_result tcsr
ON tcsnd.unity_sndng_detail_id = tcsr.unity_sndng_detail_id
WHERE tesn.unity_sndng_mastr_id = #{unitySndngMastrId}
<if test="unitySndngDetailId != null and unitySndngDetailId != ''">
AND tcsr.unity_sndng_detail_id = #{unitySndngDetailId}
</if>
</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 in ('accept', 'accept-fail')
</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 in ('accept', 'accept-fail')
</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="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}
AND sndng_process_sttus in ('accept', 'accept-fail')
</delete>
<delete id="deleteCntcDetail">
DELETE FROM tb_cntc_sndng_detail
WHERE unity_sndng_mastr_id = #{unitySndngMastrId}
</delete>
</mapper>
Loading…
Cancel
Save