feat: Post plus 종적 추적 반영

dev
Jonguk. Lim 1 year ago
parent 9c9db797b5
commit 4222759c51

@ -7,6 +7,7 @@ import kr.xit.biz.ens.model.EnsKtBcDTO;
import kr.xit.biz.ens.model.cmm.SndngMssageParam;
import kr.xit.biz.ens.model.cmm.TmplatManage;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.epost.EPostDTO.EpostTraceResTrackInfo;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatus;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO.OneTimeToken;
import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendReqData;
@ -364,6 +365,7 @@ public interface IEnsBatchMapper {
int selectCountRgistNo(final String rgistNo);
int updatePplusRgistNo(final PpStatusResMapping dto);
List<String> selectPplusRgistNos(final String unitySndngMastrId);
int updatePplusDlvrStatusFromEPostByRgistNo(final EpostTraceResTrackInfo dto);
//----------------------------------------------------------------------
// status
//----------------------------------------------------------------------

@ -13,6 +13,7 @@ import kr.xit.biz.ens.model.EnsDTO;
import kr.xit.biz.ens.model.cmm.SndngMssageParam;
import kr.xit.biz.ens.model.cntc.CntcDTO;
import kr.xit.biz.ens.model.epost.EPostDTO.EpostTraceRequest;
import kr.xit.biz.ens.model.epost.EPostDTO.EpostTraceResTrackInfo;
import kr.xit.biz.ens.model.epost.EPostDTO.EpostTraceResponse;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusRequests;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkStatusResponses;
@ -247,10 +248,6 @@ public class EnsBatchStatusService extends EgovAbstractServiceImpl implements IE
}
}
}else{
extractService.updatePplusSndngMstFailStatus(unitySndngMstId, "send-fail", resDTO.get(), resDTO.get(), "[send] Post Plus 발송(Accept)요청 실패");
}
@ -312,6 +309,22 @@ public class EnsBatchStatusService extends EgovAbstractServiceImpl implements IE
EpostTraceResponse.class);
//final String unitySndngMstId = resDTO.get연계식별키();
System.out.println(""+resDTO);
try{
assert resDTO != null;
EpostTraceResTrackInfo traceDTO = resDTO.result();
mapper.updatePplusDlvrStatusFromEPostByRgistNo(traceDTO);
}catch (BizRuntimeException e){
//TODO :: error 처리 확인 필요
mapper.updatePplusDlvrStatusFromEPostByRgistNo(
EpostTraceResTrackInfo.builder()
.regiNo(rgistNo)
.trackState(e.getMessage())
.build()
);
}
}
});
}

@ -954,6 +954,17 @@
ON tesm.sndng_mastr_id = tepp.sndng_mastr_id
WHERE tesm.unity_sndng_mastr_id = #{unitySndngMastrId}
</select>
<update id="updatePplusDlvrStatusFromEPostByRgistNo" parameterType="kr.xit.biz.ens.model.epost.EPostDTO$EpostTraceResTrackInfo">
/** ens-mysql-mapper|updatePplusDlvrStatusFromEPostByRgistNo-Post plus 우체국 종적 추적을 통한 배송상태 변경|julim */
UPDATE tb_ens_post_plus
SET dlvr_sttus = SUBSTR(#{trackStatus}, 1, 20)
, dlvr_de = REPLACE(#{receiveDate}, "-", "")
, receive_name = #{receiveName}
, updt_dt = now()
, updusr = 'batch'
WHERE rgist_no = #{regiNo}
</update>
<!-- =================================================================================== -->
<!-- ================================ status ============================================= -->
<!-- =================================================================================== -->

@ -10,14 +10,17 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.model.IApiResponse;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.ObjectUtils;
/**
* <pre>
@ -82,6 +85,7 @@ public class EPostDTO {
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "response")
@Builder
public static class EpostTraceResponse implements IApiResponse {
@Schema(requiredMode = RequiredMode.REQUIRED)
@ -91,6 +95,13 @@ public class EPostDTO {
@Schema(requiredMode = RequiredMode.REQUIRED)
@XmlElement(name = "trackInfo")
private EpostTraceResTrackInfo trackInfo;
public EpostTraceResTrackInfo result(){
if("N".equals(this.header.successYN)){
throw BizRuntimeException.create(this.header.errorMessage);
}
return this.trackInfo;
}
}
/**
@ -149,6 +160,7 @@ public class EPostDTO {
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "trackInfo")
@Builder
public static class EpostTraceResTrackInfo {
/**

Loading…
Cancel
Save