feat: 시설공단 API 반영

dev
gitea-관리자 1 year ago
parent 27b1cc226a
commit 09268b5997

@ -1,9 +1,13 @@
package kr.xit.biz.sisul.mapper;
import java.util.List;
import java.util.Optional;
import kr.xit.biz.ens.model.cmm.CmmEnsFileInfDTO;
import kr.xit.biz.ens.model.cmm.TmplatManage;
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;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
/**
@ -28,4 +32,7 @@ public interface IBizSisulMapper {
int insertCntcSndngDtl(CntcDTO.SndngDtl dto);
int insertCi(CmmEnsFileInfDTO.FmcInfExcelRslt dto);
int insertPostPlusJson(CntcDTO.PostPlusJson dto);
Optional<RsltSisulResMstData> selectSndngResultMaster(final RsltSisulRequest dto);
List<RsltSisulResDtlData> selectSndngResultDetails(final RsltSisulRequest dto);
}

@ -1,10 +1,12 @@
package kr.xit.biz.sisul.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import javax.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
@ -25,18 +27,120 @@ import lombok.NoArgsConstructor;
*/
public class SisulSndngResultDTO {
@Schema(name = "EpostTraceRequest", description = "발송결과정보 조회 request DTO")
@Getter
@Schema(name = "RsltSisulRequest", description = "발송결과정보 조회 request DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class RsltSisulRequest {
@Schema(requiredMode = RequiredMode.REQUIRED, title = "파일유일키", example = " ")
@Size(min = 10, max = 20, message = "파일유일키는 필수 입니다(max:20)")
/**
* 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 = "RsltSisulResMstData", description = "발송결과정보 master 조회 response DTO")
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class RsltSisulResMstData {
/**
* 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 = "RsltSisulResDtlData", description = "발송결과정보 details 조회 response DTO")
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class RsltSisulResDtlData {
/**
* 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;
}
}

@ -8,7 +8,6 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.transaction.Transactional;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
@ -23,10 +22,14 @@ import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiResDataBody;
import kr.xit.biz.ens.model.nice.NiceCiDTO.IpinCiResEncData;
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiRequest;
import kr.xit.biz.sisul.mapper.IBizSisulMapper;
import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulRequest;
import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulResDtlData;
import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulResMstData;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.spring.util.ApiWebClientUtil;
import kr.xit.core.support.utils.Checks;
import kr.xit.core.support.xlsx.StreamingReader;
import kr.xit.ens.cmm.CmmEnsUtils;
import kr.xit.ens.nice.cmm.CmmNiceCiUtils;
import kr.xit.ens.nice.service.INiceCiService;
import lombok.RequiredArgsConstructor;
@ -39,6 +42,7 @@ import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
/**
@ -98,6 +102,23 @@ public class BizSisulService extends EgovAbstractServiceImpl implements IBizSisu
return makeCntc(rslts, fmcExcels, fileReq);
}
@Override
@Transactional(readOnly = true)
public RsltSisulResMstData findSndngResultMaster(final RsltSisulRequest reqDTO) {
CmmEnsUtils.validate(reqDTO);
return mapper.selectSndngResultMaster(reqDTO)
.orElseThrow(() -> BizRuntimeException.create(String.format("[%s] 데이타를 찾을 수 없습니다", reqDTO.getUnitySndngMastrId())));
}
@Override
@Transactional(readOnly = true)
public List<RsltSisulResDtlData> findSndngResultDetails(final RsltSisulRequest reqDTO) {
CmmEnsUtils.validate(reqDTO);
List<RsltSisulResDtlData> resList = mapper.selectSndngResultDetails(reqDTO);
if(resList.isEmpty()) throw BizRuntimeException.create(String.format("[%s] 데이타를 찾을 수 없습니다", reqDTO.getUnitySndngMastrId()));
return mapper.selectSndngResultDetails(reqDTO);
}
private List<FmcInfExcel> parsingFmcExcel(MultipartFile mf) {
final List<FmcInfExcel> fmcExcels = new ArrayList<>();

@ -1,6 +1,10 @@
package kr.xit.biz.sisul.service;
import java.util.List;
import kr.xit.biz.ens.model.cmm.CmmEnsFileInfDTO.FmcExcelUpload;
import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulRequest;
import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulResDtlData;
import kr.xit.biz.sisul.model.SisulSndngResultDTO.RsltSisulResMstData;
/**
* <pre>
@ -19,5 +23,8 @@ import kr.xit.biz.ens.model.cmm.CmmEnsFileInfDTO.FmcExcelUpload;
*/
public interface IBizSisulService {
String fmcExcelUpload(FmcExcelUpload fileReq);
String fmcExcelUpload(final FmcExcelUpload fileReq);
RsltSisulResMstData findSndngResultMaster(final RsltSisulRequest dto);
List<RsltSisulResDtlData> findSndngResultDetails(final RsltSisulRequest dto);
}

@ -55,13 +55,12 @@ public class BizSisulController {
@Operation(summary = "발송결과정보 마스터 조회 - 시설공단 내부시스템에서 호출", description = "발송결과정보 마스터 조회 - 시설공단 내부시스템에서 호출")
@PostMapping(value = "/sndng/result/master", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse findSndngResultMaster(@RequestBody RsltSisulRequest reqDTO) {
return ApiResponseDTO.success();
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 RsltSisulRequest reqDTO) {
return ApiResponseDTO.success();
return ApiResponseDTO.success(service.findSndngResultDetails(reqDTO));
}
}

@ -120,31 +120,38 @@
</insert>
<select id="selectSndngResultMaster" resultType="kr.xit.biz.ens.model.cmm.TmplatManage">
<select id="selectSndngResultMaster" resultType="kr.xit.biz.sisul.model.SisulSndngResultDTO$RsltSisulResMstData">
/** ens-sysul-mysql-mapper|selectSndngResultMaster-발송결과정보 마스터 조회|julim */
SELECT tesn.unity_sndng_mastr_id
, tesn.sndng_se_code
, tesn.tmplat_id
, tesn.sndng_co
, tesn.sndng_process_sttus
, tcsr.requst_dt
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.sisul.model.SisulSndngResultDTO$RsltSisulResDtlData">
/** 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.rgistno /* 등기번호 */
, 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}
</select>
<select id="selectSndngResultDetails" resultType="kr.xit.biz.ens.model.cmm.TmplatManage">
/** ens-sysul-mysql-mapper|selectSndngResultDetails-발송결과정보 상세 조회|julim */
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}
<if test="unitySndngDetailId != null and unitySndngDetailId != ''">
AND tcsr.unity_sndng_detail_id = #{unitySndngDetailId}
</if>
</select>
</mapper>

Loading…
Cancel
Save