앱승인시 예상완료일 항목 추가 & 승인요청 상세 조회시 "진행중"으로 상태변경
This commit is contained in:
@@ -38,12 +38,22 @@
|
|||||||
var loginUser = '<%= loginVo.getUserId() %>';
|
var loginUser = '<%= loginVo.getUserId() %>';
|
||||||
var url = '<c:url value="/onl/apim/approval/portalApprovalMan.json" />';
|
var url = '<c:url value="/onl/apim/approval/portalApprovalMan.json" />';
|
||||||
var url_view = '<c:url value="/onl/apim/approval/portalApprovalMan.view" />';
|
var url_view = '<c:url value="/onl/apim/approval/portalApprovalMan.view" />';
|
||||||
|
|
||||||
|
function dateFormat(cellvalue) {
|
||||||
|
if ( cellvalue == null || cellvalue.length < 8 )
|
||||||
|
return '';
|
||||||
|
return cellvalue.substr(0 ,4) + '-' +
|
||||||
|
cellvalue.substr(4, 2) + '-' +
|
||||||
|
cellvalue.substr(6, 2) ;
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
var key = "${param.id}";
|
var key = "${param.id}";
|
||||||
if (key) {
|
if (key) {
|
||||||
detail(key);
|
detail(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#expectEndDate").datepicker().inputmask("yyyy-mm-dd", {'autoUnmask': true});
|
||||||
|
|
||||||
$("#btn_app_approve").click(function () {
|
$("#btn_app_approve").click(function () {
|
||||||
if (confirm("승인하시겠습니까?")) {
|
if (confirm("승인하시겠습니까?")) {
|
||||||
@@ -112,6 +122,28 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#btn_modify").click(function () {
|
||||||
|
if (confirm("수정하시겠습니까?")) {
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: url,
|
||||||
|
data: {cmd: "UPDATE", id: key, expectEndDate: $("#expectEndDate").val().replaceAll('-','')},
|
||||||
|
success: function (args) {
|
||||||
|
alert("수정되었습니다.");
|
||||||
|
if (window.dialogArguments && window.dialogArguments.self) {
|
||||||
|
window.dialogArguments.self.location.reload();
|
||||||
|
} else if (window.opener) {
|
||||||
|
window.opener.location.reload();
|
||||||
|
}
|
||||||
|
window.close();
|
||||||
|
},
|
||||||
|
error: function (e) {
|
||||||
|
alert(e.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$("#btn_close").click(function () {
|
$("#btn_close").click(function () {
|
||||||
window.close();
|
window.close();
|
||||||
@@ -126,12 +158,25 @@
|
|||||||
data: {cmd: 'DETAIL', id: key},
|
data: {cmd: 'DETAIL', id: key},
|
||||||
success: function (json) {
|
success: function (json) {
|
||||||
var data = json;
|
var data = json;
|
||||||
|
|
||||||
|
if (data.approvalStatus.code == 'END') {
|
||||||
|
$('#btn_modify').hide();
|
||||||
|
$('#expectEndDate').hide();
|
||||||
|
$('#spExpectEndDate').show();
|
||||||
|
$('#spExpectEndDate').text(dateFormat(data.expectEndDate));
|
||||||
|
} else {
|
||||||
|
$('#btn_modify').show();
|
||||||
|
$('#expectEndDate').show();
|
||||||
|
$('#spExpectEndDate').hide();
|
||||||
|
}
|
||||||
|
|
||||||
$("#approvalType").text(data.approvalType === 'USER' ? "법인사용자" : "API 사용");
|
$("#approvalType").text(data.approvalType === 'USER' ? "법인사용자" : "API 사용");
|
||||||
$("#approvalStatus").text(data.approvalStatus.description);
|
$("#approvalStatus").text(data.approvalStatus.description);
|
||||||
$("#requesterName").text(data.requester.userName);
|
$("#requesterName").text(data.requester.userName);
|
||||||
$("#approvalSubject").text(data.approvalSubject);
|
$("#approvalSubject").text(data.approvalSubject);
|
||||||
$("#approvalDetail").html(data.approvalDetail);
|
$("#approvalDetail").html(data.approvalDetail);
|
||||||
$("#createdDate").text(data.createdDate).inputmask("9999-99-99 99:99:99.999", {'autoUnmask': true});
|
$("#createdDate").text(data.createdDate).inputmask("9999-99-99 99:99:99.999", {'autoUnmask': true});
|
||||||
|
$("#expectEndDate").val(data.expectEndDate);
|
||||||
|
|
||||||
if (data.approvers.some(approver =>
|
if (data.approvers.some(approver =>
|
||||||
approver.approverStatus === 'CURRENT' &&
|
approver.approverStatus === 'CURRENT' &&
|
||||||
@@ -144,7 +189,7 @@
|
|||||||
document.getElementById("btn_app_reject").style.display = "none";
|
document.getElementById("btn_app_reject").style.display = "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.approvalStatus.description === '배포실패') {
|
if (data.approvalStatus.code === 'FAILED') {
|
||||||
document.getElementById("btn_app_redeploy").style.display = "";
|
document.getElementById("btn_app_redeploy").style.display = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,9 +287,14 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>상세 내용</th>
|
<th>상세 내용</th>
|
||||||
<td colspan="3">
|
<td>
|
||||||
<div id="approvalDetail" style="white-space: pre-wrap;"></div>
|
<div id="approvalDetail" style="white-space: pre-wrap;"></div>
|
||||||
</td>
|
</td>
|
||||||
|
<th>예상완료일</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="expectEndDate" style="width: 120px; text-align:center"/>
|
||||||
|
<span id="spExpectEndDate"></span>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@@ -282,6 +332,9 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="popup_button">
|
<div class="popup_button">
|
||||||
|
<button type="button" class="cssbtn" id="btn_modify" level="W"><i
|
||||||
|
class="material-icons">save</i>수정
|
||||||
|
</button>
|
||||||
<button type="button" class="cssbtn" style="display: none;" id="btn_app_approve" level="W"><i
|
<button type="button" class="cssbtn" style="display: none;" id="btn_app_approve" level="W"><i
|
||||||
class="material-icons">check</i>승인
|
class="material-icons">check</i>승인
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -21,6 +21,14 @@
|
|||||||
'USER': '법인사용자',
|
'USER': '법인사용자',
|
||||||
'APP': 'API 사용'
|
'APP': 'API 사용'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function dateFormat(cellvalue, options, rowObject) {
|
||||||
|
if ( cellvalue == null || cellvalue.length < 8 )
|
||||||
|
return '';
|
||||||
|
return cellvalue.substr(0 ,4) + '-' +
|
||||||
|
cellvalue.substr(4, 2) + '-' +
|
||||||
|
cellvalue.substr(6, 2) ;
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#grid').jqGrid({
|
$('#grid').jqGrid({
|
||||||
@@ -33,7 +41,7 @@
|
|||||||
searchApprovalStatus: $('select[name=searchApprovalStatus]').val(),
|
searchApprovalStatus: $('select[name=searchApprovalStatus]').val(),
|
||||||
searchApprovalSubject: $('input[name=searchApprovalSubject]').val()
|
searchApprovalSubject: $('input[name=searchApprovalSubject]').val()
|
||||||
},
|
},
|
||||||
colNames: ['No.', 'id', '제목', '승인 유형', '승인 유형', '승인 상태','요청자', '생성일'],
|
colNames: ['No.', 'id', '제목', '승인 유형', '승인 유형', '승인 상태','요청자', '생성일', '예상완료일'],
|
||||||
colModel: [
|
colModel: [
|
||||||
{ name: 'rowNum', align: 'center', width: '30', sortable: false},
|
{ name: 'rowNum', align: 'center', width: '30', sortable: false},
|
||||||
{ name: 'id', align: 'center', key: true, hidden: true },
|
{ name: 'id', align: 'center', key: true, hidden: true },
|
||||||
@@ -42,7 +50,8 @@
|
|||||||
{ name: 'approvalType', align: 'center', width: 80, hidden: true},
|
{ name: 'approvalType', align: 'center', width: 80, hidden: true},
|
||||||
{ name: 'approvalStatus.description', align: 'center', width: 80 },
|
{ name: 'approvalStatus.description', align: 'center', width: 80 },
|
||||||
{ name: 'requester.userName', align: 'center', width: 100 },
|
{ name: 'requester.userName', align: 'center', width: 100 },
|
||||||
{ name: 'createdDate', align: 'center', width: 120, formatter: 'date', formatoptions: { srcformat: 'ISO8601Long', newformat: 'Y-m-d H:i:s' } }
|
{ name: 'createdDate', align: 'center', width: 120, formatter: 'date', formatoptions: { srcformat: 'ISO8601Long', newformat: 'Y-m-d H:i:s' } },
|
||||||
|
{ name: 'expectEndDate', align: 'center', width: 100, formatter: dateFormat},
|
||||||
],
|
],
|
||||||
jsonReader: {
|
jsonReader: {
|
||||||
repeatitems: false
|
repeatitems: false
|
||||||
@@ -134,8 +143,8 @@
|
|||||||
<div class="select-style">
|
<div class="select-style">
|
||||||
<select name="searchApprovalStatus">
|
<select name="searchApprovalStatus">
|
||||||
<option value="">전체</option>
|
<option value="">전체</option>
|
||||||
<option value="CREATED">생성됨</option>
|
|
||||||
<option value="REQUESTED">요청됨</option>
|
<option value="REQUESTED">요청됨</option>
|
||||||
|
<option value="PROCESSING">진행중</option>
|
||||||
<option value="DENIED">반려됨</option>
|
<option value="DENIED">반려됨</option>
|
||||||
<option value="END">승인됨</option>
|
<option value="END">승인됨</option>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -76,4 +76,10 @@ public class PortalApprovalManController extends BaseAnnotationController {
|
|||||||
portalApprovalManService.redeploy(id);
|
portalApprovalManService.redeploy(id);
|
||||||
return ResponseEntity.ok().build();
|
return ResponseEntity.ok().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/onl/apim/approval/portalApprovalMan.json", params = "cmd=UPDATE")
|
||||||
|
public ResponseEntity<Void> update(String id, String expectEndDate) {
|
||||||
|
portalApprovalManService.update(id, expectEndDate);
|
||||||
|
return ResponseEntity.ok().build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,16 @@ public class PortalApprovalManService extends BaseService {
|
|||||||
* 마스킹된 상세 정보 조회
|
* 마스킹된 상세 정보 조회
|
||||||
*/
|
*/
|
||||||
public PortalApprovalUI selectDetail(String id) {
|
public PortalApprovalUI selectDetail(String id) {
|
||||||
|
//2026.06.05 관리자가 승인요청을 조회시 심사중으로 상태 변경
|
||||||
|
//APP 유형이고 REQUESTED 상태인 경우 관리자 조회 시 PROCESSING으로 변경
|
||||||
|
approvalService.findById(id).ifPresent(approval -> {
|
||||||
|
if (approval.getApprovalType().equals(ApprovalType.APP)
|
||||||
|
&& approval.getApprovalStatus() instanceof RequestedState) {
|
||||||
|
approval.setApprovalStatus(new ProcessingState());
|
||||||
|
approvalService.save(approval);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
PortalApprovalUI result = getDetailWithMaskOption(id, false);
|
PortalApprovalUI result = getDetailWithMaskOption(id, false);
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
throw new IllegalArgumentException("승인 정보를 찾을 수 없습니다. ID: " + id);
|
throw new IllegalArgumentException("승인 정보를 찾을 수 없습니다. ID: " + id);
|
||||||
@@ -320,6 +330,13 @@ public class PortalApprovalManService extends BaseService {
|
|||||||
sendEvent(id, ApprovalEvent.DENY, options);
|
sendEvent(id, ApprovalEvent.DENY, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void update(String id, String expectEndDate) {
|
||||||
|
Approval approval = approvalService.findById(id)
|
||||||
|
.orElseThrow(() -> new IllegalArgumentException("승인 정보를 찾을 수 없습니다. ID: " + id));
|
||||||
|
approval.setExpectEndDate(expectEndDate);
|
||||||
|
approvalService.save(approval);
|
||||||
|
}
|
||||||
|
|
||||||
public void redeploy(String id) {
|
public void redeploy(String id) {
|
||||||
Map options = new HashMap<>();
|
Map options = new HashMap<>();
|
||||||
Approval approval = approvalService.findById(id).orElseThrow(() -> new IllegalArgumentException("승인 정보를 찾을 수 없습니다. ID: " + id));
|
Approval approval = approvalService.findById(id).orElseThrow(() -> new IllegalArgumentException("승인 정보를 찾을 수 없습니다. ID: " + id));
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ public class PortalApprovalUI {
|
|||||||
@DateTimeFormat(pattern = "yyyyMMddHHmmssSSS")
|
@DateTimeFormat(pattern = "yyyyMMddHHmmssSSS")
|
||||||
private String approvalDate;
|
private String approvalDate;
|
||||||
|
|
||||||
|
private String expectEndDate;
|
||||||
|
|
||||||
public String getApprovalTypeDescription() {
|
public String getApprovalTypeDescription() {
|
||||||
return approvalType != null ? approvalType.getDescription() : "";
|
return approvalType != null ? approvalType.getDescription() : "";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user