feat: post plus 종적 조회 연계 배달 상세 항목 추가

main
kjh 8 months ago
parent 288ed421bd
commit c9249a2a1c

@ -382,7 +382,7 @@ public interface IEnsBatchMapper {
* @return List<String>
*/
<T> List<PplusResult> selectPplusUnitySndngDetailIdsByRgistNo(final T t);
int updatePplusDlvrStatusFromEPostByRgistNo(final EpostTraceResTrackInfo dto);
int updatePplusDlvrStatusFromEPostByRgistNo(final PplusResult dto);
//----------------------------------------------------------------------
// status
//----------------------------------------------------------------------

@ -356,21 +356,21 @@ public class EnsBatchStatusService extends AbstractService implements IEnsBatchS
// 종적추적 결과 set : 실패시 BizRuntimeException
// 배달완료시 시간 set
EpostTraceResTrackInfo traceDTO = epostResDTO.result();
mapper.updatePplusDlvrStatusFromEPostByRgistNo(traceDTO);
String statue = traceDTO.getDetaileTrackList().get(traceDTO.getDetaileTrackList().size()-1).getStatue().replace("\n", "");
dto.setDlvrSttus(traceDTO.getTrackState());
dto.setDlvrDetail(statue);
dto.setSenderData(Checks.isNotEmpty(traceDTO.getSenderData()) ? traceDTO.getSenderData() + "0000" : null);
dto.setReceiveDate(traceDTO.getReceiveDate());
dto.setReceiveName(traceDTO.getReceiveName());
mapper.updatePplusDlvrStatusFromEPostByRgistNo(dto);
}catch (BizRuntimeException e){
//TODO :: error 처리 확인 필요
mapper.updatePplusDlvrStatusFromEPostByRgistNo(
EpostTraceResTrackInfo.builder()
.regiNo(dto.getRgistNo())
.trackState(e.getMessage())
.build()
);
dto.setDlvrSttus(e.getMessage());
dto.setErrorCn(e.getMessage());
mapper.updatePplusDlvrStatusFromEPostByRgistNo(dto);
}
mapper.savePplusCntcSndngResult(dto);
}

@ -1003,15 +1003,16 @@
AND rgist_no &lt;= #{endRgistNo}
</select>
<update id="updatePplusDlvrStatusFromEPostByRgistNo" parameterType="kr.xit.biz.ens.model.epost.EPostDTO$EpostTraceResTrackInfo">
<update id="updatePplusDlvrStatusFromEPostByRgistNo" parameterType="kr.xit.biz.ens.model.pplus.PplusDTO$PplusResult">
/** ens-mysql-mapper|updatePplusDlvrStatusFromEPostByRgistNo-Post plus 우체국 종적 추적을 통한 배송상태 변경|julim */
UPDATE tb_ens_post_plus
SET dlvr_sttus = SUBSTR(#{trackState}, 1, 20)
SET dlvr_sttus = SUBSTR(#{dlvrSttus}, 1, 20)
, dlvr_detail = #{dlvrDetail}
, dlvr_de = REPLACE(#{receiveDate}, "-", "")
, recevie_name = #{receiveName}
, updt_dt = now()
, updusr = 'batch'
WHERE rgist_no = #{regiNo}
WHERE rgist_no = #{rgistNo}
</update>
<!-- =================================================================================== -->
<!-- ================================ status ============================================= -->

@ -100,11 +100,12 @@ public class EPostDTO {
throw BizRuntimeException.create(this.header.errorMessage);
}
String date = trackInfo.getDetaileTrackList().get(trackInfo.getDetaileTrackList().size()-1).getDate();
String time = trackInfo.getDetaileTrackList().get(trackInfo.getDetaileTrackList().size()-1).getTime();
// 배달 완료시 배달시간 set
if(ObjectUtils.isNotEmpty(this.trackInfo.receiveDate)){
String time = trackInfo.getDetaileTrackList().get(trackInfo.getDetaileTrackList().size()-1)
.getTime();
this.trackInfo.setReceiveDate(this.trackInfo.receiveDate + time.replace(":", ""));
if(ObjectUtils.isNotEmpty(date)){
this.trackInfo.setReceiveDate(date.replace("-", "") + time.replace(":", ""));
}
return this.trackInfo;
}
@ -247,7 +248,7 @@ public class EPostDTO {
@AllArgsConstructor
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "detaileTrackList")
private static class EpostTraceResDtlTrack {
public static class EpostTraceResDtlTrack {
/**
* <pre>
* : - 1
@ -282,7 +283,7 @@ public class EPostDTO {
* </pre>
*/
@Schema(requiredMode = RequiredMode.REQUIRED, title = "처리 상태")
private String status;
private String statue;
/**
* <pre>

@ -755,6 +755,15 @@ public class PplusDTO {
* </pre>
*/
private String rgistNo;
/**
* <pre>
*
* detaileTrackList statue : (, 1 )
* </pre>
*/
private String dlvrDetail;
}

Loading…
Cancel
Save