자동 추론제외, spotless 적용
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.kamco.cd.kamcoback.postgres.core;
|
||||
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngListCompareDto;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngFileEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.scheduler.MapSheetMngFileJobRepository;
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto;
|
||||
@@ -65,12 +64,12 @@ public class MapSheetMngFileJobCoreService {
|
||||
return mapSheetMngFileJobRepository.findNotYetMapSheetMng();
|
||||
}
|
||||
|
||||
public Long findByHstMapSheetBeforeYyyyListCount(int strtYyyy, int endYyyy, String mapSheetNum){
|
||||
return mapSheetMngFileJobRepository.findByHstMapSheetBeforeYyyyListCount(strtYyyy, endYyyy, mapSheetNum);
|
||||
public Long findByHstMapSheetBeforeYyyyListCount(int strtYyyy, int endYyyy, String mapSheetNum) {
|
||||
return mapSheetMngFileJobRepository.findByHstMapSheetBeforeYyyyListCount(
|
||||
strtYyyy, endYyyy, mapSheetNum);
|
||||
}
|
||||
|
||||
public void updateException5kMapSheet(String mapSheetNum){
|
||||
public void updateException5kMapSheet(String mapSheetNum) {
|
||||
mapSheetMngFileJobRepository.updateException5kMapSheet(mapSheetNum);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.scheduler;
|
||||
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngListCompareDto;
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto;
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto.MngHstDto;
|
||||
import java.util.List;
|
||||
|
||||
@@ -5,7 +5,6 @@ import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngEntity.mapSheet
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngHstEntity.mapSheetMngHstEntity;
|
||||
|
||||
import com.kamco.cd.kamcoback.common.enums.CommonUseStatus;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngListCompareDto;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto;
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto.MngHstDto;
|
||||
@@ -18,7 +17,6 @@ import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
@@ -238,28 +236,33 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
|
||||
public Long findByHstMapSheetBeforeYyyyListCount(int strtYyyy, int endYyyy, String mapSheetNum) {
|
||||
|
||||
Long countQuery =
|
||||
queryFactory
|
||||
.select(mapSheetMngHstEntity.mngYyyy.count())
|
||||
.from(mapSheetMngHstEntity)
|
||||
.where(mapSheetMngHstEntity.mngYyyy.goe(strtYyyy)
|
||||
.and(mapSheetMngHstEntity.mngYyyy.loe(endYyyy))
|
||||
.and(mapSheetMngHstEntity.mapSheetNum.eq(mapSheetNum))
|
||||
.and(mapSheetMngHstEntity.useInference.eq("USE"))
|
||||
.and(mapSheetMngHstEntity.syncState.eq("DONE")
|
||||
.or(mapSheetMngHstEntity.syncCheckState.eq("DONE")))
|
||||
)
|
||||
.fetchOne();
|
||||
queryFactory
|
||||
.select(mapSheetMngHstEntity.mngYyyy.count())
|
||||
.from(mapSheetMngHstEntity)
|
||||
.where(
|
||||
mapSheetMngHstEntity
|
||||
.mngYyyy
|
||||
.goe(strtYyyy)
|
||||
.and(mapSheetMngHstEntity.mngYyyy.loe(endYyyy))
|
||||
.and(mapSheetMngHstEntity.mapSheetNum.eq(mapSheetNum))
|
||||
.and(mapSheetMngHstEntity.useInference.eq("USE"))
|
||||
.and(
|
||||
mapSheetMngHstEntity
|
||||
.syncState
|
||||
.eq("DONE")
|
||||
.or(mapSheetMngHstEntity.syncCheckState.eq("DONE"))))
|
||||
.fetchOne();
|
||||
|
||||
return countQuery;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateException5kMapSheet(String mapSheetNum){
|
||||
public void updateException5kMapSheet(String mapSheetNum) {
|
||||
long updateCount =
|
||||
queryFactory
|
||||
.update(mapInkx5kEntity)
|
||||
.set(mapInkx5kEntity.useInference, CommonUseStatus.EXCEPT)
|
||||
.where(mapInkx5kEntity.mapidcdNo.eq(mapSheetNum))
|
||||
.execute();
|
||||
queryFactory
|
||||
.update(mapInkx5kEntity)
|
||||
.set(mapInkx5kEntity.useInference, CommonUseStatus.EXCEPT)
|
||||
.where(mapInkx5kEntity.mapidcdNo.eq(mapSheetNum))
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ public class MapSheetMngFileJobController {
|
||||
mapSheetMngFileJobService.checkMapSheetFileProcess(0, mngSyncPageSize);
|
||||
}
|
||||
|
||||
|
||||
@Scheduled(fixedDelay = 1000 * 5)
|
||||
public void mngFileSyncJob01() {
|
||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||
@@ -123,8 +122,6 @@ public class MapSheetMngFileJobController {
|
||||
mapSheetMngFileJobService.checkMapSheetFileProcess(9, mngSyncPageSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 3. 외부에서 플래그를 변경할 수 있는 Setter 메서드
|
||||
public void setSchedulerEnabled(boolean enabled) {
|
||||
this.isSchedulerEnabled = enabled;
|
||||
|
||||
@@ -4,11 +4,9 @@ import static java.lang.String.CASE_INSENSITIVE_ORDER;
|
||||
|
||||
import com.kamco.cd.kamcoback.common.utils.FIleChecker;
|
||||
import com.kamco.cd.kamcoback.common.utils.FIleChecker.Basic;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngListCompareDto;
|
||||
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngFileJobCoreService;
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.FileDto;
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.FileDto.SrchFilesDepthDto;
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto;
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto.DmlReturn;
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto.MngFileAddReq;
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.MapSheetMngDto.MngHstDto;
|
||||
@@ -55,8 +53,6 @@ public class MapSheetMngFileJobService {
|
||||
@Value("${file.sync-auto-exception-before-year-cnt}")
|
||||
private int syncAutoExceptionBeforeYearCnt;
|
||||
|
||||
|
||||
|
||||
public Integer checkMngFileSync() {
|
||||
return mapSheetMngFileJobCoreService.findNotYetMapSheetMng();
|
||||
}
|
||||
@@ -82,13 +78,14 @@ public class MapSheetMngFileJobService {
|
||||
|
||||
for (MngHstDto item : mapSheetFileNotYetList) {
|
||||
|
||||
//5K도엽 자동추론제외
|
||||
Long exceptCheckCnt = this.mapSheetAutoExceptionUpdate(item.getMngYyyy(), item.getMapSheetNum());
|
||||
// 5K도엽 자동추론제외
|
||||
Long exceptCheckCnt =
|
||||
this.mapSheetAutoExceptionUpdate(item.getMngYyyy(), item.getMapSheetNum());
|
||||
|
||||
// 도엽별 파일 체크 진행중으로 변경
|
||||
item.setDataState("PROCESSING");
|
||||
item.setUseInference("USE");
|
||||
if( exceptCheckCnt == 0 )item.setUseInference("EXCEPT");
|
||||
if (exceptCheckCnt == 0) item.setUseInference("EXCEPT");
|
||||
mngHstDataSyncStateUpdate(item);
|
||||
|
||||
// 1. MngHstDto 객체의 필드 값에 접근
|
||||
@@ -202,9 +199,6 @@ public class MapSheetMngFileJobService {
|
||||
item.setSyncState(syncState);
|
||||
|
||||
mngHstDataSyncStateUpdate(item);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Long notyetCnt = this.mngDataStateDoneUpdate(mngYyyy);
|
||||
@@ -235,24 +229,25 @@ public class MapSheetMngFileJobService {
|
||||
|
||||
public Long mapSheetAutoExceptionUpdate(int mngYyyy, String mapSheetNum) {
|
||||
|
||||
//2025년 이전 파일싱크는 무조건 이전3년이 존재하지 않으므로 자동추론제외를 진행하지 않는다.(전년도 파일이 무조건 존재하는 것으로 리턴)
|
||||
if( syncAutoExceptionStartYear > mngYyyy )return 1L;
|
||||
// 2025년 이전 파일싱크는 무조건 이전3년이 존재하지 않으므로 자동추론제외를 진행하지 않는다.(전년도 파일이 무조건 존재하는 것으로 리턴)
|
||||
if (syncAutoExceptionStartYear > mngYyyy) return 1L;
|
||||
|
||||
//List<String> mapSheetNums = new ArrayList<>();
|
||||
//mapSheetNums.add(mapSheetNum);
|
||||
// List<String> mapSheetNums = new ArrayList<>();
|
||||
// mapSheetNums.add(mapSheetNum);
|
||||
|
||||
int strtYyyy = mngYyyy - syncAutoExceptionBeforeYearCnt;
|
||||
int endYyyy = mngYyyy - 1;
|
||||
|
||||
//이전년도가 3개년인 도엽 확인
|
||||
Long beforeCnt = mapSheetMngFileJobCoreService.findByHstMapSheetBeforeYyyyListCount(strtYyyy, endYyyy, mapSheetNum);
|
||||
// 이전년도가 3개년인 도엽 확인
|
||||
Long beforeCnt =
|
||||
mapSheetMngFileJobCoreService.findByHstMapSheetBeforeYyyyListCount(
|
||||
strtYyyy, endYyyy, mapSheetNum);
|
||||
|
||||
System.out.println("mapSheetAutoExceptionUpdate mapSheetNum == " +mapSheetNum);
|
||||
System.out.println("mapSheetAutoExceptionUpdate strtYyyy == " +strtYyyy);
|
||||
System.out.println("mapSheetAutoExceptionUpdate endYyyy == " +endYyyy);
|
||||
System.out.println("mapSheetAutoExceptionUpdate beforeCnt == " +beforeCnt);
|
||||
if( beforeCnt == 0 )
|
||||
{
|
||||
System.out.println("mapSheetAutoExceptionUpdate mapSheetNum == " + mapSheetNum);
|
||||
System.out.println("mapSheetAutoExceptionUpdate strtYyyy == " + strtYyyy);
|
||||
System.out.println("mapSheetAutoExceptionUpdate endYyyy == " + endYyyy);
|
||||
System.out.println("mapSheetAutoExceptionUpdate beforeCnt == " + beforeCnt);
|
||||
if (beforeCnt == 0) {
|
||||
System.out.println("mapSheetAutoExceptionUpdate inference == 자동추론제외");
|
||||
mapSheetMngFileJobCoreService.updateException5kMapSheet(mapSheetNum);
|
||||
}
|
||||
@@ -268,9 +263,6 @@ public class MapSheetMngFileJobService {
|
||||
return mapSheetMngFileJobCoreService.findByMngYyyyTargetMapSheetNotYetCount(mngYyyy);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public DmlReturn mngHstDataSyncStateUpdate(MngHstDto UpdateReq) {
|
||||
return mapSheetMngFileJobCoreService.mngHstDataSyncStateUpdate(UpdateReq);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,8 @@ file:
|
||||
sync-root-dir: /kamco-nfs/images/
|
||||
sync-tmp-dir: ${file.sync-root-dir}/tmp
|
||||
sync-file-extention: tfw,tif
|
||||
sync-auto-exception-start-year: 2025
|
||||
sync-auto-exception-before-year-cnt: 3
|
||||
|
||||
#dataset-dir: D:/kamco-nfs/dataset/
|
||||
dataset-dir: /kamco-nfs/dataset/export/
|
||||
|
||||
Reference in New Issue
Block a user