feat/infer_dev_260107 #37

Merged
teddy merged 3 commits from feat/infer_dev_260107 into develop 2026-02-02 12:18:09 +09:00
6 changed files with 61 additions and 13 deletions

View File

@@ -216,4 +216,16 @@ public class ChngDetectMastDto {
private ZonedDateTime reviewerWorkDttm;
private ZonedDateTime labelSendDttm;
}
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public static class ErrorResDto {
private String timestamp;
private Integer status;
private String error;
private String path;
}
}

View File

@@ -1,5 +1,7 @@
package com.kamco.cd.kamcoback.gukyuin.service;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.kamco.cd.kamcoback.common.utils.NetUtils;
import com.kamco.cd.kamcoback.common.utils.UserUtil;
import com.kamco.cd.kamcoback.config.api.ApiLogFunction;
@@ -13,6 +15,7 @@ import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultContDto;
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultPnuDto;
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ChnDetectMastReqDto;
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ErrorResDto;
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LabelSendDto;
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ResReturn;
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ResultDto;
@@ -51,6 +54,7 @@ public class GukYuinApiService {
private final UserUtil userUtil;
private final AuditLogRepository auditLogRepository;
private final ObjectMapper objectMapper;
@Value("${spring.profiles.active:local}")
private String profile;
@@ -80,15 +84,30 @@ public class GukYuinApiService {
ChngDetectMastDto.RegistResDto.class);
ChngDetectMastDto.RegistResDto resultBody = result.body();
Boolean success = false;
if (resultBody != null) {
boolean success = false;
if (resultBody != null && resultBody.getSuccess() != null) {
ChngDetectMastDto.Basic registRes = resultBody.getResult();
success = resultBody.getSuccess();
// 추론 회차에 applyStatus, applyStatusDttm 업데이트
gukyuinCoreService.updateGukYuinMastRegResult(registRes);
// anal_inference 에도 국유인 반영여부, applyDttm 업데이트
gukyuinCoreService.updateAnalInferenceApplyDttm(registRes);
success = resultBody.getSuccess();
} else {
String errBody = result.errBody();
ErrorResDto error = null;
try {
error = objectMapper.readValue(errBody, ErrorResDto.class);
return new ChngDetectMastDto.RegistResDto(error.getStatus(), error.getError(), null, false);
} catch (JsonProcessingException e) {
log.error("에러 응답 파싱 실패. rawBody={}", errBody, e);
return new ChngDetectMastDto.RegistResDto(
result.statusCode(), // HTTP status
errBody, // 원문 그대로
null,
false);
}
}
this.insertGukyuinAuditLog(
@@ -98,6 +117,7 @@ public class GukYuinApiService {
url.replace(gukyuinUrl, ""),
chnDetectMastReq,
success);
return resultBody;
}
@@ -398,9 +418,12 @@ public class GukYuinApiService {
}
// 국유인 /chn/mast/regist 전송
this.regist(reqDto);
return new ResponseObj(ApiResponseCode.OK, "");
ChngDetectMastDto.RegistResDto result = this.regist(reqDto);
if (result.getSuccess()) {
return new ResponseObj(ApiResponseCode.OK, "연동되었습니다.");
} else {
return new ResponseObj(ApiResponseCode.INTERNAL_SERVER_ERROR, result.getMessage());
}
}
public List<LabelSendDto> findLabelingCompleteSendList(LocalDate yesterday) {

View File

@@ -34,8 +34,11 @@ public class LayerService {
@Value("${layer.geoserver-url}")
private String geoserverUrl;
@Value("${layer.path}")
private String geoserverPath;
@Value("${layer.wms-path}")
private String wmsPath;
@Value("${layer.wmts-path}")
private String wmtsPath;
/**
* 지도 레이어 관리 목록
@@ -184,14 +187,22 @@ public class LayerService {
List<LayerMapDto> layerMapDtoList = mapLayerCoreService.findLayerMapList(type);
layerMapDtoList.forEach(
dto -> {
if (dto.getLayerType().equals("WMS") || dto.getLayerType().equals("WMTS")) {
if (dto.getLayerType().equals("WMS")) {
dto.setUrl(
String.format(
"%s/%s/%s",
trimSlash(geoserverUrl),
trimSlash(geoserverPath),
trimSlash(wmsPath),
dto.getLayerType().toLowerCase()));
}
else if (dto.getLayerType().equals("WMTS")) {
dto.setUrl(
String.format(
"%s/%s/%s",
trimSlash(geoserverUrl),
trimSlash(wmtsPath),
dto.getLayerType().toLowerCase()));
}
});
return layerMapDtoList;
}

View File

@@ -164,7 +164,7 @@ public class GukYuinRepositoryImpl implements GukYuinRepositoryCustom {
Expressions.numberTemplate(Integer.class, "coalesce({0}, 0)", mapSheetLearnEntity.stage);
return queryFactory
.select(stageExpr.max())
.select(stageExpr.max().coalesce(0))
.from(mapSheetLearnEntity)
.where(
mapSheetLearnEntity.compareYyyy.eq(compareYyyy),

View File

@@ -124,5 +124,6 @@ training-data:
layer:
geoserver-url: https://kamco.geo-dev.gs.dabeeo.com
path: geoserver/cd/gwc/service
wms-path: geoserver/cd
wmts-path: geoserver/cd/gwc/service
workspace: cd

View File

@@ -79,5 +79,6 @@ training-data:
layer:
geoserver-url: https://kamco.geo-dev.gs.dabeeo.com
path: /geoserver/cd/gwc/service/
wms-path: geoserver/cd
wmts-path: geoserver/cd/gwc/service
workspace: cd