Merge branch 'advc' of http://hylee@vcs.iten.co.kr:9999/hylee/mjon_git
into advc
This commit is contained in:
parent
b2a89f11bd
commit
b7db0bd16e
@ -1116,7 +1116,7 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
int divideCnt = 0;
|
||||
int count = 1; // 분할 카운트
|
||||
String delayTime = "";// 30분 지연시간
|
||||
String spamStatus = mjonMsgVO.getSpamStatus();// 스팸 문구 유무
|
||||
String spamStatus = mjonMsgVO.getSpamStatus();// 스팸 문구 유무
|
||||
String smishingYn = mjonMsgVO.getSmishingYn();// 스미싱 의심 유무
|
||||
String delayYn = "N"; // 문자발송 30분 지연 처리 유무
|
||||
|
||||
@ -4043,42 +4043,48 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
|
||||
|
||||
|
||||
//장문 메세지일 경우
|
||||
int fileCount = 0;
|
||||
if(msgType.equals("6")) {
|
||||
// 장문 메시지일 경우 + 그림 이미지가 첨부된 경우
|
||||
if (msgType.equals("6")
|
||||
&& mjonMsgVO.getImgFilePath() != null
|
||||
&& mjonMsgVO.getImgFilePath().length > 0
|
||||
)
|
||||
{
|
||||
|
||||
//그림 이미지가 첨부된 경우
|
||||
if(mjonMsgVO.getImgFilePath() != null || mjonMsgVO.getImgFilePath().length > 0) {
|
||||
|
||||
String[] path = mjonMsgVO.getImgFilePath();
|
||||
String[] fileId = mjonMsgVO.getImgFileId();
|
||||
String[] templateYn = mjonMsgVO.getTemplateYn();
|
||||
|
||||
for(int i=0; i<path.length; i++) {
|
||||
|
||||
if("Y".equals(templateYn[i])) {
|
||||
//템플릿 사용누계 증가
|
||||
letterDAO.updateTemplateUseCount(fileId[i]);
|
||||
}
|
||||
|
||||
String imgFilePath = mjonMsgDAO.selectPhotoImgFileRealPath(fileId[i]);
|
||||
|
||||
switch (i) {
|
||||
case 0:
|
||||
mjonMsgVO.setFileName1(imgFilePath);
|
||||
break;
|
||||
case 1:
|
||||
mjonMsgVO.setFileName2(imgFilePath);
|
||||
break;
|
||||
default:
|
||||
mjonMsgVO.setFileName3(imgFilePath);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
fileCount ++;
|
||||
String[] path = mjonMsgVO.getImgFilePath();
|
||||
String[] fileId = mjonMsgVO.getImgFileId();
|
||||
String[] templateYn = mjonMsgVO.getTemplateYn();
|
||||
|
||||
for(int i=0; i<path.length; i++) {
|
||||
|
||||
if("Y".equals(templateYn[i])) {
|
||||
//템플릿 사용누계 증가
|
||||
letterDAO.updateTemplateUseCount(fileId[i]);
|
||||
}
|
||||
|
||||
String imgFilePath = mjonMsgDAO.selectPhotoImgFileRealPath(fileId[i]);
|
||||
|
||||
if (StringUtils.isEmpty(imgFilePath)) {
|
||||
return new StatusResponse(HttpStatus.NO_CONTENT, "문자 메세지 이미지 추가에 오류가 발생하여 문자 발송이 취소 되었습니다.");
|
||||
}
|
||||
|
||||
switch (i) {
|
||||
case 0:
|
||||
mjonMsgVO.setFileName1(imgFilePath);
|
||||
break;
|
||||
case 1:
|
||||
mjonMsgVO.setFileName2(imgFilePath);
|
||||
break;
|
||||
default:
|
||||
mjonMsgVO.setFileName3(imgFilePath);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
fileCount ++;
|
||||
|
||||
//첨부파일 갯수 셋팅해주기
|
||||
mjonMsgVO.setFileCnt(Integer.toString(fileCount));
|
||||
|
||||
@ -4089,10 +4095,10 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
|
||||
// 파일 갯수는 있는데 파일 경로가 없는 경우 문자발송이 안되도록 튕겨내도록 함 - 20220520 우영두
|
||||
// 리펙토링 20240930 이호영
|
||||
StatusResponse returnStatusResponse = MsgSendUtils.validateFilesForMessageSending(fileCount, mjonMsgVO);
|
||||
if (returnStatusResponse != null) {
|
||||
return returnStatusResponse;
|
||||
}
|
||||
// StatusResponse returnStatusResponse = MsgSendUtils.validateFilesForMessageSending(fileCount, mjonMsgVO);
|
||||
// if (returnStatusResponse != null) {
|
||||
// return returnStatusResponse;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@ -4143,7 +4149,7 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
return new StatusResponse(HttpStatus.INTERNAL_SERVER_ERROR, "이벤트 상태 처리 중 오류가 발생했습니다.");
|
||||
}
|
||||
// 이벤트 진행 회원의 발송 단가 처리
|
||||
if(eventMberInfo != null && "Y".equals(eventMberInfo.getEventStatus()) && compareEndDate) {
|
||||
if("Y".equals(eventMberInfo.getEventStatus()) && compareEndDate) {
|
||||
shortPrice = Float.parseFloat(eventMberInfo.getEventShortPrice());
|
||||
longPrice = Float.parseFloat(eventMberInfo.getEventLongPrice());
|
||||
picturePrice = Float.parseFloat(eventMberInfo.getEventPicturePrice());
|
||||
|
||||
@ -2064,9 +2064,9 @@ public class MjonMsgDataController {
|
||||
for(String spmTxt : resultSpamTxt) {
|
||||
|
||||
String parserStr = ComGetSpamStringParser.getSpamTextParse(spmTxt).trim();
|
||||
|
||||
|
||||
System.out.println("spmTxt : "+ spmTxt);
|
||||
if(resultParser.contains(parserStr)) {
|
||||
|
||||
//스팸 단어/문구가 있으면 콤마로 연결시킨 후 리턴해줌.
|
||||
spmFilterTxt += spmTxt + ",";
|
||||
spmCnt++;
|
||||
|
||||
@ -1341,12 +1341,15 @@ function fn_sendMsgData(){
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: spmData,
|
||||
|
||||
dataType:'json',
|
||||
async: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
success: function (returnData, status) {
|
||||
return false;
|
||||
|
||||
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
||||
|
||||
if("fail" == returnData.result){
|
||||
|
||||
@ -1050,20 +1050,25 @@ function fn_sendMsgData(){
|
||||
alert("현재 문자 발송하기 기능 점검 중입니다.\n\n1분 후 다시 시도해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var testString = document.msgForm.smsTxtArea.value;
|
||||
|
||||
var form = document.msgForm;
|
||||
|
||||
//회원 보유 잔액 비교
|
||||
var totPriceOnly = stringReplaceAll(form.totPrice.value, ",", "");
|
||||
var userMoneyOnly = stringReplaceAll(form.myPrice.value, ",", "");
|
||||
|
||||
if(parseFloat(userMoneyOnly) < parseFloat(totPriceOnly)){
|
||||
alert("문자 발송에 필요한 회원님의 보유 잔액이 부족 합니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
var loginVO = '${LoginVO}';
|
||||
if (!loginVO) {
|
||||
alert("문자발송 서비스는 로그인 후 이용 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 폼 유효성 검사
|
||||
if (!validateForm(form)) return false;
|
||||
|
||||
var adverYn = $("input[name='send_adYn']:checked").val();
|
||||
var spamStatus = false;
|
||||
var exceptSpamYn = $("#exceptSpamYn").val(); //금지어 필터링 예외 여부 - N 일 경우만 스팸 검사를 진행
|
||||
@ -1104,69 +1109,6 @@ function fn_sendMsgData(){
|
||||
// return false;
|
||||
//}
|
||||
|
||||
if(form.callFromList.value == ""){
|
||||
|
||||
alert("발신번호를 입력해 주세요.");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
var titleStatus = form.title_status.value;
|
||||
if(titleStatus == 'N'){//장문 제목 사용안함으로 선택시 제목에 있는 데이터 지워주기
|
||||
|
||||
form.mmsSubject.value = "";
|
||||
|
||||
}else{//장문 제목에 치환문자 포함된 경우 입력 못하도록 처리.
|
||||
|
||||
var mmsSubject = form.mmsSubject.value;
|
||||
if(getSpacialStringChk(mmsSubject)){
|
||||
alert("문자 제목에는 치환문자(엑셀 내 *이름*, *1*, *2*, *3*, *4* 등)를 사용하실 수 없습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//문자내용 첫글자에 특수기호 포함 여부 체크
|
||||
var strCont = form.smsTxtArea.value;
|
||||
var rtnStr = strChinJpnCheck(strCont);
|
||||
|
||||
//문자제목에 이모지가 있는지 체크
|
||||
var titleStatusYn = $("input[name='title_status']:checked").val();
|
||||
if(titleStatusYn == 'Y') {
|
||||
if(!emojiCheck(form.mmsSubject.value)) return false;
|
||||
}
|
||||
|
||||
//문자내용에 이모지가 있는지 체크
|
||||
if(!emojiCheck(strCont)) return false;
|
||||
|
||||
if(rtnStr.length > 0){
|
||||
|
||||
alert("입력하신 문구 중 \" " + rtnStr + " \" 는 일부 휴대폰에서 표기되지 않을 수 있습니다.");
|
||||
|
||||
}
|
||||
|
||||
/* var strCont = form.smsTxtArea.value;
|
||||
var repStr = strFirstCharCheck(strCont);
|
||||
|
||||
if(repStr.length > 0){
|
||||
|
||||
alert("문자 내용 첫 글자는 특수기호가 들어갈 수 없습니다.");
|
||||
$('#smsTxtArea').val(strCont.replace(repStr, ""));
|
||||
fnByteString(strCont.replace(repStr, ""));
|
||||
return false;
|
||||
|
||||
} */
|
||||
|
||||
if(imgFilePath.length == 0){ // 그림문자일 경우 내용이 없어도 됨 , 장문 문자일 경우만 문자내용 체크함
|
||||
|
||||
if(form.smsTxtArea.value == ""){
|
||||
|
||||
alert("문자 내용을 입력해 주세요.");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//광고 문자 내용 합쳐주기
|
||||
@ -1191,7 +1133,7 @@ function fn_sendMsgData(){
|
||||
//수신번호 리스트 체크하기
|
||||
var numCnt = 0;
|
||||
var nameList = []; //치환문자 이름
|
||||
var phoneNum = []; //받는사람
|
||||
var phoneNum = []; //받는사람
|
||||
var rep1List = []; //치환문자1
|
||||
var rep2List = []; //치환문자2
|
||||
var rep3List = []; //치환문자3
|
||||
@ -1312,7 +1254,8 @@ function fn_sendMsgData(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
console.log(' : 전송하시겠습니까 : ')
|
||||
if(confirm("문자를 전송하시겠습니까?")){
|
||||
imgFilePath = [];
|
||||
$('.thumb_wrap').find('.thumb_img').each(function(idx, el) {
|
||||
@ -1390,7 +1333,7 @@ function fn_sendMsgData(){
|
||||
|
||||
//문자내용이 입력된 경우 스팸 필터링 실행
|
||||
if(!form.smsTxtArea.value == "" && exceptSpamYn == "N"){
|
||||
|
||||
console.log(' : selectSpamTxtChkAjax : ')
|
||||
var spmData = new FormData(form);
|
||||
url = "/web/mjon/msgdata/selectSpamTxtChkAjax.do";
|
||||
|
||||
@ -1398,12 +1341,15 @@ function fn_sendMsgData(){
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: spmData,
|
||||
|
||||
dataType:'json',
|
||||
async: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
success: function (returnData, status) {
|
||||
return false;
|
||||
|
||||
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
||||
|
||||
if("fail" == returnData.result){
|
||||
@ -1452,6 +1398,7 @@ function fn_sendMsgData(){
|
||||
}
|
||||
|
||||
var eventRemainCash = parseFloat(form.eventRemainCash.value);
|
||||
console.log('eventStatus : ', eventStatus);
|
||||
|
||||
if(eventStatus == 'Y'){
|
||||
|
||||
@ -1629,8 +1576,9 @@ function fn_sendMsgData(){
|
||||
var form = document.msgForm;
|
||||
|
||||
var data = new FormData(form);
|
||||
url = "/web/mjon/msgdata/sendMsgDataAjax.do";
|
||||
|
||||
// url = "/web/mjon/msgdata/sendMsgDataAjax.do";
|
||||
url = "/web/mjon/msgdata/sendMsgDataAjax_advc.do";
|
||||
console.log('url :: ', url);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
@ -1641,6 +1589,7 @@ function fn_sendMsgData(){
|
||||
contentType: false,
|
||||
cache: false,
|
||||
success: function (returnData, status) {
|
||||
console.log('returnData : ', returnData);
|
||||
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
||||
if("fail" == returnData.result){
|
||||
|
||||
@ -1794,7 +1743,7 @@ function fn_sendMsgData(){
|
||||
form.eventStatus.value = 'N';
|
||||
form.eventYn.value = 'N';
|
||||
|
||||
sendMsgAjax(0,0);
|
||||
sendMsgAjax_advc(0,0);
|
||||
|
||||
}else{
|
||||
|
||||
@ -1815,14 +1764,14 @@ function fn_sendMsgData(){
|
||||
}else{
|
||||
|
||||
//발송 Ajax 호출해주기
|
||||
sendMsgAjax(0,0);
|
||||
sendMsgAjax_advc(0,0);
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
//발송 Ajax 호출해주기
|
||||
sendMsgAjax(0,0);
|
||||
sendMsgAjax_advc(0,0);
|
||||
|
||||
}
|
||||
|
||||
@ -1831,6 +1780,46 @@ function fn_sendMsgData(){
|
||||
}
|
||||
|
||||
|
||||
|
||||
//폼 유효성 검사 함수
|
||||
function validateForm(form) {
|
||||
|
||||
if(form.callFromList.value == ""){
|
||||
|
||||
alert("발신번호를 입력해 주세요.");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
if (form.title_status.value === 'N') {
|
||||
form.mmsSubject.value = "";
|
||||
} else if (getSpacialStringChk(form.mmsSubject.value)) {
|
||||
alert("문자 제목에는 치환문자(엑셀 내 *이름*, *1*, *2*, *3*, *4* 등)를 사용하실 수 없습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
//문자제목에 이모지가 있는지 체크
|
||||
var titleStatusYn = $("input[name='title_status']:checked").val();
|
||||
if(titleStatusYn == 'Y') {
|
||||
if(!emojiCheck(form.mmsSubject.value)) return false;
|
||||
}
|
||||
|
||||
// 문자내용에 이모지가 있는지 체크
|
||||
var strCont = form.smsTxtArea.value;
|
||||
if (!emojiCheck(strCont)) return false;
|
||||
|
||||
var rtnStr = strChinJpnCheck(strCont);
|
||||
if(rtnStr.length > 0){
|
||||
alert("입력하신 문구 중 \" " + rtnStr + " \" 는 일부 휴대폰에서 표기되지 않을 수 있습니다.");
|
||||
}
|
||||
|
||||
if (imgFilePath.length === 0 && !form.smsTxtArea.value) {
|
||||
alert("문자 내용을 입력해 주세요.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//이벤트가 아닌 일반 개별 단가 셋팅해주기
|
||||
function getNorEachPrice(evnMsgType){
|
||||
|
||||
@ -1873,13 +1862,103 @@ function getNorEachPrice(evnMsgType){
|
||||
}
|
||||
|
||||
|
||||
function sendMsgAjax(paramSmsCnt, paramBlockCnt){
|
||||
|
||||
function sendMsgAjax_advc(paramSmsCnt, paramBlockCnt){
|
||||
console.log('sendMsgAjax : ');
|
||||
var form = document.msgForm;
|
||||
var reserYn = $("#reserveYn").val();
|
||||
|
||||
var data = new FormData(form);
|
||||
url = "/web/mjon/msgdata/sendMsgDataAjax.do";
|
||||
// url = "/web/mjon/msgdata/sendMsgDataAjax.do";
|
||||
url = "/web/mjon/msgdata/sendMsgDataAjax_advc.do";
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: data,
|
||||
dataType:'json',
|
||||
async: true,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
success: function (data) {
|
||||
console.log('data : ', data);
|
||||
/* message:"특정문구 일괄변환 치환문자 데이터가 없습니다."
|
||||
status:"BAD_REQUEST" */
|
||||
|
||||
var status = data.status;
|
||||
// if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
||||
if("OK" == status){
|
||||
|
||||
var smsCnt = Number(data.object.resultSts);
|
||||
var blockCnt = Number(data.object.resultBlockSts);
|
||||
|
||||
smsCnt = Number(smsCnt) + Number(paramSmsCnt);
|
||||
blockCnt = Number(blockCnt) + Number(paramBlockCnt);
|
||||
|
||||
if((smsCnt + blockCnt) == 0){
|
||||
|
||||
$('.pop_msg_spam').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
|
||||
$('.pop_msg_spam .msg_text').html("문자 발송(예약)에 실패하였습니다.<br/> 다시 시도해주세요. <br/>* 정상적으로 발송 시도하였으나 실패하신 경우 혹시 문자내용에 사용불가 이모지 <br/>또는 복사-붙여넣기로 인한 보이지 않는 특수문자가 포함되었는지 확인 후 다시 시도해주세요.");
|
||||
$('.mask').addClass('on');
|
||||
|
||||
}else{
|
||||
|
||||
$('.pop_msg_success').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
|
||||
//예약발송 건의 경우 결과 팝업 문구 변경
|
||||
if(reserYn == 'Y'){
|
||||
$('.pop_msg_success .msg_text').html("예약 성공 : <strong>"+ smsCnt + "</strong>건,수신거부 : <span>" + blockCnt + "</span>건의<br>문자가 예약 되었습니다.");
|
||||
}else{
|
||||
$('.pop_msg_success .msg_text').html("발송 성공 : <strong>"+ smsCnt + "</strong>건,수신거부 : <span>" + blockCnt + "</span>건의<br>문자가 발송 되었습니다.");
|
||||
}
|
||||
|
||||
$('.mask').addClass('on');
|
||||
|
||||
}
|
||||
|
||||
|
||||
}else if("BAD_REQUEST" == status){
|
||||
|
||||
alert(data.message);
|
||||
return false;
|
||||
|
||||
}else if("UNAUTHORIZED" == status){
|
||||
|
||||
alert(data.message);
|
||||
//문자발송 URL Move
|
||||
goMsgUrlMove();
|
||||
return false;
|
||||
|
||||
}else if("NO_CONTENT" == status){
|
||||
|
||||
$('.pop_msg_fails').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
|
||||
$('.pop_msg_fails .msg_text').html(returnData.message);
|
||||
$('.mask').addClass('on');
|
||||
|
||||
}
|
||||
|
||||
// } else if(status== 'fail'){
|
||||
// alert(returnData.message);
|
||||
// }
|
||||
},
|
||||
beforeSend : function(xmlHttpRequest) {
|
||||
//로딩창 show
|
||||
$('.loading_layer').addClass('active');
|
||||
},
|
||||
complete : function(xhr, textStatus) {
|
||||
//로딩창 hide
|
||||
$('.loading_layer').removeClass('active');
|
||||
},
|
||||
error: function (e) { alert("문자 발송에 실패하였습니다."); console.log("ERROR : ", e); }
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function sendMsgAjax(paramSmsCnt, paramBlockCnt){
|
||||
var form = document.msgForm;
|
||||
var reserYn = $("#reserveYn").val();
|
||||
|
||||
var data = new FormData(form);
|
||||
url = "/web/mjon/msgdata/sendMsgDataAjax.do";
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
Loading…
Reference in New Issue
Block a user