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

main
kjh 8 months ago
parent 288ed421bd
commit c9249a2a1c

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

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

@ -1003,15 +1003,16 @@
AND rgist_no &lt;= #{endRgistNo} AND rgist_no &lt;= #{endRgistNo}
</select> </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 */ /** ens-mysql-mapper|updatePplusDlvrStatusFromEPostByRgistNo-Post plus 우체국 종적 추적을 통한 배송상태 변경|julim */
UPDATE tb_ens_post_plus 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}, "-", "") , dlvr_de = REPLACE(#{receiveDate}, "-", "")
, recevie_name = #{receiveName} , recevie_name = #{receiveName}
, updt_dt = now() , updt_dt = now()
, updusr = 'batch' , updusr = 'batch'
WHERE rgist_no = #{regiNo} WHERE rgist_no = #{rgistNo}
</update> </update>
<!-- =================================================================================== --> <!-- =================================================================================== -->
<!-- ================================ status ============================================= --> <!-- ================================ status ============================================= -->

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

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

Loading…
Cancel
Save