diff --git a/src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java b/src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java index bc7b56b5..63992f06 100644 --- a/src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java +++ b/src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java @@ -4167,14 +4167,22 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M return statusResponse; } + float totalPrice = MsgSendUtils.setPriceforVO(mjonMsgSendVOList); + mjonMsgVO.setTotPrice(String.valueOf(totalPrice)); + + + if (!isCashSufficient(mjonMsgVO)) { + log.error("Insufficient balance for message sending."); + return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 발송에 필요한 보유 잔액이 부족 합니다."); + } + + System.out.println("==================== insert 시작 ===================="); // log.info("mj_msg_data insert start [{}]", mjonMsgSendVOList.size()); - float totalPrice = MsgSendUtils.setPriceforVO(mjonMsgSendVOList); // 합산 금액을 String으로 변환하여 설정 - mjonMsgVO.setTotPrice(String.valueOf(totalPrice)); // 분할 최대건수가 되면 디비에 입력하기 @@ -4217,11 +4225,7 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M } - - - - - // 한 줄 호출 + // 스팸 및 스미싱 의심이면 slack 알림 boolean isNotified = mjonCommon.processUserAndCheckSms(mjonMsgVO, userId); if (isNotified) { diff --git a/src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp b/src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp index 79175789..13ab7b18 100644 --- a/src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp @@ -2071,6 +2071,8 @@ function fnByteString(contents){ var adverTxt = $('.ad_txt').html(); var denyTxt = $('.deny_txt').html(); + totRows = tableL.getRows().length; + //광고문자 상단 문구 줄바꿈 처리하기(문자길이 바이트수 계산을 위해서) if(typeof adverTxt !='undefined' && adverTxt != null){ @@ -2217,7 +2219,6 @@ function fnByteString(contents){ fnReplCell_advc(); }else{ - var totalPrice = totalPriceSum(totRows); $('#totalPrice').text(totalPrice); $('#txtReplYn').val("N"); diff --git a/src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataView.jsp b/src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataView.jsp index f8f43c56..bf74003b 100644 --- a/src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataView.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataView.jsp @@ -1048,7 +1048,10 @@ function blineSendCheck(blineCode) { //문자발송 처리 함수 function fn_sendMsgData(){ - + + // 타블레이터 호출 + var $selectedData = tableL.getData(); // 데이터 가져오기 + if(!checkConf()){ //문자온 conf-check alert("현재 문자 발송하기 기능 점검 중입니다.\n\n1분 후 다시 시도해주세요."); return false; @@ -1059,12 +1062,10 @@ function fn_sendMsgData(){ var userMoneyOnly = stringReplaceAll(form.myPrice.value, ",", ""); // test 주석 - /* if(parseFloat(userMoneyOnly) < parseFloat(totPriceOnly)){ alert("문자 발송에 필요한 회원님의 보유 잔액이 부족 합니다."); return false; } - */ // 폼 유효성 검사 if (!validateForm(form)) return false; @@ -1081,6 +1082,11 @@ function fn_sendMsgData(){ } } + if($selectedData.length > 300000){ + alert("30만건까지 발송이 가능합니다.\n받는사람 목록을 확인해주세요."); + return false; + } + if(!confirm("문자를 전송하시겠습니까?")){ @@ -1115,6 +1121,7 @@ function fn_sendMsgData(){ } } + return false; console.log(' !!! imgFilePath : ', imgFilePath); // img 처리 영역 @@ -1394,6 +1401,7 @@ function validateForm(form) { // 타블레이터 호출 var $selectedData = tableL.getData(); // 데이터 가져오기 + if($selectedData.length < 1){ alert("받는사람 내역을 입력해주세요."); return false; diff --git a/src/main/webapp/WEB-INF/jsp/web/msgdata/include/msgDataIncludeExcel.jsp b/src/main/webapp/WEB-INF/jsp/web/msgdata/include/msgDataIncludeExcel.jsp index 8130bee3..93821c51 100644 --- a/src/main/webapp/WEB-INF/jsp/web/msgdata/include/msgDataIncludeExcel.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/msgdata/include/msgDataIncludeExcel.jsp @@ -328,14 +328,15 @@ $(document).ready(function(){ || smsTxtArea.indexOf("[*3*]") > -1 || smsTxtArea.indexOf("[*4*]") > -1){ - fnReplCell(); +// fnReplCell(); }else{ //결제 금액 구하기 - totalPriceSum(totRows); +// totalPriceSum(totRows); } + totalPriceSum(totRows); setAddrMassClose(); $('.field-selector').each(function() { $(this).val(''); }); diff --git a/src/main/webapp/js/txtSpecialReplace.js b/src/main/webapp/js/txtSpecialReplace.js index 65ce7577..8c2a3a33 100644 --- a/src/main/webapp/js/txtSpecialReplace.js +++ b/src/main/webapp/js/txtSpecialReplace.js @@ -1,5 +1,6 @@ function fnReplCell_advc(){ + console.log(':: fnReplCell_advc :: '); var smsTxtArea = $('#smsTxtArea').val(); console.log('smsTxtArea : ', smsTxtArea);