shp 생성 컨트롤러 이동, 주석추가
This commit is contained in:
@@ -271,7 +271,7 @@ public class InferenceResultCoreService {
|
||||
.getInferenceResultByUuid(request.getUuid())
|
||||
.orElseThrow(EntityNotFoundException::new);
|
||||
|
||||
// M1/M2/M3 영역 업데이트
|
||||
// G1/G2/G3 영역 업데이트
|
||||
if (request.getType() != null) {
|
||||
applyModelUpdate(entity, request);
|
||||
}
|
||||
|
||||
@@ -3,10 +3,12 @@ package com.kamco.cd.kamcoback.postgres.core;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.Inference.InferenceResultRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@Log4j2
|
||||
@RequiredArgsConstructor
|
||||
public class InferenceResultShpCoreService {
|
||||
|
||||
@@ -15,15 +17,27 @@ public class InferenceResultShpCoreService {
|
||||
/**
|
||||
* inference_results 기준으로 - tb_map_sheet_anal_data_inference -
|
||||
* tb_map_sheet_anal_data_inference_geom 테이블을 최신 상태로 구성한다.
|
||||
*
|
||||
* @param id learn id
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
public InferenceResultShpDto.InferenceCntDto buildInferenceData(Long id) {
|
||||
Long analId = repo.upsertGroupsFromMapSheetAnal(id);
|
||||
repo.upsertGroupsFromInferenceResults(analId);
|
||||
repo.upsertGeomsFromInferenceResults(analId);
|
||||
repo.upsertSttcFromInferenceResults(analId);
|
||||
InferenceResultShpDto.InferenceCntDto cntDto = new InferenceResultShpDto.InferenceCntDto();
|
||||
|
||||
Long analId = repo.upsertGroupsFromMapSheetAnal(id);
|
||||
int analDataCnt = repo.upsertGroupsFromInferenceResults(analId);
|
||||
int geomCnt = repo.upsertGeomsFromInferenceResults(analId);
|
||||
int sttcCnt = repo.upsertSttcFromInferenceResults(analId);
|
||||
InferenceResultShpDto.InferenceCntDto cntDto = new InferenceResultShpDto.InferenceCntDto();
|
||||
cntDto.setSheetAnalDataCnt(analDataCnt);
|
||||
cntDto.setInferenceGeomCnt(geomCnt);
|
||||
cntDto.setInferenceSttcnt(sttcCnt);
|
||||
log.info(
|
||||
"[ANAL SAVE] analId={}, tb_map_sheet_anal_data_inference={}, tb_map_sheet_anal_data_inference_geom={}, tb_map_sheet_anal_sttc={}",
|
||||
analId,
|
||||
analDataCnt,
|
||||
geomCnt,
|
||||
sttcCnt);
|
||||
return cntDto;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,6 +202,33 @@ public class MapSheetLearnEntity {
|
||||
@Column(name = "chn_dtct_mst_id")
|
||||
private String chnDtctMstId;
|
||||
|
||||
@Column(name = "shp_create_status")
|
||||
private String shp_create_status;
|
||||
|
||||
@Column(name = "shp_create_message")
|
||||
private String shp_create_message;
|
||||
|
||||
@Column(name = "shp_create_status_dttm")
|
||||
private ZonedDateTime shp_create_status_dttm;
|
||||
|
||||
@Column(name = "shp_status")
|
||||
private String shp_status;
|
||||
|
||||
@Column(name = "shp_stage")
|
||||
private String shp_stage;
|
||||
|
||||
@Column(name = "shp_started_dttm")
|
||||
private ZonedDateTime shp_started_dttm;
|
||||
|
||||
@Column(name = "shp_ended_dttm")
|
||||
private ZonedDateTime shp_ended_dttm;
|
||||
|
||||
@Column(name = "shp_last_message")
|
||||
private String shp_last_message;
|
||||
|
||||
@Column(name = "shp_error_message")
|
||||
private String shp_error_message;
|
||||
|
||||
public InferenceResultDto.ResultList toDto() {
|
||||
return new InferenceResultDto.ResultList(
|
||||
this.uuid,
|
||||
|
||||
@@ -8,11 +8,11 @@ public interface InferenceResultRepositoryCustom {
|
||||
|
||||
Long upsertGroupsFromMapSheetAnal(Long id);
|
||||
|
||||
void upsertGroupsFromInferenceResults(Long analId);
|
||||
int upsertGroupsFromInferenceResults(Long analId);
|
||||
|
||||
void upsertGeomsFromInferenceResults(Long analId);
|
||||
int upsertGeomsFromInferenceResults(Long analId);
|
||||
|
||||
void upsertSttcFromInferenceResults(Long analId);
|
||||
int upsertSttcFromInferenceResults(Long analId);
|
||||
|
||||
Long getInferenceLearnIdByUuid(UUID uuid);
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
||||
* @return 반영된 행 수
|
||||
*/
|
||||
@Override
|
||||
public void upsertGroupsFromInferenceResults(Long analId) {
|
||||
public int upsertGroupsFromInferenceResults(Long analId) {
|
||||
|
||||
String sql =
|
||||
"""
|
||||
@@ -124,7 +124,7 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
||||
updated_dttm = now()
|
||||
""";
|
||||
|
||||
em.createNativeQuery(sql).setParameter("analId", analId).executeUpdate();
|
||||
return em.createNativeQuery(sql).setParameter("analId", analId).executeUpdate();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,7 +136,7 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
||||
* @return 반영된 행 수
|
||||
*/
|
||||
@Override
|
||||
public void upsertGeomsFromInferenceResults(Long analUid) {
|
||||
public int upsertGeomsFromInferenceResults(Long analUid) {
|
||||
|
||||
String sql =
|
||||
"""
|
||||
@@ -229,11 +229,11 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
||||
ref_map_sheet_num = EXCLUDED.ref_map_sheet_num
|
||||
""";
|
||||
|
||||
em.createNativeQuery(sql).setParameter("analUid", analUid).executeUpdate();
|
||||
return em.createNativeQuery(sql).setParameter("analUid", analUid).executeUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upsertSttcFromInferenceResults(Long analUid) {
|
||||
public int upsertSttcFromInferenceResults(Long analUid) {
|
||||
|
||||
String sql =
|
||||
"""
|
||||
@@ -306,7 +306,7 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
||||
,updated_uid = EXCLUDED.updated_uid
|
||||
""";
|
||||
|
||||
em.createNativeQuery(sql).setParameter("analUid", analUid).executeUpdate();
|
||||
return em.createNativeQuery(sql).setParameter("analUid", analUid).executeUpdate();
|
||||
}
|
||||
|
||||
// ===============================
|
||||
|
||||
Reference in New Issue
Block a user