mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-06 20:24:30 +09:00
state list 등록
This commit is contained in:
@@ -114,6 +114,10 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
|
this.$store.commit('searchcondition/updateSearchCondition', {
|
||||||
|
page: 1,
|
||||||
|
perPage: 50,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let page = 1;
|
let page = 1;
|
||||||
@@ -148,6 +152,22 @@ export default {
|
|||||||
search: function (isKeep) {
|
search: function (isKeep) {
|
||||||
this.$refs.table.search(this.grid.params, isKeep);
|
this.$refs.table.search(this.grid.params, isKeep);
|
||||||
},
|
},
|
||||||
|
changePerPage: function () {
|
||||||
|
// 페이지당 조회할 개수
|
||||||
|
this.grid.pagePerRows = this.perPageCnt;
|
||||||
|
this.search(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
sendStoreData: function () {
|
||||||
|
const getP = this.$refs.table.getPagination();
|
||||||
|
this.$store.commit('searchcondition/updateSearchCondition', {
|
||||||
|
page: getP._currentPage,
|
||||||
|
perPage: this.perPageCnt,
|
||||||
|
params: this.grid.params
|
||||||
|
});
|
||||||
|
|
||||||
|
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
|
||||||
|
},
|
||||||
|
|
||||||
customFormatter: function (date) {
|
customFormatter: function (date) {
|
||||||
if (this.sDateDiv == 'month') {
|
if (this.sDateDiv == 'month') {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import java.net.MalformedURLException;
|
|||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -554,6 +555,7 @@ public class SysMgtService {
|
|||||||
public SetWorkStateResDto setWorkState(SetWorkStateReqDto setWorkParam) {
|
public SetWorkStateResDto setWorkState(SetWorkStateReqDto setWorkParam) {
|
||||||
|
|
||||||
File file = new File("C:\\efs\\home\\workState\\workStatefile.txt");
|
File file = new File("C:\\efs\\home\\workState\\workStatefile.txt");
|
||||||
|
File fileList = new File("C:\\efs\\admin\\workState\\workStatefile.txt");
|
||||||
|
|
||||||
String[] workParamArr = setWorkParam.getStartDate().split("-");
|
String[] workParamArr = setWorkParam.getStartDate().split("-");
|
||||||
|
|
||||||
@@ -578,6 +580,7 @@ public class SysMgtService {
|
|||||||
//1. workState 파일이 없다면? 만들어라
|
//1. workState 파일이 없다면? 만들어라
|
||||||
if(!file.exists()) {
|
if(!file.exists()) {
|
||||||
file.createNewFile();
|
file.createNewFile();
|
||||||
|
fileList.createNewFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
//2. Buffer를 사용해서 File에 write할 수 있는 BufferedWriter 생성
|
//2. Buffer를 사용해서 File에 write할 수 있는 BufferedWriter 생성
|
||||||
@@ -592,12 +595,42 @@ public class SysMgtService {
|
|||||||
//4. Buffer
|
//4. Buffer
|
||||||
writer.close();
|
writer.close();
|
||||||
|
|
||||||
|
//5. admin파일에 저장
|
||||||
|
|
||||||
|
String workStateData = "";
|
||||||
|
|
||||||
|
Resource filethree = fileService.loadAsResource(dirWorkState);
|
||||||
|
BufferedReader reader = new BufferedReader(new FileReader(filethree.getFile()));
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String line;
|
||||||
|
while ((line = reader.readLine()) != null) {
|
||||||
|
sb.append(line);
|
||||||
|
}
|
||||||
|
reader.close();
|
||||||
|
|
||||||
|
FileWriter fwList = new FileWriter(fileList);
|
||||||
|
BufferedWriter writerList = new BufferedWriter(fwList);
|
||||||
|
|
||||||
|
workStateData = sb.toString();
|
||||||
|
String[] Data = workStateData.split(",");
|
||||||
|
|
||||||
|
List<String> newList = new ArrayList<>(Arrays.asList(workStateData));
|
||||||
|
newList.add(setWorkState);
|
||||||
|
|
||||||
|
for (String data : newList) {
|
||||||
|
writerList.write(data);
|
||||||
|
writerList.newLine();
|
||||||
|
}
|
||||||
|
writerList.close();
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
logger.debug("setWorkParam={}",setWorkParam);
|
logger.debug("setWorkParam={}",setWorkParam);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return new SetWorkStateResDto(ApiResponseCode.SUCCESS);
|
return new SetWorkStateResDto(ApiResponseCode.SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -611,7 +644,7 @@ public class SysMgtService {
|
|||||||
SysMgtMapper sysmgtmapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
|
SysMgtMapper sysmgtmapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
|
||||||
|
|
||||||
String workStateData = "";
|
String workStateData = "";
|
||||||
log.debug("1번 ={}",workStateData);
|
// log.debug("1번 ={}",workStateData);
|
||||||
String [] workStateDataArr = new String[7];
|
String [] workStateDataArr = new String[7];
|
||||||
log.info("getWorkStateCheck START ==========================================");
|
log.info("getWorkStateCheck START ==========================================");
|
||||||
|
|
||||||
@@ -658,19 +691,14 @@ public class SysMgtService {
|
|||||||
svcCheckList.setStrHd(StrHd);
|
svcCheckList.setStrHd(StrHd);
|
||||||
String EndHd = svcCheckList.getEndHour()+" : "+ svcCheckList.getEndMin();
|
String EndHd = svcCheckList.getEndHour()+" : "+ svcCheckList.getEndMin();
|
||||||
svcCheckList.setEndHd(EndHd);
|
svcCheckList.setEndHd(EndHd);
|
||||||
log.debug("2번 ={}",svcCheckList);
|
// log.debug("2번 ={}",svcCheckList);
|
||||||
// 리스트에 항목 추가
|
// 리스트에 항목 추가
|
||||||
CheckList.add(svcCheckList);
|
CheckList.add(svcCheckList);
|
||||||
log.debug("3번 ={}",CheckList.get(i));
|
// log.debug("3번 ={}",CheckList.get(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug("CheckList0={}",CheckList.get(0));
|
|
||||||
log.debug("CheckList1={}",CheckList.get(1));
|
|
||||||
log.debug("CheckList2={}",CheckList.get(2));
|
|
||||||
log.debug("CheckList3={}",CheckList.get(3));
|
|
||||||
|
|
||||||
svcCheckListRes.setList(CheckList);
|
svcCheckListRes.setList(CheckList);
|
||||||
log.debug("4번 ={}",svcCheckListRes.getList());
|
// log.debug("4번 ={}",svcCheckListRes.getList());
|
||||||
totalCnt = CheckList.size();
|
totalCnt = CheckList.size();
|
||||||
int page = svcCheckListReqDto.getPage();
|
int page = svcCheckListReqDto.getPage();
|
||||||
int pagePerRows = svcCheckListReqDto.getPagePerRows();
|
int pagePerRows = svcCheckListReqDto.getPagePerRows();
|
||||||
@@ -681,7 +709,7 @@ public class SysMgtService {
|
|||||||
// 파일 읽기 실패 시 "USE"로 설정하고 결과 반환
|
// 파일 읽기 실패 시 "USE"로 설정하고 결과 반환
|
||||||
log.error("WORK STATE READ FAIL : {}",e.getMessage(), e);
|
log.error("WORK STATE READ FAIL : {}",e.getMessage(), e);
|
||||||
svcCheckList.setWorkState("USE");
|
svcCheckList.setWorkState("USE");
|
||||||
log.debug("5번 ={}",svcCheckList.getWorkState());
|
// log.debug("5번 ={}",svcCheckList.getWorkState());
|
||||||
|
|
||||||
String[] Data = workStateData.split(",");
|
String[] Data = workStateData.split(",");
|
||||||
totalCnt = CheckList.size();
|
totalCnt = CheckList.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user