mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-06 16:43:32 +09:00
Resource file 수정
This commit is contained in:
@@ -601,28 +601,6 @@ public class SysMgtService {
|
||||
return new SetWorkStateResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
//파일 load
|
||||
public Path load(String filename) {
|
||||
return Paths.get(uploadPath).resolve(filename);
|
||||
}
|
||||
|
||||
public Resource loadAsResource(String filename) {
|
||||
try {
|
||||
Path file = load(filename);
|
||||
Resource resource = new UrlResource(file.toUri());
|
||||
|
||||
if (resource.exists() || resource.isReadable()) {
|
||||
return resource;
|
||||
|
||||
} else {
|
||||
throw new RuntimeException("파일을 읽을 수 없습니다. : " + filename);
|
||||
}
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
throw new RuntimeException("파일을 읽을 수 없습니다. : " + filename, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* data: 2023. 05.09.
|
||||
* auth: won
|
||||
@@ -648,7 +626,7 @@ public class SysMgtService {
|
||||
|
||||
try {
|
||||
//파일 읽기
|
||||
Resource file = loadAsResource(dirWorkState);
|
||||
Resource file = fileService.loadAsResource(dirWorkState);
|
||||
BufferedReader reader = new BufferedReader(new FileReader(file.getFile()));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
@@ -679,21 +657,18 @@ public class SysMgtService {
|
||||
svcCheckList.setStrHd(StrHd);
|
||||
String EndHd = svcCheckList.getEndHour()+" : "+ svcCheckList.getEndMin();
|
||||
svcCheckList.setEndHd(EndHd);
|
||||
log.debug("aa번 ={}",svcCheckList.getYmd());
|
||||
log.debug("aa번 ={}",svcCheckList.getStrHd());
|
||||
log.debug("aa번 ={}",svcCheckList.getEndHd());
|
||||
log.debug("2번 ={}",svcCheckList);
|
||||
|
||||
}
|
||||
// 리스트에 항목 추가
|
||||
// 리스트에 항목 추가
|
||||
CheckList.add(svcCheckList);
|
||||
log.debug("4번 ={}",CheckList.add(svcCheckList));
|
||||
}
|
||||
|
||||
log.debug("4번 ={}",CheckList);
|
||||
totalCnt = Data.length;
|
||||
int page = svcCheckListReqDto.getPage();
|
||||
int pagePerRows = svcCheckListReqDto.getPagePerRows();
|
||||
page = (page - 1) * pagePerRows;
|
||||
svcCheckListReqDto.setPage(page);
|
||||
|
||||
log.debug("22번 ={}",svcCheckList);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 파일 읽기 실패 시 "USE"로 설정하고 결과 반환
|
||||
@@ -702,7 +677,7 @@ public class SysMgtService {
|
||||
log.debug("5번 ={}",svcCheckList.getWorkState());
|
||||
|
||||
String[] Data = workStateData.split(",");
|
||||
|
||||
log.debug("222번 ={}",svcCheckList);
|
||||
totalCnt = Data.length;
|
||||
int page = svcCheckListReqDto.getPage();
|
||||
int pagePerRows = svcCheckListReqDto.getPagePerRows();
|
||||
@@ -722,7 +697,7 @@ public class SysMgtService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
log.debug("2222번 ={}",svcCheckList);
|
||||
// CheckList = sysmgtmapper.svcCheckListSelect(svcCheckListReqDto);
|
||||
svcCheckListRes.setList(CheckList);
|
||||
Paging paging = new Paging();
|
||||
|
||||
Reference in New Issue
Block a user