diff --git a/frontend/src/modules/sysMgt/views/WorkState.vue b/frontend/src/modules/sysMgt/views/WorkState.vue
index 9e28d8b..6650da7 100644
--- a/frontend/src/modules/sysMgt/views/WorkState.vue
+++ b/frontend/src/modules/sysMgt/views/WorkState.vue
@@ -14,7 +14,9 @@
@@ -71,7 +73,6 @@ import moment from 'moment';
import VueTimepicker from 'vue2-timepicker';
import 'vue2-timepicker/dist/VueTimepicker.css'
import sysMgtApi from '../service/sysMgtApi'
-// import CommonModal from '../components/modal/commonModal';
import CommonModal from '../components/commonModal.vue';
export default {
@@ -81,8 +82,11 @@ export default {
isFocused: false,
//날짜 조회
ko: vdp_translation_ko.js,
+ periodDay: 7,
sDateDiv: 'day',
startDate: new Date(),
+ disabledSDate: '',
+ startDateOptions: {disabledDate: this.disabledStDate},
totalItems: 0,
row: {},
grid: {
@@ -110,8 +114,12 @@ export default {
},
startTime : '',
endTime : '',
- state: '',
-
+ state: 'USE',
+ startDate2 :'',
+ startTimeT2: '',
+ startTimeM2: '',
+ endTimeT2 : '',
+ endTimeM2: '',
};
},
components: {
@@ -122,6 +130,7 @@ export default {
},
created() {
+ this.setPeriodDay(0);
},
destroyed() {
this.$store.commit('searchcondition/updateSearchCondition', {
@@ -148,11 +157,6 @@ export default {
methods: {
fnSaveTxt(){
- if (this.state == 'NOTUSE') {
- this.row.title = '서비스 점검 설정';
- this.row.msg1 = '저장 하시겠습니까?';
- this.$refs.commonModal.confirmModalOpen(this.row);
- }
let params = {
startDate : moment(this.startDate).format('YYYY-MM-DD'),
startTimeT : '',
@@ -161,6 +165,13 @@ export default {
endTimeM : '',
state : this.state,
}
+
+ this.startDate2 = moment(this.startDate).format('YYYY-MM-DD');
+ this.startTimeT2 = moment(this.startTime, 'HH:mm').format('HH');
+ this.startTimeM2 = moment(this.startTime, 'HH:mm').format('mm');
+ this.endTimeT2 = moment(this.endTime, 'HH:mm').format('HH');
+ this.endTimeM2 = moment(this.endTime, 'HH:mm').format('mm');
+
if (this.startTime) {
params.startTimeT = moment(this.startTime, 'HH:mm').format('HH');
params.startTimeM = moment(this.startTime, 'HH:mm').format('mm');
@@ -169,19 +180,77 @@ export default {
params.endTimeT = moment(this.endTime, 'HH:mm').format('HH');
params.endTimeM = moment(this.endTime, 'HH:mm').format('mm');
}
- sysMgtApi.setWorkState(params).then((respose) => {
- var result = respose.data;
- if (result != null && result.retCode == "0000"){
- // 저장이 완료된 후에 테이블 다시 로드
- this.toComplete();
- }
- });
+ if(params.startTimeT == ''){
+ this.row.title = '서비스 점검 설정';
+ this.row.msg1 = '시작시간을 설정해 주세요 ';
+ this.$refs.commonModal.alertSysModalOpen(this.row);
+ return false;
+ }
+ if(params.startTimeM== ''){
+ this.row.title = '서비스 점검 설정';
+ this.row.msg1 = '시작시간을 설정해 주세요 ';
+ this.$refs.commonModal.alertSysModalOpen(this.row);
+ return false;
+ }
+ if(params.endTimeT== ''){
+ this.row.title = '서비스 점검 설정';
+ this.row.msg1 = '종료시간을 설정해 주세요 ';
+ this.$refs.commonModal.alertSysModalOpen(this.row);
+ return false;
+ }
+ if(params.endTimeM== ''){
+ this.row.title = '서비스 점검 설정';
+ this.row.msg1 = '종료시간을 설정해 주세요 ';
+ this.$refs.commonModal.alertSysModalOpen(this.row);
+ return false;
+ }
+ // 사용 && 점검중 선택
+ if (this.state == 'NOTUSE') {
+ this.row.title = '서비스 점검 설정';
+ this.row.msg1 = '저장 하시겠습니까?';
+ this.$refs.commonModal.confirmModalOpen(this.row);
+ }else{
+ this.setState(params);
+ }
},
- toComplete(){
- this.$refs.table.reloadData();
- // this.confirmCalbackFnc();
- },
+
+ async setState(){
+ let params = {
+ startDate : this.startDate2,
+ startTimeT : this.startTimeT2,
+ startTimeM : this.startTimeM2,
+ endTimeT : this.endTimeT2,
+ endTimeM : this.endTimeM2,
+ state : this.state,
+ }
+ try {
+ let response = await sysMgtApi.setWorkState(params);
+ const result = response.data;
+ if (result != null && result.retCode == "0000"){
+ // 저장이 완료된 후에 테이블 다시 로드
+ this.$refs.table.reloadData();
+ return;
+ } else {
+ this.row.title = '서비스 점검 설정';
+ this.row.msg1 = '실패 하였습니다.';
+ this.$refs.commonModal.alertSysModalOpen(this.row);
+ return false;
+ }
+ } catch (error) {
+ this.row.title = '서비스 점검 설정';
+ this.row.msg1 = '실패 하였습니다.';
+ this.$refs.commonModal.alertSysModalOpen(this.row);
+ return false;
+ }
+ },
+
+ confirmCalbackFnc(props) {
+ if (props.result) {
+ this.setState();
+ }
+ },
+
search: function (isKeep) {
this.$refs.table.search(this.grid.params, isKeep);
const getP = this.$refs.table.getPagination();
@@ -209,7 +278,12 @@ export default {
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
},
-
+ setPeriodDay(day) {
+ this.periodDay = day;
+ this.initSetStartDate();
+ this.initSetEndDate();
+ this.closeDate('start');
+ },
customFormatter: function (date) {
if (this.sDateDiv == 'month') {
return moment(date).format('YYYY-MM');
@@ -219,6 +293,31 @@ export default {
return moment(date).format('YYYY-MM-DD');
}
},
+
+ closeDate(type){
+ if (type != undefined && type != null){
+ let initStartDate = new Date();
+ let initEndDate = new Date();
+ initStartDate.setDate(Number(moment(initStartDate).format('DD'))+365 );
+ initEndDate.setDate(Number(moment(initEndDate).format('DD')) -1)
+
+ this.disabledSDate = {to: initEndDate, from: initStartDate};
+ if (this.startDate !== initStartDate) {
+ this.disabledSDate = {to: initEndDate, from: initStartDate};
+ }
+
+ }
+ },
+ initSetStartDate() {
+ let initStartDate = new Date();
+ initStartDate.setDate(Number(moment(initStartDate).format('DD'))+365 );
+ this.startDate = initStartDate;
+ },
+ initSetEndDate(){
+ let initEndDate = new Date();
+ initEndDate.setDate(Number(moment(initEndDate).format('DD')) )
+ this.startDate = initEndDate;
+ },
beforeRouteLeave(to, from, next) {
const getP = this.$refs.table.getPagination();
this.$store.commit('searchcondition/updateSearchCondition', {
@@ -227,10 +326,7 @@ export default {
// 라우트 하기전 실행
next();
},
- confirmCalbackFnc(props) {
- // if (props.result) {
- // }
- },
+
}
};
diff --git a/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtService.java b/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtService.java
index cfc0063..894ebc0 100644
--- a/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtService.java
+++ b/src/main/java/kr/co/uplus/ez/api/sysMgt/SysMgtService.java
@@ -648,21 +648,17 @@ public class SysMgtService {
* @return
*/
public SvcCheckListResDto svcCheckLists(@Valid SvcCheckListReqDto svcCheckListReqDto) {
- SysMgtMapper sysmgtmapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
String workStateData = "";
-// log.debug("1번 ={}",workStateData);
String [] workStateDataArr = new String[7];
log.info("getWorkStateCheck START ==========================================");
- //CheckList >= svcCheckList
SvcCheckListRes svcCheckListRes = new SvcCheckListRes();
List CheckList = new ArrayList();
SvcCheckList svcCheckList = new SvcCheckList();
String nowPage = String.valueOf(svcCheckListReqDto.getPage());
int totalCnt = 0;
-// sysmgtmapper.svcCheckListSelectCnt(svcCheckListReqDto);
File fileList = new File("C:\\efs\\admin\\workState\\workStatefile.txt");
try {
@@ -699,14 +695,11 @@ public class SysMgtService {
svcCheckList.setStrHd(StrHd);
String EndHd = svcCheckList.getEndHour()+" : "+ svcCheckList.getEndMin();
svcCheckList.setEndHd(EndHd);
-// log.debug("2번 ={}",svcCheckList);
// 리스트에 항목 추가
CheckList.add(svcCheckList);
-// log.debug("3번 ={}",CheckList.get(i));
}
svcCheckListRes.setList(CheckList);
-// log.debug("4번 ={}",svcCheckListRes.getList());
totalCnt = CheckList.size();
int page = svcCheckListReqDto.getPage();
int pagePerRows = svcCheckListReqDto.getPagePerRows();
@@ -720,7 +713,6 @@ public class SysMgtService {
// 파일 읽기 실패 시 "USE"로 설정하고 결과 반환
log.error("WORK STATE READ FAIL : {}",e.getMessage(), e);
svcCheckList.setWorkState("USE");
-// log.debug("5번 ={}",svcCheckList.getWorkState());
String[] Data = workStateData.split(",");
totalCnt = CheckList.size();
@@ -743,7 +735,6 @@ public class SysMgtService {
}
-// CheckList = sysmgtmapper.svcCheckListSelect(svcCheckListReqDto);
svcCheckListRes.setList(CheckList);
Paging paging = new Paging();
paging.setPage(nowPage);