영상관리 수정
This commit is contained in:
@@ -14,93 +14,118 @@ public class MapSheetMngFileJobController {
|
||||
|
||||
// 현재 상태 확인용 Getter
|
||||
@Getter private boolean isSchedulerEnabled = false;
|
||||
@Getter private boolean isFileSyncSchedulerEnabled = false;
|
||||
@Getter private int mngSyncPageSize = 20;
|
||||
|
||||
// 매일 새벽 3시에 실행 (초 분 시 일 월 요일)
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
public void mngFileSyncJob00() {
|
||||
// 파일싱크 진행여부 확인하기
|
||||
@Scheduled(fixedDelay = 1000 * 10)
|
||||
public void checkMngFileSync() {
|
||||
if (!isSchedulerEnabled) return;
|
||||
|
||||
System.out.println("mngFileSyncJob00 === " + System.currentTimeMillis());
|
||||
Integer mng = 0;
|
||||
// isFileSyncSchedulerEnabled = false;
|
||||
if(mapSheetMngFileJobService.checkMngFileSync() != null)
|
||||
{
|
||||
mng = mapSheetMngFileJobService.checkMngFileSync();
|
||||
this.isFileSyncSchedulerEnabled = true;
|
||||
System.out.println("MngFileSyncJob ON --> mngYyyy : "+ mng + ", currentTime : " + System.currentTimeMillis());
|
||||
}
|
||||
else{
|
||||
this.isFileSyncSchedulerEnabled = false;
|
||||
System.out.println("MngFileSyncJob OFF --> mngYyyy : "+ mng + ", currentTime : " + System.currentTimeMillis());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Scheduled(fixedDelay = 1000 * 5)
|
||||
public void mngFileSyncJob00() {
|
||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||
|
||||
System.out.println("mngFileSyncJob 00 Processing currentTime : " + System.currentTimeMillis());
|
||||
mapSheetMngFileJobService.checkMapSheetFileProcess(0, mngSyncPageSize);
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
@Scheduled(fixedDelay = 1000 * 5)
|
||||
public void mngFileSyncJob01() {
|
||||
if (!isSchedulerEnabled) return;
|
||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||
|
||||
System.out.println("mngFileSyncJob01 === " + System.currentTimeMillis());
|
||||
System.out.println("mngFileSyncJob 01 Processing currentTime : " + System.currentTimeMillis());
|
||||
mapSheetMngFileJobService.checkMapSheetFileProcess(1, mngSyncPageSize);
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
public void mngFileSyncJob02() {
|
||||
if (!isSchedulerEnabled) return;
|
||||
|
||||
System.out.println("mngFileSyncJob00 === " + System.currentTimeMillis());
|
||||
@Scheduled(fixedDelay = 1000 * 5)
|
||||
public void mngFileSyncJob02() {
|
||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||
|
||||
System.out.println("mngFileSyncJob 02 Processing currentTime : " + System.currentTimeMillis());
|
||||
mapSheetMngFileJobService.checkMapSheetFileProcess(2, mngSyncPageSize);
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
@Scheduled(fixedDelay = 1000 * 5)
|
||||
public void mngFileSyncJob03() {
|
||||
if (!isSchedulerEnabled) return;
|
||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||
|
||||
System.out.println("mngFileSyncJob03 === " + System.currentTimeMillis());
|
||||
System.out.println("mngFileSyncJob 03 Processing currentTime : " + System.currentTimeMillis());
|
||||
mapSheetMngFileJobService.checkMapSheetFileProcess(3, mngSyncPageSize);
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
@Scheduled(fixedDelay = 1000 * 5)
|
||||
public void mngFileSyncJob04() {
|
||||
if (!isSchedulerEnabled) return;
|
||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||
|
||||
System.out.println("mngFileSyncJob04 === " + System.currentTimeMillis());
|
||||
System.out.println("mngFileSyncJob 04 Processing currentTime : " + System.currentTimeMillis());
|
||||
mapSheetMngFileJobService.checkMapSheetFileProcess(4, mngSyncPageSize);
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
@Scheduled(fixedDelay = 1000 * 5)
|
||||
public void mngFileSyncJob05() {
|
||||
if (!isSchedulerEnabled) return;
|
||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||
|
||||
System.out.println("mngFileSyncJob05 === " + System.currentTimeMillis());
|
||||
System.out.println("mngFileSyncJob 05 Processing currentTime : " + System.currentTimeMillis());
|
||||
mapSheetMngFileJobService.checkMapSheetFileProcess(5, mngSyncPageSize);
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
@Scheduled(fixedDelay = 1000 * 5)
|
||||
public void mngFileSyncJob06() {
|
||||
if (!isSchedulerEnabled) return;
|
||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||
|
||||
System.out.println("mngFileSyncJob06 === " + System.currentTimeMillis());
|
||||
System.out.println("mngFileSyncJob 06 Processing currentTime : " + System.currentTimeMillis());
|
||||
mapSheetMngFileJobService.checkMapSheetFileProcess(6, mngSyncPageSize);
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
@Scheduled(fixedDelay = 1000 * 5)
|
||||
public void mngFileSyncJob07() {
|
||||
if (!isSchedulerEnabled) return;
|
||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||
|
||||
System.out.println("mngFileSyncJob07 === " + System.currentTimeMillis());
|
||||
System.out.println("mngFileSyncJob 07 Processing currentTime : " + System.currentTimeMillis());
|
||||
mapSheetMngFileJobService.checkMapSheetFileProcess(7, mngSyncPageSize);
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
@Scheduled(fixedDelay = 1000 * 5)
|
||||
public void mngFileSyncJob08() {
|
||||
if (!isSchedulerEnabled) return;
|
||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||
|
||||
System.out.println("mngFileSyncJob08 === " + System.currentTimeMillis());
|
||||
System.out.println("mngFileSyncJob 08 Processing currentTime : " + System.currentTimeMillis());
|
||||
mapSheetMngFileJobService.checkMapSheetFileProcess(8, mngSyncPageSize);
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
@Scheduled(fixedDelay = 1000 * 5)
|
||||
public void mngFileSyncJob09() {
|
||||
if (!isSchedulerEnabled) return;
|
||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||
|
||||
System.out.println("mngFileSyncJob09 === " + System.currentTimeMillis());
|
||||
System.out.println("mngFileSyncJob 09 Processing currentTime : " + System.currentTimeMillis());
|
||||
mapSheetMngFileJobService.checkMapSheetFileProcess(9, mngSyncPageSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 3. 외부에서 플래그를 변경할 수 있는 Setter 메서드
|
||||
public void setSchedulerEnabled(boolean enabled) {
|
||||
this.isSchedulerEnabled = enabled;
|
||||
System.out.println("스케줄러 상태 변경됨: " + (enabled ? "ON" : "OFF"));
|
||||
this.isFileSyncSchedulerEnabled = false;
|
||||
System.out.println("스케줄러 동작 상태 변경됨: " + (enabled ? "ON" : "OFF"));
|
||||
}
|
||||
|
||||
public void setMngSyncPageSize(int pageSize) {
|
||||
|
||||
@@ -45,6 +45,12 @@ public class MapSheetMngFileJobService {
|
||||
@Value("${file.sync-file-extention}")
|
||||
private String syncFileExtention;
|
||||
|
||||
|
||||
public Integer checkMngFileSync()
|
||||
{
|
||||
return mapSheetMngFileJobCoreService.findNotYetMapSheetMng();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void checkMapSheetFileProcess(long targetNum, int mngSyncPageSize) {
|
||||
|
||||
@@ -55,10 +61,15 @@ public class MapSheetMngFileJobService {
|
||||
String syncCheckState = "";
|
||||
String fileState = "";
|
||||
String dataState = "";
|
||||
int mngYyyy = 0;
|
||||
|
||||
SrchFilesDepthDto srchDto = new SrchFilesDepthDto();
|
||||
List<FIleChecker.Basic> basicList = new ArrayList<>();
|
||||
|
||||
if( mapSheetFileNotYetList.size() >= 1 ){
|
||||
mngYyyy = mapSheetFileNotYetList.get(0).getMngYyyy();
|
||||
}
|
||||
|
||||
for (MngHstDto item : mapSheetFileNotYetList) {
|
||||
|
||||
// 도엽별 파일 체크 진행중으로 변경
|
||||
@@ -113,9 +124,9 @@ public class MapSheetMngFileJobService {
|
||||
if (tfwCnt == 0 && tifCnt == 0) syncState = "NOFILE";
|
||||
|
||||
for (FIleChecker.Basic item2 : basicList) {
|
||||
System.out.println("path: " + item2.getParentPath());
|
||||
System.out.println("path: " + item2.getFileNm());
|
||||
System.out.println("path: " + item2.getFullPath());
|
||||
//System.out.println("path: " + item2.getParentPath());
|
||||
//System.out.println("path: " + item2.getFileNm());
|
||||
//System.out.println("path: " + item2.getFullPath());
|
||||
|
||||
MapSheetMngDto.MngFileAddReq addReq = new MapSheetMngDto.MngFileAddReq();
|
||||
addReq.setMngYyyy(item.getMngYyyy());
|
||||
@@ -136,7 +147,7 @@ public class MapSheetMngFileJobService {
|
||||
fileState = "DUPLICATE";
|
||||
syncState = fileState;
|
||||
} else if (item2.getFileSize() == 0) {
|
||||
fileState = "SIZEERROR";
|
||||
fileState = "TYPEERROR";
|
||||
syncState = fileState;
|
||||
} else if (!FIleChecker.checkTfw(item2.getFullPath())) {
|
||||
fileState = "TYPEERROR";
|
||||
@@ -150,7 +161,7 @@ public class MapSheetMngFileJobService {
|
||||
fileState = "DUPLICATE";
|
||||
syncState = fileState;
|
||||
} else if (item2.getFileSize() == 0) {
|
||||
fileState = "SIZEERROR";
|
||||
fileState = "TYPEERROR";
|
||||
syncState = fileState;
|
||||
} else if (!FIleChecker.cmmndGdalInfo(item2.getFullPath())) {
|
||||
fileState = "TYPEERROR";
|
||||
@@ -168,15 +179,10 @@ public class MapSheetMngFileJobService {
|
||||
item.setSyncState(syncState);
|
||||
mngHstDataSyncStateUpdate(item);
|
||||
|
||||
// srchDto.
|
||||
|
||||
// 2. 출력
|
||||
// System.out.println("UID: " + hstUid + ", 상태: " + syncState + ", 관리경로: " +
|
||||
// item.getSyncMngPath());
|
||||
|
||||
// 3. (필요하다면) 다른 로직 수행
|
||||
// ...
|
||||
}
|
||||
|
||||
Long notyetCnt = this.mngDataStateDoneUpdate(mngYyyy);
|
||||
|
||||
}
|
||||
|
||||
public int checkIsNoFile(List<FileDto.Basic> basicList) {
|
||||
@@ -187,10 +193,34 @@ public class MapSheetMngFileJobService {
|
||||
return basicList.size();
|
||||
}
|
||||
|
||||
public Long mngDataStateDoneUpdate(int mngYyyy) {
|
||||
|
||||
Long notyetCnt = 0L;
|
||||
if( mngYyyy > 0 )
|
||||
{
|
||||
notyetCnt = findByMngYyyyTargetMapSheetNotYetCount(mngYyyy);
|
||||
if( notyetCnt == 0 )
|
||||
{
|
||||
mapSheetMngFileJobCoreService.mngDataState(mngYyyy,"DONE");
|
||||
}
|
||||
else
|
||||
{
|
||||
mapSheetMngFileJobCoreService.mngDataState(mngYyyy,"PROCESSING");
|
||||
}
|
||||
}
|
||||
|
||||
return notyetCnt;
|
||||
}
|
||||
|
||||
public List<MngHstDto> findTargetMapSheetFileList(long targetNum, int pageSize) {
|
||||
return mapSheetMngFileJobCoreService.findTargetMapSheetFileList(targetNum, pageSize);
|
||||
}
|
||||
|
||||
|
||||
public Long findByMngYyyyTargetMapSheetNotYetCount(int mngYyyy) {
|
||||
return mapSheetMngFileJobCoreService.findByMngYyyyTargetMapSheetNotYetCount(mngYyyy);
|
||||
}
|
||||
|
||||
public MapSheetMngDto.DmlReturn mngHstDataSyncStateUpdate(MapSheetMngDto.MngHstDto UpdateReq) {
|
||||
return mapSheetMngFileJobCoreService.mngHstDataSyncStateUpdate(UpdateReq);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user