feat: post plus 적용

dev
gitea-관리자 1 year ago
parent f09f29dcb4
commit 30f8952c5f

@ -0,0 +1,24 @@
package kr.xit.ens.pplus.mapper;
import java.util.List;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.biz.ens.model.pplus.PplusDTO.BatchAcceptRequest;
/**
* <pre>
* description :
*
* packageName : kr.xit.ens.pplus.mapper
* fileName : IPplusMapper
* author : limju
* date : 2023-11-01
* ======================================================================
*
* ----------------------------------------------------------------------
* 2023-11-01 limju
*
* </pre>
*/
public interface IPplusMapper {
List<BatchAcceptRequest> selectPostPlusSendTgts(final CmmEnsRequestDTO dto);
}

@ -1,6 +1,6 @@
package kr.xit.ens.pplus.service; package kr.xit.ens.pplus.service;
import kr.xit.biz.ens.model.pplus.PplusDTO.PpAcceptRequest; import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.biz.ens.model.pplus.PplusDTO.PpCommonResponse; import kr.xit.biz.ens.model.pplus.PplusDTO.PpCommonResponse;
import kr.xit.biz.ens.model.pplus.PplusDTO.PpStatusRequest; import kr.xit.biz.ens.model.pplus.PplusDTO.PpStatusRequest;
import kr.xit.biz.ens.model.pplus.PplusDTO.PpStatusResponse; import kr.xit.biz.ens.model.pplus.PplusDTO.PpStatusResponse;
@ -21,6 +21,6 @@ import kr.xit.biz.ens.model.pplus.PplusDTO.PpStatusResponse;
* </pre> * </pre>
*/ */
public interface IPplusService { public interface IPplusService {
PpCommonResponse sendBulks(final PpAcceptRequest reqDTO); PpCommonResponse sendBulks(final CmmEnsRequestDTO reqDTO);
PpStatusResponse statusBulks(final PpStatusRequest reqDTO); PpStatusResponse statusBulks(final PpStatusRequest reqDTO);
} }

@ -5,7 +5,9 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO; import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
import kr.xit.biz.ens.model.pplus.PplusDTO.BatchAcceptRequest;
import kr.xit.biz.ens.model.pplus.PplusDTO.PpAcceptReqDataDtl; import kr.xit.biz.ens.model.pplus.PplusDTO.PpAcceptReqDataDtl;
import kr.xit.biz.ens.model.pplus.PplusDTO.PpAcceptReqDataMst; import kr.xit.biz.ens.model.pplus.PplusDTO.PpAcceptReqDataMst;
import kr.xit.biz.ens.model.pplus.PplusDTO.PpAcceptReqDataStruct; import kr.xit.biz.ens.model.pplus.PplusDTO.PpAcceptReqDataStruct;
@ -20,6 +22,7 @@ import kr.xit.core.support.utils.FileUtil;
import kr.xit.core.support.utils.JsonUtils; import kr.xit.core.support.utils.JsonUtils;
import kr.xit.ens.cmm.CmmEnsUtils; import kr.xit.ens.cmm.CmmEnsUtils;
import kr.xit.ens.kt.cmm.CmmKtMmsUtils; import kr.xit.ens.kt.cmm.CmmKtMmsUtils;
import kr.xit.ens.pplus.mapper.IPplusMapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
@ -65,9 +68,19 @@ public class PplusService extends EgovAbstractServiceImpl implements IPplusServi
private String STATUS; private String STATUS;
private final ApiWebClientUtil webClient; private final ApiWebClientUtil webClient;
private IPplusMapper mapper;
@Override @Override
@TraceLogging @TraceLogging
public PpCommonResponse sendBulks(PpAcceptRequest reqDTO) { public PpCommonResponse sendBulks(final CmmEnsRequestDTO reqDTO) {
final List<BatchAcceptRequest> tgtList = mapper.selectPostPlusSendTgts(reqDTO);
return null;
}
@TraceLogging
private PpCommonResponse accept(PpAcceptRequest reqDTO) {
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()); final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
reqDTO.setApiKey(ktMnsInfo.getPplusApiKey()); reqDTO.setApiKey(ktMnsInfo.getPplusApiKey());
JSONObject mstJson = makePpAcceptMstData(); JSONObject mstJson = makePpAcceptMstData();

@ -2,6 +2,7 @@ package kr.xit.ens.pplus.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.CmmEnsRequestDTO;
import kr.xit.biz.ens.model.pplus.PplusDTO.PpAcceptRequest; import kr.xit.biz.ens.model.pplus.PplusDTO.PpAcceptRequest;
import kr.xit.biz.ens.model.pplus.PplusDTO.PpStatusRequest; import kr.xit.biz.ens.model.pplus.PplusDTO.PpStatusRequest;
import kr.xit.core.model.ApiResponseDTO; import kr.xit.core.model.ApiResponseDTO;
@ -63,7 +64,7 @@ public class PplusController {
@Operation(summary = "우편제작접수", description = "우편제작접수 요청<br><a href='/pstFile.html'>우편제작접수</a>") @Operation(summary = "우편제작접수", description = "우편제작접수 요청<br><a href='/pstFile.html'>우편제작접수</a>")
@PostMapping(value = "/accept", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/accept", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
//@PostMapping(value = "/accept", produces = MediaType.APPLICATION_JSON_VALUE) //@PostMapping(value = "/accept", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse send(@ModelAttribute final PpAcceptRequest paramDTO) { public IApiResponse send(@ModelAttribute final CmmEnsRequestDTO paramDTO) {
return ApiResponseDTO.success(service.sendBulks(paramDTO)); return ApiResponseDTO.success(service.sendBulks(paramDTO));
} }

@ -0,0 +1,37 @@
<?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.ens.pplus.mapper.IPplusMapper">
<select id="selectPostPlusSendTgts" resultType="kr.xit.biz.ens.model.pplus.PplusDTO$BatchAcceptRequest">
/** ens-pplus-mapper|selectPostPlusSendTgts-Post Plus 발송 대상 목록 조회|julim */
SELECT tesm.unity_sndng_mastr_id
, tesm.sndng_mastr_id
, CASE WHEN tesm.try_seq = tesm.try_cnt THEN 'send-ok'
ELSE concat('sending', try_seq)
END AS sndngProcessSttus
, tepp.sndng_detail_id
, tepp.unity_sndng_detail_id
, tepp.signgu_code
, tepp.ffnlg_code
, tepp.service_cd
, tepp.con_key
, teppj.master_cols
, teppj.master_rows
, teppj.detail_cols
, teppj.detail_rows
FROM tb_ens_sndng_mastr tesm
JOIN tb_ens_post_plus tepp
ON tesm.sndng_mastr_id=tepp.sndng_mastr_id
AND tesm.signgu_code = tepp.signgu_code
AND tesm.ffnlg_code = tepp.ffnlg_code
JOIN tb_ens_post_plus_json teppj
ON tepp.unity_sndng_detail_id = teppj.unity_sndng_detail_id
AND tepp.con_key = teppj.con_key
AND tepp.sn = teppj.sn
WHERE tepp.sndng_mastr_id = #{sndngMastrId}
AND tesm.signgu_code = #{signguCode}
AND tesm.ffnlg_code = #{ffnlgCode}
</select>
</mapper>

@ -5,7 +5,6 @@ import java.util.Optional;
import kr.xit.biz.ens.model.EnsDTO; import kr.xit.biz.ens.model.EnsDTO;
import kr.xit.biz.ens.model.EnsDTO.SndngMssageParam; import kr.xit.biz.ens.model.EnsDTO.SndngMssageParam;
import kr.xit.biz.ens.model.EnsKtBcDTO; import kr.xit.biz.ens.model.EnsKtBcDTO;
import kr.xit.biz.ens.model.EnsPostPlusDTO;
import kr.xit.biz.ens.model.cntc.CntcDTO; import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatus; import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatus;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.OneTimeToken; import kr.xit.biz.ens.model.kakao.KkopayDocDTO.OneTimeToken;
@ -312,8 +311,6 @@ public interface IEnsBatchMapper {
Optional<EnsKtBcDTO> selectKtBcMstTgtInfo(final SndngMssageParam dto); Optional<EnsKtBcDTO> selectKtBcMstTgtInfo(final SndngMssageParam dto);
List<KtMainSendReqData> selectKtBcSendTgts(final SndngMssageParam dto); List<KtMainSendReqData> selectKtBcSendTgts(final SndngMssageParam dto);
int updateKtBcMst(final SndngMssageParam dto); int updateKtBcMst(final SndngMssageParam dto);
List<EnsPostPlusDTO> selectPostPlusSendTgts(final SndngMssageParam dto);
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// send // send
//---------------------------------------------------------------------- //----------------------------------------------------------------------

@ -18,7 +18,6 @@ import kr.xit.biz.ens.model.EnsDTO;
import kr.xit.biz.ens.model.EnsDTO.SendKakaoTgt; import kr.xit.biz.ens.model.EnsDTO.SendKakaoTgt;
import kr.xit.biz.ens.model.EnsDTO.SndngMssageParam; import kr.xit.biz.ens.model.EnsDTO.SndngMssageParam;
import kr.xit.biz.ens.model.EnsKtBcDTO; import kr.xit.biz.ens.model.EnsKtBcDTO;
import kr.xit.biz.ens.model.EnsPostPlusDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.Receiver; import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.Receiver;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendReq; import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendReq;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendRequests; import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendRequests;
@ -441,7 +440,15 @@ public class EnsBatchSendService extends EgovAbstractServiceImpl implements IEns
private void sendBulkPplus(final SndngMssageParam dto) { private void sendBulkPplus(final SndngMssageParam dto) {
final String url = apiHost + apiPplusBulkSend; final String url = apiHost + apiPplusBulkSend;
final List<EnsPostPlusDTO> tgtList = mapper.selectPostPlusSendTgts(dto); ApiResponseDTO responseDTO = apiWebClient.exchange(
url,
HttpMethod.POST,
dto,
ApiResponseDTO.class,
CmmEnsBizUtils.getHeadeMap());

@ -518,7 +518,7 @@
, 'PST' , 'PST'
, teusd.unity_sndng_mastr_id , teusd.unity_sndng_mastr_id
, tetm.post_dlvr_se , tetm.post_dlvr_se
, tetm.addrse_co , teusm.sndng_co
, tetm.post_tmplat_code , tetm.post_tmplat_code
, teppj.sn , teppj.sn
, now() , now()
@ -771,37 +771,6 @@
ORDER BY tekbd.sndng_detail_id ORDER BY tekbd.sndng_detail_id
</select> </select>
<select id="selectPostPlusSendTgts" resultType="kr.xit.biz.ens.model.EnsPostPlusDTO">
/** ens-mysql-mapper|selectPostPlusSendTgts-Post Plus 발송 대상 목록 조회|julim */
SELECT tesm.unity_sndng_mastr_id
, tesm.sndng_mastr_id
, CASE WHEN tesm.try_seq = tesm.try_cnt THEN 'send-ok'
ELSE concat('sending', try_seq)
END AS sndngProcessSttus
, tepp.sndng_detail_id
, tepp.unity_sndng_detail_id
, tepp.signgu_code
, tepp.ffnlg_code
, tepp.service_cd
, tepp.con_key
, teppj.master_cols
, teppj.master_rows
, teppj.detail_cols
, teppj.detail_rows
FROM tb_ens_sndng_mastr tesm
JOIN tb_ens_post_plus tepp
ON tesm.sndng_mastr_id=tepp.sndng_mastr_id
AND tesm.signgu_code = tepp.signgu_code
AND tesm.ffnlg_code = tepp.ffnlg_code
JOIN tb_ens_post_plus_json teppj
ON tepp.unity_sndng_detail_id = teppj.unity_sndng_detail_id
AND tepp.con_key = teppj.con_key
AND tepp.sn = teppj.sn
WHERE tepp.sndng_mastr_id = #{sndngMastrId}
AND tesm.signgu_code = #{signguCode}
AND tesm.ffnlg_code = #{ffnlgCode}
</select>
<select id="selectSndProcessStatus" resultType="kr.xit.biz.ens.model.EnsDTO$SndngMssageParam"> <select id="selectSndProcessStatus" resultType="kr.xit.biz.ens.model.EnsDTO$SndngMssageParam">
/** ens-mysql-mapper|selectSndProcessStatus-발송상태정보조회|julim */ /** ens-mysql-mapper|selectSndProcessStatus-발송상태정보조회|julim */
SELECT tesm.sndng_mastr_id SELECT tesm.sndng_mastr_id

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import java.io.Serializable;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO; import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
@ -682,4 +683,110 @@ public class PplusDTO {
@Schema(requiredMode = RequiredMode.AUTO) @Schema(requiredMode = RequiredMode.AUTO)
private String ; private String ;
} }
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public static class BatchAcceptRequest implements Serializable {
/**
* id
*/
private String unitySndngMastrId;
/**
* id
*/
private String unitySndngDetailId;
/**
* id
*/
private String sndngMastrId;
/**
* id
*/
private String sndngDetailId;
/**
*
*/
private String signguCode;
/**
*
*/
private String ffnlgCode;
/**
*
*/
private String serviceCd;
/**
*
*/
private String conKey;
/**
*
*/
private String sndngProcessSttus;
private String masterCols;
private String masterRows;
private String detailCols;
private String detailRows;
/**
*
*/
private String senderNm;
/**
*
*/
private String senderZipNo;
/**
*
*/
private String senderAddr;
/**
*
*/
private String senderDetailAddr;
/**
*
*/
private String receiverSendNo;
/**
*
*/
private String receiverNm;
/**
*
*/
private String receiverZipNo;
/**
*
*/
private String receiverAddr;
/**
*
*/
private String receiverDetailAddr;
/**
* 1
*/
private String sschnge1;
/**
* 2
*/
private String sschnge2;
/**
* 3
*/
private String sschnge3;
}
} }

Loading…
Cancel
Save