feat: polishing
This commit is contained in:
@@ -9,7 +9,9 @@ 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.YearSearchReq;
|
||||
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngCoreService;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.YearEntity;
|
||||
import jakarta.validation.Valid;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -17,6 +19,7 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -40,6 +43,16 @@ public class MapSheetMngService {
|
||||
return mapSheetMngCoreService.findMapSheetMngYyyyList();
|
||||
}
|
||||
|
||||
public List<Integer> getListMapListYYYYLimit10() {
|
||||
|
||||
YearSearchReq req = YearSearchReq.builder().status("NOTYET").page(0).size(10).build();
|
||||
// List조회
|
||||
Page<YearEntity> years = mapSheetMngCoreService.getListMapListYYYYWithPaging(req);
|
||||
return years.map(YearEntity::getYyyy).getContent().stream()
|
||||
.sorted(Comparator.reverseOrder())
|
||||
.toList();
|
||||
}
|
||||
|
||||
public MngDto findMapSheetMng(int mngYyyy) {
|
||||
return mapSheetMngCoreService.findMapSheetMng(mngYyyy);
|
||||
}
|
||||
@@ -130,10 +143,15 @@ public class MapSheetMngService {
|
||||
if (!overwrite) {
|
||||
if (tfwCnt > 0 || tifCnt > 0) {
|
||||
String tfwtifMsg = "";
|
||||
if (tfwCnt > 0) tfwtifMsg = tfwFile.getOriginalFilename();
|
||||
if (tfwCnt > 0) {
|
||||
tfwtifMsg = tfwFile.getOriginalFilename();
|
||||
}
|
||||
if (tifCnt > 0) {
|
||||
if (tfwCnt > 0) tfwtifMsg = "," + tifFile.getOriginalFilename();
|
||||
else tfwtifMsg = tifFile.getOriginalFilename();
|
||||
if (tfwCnt > 0) {
|
||||
tfwtifMsg = "," + tifFile.getOriginalFilename();
|
||||
} else {
|
||||
tfwtifMsg = tifFile.getOriginalFilename();
|
||||
}
|
||||
}
|
||||
return new DmlReturn("duplicate", tfwtifMsg);
|
||||
}
|
||||
@@ -153,8 +171,12 @@ public class MapSheetMngService {
|
||||
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");
|
||||
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);
|
||||
@@ -252,7 +274,9 @@ public class MapSheetMngService {
|
||||
}
|
||||
|
||||
// 중복제거 확인후 처리상태(DONE)변경
|
||||
if (hstUid > 0) mapSheetMngCoreService.updateByHstUidSyncCheckState(hstUid);
|
||||
if (hstUid > 0) {
|
||||
mapSheetMngCoreService.updateByHstUidSyncCheckState(hstUid);
|
||||
}
|
||||
|
||||
return new DmlReturn("success", fileUids.size() + "개 파일이 삭제되었습니다.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user