spotless 적용
This commit is contained in:
@@ -34,8 +34,7 @@ public class ApiResponseAdvice implements ResponseBodyAdvice<Object> {
|
|||||||
private final AuditLogRepository auditLogRepository;
|
private final AuditLogRepository auditLogRepository;
|
||||||
private final MenuService menuService;
|
private final MenuService menuService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired private ObjectMapper objectMapper;
|
||||||
private ObjectMapper objectMapper;
|
|
||||||
|
|
||||||
public ApiResponseAdvice(AuditLogRepository auditLogRepository, MenuService menuService) {
|
public ApiResponseAdvice(AuditLogRepository auditLogRepository, MenuService menuService) {
|
||||||
this.auditLogRepository = auditLogRepository;
|
this.auditLogRepository = auditLogRepository;
|
||||||
|
|||||||
@@ -52,18 +52,15 @@ public class MapSheetMngFileJobCoreService {
|
|||||||
return new MapSheetMngDto.DmlReturn("success", saved.getFileUid().toString());
|
return new MapSheetMngDto.DmlReturn("success", saved.getFileUid().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long findByMngYyyyTargetMapSheetNotYetCount(int mngYyyy){
|
public Long findByMngYyyyTargetMapSheetNotYetCount(int mngYyyy) {
|
||||||
return mapSheetMngFileJobRepository.findByMngYyyyTargetMapSheetNotYetCount(mngYyyy);
|
return mapSheetMngFileJobRepository.findByMngYyyyTargetMapSheetNotYetCount(mngYyyy);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void mngDataState(int mngYyyy, String mngState)
|
public void mngDataState(int mngYyyy, String mngState) {
|
||||||
{
|
|
||||||
mapSheetMngFileJobRepository.mngDataState(mngYyyy, mngState);
|
mapSheetMngFileJobRepository.mngDataState(mngYyyy, mngState);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer findNotYetMapSheetMng()
|
public Integer findNotYetMapSheetMng() {
|
||||||
{
|
|
||||||
return mapSheetMngFileJobRepository.findNotYetMapSheetMng();
|
return mapSheetMngFileJobRepository.findNotYetMapSheetMng();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,12 +35,15 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer findNotYetMapSheetMng(){
|
public Integer findNotYetMapSheetMng() {
|
||||||
Integer countQuery =
|
Integer countQuery =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(mapSheetMngEntity.mngYyyy)
|
.select(mapSheetMngEntity.mngYyyy)
|
||||||
.from(mapSheetMngEntity)
|
.from(mapSheetMngEntity)
|
||||||
.where(mapSheetMngEntity.mngState.eq("NOTYET")
|
.where(
|
||||||
|
mapSheetMngEntity
|
||||||
|
.mngState
|
||||||
|
.eq("NOTYET")
|
||||||
.or(mapSheetMngEntity.mngState.eq("PROCESSING")))
|
.or(mapSheetMngEntity.mngState.eq("PROCESSING")))
|
||||||
.limit(1)
|
.limit(1)
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
@@ -121,19 +124,22 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long findByMngYyyyTargetMapSheetNotYetCount(int mngYyyy){
|
public Long findByMngYyyyTargetMapSheetNotYetCount(int mngYyyy) {
|
||||||
Long countQuery =
|
Long countQuery =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(mapSheetMngHstEntity.mngYyyy.count())
|
.select(mapSheetMngHstEntity.mngYyyy.count())
|
||||||
.from(mapSheetMngHstEntity)
|
.from(mapSheetMngHstEntity)
|
||||||
.where(mapSheetMngHstEntity.mngYyyy.eq(mngYyyy)
|
.where(
|
||||||
|
mapSheetMngHstEntity
|
||||||
|
.mngYyyy
|
||||||
|
.eq(mngYyyy)
|
||||||
.and(mapSheetMngHstEntity.syncState.eq("NOTYET")))
|
.and(mapSheetMngHstEntity.syncState.eq("NOTYET")))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
return countQuery;
|
return countQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void mngDataState(int mngYyyy, String mngState){
|
public void mngDataState(int mngYyyy, String mngState) {
|
||||||
long updateCount =
|
long updateCount =
|
||||||
queryFactory
|
queryFactory
|
||||||
.update(mapSheetMngEntity)
|
.update(mapSheetMngEntity)
|
||||||
|
|||||||
@@ -24,20 +24,24 @@ public class MapSheetMngFileJobController {
|
|||||||
|
|
||||||
Integer mng = 0;
|
Integer mng = 0;
|
||||||
// isFileSyncSchedulerEnabled = false;
|
// isFileSyncSchedulerEnabled = false;
|
||||||
if(mapSheetMngFileJobService.checkMngFileSync() != null)
|
if (mapSheetMngFileJobService.checkMngFileSync() != null) {
|
||||||
{
|
|
||||||
mng = mapSheetMngFileJobService.checkMngFileSync();
|
mng = mapSheetMngFileJobService.checkMngFileSync();
|
||||||
this.isFileSyncSchedulerEnabled = true;
|
this.isFileSyncSchedulerEnabled = true;
|
||||||
System.out.println("MngFileSyncJob ON --> mngYyyy : "+ mng + ", currentTime : " + System.currentTimeMillis());
|
System.out.println(
|
||||||
}
|
"MngFileSyncJob ON --> mngYyyy : "
|
||||||
else{
|
+ mng
|
||||||
|
+ ", currentTime : "
|
||||||
|
+ System.currentTimeMillis());
|
||||||
|
} else {
|
||||||
this.isFileSyncSchedulerEnabled = false;
|
this.isFileSyncSchedulerEnabled = false;
|
||||||
System.out.println("MngFileSyncJob OFF --> mngYyyy : "+ mng + ", currentTime : " + System.currentTimeMillis());
|
System.out.println(
|
||||||
|
"MngFileSyncJob OFF --> mngYyyy : "
|
||||||
|
+ mng
|
||||||
|
+ ", currentTime : "
|
||||||
|
+ System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Scheduled(fixedDelay = 1000 * 5)
|
@Scheduled(fixedDelay = 1000 * 5)
|
||||||
public void mngFileSyncJob00() {
|
public void mngFileSyncJob00() {
|
||||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||||
@@ -54,7 +58,6 @@ public class MapSheetMngFileJobController {
|
|||||||
mapSheetMngFileJobService.checkMapSheetFileProcess(1, mngSyncPageSize);
|
mapSheetMngFileJobService.checkMapSheetFileProcess(1, mngSyncPageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Scheduled(fixedDelay = 1000 * 5)
|
@Scheduled(fixedDelay = 1000 * 5)
|
||||||
public void mngFileSyncJob02() {
|
public void mngFileSyncJob02() {
|
||||||
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
|
||||||
@@ -119,8 +122,6 @@ public class MapSheetMngFileJobController {
|
|||||||
mapSheetMngFileJobService.checkMapSheetFileProcess(9, mngSyncPageSize);
|
mapSheetMngFileJobService.checkMapSheetFileProcess(9, mngSyncPageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 3. 외부에서 플래그를 변경할 수 있는 Setter 메서드
|
// 3. 외부에서 플래그를 변경할 수 있는 Setter 메서드
|
||||||
public void setSchedulerEnabled(boolean enabled) {
|
public void setSchedulerEnabled(boolean enabled) {
|
||||||
this.isSchedulerEnabled = enabled;
|
this.isSchedulerEnabled = enabled;
|
||||||
|
|||||||
@@ -45,9 +45,7 @@ public class MapSheetMngFileJobService {
|
|||||||
@Value("${file.sync-file-extention}")
|
@Value("${file.sync-file-extention}")
|
||||||
private String syncFileExtention;
|
private String syncFileExtention;
|
||||||
|
|
||||||
|
public Integer checkMngFileSync() {
|
||||||
public Integer checkMngFileSync()
|
|
||||||
{
|
|
||||||
return mapSheetMngFileJobCoreService.findNotYetMapSheetMng();
|
return mapSheetMngFileJobCoreService.findNotYetMapSheetMng();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +64,7 @@ public class MapSheetMngFileJobService {
|
|||||||
SrchFilesDepthDto srchDto = new SrchFilesDepthDto();
|
SrchFilesDepthDto srchDto = new SrchFilesDepthDto();
|
||||||
List<FIleChecker.Basic> basicList = new ArrayList<>();
|
List<FIleChecker.Basic> basicList = new ArrayList<>();
|
||||||
|
|
||||||
if( mapSheetFileNotYetList.size() >= 1 ){
|
if (mapSheetFileNotYetList.size() >= 1) {
|
||||||
mngYyyy = mapSheetFileNotYetList.get(0).getMngYyyy();
|
mngYyyy = mapSheetFileNotYetList.get(0).getMngYyyy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,9 +122,9 @@ public class MapSheetMngFileJobService {
|
|||||||
if (tfwCnt == 0 && tifCnt == 0) syncState = "NOFILE";
|
if (tfwCnt == 0 && tifCnt == 0) syncState = "NOFILE";
|
||||||
|
|
||||||
for (FIleChecker.Basic item2 : basicList) {
|
for (FIleChecker.Basic item2 : basicList) {
|
||||||
//System.out.println("path: " + item2.getParentPath());
|
// System.out.println("path: " + item2.getParentPath());
|
||||||
//System.out.println("path: " + item2.getFileNm());
|
// System.out.println("path: " + item2.getFileNm());
|
||||||
//System.out.println("path: " + item2.getFullPath());
|
// System.out.println("path: " + item2.getFullPath());
|
||||||
|
|
||||||
MapSheetMngDto.MngFileAddReq addReq = new MapSheetMngDto.MngFileAddReq();
|
MapSheetMngDto.MngFileAddReq addReq = new MapSheetMngDto.MngFileAddReq();
|
||||||
addReq.setMngYyyy(item.getMngYyyy());
|
addReq.setMngYyyy(item.getMngYyyy());
|
||||||
@@ -178,11 +176,9 @@ public class MapSheetMngFileJobService {
|
|||||||
if (syncState.isEmpty()) syncState = "DONE";
|
if (syncState.isEmpty()) syncState = "DONE";
|
||||||
item.setSyncState(syncState);
|
item.setSyncState(syncState);
|
||||||
mngHstDataSyncStateUpdate(item);
|
mngHstDataSyncStateUpdate(item);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Long notyetCnt = this.mngDataStateDoneUpdate(mngYyyy);
|
Long notyetCnt = this.mngDataStateDoneUpdate(mngYyyy);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int checkIsNoFile(List<FileDto.Basic> basicList) {
|
public int checkIsNoFile(List<FileDto.Basic> basicList) {
|
||||||
@@ -196,16 +192,12 @@ public class MapSheetMngFileJobService {
|
|||||||
public Long mngDataStateDoneUpdate(int mngYyyy) {
|
public Long mngDataStateDoneUpdate(int mngYyyy) {
|
||||||
|
|
||||||
Long notyetCnt = 0L;
|
Long notyetCnt = 0L;
|
||||||
if( mngYyyy > 0 )
|
if (mngYyyy > 0) {
|
||||||
{
|
|
||||||
notyetCnt = findByMngYyyyTargetMapSheetNotYetCount(mngYyyy);
|
notyetCnt = findByMngYyyyTargetMapSheetNotYetCount(mngYyyy);
|
||||||
if( notyetCnt == 0 )
|
if (notyetCnt == 0) {
|
||||||
{
|
mapSheetMngFileJobCoreService.mngDataState(mngYyyy, "DONE");
|
||||||
mapSheetMngFileJobCoreService.mngDataState(mngYyyy,"DONE");
|
} else {
|
||||||
}
|
mapSheetMngFileJobCoreService.mngDataState(mngYyyy, "PROCESSING");
|
||||||
else
|
|
||||||
{
|
|
||||||
mapSheetMngFileJobCoreService.mngDataState(mngYyyy,"PROCESSING");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,7 +208,6 @@ public class MapSheetMngFileJobService {
|
|||||||
return mapSheetMngFileJobCoreService.findTargetMapSheetFileList(targetNum, pageSize);
|
return mapSheetMngFileJobCoreService.findTargetMapSheetFileList(targetNum, pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Long findByMngYyyyTargetMapSheetNotYetCount(int mngYyyy) {
|
public Long findByMngYyyyTargetMapSheetNotYetCount(int mngYyyy) {
|
||||||
return mapSheetMngFileJobCoreService.findByMngYyyyTargetMapSheetNotYetCount(mngYyyy);
|
return mapSheetMngFileJobCoreService.findByMngYyyyTargetMapSheetNotYetCount(mngYyyy);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user