From 5015a2a43763bc7cd6fd24c6cbf601a248abd208 Mon Sep 17 00:00:00 2001 From: "gayoun.park" Date: Mon, 2 Feb 2026 10:10:52 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EA=B5=AD=EC=9C=A0=EC=9D=B8=20=EC=97=B0?= =?UTF-8?q?=EB=8F=99=20API=20validation=20=EC=B2=B4=ED=81=AC=20=EC=A3=BC?= =?UTF-8?q?=EC=84=9D=20=ED=95=B4=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gukyuin/service/GukYuinApiService.java | 264 +++++++++--------- 1 file changed, 135 insertions(+), 129 deletions(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/gukyuin/service/GukYuinApiService.java b/src/main/java/com/kamco/cd/kamcoback/gukyuin/service/GukYuinApiService.java index 7214279b..4778f363 100644 --- a/src/main/java/com/kamco/cd/kamcoback/gukyuin/service/GukYuinApiService.java +++ b/src/main/java/com/kamco/cd/kamcoback/gukyuin/service/GukYuinApiService.java @@ -20,11 +20,14 @@ import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkFacts; import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkFailCode; import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkableRes; import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.LearnInfo; +import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus; import com.kamco.cd.kamcoback.log.dto.EventStatus; import com.kamco.cd.kamcoback.log.dto.EventType; import com.kamco.cd.kamcoback.postgres.core.GukYuinCoreService; import com.kamco.cd.kamcoback.postgres.entity.AuditLogEntity; import com.kamco.cd.kamcoback.postgres.repository.log.AuditLogRepository; +import java.nio.file.Files; +import java.nio.file.Path; import java.time.LocalDate; import java.util.List; import java.util.UUID; @@ -60,7 +63,7 @@ public class GukYuinApiService { @Transactional public ChngDetectMastDto.RegistResDto regist( - ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) { + ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) { String url = gukyuinCdiUrl + "/chn/mast/regist"; @@ -69,12 +72,12 @@ public class GukYuinApiService { chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo()); ExternalCallResult result = - externalHttpClient.call( - url, - HttpMethod.POST, - chnDetectMastReq, - netUtils.jsonHeaders(), - ChngDetectMastDto.RegistResDto.class); + externalHttpClient.call( + url, + HttpMethod.POST, + chnDetectMastReq, + netUtils.jsonHeaders(), + ChngDetectMastDto.RegistResDto.class); ChngDetectMastDto.RegistResDto resultBody = result.body(); Boolean success = false; @@ -89,12 +92,12 @@ public class GukYuinApiService { } this.insertGukyuinAuditLog( - EventType.ADDED.getId(), - myip, - userUtil.getId(), - url.replace(gukyuinUrl, ""), - chnDetectMastReq, - success); + EventType.ADDED.getId(), + myip, + userUtil.getId(), + url.replace(gukyuinUrl, ""), + chnDetectMastReq, + success); return resultBody; } @@ -107,23 +110,23 @@ public class GukYuinApiService { chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo()); ExternalCallResult result = - externalHttpClient.call( - url, - HttpMethod.POST, - chnDetectMastReq, - netUtils.jsonHeaders(), - ChngDetectMastDto.Basic.class); + externalHttpClient.call( + url, + HttpMethod.POST, + chnDetectMastReq, + netUtils.jsonHeaders(), + ChngDetectMastDto.Basic.class); ChngDetectMastDto.Basic resultBody = result.body(); gukyuinCoreService.updateGukYuinMastRegRemove(resultBody); this.insertGukyuinAuditLog( - EventType.REMOVE.getId(), - myip, - userUtil.getId(), - url.replace(gukyuinUrl, ""), - chnDetectMastReq, - true); // TODO : successFail 여부 + EventType.REMOVE.getId(), + myip, + userUtil.getId(), + url.replace(gukyuinUrl, ""), + chnDetectMastReq, + true); // TODO : successFail 여부 return new ResReturn("success", "탐지결과 삭제 되었습니다."); } @@ -133,37 +136,37 @@ public class GukYuinApiService { String url = gukyuinCdiUrl + "/chn/mast/list/" + chnDtctMstId; ExternalCallResult result = - externalHttpClient.call( - url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class); + externalHttpClient.call( + url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class); this.insertGukyuinAuditLog( - EventType.DETAIL.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.DETAIL.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return result.body(); } // 등록목록 비교년도,기준년도,차수 조합해서 n개 확인 public ChngDetectMastDto.ResultDto listYearStage( - ChngDetectMastDto.ChngDetectMastSearchDto searchDto) { + ChngDetectMastDto.ChngDetectMastSearchDto searchDto) { String queryString = netUtils.dtoToQueryString(searchDto, null); String url = gukyuinCdiUrl + "/chn/mast" + queryString; ExternalCallResult result = - externalHttpClient.call( - url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class); + externalHttpClient.call( + url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class); this.insertGukyuinAuditLog( - EventType.LIST.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.LIST.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return result.body(); } @@ -209,21 +212,21 @@ public class GukYuinApiService { public ResultContDto findChnContList(String chnDtctId, Integer pageIndex, Integer pageSize) { String url = - gukyuinCdiUrl - + "/chn/cont/" - + chnDtctId - + "?pageIndex=" - + pageIndex - + "&pageSize=" - + pageSize; + gukyuinCdiUrl + + "/chn/cont/" + + chnDtctId + + "?pageIndex=" + + pageIndex + + "&pageSize=" + + pageSize; ExternalCallResult result = - externalHttpClient.call( - url, - HttpMethod.GET, - null, - netUtils.jsonHeaders(), - ChngDetectContDto.ResultContDto.class); + externalHttpClient.call( + url, + HttpMethod.GET, + null, + netUtils.jsonHeaders(), + ChngDetectContDto.ResultContDto.class); List contList = result.body().getResult(); if (contList == null || contList.isEmpty()) { @@ -238,19 +241,19 @@ public class GukYuinApiService { if (pnuCnt > 0) { Long geoUid = - gukyuinCoreService.findMapSheetAnalDataInferenceGeomUid(cont.getChnDtctObjtId()); + gukyuinCoreService.findMapSheetAnalDataInferenceGeomUid(cont.getChnDtctObjtId()); gukyuinCoreService.insertGeoUidPnuData(geoUid, pnuList); } } } this.insertGukyuinAuditLog( - EventType.LIST.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.LIST.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return result.body(); } @@ -259,20 +262,20 @@ public class GukYuinApiService { String url = gukyuinCdiUrl + "/chn/pnu/" + chnDtctId + "/objt/" + chnDtctObjtId; ExternalCallResult result = - externalHttpClient.call( - url, - HttpMethod.GET, - null, - netUtils.jsonHeaders(), - ChngDetectContDto.ResultPnuDto.class); + externalHttpClient.call( + url, + HttpMethod.GET, + null, + netUtils.jsonHeaders(), + ChngDetectContDto.ResultPnuDto.class); this.insertGukyuinAuditLog( - EventType.DETAIL.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.DETAIL.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return result.body(); } @@ -281,22 +284,22 @@ public class GukYuinApiService { String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId + "/lbl/" + lblYn; ExternalCallResult result = - externalHttpClient.call( - url, - HttpMethod.POST, - null, - netUtils.jsonHeaders(), - ChngDetectContDto.ResultPnuDto.class); + externalHttpClient.call( + url, + HttpMethod.POST, + null, + netUtils.jsonHeaders(), + ChngDetectContDto.ResultPnuDto.class); ChngDetectContDto.ResultPnuDto dto = result.body(); this.insertGukyuinAuditLog( - EventType.MODIFIED.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.MODIFIED.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return new ResReturn(dto.getCode() > 200000 ? "fail" : "success", dto.getMessage()); } @@ -305,20 +308,20 @@ public class GukYuinApiService { String url = gukyuinCdiUrl + "/chn/cont/" + chnDtctId + "/pnu/" + pnu; ExternalCallResult result = - externalHttpClient.call( - url, - HttpMethod.GET, - null, - netUtils.jsonHeaders(), - ChngDetectContDto.ResultContDto.class); + externalHttpClient.call( + url, + HttpMethod.GET, + null, + netUtils.jsonHeaders(), + ChngDetectContDto.ResultContDto.class); this.insertGukyuinAuditLog( - EventType.LIST.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.LIST.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return result.body(); } @@ -326,41 +329,41 @@ public class GukYuinApiService { String url = gukyuinCdiUrl + "/chn/mast/" + chnDtctId; ExternalCallResult result = - externalHttpClient.call( - url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class); + externalHttpClient.call( + url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class); this.insertGukyuinAuditLog( - EventType.DETAIL.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.DETAIL.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return result.body(); } @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false) public void insertGukyuinAuditLog( - String actionType, - String myIp, - Long userUid, - String requestUri, - Object requestBody, - boolean successFail) { + String actionType, + String myIp, + Long userUid, + String requestUri, + Object requestBody, + boolean successFail) { try { AuditLogEntity log = - new AuditLogEntity( - userUid, - EventType.fromName(actionType), - successFail ? EventStatus.SUCCESS : EventStatus.FAILED, - "GUKYUIN", // 메뉴도 국유인으로 하나 따기 - myIp, - requestUri, - requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()), - null, - null, - null); + new AuditLogEntity( + userUid, + EventType.fromName(actionType), + successFail ? EventStatus.SUCCESS : EventStatus.FAILED, + "GUKYUIN", // 메뉴도 국유인으로 하나 따기 + myIp, + requestUri, + requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()), + null, + null, + null); auditLogRepository.save(log); } catch (Exception e) { @@ -372,15 +375,14 @@ public class GukYuinApiService { public ResponseObj connectChnMastRegist(UUID uuid) { // uuid로 추론 회차 조회 LearnInfo info = gukyuinCoreService.findMapSheetLearnInfo(uuid); - // if (info.getApplyStatus() != null && - // !info.getApplyStatus().equals(GukYuinStatus.PENDING.getId())) - // { - // return new ResponseObj(ApiResponseCode.DUPLICATE_DATA, "이미 국유인 연동을 한 추론 회차입니다."); - // } + if (info.getApplyStatus() != null + && !info.getApplyStatus().equals(GukYuinStatus.PENDING.getId())) { + return new ResponseObj(ApiResponseCode.DUPLICATE_DATA, "이미 국유인 연동을 한 회차입니다."); + } // 비교년도,기준년도로 전송한 데이터 있는지 확인 후 회차 번호 생성 Integer maxStage = - gukyuinCoreService.findMapSheetLearnYearStage(info.getCompareYyyy(), info.getTargetYyyy()); + gukyuinCoreService.findMapSheetLearnYearStage(info.getCompareYyyy(), info.getTargetYyyy()); // reqDto 셋팅 ChnDetectMastReqDto reqDto = new ChnDetectMastReqDto(); @@ -390,6 +392,10 @@ public class GukYuinApiService { reqDto.setChnDtctId(info.getUid()); reqDto.setPathNm("/kamco-nfs/dataset/export/" + info.getUid()); + if (Files.isDirectory(Path.of("/kamco-nfs/dataset/export/" + info.getUid()))) { + return new ResponseObj(ApiResponseCode.NOT_FOUND_DATA, "파일 경로에 회차 실행 파일이 생성되지 않았습니다. 확인 부탁드립니다."); + } + // 국유인 /chn/mast/regist 전송 this.regist(reqDto); From c0b5dd99ef4dd3b6ce22064d3e504d7d2401d82c Mon Sep 17 00:00:00 2001 From: "gayoun.park" Date: Mon, 2 Feb 2026 10:13:58 +0900 Subject: [PATCH 2/2] spotless --- .../gukyuin/service/GukYuinApiService.java | 255 +++++++++--------- 1 file changed, 128 insertions(+), 127 deletions(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/gukyuin/service/GukYuinApiService.java b/src/main/java/com/kamco/cd/kamcoback/gukyuin/service/GukYuinApiService.java index 4778f363..46ace37b 100644 --- a/src/main/java/com/kamco/cd/kamcoback/gukyuin/service/GukYuinApiService.java +++ b/src/main/java/com/kamco/cd/kamcoback/gukyuin/service/GukYuinApiService.java @@ -63,7 +63,7 @@ public class GukYuinApiService { @Transactional public ChngDetectMastDto.RegistResDto regist( - ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) { + ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) { String url = gukyuinCdiUrl + "/chn/mast/regist"; @@ -72,12 +72,12 @@ public class GukYuinApiService { chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo()); ExternalCallResult result = - externalHttpClient.call( - url, - HttpMethod.POST, - chnDetectMastReq, - netUtils.jsonHeaders(), - ChngDetectMastDto.RegistResDto.class); + externalHttpClient.call( + url, + HttpMethod.POST, + chnDetectMastReq, + netUtils.jsonHeaders(), + ChngDetectMastDto.RegistResDto.class); ChngDetectMastDto.RegistResDto resultBody = result.body(); Boolean success = false; @@ -92,12 +92,12 @@ public class GukYuinApiService { } this.insertGukyuinAuditLog( - EventType.ADDED.getId(), - myip, - userUtil.getId(), - url.replace(gukyuinUrl, ""), - chnDetectMastReq, - success); + EventType.ADDED.getId(), + myip, + userUtil.getId(), + url.replace(gukyuinUrl, ""), + chnDetectMastReq, + success); return resultBody; } @@ -110,23 +110,23 @@ public class GukYuinApiService { chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo()); ExternalCallResult result = - externalHttpClient.call( - url, - HttpMethod.POST, - chnDetectMastReq, - netUtils.jsonHeaders(), - ChngDetectMastDto.Basic.class); + externalHttpClient.call( + url, + HttpMethod.POST, + chnDetectMastReq, + netUtils.jsonHeaders(), + ChngDetectMastDto.Basic.class); ChngDetectMastDto.Basic resultBody = result.body(); gukyuinCoreService.updateGukYuinMastRegRemove(resultBody); this.insertGukyuinAuditLog( - EventType.REMOVE.getId(), - myip, - userUtil.getId(), - url.replace(gukyuinUrl, ""), - chnDetectMastReq, - true); // TODO : successFail 여부 + EventType.REMOVE.getId(), + myip, + userUtil.getId(), + url.replace(gukyuinUrl, ""), + chnDetectMastReq, + true); // TODO : successFail 여부 return new ResReturn("success", "탐지결과 삭제 되었습니다."); } @@ -136,37 +136,37 @@ public class GukYuinApiService { String url = gukyuinCdiUrl + "/chn/mast/list/" + chnDtctMstId; ExternalCallResult result = - externalHttpClient.call( - url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class); + externalHttpClient.call( + url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class); this.insertGukyuinAuditLog( - EventType.DETAIL.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.DETAIL.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return result.body(); } // 등록목록 비교년도,기준년도,차수 조합해서 n개 확인 public ChngDetectMastDto.ResultDto listYearStage( - ChngDetectMastDto.ChngDetectMastSearchDto searchDto) { + ChngDetectMastDto.ChngDetectMastSearchDto searchDto) { String queryString = netUtils.dtoToQueryString(searchDto, null); String url = gukyuinCdiUrl + "/chn/mast" + queryString; ExternalCallResult result = - externalHttpClient.call( - url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class); + externalHttpClient.call( + url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class); this.insertGukyuinAuditLog( - EventType.LIST.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.LIST.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return result.body(); } @@ -212,21 +212,21 @@ public class GukYuinApiService { public ResultContDto findChnContList(String chnDtctId, Integer pageIndex, Integer pageSize) { String url = - gukyuinCdiUrl - + "/chn/cont/" - + chnDtctId - + "?pageIndex=" - + pageIndex - + "&pageSize=" - + pageSize; + gukyuinCdiUrl + + "/chn/cont/" + + chnDtctId + + "?pageIndex=" + + pageIndex + + "&pageSize=" + + pageSize; ExternalCallResult result = - externalHttpClient.call( - url, - HttpMethod.GET, - null, - netUtils.jsonHeaders(), - ChngDetectContDto.ResultContDto.class); + externalHttpClient.call( + url, + HttpMethod.GET, + null, + netUtils.jsonHeaders(), + ChngDetectContDto.ResultContDto.class); List contList = result.body().getResult(); if (contList == null || contList.isEmpty()) { @@ -241,19 +241,19 @@ public class GukYuinApiService { if (pnuCnt > 0) { Long geoUid = - gukyuinCoreService.findMapSheetAnalDataInferenceGeomUid(cont.getChnDtctObjtId()); + gukyuinCoreService.findMapSheetAnalDataInferenceGeomUid(cont.getChnDtctObjtId()); gukyuinCoreService.insertGeoUidPnuData(geoUid, pnuList); } } } this.insertGukyuinAuditLog( - EventType.LIST.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.LIST.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return result.body(); } @@ -262,20 +262,20 @@ public class GukYuinApiService { String url = gukyuinCdiUrl + "/chn/pnu/" + chnDtctId + "/objt/" + chnDtctObjtId; ExternalCallResult result = - externalHttpClient.call( - url, - HttpMethod.GET, - null, - netUtils.jsonHeaders(), - ChngDetectContDto.ResultPnuDto.class); + externalHttpClient.call( + url, + HttpMethod.GET, + null, + netUtils.jsonHeaders(), + ChngDetectContDto.ResultPnuDto.class); this.insertGukyuinAuditLog( - EventType.DETAIL.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.DETAIL.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return result.body(); } @@ -284,22 +284,22 @@ public class GukYuinApiService { String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId + "/lbl/" + lblYn; ExternalCallResult result = - externalHttpClient.call( - url, - HttpMethod.POST, - null, - netUtils.jsonHeaders(), - ChngDetectContDto.ResultPnuDto.class); + externalHttpClient.call( + url, + HttpMethod.POST, + null, + netUtils.jsonHeaders(), + ChngDetectContDto.ResultPnuDto.class); ChngDetectContDto.ResultPnuDto dto = result.body(); this.insertGukyuinAuditLog( - EventType.MODIFIED.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.MODIFIED.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return new ResReturn(dto.getCode() > 200000 ? "fail" : "success", dto.getMessage()); } @@ -308,20 +308,20 @@ public class GukYuinApiService { String url = gukyuinCdiUrl + "/chn/cont/" + chnDtctId + "/pnu/" + pnu; ExternalCallResult result = - externalHttpClient.call( - url, - HttpMethod.GET, - null, - netUtils.jsonHeaders(), - ChngDetectContDto.ResultContDto.class); + externalHttpClient.call( + url, + HttpMethod.GET, + null, + netUtils.jsonHeaders(), + ChngDetectContDto.ResultContDto.class); this.insertGukyuinAuditLog( - EventType.LIST.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.LIST.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return result.body(); } @@ -329,41 +329,41 @@ public class GukYuinApiService { String url = gukyuinCdiUrl + "/chn/mast/" + chnDtctId; ExternalCallResult result = - externalHttpClient.call( - url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class); + externalHttpClient.call( + url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class); this.insertGukyuinAuditLog( - EventType.DETAIL.getId(), - netUtils.getLocalIP(), - userUtil.getId(), - url.replace(gukyuinUrl, ""), - null, - result.body().getSuccess()); + EventType.DETAIL.getId(), + netUtils.getLocalIP(), + userUtil.getId(), + url.replace(gukyuinUrl, ""), + null, + result.body().getSuccess()); return result.body(); } @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false) public void insertGukyuinAuditLog( - String actionType, - String myIp, - Long userUid, - String requestUri, - Object requestBody, - boolean successFail) { + String actionType, + String myIp, + Long userUid, + String requestUri, + Object requestBody, + boolean successFail) { try { AuditLogEntity log = - new AuditLogEntity( - userUid, - EventType.fromName(actionType), - successFail ? EventStatus.SUCCESS : EventStatus.FAILED, - "GUKYUIN", // 메뉴도 국유인으로 하나 따기 - myIp, - requestUri, - requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()), - null, - null, - null); + new AuditLogEntity( + userUid, + EventType.fromName(actionType), + successFail ? EventStatus.SUCCESS : EventStatus.FAILED, + "GUKYUIN", // 메뉴도 국유인으로 하나 따기 + myIp, + requestUri, + requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()), + null, + null, + null); auditLogRepository.save(log); } catch (Exception e) { @@ -376,13 +376,13 @@ public class GukYuinApiService { // uuid로 추론 회차 조회 LearnInfo info = gukyuinCoreService.findMapSheetLearnInfo(uuid); if (info.getApplyStatus() != null - && !info.getApplyStatus().equals(GukYuinStatus.PENDING.getId())) { + && !info.getApplyStatus().equals(GukYuinStatus.PENDING.getId())) { return new ResponseObj(ApiResponseCode.DUPLICATE_DATA, "이미 국유인 연동을 한 회차입니다."); } // 비교년도,기준년도로 전송한 데이터 있는지 확인 후 회차 번호 생성 Integer maxStage = - gukyuinCoreService.findMapSheetLearnYearStage(info.getCompareYyyy(), info.getTargetYyyy()); + gukyuinCoreService.findMapSheetLearnYearStage(info.getCompareYyyy(), info.getTargetYyyy()); // reqDto 셋팅 ChnDetectMastReqDto reqDto = new ChnDetectMastReqDto(); @@ -393,9 +393,10 @@ public class GukYuinApiService { reqDto.setPathNm("/kamco-nfs/dataset/export/" + info.getUid()); if (Files.isDirectory(Path.of("/kamco-nfs/dataset/export/" + info.getUid()))) { - return new ResponseObj(ApiResponseCode.NOT_FOUND_DATA, "파일 경로에 회차 실행 파일이 생성되지 않았습니다. 확인 부탁드립니다."); + return new ResponseObj( + ApiResponseCode.NOT_FOUND_DATA, "파일 경로에 회차 실행 파일이 생성되지 않았습니다. 확인 부탁드립니다."); } - + // 국유인 /chn/mast/regist 전송 this.regist(reqDto);