영상관리 추가 및 수정
This commit is contained in:
@@ -26,8 +26,6 @@ public class MapSheetMngApiController {
|
|||||||
private final CommonCodeService commonCodeService;
|
private final CommonCodeService commonCodeService;
|
||||||
private final MapSheetMngService mapSheetMngService;
|
private final MapSheetMngService mapSheetMngService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "영상데이터관리목록 조회", description = "영상데이터관리목록 조회")
|
@Operation(summary = "영상데이터관리목록 조회", description = "영상데이터관리목록 조회")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
@@ -67,8 +65,6 @@ public class MapSheetMngApiController {
|
|||||||
return ApiResponseDto.ok(mapSheetMngService.mngDataSave(AddReq));
|
return ApiResponseDto.ok(mapSheetMngService.mngDataSave(AddReq));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 오류데이터 목록 조회
|
* 오류데이터 목록 조회
|
||||||
*
|
*
|
||||||
@@ -77,11 +73,10 @@ public class MapSheetMngApiController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/error-list")
|
@PostMapping("/error-list")
|
||||||
public ApiResponseDto<Page<MapSheetMngDto.ErrorDataDto>> findMapSheetErrorList(
|
public ApiResponseDto<Page<MapSheetMngDto.ErrorDataDto>> findMapSheetErrorList(
|
||||||
@RequestBody @Valid MapSheetMngDto.ErrorSearchReq searchReq) {
|
@RequestBody @Valid MapSheetMngDto.ErrorSearchReq searchReq) {
|
||||||
return ApiResponseDto.ok(mapSheetMngService.findMapSheetErrorList(searchReq));
|
return ApiResponseDto.ok(mapSheetMngService.findMapSheetErrorList(searchReq));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param hstUidList
|
* @param hstUidList
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ public class MapSheetMngDto {
|
|||||||
@JsonFormatDttm private ZonedDateTime rgstEndDttm;
|
@JsonFormatDttm private ZonedDateTime rgstEndDttm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Schema(name = "ErrorSearchReq", description = "영상관리 오류데이터 검색 요청")
|
@Schema(name = "ErrorSearchReq", description = "영상관리 오류데이터 검색 요청")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -109,15 +108,13 @@ public class MapSheetMngDto {
|
|||||||
String[] sortParams = sort.split(",");
|
String[] sortParams = sort.split(",");
|
||||||
String property = sortParams[0];
|
String property = sortParams[0];
|
||||||
Sort.Direction direction =
|
Sort.Direction direction =
|
||||||
sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC;
|
sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC;
|
||||||
return PageRequest.of(page, size, Sort.by(direction, property));
|
return PageRequest.of(page, size, Sort.by(direction, property));
|
||||||
}
|
}
|
||||||
return PageRequest.of(page, size);
|
return PageRequest.of(page, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(name = "ErrorDataDto", description = "영상관리 오류데이터 검색 리턴")
|
@Schema(name = "ErrorDataDto", description = "영상관리 오류데이터 검색 리턴")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -133,11 +130,6 @@ public class MapSheetMngDto {
|
|||||||
private DataState dataState;
|
private DataState dataState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(name = "DmlReturn", description = "영상관리 DML 수행 후 리턴")
|
@Schema(name = "DmlReturn", description = "영상관리 DML 수행 후 리턴")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|||||||
@@ -218,8 +218,7 @@ public class MapSheetMngService {
|
|||||||
return mapSheetMngCoreService.findMapSheetErrorList(searchReq);
|
return mapSheetMngCoreService.findMapSheetErrorList(searchReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(
|
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(MapSheetMngDto.MngSearchReq searchReq) {
|
||||||
MapSheetMngDto.MngSearchReq searchReq) {
|
|
||||||
return mapSheetMngCoreService.findMapSheetMngList(searchReq);
|
return mapSheetMngCoreService.findMapSheetMngList(searchReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -133,7 +132,7 @@ public class MapSheetMngCoreService {
|
|||||||
entity.setMngYyyy(addReq.getMngYyyy());
|
entity.setMngYyyy(addReq.getMngYyyy());
|
||||||
entity.setMngPath(addReq.getMngPath());
|
entity.setMngPath(addReq.getMngPath());
|
||||||
|
|
||||||
//mapSheetMngRepository.deleteMngAll(addReq.getMngYyyy());
|
// mapSheetMngRepository.deleteMngAll(addReq.getMngYyyy());
|
||||||
|
|
||||||
MapSheetMngEntity saved = mapSheetMngRepository.save(entity);
|
MapSheetMngEntity saved = mapSheetMngRepository.save(entity);
|
||||||
int hstCnt = mapSheetMngRepository.insertMapSheetOrgDataToMapSheetMngHst(saved.getMngYyyy());
|
int hstCnt = mapSheetMngRepository.insertMapSheetOrgDataToMapSheetMngHst(saved.getMngYyyy());
|
||||||
|
|||||||
@@ -50,5 +50,4 @@ public class MapSheetMngFileEntity {
|
|||||||
|
|
||||||
@Column(name = "hst_uid")
|
@Column(name = "hst_uid")
|
||||||
private Long hstUid;
|
private Long hstUid;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import org.springframework.data.domain.Page;
|
|||||||
|
|
||||||
public interface MapSheetMngRepositoryCustom {
|
public interface MapSheetMngRepositoryCustom {
|
||||||
|
|
||||||
|
|
||||||
Page<MapSheetMngDto.MngDto> findMapSheetMngList(MapSheetMngDto.MngSearchReq searchReq);
|
Page<MapSheetMngDto.MngDto> findMapSheetMngList(MapSheetMngDto.MngSearchReq searchReq);
|
||||||
|
|
||||||
Optional<MapSheetMngHstEntity> findMapSheetMngHstInfo(Long hstUid);
|
Optional<MapSheetMngHstEntity> findMapSheetMngHstInfo(Long hstUid);
|
||||||
@@ -18,5 +17,5 @@ public interface MapSheetMngRepositoryCustom {
|
|||||||
void deleteMngAll(int mngYyyy);
|
void deleteMngAll(int mngYyyy);
|
||||||
|
|
||||||
Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||||
MapSheetMngDto.@Valid ErrorSearchReq searchReq);
|
MapSheetMngDto.@Valid ErrorSearchReq searchReq);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,18 +34,15 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
private final JPAQueryFactory queryFactory;
|
private final JPAQueryFactory queryFactory;
|
||||||
private final StringExpression NULL_STRING = Expressions.stringTemplate("cast(null as text)");
|
private final StringExpression NULL_STRING = Expressions.stringTemplate("cast(null as text)");
|
||||||
|
|
||||||
@PersistenceContext
|
@PersistenceContext private EntityManager em;
|
||||||
private EntityManager em;
|
|
||||||
|
|
||||||
public MapSheetMngRepositoryImpl(JPAQueryFactory queryFactory) {
|
public MapSheetMngRepositoryImpl(JPAQueryFactory queryFactory) {
|
||||||
super(MapSheetMngHstEntity.class);
|
super(MapSheetMngHstEntity.class);
|
||||||
this.queryFactory = queryFactory;
|
this.queryFactory = queryFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(
|
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(MapSheetMngDto.MngSearchReq searchReq) {
|
||||||
MapSheetMngDto.MngSearchReq searchReq) {
|
|
||||||
|
|
||||||
Pageable pageable = searchReq.toPageable();
|
Pageable pageable = searchReq.toPageable();
|
||||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||||
@@ -116,73 +113,67 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
return new PageImpl<>(foundContent, pageable, countQuery);
|
return new PageImpl<>(foundContent, pageable, countQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||||
MapSheetMngDto.@Valid ErrorSearchReq searchReq) {
|
MapSheetMngDto.@Valid ErrorSearchReq searchReq) {
|
||||||
|
|
||||||
Pageable pageable = PageRequest.of(searchReq.getPage(), searchReq.getSize());
|
Pageable pageable = PageRequest.of(searchReq.getPage(), searchReq.getSize());
|
||||||
List<MapSheetMngDto.ErrorDataDto> foundContent =
|
List<MapSheetMngDto.ErrorDataDto> foundContent =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
MapSheetMngDto.ErrorDataDto.class,
|
MapSheetMngDto.ErrorDataDto.class,
|
||||||
mapSheetMngHstEntity.hstUid,
|
mapSheetMngHstEntity.hstUid,
|
||||||
rowNum(),
|
rowNum(),
|
||||||
Expressions.stringTemplate(
|
Expressions.stringTemplate(
|
||||||
"concat({0}, {1})",
|
"concat({0}, {1})",
|
||||||
mapSheetMngHstEntity.mapSheetName, mapInkx50kEntity.mapidcdNo),
|
mapSheetMngHstEntity.mapSheetName, mapInkx50kEntity.mapidcdNo),
|
||||||
Expressions.stringTemplate(
|
Expressions.stringTemplate(
|
||||||
"concat({0}, substring({1}, {2}, {3}))",
|
"concat({0}, substring({1}, {2}, {3}))",
|
||||||
mapSheetMngHstEntity.mapSheetName, mapSheetMngHstEntity.mapSheetNum, 6, 8),
|
mapSheetMngHstEntity.mapSheetName, mapSheetMngHstEntity.mapSheetNum, 6, 8),
|
||||||
mapSheetMngHstEntity.mapSheetCodeSrc,
|
mapSheetMngHstEntity.mapSheetCodeSrc,
|
||||||
Expressions.stringTemplate(
|
Expressions.stringTemplate(
|
||||||
"to_char({0}, 'YYYY-MM-DD')", mapSheetMngHstEntity.createdDate),
|
"to_char({0}, 'YYYY-MM-DD')", mapSheetMngHstEntity.createdDate),
|
||||||
mapSheetMngHstEntity.dataState))
|
mapSheetMngHstEntity.dataState))
|
||||||
.from(mapSheetMngHstEntity)
|
.from(mapSheetMngHstEntity)
|
||||||
.innerJoin(mapInkx5kEntity)
|
.innerJoin(mapInkx5kEntity)
|
||||||
.on(mapSheetMngHstEntity.mapSheetCode.eq(mapInkx5kEntity.fid))
|
.on(mapSheetMngHstEntity.mapSheetCode.eq(mapInkx5kEntity.fid))
|
||||||
.leftJoin(mapInkx50kEntity)
|
.leftJoin(mapInkx50kEntity)
|
||||||
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
|
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
|
||||||
.where(
|
.where(
|
||||||
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
|
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
|
||||||
// mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
|
// mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
|
||||||
mapSheetErrorSearchValue(searchReq))
|
mapSheetErrorSearchValue(searchReq))
|
||||||
.offset(pageable.getOffset())
|
.offset(pageable.getOffset())
|
||||||
.limit(pageable.getPageSize())
|
.limit(pageable.getPageSize())
|
||||||
.orderBy(mapSheetMngHstEntity.createdDate.desc())
|
.orderBy(mapSheetMngHstEntity.createdDate.desc())
|
||||||
.fetch();
|
.fetch();
|
||||||
|
|
||||||
Long countQuery =
|
Long countQuery =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(mapSheetMngHstEntity.hstUid.count())
|
.select(mapSheetMngHstEntity.hstUid.count())
|
||||||
.from(mapSheetMngHstEntity)
|
.from(mapSheetMngHstEntity)
|
||||||
.innerJoin(mapInkx5kEntity)
|
.innerJoin(mapInkx5kEntity)
|
||||||
.on(mapSheetMngHstEntity.mapSheetCode.eq(mapInkx5kEntity.fid))
|
.on(mapSheetMngHstEntity.mapSheetCode.eq(mapInkx5kEntity.fid))
|
||||||
.leftJoin(mapInkx50kEntity)
|
.leftJoin(mapInkx50kEntity)
|
||||||
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
|
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
|
||||||
.where(
|
.where(
|
||||||
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
|
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
|
||||||
// mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
|
// mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
|
||||||
mapSheetErrorSearchValue(searchReq))
|
mapSheetErrorSearchValue(searchReq))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
return new PageImpl<>(foundContent, pageable, countQuery);
|
return new PageImpl<>(foundContent, pageable, countQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteMngAll(int mngYyyy){
|
public void deleteMngAll(int mngYyyy) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertMapSheetOrgDataToMapSheetMngHst(int mngYyyy) {
|
public int insertMapSheetOrgDataToMapSheetMngHst(int mngYyyy) {
|
||||||
|
|
||||||
String sql = """
|
String sql =
|
||||||
|
"""
|
||||||
INSERT INTO tb_map_sheet_mng_hst
|
INSERT INTO tb_map_sheet_mng_hst
|
||||||
(
|
(
|
||||||
mng_yyyy
|
mng_yyyy
|
||||||
@@ -214,7 +205,6 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
int exeCnt = query.executeUpdate(); // 실행 (영향받은 행의 개수 반환)
|
int exeCnt = query.executeUpdate(); // 실행 (영향받은 행의 개수 반환)
|
||||||
|
|
||||||
return exeCnt;
|
return exeCnt;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -226,8 +216,6 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.fetchOne());
|
.fetchOne());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private NumberExpression<Integer> rowNum() {
|
private NumberExpression<Integer> rowNum() {
|
||||||
return Expressions.numberTemplate(
|
return Expressions.numberTemplate(
|
||||||
Integer.class, "row_number() over(order by {0} desc)", mapSheetMngHstEntity.createdDate);
|
Integer.class, "row_number() over(order by {0} desc)", mapSheetMngHstEntity.createdDate);
|
||||||
|
|||||||
Reference in New Issue
Block a user