영상관리 추가 수정
This commit is contained in:
@@ -40,10 +40,9 @@ public class MapSheetMngApiController {
|
|||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
})
|
})
|
||||||
@PostMapping("/mng-list")
|
@PostMapping("/mng-list")
|
||||||
public ApiResponseDto<Page<MapSheetMngDto.MngDto>> findMapSheetMngList(
|
public ApiResponseDto<List<MapSheetMngDto.MngDto>> findMapSheetMngList() {
|
||||||
@RequestBody MapSheetMngDto.MngSearchReq searchReq) {
|
|
||||||
|
|
||||||
return ApiResponseDto.ok(mapSheetMngService.findMapSheetMngList(searchReq));
|
return ApiResponseDto.ok(mapSheetMngService.findMapSheetMngList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "영상데이터관리 상세", description = "영상데이터관리 상세")
|
@Operation(summary = "영상데이터관리 상세", description = "영상데이터관리 상세")
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ public class MapSheetMngDto {
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
|
||||||
public static class ErrorDataDto {
|
public static class ErrorDataDto {
|
||||||
// private Integer rowNum;
|
// private Integer rowNum;
|
||||||
private Long hstUid;
|
private Long hstUid;
|
||||||
@@ -163,10 +162,12 @@ public class MapSheetMngDto {
|
|||||||
private String syncState;
|
private String syncState;
|
||||||
private String syncCheckState;
|
private String syncCheckState;
|
||||||
|
|
||||||
private Long fileUid;
|
//private Long fileUid;
|
||||||
private String fileName;
|
private String tfwFileName;
|
||||||
|
private String tifFileName;
|
||||||
|
|
||||||
|
//private List<MngFIleDto> fileArray;
|
||||||
|
|
||||||
private List<MngFIleDto> fileArray;
|
|
||||||
|
|
||||||
public ErrorDataDto(
|
public ErrorDataDto(
|
||||||
Long hstUid,
|
Long hstUid,
|
||||||
@@ -176,7 +177,9 @@ public class MapSheetMngDto {
|
|||||||
Integer mapCodeSrc,
|
Integer mapCodeSrc,
|
||||||
ZonedDateTime createdDttm,
|
ZonedDateTime createdDttm,
|
||||||
String syncState,
|
String syncState,
|
||||||
String syncCheckState) {
|
String syncCheckState,
|
||||||
|
String tfwFileName,
|
||||||
|
String tifFileName) {
|
||||||
this.hstUid = hstUid;
|
this.hstUid = hstUid;
|
||||||
this.map50kName = map50kName;
|
this.map50kName = map50kName;
|
||||||
this.map5kName = map5kName;
|
this.map5kName = map5kName;
|
||||||
@@ -185,6 +188,8 @@ public class MapSheetMngDto {
|
|||||||
this.createdDttm = createdDttm;
|
this.createdDttm = createdDttm;
|
||||||
this.syncState = syncState;
|
this.syncState = syncState;
|
||||||
this.syncCheckState = syncCheckState;
|
this.syncCheckState = syncCheckState;
|
||||||
|
this.tfwFileName = tfwFileName;
|
||||||
|
this.tifFileName = tifFileName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -213,8 +213,8 @@ public class MapSheetMngService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(MapSheetMngDto.MngSearchReq searchReq) {
|
public List<MapSheetMngDto.MngDto> findMapSheetMngList() {
|
||||||
return mapSheetMngCoreService.findMapSheetMngList(searchReq);
|
return mapSheetMngCoreService.findMapSheetMngList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
|
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
|
||||||
|
|||||||
@@ -37,9 +37,8 @@ public class MapSheetMngCoreService {
|
|||||||
return mapSheetMngRepository.findMapSheetErrorList(searchReq);
|
return mapSheetMngRepository.findMapSheetErrorList(searchReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(
|
public List<MapSheetMngDto.MngDto> findMapSheetMngList() {
|
||||||
MapSheetMngDto.@Valid MngSearchReq searchReq) {
|
return mapSheetMngRepository.findMapSheetMngList();
|
||||||
return mapSheetMngRepository.findMapSheetMngList(searchReq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
|
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.repository.mapsheet;
|
package com.kamco.cd.kamcoback.postgres.repository.mapsheet;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
|
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
|
||||||
|
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngDto;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
|
|
||||||
public interface MapSheetMngRepositoryCustom {
|
public interface MapSheetMngRepositoryCustom {
|
||||||
|
|
||||||
Page<MapSheetMngDto.MngDto> findMapSheetMngList(MapSheetMngDto.MngSearchReq searchReq);
|
List<MapSheetMngDto.MngDto> findMapSheetMngList();
|
||||||
|
|
||||||
MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy);
|
MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy);
|
||||||
|
|
||||||
|
|||||||
@@ -47,14 +47,14 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(MapSheetMngDto.MngSearchReq searchReq) {
|
public List<MapSheetMngDto.MngDto> findMapSheetMngList() {
|
||||||
|
|
||||||
Pageable pageable = searchReq.toPageable();
|
//Pageable pageable = searchReq.toPageable();
|
||||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||||
|
|
||||||
if (searchReq.getMngYyyy() != null) {
|
//if (searchReq.getMngYyyy() != null) {
|
||||||
whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(searchReq.getMngYyyy()));
|
//whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(searchReq.getMngYyyy()));
|
||||||
}
|
//}
|
||||||
|
|
||||||
NumberExpression<Long> totalCount = mapSheetMngHstEntity.count().as("syncTotCnt");
|
NumberExpression<Long> totalCount = mapSheetMngHstEntity.count().as("syncTotCnt");
|
||||||
|
|
||||||
@@ -155,9 +155,9 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.leftJoin(mapSheetMngHstEntity)
|
.leftJoin(mapSheetMngHstEntity)
|
||||||
.on(mapSheetMngEntity.mngYyyy.eq(mapSheetMngHstEntity.mngYyyy))
|
.on(mapSheetMngEntity.mngYyyy.eq(mapSheetMngHstEntity.mngYyyy))
|
||||||
.where(whereBuilder)
|
.where(whereBuilder)
|
||||||
.offset(pageable.getOffset())
|
//.offset(pageable.getOffset())
|
||||||
.limit(pageable.getPageSize())
|
//.limit(pageable.getPageSize())
|
||||||
.orderBy(mapSheetMngEntity.createdDttm.desc())
|
.orderBy(mapSheetMngEntity.mngYyyy.desc())
|
||||||
.groupBy(mapSheetMngEntity.mngYyyy)
|
.groupBy(mapSheetMngEntity.mngYyyy)
|
||||||
.fetch();
|
.fetch();
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.where(whereBuilder)
|
.where(whereBuilder)
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
return new PageImpl<>(foundContent, pageable, countQuery);
|
return foundContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy){
|
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy){
|
||||||
@@ -322,86 +322,46 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.likeIgnoreCase("%" + searchReq.getSearchValue() + "%")));
|
.likeIgnoreCase("%" + searchReq.getSearchValue() + "%")));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Tuple> tuples =
|
List<MapSheetMngDto.ErrorDataDto> foundContent =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
mapSheetMngHstEntity.hstUid,
|
Projections.constructor(
|
||||||
mapSheetMngHstEntity.mapSheetName,
|
MapSheetMngDto.ErrorDataDto.class,
|
||||||
mapInkx5kEntity.mapidNm,
|
mapSheetMngHstEntity.hstUid,
|
||||||
mapSheetMngHstEntity.mapSheetNum,
|
Expressions.stringTemplate(
|
||||||
mapSheetMngHstEntity.mapSheetCodeSrc,
|
"concat({0},substring({1}, 0, 6))",
|
||||||
mapSheetMngHstEntity.createdDate,
|
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum).as("map50kName"),
|
||||||
mapSheetMngHstEntity.syncState,
|
Expressions.stringTemplate(
|
||||||
mapSheetMngHstEntity.syncCheckState,
|
"concat({0},substring({1}, 6, 8))",
|
||||||
mapSheetMngFileEntity.fileUid,
|
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum).as("map5kName"),
|
||||||
mapSheetMngFileEntity.filePath,
|
Expressions.stringTemplate(
|
||||||
mapSheetMngFileEntity.fileName,
|
"concat({0},substring({1}, 6, 8))",
|
||||||
mapSheetMngFileEntity.fileSize,
|
mapInkx5kEntity.mapidNm, mapSheetMngHstEntity.mapSheetNum).as("mapSrcName"),
|
||||||
mapSheetMngFileEntity.fileState)
|
mapInkx5kEntity.fid,
|
||||||
.from(mapSheetMngHstEntity)
|
mapSheetMngHstEntity.createdDate,
|
||||||
.innerJoin(mapInkx5kEntity)
|
mapSheetMngHstEntity.syncState,
|
||||||
.on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
|
mapSheetMngHstEntity.syncCheckState,
|
||||||
.leftJoin(mapSheetMngFileEntity)
|
Expressions.stringTemplate(
|
||||||
.on(mapSheetMngFileEntity.hstUid.eq(mapSheetMngHstEntity.hstUid))
|
"MAX(CASE WHEN {0} = 'tfw' THEN {1} END)",
|
||||||
.where(whereBuilder)
|
mapSheetMngFileEntity.fileExt, mapSheetMngFileEntity.fileName
|
||||||
.orderBy(mapSheetMngHstEntity.createdDate.desc())
|
),
|
||||||
.offset(pageable.getOffset())
|
Expressions.stringTemplate(
|
||||||
.limit(pageable.getPageSize())
|
"MAX(CASE WHEN {0} = 'tif' THEN {1} END)",
|
||||||
.fetch();
|
mapSheetMngFileEntity.fileExt, mapSheetMngFileEntity.fileName
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.from(mapSheetMngHstEntity)
|
||||||
|
.innerJoin(mapInkx5kEntity).on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
|
||||||
|
.leftJoin(mapSheetMngFileEntity).on(mapSheetMngHstEntity.hstUid.eq(mapSheetMngFileEntity.hstUid))
|
||||||
|
.where(whereBuilder)
|
||||||
|
.groupBy(mapSheetMngHstEntity.hstUid, mapInkx5kEntity.fid, mapInkx5kEntity.mapidNm)
|
||||||
|
.orderBy(mapSheetMngHstEntity.createdDate.desc())
|
||||||
|
.offset(pageable.getOffset())
|
||||||
|
.limit(pageable.getPageSize())
|
||||||
|
.fetch();
|
||||||
|
|
||||||
Map<Long, MapSheetMngDto.ErrorDataDto> resultMap = new LinkedHashMap<>();
|
|
||||||
|
|
||||||
for (Tuple t : tuples) {
|
|
||||||
|
|
||||||
Long hstUid = t.get(mapSheetMngHstEntity.hstUid);
|
|
||||||
|
|
||||||
MapSheetMngDto.ErrorDataDto dto =
|
|
||||||
resultMap.computeIfAbsent(
|
|
||||||
hstUid,
|
|
||||||
id -> {
|
|
||||||
String map50kName =
|
|
||||||
t.get(mapSheetMngHstEntity.mapSheetName)
|
|
||||||
+ t.get(mapSheetMngHstEntity.mapSheetNum).substring(0, 5);
|
|
||||||
|
|
||||||
String map5kName =
|
|
||||||
t.get(mapSheetMngHstEntity.mapSheetName)
|
|
||||||
+ t.get(mapSheetMngHstEntity.mapSheetNum).substring(5, 8);
|
|
||||||
|
|
||||||
String mapSrcName =
|
|
||||||
t.get(mapSheetMngHstEntity.mapSheetName)
|
|
||||||
+ t.get(mapSheetMngHstEntity.mapSheetNum).substring(5, 8);
|
|
||||||
|
|
||||||
MapSheetMngDto.ErrorDataDto newDto =
|
|
||||||
new MapSheetMngDto.ErrorDataDto(
|
|
||||||
id,
|
|
||||||
map50kName,
|
|
||||||
map5kName,
|
|
||||||
mapSrcName,
|
|
||||||
t.get(mapSheetMngHstEntity.mapSheetCodeSrc),
|
|
||||||
t.get(mapSheetMngHstEntity.createdDate),
|
|
||||||
t.get(mapSheetMngHstEntity.syncState),
|
|
||||||
t.get(mapSheetMngHstEntity.syncCheckState));
|
|
||||||
|
|
||||||
newDto.setFileArray(new ArrayList<>());
|
|
||||||
return newDto;
|
|
||||||
});
|
|
||||||
|
|
||||||
// 파일 정보가 있는 경우만 추가
|
|
||||||
Long fileUid = t.get(mapSheetMngFileEntity.fileUid);
|
|
||||||
if (fileUid != null) {
|
|
||||||
MapSheetMngDto.MngFIleDto fileDto = new MapSheetMngDto.MngFIleDto();
|
|
||||||
fileDto.setFileUid(fileUid);
|
|
||||||
fileDto.setFilePath(t.get(mapSheetMngFileEntity.filePath));
|
|
||||||
fileDto.setFileName(t.get(mapSheetMngFileEntity.fileName));
|
|
||||||
fileDto.setFileSize(t.get(mapSheetMngFileEntity.fileSize));
|
|
||||||
fileDto.setFileState(t.get(mapSheetMngFileEntity.fileState));
|
|
||||||
fileDto.setHstUid(hstUid);
|
|
||||||
|
|
||||||
dto.getFileArray().add(fileDto);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<MapSheetMngDto.ErrorDataDto> foundContent = new ArrayList<>(resultMap.values());
|
|
||||||
|
|
||||||
Long countQuery =
|
Long countQuery =
|
||||||
queryFactory
|
queryFactory
|
||||||
|
|||||||
Reference in New Issue
Block a user