영상관리 chunk, uploadPair 로직 수정
This commit is contained in:
@@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -322,6 +323,7 @@ public class MapSheetMngApiController {
|
||||
@PostMapping(value = "/file-chunk-upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public ApiResponseDto<ModelUploadResDto> fileChunkUpload(
|
||||
@RequestParam("hstUid") Long hstUid,
|
||||
@RequestParam("uuid") UUID uuid,
|
||||
@RequestParam("fileName") String fileName,
|
||||
@RequestParam("fileSize") long fileSize,
|
||||
@RequestParam("chunkIndex") Integer chunkIndex,
|
||||
@@ -338,6 +340,7 @@ public class MapSheetMngApiController {
|
||||
upAddReqDto.setChunkIndex(chunkIndex);
|
||||
upAddReqDto.setChunkTotalIndex(chunkTotalIndex);
|
||||
upAddReqDto.setUploadDivi(uploadDivi);
|
||||
upAddReqDto.setUuid(uuid);
|
||||
upAddReqDto.setFinalPath(syncRootDir);
|
||||
upAddReqDto.setTempPath(syncRootTmpDir);
|
||||
|
||||
|
||||
@@ -258,6 +258,7 @@ public class MapSheetMngDto {
|
||||
private String mapSheetPath;
|
||||
|
||||
private UUID uuid;
|
||||
private String uploadId;
|
||||
|
||||
// private List<MngFIleDto> fileArray;
|
||||
|
||||
@@ -278,7 +279,8 @@ public class MapSheetMngDto {
|
||||
String errorCheckTfwFileName,
|
||||
String errorCheckTifFileName,
|
||||
String mapSheetPath,
|
||||
UUID uuid) {
|
||||
UUID uuid,
|
||||
String uploadId) {
|
||||
this.hstUid = hstUid;
|
||||
this.mngYyyy = mngYyyy;
|
||||
this.mapSheetNum = mapSheetNum;
|
||||
@@ -298,6 +300,7 @@ public class MapSheetMngDto {
|
||||
this.errorCheckTifFileName = errorCheckTifFileName;
|
||||
this.mapSheetPath = mapSheetPath;
|
||||
this.uuid = uuid;
|
||||
this.uploadId = uploadId;
|
||||
}
|
||||
|
||||
private String getSyncStateName(String enumId) {
|
||||
|
||||
@@ -148,7 +148,7 @@ public class MapSheetMngService {
|
||||
|
||||
// 멀티파트 파일 tmp폴더 저장(파일형식 체크를 위해)
|
||||
String tfwTmpPath = tmpPath + tfwFile.getOriginalFilename();
|
||||
String tifTmpPath = tmpPath + tifFile;
|
||||
// String tifTmpPath = tmpPath + tifFile;
|
||||
|
||||
if (!FIleChecker.multipartSaveTo(tfwFile, tfwTmpPath)) {
|
||||
return new DmlReturn("fail", "UPLOAD ERROR");
|
||||
@@ -393,7 +393,6 @@ public class MapSheetMngService {
|
||||
uploadPath = Paths.get(referPath).getParent().toString() + "/" + errDto.getRefMapSheetNum();
|
||||
}
|
||||
|
||||
upAddReqDto.setUuid(errDto.getUuid());
|
||||
upAddReqDto.setFinalPath(uploadPath + "/");
|
||||
upAddReqDto.setTempPath(upAddReqDto.getTempPath() + "/");
|
||||
|
||||
@@ -402,7 +401,7 @@ public class MapSheetMngService {
|
||||
ModelUploadResDto modelUploadResDto = new ModelUploadResDto();
|
||||
|
||||
// 병합 다 했는데 gdalinfo 가 fail 이면 삭제?
|
||||
if (upRes.getRes().equals("MERGED")) {
|
||||
if (upAddReqDto.getStatus().equals("MERGED")) {
|
||||
if (!FIleChecker.cmmndGdalInfo(upRes.getFilePath() + "/" + upRes.getFileName())) {
|
||||
Path filePath = Paths.get(upRes.getFilePath());
|
||||
Files.deleteIfExists(filePath);
|
||||
@@ -410,6 +409,10 @@ public class MapSheetMngService {
|
||||
modelUploadResDto.setResMsg("TIF TYPE ERROR");
|
||||
return modelUploadResDto;
|
||||
}
|
||||
|
||||
// upload_id, uuid 를 update
|
||||
mapSheetMngCoreService.updateMapSheetMngHstUploadId(
|
||||
hstUid, upAddReqDto.getUuid(), upRes.getUploadId());
|
||||
}
|
||||
|
||||
modelUploadResDto.setRes(upRes.getRes());
|
||||
|
||||
Reference in New Issue
Block a user