|
|
|
@ -216,9 +216,13 @@ public class ApiConstants {
|
|
|
|
|
*/
|
|
|
|
|
CHUNCHEON("51110"),
|
|
|
|
|
/**
|
|
|
|
|
* 승화원 : NICE CI는 교통시설운영처와 동일한 코드 사용
|
|
|
|
|
* 천안동남구청
|
|
|
|
|
*/
|
|
|
|
|
FUNERAL("88316"),
|
|
|
|
|
CHEONAN_ES("44131"),
|
|
|
|
|
/**
|
|
|
|
|
* 천안서북
|
|
|
|
|
*/
|
|
|
|
|
CHEONAN_WN("44133"),
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
private final String code;
|
|
|
|
@ -247,13 +251,13 @@ public class ApiConstants {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <pre>
|
|
|
|
|
* 발송처리상태 : ENS003 매핑
|
|
|
|
|
* 춘천의 발송처리상태 : ENS003 매핑
|
|
|
|
|
* 01: 요청, 11: 접수완료, 19: 접수실패
|
|
|
|
|
* 22: 제작완료, 29: 제작실패, 08: 발송완료, 09: 마감, 99: 발송실패
|
|
|
|
|
* </pre>
|
|
|
|
|
*/
|
|
|
|
|
@Getter
|
|
|
|
|
public enum MappingSndngProcessStatus {
|
|
|
|
|
public enum MappingCcnSndngProcessStatus {
|
|
|
|
|
ACCEPT("accept", "01"),
|
|
|
|
|
ACCEPT_OK("accept-ok", "11"),
|
|
|
|
|
ACCEPT_FAIL("accept-fail", "19"),
|
|
|
|
@ -274,7 +278,7 @@ public class ApiConstants {
|
|
|
|
|
private final String ensCode;
|
|
|
|
|
private final String trfCode;
|
|
|
|
|
|
|
|
|
|
MappingSndngProcessStatus(String ensCode, String trfCode) {
|
|
|
|
|
MappingCcnSndngProcessStatus(String ensCode, String trfCode) {
|
|
|
|
|
this.ensCode = ensCode;
|
|
|
|
|
this.trfCode = trfCode;
|
|
|
|
|
}
|
|
|
|
@ -287,10 +291,10 @@ public class ApiConstants {
|
|
|
|
|
* </pre>
|
|
|
|
|
*/
|
|
|
|
|
public static String fromTraffic(final String trfCode){
|
|
|
|
|
return Arrays.stream(MappingSndngProcessStatus.values())
|
|
|
|
|
return Arrays.stream(MappingCcnSndngProcessStatus.values())
|
|
|
|
|
.filter(en -> en.getTrfCode().equals(trfCode))
|
|
|
|
|
.findFirst()
|
|
|
|
|
.map(MappingSndngProcessStatus::getEnsCode)
|
|
|
|
|
.map(MappingCcnSndngProcessStatus::getEnsCode)
|
|
|
|
|
.orElseThrow(() -> BizRuntimeException.create(String.format("미정의된 상태코드가[%s]", trfCode)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -302,12 +306,76 @@ public class ApiConstants {
|
|
|
|
|
* </pre>
|
|
|
|
|
*/
|
|
|
|
|
public static String fromEns(final String ensCode){
|
|
|
|
|
return Arrays.stream(MappingSndngProcessStatus.values())
|
|
|
|
|
return Arrays.stream(MappingCcnSndngProcessStatus.values())
|
|
|
|
|
.filter(en -> en.getEnsCode().equals(ensCode))
|
|
|
|
|
.findFirst()
|
|
|
|
|
.map(MappingSndngProcessStatus::getTrfCode)
|
|
|
|
|
.map(MappingCcnSndngProcessStatus::getTrfCode)
|
|
|
|
|
.orElseThrow(() -> BizRuntimeException.create(String.format("미정의된 상태코드가[%s]", ensCode)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <pre>
|
|
|
|
|
* 천안의 발송처리상태 : ENS003 매핑
|
|
|
|
|
* 01: 요청, 11: 접수완료, 19: 접수실패
|
|
|
|
|
* 22: 제작완료, 29: 제작실패, 08: 발송완료, 09: 마감, 99: 발송실패
|
|
|
|
|
* </pre>
|
|
|
|
|
*/
|
|
|
|
|
@Getter
|
|
|
|
|
public enum MappingCanSndngProcessStatus {
|
|
|
|
|
ACCEPT("accept", "accept"),
|
|
|
|
|
ACCEPT_OK("accept-ok", "acptok"),
|
|
|
|
|
ACCEPT_FAIL("accept-fail", "acptfail"),
|
|
|
|
|
MAKE_OK("make-ok", "ensmake"),
|
|
|
|
|
MAKE_FAIL1("make-fail1", "makefail"),
|
|
|
|
|
MAKE_FAIL2("make-fail2", "makefail"),
|
|
|
|
|
MAKE_FAIL3("make-fail3", "makefail"),
|
|
|
|
|
SENDING1("sending1", "ensok"),
|
|
|
|
|
SENDING2("sending2", "ensok"),
|
|
|
|
|
SEND_OK("send-ok", "ensopen"),
|
|
|
|
|
SEND_FAIL1("send-fail1", "ensfail"),
|
|
|
|
|
SEND_FAIL2("send-fail2", "ensfail"),
|
|
|
|
|
SEND_FAIL3("send-fail3", "ensfail"),
|
|
|
|
|
CLOSE("close", "ensclose")
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
private final String ensCode;
|
|
|
|
|
private final String trfCode;
|
|
|
|
|
|
|
|
|
|
MappingCanSndngProcessStatus(String ensCode, String trfCode) {
|
|
|
|
|
this.ensCode = ensCode;
|
|
|
|
|
this.trfCode = trfCode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <pre>
|
|
|
|
|
* traffic 상태코드를 ens 상태코드로 매핑
|
|
|
|
|
* @param trfCode
|
|
|
|
|
* @return traffic 상태코드에 매핑된 ens 상태코드
|
|
|
|
|
* </pre>
|
|
|
|
|
*/
|
|
|
|
|
public static String fromTraffic(final String trfCode){
|
|
|
|
|
return Arrays.stream(MappingCcnSndngProcessStatus.values())
|
|
|
|
|
.filter(en -> en.getTrfCode().equals(trfCode))
|
|
|
|
|
.findFirst()
|
|
|
|
|
.map(MappingCcnSndngProcessStatus::getEnsCode)
|
|
|
|
|
.orElseThrow(() -> BizRuntimeException.create(String.format("미정의된 상태코드가[%s]", trfCode)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <pre>
|
|
|
|
|
* ens 상태코드를 traffic 상태코드로 매핑
|
|
|
|
|
* @param ensCode
|
|
|
|
|
* @return ens 상태코드에 매핑된 traffic 상태코드
|
|
|
|
|
* </pre>
|
|
|
|
|
*/
|
|
|
|
|
public static String fromEns(final String ensCode){
|
|
|
|
|
return Arrays.stream(MappingCcnSndngProcessStatus.values())
|
|
|
|
|
.filter(en -> en.getEnsCode().equals(ensCode))
|
|
|
|
|
.findFirst()
|
|
|
|
|
.map(MappingCcnSndngProcessStatus::getTrfCode)
|
|
|
|
|
.orElseThrow(() -> BizRuntimeException.create(String.format("미정의된 상태코드가[%s]", ensCode)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|