알림톡 목록에 발송승인, 발송취소 버튼 추가

This commit is contained in:
itn 2023-09-20 15:08:05 +09:00
parent c0c882db7a
commit adc496aa65
2 changed files with 175 additions and 3 deletions

View File

@ -259,6 +259,10 @@ public class MjonKakaoATController {
System.out.println("sendKakaoATList Controller Error !!! " +e);
}
// 로그인VO에서 사용자 정보 가져오기
String admId = loginVO == null ? "" : loginVO.getId();
model.addAttribute("admId", admId);
return "/uss/ion/kakaoat/SendKakaoATList";
}

View File

@ -27,6 +27,8 @@
response.setDateHeader("Expires",0);
if (request.getProtocol().equals("HTTP/1.1")) response.setHeader("Cache-Control", "no-cache");
%>
<jsp:useBean id="now" class="java.util.Date" />
<!DOCTYPE html>
<html lang="ko">
<head>
@ -373,6 +375,156 @@ function fnAtSmishingUpdate(flag) {
}
}
}
//지연 알림톡 즉시 발송
function kakaoATDelaySend(msgGroupId, userId){
var msg = "";
var url = "/uss/ion/msg/updateKakaoATDelaySendRealTimeDataAjax.do";
var json = {"msgGroupId" : msgGroupId, "userId" : userId};
if(confirm("해당 지연 알림톡을 즉시 발송 하시겠습니까?")){
$.ajax({
type: "POST"
, url: url
, data: json
, dataType:'json'
, async: false
, success: function (data, status) {
var result = data.isStatus;
var msg = data.msg;
if (result == 'loginFail') {
alert(msg);
location.reload();
}else if(result == 'dateFail'){
alert(msg);
location.reload();
}else if(result == 'fail'){
alert(msg);
return false;
}else{
alert(msg);
location.reload();
}
}
, beforeSend: function () {
//로딩창 show
$('.loading_layer').addClass('active');
}
, complete: function () {
//로딩창 hide
$('.loading_layer').removeClass('active');
}
, error: function (e) {
alert("에러가 발생했습니다."); console.log("ERROR : ", e);
}
});
}
}
//지연 알림톡 발송취소
function kakaoATDelayCancel(msgGroupId, userId){
var msg = "";
var url = "/uss/ion/msg/deleteKakaoATDelaySendCancelDataAjax.do";
var json = {"msgGroupId" : msgGroupId, "userId" : userId};
if(confirm("해당 지연 알림톡을 발송취소 하시겠습니까?")){
$.ajax({
type: "POST"
, url: url
, data: json
, dataType:'json'
, async: false
, success: function (data, status) {
var result = data.isStatus;
var msg = data.msg;
if (result == 'loginFail') {
alert(msg);
location.reload();
}else if(result == 'dateFail'){
alert(msg);
location.reload();
}else if(result == 'fail'){
alert(msg);
return false;
}else{
alert(msg);
//회원 이용정지 처리하기
fn_MsgDelayCancel_after(userId);
}
}
, beforeSend: function () {
//로딩창 show
$('.loading_layer').addClass('active');
}
, complete: function () {
//로딩창 hide
$('.loading_layer').removeClass('active');
}
, error: function (e) {
alert("에러가 발생했습니다."); console.log("ERROR : ", e);
}
});
}
}
//문자 지연 내역 발송 취소를 통한 회원 이용정지시
function fn_MsgDelayCancel_after(userId){
var mberSttus = $('#mberSttus').val();
mberSttus = "B"; //이용자 정지 처리
var smiMemo = "관리자가 최근 문자 지연 내역에서 스미싱의심으로 판단하여 발송취소를 한 후 이용자 정지 처리함";
fn_SpamMberUpdt(userId, mberSttus, smiMemo, "이용자 정지를 진행하시겠습니까?");
}
//회원 이용정지 처리
function fn_SpamMberUpdt(userId, p_mberSttus, p_smiMemo, p_confirm_msg) {
url = "/uss/umt/user/EgovGnrlUpdateUserMsttusAjax.do";
var json = {"mberId" : userId, "mberSttus" : p_mberSttus, "smiMemo" : p_smiMemo};
if(confirm(p_confirm_msg)){
$.ajax({
type: "POST",
url: url,
data: json,
dataType:'json',
async: false,
success: function (returnData, status) {
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
if("fail"==returnData.result){
alert(returnData.message);
return false;
}else if("loginFail"==returnData.result){
alert(returnData.message);
return false;
}else{ //이용자 상태 변경 성공시 처리
alert(returnData.message);
location.reload();
}
} else if(status== 'fail'){
alert("이용자 상태 변경에 실패하였습니다.");
}
},
beforeSend: function () {
//로딩창 show
$('.loading_layer').addClass('active');
},
complete: function () {
//로딩창 hide
$('.loading_layer').removeClass('active');
},
error: function (e) { alert("이용자 상태 변경에 실패하였습니다."); console.log("ERROR : ", e); }
});
}
else {
location.reload();
}
}
</script>
<style>
.calBtn{
@ -393,6 +545,10 @@ function fnAtSmishingUpdate(flag) {
.pageCont .tbType1 tbody tr td.sms_detail .sms_detail_hover {overflow:hidden;text-overflow:ellipsis;display:none;word-wrap:break-word;-webkit-line-clamp:20;-webkit-box-orient:vertical;position:absolute;left:-50px;top:45px;width:calc(100% + 150px);padding:15px;line-height:20px;white-space:normal;border:1px solid #e5e5e5;background:#fff;border-radius:5px;box-sizing:border-box;box-shadow:0px 3px 10px 0px rgb(0 0 0 / 0.2);z-index:1;font-size:14px;text-align:left;}
.pageCont .tbType1 tbody tr td.sms_detail .sms_detail_hover:after {content:'';position:absolute;left:0;bottom:0;width:100%;height:10px;background:#fff;border-radius:0 0 5px 5px;}
.pageCont .tbType1 tbody tr td.sms_detail:hover .sms_detail_hover {display:-webkit-box;}
.pageCont .tbType1 tbody tr td .fillBlue {margin-top:5px;height:25px;padding:3 3px;font-size:13px;text-align:center;color:#ffffff !important;background:#456ded;border-radius:3px;}
.pageCont .tbType1 tbody tr td .fillRed {margin-top:5px;height:25px;padding:3 3px;font-size:13px;text-align:center;color:#ffffff !important;background:#e40000;border-radius:3px;}
</style>
</head>
<body>
@ -493,13 +649,12 @@ function fnAtSmishingUpdate(flag) {
<col style="width: 5%">
<col style="width: 13%">
<col style="width: 13%">
<%-- <col style="width: 10%"> --%>
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 13%">
<col style="width: 10%">
<col style="width: 5%">
<col style="width: auto">
<col style="width: 10%">
<col style="width: 7%">
</colgroup>
<thead>
<tr>
@ -575,6 +730,19 @@ function fnAtSmishingUpdate(flag) {
<c:when test="${result.atDelayCompleteYn eq 'N'}">
<c:if test="${result.atSmishingYn eq 'Y'}">온</c:if>
<c:if test="${result.atSmishingYn eq 'N'}">오프</c:if>[미처리]
<c:if test="${admId eq 'jsp'}">
<c:if test="${result.reserveCYn eq 'N' && result.atDelayYn eq 'Y' && result.atDelayCompleteYn eq 'N'}">
<br />
<fmt:formatDate value="${now}" pattern="yyyyMMddhhmm" var="nowDate" />
<fmt:parseDate value="${result.reqDate}" pattern="yyyy-MM-dd HH:mm" var="checkValue" />
<fmt:formatDate value="${checkValue}" pattern="yyyyMMddhhmm" var="checkDate"/>
<c:if test="${nowDate < checkDate}">
<button type="button" class="fillBlue" onclick="kakaoATDelaySend('<c:out value="${result.msgGroupId}"/>','<c:out value="${result.userId}"/>'); return false;">발송승인</button>
<button type="button" class="fillRed" onclick="kakaoATDelayCancel('<c:out value="${result.msgGroupId}"/>','<c:out value="${result.userId}"/>'); return false;">발송취소</button>
</c:if>
</c:if>
</c:if>
</c:when>
<c:otherwise>
<span style="color: #0000FF;">