Merge pull request '국유인 실태조사 bulk 확인' (#122) from feat/infer_dev_260211 into develop
Reviewed-on: #122
This commit was merged in pull request #122.
This commit is contained in:
@@ -59,10 +59,20 @@ public class MapSheetMngService {
|
||||
@Value("${file.sync-file-extention}")
|
||||
private String syncFileExtention;
|
||||
|
||||
/**
|
||||
* 영상데이터관리 > 목록 조회
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<MngDto> findMapSheetMngList() {
|
||||
return mapSheetMngCoreService.findMapSheetMngList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 영상데이터관리 > 데이터 등록 > 연도 선택 목록
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Integer> findMapSheetMngYyyyList() {
|
||||
return mapSheetMngCoreService.findMapSheetMngYyyyList();
|
||||
}
|
||||
@@ -77,6 +87,12 @@ public class MapSheetMngService {
|
||||
.toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 영상데이터관리 > 상세 조회
|
||||
*
|
||||
* @param mngYyyy
|
||||
* @return
|
||||
*/
|
||||
public MngDto findMapSheetMng(int mngYyyy) {
|
||||
return mapSheetMngCoreService.findMapSheetMng(mngYyyy);
|
||||
}
|
||||
@@ -89,6 +105,12 @@ public class MapSheetMngService {
|
||||
return new DmlReturn("success", "작업완료 처리되었습니다.");
|
||||
}
|
||||
|
||||
/**
|
||||
* 영상데이터관리 > 상세 > 오류 처리 내역
|
||||
*
|
||||
* @param searchReq
|
||||
* @return
|
||||
*/
|
||||
public Page<ErrorDataDto> findMapSheetErrorList(@Valid ErrorSearchReq searchReq) {
|
||||
return mapSheetMngCoreService.findMapSheetErrorList(searchReq);
|
||||
}
|
||||
@@ -97,12 +119,20 @@ public class MapSheetMngService {
|
||||
return mapSheetMngCoreService.findMapSheetError(hstUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 영상데이터관리 > 데이터 등록
|
||||
*
|
||||
* @param addReq
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
public DmlReturn mngDataSave(AddReq addReq) {
|
||||
|
||||
addReq.setCreatedUid(userUtil.getId());
|
||||
|
||||
int execCnt = mapSheetMngCoreService.mngDataSave(addReq);
|
||||
int execCnt =
|
||||
mapSheetMngCoreService.mngDataSave(addReq); // tb_map_sheet_mng_hst 테이블에 insert된 개수 리턴됨
|
||||
|
||||
return new MapSheetMngDto.DmlReturn("success", addReq.getMngYyyy() + "년, " + execCnt + "건 생성");
|
||||
}
|
||||
|
||||
@@ -110,6 +140,15 @@ public class MapSheetMngService {
|
||||
return mapSheetMngCoreService.updateExceptUseInference(hstUidList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 영상데이터관리 > 상세 > 오류 처리 내역 > 업로드 (페어 파일 저장)
|
||||
*
|
||||
* @param tfwFile
|
||||
* @param tifFile
|
||||
* @param hstUid
|
||||
* @param tifFileSize
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
public DmlReturn uploadPair(
|
||||
MultipartFile tfwFile, String tifFile, Long hstUid, Long tifFileSize) {
|
||||
@@ -118,6 +157,7 @@ public class MapSheetMngService {
|
||||
|
||||
DmlReturn dmlReturn = new DmlReturn("success", "UPLOAD COMPLETE");
|
||||
|
||||
// hst 테이블에 선택한 hstUid row 정보 조회
|
||||
ErrorDataDto errDto = mapSheetMngCoreService.findMapSheetError(hstUid);
|
||||
|
||||
if (errDto == null) {
|
||||
@@ -135,33 +175,14 @@ public class MapSheetMngService {
|
||||
return dmlReturn;
|
||||
}
|
||||
|
||||
// TODO 삭제?
|
||||
MngDto mngDto = mapSheetMngCoreService.findMapSheetMng(errDto.getMngYyyy());
|
||||
|
||||
// 중복체크 -> 도엽50k/uuid 경로에 업로드 할 거라 overwrite 되지 않음
|
||||
// if (!overwrite) {
|
||||
// dmlReturn =
|
||||
// this.duplicateFile(
|
||||
// errDto.getMngYyyy(), tfwFile.getOriginalFilename(), tifFile.getOriginalFilename());
|
||||
// if (dmlReturn.getFlag().equals("duplicate")) {
|
||||
// return dmlReturn;
|
||||
// }
|
||||
// }
|
||||
|
||||
// ★ tif 파일은 대용량 업로드에서 아래 정보들을 체크하기 때문에 체크 로직에서 제외됨
|
||||
// 멀티파트 파일 tmp폴더 저장(파일형식 체크를 위해)
|
||||
String tfwTmpPath = tmpPath + tfwFile.getOriginalFilename();
|
||||
// String tifTmpPath = tmpPath + tifFile;
|
||||
|
||||
if (!FIleChecker.multipartSaveTo(tfwFile, tfwTmpPath)) {
|
||||
return new DmlReturn("fail", "UPLOAD ERROR");
|
||||
}
|
||||
// if (!FIleChecker.multipartSaveTo(tifFile, tifTmpPath)) {
|
||||
// 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");
|
||||
}
|
||||
@@ -175,7 +196,6 @@ public class MapSheetMngService {
|
||||
}
|
||||
|
||||
Path tfwTmpSavePath = Paths.get(tfwTmpPath);
|
||||
// Path tifTmpSavePath = Paths.get(tifTmpPath);
|
||||
Path tfwTargetPath = null;
|
||||
Path tifTargetPath = null;
|
||||
|
||||
@@ -222,7 +242,7 @@ public class MapSheetMngService {
|
||||
|
||||
try {
|
||||
Files.move(tfwTmpSavePath, tfwTargetPath, StandardCopyOption.REPLACE_EXISTING);
|
||||
// Files.move(tifTmpSavePath, tifTargetPath, StandardCopyOption.REPLACE_EXISTING);
|
||||
// tif파일은 대용량 업로드에서 이미 업로드 했기 때문에 완료된 상태
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -234,7 +254,7 @@ public class MapSheetMngService {
|
||||
updReqSyncCheckState.setFilePath(uploadPath);
|
||||
updReqSyncCheckState.setSyncCheckTfwFileName(tfwFile.getOriginalFilename());
|
||||
updReqSyncCheckState.setSyncCheckTifFileName(tifFile);
|
||||
updReqSyncCheckState.setSyncCheckState("DONE");
|
||||
updReqSyncCheckState.setSyncCheckState("DONE"); // 오류처리 완료
|
||||
mapSheetMngCoreService.updateMapSheetMngHstSyncCheckState(updReqSyncCheckState);
|
||||
// 파일정보 업데이트
|
||||
mapSheetMngCoreService.deleteByHstUidMngFile(hstUid);
|
||||
|
||||
Reference in New Issue
Block a user