영상관리 수정
This commit is contained in:
@@ -178,9 +178,8 @@ public class MapSheetMngApiController {
|
||||
@RequestParam(value = "hstUid", required = false) Long hstUid,
|
||||
@RequestParam(value = "overwrite", required = false) boolean overwrite) {
|
||||
|
||||
|
||||
|
||||
return ApiResponseDto.createOK(mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid, overwrite));
|
||||
return ApiResponseDto.createOK(
|
||||
mapSheetMngService.uploadPair(tfwFile, tifFile, hstUid, overwrite));
|
||||
}
|
||||
|
||||
@Operation(summary = "영상관리 > 파일조회", description = "영상관리 > 파일조회")
|
||||
|
||||
@@ -92,26 +92,27 @@ public class MapSheetMngDto {
|
||||
|
||||
public String getMngState() {
|
||||
|
||||
if (this.syncStateDoneCnt == 0)return "NOTYET";
|
||||
else if (this.syncStateDoneCnt < this.syncTotCnt)return "PROCESSING";
|
||||
if (this.syncStateDoneCnt == 0) return "NOTYET";
|
||||
else if (this.syncStateDoneCnt < this.syncTotCnt) return "PROCESSING";
|
||||
|
||||
if( (this.syncNotPaireExecCnt + this.syncDuplicateExecCnt + this.syncFaultExecCnt) > 0 )return "TAKINGERROR";
|
||||
if ((this.syncNotPaireExecCnt + this.syncDuplicateExecCnt + this.syncFaultExecCnt) > 0)
|
||||
return "TAKINGERROR";
|
||||
|
||||
return "DONE";
|
||||
}
|
||||
|
||||
public String getSyncState() {
|
||||
|
||||
if (this.syncStateDoneCnt == 0)return "NOTYET";
|
||||
else if (this.syncStateDoneCnt < this.syncTotCnt)return "PROCESSING";
|
||||
if (this.syncStateDoneCnt == 0) return "NOTYET";
|
||||
else if (this.syncStateDoneCnt < this.syncTotCnt) return "PROCESSING";
|
||||
|
||||
return "DONE";
|
||||
}
|
||||
|
||||
public String getDataCheckState() {
|
||||
|
||||
if (this.syncDataCheckDoneCnt == 0)return "NOTYET";
|
||||
else if (this.syncDataCheckDoneCnt < this.syncTotCnt)return "PROCESSING";
|
||||
if (this.syncDataCheckDoneCnt == 0) return "NOTYET";
|
||||
else if (this.syncDataCheckDoneCnt < this.syncTotCnt) return "PROCESSING";
|
||||
|
||||
return "DONE";
|
||||
}
|
||||
@@ -138,8 +139,6 @@ public class MapSheetMngDto {
|
||||
return this.syncNotPaireExecCnt + this.syncDuplicateExecCnt + this.syncFaultExecCnt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getMngStateName() {
|
||||
String enumId = this.mngState;
|
||||
if (enumId == null || enumId.isEmpty()) {
|
||||
@@ -254,8 +253,6 @@ public class MapSheetMngDto {
|
||||
this.errorCheckTifFileName = errorCheckTifFileName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private String getSyncStateName(String enumId) {
|
||||
if (enumId == null || enumId.isEmpty()) {
|
||||
enumId = "NOTYET";
|
||||
|
||||
@@ -33,7 +33,6 @@ public class MapSheetMngService {
|
||||
private final MapSheetMngCoreService mapSheetMngCoreService;
|
||||
private final FileConfig fileConfig;
|
||||
|
||||
|
||||
@Value("${file.sync-root-dir}")
|
||||
private String syncRootDir;
|
||||
|
||||
@@ -85,7 +84,8 @@ public class MapSheetMngService {
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public DmlReturn uploadPair(MultipartFile tfwFile, MultipartFile tifFile, Long hstUid, Boolean overwrite) {
|
||||
public DmlReturn uploadPair(
|
||||
MultipartFile tfwFile, MultipartFile tifFile, Long hstUid, Boolean overwrite) {
|
||||
|
||||
String rootPath = syncRootDir;
|
||||
String tmpPath = syncTmpDir;
|
||||
@@ -103,32 +103,30 @@ public class MapSheetMngService {
|
||||
return new DmlReturn("fail", "CREATE TEMP FOLDER ERROR");
|
||||
}
|
||||
|
||||
//업로드 파일 사이즈,확장자명 체크
|
||||
// 업로드 파일 사이즈,확장자명 체크
|
||||
dmlReturn = this.validationFile(tfwFile, tifFile);
|
||||
if( dmlReturn.getFlag().equals("fail") )return dmlReturn;
|
||||
|
||||
if (dmlReturn.getFlag().equals("fail")) return dmlReturn;
|
||||
|
||||
MngDto mngDto = mapSheetMngCoreService.findMapSheetMng(errDto.getMngYyyy());
|
||||
String targetYearDir = mngDto.getMngPath();
|
||||
|
||||
// 중복체크
|
||||
if( !overwrite ) {
|
||||
if (!overwrite) {
|
||||
|
||||
int tfwCnt = FIleChecker.getFileCountFromAllDepth(targetYearDir, tfwFile.getOriginalFilename(), "tfw");
|
||||
int tifCnt = FIleChecker.getFileCountFromAllDepth(targetYearDir, tfwFile.getOriginalFilename(), "tfw");
|
||||
int tfwCnt =
|
||||
FIleChecker.getFileCountFromAllDepth(targetYearDir, tfwFile.getOriginalFilename(), "tfw");
|
||||
int tifCnt =
|
||||
FIleChecker.getFileCountFromAllDepth(targetYearDir, tfwFile.getOriginalFilename(), "tfw");
|
||||
|
||||
if (tfwCnt > 0 || tifCnt > 0) {
|
||||
String tfwtifMsg = "";
|
||||
if (tfwCnt > 0)
|
||||
tfwtifMsg = tfwFile.getOriginalFilename();
|
||||
if (tifCnt > 0) {
|
||||
if (tfwCnt > 0)
|
||||
tfwtifMsg = "," + tifFile.getOriginalFilename();
|
||||
else
|
||||
tfwtifMsg = tifFile.getOriginalFilename();
|
||||
}
|
||||
return new DmlReturn("duplicate", tfwtifMsg);
|
||||
if (tfwCnt > 0 || tifCnt > 0) {
|
||||
String tfwtifMsg = "";
|
||||
if (tfwCnt > 0) tfwtifMsg = tfwFile.getOriginalFilename();
|
||||
if (tifCnt > 0) {
|
||||
if (tfwCnt > 0) tfwtifMsg = "," + tifFile.getOriginalFilename();
|
||||
else tfwtifMsg = tifFile.getOriginalFilename();
|
||||
}
|
||||
return new DmlReturn("duplicate", tfwtifMsg);
|
||||
}
|
||||
}
|
||||
|
||||
File directory = new File(tmpPath);
|
||||
@@ -214,12 +212,13 @@ public class MapSheetMngService {
|
||||
return new DmlReturn("success", "파일 업로드 완료되었습니다.");
|
||||
}
|
||||
|
||||
public DmlReturn validationFile(MultipartFile tfwFile, MultipartFile tifFile)
|
||||
{
|
||||
if( !FIleChecker.validationMultipart(tfwFile) )return new DmlReturn("fail", "TFW SIZE 오류");
|
||||
else if( !FIleChecker.validationMultipart(tifFile) )return new DmlReturn("fail", "TFW SIZE 오류");
|
||||
else if (!FIleChecker.checkExtensions(tfwFile.getOriginalFilename(), "tfw"))return new DmlReturn("fail", "TFW FILENAME ERROR");
|
||||
else if (!FIleChecker.checkExtensions(tifFile.getOriginalFilename(), "tif"))return new DmlReturn("fail", "TIF FILENAME ERROR");
|
||||
public DmlReturn validationFile(MultipartFile tfwFile, MultipartFile tifFile) {
|
||||
if (!FIleChecker.validationMultipart(tfwFile)) return new DmlReturn("fail", "TFW SIZE 오류");
|
||||
else if (!FIleChecker.validationMultipart(tifFile)) return new DmlReturn("fail", "TFW SIZE 오류");
|
||||
else if (!FIleChecker.checkExtensions(tfwFile.getOriginalFilename(), "tfw"))
|
||||
return new DmlReturn("fail", "TFW FILENAME ERROR");
|
||||
else if (!FIleChecker.checkExtensions(tifFile.getOriginalFilename(), "tif"))
|
||||
return new DmlReturn("fail", "TIF FILENAME ERROR");
|
||||
|
||||
return new DmlReturn("success", "파일체크");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user