작업중 설정 진행 중 & 배치 모니터링 수정

This commit is contained in:
2023-05-09 20:23:00 +09:00
parent 96fe1ec899
commit 081e9b8712
7 changed files with 126 additions and 137 deletions

View File

@@ -40,7 +40,7 @@ export default [
meta: { public: false } meta: { public: false }
}, },
{ {
path: '/sysMgt/batchDetail/:batchId', path: '/sysMgt/batchDetail',
component: BatchDetail, component: BatchDetail,
name: 'batchDetail', name: 'batchDetail',
meta: { public: false } meta: { public: false }

View File

@@ -85,6 +85,11 @@ const notiList = (params) => {
return httpClient.post('/api/v1/bo/sysMgt/notiList', params, { withCredentials: false }) return httpClient.post('/api/v1/bo/sysMgt/notiList', params, { withCredentials: false })
} }
const setWorkState = (params) => {
console.log("api호출",params)
return httpClient.post('/api/v1/bo/sysMgt/setWorkState', params, { withCredentials: false })
}
export default { export default {
insertAdmin, insertAdmin,
@@ -104,5 +109,6 @@ export default {
batchList, batchList,
batchDetail, batchDetail,
batchExecuteJob, batchExecuteJob,
notiList notiList,
setWorkState,
} }

View File

@@ -9,7 +9,7 @@
<div class="search_wrap"> <div class="search_wrap">
<div class="group"> <div class="group">
<h3> <h3>
<label for="right" class="label">배치 ID | {{ this.batchId }} </label> <label for="right" class="label">배치 ID | {{ this.batchId }} | {{ this.batchNm }} | {{ this.batchType }} </label>
</h3> </h3>
</div> </div>
<div class="group"> <div class="group">
@@ -57,10 +57,9 @@
<div class="term"> <div class="term">
<span class="custom_input icon_date"> <span class="custom_input icon_date">
<vuejs-datepicker <vuejs-datepicker
:language="ko" :language="ko"
:format="customFormatter" :format="customFormatter"
:disabled-dates="disabledSDate" v-model="strDate"
v-model="strDate"
></vuejs-datepicker> ></vuejs-datepicker>
</span> </span>
</div> </div>
@@ -107,7 +106,7 @@ export default {
name: 'batchDetail', name: 'batchDetail',
data() { data() {
return { return {
//paramBatchId : this.$route.params.batchId, paramBatchId : this.$route.params.batchId,
//날짜 조회 //날짜 조회
ko: vdp_translation_ko.js, ko: vdp_translation_ko.js,
periodDay: 7, periodDay: 7,
@@ -120,8 +119,9 @@ export default {
pageType: 'CALC', pageType: 'CALC',
batchId : this.$route.params.batchId, batchId : this.$route.params.props.batchId,
batchNm : this.$route.params.batchNm, batchNm : this.$route.params.props.batchNm,
batchType: this.$route.params.props.batchType,
//상태조회 //상태조회
sttusCd: '', sttusCd: '',
@@ -154,6 +154,8 @@ export default {
noDataStr: '검색 결과가 없습니다.', noDataStr: '검색 결과가 없습니다.',
params: { params: {
batchId : '', batchId : '',
batchType: '',
batchNm: '',
sttusCd: '', sttusCd: '',
startDt: '', startDt: '',
endDt: '', endDt: '',
@@ -220,6 +222,8 @@ export default {
startDt: moment(this.startDate).format('YYYYMMDD'), startDt: moment(this.startDate).format('YYYYMMDD'),
endDt: moment(this.endDate).format('YYYYMMDD'), endDt: moment(this.endDate).format('YYYYMMDD'),
batchId: this.batchId, batchId: this.batchId,
batchNm: this.batchNm,
batchType: this.batchType,
sttusCd: this.sttusCd sttusCd: this.sttusCd
} }
this.$refs.table.search(this.grid.params, isKeep); this.$refs.table.search(this.grid.params, isKeep);
@@ -291,10 +295,14 @@ export default {
}, },
async runExecuteJob(){ async runExecuteJob(){
console.log("this.strDate",this.strDate)
const params = { const params = {
strDate : this.strDate, strDate : moment(this.strDate).format('YYYY-MM-DD'),
batchId : this.batchId batchId : this.batchId,
batchType : this.batchType,
batchNm : this.batchNm,
} }
console.log("params",params)
try { try {
const response = await sysMgtApi.batchExecuteJob(params); const response = await sysMgtApi.batchExecuteJob(params);

View File

@@ -7,13 +7,21 @@
</div> </div>
<div class="table"> <div class="table">
<custom-grid ref="table" :url="grid.url" :columns="grid.columns"></custom-grid> <custom-grid ref="table" :url="grid.url" :columns="grid.columns"></custom-grid>
<router-link
:to="{
name: 'batchDetail',
params: { batchId : 'BATCH_003'}
}">
</router-link>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import customGrid from '@/components/CustomGrid'; import customGrid from '@/components/CustomGrid';
import batchDetail from './BatchDetail.vue'
class CustomATagRenderer { class CustomATagRenderer {
constructor(props) { constructor(props) {
@@ -62,7 +70,7 @@ export default {
renderer: { renderer: {
type: CustomATagRenderer, type: CustomATagRenderer,
options: { options: {
callback: this.batchDetail, callback: this.goBatchDetail,
}, },
}, },
}, },
@@ -77,6 +85,7 @@ export default {
}, },
components: { components: {
customGrid: customGrid, customGrid: customGrid,
batchDetail: batchDetail,
}, },
created() { created() {
const getCondition = this.$store.getters['searchcondition/getSearchCondition']; const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
@@ -112,9 +121,12 @@ export default {
this.$refs.table.search(this.grid.params, isKeep); this.$refs.table.search(this.grid.params, isKeep);
this.sendStoreData(); this.sendStoreData();
}, },
batchDetail(props) { goBatchDetail(props) {
this.row.batchId = props.batchId; // this.row = props
this.$router.push({ path: `/sysMgt/batchDetail/${props.batchId}`, params: this.row }); // console.log("props1",props.getters)
// console.log("props2",props)
this.$router.push({ name: "batchDetail", params: {props: props} });
}, },
sendStoreData: function () { sendStoreData: function () {
const getP = this.$refs.table.getPagination(); const getP = this.$refs.table.getPagination();

View File

@@ -14,38 +14,35 @@
<vuejs-datepicker <vuejs-datepicker
:language="ko" :language="ko"
:format="customFormatter" :format="customFormatter"
:disabled-dates="disabledSDate"
v-model="startDate" v-model="startDate"
@selected="selectedStartDate(0)"
@closed="closeDate('start')"
></vuejs-datepicker> ></vuejs-datepicker>
</span> </span>
</div> </div>
</div> </div>
<div> <div style="margin-right: 20px;">
<label for="right" class="label">시작시간</label> <label for="right" class="label">시작시간</label>
<div class="term"> <div class="term">
<span class="custom_input icon_date"> <span class="custom_input icon_date">
<vue-timepicker v-model="StartTime" format="hh:mm A" :minute-interval="10"></vue-timepicker> <vue-timepicker v-model="startTime" :minuteInterval="10"></vue-timepicker>
</span> </span>
</div> </div>
</div> </div>
<div> <div style="margin-right: 30px;">
<label for="right" class="label">종료시간</label> <label for="right" class="label">종료시간</label>
<div class="term"> <div class="term">
<span class="custom_input icon_date"> <span class="custom_input icon_date">
<vue-timepicker v-model="EndTime" format="hh:mm A" :minute-interval="10"></vue-timepicker> <vue-timepicker v-model="endTime" :minuteInterval="10"></vue-timepicker>
</span> </span>
</div> </div>
</div> </div>
<div> <div>
<input type="radio" name="state" value="use" id="popup_radio1"> <input type="radio" v-model="state" name="state" value="use" id="popup_radio1">
<label for="popup_radio1">사용</label> <label for="popup_radio1" style="margin-right: 20px;">사용</label>
<input type="radio" name="state" value="notUse" id="popup_radio2"> <input type="radio" v-model="state" name="state" value="notUse" id="popup_radio2">
<label for="popup_radio2">점검중</label> <label for="popup_radio2" style="margin-right: 30px;">점검중</label>
</div> </div>
<div> <div>
<button type="button" class="button grey" @click="save">저장</button> <button type="button" class="button grey" @click="fnSaveTxt">저장</button>
</div> </div>
</div> </div>
</div> </div>
@@ -68,52 +65,20 @@
<script> <script>
import customGrid from '@/components/CustomGrid'; import customGrid from '@/components/CustomGrid';
import Timepicker from 'vue-timepicker'; import moment from 'moment';
import VueTimepicker from 'vue2-timepicker';
class CustomATagRenderer { import 'vue2-timepicker/dist/VueTimepicker.css'
constructor(props) { import sysMgtApi from '../service/sysMgtApi'
this.props = props;
const el = document.createElement('a');
el.href = 'javascript:void(0);';
el.className = 'btn_text';
el.innerText = String(props.colValue);
this.el = el;
}
getElement() {
return this.el;
}
addEvent(selEl) {
selEl.addEventListener('click', () => {
const { callback } = this.props['cgrido' + this.props.colName].options;
callback(this.props);
});
}
}
export default { export default {
name: 'workState', name: 'workState',
data() { data() {
return { return {
isFocused: false, isFocused: false,
srchGbn: '00',
srchGbn2: '00',
row: {},
perPageCnt: 50,
options: [
{ text: '20', value: 20 },
{ text: '50', value: 50 },
{ text: '100', value: 100 },
],
//날짜 조회 //날짜 조회
ko: vdp_translation_ko.js, ko: vdp_translation_ko.js,
periodDay: 7,
sDateDiv: 'day', sDateDiv: 'day',
startDate: new Date(), startDate: new Date(),
totalItems: 0, totalItems: 0,
grid: { grid: {
url: '/api/v1/bo/sysMgt/notiList', url: '/api/v1/bo/sysMgt/notiList',
@@ -122,45 +87,32 @@ export default {
addCls: 'box_OFvis', addCls: 'box_OFvis',
initialRequest: false, initialRequest: false,
columns: [ columns: [
{ name: 'sndYmd', header: '발송 날짜', align: 'center', width: '15%' }, { name: 'day', header: '날짜', align: 'center', width: '15%' },
{ name: 'userId', header: '유저 ID', align: 'center', width: '15%' }, { name: 'userId', header: '시작 시간', align: 'center', width: '15%' },
{ name: 'notiDiv', header: '알림 구분', align: 'center', width: '15%' }, { name: 'notiDiv', header: '종료 시간', align: 'center', width: '15%' },
{ name: 'webReqId', header: '웹요청 ID', align: 'center', width: '20%' }, { name: 'webReqId', header: '상태 변경', align: 'center', width: '20%' },
// { name: 'regDt', header: '등록 일시', align: 'center', width: '15%' },
], ],
noDataStr: '발송 내역이 없습니다.', noDataStr: '발송 내역이 없습니다.',
params: { params: {
startDt: '',
endDt: '',
search: '',
srchGbn: '',
srchGbn2: ''
}, },
StartTime : null, startTime : '',
EndTime : null, endTime : '',
state: 'use'
}, },
}; };
}, },
components: { components: {
customGrid: customGrid, customGrid: customGrid,
vuejsDatepicker, vuejsDatepicker,
Timepicker, VueTimepicker,
}, },
created() { created() {
this.setPeriodDay(0);
}, },
destroyed() { destroyed() {
// this.$store.commit('dataStore/updateDataStore', ''); // this.$store.commit('dataStore/updateDataStore', '');
this.$store.commit('searchcondition/updateSearchCondition', { this.$store.commit('searchcondition/updateSearchCondition', {
page: 1,
perPage: 50,
params: { params: {
startDt: '',
endDt: '',
search: '',
srchGbn: '',
srchGbn2: ''
}, },
}); });
}, },
@@ -182,9 +134,30 @@ export default {
}, },
methods: { methods: {
save(){ fnSaveTxt(){
alert("저장!") let params = {
} startDate : this.startDate,
startTime : this.startTime,
endTime : this.endTime,
state : this.state,
}
sysMgtApi.setWorkState(params);
},
search: function (isKeep) {
this.$refs.table.search(this.grid.params, isKeep);
},
customFormatter: function (date) {
if (this.sDateDiv == 'month') {
return moment(date).format('YYYY-MM');
} else if (this.sDateDiv == 'year') {
return moment(date).format('YYYY');
} else {
return moment(date).format('YYYY-MM-DD');
}
},
} }
}; };
</script> </script>

View File

@@ -14,6 +14,7 @@ import kr.co.uplus.ez.common.components.ValidComponents;
import kr.co.uplus.ez.common.components.WebClientRequestService; import kr.co.uplus.ez.common.components.WebClientRequestService;
import kr.co.uplus.ez.common.data.ApiResponseCode; import kr.co.uplus.ez.common.data.ApiResponseCode;
import kr.co.uplus.ez.common.data.Const; import kr.co.uplus.ez.common.data.Const;
import springfox.documentation.spring.web.json.Json;
import org.apache.http.HttpStatus; import org.apache.http.HttpStatus;
import org.apache.http.protocol.HTTP; import org.apache.http.protocol.HTTP;
@@ -274,8 +275,8 @@ public class SysMgtController {
/** /**
* data: 2022. 10.24. * data: 2022. 10.24.
* auth: Lee minha * auth: Lee
* desc: 배치 리스트 조회 * desc: 배치 리스트 조회.
* @return * @return
*/ */
@ApiOperation(value = "batchList", notes = "배치 리스트 조회") @ApiOperation(value = "batchList", notes = "배치 리스트 조회")
@@ -286,9 +287,9 @@ public class SysMgtController {
} }
/** /**
* data : 2022. 10. 26 * date : 2022. 10. 26
* auth : Lee minha * auth : Lee
* desc : 배치 상세내용 * desc : 배치 상세내용.
* @return * @return
*/ */
@@ -299,16 +300,21 @@ public class SysMgtController {
public BatchDetailResDto batchDetail(@RequestBody @Valid BatchDetailReqDto batchDetailReqDto, public BatchDetailResDto batchDetail(@RequestBody @Valid BatchDetailReqDto batchDetailReqDto,
BindingResult bindingResult) { BindingResult bindingResult) {
if (validComponents.validParameter(bindingResult)) { if (validComponents.validParameter(bindingResult)) {
return new BatchDetailResDto(ApiResponseCode.CM_PARAMETER_ERROR); return new BatchDetailResDto(ApiResponseCode.CM_PARAMETER_ERROR);
} }
// batchDetailReqDto.setBatchId("BATCH_010");
logger.debug("param 확인 : "+ batchDetailReqDto);
return sysService.batchDetail(batchDetailReqDto); return sysService.batchDetail(batchDetailReqDto);
} }
/**
* date : 2022. 10. 26
* auth : Lee
* @param batchReqMap
* @return
*/
@RequestMapping(value = "batchExecuteJob", method = {RequestMethod.POST}) @RequestMapping(value = "batchExecuteJob", method = {RequestMethod.POST})
@ResponseBody @ResponseBody
public BatchExeLogResDto batchExecuteJob(@RequestBody @Valid Map<Object, Object> batchReqMap) { public BatchExeLogResDto batchExecuteJob(@RequestBody @Valid Map<Object, Object> batchReqMap) {
@@ -324,35 +330,22 @@ public class SysMgtController {
String dayBatch = "yyyyMMdd"; String dayBatch = "yyyyMMdd";
String timeBatch = "yyyyMMddHHmmss"; String timeBatch = "yyyyMMddHHmmss";
SimpleDateFormat monthDateFormat = new SimpleDateFormat(monthBatch); SimpleDateFormat monthDateFormat = new SimpleDateFormat(monthBatch);
SimpleDateFormat dayDateFormat = new SimpleDateFormat(dayBatch); SimpleDateFormat dayDateFormat = new SimpleDateFormat(dayBatch);
SimpleDateFormat timeDateFormat = new SimpleDateFormat(timeBatch); SimpleDateFormat timeDateFormat = new SimpleDateFormat(timeBatch);
logger.info("callUrl={}",callUrl); logger.info("callUrl={}",callUrl);
String jobId = (String) batchReqMap.get("batchId"); String jobId = (String) batchReqMap.get("batchId");
String batchType = (String) batchReqMap.get("batchType");
String strDate = (String) batchReqMap.get("strDate"); String strDate = (String) batchReqMap.get("strDate");
logger.info("유입날짜 확인 {}",batchReqMap.get("strDate")); logger.info("batchExecuteJob input Date Check = {}",batchReqMap.get("strDate"));
logger.debug("확인 batchType={}",batchType);
// 배치 타입 : 일배치, 월배치, 매시간
if("월배치".equals(batchType)) {
if( logger.debug("월배치 batchType={}",batchType);
//월배치일 경우 날짜
jobId.equals("BATCH_001")||
jobId.equals("BATCH_002")||
jobId.equals("BATCH_004")||
jobId.equals("BATCH_005")||
jobId.equals("BATCH_006")||
jobId.equals("BATCH_009")||
jobId.equals("BATCH_011")||
jobId.equals("BATCH_017")||
jobId.equals("BATCH_020")) {
try { try {
Date date = new SimpleDateFormat("yyyy-MM-dd").parse(strDate); Date date = new SimpleDateFormat("yyyy-MM-dd").parse(strDate);
strDate = (String)monthDateFormat.format(date); strDate = (String)monthDateFormat.format(date);
@@ -360,32 +353,17 @@ public class SysMgtController {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e1.printStackTrace(); e1.printStackTrace();
} }
}else if("일배치".equals(batchType)) {
} else if ( logger.debug("일배치 batchType={}",batchType);
//일배치일 경우 날짜
jobId.equals("BATCH_003")||
jobId.equals("BATCH_008")||
jobId.equals("BATCH_010")||
jobId.equals("BATCH_012")||
jobId.equals("BATCH_013")||
jobId.equals("BATCH_014")||
jobId.equals("BATCH_015")||
jobId.equals("BATCH_018")||
jobId.equals("BATCH_019")||
jobId.equals("BATCH_021")||
jobId.equals("BATCH_022")||
jobId.equals("BATCH_023")){
try { try {
Date date = new SimpleDateFormat("yyyy-MM-dd").parse(strDate); Date date = new SimpleDateFormat("yyyy-MM-dd").parse(strDate);
strDate = (String)dayDateFormat.format(date); strDate = (String)dayDateFormat.format(date);
} catch (ParseException e1) { } catch (ParseException e1) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e1.printStackTrace(); e1.printStackTrace();
} }
}else if("매시간".equals(batchType)) {
} else { logger.debug("매시간 batchType={}",batchType);
try { try {
Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").parse(strDate); Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").parse(strDate);
strDate = (String)timeDateFormat.format(date); strDate = (String)timeDateFormat.format(date);
@@ -394,7 +372,7 @@ public class SysMgtController {
e1.printStackTrace(); e1.printStackTrace();
} }
} }
try { try {
jsonObject.put("strDate", strDate); jsonObject.put("strDate", strDate);
@@ -449,4 +427,10 @@ public class SysMgtController {
return sysService.notiList(notiListReqDto); return sysService.notiList(notiListReqDto);
} }
@RequestMapping(value = "/setWorkState", method = {RequestMethod.POST})
@ResponseBody
public void setWorkState(@RequestBody @Valid Object setWorkParam) {
logger.debug("setWorkParam={}",setWorkParam);
}
} }

View File

@@ -15,6 +15,12 @@ public class BatchDetailReqDto implements Serializable{
//배치 아이디 //배치 아이디
private String batchId; private String batchId;
//배치명
private String batchNm;
//배치 유형
private String batchType;
//검색 시작일 //검색 시작일
private String startDt; private String startDt;