spotless
This commit is contained in:
@@ -63,7 +63,7 @@ public class GukYuinApiService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ChngDetectMastDto.RegistResDto regist(
|
public ChngDetectMastDto.RegistResDto regist(
|
||||||
ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
||||||
|
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/regist";
|
String url = gukyuinCdiUrl + "/chn/mast/regist";
|
||||||
|
|
||||||
@@ -72,12 +72,12 @@ public class GukYuinApiService {
|
|||||||
chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo());
|
chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo());
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.RegistResDto> result =
|
ExternalCallResult<ChngDetectMastDto.RegistResDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url,
|
url,
|
||||||
HttpMethod.POST,
|
HttpMethod.POST,
|
||||||
chnDetectMastReq,
|
chnDetectMastReq,
|
||||||
netUtils.jsonHeaders(),
|
netUtils.jsonHeaders(),
|
||||||
ChngDetectMastDto.RegistResDto.class);
|
ChngDetectMastDto.RegistResDto.class);
|
||||||
|
|
||||||
ChngDetectMastDto.RegistResDto resultBody = result.body();
|
ChngDetectMastDto.RegistResDto resultBody = result.body();
|
||||||
Boolean success = false;
|
Boolean success = false;
|
||||||
@@ -92,12 +92,12 @@ public class GukYuinApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.ADDED.getId(),
|
EventType.ADDED.getId(),
|
||||||
myip,
|
myip,
|
||||||
userUtil.getId(),
|
userUtil.getId(),
|
||||||
url.replace(gukyuinUrl, ""),
|
url.replace(gukyuinUrl, ""),
|
||||||
chnDetectMastReq,
|
chnDetectMastReq,
|
||||||
success);
|
success);
|
||||||
return resultBody;
|
return resultBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,23 +110,23 @@ public class GukYuinApiService {
|
|||||||
chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo());
|
chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo());
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.Basic> result =
|
ExternalCallResult<ChngDetectMastDto.Basic> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url,
|
url,
|
||||||
HttpMethod.POST,
|
HttpMethod.POST,
|
||||||
chnDetectMastReq,
|
chnDetectMastReq,
|
||||||
netUtils.jsonHeaders(),
|
netUtils.jsonHeaders(),
|
||||||
ChngDetectMastDto.Basic.class);
|
ChngDetectMastDto.Basic.class);
|
||||||
|
|
||||||
ChngDetectMastDto.Basic resultBody = result.body();
|
ChngDetectMastDto.Basic resultBody = result.body();
|
||||||
gukyuinCoreService.updateGukYuinMastRegRemove(resultBody);
|
gukyuinCoreService.updateGukYuinMastRegRemove(resultBody);
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.REMOVE.getId(),
|
EventType.REMOVE.getId(),
|
||||||
myip,
|
myip,
|
||||||
userUtil.getId(),
|
userUtil.getId(),
|
||||||
url.replace(gukyuinUrl, ""),
|
url.replace(gukyuinUrl, ""),
|
||||||
chnDetectMastReq,
|
chnDetectMastReq,
|
||||||
true); // TODO : successFail 여부
|
true); // TODO : successFail 여부
|
||||||
return new ResReturn("success", "탐지결과 삭제 되었습니다.");
|
return new ResReturn("success", "탐지결과 삭제 되었습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,37 +136,37 @@ public class GukYuinApiService {
|
|||||||
String url = gukyuinCdiUrl + "/chn/mast/list/" + chnDtctMstId;
|
String url = gukyuinCdiUrl + "/chn/mast/list/" + chnDtctMstId;
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class);
|
url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class);
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.DETAIL.getId(),
|
EventType.DETAIL.getId(),
|
||||||
netUtils.getLocalIP(),
|
netUtils.getLocalIP(),
|
||||||
userUtil.getId(),
|
userUtil.getId(),
|
||||||
url.replace(gukyuinUrl, ""),
|
url.replace(gukyuinUrl, ""),
|
||||||
null,
|
null,
|
||||||
result.body().getSuccess());
|
result.body().getSuccess());
|
||||||
return result.body();
|
return result.body();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 등록목록 비교년도,기준년도,차수 조합해서 n개 확인
|
// 등록목록 비교년도,기준년도,차수 조합해서 n개 확인
|
||||||
public ChngDetectMastDto.ResultDto listYearStage(
|
public ChngDetectMastDto.ResultDto listYearStage(
|
||||||
ChngDetectMastDto.ChngDetectMastSearchDto searchDto) {
|
ChngDetectMastDto.ChngDetectMastSearchDto searchDto) {
|
||||||
|
|
||||||
String queryString = netUtils.dtoToQueryString(searchDto, null);
|
String queryString = netUtils.dtoToQueryString(searchDto, null);
|
||||||
String url = gukyuinCdiUrl + "/chn/mast" + queryString;
|
String url = gukyuinCdiUrl + "/chn/mast" + queryString;
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class);
|
url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class);
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.LIST.getId(),
|
EventType.LIST.getId(),
|
||||||
netUtils.getLocalIP(),
|
netUtils.getLocalIP(),
|
||||||
userUtil.getId(),
|
userUtil.getId(),
|
||||||
url.replace(gukyuinUrl, ""),
|
url.replace(gukyuinUrl, ""),
|
||||||
null,
|
null,
|
||||||
result.body().getSuccess());
|
result.body().getSuccess());
|
||||||
return result.body();
|
return result.body();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,21 +212,21 @@ public class GukYuinApiService {
|
|||||||
public ResultContDto findChnContList(String chnDtctId, Integer pageIndex, Integer pageSize) {
|
public ResultContDto findChnContList(String chnDtctId, Integer pageIndex, Integer pageSize) {
|
||||||
|
|
||||||
String url =
|
String url =
|
||||||
gukyuinCdiUrl
|
gukyuinCdiUrl
|
||||||
+ "/chn/cont/"
|
+ "/chn/cont/"
|
||||||
+ chnDtctId
|
+ chnDtctId
|
||||||
+ "?pageIndex="
|
+ "?pageIndex="
|
||||||
+ pageIndex
|
+ pageIndex
|
||||||
+ "&pageSize="
|
+ "&pageSize="
|
||||||
+ pageSize;
|
+ pageSize;
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url,
|
url,
|
||||||
HttpMethod.GET,
|
HttpMethod.GET,
|
||||||
null,
|
null,
|
||||||
netUtils.jsonHeaders(),
|
netUtils.jsonHeaders(),
|
||||||
ChngDetectContDto.ResultContDto.class);
|
ChngDetectContDto.ResultContDto.class);
|
||||||
|
|
||||||
List<ContBasic> contList = result.body().getResult();
|
List<ContBasic> contList = result.body().getResult();
|
||||||
if (contList == null || contList.isEmpty()) {
|
if (contList == null || contList.isEmpty()) {
|
||||||
@@ -241,19 +241,19 @@ public class GukYuinApiService {
|
|||||||
|
|
||||||
if (pnuCnt > 0) {
|
if (pnuCnt > 0) {
|
||||||
Long geoUid =
|
Long geoUid =
|
||||||
gukyuinCoreService.findMapSheetAnalDataInferenceGeomUid(cont.getChnDtctObjtId());
|
gukyuinCoreService.findMapSheetAnalDataInferenceGeomUid(cont.getChnDtctObjtId());
|
||||||
gukyuinCoreService.insertGeoUidPnuData(geoUid, pnuList);
|
gukyuinCoreService.insertGeoUidPnuData(geoUid, pnuList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.LIST.getId(),
|
EventType.LIST.getId(),
|
||||||
netUtils.getLocalIP(),
|
netUtils.getLocalIP(),
|
||||||
userUtil.getId(),
|
userUtil.getId(),
|
||||||
url.replace(gukyuinUrl, ""),
|
url.replace(gukyuinUrl, ""),
|
||||||
null,
|
null,
|
||||||
result.body().getSuccess());
|
result.body().getSuccess());
|
||||||
|
|
||||||
return result.body();
|
return result.body();
|
||||||
}
|
}
|
||||||
@@ -262,20 +262,20 @@ public class GukYuinApiService {
|
|||||||
String url = gukyuinCdiUrl + "/chn/pnu/" + chnDtctId + "/objt/" + chnDtctObjtId;
|
String url = gukyuinCdiUrl + "/chn/pnu/" + chnDtctId + "/objt/" + chnDtctObjtId;
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url,
|
url,
|
||||||
HttpMethod.GET,
|
HttpMethod.GET,
|
||||||
null,
|
null,
|
||||||
netUtils.jsonHeaders(),
|
netUtils.jsonHeaders(),
|
||||||
ChngDetectContDto.ResultPnuDto.class);
|
ChngDetectContDto.ResultPnuDto.class);
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.DETAIL.getId(),
|
EventType.DETAIL.getId(),
|
||||||
netUtils.getLocalIP(),
|
netUtils.getLocalIP(),
|
||||||
userUtil.getId(),
|
userUtil.getId(),
|
||||||
url.replace(gukyuinUrl, ""),
|
url.replace(gukyuinUrl, ""),
|
||||||
null,
|
null,
|
||||||
result.body().getSuccess());
|
result.body().getSuccess());
|
||||||
|
|
||||||
return result.body();
|
return result.body();
|
||||||
}
|
}
|
||||||
@@ -284,22 +284,22 @@ public class GukYuinApiService {
|
|||||||
String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId + "/lbl/" + lblYn;
|
String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId + "/lbl/" + lblYn;
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url,
|
url,
|
||||||
HttpMethod.POST,
|
HttpMethod.POST,
|
||||||
null,
|
null,
|
||||||
netUtils.jsonHeaders(),
|
netUtils.jsonHeaders(),
|
||||||
ChngDetectContDto.ResultPnuDto.class);
|
ChngDetectContDto.ResultPnuDto.class);
|
||||||
|
|
||||||
ChngDetectContDto.ResultPnuDto dto = result.body();
|
ChngDetectContDto.ResultPnuDto dto = result.body();
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.MODIFIED.getId(),
|
EventType.MODIFIED.getId(),
|
||||||
netUtils.getLocalIP(),
|
netUtils.getLocalIP(),
|
||||||
userUtil.getId(),
|
userUtil.getId(),
|
||||||
url.replace(gukyuinUrl, ""),
|
url.replace(gukyuinUrl, ""),
|
||||||
null,
|
null,
|
||||||
result.body().getSuccess());
|
result.body().getSuccess());
|
||||||
|
|
||||||
return new ResReturn(dto.getCode() > 200000 ? "fail" : "success", dto.getMessage());
|
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;
|
String url = gukyuinCdiUrl + "/chn/cont/" + chnDtctId + "/pnu/" + pnu;
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url,
|
url,
|
||||||
HttpMethod.GET,
|
HttpMethod.GET,
|
||||||
null,
|
null,
|
||||||
netUtils.jsonHeaders(),
|
netUtils.jsonHeaders(),
|
||||||
ChngDetectContDto.ResultContDto.class);
|
ChngDetectContDto.ResultContDto.class);
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.LIST.getId(),
|
EventType.LIST.getId(),
|
||||||
netUtils.getLocalIP(),
|
netUtils.getLocalIP(),
|
||||||
userUtil.getId(),
|
userUtil.getId(),
|
||||||
url.replace(gukyuinUrl, ""),
|
url.replace(gukyuinUrl, ""),
|
||||||
null,
|
null,
|
||||||
result.body().getSuccess());
|
result.body().getSuccess());
|
||||||
return result.body();
|
return result.body();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,41 +329,41 @@ public class GukYuinApiService {
|
|||||||
String url = gukyuinCdiUrl + "/chn/mast/" + chnDtctId;
|
String url = gukyuinCdiUrl + "/chn/mast/" + chnDtctId;
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class);
|
url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class);
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.DETAIL.getId(),
|
EventType.DETAIL.getId(),
|
||||||
netUtils.getLocalIP(),
|
netUtils.getLocalIP(),
|
||||||
userUtil.getId(),
|
userUtil.getId(),
|
||||||
url.replace(gukyuinUrl, ""),
|
url.replace(gukyuinUrl, ""),
|
||||||
null,
|
null,
|
||||||
result.body().getSuccess());
|
result.body().getSuccess());
|
||||||
|
|
||||||
return result.body();
|
return result.body();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
|
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
|
||||||
public void insertGukyuinAuditLog(
|
public void insertGukyuinAuditLog(
|
||||||
String actionType,
|
String actionType,
|
||||||
String myIp,
|
String myIp,
|
||||||
Long userUid,
|
Long userUid,
|
||||||
String requestUri,
|
String requestUri,
|
||||||
Object requestBody,
|
Object requestBody,
|
||||||
boolean successFail) {
|
boolean successFail) {
|
||||||
try {
|
try {
|
||||||
AuditLogEntity log =
|
AuditLogEntity log =
|
||||||
new AuditLogEntity(
|
new AuditLogEntity(
|
||||||
userUid,
|
userUid,
|
||||||
EventType.fromName(actionType),
|
EventType.fromName(actionType),
|
||||||
successFail ? EventStatus.SUCCESS : EventStatus.FAILED,
|
successFail ? EventStatus.SUCCESS : EventStatus.FAILED,
|
||||||
"GUKYUIN", // 메뉴도 국유인으로 하나 따기
|
"GUKYUIN", // 메뉴도 국유인으로 하나 따기
|
||||||
myIp,
|
myIp,
|
||||||
requestUri,
|
requestUri,
|
||||||
requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()),
|
requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()),
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null);
|
null);
|
||||||
auditLogRepository.save(log);
|
auditLogRepository.save(log);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -376,13 +376,13 @@ public class GukYuinApiService {
|
|||||||
// uuid로 추론 회차 조회
|
// uuid로 추론 회차 조회
|
||||||
LearnInfo info = gukyuinCoreService.findMapSheetLearnInfo(uuid);
|
LearnInfo info = gukyuinCoreService.findMapSheetLearnInfo(uuid);
|
||||||
if (info.getApplyStatus() != null
|
if (info.getApplyStatus() != null
|
||||||
&& !info.getApplyStatus().equals(GukYuinStatus.PENDING.getId())) {
|
&& !info.getApplyStatus().equals(GukYuinStatus.PENDING.getId())) {
|
||||||
return new ResponseObj(ApiResponseCode.DUPLICATE_DATA, "이미 국유인 연동을 한 회차입니다.");
|
return new ResponseObj(ApiResponseCode.DUPLICATE_DATA, "이미 국유인 연동을 한 회차입니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 비교년도,기준년도로 전송한 데이터 있는지 확인 후 회차 번호 생성
|
// 비교년도,기준년도로 전송한 데이터 있는지 확인 후 회차 번호 생성
|
||||||
Integer maxStage =
|
Integer maxStage =
|
||||||
gukyuinCoreService.findMapSheetLearnYearStage(info.getCompareYyyy(), info.getTargetYyyy());
|
gukyuinCoreService.findMapSheetLearnYearStage(info.getCompareYyyy(), info.getTargetYyyy());
|
||||||
|
|
||||||
// reqDto 셋팅
|
// reqDto 셋팅
|
||||||
ChnDetectMastReqDto reqDto = new ChnDetectMastReqDto();
|
ChnDetectMastReqDto reqDto = new ChnDetectMastReqDto();
|
||||||
@@ -393,9 +393,10 @@ public class GukYuinApiService {
|
|||||||
reqDto.setPathNm("/kamco-nfs/dataset/export/" + info.getUid());
|
reqDto.setPathNm("/kamco-nfs/dataset/export/" + info.getUid());
|
||||||
|
|
||||||
if (Files.isDirectory(Path.of("/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 전송
|
// 국유인 /chn/mast/regist 전송
|
||||||
this.regist(reqDto);
|
this.regist(reqDto);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user