diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsBatchMapper.java b/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsBatchMapper.java index 6f5350f..e79aa7b 100644 --- a/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsBatchMapper.java +++ b/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsBatchMapper.java @@ -382,7 +382,7 @@ public interface IEnsBatchMapper { * @return List */ List selectPplusUnitySndngDetailIdsByRgistNo(final T t); - int updatePplusDlvrStatusFromEPostByRgistNo(final EpostTraceResTrackInfo dto); + int updatePplusDlvrStatusFromEPostByRgistNo(final PplusResult dto); //---------------------------------------------------------------------- // status //---------------------------------------------------------------------- diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchStatusService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchStatusService.java index 053cb88..a858737 100644 --- a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchStatusService.java +++ b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchStatusService.java @@ -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); } diff --git a/mens-batch/src/main/resources/egovframework/mapper/biz/ens-mysql-mapper.xml b/mens-batch/src/main/resources/egovframework/mapper/biz/ens-mysql-mapper.xml index 9843d8d..dc99612 100644 --- a/mens-batch/src/main/resources/egovframework/mapper/biz/ens-mysql-mapper.xml +++ b/mens-batch/src/main/resources/egovframework/mapper/biz/ens-mysql-mapper.xml @@ -1003,15 +1003,16 @@ AND rgist_no <= #{endRgistNo} - + /** 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} diff --git a/mens-core/src/main/java/kr/xit/biz/ens/model/epost/EPostDTO.java b/mens-core/src/main/java/kr/xit/biz/ens/model/epost/EPostDTO.java index 4d92ee1..d7edc0a 100644 --- a/mens-core/src/main/java/kr/xit/biz/ens/model/epost/EPostDTO.java +++ b/mens-core/src/main/java/kr/xit/biz/ens/model/epost/EPostDTO.java @@ -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 { /** *
              * 정렬순서 : 필수 - 1자리
@@ -282,7 +283,7 @@ public class EPostDTO {
              * 
*/ @Schema(requiredMode = RequiredMode.REQUIRED, title = "처리 상태") - private String status; + private String statue; /** *
diff --git a/mens-core/src/main/java/kr/xit/biz/ens/model/pplus/PplusDTO.java b/mens-core/src/main/java/kr/xit/biz/ens/model/pplus/PplusDTO.java
index a5c6c6b..373ffcb 100644
--- a/mens-core/src/main/java/kr/xit/biz/ens/model/pplus/PplusDTO.java
+++ b/mens-core/src/main/java/kr/xit/biz/ens/model/pplus/PplusDTO.java
@@ -755,6 +755,15 @@ public class PplusDTO {
          * 
*/ private String rgistNo; + + /** + *
+         * 배달상세
+         * 종적 조회 연계 detaileTrackList 마지막 statue : 미배달 주소불명 (반송불요, 1개월 보관)
+         * 
+ */ + private String dlvrDetail; + }