영상관리 수정
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.kamco.cd.kamcoback.postgres.core;
|
||||
|
||||
import com.kamco.cd.kamcoback.common.enums.MngStateType;
|
||||
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
|
||||
import com.kamco.cd.kamcoback.common.geometry.GeoJsonFileWriter;
|
||||
import com.kamco.cd.kamcoback.common.geometry.GeoJsonFileWriter.ImageFeature;
|
||||
@@ -20,6 +21,7 @@ import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -136,6 +138,15 @@ public class MapSheetMngCoreService {
|
||||
MapSheetMngEntity entity = new MapSheetMngEntity();
|
||||
entity.setMngYyyy(addReq.getMngYyyy());
|
||||
entity.setMngPath(addReq.getMngPath());
|
||||
entity.setMngState(MngStateType.NOTYET.name());
|
||||
entity.setSyncState(MngStateType.NOTYET.name());
|
||||
entity.setSyncCheckState(MngStateType.NOTYET.name());
|
||||
entity.setMngStateDttm(ZonedDateTime.now());
|
||||
entity.setCreatedDttm(ZonedDateTime.now());
|
||||
entity.setUpdatedDttm(ZonedDateTime.now());
|
||||
entity.setSyncStateDttm(ZonedDateTime.now());
|
||||
entity.setCreatedUid(addReq.getCreatedUid());
|
||||
entity.setUpdatedUid(addReq.getCreatedUid());
|
||||
|
||||
mapSheetMngRepository.deleteByMngYyyyMngAll(addReq.getMngYyyy());
|
||||
|
||||
|
||||
@@ -51,4 +51,19 @@ public class MapSheetMngFileJobCoreService {
|
||||
|
||||
return new MapSheetMngDto.DmlReturn("success", saved.getFileUid().toString());
|
||||
}
|
||||
|
||||
public Long findByMngYyyyTargetMapSheetNotYetCount(int mngYyyy){
|
||||
return mapSheetMngFileJobRepository.findByMngYyyyTargetMapSheetNotYetCount(mngYyyy);
|
||||
}
|
||||
|
||||
public void mngDataState(int mngYyyy, String mngState)
|
||||
{
|
||||
mapSheetMngFileJobRepository.mngDataState(mngYyyy, mngState);
|
||||
}
|
||||
|
||||
public Integer findNotYetMapSheetMng()
|
||||
{
|
||||
return mapSheetMngFileJobRepository.findNotYetMapSheetMng();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,4 +12,10 @@ public interface MapSheetMngFileJobRepositoryCustom {
|
||||
void mngHstDataSyncStateUpdate(MapSheetMngDto.MngHstDto updateReq);
|
||||
|
||||
List<MngHstDto> findTargetMapSheetFileList(long targetNum, int pageSize);
|
||||
|
||||
Long findByMngYyyyTargetMapSheetNotYetCount(int mngYyyy);
|
||||
|
||||
public void mngDataState(int mngYyyy, String mngState);
|
||||
|
||||
public Integer findNotYetMapSheetMng();
|
||||
}
|
||||
|
||||
@@ -34,6 +34,20 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
|
||||
this.queryFactory = queryFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer findNotYetMapSheetMng(){
|
||||
Integer countQuery =
|
||||
queryFactory
|
||||
.select(mapSheetMngEntity.mngYyyy)
|
||||
.from(mapSheetMngEntity)
|
||||
.where(mapSheetMngEntity.mngState.eq("NOTYET")
|
||||
.or(mapSheetMngEntity.mngState.eq("PROCESSING")))
|
||||
.limit(1)
|
||||
.fetchOne();
|
||||
|
||||
return countQuery;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(MapSheetMngDto.MngSearchReq searchReq) {
|
||||
|
||||
@@ -106,6 +120,30 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
|
||||
return new PageImpl<>(foundContent, pageable, countQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long findByMngYyyyTargetMapSheetNotYetCount(int mngYyyy){
|
||||
Long countQuery =
|
||||
queryFactory
|
||||
.select(mapSheetMngHstEntity.mngYyyy.count())
|
||||
.from(mapSheetMngHstEntity)
|
||||
.where(mapSheetMngHstEntity.mngYyyy.eq(mngYyyy)
|
||||
.and(mapSheetMngHstEntity.syncState.eq("NOTYET")))
|
||||
.fetchOne();
|
||||
|
||||
return countQuery;
|
||||
}
|
||||
|
||||
public void mngDataState(int mngYyyy, String mngState){
|
||||
long updateCount =
|
||||
queryFactory
|
||||
.update(mapSheetMngEntity)
|
||||
.set(mapSheetMngEntity.mngState, mngState)
|
||||
.set(mapSheetMngEntity.syncState, mngState)
|
||||
.set(mapSheetMngEntity.syncCheckState, mngState)
|
||||
.where(mapSheetMngEntity.mngYyyy.eq(mngYyyy))
|
||||
.execute();
|
||||
}
|
||||
|
||||
public void mngHstDataSyncStateUpdate(MapSheetMngDto.MngHstDto updateReq) {
|
||||
|
||||
ZonedDateTime now = ZonedDateTime.now();
|
||||
@@ -118,7 +156,7 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
|
||||
.set(mapSheetMngHstEntity.dataStateDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncState, updateReq.getSyncState())
|
||||
.set(mapSheetMngHstEntity.syncEndDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncCheckState, "DONE")
|
||||
.set(mapSheetMngHstEntity.syncCheckState, "NOTYET")
|
||||
.set(mapSheetMngHstEntity.syncCheckStrtDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncCheckEndDttm, now)
|
||||
.where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid()))
|
||||
@@ -132,7 +170,7 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
|
||||
.set(mapSheetMngHstEntity.syncState, updateReq.getSyncState())
|
||||
.set(mapSheetMngHstEntity.syncStrtDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncEndDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncCheckState, "PROCESSING")
|
||||
.set(mapSheetMngHstEntity.syncCheckState, "NOTYET")
|
||||
.set(mapSheetMngHstEntity.syncCheckStrtDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncCheckEndDttm, now)
|
||||
.where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid()))
|
||||
|
||||
Reference in New Issue
Block a user