Merge remote-tracking branch 'origin/feat/dev_251201' into feat/dev_251201
# Conflicts: # src/main/java/com/kamco/cd/kamcoback/config/FileConfig.java
This commit is contained in:
@@ -2,7 +2,7 @@ package com.kamco.cd.kamcoback.mapsheet.dto;
|
|||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.enums.MngStateType;
|
import com.kamco.cd.kamcoback.common.enums.MngStateType;
|
||||||
import com.kamco.cd.kamcoback.common.enums.SyncStateType;
|
import com.kamco.cd.kamcoback.common.enums.SyncStateType;
|
||||||
import com.kamco.cd.kamcoback.common.utils.Enums;
|
import com.kamco.cd.kamcoback.common.utils.enums.Enums;
|
||||||
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
@@ -44,6 +44,7 @@ public class MapSheetMngDto {
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class AddReq {
|
public static class AddReq {
|
||||||
|
|
||||||
@Schema(description = "관리년도", example = "2022")
|
@Schema(description = "관리년도", example = "2022")
|
||||||
private int mngYyyy;
|
private int mngYyyy;
|
||||||
|
|
||||||
@@ -57,6 +58,7 @@ public class MapSheetMngDto {
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class DeleteFileReq {
|
public static class DeleteFileReq {
|
||||||
|
|
||||||
@Schema(description = "파일 경로", example = "/app/original-images/2024/00000001.tif")
|
@Schema(description = "파일 경로", example = "/app/original-images/2024/00000001.tif")
|
||||||
private String filePath;
|
private String filePath;
|
||||||
}
|
}
|
||||||
@@ -67,6 +69,7 @@ public class MapSheetMngDto {
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class MngDto {
|
public static class MngDto {
|
||||||
|
|
||||||
private int rowNum;
|
private int rowNum;
|
||||||
private int mngYyyy;
|
private int mngYyyy;
|
||||||
private String mngPath;
|
private String mngPath;
|
||||||
@@ -85,7 +88,6 @@ public class MapSheetMngDto {
|
|||||||
@JsonFormatDttm private ZonedDateTime rgstStrtDttm;
|
@JsonFormatDttm private ZonedDateTime rgstStrtDttm;
|
||||||
@JsonFormatDttm private ZonedDateTime rgstEndDttm;
|
@JsonFormatDttm private ZonedDateTime rgstEndDttm;
|
||||||
|
|
||||||
|
|
||||||
public double getSyncStateDoneRate() {
|
public double getSyncStateDoneRate() {
|
||||||
if (this.syncTotCnt == null || this.syncTotCnt == 0) {
|
if (this.syncTotCnt == null || this.syncTotCnt == 0) {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
@@ -110,7 +112,9 @@ public class MapSheetMngDto {
|
|||||||
|
|
||||||
public String getMngStateName() {
|
public String getMngStateName() {
|
||||||
String enumId = this.mngState;
|
String enumId = this.mngState;
|
||||||
if (enumId == null || enumId.isEmpty()) enumId = "NOTYET";
|
if (enumId == null || enumId.isEmpty()) {
|
||||||
|
enumId = "NOTYET";
|
||||||
|
}
|
||||||
|
|
||||||
MngStateType type = Enums.fromId(MngStateType.class, enumId);
|
MngStateType type = Enums.fromId(MngStateType.class, enumId);
|
||||||
return type.getText();
|
return type.getText();
|
||||||
@@ -162,6 +166,7 @@ public class MapSheetMngDto {
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public static class ErrorDataDto {
|
public static class ErrorDataDto {
|
||||||
|
|
||||||
private Long hstUid;
|
private Long hstUid;
|
||||||
private Integer mngYyyy;
|
private Integer mngYyyy;
|
||||||
private String mapSheetNum;
|
private String mapSheetNum;
|
||||||
@@ -220,19 +225,20 @@ public class MapSheetMngDto {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String getSyncStateName(String enumId) {
|
private String getSyncStateName(String enumId) {
|
||||||
if (enumId == null || enumId.isEmpty()) enumId = "NOTYET";
|
if (enumId == null || enumId.isEmpty()) {
|
||||||
|
enumId = "NOTYET";
|
||||||
|
}
|
||||||
|
|
||||||
SyncStateType type = Enums.fromId(SyncStateType.class, enumId);
|
SyncStateType type = Enums.fromId(SyncStateType.class, enumId);
|
||||||
return type.getText();
|
return type.getText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(name = "MngFIleDto", description = "관리파일정보")
|
@Schema(name = "MngFIleDto", description = "관리파일정보")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public static class MngFIleDto {
|
public static class MngFIleDto {
|
||||||
|
|
||||||
private Long fileUid;
|
private Long fileUid;
|
||||||
private String filePath;
|
private String filePath;
|
||||||
private String fileName;
|
private String fileName;
|
||||||
@@ -247,6 +253,7 @@ public class MapSheetMngDto {
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class DmlReturn {
|
public static class DmlReturn {
|
||||||
|
|
||||||
private String flag;
|
private String flag;
|
||||||
private String message;
|
private String message;
|
||||||
}
|
}
|
||||||
@@ -257,6 +264,7 @@ public class MapSheetMngDto {
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class MngFileAddReq {
|
public static class MngFileAddReq {
|
||||||
|
|
||||||
private int mngYyyy;
|
private int mngYyyy;
|
||||||
private String mapSheetNum;
|
private String mapSheetNum;
|
||||||
private String refMapSheetNum;
|
private String refMapSheetNum;
|
||||||
@@ -274,6 +282,7 @@ public class MapSheetMngDto {
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class MngFilesDto {
|
public static class MngFilesDto {
|
||||||
|
|
||||||
private long fileUid;
|
private long fileUid;
|
||||||
private int mngYyyy;
|
private int mngYyyy;
|
||||||
private String mapSheetNum;
|
private String mapSheetNum;
|
||||||
@@ -285,17 +294,16 @@ public class MapSheetMngDto {
|
|||||||
private Long fileSize;
|
private Long fileSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(name = "ReqUpdateErrorCheckStateDto", description = "영상관리 오류데이터 체크결과 수정요청")
|
@Schema(name = "ReqUpdateErrorCheckStateDto", description = "영상관리 오류데이터 체크결과 수정요청")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public static class ReqUpdateErrorCheckStateDto {
|
public static class ReqUpdateErrorCheckStateDto {
|
||||||
|
|
||||||
private Long hstUid;
|
private Long hstUid;
|
||||||
private String errorCheckState;
|
private String errorCheckState;
|
||||||
private String errorCheckTfwFileName;
|
private String errorCheckTfwFileName;
|
||||||
private String errorCheckTifFileName;
|
private String errorCheckTifFileName;
|
||||||
/*
|
/*
|
||||||
public reqErrorDataCheckStateDto(
|
public reqErrorDataCheckStateDto(
|
||||||
Long hstUid,
|
Long hstUid,
|
||||||
String errorCheckState,
|
String errorCheckState,
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import static java.lang.String.CASE_INSENSITIVE_ORDER;
|
|||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.FIleChecker;
|
import com.kamco.cd.kamcoback.common.utils.FIleChecker;
|
||||||
import com.kamco.cd.kamcoback.config.FileConfig;
|
import com.kamco.cd.kamcoback.config.FileConfig;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto;
|
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.Basic;
|
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.Basic;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FilesDto;
|
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FilesDto;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDepthDto;
|
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDepthDto;
|
||||||
@@ -16,7 +15,6 @@ import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.ErrorDataDto;
|
|||||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.ErrorSearchReq;
|
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.ErrorSearchReq;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngDto;
|
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngDto;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngFilesDto;
|
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngFilesDto;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.ReqUpdateErrorCheckStateDto;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngCoreService;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -31,7 +29,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -246,8 +243,6 @@ public class MapSheetMngService {
|
|||||||
return mapSheetMngCoreService.findMapSheetMngYyyyList();
|
return mapSheetMngCoreService.findMapSheetMngYyyyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public MngDto findMapSheetMng(int mngYyyy) {
|
public MngDto findMapSheetMng(int mngYyyy) {
|
||||||
return mapSheetMngCoreService.findMapSheetMng(mngYyyy);
|
return mapSheetMngCoreService.findMapSheetMng(mngYyyy);
|
||||||
}
|
}
|
||||||
@@ -260,8 +255,7 @@ public class MapSheetMngService {
|
|||||||
return new DmlReturn("success", "작업완료 처리되었습니다.");
|
return new DmlReturn("success", "작업완료 처리되었습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<ErrorDataDto> findMapSheetErrorList(
|
public Page<ErrorDataDto> findMapSheetErrorList(@Valid ErrorSearchReq searchReq) {
|
||||||
@Valid ErrorSearchReq searchReq) {
|
|
||||||
return mapSheetMngCoreService.findMapSheetErrorList(searchReq);
|
return mapSheetMngCoreService.findMapSheetErrorList(searchReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,44 +319,39 @@ public class MapSheetMngService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ErrorDataDto errDto = mapSheetMngCoreService.findMapSheetError(hstUid);
|
ErrorDataDto errDto = mapSheetMngCoreService.findMapSheetError(hstUid);
|
||||||
if( errDto == null )
|
if (errDto == null) {
|
||||||
{
|
|
||||||
return new DmlReturn("fail", "NO hstUid Data");
|
return new DmlReturn("fail", "NO hstUid Data");
|
||||||
}
|
}
|
||||||
MngDto mngDto = mapSheetMngCoreService.findMapSheetMng(errDto.getMngYyyy());
|
MngDto mngDto = mapSheetMngCoreService.findMapSheetMng(errDto.getMngYyyy());
|
||||||
|
|
||||||
String targetYearDir = mngDto.getMngPath();
|
String targetYearDir = mngDto.getMngPath();
|
||||||
|
|
||||||
List<FIleChecker.Basic> basicTfwList = FIleChecker.getFilesFromAllDepth(targetYearDir,
|
List<FIleChecker.Basic> basicTfwList =
|
||||||
tfwFile.getOriginalFilename(),
|
FIleChecker.getFilesFromAllDepth(
|
||||||
"tfw",
|
targetYearDir, tfwFile.getOriginalFilename(), "tfw", 100, "name", 0, 100);
|
||||||
100,
|
|
||||||
"name",
|
|
||||||
0, 100);
|
|
||||||
|
|
||||||
List<FIleChecker.Basic> basicTifList = FIleChecker.getFilesFromAllDepth(targetYearDir,
|
List<FIleChecker.Basic> basicTifList =
|
||||||
tifFile.getOriginalFilename(),
|
FIleChecker.getFilesFromAllDepth(
|
||||||
"tif",
|
targetYearDir, tifFile.getOriginalFilename(), "tif", 100, "name", 0, 100);
|
||||||
100,
|
|
||||||
"name",
|
|
||||||
0, 100);
|
|
||||||
|
|
||||||
int tfwCnt =
|
int tfwCnt =
|
||||||
(int)
|
(int)
|
||||||
basicTfwList.stream().filter(dto -> dto.getExtension().toString().equals("tfw")).count();
|
basicTfwList.stream()
|
||||||
|
.filter(dto -> dto.getExtension().toString().equals("tfw"))
|
||||||
|
.count();
|
||||||
|
|
||||||
int tifCnt =
|
int tifCnt =
|
||||||
(int)
|
(int)
|
||||||
basicTifList.stream().filter(dto -> dto.getExtension().toString().equals("tif")).count();
|
basicTifList.stream()
|
||||||
|
.filter(dto -> dto.getExtension().toString().equals("tif"))
|
||||||
|
.count();
|
||||||
|
|
||||||
|
if (tfwCnt > 0 || tifCnt > 0) {
|
||||||
if( tfwCnt > 0 || tifCnt > 0 )
|
|
||||||
{
|
|
||||||
String tfwMsg = "";
|
String tfwMsg = "";
|
||||||
String tifMsg = "";
|
String tifMsg = "";
|
||||||
if( tfwCnt > 0 )tfwMsg = tfwFile.getOriginalFilename();
|
if (tfwCnt > 0) tfwMsg = tfwFile.getOriginalFilename();
|
||||||
if( tifCnt > 0 )tifMsg = tifFile.getOriginalFilename();
|
if (tifCnt > 0) tifMsg = tifFile.getOriginalFilename();
|
||||||
return new DmlReturn("fail", tfwMsg+","+tifMsg+ " DUPLICATE ERROR");
|
return new DmlReturn("fail", tfwMsg + "," + tifMsg + " DUPLICATE ERROR");
|
||||||
}
|
}
|
||||||
|
|
||||||
File directory = new File(tmpPath);
|
File directory = new File(tmpPath);
|
||||||
@@ -375,14 +364,12 @@ public class MapSheetMngService {
|
|||||||
tfwFile.transferTo(tfwTmpSavePath);
|
tfwFile.transferTo(tfwTmpSavePath);
|
||||||
tifFile.transferTo(tifTmpSavePath);
|
tifFile.transferTo(tifTmpSavePath);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
//throw new RuntimeException(e);
|
// throw new RuntimeException(e);
|
||||||
return new DmlReturn("fail", "UPLOAD ERROR");
|
return new DmlReturn("fail", "UPLOAD ERROR");
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !FIleChecker.cmmndGdalInfo(tifTmpPath) )return new DmlReturn("fail", "TIF TYPE ERROR");
|
if (!FIleChecker.cmmndGdalInfo(tifTmpPath)) return new DmlReturn("fail", "TIF TYPE ERROR");
|
||||||
if( !FIleChecker.checkTfw(tfwTmpPath) )return new DmlReturn("fail", "TFW TYPE ERROR");
|
if (!FIleChecker.checkTfw(tfwTmpPath)) return new DmlReturn("fail", "TFW TYPE ERROR");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 싱크파일목록 가저오기
|
// 싱크파일목록 가저오기
|
||||||
List<MngFilesDto> mngFiles = mapSheetMngCoreService.findIdToMapSheetFileList(hstUid);
|
List<MngFilesDto> mngFiles = mapSheetMngCoreService.findIdToMapSheetFileList(hstUid);
|
||||||
@@ -397,14 +384,15 @@ public class MapSheetMngService {
|
|||||||
Path uploadTargetPath = null;
|
Path uploadTargetPath = null;
|
||||||
|
|
||||||
if (uploadPath.isEmpty()) {
|
if (uploadPath.isEmpty()) {
|
||||||
MngFilesDto filesDto = mapSheetMngCoreService.findYyyyToMapSheetFilePathRefer(errDto.getMngYyyy());
|
MngFilesDto filesDto =
|
||||||
|
mapSheetMngCoreService.findYyyyToMapSheetFilePathRefer(errDto.getMngYyyy());
|
||||||
String referPath = filesDto.getFilePath();
|
String referPath = filesDto.getFilePath();
|
||||||
uploadPath = Paths.get(referPath).getParent().toString()+"/"+errDto.getRefMapSheetNum();
|
uploadPath = Paths.get(referPath).getParent().toString() + "/" + errDto.getRefMapSheetNum();
|
||||||
tfwTargetPath = Paths.get(uploadPath).resolve(tfwFile.getOriginalFilename());
|
tfwTargetPath = Paths.get(uploadPath).resolve(tfwFile.getOriginalFilename());
|
||||||
tifTargetPath = Paths.get(uploadPath).resolve(tifFile.getOriginalFilename());
|
tifTargetPath = Paths.get(uploadPath).resolve(tifFile.getOriginalFilename());
|
||||||
}
|
}
|
||||||
|
|
||||||
//String searchDir =
|
// String searchDir =
|
||||||
|
|
||||||
try {
|
try {
|
||||||
uploadTargetPath = Paths.get(uploadPath);
|
uploadTargetPath = Paths.get(uploadPath);
|
||||||
@@ -415,13 +403,10 @@ public class MapSheetMngService {
|
|||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
//hst업데이트
|
// hst업데이트
|
||||||
mapSheetMngCoreService.updateMapSheetMngHstSyncCheckState(
|
mapSheetMngCoreService.updateMapSheetMngHstSyncCheckState(
|
||||||
hstUid,
|
hstUid, uploadPath, tfwFile.getOriginalFilename(), tifFile.getOriginalFilename());
|
||||||
uploadPath,
|
// 파일정보 업데이트
|
||||||
tfwFile.getOriginalFilename(),
|
|
||||||
tifFile.getOriginalFilename());
|
|
||||||
//파일정보 업데이트
|
|
||||||
mapSheetMngCoreService.deleteByHstUidMngFile(hstUid);
|
mapSheetMngCoreService.deleteByHstUidMngFile(hstUid);
|
||||||
|
|
||||||
MapSheetMngDto.MngFileAddReq addReq = new MapSheetMngDto.MngFileAddReq();
|
MapSheetMngDto.MngFileAddReq addReq = new MapSheetMngDto.MngFileAddReq();
|
||||||
@@ -441,7 +426,6 @@ public class MapSheetMngService {
|
|||||||
addReq.setFileSize(tifFile.getSize());
|
addReq.setFileSize(tifFile.getSize());
|
||||||
mapSheetMngCoreService.mngFileSave(addReq);
|
mapSheetMngCoreService.mngFileSave(addReq);
|
||||||
|
|
||||||
|
|
||||||
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
|
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,7 +438,7 @@ public class MapSheetMngService {
|
|||||||
|
|
||||||
for (Long uid : fileUids) {
|
for (Long uid : fileUids) {
|
||||||
MapSheetMngDto.MngFilesDto dto = mapSheetMngCoreService.findIdToMapSheetFile(uid);
|
MapSheetMngDto.MngFilesDto dto = mapSheetMngCoreService.findIdToMapSheetFile(uid);
|
||||||
String filePath = dto.getFilePath()+"/"+dto.getFileName();
|
String filePath = dto.getFilePath() + "/" + dto.getFileName();
|
||||||
Path path = Paths.get(filePath);
|
Path path = Paths.get(filePath);
|
||||||
try {
|
try {
|
||||||
boolean isDeleted = Files.deleteIfExists(path);
|
boolean isDeleted = Files.deleteIfExists(path);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.model.dto;
|
|||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -69,7 +70,12 @@ public class ModelMgmtDto {
|
|||||||
private String dockerFileNm;
|
private String dockerFileNm;
|
||||||
private String modelType;
|
private String modelType;
|
||||||
private String createCompleteDttm;
|
private String createCompleteDttm;
|
||||||
private String recentUseDttm;
|
private String recentUseDttm; // TODO: 추론관리 테이블 나오면 분석진행중일 때 사용중으로 리턴하기
|
||||||
|
private BigDecimal f1Score;
|
||||||
|
private BigDecimal precision;
|
||||||
|
private BigDecimal recall;
|
||||||
|
private BigDecimal accuracy;
|
||||||
|
private BigDecimal iou;
|
||||||
private Boolean deleted;
|
private Boolean deleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.kamco.cd.kamcoback.postgres.core;
|
|||||||
|
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
|
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngFileEntity;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.mapsheet.MapSheetMngRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.mapsheet.MapSheetMngRepository;
|
||||||
import jakarta.persistence.EntityNotFoundException;
|
import jakarta.persistence.EntityNotFoundException;
|
||||||
@@ -55,20 +54,16 @@ public class MapSheetMngCoreService {
|
|||||||
|
|
||||||
public MapSheetMngDto.DmlReturn mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq) {
|
public MapSheetMngDto.DmlReturn mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq) {
|
||||||
|
|
||||||
|
|
||||||
mapSheetMngRepository.mngFileSave(addReq);
|
mapSheetMngRepository.mngFileSave(addReq);
|
||||||
// int hstCnt = mapSheetMngRepository.insertMapSheetOrgDataToMapSheetMngHst(saved.getMngYyyy());
|
// int hstCnt = mapSheetMngRepository.insertMapSheetOrgDataToMapSheetMngHst(saved.getMngYyyy());
|
||||||
|
|
||||||
return new MapSheetMngDto.DmlReturn("success", "파일정보저장되었습니다.");
|
return new MapSheetMngDto.DmlReturn("success", "파일정보저장되었습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void updateMapSheetMngHstSyncCheckState(
|
public void updateMapSheetMngHstSyncCheckState(
|
||||||
Long hstUid,
|
Long hstUid, String uploadPath, String syncCheckTfwFileName, String syncCheckTifFileName) {
|
||||||
String uploadPath,
|
mapSheetMngRepository.updateMapSheetMngHstSyncCheckState(
|
||||||
String syncCheckTfwFileName,
|
hstUid, uploadPath, syncCheckTfwFileName, syncCheckTifFileName);
|
||||||
String syncCheckTifFileName){
|
|
||||||
mapSheetMngRepository.updateMapSheetMngHstSyncCheckState(hstUid, uploadPath, syncCheckTfwFileName, syncCheckTifFileName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||||
@@ -80,13 +75,10 @@ public class MapSheetMngCoreService {
|
|||||||
return mapSheetMngRepository.findMapSheetError(hstUid);
|
return mapSheetMngRepository.findMapSheetError(hstUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<MapSheetMngDto.MngFilesDto> findIdToMapSheetFileList(Long hstUid) {
|
public List<MapSheetMngDto.MngFilesDto> findIdToMapSheetFileList(Long hstUid) {
|
||||||
return mapSheetMngRepository.findIdToMapSheetFileList(hstUid);
|
return mapSheetMngRepository.findIdToMapSheetFileList(hstUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public MapSheetMngDto.MngFilesDto findYyyyToMapSheetFilePathRefer(int mngYyyy) {
|
public MapSheetMngDto.MngFilesDto findYyyyToMapSheetFilePathRefer(int mngYyyy) {
|
||||||
return mapSheetMngRepository.findYyyyToMapSheetFilePathRefer(mngYyyy);
|
return mapSheetMngRepository.findYyyyToMapSheetFilePathRefer(mngYyyy);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.kamco.cd.kamcoback.postgres.entity;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import java.time.ZonedDateTime;
|
||||||
|
import java.util.Map;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.JdbcTypeCode;
|
||||||
|
import org.hibernate.type.SqlTypes;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "tb_model_result_metric")
|
||||||
|
@Getter
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ModelResultMetricEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "metric_uid")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "model_uid")
|
||||||
|
private Long modelUid;
|
||||||
|
|
||||||
|
@Column(name = "model_ver_uid")
|
||||||
|
private Long modelVerUid;
|
||||||
|
|
||||||
|
@JdbcTypeCode(SqlTypes.JSON)
|
||||||
|
@Column(name = "metrics", columnDefinition = "jsonb")
|
||||||
|
private Map<String, Object> metrics;
|
||||||
|
|
||||||
|
@Column(name = "f1_score")
|
||||||
|
private Double f1Score;
|
||||||
|
|
||||||
|
@Column(name = "precision")
|
||||||
|
private Double precision;
|
||||||
|
|
||||||
|
@Column(name = "recall")
|
||||||
|
private Double recall;
|
||||||
|
|
||||||
|
@Column(name = "loss")
|
||||||
|
private Double loss;
|
||||||
|
|
||||||
|
@Column(name = "iou")
|
||||||
|
private Double iou;
|
||||||
|
|
||||||
|
@Column(name = "created_dttm", updatable = false, nullable = false)
|
||||||
|
private ZonedDateTime createdDate;
|
||||||
|
|
||||||
|
@PrePersist
|
||||||
|
protected void onPersist() {
|
||||||
|
this.createdDate = ZonedDateTime.now();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,8 +15,6 @@ public interface MapSheetMngRepositoryCustom {
|
|||||||
|
|
||||||
MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy);
|
MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MapSheetMngComplete(int mngYyyy);
|
void MapSheetMngComplete(int mngYyyy);
|
||||||
|
|
||||||
Optional<MapSheetMngHstEntity> findMapSheetMngHstInfo(Long hstUid);
|
Optional<MapSheetMngHstEntity> findMapSheetMngHstInfo(Long hstUid);
|
||||||
@@ -42,10 +40,7 @@ public interface MapSheetMngRepositoryCustom {
|
|||||||
void mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq);
|
void mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq);
|
||||||
|
|
||||||
void updateMapSheetMngHstSyncCheckState(
|
void updateMapSheetMngHstSyncCheckState(
|
||||||
Long hstUid,
|
Long hstUid, String uploadPath, String syncCheckTfwFileName, String syncCheckTifFileName);
|
||||||
String uploadPath,
|
|
||||||
String syncCheckTfwFileName,
|
|
||||||
String syncCheckTifFileName);
|
|
||||||
|
|
||||||
Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||||
MapSheetMngDto.@Valid ErrorSearchReq searchReq);
|
MapSheetMngDto.@Valid ErrorSearchReq searchReq);
|
||||||
@@ -53,6 +48,7 @@ public interface MapSheetMngRepositoryCustom {
|
|||||||
MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid);
|
MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid);
|
||||||
|
|
||||||
List<MapSheetMngDto.MngFilesDto> findIdToMapSheetFileList(Long hstUid);
|
List<MapSheetMngDto.MngFilesDto> findIdToMapSheetFileList(Long hstUid);
|
||||||
|
|
||||||
MapSheetMngDto.MngFilesDto findIdToMapSheetFile(Long fileUid);
|
MapSheetMngDto.MngFilesDto findIdToMapSheetFile(Long fileUid);
|
||||||
|
|
||||||
void updateHstFileSizes(Long hstUid, long tifSizeBytes, long tfwSizeBytes, long totalSizeBytes);
|
void updateHstFileSizes(Long hstUid, long tifSizeBytes, long tfwSizeBytes, long totalSizeBytes);
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import jakarta.persistence.PersistenceContext;
|
|||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.hibernate.query.Query;
|
import org.hibernate.query.Query;
|
||||||
@@ -187,7 +186,6 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||||
whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(mngYyyy));
|
whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(mngYyyy));
|
||||||
|
|
||||||
|
|
||||||
MapSheetMngDto.MngDto foundContent =
|
MapSheetMngDto.MngDto foundContent =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
@@ -394,39 +392,39 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
whereBuilder.and(mapSheetMngHstEntity.hstUid.eq(hstUid));
|
whereBuilder.and(mapSheetMngHstEntity.hstUid.eq(hstUid));
|
||||||
|
|
||||||
MapSheetMngDto.ErrorDataDto foundContent =
|
MapSheetMngDto.ErrorDataDto foundContent =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
MapSheetMngDto.ErrorDataDto.class,
|
MapSheetMngDto.ErrorDataDto.class,
|
||||||
mapSheetMngHstEntity.hstUid,
|
mapSheetMngHstEntity.hstUid,
|
||||||
mapSheetMngHstEntity.mngYyyy,
|
mapSheetMngHstEntity.mngYyyy,
|
||||||
mapSheetMngHstEntity.mapSheetNum,
|
mapSheetMngHstEntity.mapSheetNum,
|
||||||
mapSheetMngHstEntity.refMapSheetNum,
|
mapSheetMngHstEntity.refMapSheetNum,
|
||||||
Expressions.stringTemplate(
|
Expressions.stringTemplate(
|
||||||
"concat({0},substring({1}, 0, 6))",
|
"concat({0},substring({1}, 0, 6))",
|
||||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||||
.as("map50kName"),
|
.as("map50kName"),
|
||||||
Expressions.stringTemplate(
|
Expressions.stringTemplate(
|
||||||
"concat({0},substring({1}, 6, 8))",
|
"concat({0},substring({1}, 6, 8))",
|
||||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||||
.as("map5kName"),
|
.as("map5kName"),
|
||||||
Expressions.stringTemplate(
|
Expressions.stringTemplate(
|
||||||
"concat({0},substring({1}, 6, 8))",
|
"concat({0},substring({1}, 6, 8))",
|
||||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||||
.as("mapSrcName"),
|
.as("mapSrcName"),
|
||||||
mapInkx5kEntity.fid,
|
mapInkx5kEntity.fid,
|
||||||
mapSheetMngHstEntity.createdDate,
|
mapSheetMngHstEntity.createdDate,
|
||||||
mapSheetMngHstEntity.syncState,
|
mapSheetMngHstEntity.syncState,
|
||||||
mapSheetMngHstEntity.syncTfwFileName,
|
mapSheetMngHstEntity.syncTfwFileName,
|
||||||
mapSheetMngHstEntity.syncTifFileName,
|
mapSheetMngHstEntity.syncTifFileName,
|
||||||
mapSheetMngHstEntity.syncCheckState,
|
mapSheetMngHstEntity.syncCheckState,
|
||||||
mapSheetMngHstEntity.syncCheckTfwFileName,
|
mapSheetMngHstEntity.syncCheckTfwFileName,
|
||||||
mapSheetMngHstEntity.syncCheckTifFileName))
|
mapSheetMngHstEntity.syncCheckTifFileName))
|
||||||
.from(mapSheetMngHstEntity)
|
.from(mapSheetMngHstEntity)
|
||||||
.innerJoin(mapInkx5kEntity)
|
.innerJoin(mapInkx5kEntity)
|
||||||
.on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
|
.on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
|
||||||
.where(whereBuilder)
|
.where(whereBuilder)
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
return foundContent;
|
return foundContent;
|
||||||
}
|
}
|
||||||
@@ -518,27 +516,26 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
public MapSheetMngDto.MngFilesDto findIdToMapSheetFile(Long fileUid) {
|
public MapSheetMngDto.MngFilesDto findIdToMapSheetFile(Long fileUid) {
|
||||||
|
|
||||||
MapSheetMngDto.MngFilesDto foundContent =
|
MapSheetMngDto.MngFilesDto foundContent =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
MapSheetMngDto.MngFilesDto.class,
|
MapSheetMngDto.MngFilesDto.class,
|
||||||
mapSheetMngFileEntity.fileUid,
|
mapSheetMngFileEntity.fileUid,
|
||||||
mapSheetMngFileEntity.mngYyyy,
|
mapSheetMngFileEntity.mngYyyy,
|
||||||
mapSheetMngFileEntity.mapSheetNum,
|
mapSheetMngFileEntity.mapSheetNum,
|
||||||
mapSheetMngFileEntity.refMapSheetNum,
|
mapSheetMngFileEntity.refMapSheetNum,
|
||||||
mapSheetMngFileEntity.filePath,
|
mapSheetMngFileEntity.filePath,
|
||||||
mapSheetMngFileEntity.fileName,
|
mapSheetMngFileEntity.fileName,
|
||||||
mapSheetMngFileEntity.fileExt,
|
mapSheetMngFileEntity.fileExt,
|
||||||
mapSheetMngFileEntity.hstUid,
|
mapSheetMngFileEntity.hstUid,
|
||||||
mapSheetMngFileEntity.fileSize))
|
mapSheetMngFileEntity.fileSize))
|
||||||
.from(mapSheetMngFileEntity)
|
.from(mapSheetMngFileEntity)
|
||||||
.where(mapSheetMngFileEntity.fileUid.eq(fileUid))
|
.where(mapSheetMngFileEntity.fileUid.eq(fileUid))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
return foundContent;
|
return foundContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void MapSheetMngComplete(int mngYyyy) {
|
public void MapSheetMngComplete(int mngYyyy) {
|
||||||
long execCount =
|
long execCount =
|
||||||
@@ -551,22 +548,19 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateMapSheetMngHstSyncCheckState(
|
public void updateMapSheetMngHstSyncCheckState(
|
||||||
Long hstUid,
|
Long hstUid, String uploadPath, String syncCheckTfwFileName, String syncCheckTifFileName) {
|
||||||
String uploadPath,
|
|
||||||
String syncCheckTfwFileName,
|
|
||||||
String syncCheckTifFileName){
|
|
||||||
|
|
||||||
long execCount =
|
long execCount =
|
||||||
queryFactory
|
queryFactory
|
||||||
.update(mapSheetMngHstEntity)
|
.update(mapSheetMngHstEntity)
|
||||||
.set(mapSheetMngHstEntity.syncCheckState, "DONE")
|
.set(mapSheetMngHstEntity.syncCheckState, "DONE")
|
||||||
.set(mapSheetMngHstEntity.mapSheetPath, uploadPath)
|
.set(mapSheetMngHstEntity.mapSheetPath, uploadPath)
|
||||||
.set(mapSheetMngHstEntity.syncCheckTfwFileName, syncCheckTfwFileName)
|
.set(mapSheetMngHstEntity.syncCheckTfwFileName, syncCheckTfwFileName)
|
||||||
.set(mapSheetMngHstEntity.syncCheckTifFileName, syncCheckTifFileName)
|
.set(mapSheetMngHstEntity.syncCheckTifFileName, syncCheckTifFileName)
|
||||||
.set(mapSheetMngHstEntity.syncCheckStrtDttm, ZonedDateTime.now())
|
.set(mapSheetMngHstEntity.syncCheckStrtDttm, ZonedDateTime.now())
|
||||||
.set(mapSheetMngHstEntity.syncCheckEndDttm, ZonedDateTime.now())
|
.set(mapSheetMngHstEntity.syncCheckEndDttm, ZonedDateTime.now())
|
||||||
.where(mapSheetMngHstEntity.hstUid.eq(hstUid))
|
.where(mapSheetMngHstEntity.hstUid.eq(hstUid))
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -624,10 +618,10 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
@Override
|
@Override
|
||||||
public void deleteByHstUidMngFile(Long hstUid) {
|
public void deleteByHstUidMngFile(Long hstUid) {
|
||||||
long deletedFileCount =
|
long deletedFileCount =
|
||||||
queryFactory
|
queryFactory
|
||||||
.delete(mapSheetMngFileEntity)
|
.delete(mapSheetMngFileEntity)
|
||||||
.where(mapSheetMngFileEntity.fileUid.eq(hstUid))
|
.where(mapSheetMngFileEntity.fileUid.eq(hstUid))
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -640,33 +634,31 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq){
|
public void mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq) {
|
||||||
long fileCount =
|
long fileCount =
|
||||||
queryFactory
|
queryFactory
|
||||||
.insert(mapSheetMngFileEntity)
|
.insert(mapSheetMngFileEntity)
|
||||||
.columns(
|
.columns(
|
||||||
mapSheetMngFileEntity.mngYyyy,
|
mapSheetMngFileEntity.mngYyyy,
|
||||||
mapSheetMngFileEntity.mapSheetNum,
|
mapSheetMngFileEntity.mapSheetNum,
|
||||||
mapSheetMngFileEntity.refMapSheetNum,
|
mapSheetMngFileEntity.refMapSheetNum,
|
||||||
mapSheetMngFileEntity.filePath,
|
mapSheetMngFileEntity.filePath,
|
||||||
mapSheetMngFileEntity.fileName,
|
mapSheetMngFileEntity.fileName,
|
||||||
mapSheetMngFileEntity.fileExt,
|
mapSheetMngFileEntity.fileExt,
|
||||||
mapSheetMngFileEntity.hstUid,
|
mapSheetMngFileEntity.hstUid,
|
||||||
mapSheetMngFileEntity.fileSize,
|
mapSheetMngFileEntity.fileSize,
|
||||||
mapSheetMngFileEntity.fileState
|
mapSheetMngFileEntity.fileState)
|
||||||
)
|
.values(
|
||||||
.values(
|
addReq.getMngYyyy(),
|
||||||
addReq.getMngYyyy(),
|
addReq.getMapSheetNum(),
|
||||||
addReq.getMapSheetNum(),
|
addReq.getRefMapSheetNum(),
|
||||||
addReq.getRefMapSheetNum(),
|
addReq.getFilePath(),
|
||||||
addReq.getFilePath(),
|
addReq.getFileName(),
|
||||||
addReq.getFileName(),
|
addReq.getFileExt(),
|
||||||
addReq.getFileExt(),
|
addReq.getHstUid(),
|
||||||
addReq.getHstUid(),
|
addReq.getFileSize(),
|
||||||
addReq.getFileSize(),
|
addReq.getFileState())
|
||||||
addReq.getFileState()
|
.execute();
|
||||||
)
|
|
||||||
.execute();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.repository.model;
|
package com.kamco.cd.kamcoback.postgres.repository.model;
|
||||||
|
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QModelMgmtEntity.modelMgmtEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QModelMgmtEntity.modelMgmtEntity;
|
||||||
|
import static com.kamco.cd.kamcoback.postgres.entity.QModelResultMetricEntity.modelResultMetricEntity;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.model.dto.ModelMgmtDto;
|
import com.kamco.cd.kamcoback.model.dto.ModelMgmtDto;
|
||||||
import com.kamco.cd.kamcoback.postgres.QuerydslOrderUtil;
|
import com.kamco.cd.kamcoback.postgres.QuerydslOrderUtil;
|
||||||
@@ -10,8 +11,10 @@ import com.querydsl.core.types.Expression;
|
|||||||
import com.querydsl.core.types.Projections;
|
import com.querydsl.core.types.Projections;
|
||||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||||
import com.querydsl.core.types.dsl.Expressions;
|
import com.querydsl.core.types.dsl.Expressions;
|
||||||
|
import com.querydsl.core.types.dsl.NumberPath;
|
||||||
import com.querydsl.core.types.dsl.StringExpression;
|
import com.querydsl.core.types.dsl.StringExpression;
|
||||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
@@ -79,8 +82,15 @@ public class ModelMgmtRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
"to_char({0}, 'YYYY-MM-DD')", modelMgmtEntity.createCompleteDttm),
|
"to_char({0}, 'YYYY-MM-DD')", modelMgmtEntity.createCompleteDttm),
|
||||||
Expressions.stringTemplate(
|
Expressions.stringTemplate(
|
||||||
"to_char({0}, 'YYYY-MM-DD')", modelMgmtEntity.recentUseDttm),
|
"to_char({0}, 'YYYY-MM-DD')", modelMgmtEntity.recentUseDttm),
|
||||||
|
roundNumericToPercent(modelResultMetricEntity.f1Score),
|
||||||
|
roundNumericToPercent(modelResultMetricEntity.precision),
|
||||||
|
roundNumericToPercent(modelResultMetricEntity.recall),
|
||||||
|
roundNumericToPercent(modelResultMetricEntity.loss),
|
||||||
|
roundNumericToPercent(modelResultMetricEntity.iou),
|
||||||
modelMgmtEntity.deleted))
|
modelMgmtEntity.deleted))
|
||||||
.from(modelMgmtEntity)
|
.from(modelMgmtEntity)
|
||||||
|
.innerJoin(modelResultMetricEntity)
|
||||||
|
.on(modelMgmtEntity.modelUid.longValue().eq(modelResultMetricEntity.modelUid))
|
||||||
.where(
|
.where(
|
||||||
eventEndedAtBetween(startDate, endDate, property),
|
eventEndedAtBetween(startDate, endDate, property),
|
||||||
searchModelVersion(modelType, searchVal))
|
searchModelVersion(modelType, searchVal))
|
||||||
@@ -138,4 +148,8 @@ public class ModelMgmtRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
|
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Expression<BigDecimal> roundNumericToPercent(NumberPath<Double> ratio) {
|
||||||
|
return Expressions.numberTemplate(BigDecimal.class, "function('round', {0} * 100, 2)", ratio);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user