영상관리 파일 업로드 추가
This commit is contained in:
@@ -2,7 +2,6 @@ package com.kamco.cd.kamcoback.postgres.core;
|
||||
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngFileEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.mapsheet.MapSheetMngRepository;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
@@ -55,20 +54,16 @@ public class MapSheetMngCoreService {
|
||||
|
||||
public MapSheetMngDto.DmlReturn mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq) {
|
||||
|
||||
|
||||
mapSheetMngRepository.mngFileSave(addReq);
|
||||
// int hstCnt = mapSheetMngRepository.insertMapSheetOrgDataToMapSheetMngHst(saved.getMngYyyy());
|
||||
|
||||
return new MapSheetMngDto.DmlReturn("success", "파일정보저장되었습니다.");
|
||||
}
|
||||
|
||||
|
||||
public void updateMapSheetMngHstSyncCheckState(
|
||||
Long hstUid,
|
||||
String uploadPath,
|
||||
String syncCheckTfwFileName,
|
||||
String syncCheckTifFileName){
|
||||
mapSheetMngRepository.updateMapSheetMngHstSyncCheckState(hstUid, uploadPath, syncCheckTfwFileName, syncCheckTifFileName);
|
||||
Long hstUid, String uploadPath, String syncCheckTfwFileName, String syncCheckTifFileName) {
|
||||
mapSheetMngRepository.updateMapSheetMngHstSyncCheckState(
|
||||
hstUid, uploadPath, syncCheckTfwFileName, syncCheckTifFileName);
|
||||
}
|
||||
|
||||
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||
@@ -80,13 +75,10 @@ public class MapSheetMngCoreService {
|
||||
return mapSheetMngRepository.findMapSheetError(hstUid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<MapSheetMngDto.MngFilesDto> findIdToMapSheetFileList(Long hstUid) {
|
||||
return mapSheetMngRepository.findIdToMapSheetFileList(hstUid);
|
||||
}
|
||||
|
||||
|
||||
public MapSheetMngDto.MngFilesDto findYyyyToMapSheetFilePathRefer(int mngYyyy) {
|
||||
return mapSheetMngRepository.findYyyyToMapSheetFilePathRefer(mngYyyy);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ public interface MapSheetMngRepositoryCustom {
|
||||
|
||||
MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy);
|
||||
|
||||
|
||||
|
||||
void MapSheetMngComplete(int mngYyyy);
|
||||
|
||||
Optional<MapSheetMngHstEntity> findMapSheetMngHstInfo(Long hstUid);
|
||||
@@ -42,10 +40,7 @@ public interface MapSheetMngRepositoryCustom {
|
||||
void mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq);
|
||||
|
||||
void updateMapSheetMngHstSyncCheckState(
|
||||
Long hstUid,
|
||||
String uploadPath,
|
||||
String syncCheckTfwFileName,
|
||||
String syncCheckTifFileName);
|
||||
Long hstUid, String uploadPath, String syncCheckTfwFileName, String syncCheckTifFileName);
|
||||
|
||||
Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||
MapSheetMngDto.@Valid ErrorSearchReq searchReq);
|
||||
@@ -53,6 +48,7 @@ public interface MapSheetMngRepositoryCustom {
|
||||
MapSheetMngDto.ErrorDataDto findMapSheetError(Long hstUid);
|
||||
|
||||
List<MapSheetMngDto.MngFilesDto> findIdToMapSheetFileList(Long hstUid);
|
||||
|
||||
MapSheetMngDto.MngFilesDto findIdToMapSheetFile(Long fileUid);
|
||||
|
||||
void updateHstFileSizes(Long hstUid, long tifSizeBytes, long tfwSizeBytes, long totalSizeBytes);
|
||||
|
||||
@@ -21,7 +21,6 @@ import jakarta.persistence.PersistenceContext;
|
||||
import jakarta.validation.Valid;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import org.hibernate.query.Query;
|
||||
@@ -187,7 +186,6 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||
whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(mngYyyy));
|
||||
|
||||
|
||||
MapSheetMngDto.MngDto foundContent =
|
||||
queryFactory
|
||||
.select(
|
||||
@@ -394,39 +392,39 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
whereBuilder.and(mapSheetMngHstEntity.hstUid.eq(hstUid));
|
||||
|
||||
MapSheetMngDto.ErrorDataDto foundContent =
|
||||
queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
MapSheetMngDto.ErrorDataDto.class,
|
||||
mapSheetMngHstEntity.hstUid,
|
||||
mapSheetMngHstEntity.mngYyyy,
|
||||
mapSheetMngHstEntity.mapSheetNum,
|
||||
mapSheetMngHstEntity.refMapSheetNum,
|
||||
Expressions.stringTemplate(
|
||||
"concat({0},substring({1}, 0, 6))",
|
||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||
.as("map50kName"),
|
||||
Expressions.stringTemplate(
|
||||
"concat({0},substring({1}, 6, 8))",
|
||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||
.as("map5kName"),
|
||||
Expressions.stringTemplate(
|
||||
"concat({0},substring({1}, 6, 8))",
|
||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||
.as("mapSrcName"),
|
||||
mapInkx5kEntity.fid,
|
||||
mapSheetMngHstEntity.createdDate,
|
||||
mapSheetMngHstEntity.syncState,
|
||||
mapSheetMngHstEntity.syncTfwFileName,
|
||||
mapSheetMngHstEntity.syncTifFileName,
|
||||
mapSheetMngHstEntity.syncCheckState,
|
||||
mapSheetMngHstEntity.syncCheckTfwFileName,
|
||||
mapSheetMngHstEntity.syncCheckTifFileName))
|
||||
.from(mapSheetMngHstEntity)
|
||||
.innerJoin(mapInkx5kEntity)
|
||||
.on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
|
||||
.where(whereBuilder)
|
||||
.fetchOne();
|
||||
queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
MapSheetMngDto.ErrorDataDto.class,
|
||||
mapSheetMngHstEntity.hstUid,
|
||||
mapSheetMngHstEntity.mngYyyy,
|
||||
mapSheetMngHstEntity.mapSheetNum,
|
||||
mapSheetMngHstEntity.refMapSheetNum,
|
||||
Expressions.stringTemplate(
|
||||
"concat({0},substring({1}, 0, 6))",
|
||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||
.as("map50kName"),
|
||||
Expressions.stringTemplate(
|
||||
"concat({0},substring({1}, 6, 8))",
|
||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||
.as("map5kName"),
|
||||
Expressions.stringTemplate(
|
||||
"concat({0},substring({1}, 6, 8))",
|
||||
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum)
|
||||
.as("mapSrcName"),
|
||||
mapInkx5kEntity.fid,
|
||||
mapSheetMngHstEntity.createdDate,
|
||||
mapSheetMngHstEntity.syncState,
|
||||
mapSheetMngHstEntity.syncTfwFileName,
|
||||
mapSheetMngHstEntity.syncTifFileName,
|
||||
mapSheetMngHstEntity.syncCheckState,
|
||||
mapSheetMngHstEntity.syncCheckTfwFileName,
|
||||
mapSheetMngHstEntity.syncCheckTifFileName))
|
||||
.from(mapSheetMngHstEntity)
|
||||
.innerJoin(mapInkx5kEntity)
|
||||
.on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
|
||||
.where(whereBuilder)
|
||||
.fetchOne();
|
||||
|
||||
return foundContent;
|
||||
}
|
||||
@@ -518,27 +516,26 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
public MapSheetMngDto.MngFilesDto findIdToMapSheetFile(Long fileUid) {
|
||||
|
||||
MapSheetMngDto.MngFilesDto foundContent =
|
||||
queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
MapSheetMngDto.MngFilesDto.class,
|
||||
mapSheetMngFileEntity.fileUid,
|
||||
mapSheetMngFileEntity.mngYyyy,
|
||||
mapSheetMngFileEntity.mapSheetNum,
|
||||
mapSheetMngFileEntity.refMapSheetNum,
|
||||
mapSheetMngFileEntity.filePath,
|
||||
mapSheetMngFileEntity.fileName,
|
||||
mapSheetMngFileEntity.fileExt,
|
||||
mapSheetMngFileEntity.hstUid,
|
||||
mapSheetMngFileEntity.fileSize))
|
||||
.from(mapSheetMngFileEntity)
|
||||
.where(mapSheetMngFileEntity.fileUid.eq(fileUid))
|
||||
.fetchOne();
|
||||
queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
MapSheetMngDto.MngFilesDto.class,
|
||||
mapSheetMngFileEntity.fileUid,
|
||||
mapSheetMngFileEntity.mngYyyy,
|
||||
mapSheetMngFileEntity.mapSheetNum,
|
||||
mapSheetMngFileEntity.refMapSheetNum,
|
||||
mapSheetMngFileEntity.filePath,
|
||||
mapSheetMngFileEntity.fileName,
|
||||
mapSheetMngFileEntity.fileExt,
|
||||
mapSheetMngFileEntity.hstUid,
|
||||
mapSheetMngFileEntity.fileSize))
|
||||
.from(mapSheetMngFileEntity)
|
||||
.where(mapSheetMngFileEntity.fileUid.eq(fileUid))
|
||||
.fetchOne();
|
||||
|
||||
return foundContent;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void MapSheetMngComplete(int mngYyyy) {
|
||||
long execCount =
|
||||
@@ -551,22 +548,19 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
|
||||
@Override
|
||||
public void updateMapSheetMngHstSyncCheckState(
|
||||
Long hstUid,
|
||||
String uploadPath,
|
||||
String syncCheckTfwFileName,
|
||||
String syncCheckTifFileName){
|
||||
Long hstUid, String uploadPath, String syncCheckTfwFileName, String syncCheckTifFileName) {
|
||||
|
||||
long execCount =
|
||||
queryFactory
|
||||
.update(mapSheetMngHstEntity)
|
||||
.set(mapSheetMngHstEntity.syncCheckState, "DONE")
|
||||
.set(mapSheetMngHstEntity.mapSheetPath, uploadPath)
|
||||
.set(mapSheetMngHstEntity.syncCheckTfwFileName, syncCheckTfwFileName)
|
||||
.set(mapSheetMngHstEntity.syncCheckTifFileName, syncCheckTifFileName)
|
||||
.set(mapSheetMngHstEntity.syncCheckStrtDttm, ZonedDateTime.now())
|
||||
.set(mapSheetMngHstEntity.syncCheckEndDttm, ZonedDateTime.now())
|
||||
.where(mapSheetMngHstEntity.hstUid.eq(hstUid))
|
||||
.execute();
|
||||
queryFactory
|
||||
.update(mapSheetMngHstEntity)
|
||||
.set(mapSheetMngHstEntity.syncCheckState, "DONE")
|
||||
.set(mapSheetMngHstEntity.mapSheetPath, uploadPath)
|
||||
.set(mapSheetMngHstEntity.syncCheckTfwFileName, syncCheckTfwFileName)
|
||||
.set(mapSheetMngHstEntity.syncCheckTifFileName, syncCheckTifFileName)
|
||||
.set(mapSheetMngHstEntity.syncCheckStrtDttm, ZonedDateTime.now())
|
||||
.set(mapSheetMngHstEntity.syncCheckEndDttm, ZonedDateTime.now())
|
||||
.where(mapSheetMngHstEntity.hstUid.eq(hstUid))
|
||||
.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -624,10 +618,10 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
@Override
|
||||
public void deleteByHstUidMngFile(Long hstUid) {
|
||||
long deletedFileCount =
|
||||
queryFactory
|
||||
.delete(mapSheetMngFileEntity)
|
||||
.where(mapSheetMngFileEntity.fileUid.eq(hstUid))
|
||||
.execute();
|
||||
queryFactory
|
||||
.delete(mapSheetMngFileEntity)
|
||||
.where(mapSheetMngFileEntity.fileUid.eq(hstUid))
|
||||
.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -640,33 +634,31 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq){
|
||||
public void mngFileSave(@Valid MapSheetMngDto.MngFileAddReq addReq) {
|
||||
long fileCount =
|
||||
queryFactory
|
||||
.insert(mapSheetMngFileEntity)
|
||||
.columns(
|
||||
mapSheetMngFileEntity.mngYyyy,
|
||||
mapSheetMngFileEntity.mapSheetNum,
|
||||
mapSheetMngFileEntity.refMapSheetNum,
|
||||
mapSheetMngFileEntity.filePath,
|
||||
mapSheetMngFileEntity.fileName,
|
||||
mapSheetMngFileEntity.fileExt,
|
||||
mapSheetMngFileEntity.hstUid,
|
||||
mapSheetMngFileEntity.fileSize,
|
||||
mapSheetMngFileEntity.fileState
|
||||
)
|
||||
.values(
|
||||
addReq.getMngYyyy(),
|
||||
addReq.getMapSheetNum(),
|
||||
addReq.getRefMapSheetNum(),
|
||||
addReq.getFilePath(),
|
||||
addReq.getFileName(),
|
||||
addReq.getFileExt(),
|
||||
addReq.getHstUid(),
|
||||
addReq.getFileSize(),
|
||||
addReq.getFileState()
|
||||
)
|
||||
.execute();
|
||||
queryFactory
|
||||
.insert(mapSheetMngFileEntity)
|
||||
.columns(
|
||||
mapSheetMngFileEntity.mngYyyy,
|
||||
mapSheetMngFileEntity.mapSheetNum,
|
||||
mapSheetMngFileEntity.refMapSheetNum,
|
||||
mapSheetMngFileEntity.filePath,
|
||||
mapSheetMngFileEntity.fileName,
|
||||
mapSheetMngFileEntity.fileExt,
|
||||
mapSheetMngFileEntity.hstUid,
|
||||
mapSheetMngFileEntity.fileSize,
|
||||
mapSheetMngFileEntity.fileState)
|
||||
.values(
|
||||
addReq.getMngYyyy(),
|
||||
addReq.getMapSheetNum(),
|
||||
addReq.getRefMapSheetNum(),
|
||||
addReq.getFilePath(),
|
||||
addReq.getFileName(),
|
||||
addReq.getFileExt(),
|
||||
addReq.getHstUid(),
|
||||
addReq.getFileSize(),
|
||||
addReq.getFileState())
|
||||
.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user