Compare commits
2 Commits
ed3c901143
...
04af23b814
| Author | SHA1 | Date | |
|---|---|---|---|
| 04af23b814 | |||
| a1fc62b3eb |
@@ -35,6 +35,11 @@ public class ChangeDetectionDto {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return name();
|
||||
}
|
||||
}
|
||||
|
||||
@CodeExpose
|
||||
@@ -55,6 +60,11 @@ public class ChangeDetectionDto {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "TestDto", description = "테스트용")
|
||||
|
||||
@@ -324,21 +324,4 @@ public class CommonCodeApiController {
|
||||
public ApiResponseDto<List<CodeDto>> getTypeCode(@PathVariable String type) {
|
||||
return ApiResponseDto.ok(commonCodeService.getTypeCode(type));
|
||||
}
|
||||
|
||||
@Operation(summary = "코드 단건 조회", description = "코드 조회")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "코드 조회 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = CodeDto.class))),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping("/type/copy/{type}")
|
||||
public ApiResponseDto<List<CodeDto>> getTypeCodeCopy(@PathVariable String type) {
|
||||
return ApiResponseDto.ok(commonCodeService.getTypeCode(type));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import lombok.AllArgsConstructor;
|
||||
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;
|
||||
@@ -119,10 +120,12 @@ public class CommonCodeDto {
|
||||
String props2,
|
||||
String props3,
|
||||
ZonedDateTime deletedDttm) {
|
||||
String lang = LocaleContextHolder.getLocale().getLanguage();
|
||||
boolean english = "en".equalsIgnoreCase(lang);
|
||||
this.id = id;
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
this.name = name;
|
||||
this.name = english ? code : name;
|
||||
this.order = order;
|
||||
this.used = used;
|
||||
this.deleted = deleted;
|
||||
|
||||
@@ -45,4 +45,9 @@ public enum CommonUseStatus implements EnumType {
|
||||
public EnumDto<CommonUseStatus> getEnumDto() {
|
||||
return new EnumDto<>(this, this.id, this.text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,13 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CrsType implements EnumType {
|
||||
EPSG_3857("Web Mercator, 웹지도 미터(EPSG:900913 동일)"),
|
||||
EPSG_4326("WGS84 위경도, GeoJSON/OSM 기본"),
|
||||
EPSG_5186("5186::Korea 2000 중부 TM, 한국 SHP"),
|
||||
EPSG_5179("5179::Korea 2000 중부 TM, 한국 SHP");
|
||||
EPSG_3857("Web Mercator, 웹지도 미터(EPSG:900913 동일)", "Web Mercator"),
|
||||
EPSG_4326("WGS84 위경도, GeoJSON/OSM 기본", "GeoJSON/OSM"),
|
||||
EPSG_5186("5186::Korea 2000 중부 TM, 한국 SHP", "5186::Korea 2000"),
|
||||
EPSG_5179("5179::Korea 2000 중부 TM, 한국 SHP", "5179::Korea 2000");
|
||||
|
||||
private final String desc;
|
||||
private final String descEn;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
@@ -25,4 +26,9 @@ public enum CrsType implements EnumType {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return descEn;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,14 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum FileUploadStatus implements EnumType {
|
||||
INIT("초기화"),
|
||||
UPLOADING("업로드중"),
|
||||
DONE("업로드완료"),
|
||||
MERGED("병합완료"),
|
||||
MERGE_FAIL("병합 실패");
|
||||
INIT("초기화", "Init"),
|
||||
UPLOADING("업로드중", "Uploading"),
|
||||
DONE("업로드완료", "Upload Done"),
|
||||
MERGED("병합완료", "Merged Done"),
|
||||
MERGE_FAIL("병합 실패", "Merge Failed");
|
||||
|
||||
private final String desc;
|
||||
private final String descEn;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
@@ -26,4 +27,9 @@ public enum FileUploadStatus implements EnumType {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return descEn;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,11 @@ public enum ImageryFitStatus implements EnumType {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return name();
|
||||
}
|
||||
|
||||
public static ImageryFitStatus fromCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
|
||||
@@ -10,14 +10,15 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum LayerType implements EnumType {
|
||||
TILE("배경지도"),
|
||||
GEOJSON("객체데이터"),
|
||||
WMTS("타일레이어"),
|
||||
WMS("지적도"),
|
||||
KAMCO_WMS("국유인WMS"),
|
||||
KAMCO_WMTS("국유인WMTS");
|
||||
TILE("배경지도", "Tile"),
|
||||
GEOJSON("객체데이터", "GeoJSON"),
|
||||
WMTS("타일레이어", "WMTS"),
|
||||
WMS("지적도", "WMS"),
|
||||
KAMCO_WMS("국유인WMS", "KAMCO_WMS"),
|
||||
KAMCO_WMTS("국유인WMTS", "KAMCO_WMTS");
|
||||
|
||||
private final String desc;
|
||||
private final String descEn;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
@@ -29,6 +30,11 @@ public enum LayerType implements EnumType {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return descEn;
|
||||
}
|
||||
|
||||
public static Optional<LayerType> from(String type) {
|
||||
try {
|
||||
return Optional.of(LayerType.valueOf(type));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,9 @@ public enum RoleType implements EnumType {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return name();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,9 @@ public enum StatusType implements EnumType {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return name();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,9 @@ public enum SyncCheckStateType implements EnumType {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return name();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,4 +30,9 @@ public enum SyncStateType implements EnumType {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return name();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,4 +5,6 @@ public interface EnumType {
|
||||
String getId();
|
||||
|
||||
String getText();
|
||||
|
||||
String getTextEn();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.reflections.Reflections;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
|
||||
public class Enums {
|
||||
|
||||
@@ -32,11 +33,13 @@ public class Enums {
|
||||
// enum -> CodeDto list
|
||||
public static List<CodeDto> toList(Class<? extends Enum<?>> enumClass) {
|
||||
Object[] enums = enumClass.getEnumConstants();
|
||||
String lang = LocaleContextHolder.getLocale().getLanguage();
|
||||
boolean english = "en".equalsIgnoreCase(lang);
|
||||
|
||||
return Arrays.stream(enums)
|
||||
.map(e -> (EnumType) e)
|
||||
.filter(e -> !isHidden(enumClass, (Enum<?>) e))
|
||||
.map(e -> new CodeDto(e.getId(), e.getText()))
|
||||
.map(e -> new CodeDto(e.getId(), english ? e.getTextEn() : e.getText()))
|
||||
.toList();
|
||||
}
|
||||
|
||||
|
||||
@@ -192,6 +192,11 @@ public class ApiResponseDto<T> {
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public static ApiResponseCode getCode(String name) {
|
||||
return ApiResponseCode.valueOf(name.toUpperCase());
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ public class GukYuinDto {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
|
||||
@@ -26,4 +26,9 @@ public enum GukYuinStatus implements EnumType {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,11 @@ public class InferenceResultDto {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
/** 탐지 데이터 옵션 dto */
|
||||
@@ -79,6 +84,11 @@ public class InferenceResultDto {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@@ -108,6 +118,11 @@ public class InferenceResultDto {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@@ -129,6 +144,11 @@ public class InferenceResultDto {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
/** 목록조회 dto */
|
||||
|
||||
@@ -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, "삭제 실패하였습니다. 관리자에게 문의해주세요.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,11 @@ public class LabelAllocateDto {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return name();
|
||||
}
|
||||
}
|
||||
|
||||
@CodeExpose
|
||||
@@ -59,6 +64,11 @@ public class LabelAllocateDto {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return name();
|
||||
}
|
||||
}
|
||||
|
||||
@CodeExpose
|
||||
@@ -80,6 +90,11 @@ public class LabelAllocateDto {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return name();
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
|
||||
@@ -36,6 +36,11 @@ public class ErrorLogDto {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "ErrorLogBasic", description = "에러로그 기본 정보")
|
||||
|
||||
@@ -21,4 +21,9 @@ public enum EventStatus implements EnumType {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,4 +39,9 @@ public enum EventType implements EnumType {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return name();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -41,6 +42,11 @@ public class MapSheetMngDto {
|
||||
public String getText() {
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "MngSearchReq", description = "영상관리 검색 요청")
|
||||
@@ -217,7 +223,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();
|
||||
}
|
||||
}
|
||||
@@ -341,6 +351,10 @@ public class MapSheetMngDto {
|
||||
}
|
||||
|
||||
SyncStateType type = Enums.fromId(SyncStateType.class, enumId);
|
||||
String lang = LocaleContextHolder.getLocale().getLanguage();
|
||||
if ("en".equalsIgnoreCase(lang)) {
|
||||
return type.getTextEn();
|
||||
}
|
||||
return type.getText();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import lombok.AllArgsConstructor;
|
||||
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;
|
||||
|
||||
@@ -65,16 +66,20 @@ public class MembersDto {
|
||||
|
||||
private String getUserRoleName(String roleId) {
|
||||
RoleType type = Enums.fromId(RoleType.class, roleId);
|
||||
return type.getText();
|
||||
String lang = LocaleContextHolder.getLocale().getLanguage();
|
||||
boolean english = "en".equalsIgnoreCase(lang);
|
||||
return english ? type.getTextEn() : type.getText();
|
||||
}
|
||||
|
||||
private String getStatusName(String status, Boolean pwdResetYn) {
|
||||
StatusType type = Enums.fromId(StatusType.class, status);
|
||||
String lang = LocaleContextHolder.getLocale().getLanguage();
|
||||
boolean english = "en".equalsIgnoreCase(lang);
|
||||
pwdResetYn = pwdResetYn != null && pwdResetYn;
|
||||
if (type.equals(StatusType.PENDING) && pwdResetYn) {
|
||||
type = StatusType.ACTIVE;
|
||||
}
|
||||
return type.getText();
|
||||
return english ? type.getTextEn() : 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,11 @@ public class ModelMngDto {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextEn() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "ModelMgmtDto Basic", description = "모델관리 엔티티 기본 정보")
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.kamco.cd.kamcoback.log.dto.EventType;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.AuditLogEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMenuEntity;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.Expression;
|
||||
import com.querydsl.core.types.Projections;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import com.querydsl.core.types.dsl.CaseBuilder;
|
||||
@@ -26,6 +27,7 @@ import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -83,13 +85,18 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
|
||||
public Page<AuditLogDto.MenuAuditList> findLogByMenu(
|
||||
AuditLogDto.searchReq searchReq, String searchValue) {
|
||||
Pageable pageable = searchReq.toPageable();
|
||||
String lang = LocaleContextHolder.getLocale().getLanguage();
|
||||
|
||||
Expression<String> menuNameExpr =
|
||||
"en".equalsIgnoreCase(lang) ? menuEntity.menuNmEn.max() : menuEntity.menuNm.max();
|
||||
|
||||
List<AuditLogDto.MenuAuditList> foundContent =
|
||||
queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
AuditLogDto.MenuAuditList.class,
|
||||
auditLogEntity.menuUid.as("menuId"),
|
||||
menuEntity.menuNm.max().as("menuName"),
|
||||
menuNameExpr,
|
||||
readCount().as("readCount"),
|
||||
cudCount().as("cudCount"),
|
||||
printCount().as("printCount"),
|
||||
@@ -217,21 +224,25 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
|
||||
@Override
|
||||
public Page<AuditLogDto.DailyDetail> findLogByDailyResult(
|
||||
AuditLogDto.searchReq searchReq, LocalDate logDate) {
|
||||
String lang = LocaleContextHolder.getLocale().getLanguage();
|
||||
boolean english = "en".equalsIgnoreCase(lang);
|
||||
Pageable pageable = searchReq.toPageable();
|
||||
QMenuEntity parent = new QMenuEntity("parent");
|
||||
// 1depth menu name
|
||||
StringExpression parentMenuName =
|
||||
new CaseBuilder()
|
||||
.when(parent.menuUid.isNull())
|
||||
.then(menuEntity.menuNm)
|
||||
.otherwise(parent.menuNm);
|
||||
.then(english ? menuEntity.menuNmEn : menuEntity.menuNm)
|
||||
.otherwise(english ? parent.menuNmEn : parent.menuNm);
|
||||
|
||||
// 2depth menu name
|
||||
StringExpression menuName =
|
||||
new CaseBuilder()
|
||||
.when(parent.menuUid.isNull())
|
||||
.then(NULL_STRING)
|
||||
.otherwise(menuEntity.menuNm);
|
||||
.otherwise(english ? menuEntity.menuNmEn : menuEntity.menuNm);
|
||||
|
||||
StringExpression menuNm = (english ? menuEntity.menuNmEn : menuEntity.menuNm);
|
||||
|
||||
List<AuditLogDto.DailyDetail> foundContent =
|
||||
queryFactory
|
||||
@@ -241,20 +252,20 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
|
||||
auditLogEntity.id.as("logId"),
|
||||
memberEntity.name.as("userName"),
|
||||
memberEntity.employeeNo.as("loginId"),
|
||||
menuEntity.menuNm.as("menuName"),
|
||||
menuNm.as("menuName"),
|
||||
auditLogEntity.eventType.as("eventType"),
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD HH24:MI')", auditLogEntity.createdDate)
|
||||
.as("logDateTime"),
|
||||
Projections.constructor(
|
||||
AuditLogDto.LogDetail.class,
|
||||
Expressions.constant("한국자산관리공사"), // serviceName
|
||||
Expressions.constant(english ? "Kamco" : "한국자산관리공사"), // serviceName
|
||||
parentMenuName.as("parentMenuName"),
|
||||
menuName,
|
||||
menuEntity.menuUrl.as("menuUrl"),
|
||||
menuEntity.description.as("menuDescription"),
|
||||
menuEntity.menuOrder.as("sortOrder"),
|
||||
menuEntity.isUse.as("used")))) // TODO
|
||||
menuEntity.isUse.as("used"))))
|
||||
.from(auditLogEntity)
|
||||
.leftJoin(menuEntity)
|
||||
.on(auditLogEntity.menuUid.eq(menuEntity.menuUid))
|
||||
@@ -285,21 +296,23 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
|
||||
@Override
|
||||
public Page<AuditLogDto.MenuDetail> findLogByMenuResult(
|
||||
AuditLogDto.searchReq searchReq, String menuUid) {
|
||||
String lang = LocaleContextHolder.getLocale().getLanguage();
|
||||
boolean english = "en".equalsIgnoreCase(lang);
|
||||
Pageable pageable = searchReq.toPageable();
|
||||
QMenuEntity parent = new QMenuEntity("parent");
|
||||
// 1depth menu name
|
||||
StringExpression parentMenuName =
|
||||
new CaseBuilder()
|
||||
.when(parent.menuUid.isNull())
|
||||
.then(menuEntity.menuNm)
|
||||
.otherwise(parent.menuNm);
|
||||
.then(english ? menuEntity.menuNmEn : menuEntity.menuNm)
|
||||
.otherwise(english ? parent.menuNmEn : parent.menuNm);
|
||||
|
||||
// 2depth menu name
|
||||
StringExpression menuName =
|
||||
new CaseBuilder()
|
||||
.when(parent.menuUid.isNull())
|
||||
.then(NULL_STRING)
|
||||
.otherwise(menuEntity.menuNm);
|
||||
.otherwise(english ? menuEntity.menuNmEn : menuEntity.menuNm);
|
||||
|
||||
List<AuditLogDto.MenuDetail> foundContent =
|
||||
queryFactory
|
||||
@@ -315,7 +328,7 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
|
||||
auditLogEntity.eventType.as("eventType"),
|
||||
Projections.constructor(
|
||||
AuditLogDto.LogDetail.class,
|
||||
Expressions.constant("한국자산관리공사"), // serviceName
|
||||
Expressions.constant(english ? "Kamco" : "한국자산관리공사"), // serviceName
|
||||
parentMenuName.as("parentMenuName"),
|
||||
menuName,
|
||||
menuEntity.menuUrl.as("menuUrl"),
|
||||
@@ -352,21 +365,25 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
|
||||
@Override
|
||||
public Page<AuditLogDto.UserDetail> findLogByAccountResult(
|
||||
AuditLogDto.searchReq searchReq, Long userUid) {
|
||||
String lang = LocaleContextHolder.getLocale().getLanguage();
|
||||
boolean english = "en".equalsIgnoreCase(lang);
|
||||
Pageable pageable = searchReq.toPageable();
|
||||
QMenuEntity parent = new QMenuEntity("parent");
|
||||
// 1depth menu name
|
||||
StringExpression parentMenuName =
|
||||
new CaseBuilder()
|
||||
.when(parent.menuUid.isNull())
|
||||
.then(menuEntity.menuNm)
|
||||
.otherwise(parent.menuNm);
|
||||
.then(english ? menuEntity.menuNmEn : menuEntity.menuNm)
|
||||
.otherwise(english ? parent.menuNmEn : parent.menuNm);
|
||||
|
||||
// 2depth menu name
|
||||
StringExpression menuName =
|
||||
new CaseBuilder()
|
||||
.when(parent.menuUid.isNull())
|
||||
.then(NULL_STRING)
|
||||
.otherwise(menuEntity.menuNm);
|
||||
.otherwise(english ? menuEntity.menuNmEn : menuEntity.menuNm);
|
||||
|
||||
StringExpression menuNm = (english ? menuEntity.menuNmEn : menuEntity.menuNm);
|
||||
|
||||
List<AuditLogDto.UserDetail> foundContent =
|
||||
queryFactory
|
||||
@@ -377,11 +394,11 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD HH24:MI')", auditLogEntity.createdDate)
|
||||
.as("logDateTime"),
|
||||
menuEntity.menuNm.as("menuName"),
|
||||
menuNm.as("menuName"),
|
||||
auditLogEntity.eventType.as("eventType"),
|
||||
Projections.constructor(
|
||||
AuditLogDto.LogDetail.class,
|
||||
Expressions.constant("한국자산관리공사"), // serviceName
|
||||
Expressions.constant(english ? "Kamco" : "한국자산관리공사"), // serviceName
|
||||
parentMenuName.as("parentMenuName"),
|
||||
menuName,
|
||||
menuEntity.menuUrl.as("menuUrl"),
|
||||
@@ -442,7 +459,7 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
|
||||
if (StringUtils.isBlank(searchValue)) {
|
||||
return null;
|
||||
}
|
||||
return menuEntity.menuNm.contains(searchValue);
|
||||
return menuEntity.menuNm.contains(searchValue).or(menuEntity.menuNmEn.contains(searchValue));
|
||||
}
|
||||
|
||||
private BooleanExpression loginIdOrUsernameContains(String searchValue) {
|
||||
|
||||
Reference in New Issue
Block a user