영상관리 수정

This commit is contained in:
Moon
2025-12-26 15:13:27 +09:00
parent a2f2af4282
commit 8ff5ac68f0
6 changed files with 72 additions and 234 deletions

View File

@@ -178,20 +178,22 @@ public class MapSheetMngApiController {
return ApiResponseDto.ok(mapSheetMngService.updateExceptUseInference(hstUidList));
}
*/
@Operation(summary = "페어 파일 업로드", description = "TFW/TIF 두 파일을 쌍으로 업로드 및 검증")
@PostMapping(value = "/upload-pair", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ApiResponseDto<MapSheetMngDto.DmlReturn> uploadPair(
@RequestPart("tfw") MultipartFile tfwFile,
@RequestPart("tif") MultipartFile tifFile,
@RequestParam(value = "hstUid", required = false) Long hstUid,
@RequestParam(value = "overwrite", required = false) boolean overwrite) {
@RequestPart("tfw") MultipartFile tfwFile,
@RequestPart("tif") MultipartFile tifFile,
@RequestParam(value = "hstUid", required = false) Long hstUid,
@RequestParam(value = "overwrite", required = false) boolean overwrite) {
return ApiResponseDto.createOK(
mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid, overwrite));
mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid, overwrite));
}
*/
@Operation(summary = "영상관리 > 파일조회", description = "영상관리 > 파일조회")
@ApiResponses(
value = {
@@ -207,33 +209,13 @@ public class MapSheetMngApiController {
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@GetMapping("/mng-file-list")
public ApiResponseDto<List<MapSheetMngDto.MngFilesDto>> findHstUidToMapSheetFileList(
public ApiResponseDto<List<MapSheetMngDto.MngFilesDto>> findByHstUidMapSheetFileList(
@RequestParam @Valid Long hstUid) {
return ApiResponseDto.ok(mapSheetMngService.findHstUidToMapSheetFileList(hstUid));
}
@Operation(summary = "영상관리 > 파일삭제", description = "영상관리 > 파일삭제")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "201",
description = "파일삭제 처리 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Long.class))),
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@PutMapping("/del-mng-files")
public ApiResponseDto<MapSheetMngDto.DmlReturn> deleteByFileUidMngFile(
@RequestParam @Valid List<Long> fileUids) {
return ApiResponseDto.ok(mapSheetMngService.deleteByFileUidMngFile(fileUids));
return ApiResponseDto.ok(mapSheetMngService.findByHstUidMapSheetFileList(hstUid));
}
@Operation(summary = "영상관리 > 파일사용설정", description = "영상관리 > 파일사용설정(중복파일제거 및 선택파일사용설정)")
@Operation(summary = "영상관리 > 파일사용설정 및 중복제거", description = "영상관리 >파일사용설정 및 중복제거(중복파일제거 및 선택파일사용설정)")
@ApiResponses(
value = {
@ApiResponse(

View File

@@ -90,16 +90,7 @@ public class MapSheetMngDto {
@JsonFormatDttm private ZonedDateTime rgstStrtDttm;
@JsonFormatDttm private ZonedDateTime rgstEndDttm;
public String getMngState() {
if (this.syncStateDoneCnt == 0) return "NOTYET";
else if (this.syncStateDoneCnt < this.syncTotCnt) return "PROCESSING";
if ((this.syncNotPaireExecCnt + this.syncDuplicateExecCnt + this.syncFaultExecCnt) > 0)
return "TAKINGERROR";
return "DONE";
}
public String getSyncState() {
@@ -139,8 +130,22 @@ public class MapSheetMngDto {
return this.syncNotPaireExecCnt + this.syncDuplicateExecCnt + this.syncFaultExecCnt;
}
public String getMngState() {
String mngState = "DONE";
if (this.syncStateDoneCnt == 0) mngState = "NOTYET";
else if (this.syncStateDoneCnt < this.syncTotCnt) mngState = "PROCESSING";
if ((this.syncNotPaireExecCnt + this.syncDuplicateExecCnt + this.syncFaultExecCnt) > 0)
mngState = "TAKINGERROR";
return mngState;
}
public String getMngStateName() {
String enumId = this.mngState;
String enumId = this.getMngState();
if (enumId == null || enumId.isEmpty()) {
enumId = "NOTYET";
}
@@ -148,6 +153,7 @@ public class MapSheetMngDto {
MngStateType type = Enums.fromId(MngStateType.class, enumId);
return type.getText();
}
}
@Schema(name = "ErrorSearchReq", description = "영상관리 오류데이터 검색 요청")

View File

@@ -73,13 +73,11 @@ public class MapSheetMngService {
}
@Transactional
public DmlReturn mngDataSave(AddReq AddReq) {
return mapSheetMngCoreService.mngDataSave(AddReq);
public DmlReturn mngDataSave(AddReq addReq) {
int execCnt = mapSheetMngCoreService.mngDataSave(addReq);
return new MapSheetMngDto.DmlReturn("success", addReq.getMngYyyy()+"년, "+execCnt+"건 생성");
}
public DmlReturn uploadProcess(@Valid List<Long> hstUidList) {
return mapSheetMngCoreService.uploadProcess(hstUidList);
}
public DmlReturn updateExceptUseInference(@Valid List<Long> hstUidList) {
return mapSheetMngCoreService.updateExceptUseInference(hstUidList);
@@ -129,7 +127,7 @@ public class MapSheetMngService {
if (!FIleChecker.checkTfw(tfwTmpPath)) return new DmlReturn("fail", "TFW TYPE ERROR");
// 싱크파일목록으로 업로드 경로 확인
List<MngFilesDto> mngFiles = mapSheetMngCoreService.findIdToMapSheetFileList(hstUid);
List<MngFilesDto> mngFiles = mapSheetMngCoreService.findByHstUidMapSheetFileList(hstUid);
String uploadPath = "";
for (MngFilesDto dto : mngFiles) {
uploadPath = dto.getFilePath();
@@ -197,24 +195,10 @@ public class MapSheetMngService {
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
}
public List<MngFilesDto> findHstUidToMapSheetFileList(Long hstUid) {
return mapSheetMngCoreService.findHstUidToMapSheetFileList(hstUid);
public List<MngFilesDto> findByHstUidMapSheetFileList(Long hstUid) {
return mapSheetMngCoreService.findByHstUidMapSheetFileList(hstUid);
}
@Transactional
public DmlReturn deleteByFileUidMngFile(List<Long> fileUids) {
long hstUid = 0;
for (Long uid : fileUids) {
mapSheetMngCoreService.deleteByFileUidMngFile(uid);
}
// 중복제거 확인후 처리상태(DONE)변경
//if (hstUid > 0) mapSheetMngCoreService.updateByHstUidSyncCheckState(hstUid);
return new DmlReturn("success", fileUids.size() + "개 파일이 삭제되었습니다.");
}
@Transactional
public DmlReturn setUseByFileUidMngFile(List<Long> fileUids) {
@@ -223,21 +207,29 @@ public class MapSheetMngService {
DmlReturn dmlReturn = new DmlReturn("success", "정상처리되었습니다.");
MapSheetMngDto.MngFilesDto dto = mapSheetMngCoreService.findByFileUidMapSheetFile(fileUids.get(0));
hstUid = dto.getHstUid();
mapSheetMngCoreService.deleteByNotInFileUidMngFile(hstUid, fileUids);
MapSheetMngDto.SyncCheckStateReqUpdateDto reqDto = new MapSheetMngDto.SyncCheckStateReqUpdateDto();
for (Long uid : fileUids) {
MapSheetMngDto.MngFilesDto dto = mapSheetMngCoreService.findByFileUidMapSheetFile(uid);
reqDto.setHstUid(dto.getHstUid());
reqDto.setFilePath(dto.getFilePath());
reqDto.setSyncCheckState("DONE");
if (dto.getFileExt().equals("tif")) reqDto.setSyncCheckTifFileName(dto.getFileName());
else if (dto.getFileExt().equals("tfw")) reqDto.setSyncCheckTfwFileName(dto.getFileName());
mapSheetMngCoreService.updateByFileUidFileState(uid, "DONE");
}
//선택제외 삭제처리
mapSheetMngCoreService.deleteByNotInFileUidMngFile(reqDto.getHstUid(), fileUids);
//Hst(내역) 테이블 상태 업데이트
mapSheetMngCoreService.updateByHstUidSyncCheckState(reqDto);
return new DmlReturn("success", fileUids.size() + "개 파일이 사용설정되었습니다.");
}
public DmlReturn validationFile(MultipartFile tfwFile, MultipartFile tifFile)
{
if( !FIleChecker.validationMultipart(tfwFile) )return new DmlReturn("fail", "TFW SIZE 오류");
@@ -253,9 +245,6 @@ public class MapSheetMngService {
int tfwCnt = mapSheetMngCoreService.findByYearFileNameFileCount(mngYyyy, tfwFileName);
int tifCnt = mapSheetMngCoreService.findByYearFileNameFileCount(mngYyyy, tifFileName);
System.out.println("tfwCnt ==" + tfwCnt);
System.out.println("tifCnt ==" + tifCnt);
if (tfwCnt > 0 || tifCnt > 0) {
String resMsg = "";
if (tfwCnt > 0)