메뉴 목록, 영상관리 목록 API 영문 헤더 추가, 추론 삭제기능 추가
This commit is contained in:
@@ -9,12 +9,13 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum MngStateType implements EnumType {
|
||||
NOTYET("동기화 시작"),
|
||||
PROCESSING("데이터 체크"),
|
||||
DONE("동기화 작업 종료"),
|
||||
TAKINGERROR("오류 데이터 처리중");
|
||||
NOTYET("동기화 시작", "Sync Started"),
|
||||
PROCESSING("데이터 체크", "Data Check"),
|
||||
DONE("동기화 작업 종료", "Sync Completed"),
|
||||
TAKINGERROR("오류 데이터 처리중", "Processing Error Data");
|
||||
|
||||
private final String desc;
|
||||
private final String descEn;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
@@ -25,4 +26,8 @@ public enum MngStateType implements EnumType {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public String getTextEn() {
|
||||
return descEn;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,4 +448,22 @@ public class InferenceResultApiController {
|
||||
UUID uuid) {
|
||||
return ApiResponseDto.ok(inferenceResultService.getInferenceRunMapId(uuid));
|
||||
}
|
||||
|
||||
@Operation(summary = "추론 삭제", description = "추론관리 > 추론목록 > 추론 상세 > 추론 삭제")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "201",
|
||||
description = "종료 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Page.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@DeleteMapping("/delete-inference/{uuid}")
|
||||
public ApiResponseDto<ApiResponseDto.ResponseObj> deleteInference(@PathVariable UUID uuid) {
|
||||
return ApiResponseDto.ok(inferenceResultService.deleteInference(uuid));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,24 +7,13 @@ import com.kamco.cd.kamcoback.common.geometry.GeoJsonFileWriter.Scene;
|
||||
import com.kamco.cd.kamcoback.common.inference.service.InferenceCommonService;
|
||||
import com.kamco.cd.kamcoback.common.inference.utils.GeoJsonValidator;
|
||||
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.AnalResultInfo;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Dashboard;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Detail;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Geom;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.MapSheet;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.SearchGeoReq;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.*;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.DetectOption;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceLearnDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetScope;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.SaveInferenceAiDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Status;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.*;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto.pred_requests_areas;
|
||||
import com.kamco.cd.kamcoback.log.dto.AuditLogDto;
|
||||
@@ -44,16 +33,7 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -70,7 +50,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Transactional(readOnly = true)
|
||||
@Transactional
|
||||
public class InferenceResultService {
|
||||
|
||||
private final InferenceResultCoreService inferenceResultCoreService;
|
||||
@@ -1033,4 +1013,14 @@ public class InferenceResultService {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public ApiResponseDto.ResponseObj deleteInference(UUID uuid) {
|
||||
long result = inferenceResultCoreService.deleteInference(uuid);
|
||||
if (result > 0) {
|
||||
return new ApiResponseDto.ResponseObj(ApiResponseDto.ApiResponseCode.OK, "삭제되었습니다.");
|
||||
} else {
|
||||
return new ApiResponseDto.ResponseObj(
|
||||
ApiResponseDto.ApiResponseCode.INTERNAL_SERVER_ERROR, "삭제 실패하였습니다. 관리자에게 문의해주세요.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
@@ -217,7 +218,11 @@ public class MapSheetMngDto {
|
||||
enumId = "NOTYET";
|
||||
}
|
||||
|
||||
String lang = LocaleContextHolder.getLocale().getLanguage();
|
||||
MngStateType type = Enums.fromId(MngStateType.class, enumId);
|
||||
if ("en".equalsIgnoreCase(lang)) {
|
||||
return type.getTextEn();
|
||||
}
|
||||
return type.getText();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Tag(name = "메뉴 조회", description = "메뉴 조회 API")
|
||||
@@ -69,10 +68,9 @@ public class MyMenuApiController {
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping
|
||||
public ApiResponseDto<List<MyMenuDto.Basic>> getFindAllByRole(
|
||||
@RequestParam(required = false) String locale) {
|
||||
public ApiResponseDto<List<MyMenuDto.Basic>> getFindAllByRole() {
|
||||
UserUtil userUtil = new UserUtil();
|
||||
String role = userUtil.getRole();
|
||||
return ApiResponseDto.ok(myMenuService.getFindByRole(role, locale));
|
||||
return ApiResponseDto.ok(myMenuService.getFindByRole(role));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class MyMenuService {
|
||||
* @param role
|
||||
* @return
|
||||
*/
|
||||
public List<MyMenuDto.Basic> getFindByRole(String role, String locale) {
|
||||
return menuCoreService.getFindByRole(role, locale);
|
||||
public List<MyMenuDto.Basic> getFindByRole(String role) {
|
||||
return menuCoreService.getFindByRole(role);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -626,4 +626,8 @@ public class InferenceResultCoreService {
|
||||
public List<InferenceResultsTestingDto.Basic> getInferenceResultGroupList(List<Long> batchIds) {
|
||||
return inferenceResultsTestingRepository.getInferenceResultGroupList(batchIds);
|
||||
}
|
||||
|
||||
public long deleteInference(UUID uuid) {
|
||||
return inferenceResultRepository.deleteInference(uuid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.kamco.cd.kamcoback.postgres.repository.menu.MenuRepository;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@@ -25,9 +26,10 @@ public class MenuCoreService {
|
||||
* @param role
|
||||
* @return
|
||||
*/
|
||||
public List<MyMenuDto.Basic> getFindByRole(String role, String locale) {
|
||||
public List<MyMenuDto.Basic> getFindByRole(String role) {
|
||||
List<MenuEntity> entities = menuRepository.getFindByRole(role);
|
||||
boolean english = locale != null && locale.equals("en");
|
||||
String lang = LocaleContextHolder.getLocale().getLanguage();
|
||||
boolean english = lang.equalsIgnoreCase("en");
|
||||
return entities.stream()
|
||||
.map(
|
||||
parent -> {
|
||||
|
||||
@@ -229,6 +229,9 @@ public class MapSheetLearnEntity {
|
||||
@Column(name = "shp_error_message")
|
||||
private String shp_error_message;
|
||||
|
||||
@Column(name = "is_deleted")
|
||||
private Boolean isDeleted;
|
||||
|
||||
public InferenceResultDto.ResultList toDto() {
|
||||
return new InferenceResultDto.ResultList(
|
||||
this.uuid,
|
||||
|
||||
@@ -62,4 +62,11 @@ public interface InferenceResultRepositoryCustom {
|
||||
* @return
|
||||
*/
|
||||
Optional<MapSheetAnalInferenceEntity> getAnalInferenceDataByLearnId(Long id);
|
||||
|
||||
/**
|
||||
* 추론 삭제
|
||||
*
|
||||
* @param uuid
|
||||
*/
|
||||
long deleteInference(UUID uuid);
|
||||
}
|
||||
|
||||
@@ -346,4 +346,13 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
||||
.where(mapSheetAnalInferenceEntity.learnId.eq(id))
|
||||
.fetchOne());
|
||||
}
|
||||
|
||||
@Override
|
||||
public long deleteInference(UUID uuid) {
|
||||
return queryFactory
|
||||
.update(mapSheetLearnEntity)
|
||||
.set(mapSheetLearnEntity.isDeleted, true)
|
||||
.where(mapSheetLearnEntity.uuid.eq(uuid))
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,9 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
builder.and(mapSheetLearnEntity.title.containsIgnoreCase(req.getTitle()));
|
||||
}
|
||||
|
||||
// 삭제여부 값 추가
|
||||
builder.and(mapSheetLearnEntity.isDeleted.eq(false).or(mapSheetLearnEntity.isDeleted.isNull()));
|
||||
|
||||
List<MapSheetLearnEntity> content =
|
||||
queryFactory
|
||||
.select(mapSheetLearnEntity)
|
||||
|
||||
@@ -161,7 +161,9 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
||||
mapSheetLearnEntity.uuid))
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.leftJoin(mapSheetLearnEntity)
|
||||
.on(mapSheetAnalInferenceEntity.learnId.eq(mapSheetLearnEntity.id))
|
||||
.on(
|
||||
mapSheetAnalInferenceEntity.learnId.eq(mapSheetLearnEntity.id),
|
||||
mapSheetLearnEntity.isDeleted.eq(false).or(mapSheetLearnEntity.isDeleted.isNull()))
|
||||
.where(baseWhereBuilder)
|
||||
.orderBy(
|
||||
stateOrder.asc(),
|
||||
|
||||
Reference in New Issue
Block a user