|
|
@@ -29,6 +29,8 @@
|
|
|
<div class="panelStyle">
|
|
|
<!-- Search -->
|
|
|
<form id="searchForm" name="searchForm" action="#" th:action="@{'/system/batch/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
|
|
|
+ <input type="hidden" name="batchId"/>
|
|
|
+
|
|
|
<table class="frmStyle" aria-describedby="검색조건">
|
|
|
<colgroup>
|
|
|
<col style="width:10%;"/>
|
|
|
@@ -138,6 +140,12 @@
|
|
|
<textarea class="textareaR2" name="batchDesc"></textarea>
|
|
|
</td>
|
|
|
</tr>
|
|
|
+ <tr>
|
|
|
+ <th>배치URL</th>
|
|
|
+ <td colspan="3">
|
|
|
+ <input type="text" name="batchUrl" placeholder="" maxlength="100"/>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
<tr>
|
|
|
<th>사용여부<em class="required" title="필수"></em></th>
|
|
|
<td colspan="3">
|
|
|
@@ -179,7 +187,7 @@
|
|
|
},
|
|
|
{headerName: "배치명", field: "batchNm", width: 200},
|
|
|
{
|
|
|
- headerName: "업무구분", field: "bizGb", width: 80, cellClass: 'text-center',
|
|
|
+ headerName: "업무구분", field: "bizGb", width: 100, cellClass: 'text-center',
|
|
|
cellRenderer: function (params) { return gagaAgGrid.lookupValue(bizGbList, params.value); }
|
|
|
},
|
|
|
{
|
|
|
@@ -192,7 +200,25 @@
|
|
|
return batchFrqNm;
|
|
|
}
|
|
|
},
|
|
|
+ {headerName: "상태", field: "batchStat", width: 80, cellClass: 'text-center', hide: true},
|
|
|
+ {
|
|
|
+ headerName: "실행", field: "btnNm", width: 120, cellClass: 'text-center',
|
|
|
+ cellRenderer: function(params) {
|
|
|
+ let btnNm = '';
|
|
|
+ if (params.data.useYn == 'N') {
|
|
|
+ btnNm = '미사용';
|
|
|
+ } else {
|
|
|
+ if (gagajf.isNull(params.data.batchStat) || params.data.batchStat == 'F') {
|
|
|
+ btnNm = '<button type="button" class="btn btn-base btn-lg" onclick="fnExcuteBatch(\'' + params.data.batchId + '\',\'' + params.data.batchStat + '\',\'' + params.data.batchUrl + '\');">실행</button>';
|
|
|
+ } else {
|
|
|
+ btnNm = '실행중';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return btnNm;
|
|
|
+ }
|
|
|
+ },
|
|
|
{headerName: "배치설명", field: "batchDesc", width: 400, hide: true},
|
|
|
+ {headerName: "배치URL", field: "batchUrl", width: 200},
|
|
|
{headerName: "사용여부", field: "useYn", width: 80, cellClass: 'text-center'}
|
|
|
];
|
|
|
|
|
|
@@ -233,9 +259,10 @@
|
|
|
|
|
|
// Cell Click
|
|
|
gridOptions1.onCellClicked = function(event) {
|
|
|
- if (event.colDef.field != 'batchId')
|
|
|
- return;
|
|
|
-
|
|
|
+ if (event.colDef.field != 'batchId') {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
$('#detailForm input[name=mode]').val('U');
|
|
|
$('#detailForm input[name=batchId]').val(event.data.batchId);
|
|
|
$('#detailForm input[name=batchId]').attr('readonly', true);
|
|
|
@@ -243,6 +270,7 @@
|
|
|
$('#detailForm select[name=bizGb]').val(event.data.bizGb);
|
|
|
$('#detailForm select[name=batchFrq]').val(event.data.batchFrq);
|
|
|
$('#detailForm textarea[name=batchDesc]').val(event.data.batchDesc);
|
|
|
+ $('#detailForm input[name=batchUrl]').val(event.data.batchUrl);
|
|
|
|
|
|
if (event.data.useYn == 'Y') {
|
|
|
$("#detailForm input:checkbox[name=chkUseYn]").prop('checked', true);
|
|
|
@@ -253,6 +281,34 @@
|
|
|
}
|
|
|
|
|
|
$('#detailForm input:checkbox[name=chkUseYn]').attr('readonly', false);
|
|
|
+
|
|
|
+ // 배치로그 조회
|
|
|
+ fnGetBatchLogByBatchId(event.data.batchId);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 배치 실행
|
|
|
+ var fnExcuteBatch = function(batchId, batchStat, batchUrl) {
|
|
|
+ if (batchStat == 'I') {
|
|
|
+ mcxDialog.alert("실행중입니다. 종료되면 실행해 주세요.");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (gagajf.isNull(batchUrl)) {
|
|
|
+ mcxDialog.alert("배치URL 정보가 없습니다. 등록 후 실행해 주세요.");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ mcxDialog.confirm("배치는 몇 분이 소요될 수 있으며 나중에 확인하셔야 할 수도 있습니다.<br/>계속 진행하시겠습니까?", {
|
|
|
+ cancelBtnText: "취소",
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function() {
|
|
|
+ let actionUrl = [[${@environment.getProperty('domain.batch')}]] + batchUrl;
|
|
|
+ $.get(actionUrl, function(result) {
|
|
|
+ // 배치로그 조회
|
|
|
+ fnGetBatchLogByBatchId(batchId);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
// 조회
|
|
|
@@ -295,6 +351,12 @@
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+ // 배치로그 조회
|
|
|
+ var fnGetBatchLogByBatchId = function(batchId) {
|
|
|
+ $('#searchForm input[name=batchId]').val(batchId);
|
|
|
+ gagaAgGrid.fetch('/system/batch/log/list', gridOptions2, '#searchForm');
|
|
|
+ }
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
cfnCreateCalendar('#terms', 'batchStdt', 'batchEddt');
|