feat: 춘천/천안 traffic 코드 적용

swagger 테스트 데이타 추가
main
Jonguk. Lim 3 months ago
parent 15f1904d64
commit 65b5e690bb

@ -40,14 +40,14 @@ import lombok.extern.slf4j.Slf4j;
public class BizKtGbsController {
private static final String PARAM1 = """
{
"signguCode": "88328",
"signguCode": "44131",
"ffnlgCode": "11",
"profile": "local"
}
""";
private static final String PARAM2 = """
{
"signguCode": "88316",
"signguCode": "44133",
"ffnlgCode": "11",
"profile": "local"
}
@ -60,10 +60,10 @@ public class BizKtGbsController {
mediaType = "application/json",
examples = {
@ExampleObject(
name = "교통시설운영처",
name = "천안시동남구청",
value = PARAM1),
@ExampleObject(
name = "승화원",
name = "천안시서북구청",
value = PARAM2)
})
})

@ -82,14 +82,17 @@ public class MobilePageController {
produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse findKtMblPage(@RequestParam final String token, final HttpServletRequest request) {
final String uri = request.getRequestURI();
//FIXME: KT mblpage 적용 안됨
final KtTokenDTO.KtTokenConfirmRequest cfmReqDTO = KtTokenDTO.KtTokenConfirmRequest.builder()
.signguCode(SignguCode.CHUNCHEON.getCode())
.ffnlgCode(ApiConstants.FFNLN_CODE)
.accessToken(token)
.build();
//FIXME: KT mblpage 적용 안됨
if(uri.contains("meMblPage")){
cfmReqDTO.setSignguCode(SignguCode.FUNERAL.getCode());
cfmReqDTO.setSignguCode(SignguCode.CHEONAN_ES.getCode());
//cfmReqDTO.setSignguCode(SignguCode.CHEONAN_WN.getCode());
}
return service.findKtMblPage(cfmReqDTO);
}

@ -106,7 +106,7 @@ public class BizNiceCiService extends AbstractService implements IBizNiceCiServi
// 공개키 정보 캐쉬 삭제
cacheService.removeNiceCiInfoCache(niceDTO.getSignguCode(), niceDTO.getFfnlgCode());
updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.TOKEN);
//updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.TOKEN);
//----------------------------------------------------------------------------------
}
@ -146,7 +146,7 @@ public class BizNiceCiService extends AbstractService implements IBizNiceCiServi
// 공개키 정보 캐쉬 삭제
cacheService.removeNiceCiInfoCache(niceDTO.getSignguCode(), niceDTO.getFfnlgCode());
updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.TOKEN);
//updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.TOKEN);
}else{
throw BizRuntimeException.create("토큰을 폐기하지 못했습니다.");
}
@ -184,7 +184,7 @@ public class BizNiceCiService extends AbstractService implements IBizNiceCiServi
// 공개키 정보 캐쉬 삭제
cacheService.removeNiceCiInfoCache(niceDTO.getSignguCode(), niceDTO.getFfnlgCode());
updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.PUBLIC_KEY);
//updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.PUBLIC_KEY);
return dataBody;
}
@ -228,7 +228,7 @@ public class BizNiceCiService extends AbstractService implements IBizNiceCiServi
// 공개키 정보 캐쉬 삭제
cacheService.removeNiceCiInfoCache(niceDTO.getSignguCode(), niceDTO.getFfnlgCode());
updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.SYM_KEY);
//updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.SYM_KEY);
return symkeyStatInfo;
}
@ -247,21 +247,20 @@ public class BizNiceCiService extends AbstractService implements IBizNiceCiServi
/**
* <pre>
* Nice CI sync
* Nice CI sync
* @param niceDTO NiceCiInfo
* @param reqDTO NiceCiRequest
* @param wrkDiv NiceCiWrkDiv
* </pre>
*/
// FIXME : SignguCode
private void updateNiceCerfInfoSync(final NiceCiInfo niceDTO, final NiceCiRequest reqDTO, final NiceCiWrkDiv wrkDiv) {
// 교통시설운영처 또는 장사시설인 경우 sync ----------------------------------------
if(SignguCode.CHUNCHEON.getCode().equals(reqDTO.getSignguCode())){
niceDTO.setSignguCode(SignguCode.FUNERAL.getCode());
if(SignguCode.CHEONAN_ES.getCode().equals(reqDTO.getSignguCode())){
niceDTO.setSignguCode(SignguCode.CHEONAN_WN.getCode());
}
if(SignguCode.FUNERAL.getCode().equals(reqDTO.getSignguCode())){
niceDTO.setSignguCode(SignguCode.CHUNCHEON.getCode());
if(SignguCode.CHEONAN_WN.getCode().equals(reqDTO.getSignguCode())){
niceDTO.setSignguCode(SignguCode.CHEONAN_ES.getCode());
}
switch(wrkDiv){

@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import io.swagger.v3.oas.annotations.tags.Tag;
import kr.xit.batch.ens.job.SndngAcceptJobConfig;
import kr.xit.batch.ens.job.SndngCloseJobConfig;
@ -66,6 +68,44 @@ public class BatchJobWebController {
private final SndngStatusBulksJobConfig statusJobConfig;
private final SndngCloseJobConfig closeJobConfig;
private static final String CAN_1 = """
{
"signguCode": "44131",
"ffnlgCode": "11",
"profile": "local"
}
""";
private static final String CAN_2 = """
{
"signguCode": "44133",
"ffnlgCode": "11",
"profile": "local"
}
""";
private static final String CCN = """
{
"signguCode": "41220",
"ffnlgCode": "11",
"profile": "local"
}
""";
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(
mediaType = "application/json",
examples = {
@ExampleObject(
name = "춘천",
value = CCN),
@ExampleObject(
name = "천안시 동남구청",
value = CAN_1),
@ExampleObject(
name = "천안시 서북구청",
value = CAN_2)
})
})
@Operation(summary = "accept", description = "accept")
@PostMapping(value = "/accept", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse accept(@RequestBody final CmmEnsRequestDTO reqDTO) {
@ -88,6 +128,21 @@ public class BatchJobWebController {
return ApiResponseDTO.success(HttpStatus.OK);
}
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(
mediaType = "application/json",
examples = {
@ExampleObject(
name = "춘천",
value = CCN),
@ExampleObject(
name = "천안시 동남구청",
value = CAN_1),
@ExampleObject(
name = "천안시 서북구청",
value = CAN_2)
})
})
@Operation(summary = "make", description = "make")
@PostMapping(value = "/make", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse make(@RequestBody final CmmEnsRequestDTO reqDTO) {
@ -111,6 +166,21 @@ public class BatchJobWebController {
return ApiResponseDTO.success(HttpStatus.OK);
}
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(
mediaType = "application/json",
examples = {
@ExampleObject(
name = "춘천",
value = CCN),
@ExampleObject(
name = "천안시 동남구청",
value = CAN_1),
@ExampleObject(
name = "천안시 서북구청",
value = CAN_2)
})
})
@Operation(summary = "close", description = "close")
@PostMapping(value = "/close", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse close(@RequestBody final CmmEnsRequestDTO reqDTO) {
@ -134,6 +204,21 @@ public class BatchJobWebController {
return ApiResponseDTO.success(HttpStatus.OK);
}
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(
mediaType = "application/json",
examples = {
@ExampleObject(
name = "춘천",
value = CCN),
@ExampleObject(
name = "천안시 동남구청",
value = CAN_1),
@ExampleObject(
name = "천안시 서북구청",
value = CAN_2)
})
})
@Operation(summary = "sendBulks", description = "sendBulks")
@PostMapping(value = "/sendBulks", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse sendBulks(@RequestBody final CmmEnsRequestDTO reqDTO) {
@ -157,6 +242,21 @@ public class BatchJobWebController {
return ApiResponseDTO.success(HttpStatus.OK);
}
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(
mediaType = "application/json",
examples = {
@ExampleObject(
name = "춘천",
value = CCN),
@ExampleObject(
name = "천안시 동남구청",
value = CAN_1),
@ExampleObject(
name = "천안시 서북구청",
value = CAN_2)
})
})
@Operation(summary = "statusBulks", description = "statusBulks")
@PostMapping(value = "/statusBulks", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse statusBulks(@RequestBody final CmmEnsRequestDTO reqDTO) {

@ -55,4 +55,15 @@ public class CmmEnsBizUtils {
return ApiConstants.SndngSeCode.getSndngSeCode(seCode);
}
/**
* set
* @param isChuncheon
* @param dto SndngMssageParam
* @param processStatus
*/
public static void setMappingProcessStatus(boolean isChuncheon, final SndngMssageParam dto, final String processStatus) {
if(isChuncheon) dto.setNewSndngProcessSttus(ApiConstants.MappingCcnSndngProcessStatus.fromEns(processStatus));
else dto.setNewSndngProcessSttus(ApiConstants.MappingCanSndngProcessStatus.fromEns(processStatus));
}
}

@ -23,7 +23,8 @@ import KISINFO.VNO.VNOInterop;
import egovframework.com.cmm.util.EgovDateUtil;
import egovframework.com.cmm.util.EgovStringUtil;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.MappingSndngProcessStatus;
import kr.xit.biz.common.ApiConstants.MappingCanSndngProcessStatus;
import kr.xit.biz.common.ApiConstants.MappingCcnSndngProcessStatus;
import kr.xit.biz.common.ApiConstants.SndngProcessStatus;
import kr.xit.biz.common.ApiConstants.SndngSeCode;
import kr.xit.biz.ens.cmm.CmmEnsBizUtils;
@ -123,7 +124,8 @@ public class EnsBatchAcceptService extends AbstractService implements IEnsBatchA
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void accept(final EnsDTO.BatchEnsRequest reqDTO) {
reqDTO.setSndngProcessSttus(MappingSndngProcessStatus.fromEns(SndngProcessStatus.ACCEPT.getCode()));
if(IS_CCN) reqDTO.setSndngProcessSttus(MappingCcnSndngProcessStatus.fromEns(SndngProcessStatus.ACCEPT.getCode()));
else reqDTO.setSndngProcessSttus(MappingCanSndngProcessStatus.fromEns(SndngProcessStatus.ACCEPT.getCode()));
final List<SndngMssageParam> list = mapper.selectAcceptTgts(reqDTO);
String sndngDt = null;
@ -181,7 +183,7 @@ public class EnsBatchAcceptService extends AbstractService implements IEnsBatchA
insCnt));
}
dto.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(SndngProcessStatus.ACCEPT_OK.getCode()));
CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, SndngProcessStatus.ACCEPT_OK.getCode());
if (mapper.updateProcessSttusCntcSndngMst(dto) != 1) {
throw BizRuntimeException.create("접수 데이타 생성(통합발송마스터 상태변경) 실패");
}
@ -475,13 +477,13 @@ public class EnsBatchAcceptService extends AbstractService implements IEnsBatchA
private void updateAcceptCntcSndngMstFailStatus(final List<String> mstIdList, final String stsErrMsg) {
for (String id : mstIdList) {
final SndngMssageParam paramDTO = SndngMssageParam.builder()
final SndngMssageParam dto = SndngMssageParam.builder()
.unitySndngMastrId(id)
.newSndngProcessSttus(MappingSndngProcessStatus.fromEns(SndngProcessStatus.ACCEPT_FAIL.getCode()))
.errorMssage(stsErrMsg)
.build();
if (mapper.updateProcessSttusCntcSndngMst(paramDTO) != 1) {
CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, SndngProcessStatus.ACCEPT_FAIL.getCode());
if (mapper.updateProcessSttusCntcSndngMst(dto) != 1) {
throw BizRuntimeException.create("[accept]연계 발송 마스터 상태변경 실패");
}
}

@ -7,6 +7,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.ens.cmm.CmmEnsBizUtils;
import kr.xit.biz.ens.mapper.IEnsBatchMapper;
import kr.xit.biz.ens.model.EnsDTO;
import kr.xit.biz.ens.model.cmm.SndngMssageParam;
@ -55,10 +56,10 @@ public class EnsBatchCloseService extends AbstractService implements IEnsBatchCl
final SndngMssageParam paramDTO = SndngMssageParam.builder()
.unitySndngMastrId(id)
.sndngProcessSttus(reqDTO.getSndngProcessSttus())
.newSndngProcessSttus(ApiConstants.SndngProcessStatus.CLOSE.getCode())
.build();
if(IS_CCN) paramDTO.setNewSndngProcessSttus(ApiConstants.MappingSndngProcessStatus.fromEns(paramDTO.getNewSndngProcessSttus()));
CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, paramDTO, ApiConstants.SndngProcessStatus.CLOSE.getCode());
if (mapper.updateProcessSttusCntcSndngMst(paramDTO) != 1) {
throw BizRuntimeException.create("[close]연계 발송 마스터 상태변경 실패");
}

@ -14,8 +14,8 @@ import org.springframework.transaction.annotation.Transactional;
import kr.xit.batch.ens.task.cmm.TaskCmmUtils;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.MappingSndngProcessStatus;
import kr.xit.biz.common.ApiConstants.SndngSeCode;
import kr.xit.biz.ens.cmm.CmmEnsBizUtils;
import kr.xit.biz.ens.mapper.IEnsBatchMapper;
import kr.xit.biz.ens.model.EnsDTO;
import kr.xit.biz.ens.model.cmm.SndngMssageParam;
@ -234,17 +234,17 @@ public class EnsBatchExtractService extends AbstractService implements
final String status = dto.getNewSndngProcessSttus();
if ("SndngAcceptJob".equals(dto.getErrorCode())) {
if(IS_CCN) dto.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(status));
CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, status);
mapper.updateProcessSttusCntcSndngMst(dto);
} else if ("SndngMakeJob".equals(dto.getErrorCode())) {
if(IS_CCN) dto.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(status));
CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, status);
mapper.updateProcessSttusCntcSndngMst(dto);
dto.setNewSndngProcessSttus(status);
mapper.updateProcessSttusUnitySndngMst(dto);
} else if ("SndngSendBulksJob".equals(dto.getErrorCode())) {
if(IS_CCN) dto.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(status));
CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, status);
mapper.updateProcessSttusCntcSndngMst(dto);
dto.setNewSndngProcessSttus(status);
mapper.updateProcessSttusUnitySndngMst(dto);
@ -278,7 +278,7 @@ public class EnsBatchExtractService extends AbstractService implements
private void updateMstTable(SndngMssageParam paramDTO, SndngSeCode seCode) {
final String status = paramDTO.getNewSndngProcessSttus();
if(IS_CCN) paramDTO.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(status));
CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, paramDTO, status);
if(mapper.updateProcessSttusCntcSndngMst(paramDTO) != 1) {
throw BizRuntimeException.create(String.format("[send-%s]연계 발송 마스터 상태변경 실패", seCode.getCode()));
}

@ -114,7 +114,7 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak
}
//없으면 연계 발송 마스터, 통합 발송 마스터 send-ok
if (sendCnt == 0) {
if(IS_CCN) dto.setNewSndngProcessSttus(ApiConstants.MappingSndngProcessStatus.fromEns(dto.getNewSndngProcessSttus()));
CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, dto.getNewSndngProcessSttus());
if (mapper.updateProcessSttusCntcSndngMst(dto) != 1) {
throw BizRuntimeException.create("[make]연계 발송 마스터 상태변경 실패");
}
@ -168,7 +168,7 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak
}
// 3. status
if(IS_CCN) dto.setNewSndngProcessSttus(ApiConstants.MappingSndngProcessStatus.fromEns(dto.getNewSndngProcessSttus()));
CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, dto.getNewSndngProcessSttus());
if (mapper.updateProcessSttusCntcSndngMst(dto) != 1) {
throw BizRuntimeException.create("[make]데이타 생성(발송마스터 상태변경) 실패");
}
@ -212,7 +212,10 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak
dto.setUrl(CHUNCHEON_CALLBACK_URL);
}
// FIXME: KT callback url 확인 적용
if(SignguCode.FUNERAL.getCode().equals(dto.getSignguCode())){
if(SignguCode.CHEONAN_ES.getCode().equals(dto.getSignguCode())){
dto.setUrl(ME_CALLBACK_URL);
}
if(SignguCode.CHEONAN_WN.getCode().equals(dto.getSignguCode())){
dto.setUrl(ME_CALLBACK_URL);
}
mapper.insertKtBcMastr(dto);
@ -226,7 +229,10 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak
dto.setUrl(CHUNCHEON_CALLBACK_URL);
}
// FIXME: KT callback url 확인 적용
if(SignguCode.FUNERAL.getCode().equals(dto.getSignguCode())){
if(SignguCode.CHEONAN_ES.getCode().equals(dto.getSignguCode())){
dto.setUrl(ME_CALLBACK_URL);
}
if(SignguCode.CHEONAN_WN.getCode().equals(dto.getSignguCode())){
dto.setUrl(ME_CALLBACK_URL);
}
//mapper.insertKtBcMastr(dto);

@ -42,57 +42,89 @@ public class EnsBatchController {
private final IEnsBatchStatusService statusService;
private final IEnsBatchCloseService closeService;
@Operation(summary = "통합문서 접수", description = "통합문서 접수")
private static final String CAN_1 = """
{
"signguCode": "44131",
"ffnlgCode": "11",
"profile": "local"
}
""";
private static final String CAN_2 = """
{
"signguCode": "44133",
"ffnlgCode": "11",
"profile": "local"
}
""";
private static final String CCN = """
{
"signguCode": "41220",
"ffnlgCode": "11",
"profile": "local"
}
""";
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(mediaType = "application/json", examples = {
@ExampleObject(value = """
{
"signguCode": "51110",
"ffnlgCode": "11",
"sndngProcessSttus": "accept"
}
"""
)
@Content(
mediaType = "application/json",
examples = {
@ExampleObject(
name = "춘천",
value = CCN),
@ExampleObject(
name = "천안시 동남구청",
value = CAN_1),
@ExampleObject(
name = "천안시 서북구청",
value = CAN_2)
})
})
@Operation(summary = "통합문서 접수", description = "통합문서 접수")
@PostMapping(value = "/accept", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse accept(@RequestBody final EnsDTO.BatchEnsRequest reqDTO) {
acceptService.accept(reqDTO);
return ApiResponseDTO.success();
}
@Operation(summary = "통합문서 발송 데이타 종료", description = "통합문서 발송 데이타 종료")
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(mediaType = "application/json", examples = {
@ExampleObject(value = """
{
"signguCode": "51110",
"ffnlgCode": "11",
"sndngProcessSttus": "send-ok"
}
"""
)
@Content(
mediaType = "application/json",
examples = {
@ExampleObject(
name = "춘천",
value = CCN),
@ExampleObject(
name = "천안시 동남구청",
value = CAN_1),
@ExampleObject(
name = "천안시 서북구청",
value = CAN_2)
})
})
@Operation(summary = "통합문서 발송 데이타 종료", description = "통합문서 발송 데이타 종료")
@PostMapping(value = "/close", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse close(@RequestBody final EnsDTO.BatchEnsRequest reqDTO){
closeService.close(reqDTO);
return ApiResponseDTO.success();
}
@Operation(summary = "통합문서(bulk) 상태 조회", description = "통합문서 상태 조회")
@io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = {
@Content(mediaType = "application/json", examples = {
@ExampleObject(value = """
{
"signguCode": "51110",
"ffnlgCode": "11",
"sndngProcessSttus": "send-ok"
}
"""
)
})
@Content(
mediaType = "application/json",
examples = {
@ExampleObject(
name = "춘천",
value = CCN),
@ExampleObject(
name = "천안시 동남구청",
value = CAN_1),
@ExampleObject(
name = "천안시 서북구청",
value = CAN_2)
})
})
@Operation(summary = "통합문서(bulk) 상태 조회", description = "통합문서 상태 조회")
@PostMapping(value = "/statusBulks", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse statusBulks(@RequestBody final EnsDTO.BatchEnsRequest reqDTO){
statusService.statusBulks(reqDTO);

@ -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)));
}
}
}

Loading…
Cancel
Save