페어파일업로드, 파일삭제 수정
This commit is contained in:
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Setter
|
@Setter
|
||||||
public class FileConfig {
|
public class FileConfig {
|
||||||
|
|
||||||
// private String rootSyncDir = "D:\\app\\original-images";
|
private String rootSyncDir = "D:\\app\\original-images\\";
|
||||||
private String rootSyncDir = "/app/original-images";
|
private String tmpSyncDir = rootSyncDir+"tmp\\";
|
||||||
|
//private String rootSyncDir = "/app/original-images";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ public class MapSheetMngDto {
|
|||||||
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 mngState;
|
private String mngState;
|
||||||
private String syncState;
|
private String syncState;
|
||||||
private String syncDataCheckState;
|
private String syncDataCheckState;
|
||||||
@@ -160,9 +161,10 @@ public class MapSheetMngDto {
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public static class ErrorDataDto {
|
public static class ErrorDataDto {
|
||||||
// private Integer rowNum;
|
|
||||||
private Long hstUid;
|
private Long hstUid;
|
||||||
|
private Integer mngYyyy;
|
||||||
private String mapSheetNum;
|
private String mapSheetNum;
|
||||||
|
private String refMapSheetNum;
|
||||||
private String map50kName;
|
private String map50kName;
|
||||||
private String map5kName;
|
private String map5kName;
|
||||||
private String mapSrcName;
|
private String mapSrcName;
|
||||||
@@ -183,6 +185,9 @@ public class MapSheetMngDto {
|
|||||||
|
|
||||||
public ErrorDataDto(
|
public ErrorDataDto(
|
||||||
Long hstUid,
|
Long hstUid,
|
||||||
|
Integer mngYyyy,
|
||||||
|
String mapSheetNum,
|
||||||
|
String refMapSheetNum,
|
||||||
String map50kName,
|
String map50kName,
|
||||||
String map5kName,
|
String map5kName,
|
||||||
String mapSrcName,
|
String mapSrcName,
|
||||||
@@ -195,6 +200,9 @@ public class MapSheetMngDto {
|
|||||||
String errorCheckTfwFileName,
|
String errorCheckTfwFileName,
|
||||||
String errorCheckTifFileName) {
|
String errorCheckTifFileName) {
|
||||||
this.hstUid = hstUid;
|
this.hstUid = hstUid;
|
||||||
|
this.mngYyyy = mngYyyy;
|
||||||
|
this.mapSheetNum = mapSheetNum;
|
||||||
|
this.refMapSheetNum = refMapSheetNum;
|
||||||
this.map50kName = map50kName;
|
this.map50kName = map50kName;
|
||||||
this.map5kName = map5kName;
|
this.map5kName = map5kName;
|
||||||
this.mapSrcName = mapSrcName;
|
this.mapSrcName = mapSrcName;
|
||||||
@@ -218,6 +226,8 @@ public class MapSheetMngDto {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(name = "MngFIleDto", description = "관리파일정보")
|
@Schema(name = "MngFIleDto", description = "관리파일정보")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -240,6 +250,23 @@ public class MapSheetMngDto {
|
|||||||
private String message;
|
private String message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Schema(name = "MngFileAddReq", description = "영상관리파일 등록 요청")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class MngFileAddReq {
|
||||||
|
private int mngYyyy;
|
||||||
|
private String mapSheetNum;
|
||||||
|
private String refMapSheetNum;
|
||||||
|
private String filePath;
|
||||||
|
private String fileName;
|
||||||
|
private String fileExt;
|
||||||
|
private Long hstUid;
|
||||||
|
private Long fileSize;
|
||||||
|
private String fileState;
|
||||||
|
}
|
||||||
|
|
||||||
@Schema(name = "MngFilesDto", description = "영상파일내역 검색 리턴")
|
@Schema(name = "MngFilesDto", description = "영상파일내역 검색 리턴")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -256,4 +283,27 @@ public class MapSheetMngDto {
|
|||||||
private Long hstUid;
|
private Long hstUid;
|
||||||
private Long fileSize;
|
private Long fileSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(name = "ReqUpdateErrorCheckStateDto", description = "영상관리 오류데이터 체크결과 수정요청")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public static class ReqUpdateErrorCheckStateDto {
|
||||||
|
private Long hstUid;
|
||||||
|
private String errorCheckState;
|
||||||
|
private String errorCheckTfwFileName;
|
||||||
|
private String errorCheckTifFileName;
|
||||||
|
/*
|
||||||
|
public reqErrorDataCheckStateDto(
|
||||||
|
Long hstUid,
|
||||||
|
String errorCheckState,
|
||||||
|
String errorCheckTfwFileName,
|
||||||
|
String errorCheckTifFileName) {
|
||||||
|
this.hstUid = hstUid;
|
||||||
|
this.errorCheckState = errorCheckState;
|
||||||
|
this.errorCheckTfwFileName = errorCheckTfwFileName;
|
||||||
|
this.errorCheckTifFileName = errorCheckTifFileName;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,21 @@ package com.kamco.cd.kamcoback.mapsheet.service;
|
|||||||
|
|
||||||
import static java.lang.String.CASE_INSENSITIVE_ORDER;
|
import static java.lang.String.CASE_INSENSITIVE_ORDER;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.common.utils.FIleChecker;
|
||||||
|
import com.kamco.cd.kamcoback.config.FileConfig;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto;
|
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.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;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDto;
|
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDto;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
|
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
|
||||||
|
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.AddReq;
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.DmlReturn;
|
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.DmlReturn;
|
||||||
|
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.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;
|
||||||
@@ -16,12 +24,14 @@ import java.io.IOException;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
import java.nio.file.StandardCopyOption;
|
||||||
import java.nio.file.attribute.FileTime;
|
import java.nio.file.attribute.FileTime;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
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;
|
||||||
@@ -39,6 +49,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
public class MapSheetMngService {
|
public class MapSheetMngService {
|
||||||
|
|
||||||
private final MapSheetMngCoreService mapSheetMngCoreService;
|
private final MapSheetMngCoreService mapSheetMngCoreService;
|
||||||
|
private final FileConfig fileConfig;
|
||||||
|
|
||||||
public FilesDto getFilesAll(SrchFilesDto srchDto) {
|
public FilesDto getFilesAll(SrchFilesDto srchDto) {
|
||||||
|
|
||||||
@@ -50,7 +61,7 @@ public class MapSheetMngService {
|
|||||||
File dir = new File(dirPath);
|
File dir = new File(dirPath);
|
||||||
File[] fileList = dir.listFiles();
|
File[] fileList = dir.listFiles();
|
||||||
|
|
||||||
List<FileDto.Basic> files = new ArrayList<>();
|
List<Basic> files = new ArrayList<>();
|
||||||
SimpleDateFormat dttmFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat dttmFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
int fileListPos = 0;
|
int fileListPos = 0;
|
||||||
@@ -85,7 +96,7 @@ public class MapSheetMngService {
|
|||||||
String lastModified = dttmFormat.format(new Date(file.lastModified()));
|
String lastModified = dttmFormat.format(new Date(file.lastModified()));
|
||||||
|
|
||||||
files.add(
|
files.add(
|
||||||
new FileDto.Basic(
|
new Basic(
|
||||||
fileName, parentFolderNm, parentPath, fullPath, ext, fileSize, lastModified));
|
fileName, parentFolderNm, parentPath, fullPath, ext, fileSize, lastModified));
|
||||||
|
|
||||||
fileTotCnt = fileTotCnt + 1;
|
fileTotCnt = fileTotCnt + 1;
|
||||||
@@ -113,7 +124,7 @@ public class MapSheetMngService {
|
|||||||
|
|
||||||
Set<String> targetExtensions = createExtensionSet(extension);
|
Set<String> targetExtensions = createExtensionSet(extension);
|
||||||
|
|
||||||
List<FileDto.Basic> fileDtoList = new ArrayList<>();
|
List<Basic> fileDtoList = new ArrayList<>();
|
||||||
SimpleDateFormat dttmFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat dttmFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
int fileTotCnt = 0;
|
int fileTotCnt = 0;
|
||||||
@@ -147,13 +158,13 @@ public class MapSheetMngService {
|
|||||||
long fileSize = file.length();
|
long fileSize = file.length();
|
||||||
String lastModified = dttmFormat.format(new Date(file.lastModified()));
|
String lastModified = dttmFormat.format(new Date(file.lastModified()));
|
||||||
|
|
||||||
return new FileDto.Basic(
|
return new Basic(
|
||||||
fileNm, parentFolderNm, parentPath, fullPath, ext, fileSize, lastModified);
|
fileNm, parentFolderNm, parentPath, fullPath, ext, fileSize, lastModified);
|
||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
fileTotCnt = fileDtoList.size();
|
fileTotCnt = fileDtoList.size();
|
||||||
fileTotSize = fileDtoList.stream().mapToLong(FileDto.Basic::getFileSize).sum();
|
fileTotSize = fileDtoList.stream().mapToLong(Basic::getFileSize).sum();
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.err.println("파일 I/O 오류 발생: " + e.getMessage());
|
System.err.println("파일 I/O 오류 발생: " + e.getMessage());
|
||||||
@@ -215,7 +226,7 @@ public class MapSheetMngService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MapSheetMngDto.MngDto> findMapSheetMngList() {
|
public List<MngDto> findMapSheetMngList() {
|
||||||
return mapSheetMngCoreService.findMapSheetMngList();
|
return mapSheetMngCoreService.findMapSheetMngList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,29 +236,29 @@ public class MapSheetMngService {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
|
public MngDto findMapSheetMng(int mngYyyy) {
|
||||||
return mapSheetMngCoreService.findMapSheetMng(mngYyyy);
|
return mapSheetMngCoreService.findMapSheetMng(mngYyyy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public MapSheetMngDto.DmlReturn mngComplete(int mngYyyy) {
|
public DmlReturn mngComplete(int mngYyyy) {
|
||||||
|
|
||||||
mapSheetMngCoreService.MapSheetMngComplete(mngYyyy);
|
mapSheetMngCoreService.MapSheetMngComplete(mngYyyy);
|
||||||
|
|
||||||
return new MapSheetMngDto.DmlReturn("success", "작업완료 처리되었습니다.");
|
return new DmlReturn("success", "작업완료 처리되었습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
public Page<ErrorDataDto> findMapSheetErrorList(
|
||||||
MapSheetMngDto.@Valid ErrorSearchReq searchReq) {
|
@Valid ErrorSearchReq searchReq) {
|
||||||
return mapSheetMngCoreService.findMapSheetErrorList(searchReq);
|
return mapSheetMngCoreService.findMapSheetErrorList(searchReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid) {
|
public ErrorDataDto findMapSheetError(Long hstUid) {
|
||||||
return mapSheetMngCoreService.findMapSheetError(hstUid);
|
return mapSheetMngCoreService.findMapSheetError(hstUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public MapSheetMngDto.DmlReturn mngDataSave(MapSheetMngDto.AddReq AddReq) {
|
public DmlReturn mngDataSave(AddReq AddReq) {
|
||||||
return mapSheetMngCoreService.mngDataSave(AddReq);
|
return mapSheetMngCoreService.mngDataSave(AddReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,11 +273,11 @@ public class MapSheetMngService {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public MapSheetMngDto.DmlReturn uploadProcess(@Valid List<Long> hstUidList) {
|
public DmlReturn uploadProcess(@Valid List<Long> hstUidList) {
|
||||||
return mapSheetMngCoreService.uploadProcess(hstUidList);
|
return mapSheetMngCoreService.uploadProcess(hstUidList);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapSheetMngDto.DmlReturn updateExceptUseInference(@Valid List<Long> hstUidList) {
|
public DmlReturn updateExceptUseInference(@Valid List<Long> hstUidList) {
|
||||||
return mapSheetMngCoreService.updateExceptUseInference(hstUidList);
|
return mapSheetMngCoreService.updateExceptUseInference(hstUidList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,6 +288,9 @@ public class MapSheetMngService {
|
|||||||
// String targetPath,
|
// String targetPath,
|
||||||
Long hstUid) {
|
Long hstUid) {
|
||||||
|
|
||||||
|
String rootPath = fileConfig.getRootSyncDir();
|
||||||
|
String tmpPath = fileConfig.getTmpSyncDir();
|
||||||
|
|
||||||
// 파일 유효성 검증
|
// 파일 유효성 검증
|
||||||
if (tfwFile == null || tfwFile.isEmpty() || tfwFile.getSize() == 0) {
|
if (tfwFile == null || tfwFile.isEmpty() || tfwFile.getSize() == 0) {
|
||||||
return new DmlReturn("fail", "TFW SIZE 오류");
|
return new DmlReturn("fail", "TFW SIZE 오류");
|
||||||
@@ -289,15 +303,75 @@ public class MapSheetMngService {
|
|||||||
.substring(tfwFile.getOriginalFilename().lastIndexOf('.') + 1)
|
.substring(tfwFile.getOriginalFilename().lastIndexOf('.') + 1)
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.equals("tfw")) {
|
.equals("tfw")) {
|
||||||
return new DmlReturn("fail", "TFW TYPE ERROR");
|
return new DmlReturn("fail", "TFW FILENAME ERROR");
|
||||||
} else if (!tifFile
|
} else if (!tifFile
|
||||||
.getOriginalFilename()
|
.getOriginalFilename()
|
||||||
.substring(tifFile.getOriginalFilename().lastIndexOf('.') + 1)
|
.substring(tifFile.getOriginalFilename().lastIndexOf('.') + 1)
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.equals("tif")) {
|
.equals("tif")) {
|
||||||
return new DmlReturn("fail", "TIF TYPE ERROR");
|
return new DmlReturn("fail", "TIF FILENAME ERROR");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ErrorDataDto errDto = mapSheetMngCoreService.findMapSheetError(hstUid);
|
||||||
|
if( errDto == null )
|
||||||
|
{
|
||||||
|
return new DmlReturn("fail", "NO hstUid Data");
|
||||||
|
}
|
||||||
|
MngDto mngDto = mapSheetMngCoreService.findMapSheetMng(errDto.getMngYyyy());
|
||||||
|
|
||||||
|
String targetYearDir = mngDto.getMngPath();
|
||||||
|
|
||||||
|
List<FIleChecker.Basic> basicTfwList = FIleChecker.getFilesFromAllDepth(targetYearDir,
|
||||||
|
tfwFile.getOriginalFilename(),
|
||||||
|
"tfw",
|
||||||
|
100,
|
||||||
|
"name",
|
||||||
|
0, 100);
|
||||||
|
|
||||||
|
List<FIleChecker.Basic> basicTifList = FIleChecker.getFilesFromAllDepth(targetYearDir,
|
||||||
|
tifFile.getOriginalFilename(),
|
||||||
|
"tif",
|
||||||
|
100,
|
||||||
|
"name",
|
||||||
|
0, 100);
|
||||||
|
|
||||||
|
int tfwCnt =
|
||||||
|
(int)
|
||||||
|
basicTfwList.stream().filter(dto -> dto.getExtension().toString().equals("tfw")).count();
|
||||||
|
|
||||||
|
int tifCnt =
|
||||||
|
(int)
|
||||||
|
basicTifList.stream().filter(dto -> dto.getExtension().toString().equals("tif")).count();
|
||||||
|
|
||||||
|
|
||||||
|
if( tfwCnt > 0 || tifCnt > 0 )
|
||||||
|
{
|
||||||
|
String tfwMsg = "";
|
||||||
|
String tifMsg = "";
|
||||||
|
if( tfwCnt > 0 )tfwMsg = tfwFile.getOriginalFilename();
|
||||||
|
if( tifCnt > 0 )tifMsg = tifFile.getOriginalFilename();
|
||||||
|
return new DmlReturn("fail", tfwMsg+","+tifMsg+ " DUPLICATE ERROR");
|
||||||
|
}
|
||||||
|
|
||||||
|
File directory = new File(tmpPath);
|
||||||
|
String tfwTmpPath = tmpPath + tfwFile.getOriginalFilename();
|
||||||
|
Path tfwTmpSavePath = Paths.get(tfwTmpPath);
|
||||||
|
String tifTmpPath = tmpPath + tifFile.getOriginalFilename();
|
||||||
|
Path tifTmpSavePath = Paths.get(tifTmpPath);
|
||||||
|
boolean fileUpload = true;
|
||||||
|
try {
|
||||||
|
tfwFile.transferTo(tfwTmpSavePath);
|
||||||
|
tifFile.transferTo(tifTmpSavePath);
|
||||||
|
} catch (IOException e) {
|
||||||
|
//throw new RuntimeException(e);
|
||||||
|
return new DmlReturn("fail", "UPLOAD ERROR");
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !FIleChecker.cmmndGdalInfo(tifTmpPath) )return new DmlReturn("fail", "TIF 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);
|
||||||
String uploadPath = "";
|
String uploadPath = "";
|
||||||
@@ -306,28 +380,83 @@ public class MapSheetMngService {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Path tfwTargetPath = null;
|
||||||
|
Path tifTargetPath = null;
|
||||||
|
Path uploadTargetPath = null;
|
||||||
|
|
||||||
if (uploadPath.isEmpty()) {
|
if (uploadPath.isEmpty()) {
|
||||||
// ErrorDataDto errDto = mapSheetMngCoreService.findMapSheetError(hstUid);
|
MngFilesDto filesDto = mapSheetMngCoreService.findYyyyToMapSheetFilePathRefer(errDto.getMngYyyy());
|
||||||
// uploadPath = FileConfig.rootSyncDir+"\\"+errDto.getMapSheetNum();
|
String referPath = filesDto.getFilePath();
|
||||||
|
uploadPath = Paths.get(referPath).getParent().toString()+"/"+errDto.getRefMapSheetNum();
|
||||||
|
tfwTargetPath = Paths.get(uploadPath).resolve(tfwFile.getOriginalFilename());
|
||||||
|
tifTargetPath = Paths.get(uploadPath).resolve(tifFile.getOriginalFilename());
|
||||||
}
|
}
|
||||||
|
|
||||||
// tfw가 있는 경우
|
//String searchDir =
|
||||||
// tif가 있는 경우
|
|
||||||
|
try {
|
||||||
|
uploadTargetPath = Paths.get(uploadPath);
|
||||||
|
Files.createDirectories(uploadTargetPath);
|
||||||
|
Files.move(tfwTmpSavePath, tfwTargetPath, StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
Files.move(tifTmpSavePath, tifTargetPath, StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
//hst업데이트
|
||||||
|
mapSheetMngCoreService.updateMapSheetMngHstSyncCheckState(
|
||||||
|
hstUid,
|
||||||
|
uploadPath,
|
||||||
|
tfwFile.getOriginalFilename(),
|
||||||
|
tifFile.getOriginalFilename());
|
||||||
|
//파일정보 업데이트
|
||||||
|
mapSheetMngCoreService.deleteByHstUidMngFile(hstUid);
|
||||||
|
|
||||||
|
MapSheetMngDto.MngFileAddReq addReq = new MapSheetMngDto.MngFileAddReq();
|
||||||
|
addReq.setMngYyyy(errDto.getMngYyyy());
|
||||||
|
addReq.setMapSheetNum(errDto.getMapSheetNum());
|
||||||
|
addReq.setRefMapSheetNum(errDto.getRefMapSheetNum());
|
||||||
|
addReq.setFilePath(uploadPath);
|
||||||
|
addReq.setFileName(tfwFile.getOriginalFilename());
|
||||||
|
addReq.setFileExt("tfw");
|
||||||
|
addReq.setFileSize(tfwFile.getSize());
|
||||||
|
addReq.setHstUid(errDto.getHstUid());
|
||||||
|
addReq.setFileState("DONE");
|
||||||
|
|
||||||
|
mapSheetMngCoreService.mngFileSave(addReq);
|
||||||
|
|
||||||
|
addReq.setFileExt("tif");
|
||||||
|
addReq.setFileSize(tifFile.getSize());
|
||||||
|
mapSheetMngCoreService.mngFileSave(addReq);
|
||||||
|
|
||||||
|
|
||||||
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
|
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MapSheetMngDto.MngFilesDto> findHstUidToMapSheetFileList(Long hstUid) {
|
public List<MngFilesDto> findHstUidToMapSheetFileList(Long hstUid) {
|
||||||
return mapSheetMngCoreService.findHstUidToMapSheetFileList(hstUid);
|
return mapSheetMngCoreService.findHstUidToMapSheetFileList(hstUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public MapSheetMngDto.DmlReturn deleteByFileUidMngFile(List<Long> fileUids) {
|
public DmlReturn deleteByFileUidMngFile(List<Long> fileUids) {
|
||||||
|
|
||||||
for (Long uid : fileUids) {
|
for (Long uid : fileUids) {
|
||||||
MapSheetMngDto.DmlReturn dmlReturn = mapSheetMngCoreService.deleteByFileUidMngFile(uid);
|
MapSheetMngDto.MngFilesDto dto = mapSheetMngCoreService.findIdToMapSheetFile(uid);
|
||||||
|
String filePath = dto.getFilePath()+"/"+dto.getFileName();
|
||||||
|
Path path = Paths.get(filePath);
|
||||||
|
try {
|
||||||
|
boolean isDeleted = Files.deleteIfExists(path);
|
||||||
|
if (isDeleted) {
|
||||||
|
System.out.println("파일 삭제 성공: " + filePath);
|
||||||
|
} else {
|
||||||
|
System.out.println("삭제 실패: 파일이 존재하지 않습니다.");
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.err.println("파일 삭제 중 오류 발생: " + e.getMessage());
|
||||||
|
}
|
||||||
|
DmlReturn dmlReturn = mapSheetMngCoreService.deleteByFileUidMngFile(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new MapSheetMngDto.DmlReturn("success", fileUids.size() + "개 파일이 삭제되었습니다.");
|
return new DmlReturn("success", fileUids.size() + "개 파일이 삭제되었습니다.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ 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;
|
||||||
@@ -49,6 +50,28 @@ public class MapSheetMngCoreService {
|
|||||||
mapSheetMngRepository.MapSheetMngComplete(mngYyyy);
|
mapSheetMngRepository.MapSheetMngComplete(mngYyyy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deleteByHstUidMngFile(@Valid Long hstUid) {
|
||||||
|
mapSheetMngRepository.deleteByHstUidMngFile(hstUid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MapSheetMngDto.DmlReturn mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq) {
|
||||||
|
|
||||||
|
|
||||||
|
mapSheetMngRepository.mngFileSave(addReq);
|
||||||
|
// int hstCnt = mapSheetMngRepository.insertMapSheetOrgDataToMapSheetMngHst(saved.getMngYyyy());
|
||||||
|
|
||||||
|
return new MapSheetMngDto.DmlReturn("success", "파일정보저장되었습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void updateMapSheetMngHstSyncCheckState(
|
||||||
|
Long hstUid,
|
||||||
|
String uploadPath,
|
||||||
|
String syncCheckTfwFileName,
|
||||||
|
String syncCheckTifFileName){
|
||||||
|
mapSheetMngRepository.updateMapSheetMngHstSyncCheckState(hstUid, uploadPath, syncCheckTfwFileName, syncCheckTifFileName);
|
||||||
|
}
|
||||||
|
|
||||||
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||||
MapSheetMngDto.@Valid ErrorSearchReq searchReq) {
|
MapSheetMngDto.@Valid ErrorSearchReq searchReq) {
|
||||||
return mapSheetMngRepository.findMapSheetErrorList(searchReq);
|
return mapSheetMngRepository.findMapSheetErrorList(searchReq);
|
||||||
@@ -58,10 +81,21 @@ 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) {
|
||||||
|
return mapSheetMngRepository.findYyyyToMapSheetFilePathRefer(mngYyyy);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MapSheetMngDto.MngFilesDto findIdToMapSheetFile(Long fileUid) {
|
||||||
|
return mapSheetMngRepository.findIdToMapSheetFile(fileUid);
|
||||||
|
}
|
||||||
|
|
||||||
public MapSheetMngDto.DmlReturn uploadProcess(@Valid List<Long> hstUidList) {
|
public MapSheetMngDto.DmlReturn uploadProcess(@Valid List<Long> hstUidList) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
if (!Objects.isNull(hstUidList) && !hstUidList.isEmpty()) {
|
if (!Objects.isNull(hstUidList) && !hstUidList.isEmpty()) {
|
||||||
@@ -215,6 +249,7 @@ public class MapSheetMngCoreService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MapSheetMngDto.DmlReturn deleteByFileUidMngFile(Long fileUid) {
|
public MapSheetMngDto.DmlReturn deleteByFileUidMngFile(Long fileUid) {
|
||||||
|
|
||||||
mapSheetMngRepository.deleteByFileUidMngFile(fileUid);
|
mapSheetMngRepository.deleteByFileUidMngFile(fileUid);
|
||||||
|
|
||||||
return new MapSheetMngDto.DmlReturn("success", fileUid + " : 삭제되었습니다.");
|
return new MapSheetMngDto.DmlReturn("success", fileUid + " : 삭제되었습니다.");
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ 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);
|
||||||
@@ -25,7 +27,7 @@ public interface MapSheetMngRepositoryCustom {
|
|||||||
|
|
||||||
void deleteByFileUidMngFile(Long fileUid);
|
void deleteByFileUidMngFile(Long fileUid);
|
||||||
|
|
||||||
MapSheetMngDto.MngFilesDto findYyyyToMapSheetFilePath(int mngYyyy);
|
MapSheetMngDto.MngFilesDto findYyyyToMapSheetFilePathRefer(int mngYyyy);
|
||||||
|
|
||||||
void deleteByMngYyyyMngAll(int mngYyyy);
|
void deleteByMngYyyyMngAll(int mngYyyy);
|
||||||
|
|
||||||
@@ -35,12 +37,23 @@ public interface MapSheetMngRepositoryCustom {
|
|||||||
|
|
||||||
void deleteByMngYyyyMngFile(int mngYyyy);
|
void deleteByMngYyyyMngFile(int mngYyyy);
|
||||||
|
|
||||||
|
void deleteByHstUidMngFile(Long hstUid);
|
||||||
|
|
||||||
|
void mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq);
|
||||||
|
|
||||||
|
void updateMapSheetMngHstSyncCheckState(
|
||||||
|
Long hstUid,
|
||||||
|
String uploadPath,
|
||||||
|
String syncCheckTfwFileName,
|
||||||
|
String syncCheckTifFileName);
|
||||||
|
|
||||||
Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||||
MapSheetMngDto.@Valid ErrorSearchReq searchReq);
|
MapSheetMngDto.@Valid ErrorSearchReq searchReq);
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
void updateHstFileSizes(Long hstUid, long tifSizeBytes, long tfwSizeBytes, long totalSizeBytes);
|
void updateHstFileSizes(Long hstUid, long tifSizeBytes, long tfwSizeBytes, long totalSizeBytes);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ import com.querydsl.jpa.impl.JPAQueryFactory;
|
|||||||
import jakarta.persistence.EntityManager;
|
import jakarta.persistence.EntityManager;
|
||||||
import jakarta.persistence.PersistenceContext;
|
import jakarta.persistence.PersistenceContext;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
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;
|
||||||
@@ -72,6 +74,7 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
"row_number() over(order by {0} desc)",
|
"row_number() over(order by {0} desc)",
|
||||||
mapSheetMngEntity.createdDttm),
|
mapSheetMngEntity.createdDttm),
|
||||||
mapSheetMngEntity.mngYyyy,
|
mapSheetMngEntity.mngYyyy,
|
||||||
|
mapSheetMngEntity.mngPath,
|
||||||
mapSheetMngEntity.mngState,
|
mapSheetMngEntity.mngState,
|
||||||
mapSheetMngEntity.syncState,
|
mapSheetMngEntity.syncState,
|
||||||
mapSheetMngEntity.syncCheckState,
|
mapSheetMngEntity.syncCheckState,
|
||||||
@@ -194,6 +197,7 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
"row_number() over(order by {0} desc)",
|
"row_number() over(order by {0} desc)",
|
||||||
mapSheetMngEntity.createdDttm),
|
mapSheetMngEntity.createdDttm),
|
||||||
mapSheetMngEntity.mngYyyy,
|
mapSheetMngEntity.mngYyyy,
|
||||||
|
mapSheetMngEntity.mngPath,
|
||||||
mapSheetMngEntity.mngState,
|
mapSheetMngEntity.mngState,
|
||||||
mapSheetMngEntity.syncState,
|
mapSheetMngEntity.syncState,
|
||||||
mapSheetMngEntity.syncCheckState,
|
mapSheetMngEntity.syncCheckState,
|
||||||
@@ -336,6 +340,9 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
MapSheetMngDto.ErrorDataDto.class,
|
MapSheetMngDto.ErrorDataDto.class,
|
||||||
mapSheetMngHstEntity.hstUid,
|
mapSheetMngHstEntity.hstUid,
|
||||||
|
mapSheetMngHstEntity.mngYyyy,
|
||||||
|
mapSheetMngHstEntity.mapSheetNum,
|
||||||
|
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)
|
||||||
@@ -386,37 +393,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.mapSheetNum,
|
mapSheetMngHstEntity.mngYyyy,
|
||||||
Expressions.stringTemplate(
|
mapSheetMngHstEntity.mapSheetNum,
|
||||||
"concat({0},substring({1}, 0, 6))",
|
mapSheetMngHstEntity.refMapSheetNum,
|
||||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
Expressions.stringTemplate(
|
||||||
.as("map50kName"),
|
"concat({0},substring({1}, 0, 6))",
|
||||||
Expressions.stringTemplate(
|
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||||
"concat({0},substring({1}, 6, 8))",
|
.as("map50kName"),
|
||||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
Expressions.stringTemplate(
|
||||||
.as("map5kName"),
|
"concat({0},substring({1}, 6, 8))",
|
||||||
Expressions.stringTemplate(
|
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||||
"concat({0},substring({1}, 6, 8))",
|
.as("map5kName"),
|
||||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
Expressions.stringTemplate(
|
||||||
.as("mapSrcName"),
|
"concat({0},substring({1}, 6, 8))",
|
||||||
mapInkx5kEntity.fid,
|
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||||
mapSheetMngHstEntity.createdDate,
|
.as("mapSrcName"),
|
||||||
mapSheetMngHstEntity.syncState,
|
mapInkx5kEntity.fid,
|
||||||
mapSheetMngHstEntity.syncTfwFileName,
|
mapSheetMngHstEntity.createdDate,
|
||||||
mapSheetMngHstEntity.syncTifFileName,
|
mapSheetMngHstEntity.syncState,
|
||||||
mapSheetMngHstEntity.syncCheckState,
|
mapSheetMngHstEntity.syncTfwFileName,
|
||||||
mapSheetMngHstEntity.syncCheckTfwFileName,
|
mapSheetMngHstEntity.syncTifFileName,
|
||||||
mapSheetMngHstEntity.syncCheckTifFileName))
|
mapSheetMngHstEntity.syncCheckState,
|
||||||
.from(mapSheetMngHstEntity)
|
mapSheetMngHstEntity.syncCheckTfwFileName,
|
||||||
.innerJoin(mapInkx5kEntity)
|
mapSheetMngHstEntity.syncCheckTifFileName))
|
||||||
.on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
|
.from(mapSheetMngHstEntity)
|
||||||
.where(whereBuilder)
|
.innerJoin(mapInkx5kEntity)
|
||||||
.fetchOne();
|
.on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
|
||||||
|
.where(whereBuilder)
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
return foundContent;
|
return foundContent;
|
||||||
}
|
}
|
||||||
@@ -476,7 +485,7 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MapSheetMngDto.MngFilesDto findYyyyToMapSheetFilePath(int mngYyyy) {
|
public MapSheetMngDto.MngFilesDto findYyyyToMapSheetFilePathRefer(int mngYyyy) {
|
||||||
|
|
||||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||||
whereBuilder.and(mapSheetMngFileEntity.mngYyyy.eq(mngYyyy));
|
whereBuilder.and(mapSheetMngFileEntity.mngYyyy.eq(mngYyyy));
|
||||||
@@ -497,11 +506,39 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
mapSheetMngFileEntity.fileSize))
|
mapSheetMngFileEntity.fileSize))
|
||||||
.from(mapSheetMngFileEntity)
|
.from(mapSheetMngFileEntity)
|
||||||
.where(whereBuilder)
|
.where(whereBuilder)
|
||||||
|
.orderBy(mapSheetMngFileEntity.fileUid.desc())
|
||||||
|
.limit(1)
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
return foundContent;
|
return foundContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MapSheetMngDto.MngFilesDto findIdToMapSheetFile(Long fileUid) {
|
||||||
|
|
||||||
|
MapSheetMngDto.MngFilesDto foundContent =
|
||||||
|
queryFactory
|
||||||
|
.select(
|
||||||
|
Projections.constructor(
|
||||||
|
MapSheetMngDto.MngFilesDto.class,
|
||||||
|
mapSheetMngFileEntity.fileUid,
|
||||||
|
mapSheetMngFileEntity.mngYyyy,
|
||||||
|
mapSheetMngFileEntity.mapSheetNum,
|
||||||
|
mapSheetMngFileEntity.refMapSheetNum,
|
||||||
|
mapSheetMngFileEntity.filePath,
|
||||||
|
mapSheetMngFileEntity.fileName,
|
||||||
|
mapSheetMngFileEntity.fileExt,
|
||||||
|
mapSheetMngFileEntity.hstUid,
|
||||||
|
mapSheetMngFileEntity.fileSize))
|
||||||
|
.from(mapSheetMngFileEntity)
|
||||||
|
.where(mapSheetMngFileEntity.fileUid.eq(fileUid))
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
|
return foundContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void MapSheetMngComplete(int mngYyyy) {
|
public void MapSheetMngComplete(int mngYyyy) {
|
||||||
long execCount =
|
long execCount =
|
||||||
queryFactory
|
queryFactory
|
||||||
@@ -511,6 +548,26 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateMapSheetMngHstSyncCheckState(
|
||||||
|
Long hstUid,
|
||||||
|
String uploadPath,
|
||||||
|
String syncCheckTfwFileName,
|
||||||
|
String syncCheckTifFileName){
|
||||||
|
|
||||||
|
long execCount =
|
||||||
|
queryFactory
|
||||||
|
.update(mapSheetMngHstEntity)
|
||||||
|
.set(mapSheetMngHstEntity.syncCheckState, "DONE")
|
||||||
|
.set(mapSheetMngHstEntity.mapSheetPath, uploadPath)
|
||||||
|
.set(mapSheetMngHstEntity.syncCheckTfwFileName, syncCheckTfwFileName)
|
||||||
|
.set(mapSheetMngHstEntity.syncCheckTifFileName, syncCheckTifFileName)
|
||||||
|
.set(mapSheetMngHstEntity.syncCheckStrtDttm, ZonedDateTime.now())
|
||||||
|
.set(mapSheetMngHstEntity.syncCheckEndDttm, ZonedDateTime.now())
|
||||||
|
.where(mapSheetMngHstEntity.hstUid.eq(hstUid))
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteByMngYyyyMngAll(int mngYyyy) {
|
public void deleteByMngYyyyMngAll(int mngYyyy) {
|
||||||
|
|
||||||
@@ -564,14 +621,53 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteByFileUidMngFile(Long fileUid) {
|
public void deleteByHstUidMngFile(Long hstUid) {
|
||||||
long deletedFileCount =
|
long deletedFileCount =
|
||||||
|
queryFactory
|
||||||
|
.delete(mapSheetMngFileEntity)
|
||||||
|
.where(mapSheetMngFileEntity.fileUid.eq(hstUid))
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteByFileUidMngFile(Long fileUid) {
|
||||||
|
long fileCount =
|
||||||
queryFactory
|
queryFactory
|
||||||
.delete(mapSheetMngFileEntity)
|
.delete(mapSheetMngFileEntity)
|
||||||
.where(mapSheetMngFileEntity.fileUid.eq(fileUid))
|
.where(mapSheetMngFileEntity.fileUid.eq(fileUid))
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq){
|
||||||
|
long fileCount =
|
||||||
|
queryFactory
|
||||||
|
.insert(mapSheetMngFileEntity)
|
||||||
|
.columns(
|
||||||
|
mapSheetMngFileEntity.mngYyyy,
|
||||||
|
mapSheetMngFileEntity.mapSheetNum,
|
||||||
|
mapSheetMngFileEntity.refMapSheetNum,
|
||||||
|
mapSheetMngFileEntity.filePath,
|
||||||
|
mapSheetMngFileEntity.fileName,
|
||||||
|
mapSheetMngFileEntity.fileExt,
|
||||||
|
mapSheetMngFileEntity.hstUid,
|
||||||
|
mapSheetMngFileEntity.fileSize,
|
||||||
|
mapSheetMngFileEntity.fileState
|
||||||
|
)
|
||||||
|
.values(
|
||||||
|
addReq.getMngYyyy(),
|
||||||
|
addReq.getMapSheetNum(),
|
||||||
|
addReq.getRefMapSheetNum(),
|
||||||
|
addReq.getFilePath(),
|
||||||
|
addReq.getFileName(),
|
||||||
|
addReq.getFileExt(),
|
||||||
|
addReq.getHstUid(),
|
||||||
|
addReq.getFileSize(),
|
||||||
|
addReq.getFileState()
|
||||||
|
)
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertMapSheetOrgDataToMapSheetMngHst(int mngYyyy) {
|
public int insertMapSheetOrgDataToMapSheetMngHst(int mngYyyy) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user