issues/4750 - : pms 수정
This commit is contained in:
parent
4c449d49a0
commit
81e7e1861d
@ -8,12 +8,14 @@ import lombok.Setter;
|
||||
public class RefundDTO {
|
||||
private String userId;
|
||||
private String msgGroupId;
|
||||
private int userData;
|
||||
private String userData;
|
||||
private int msgSeq;
|
||||
private String eachPrice ; // 전송문자 개별가격
|
||||
|
||||
public RefundDTO(String userId, String msgGroupId, int userData, String eachPrice) {
|
||||
public RefundDTO(String userId, String msgGroupId, int msgSeq, String userData, String eachPrice) {
|
||||
this.userId = userId;
|
||||
this.msgGroupId = msgGroupId;
|
||||
this.msgSeq = msgSeq;
|
||||
this.userData = userData;
|
||||
this.eachPrice = eachPrice;
|
||||
}
|
||||
|
||||
@ -3455,7 +3455,7 @@ public class TestController {
|
||||
try {
|
||||
// 필요한 필드만 DTO로 매핑
|
||||
List<RefundDTO> dtoList = msgFailList.stream()
|
||||
.map(msg -> new RefundDTO(msg.getUserId(), msg.getMsgGroupId(), Integer.parseInt(msg.getUserData()), msg.getEachPrice()))
|
||||
.map(msg -> new RefundDTO(msg.getUserId(), msg.getMsgGroupId(), Integer.parseInt(msg.getUserData()), msg.getUserData(), msg.getEachPrice()))
|
||||
.collect(Collectors.toList());
|
||||
// JSON 변환
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@ -504,24 +504,33 @@ public class SchdlrManageServiceImpl extends EgovAbstractServiceImpl implements
|
||||
*/
|
||||
@Override
|
||||
public void payBack_advc(String p_type) throws Exception {
|
||||
|
||||
List<MjonMsgVO> msgFailList = new ArrayList<>();
|
||||
|
||||
msgFailList = getMsgFailList(p_type);
|
||||
|
||||
// 리스트가 비어있는 경우 종료
|
||||
if (msgFailList == null || msgFailList.isEmpty()) {
|
||||
if (msgFailList == null || msgFailList.isEmpty() || msgFailList.size() < 1) {
|
||||
System.out.println("No payBack messages empty.");
|
||||
}
|
||||
|
||||
try {
|
||||
// 필요한 필드만 DTO로 매핑
|
||||
List<RefundDTO> dtoList = msgFailList.stream().map(msg -> new RefundDTO(msg.getUserId(),
|
||||
msg.getMsgGroupId(), Integer.parseInt(msg.getUserData()), msg.getEachPrice()))
|
||||
.collect(Collectors.toList());
|
||||
List<RefundDTO> dtoList = msgFailList.stream()
|
||||
.map(msg ->
|
||||
new RefundDTO(
|
||||
msg.getUserId()
|
||||
, msg.getMsgGroupId()
|
||||
, Integer.parseInt(msg.getUserData())
|
||||
, msg.getUserData()
|
||||
, msg.getEachPrice())
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// JSON 변환
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String msgFailListJson = objectMapper.writeValueAsString(dtoList);
|
||||
|
||||
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
mjonMsgDataDAO.updateMsgSentFailPayBackBatch(msgFailListJson);
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
@ -154,6 +154,8 @@
|
||||
ADDR_GRP_NM = #addrGrpNm#
|
||||
AND
|
||||
MBER_ID = #mberId#
|
||||
AND
|
||||
DELETE_YN = 'N'
|
||||
</select>
|
||||
|
||||
<!-- 주소록 그룹 다음 순서번호 확인 -->
|
||||
|
||||
@ -190,6 +190,8 @@
|
||||
ADDR_GRP_NM = #addrGrpNm#
|
||||
AND
|
||||
MBER_ID = #mberId#
|
||||
AND
|
||||
DELETE_YN = 'N'
|
||||
</select>
|
||||
|
||||
<!-- 주소록 그룹 다음 순서번호 확인 -->
|
||||
|
||||
@ -565,10 +565,14 @@
|
||||
COUNT(A.ADDR_ID) AS totCnt
|
||||
FROM
|
||||
MJ_ADDR A
|
||||
left join mj_addr_grp mag
|
||||
on A.ADDR_GRP_ID = mag.ADDR_GRP_ID
|
||||
WHERE
|
||||
A.MBER_ID = #mberId#
|
||||
AND (A.RECV_STATUS = 'Y' OR A.RECV_STATUS = 'S' OR A.RECV_STATUS IS NULL)
|
||||
AND A.DELETE_YN = 'N'
|
||||
AND (A.RECV_STATUS = 'Y'
|
||||
or A.RECV_STATUS = 'S'
|
||||
or A.RECV_STATUS is null)
|
||||
AND mag.DELETE_YN = 'N'
|
||||
</select>
|
||||
|
||||
<!-- 주소록 상세 조회 -->
|
||||
|
||||
@ -4150,7 +4150,9 @@
|
||||
THEN 'W'
|
||||
ELSE 'F'
|
||||
END) IN ('F')
|
||||
ORDER BY MMD.USER_ID
|
||||
ORDER BY
|
||||
MMD.REQ_DATE asc
|
||||
, MMD.USER_ID
|
||||
LIMIT 10000
|
||||
|
||||
</select>
|
||||
@ -4326,7 +4328,9 @@
|
||||
THEN 'W'
|
||||
ELSE 'F'
|
||||
END) IN ('F')
|
||||
ORDER BY MMD.USER_ID
|
||||
ORDER BY
|
||||
MMD.REQ_DATE asc
|
||||
, MMD.USER_ID
|
||||
LIMIT 10000
|
||||
|
||||
|
||||
|
||||
@ -47,10 +47,6 @@ function listAddrGrp(){
|
||||
}
|
||||
|
||||
|
||||
function addrGroupLoadAjax(){
|
||||
$("#addrRegistSelect").load("/web/addr/selectAddrGroupAjax.do", function(response, status, xhr){});
|
||||
$("#funcAddrGroupSelect").load("/web/addr/selectAddrGroupAjax.do", function(response, status, xhr){});
|
||||
}
|
||||
|
||||
function addrLoadAjax(){
|
||||
$("#adr1_right").load("/web/mjon/addr/selectAddrAjax.do", function(response, status, xhr){tableAllChk();});
|
||||
@ -96,6 +92,70 @@ function insertAddrGroupAjax() {
|
||||
|
||||
}
|
||||
|
||||
function insertAddrAjax() {
|
||||
var selectVal = $("#addrRegistSelect option:selected").val();
|
||||
//alert(selectVal);
|
||||
|
||||
var form = document.addrInsertForm;
|
||||
/*
|
||||
//필수값 아니어서 뺐음
|
||||
if(form.addrNm.value == "") {
|
||||
alert("주소록 이름을 입력하세요");
|
||||
return;
|
||||
}
|
||||
*/
|
||||
if(form.addrPhoneNo.value == "") {
|
||||
alert("주소록 번호를 입력하세요");
|
||||
return;
|
||||
}
|
||||
//if(!confirm("주소록을 추가하시겠습니까?")) {
|
||||
// return;
|
||||
//}
|
||||
|
||||
if(!checkHpNum(form.addrPhoneNo.value)){//휴대폰 유효성 검사
|
||||
if(!checkNorPhoneNum(form.addrPhoneNo.value)){//일반전화 유효성 검사
|
||||
|
||||
alert("잘못된 휴대폰번호 또는 일반전화 번호 입니다.");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var data = new FormData(form);
|
||||
|
||||
$.ajax({
|
||||
cache : false,
|
||||
url : "<c:url value='/web/mjon/addr/insertAddrAjax.do' />",
|
||||
type : 'POST',
|
||||
data : data,
|
||||
dataType:'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success : function(returnData, status){
|
||||
if(status == "success") {
|
||||
if("fail"==returnData.result){
|
||||
alert(returnData.message);
|
||||
return;
|
||||
} else if("dupl"==returnData.result){
|
||||
alert("해당 그룹에 중복된 번호가 있습니다.");
|
||||
return;
|
||||
}
|
||||
//alert("저장 되었습니다.");
|
||||
|
||||
listAddrGrp();
|
||||
addrGroupLoadAjax();
|
||||
addrLoadAjax();
|
||||
|
||||
// 주소록그룹 콤보박스 유지
|
||||
setTimeout(setSelectSetting, 500, selectVal);
|
||||
|
||||
}else{ alert("ERROR!");return;}
|
||||
},
|
||||
error: function (e) { alert("저장에 실패하였습니다."); console.log("ERROR : ", e); }
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 주소록그룹 콤보박스 유지
|
||||
function setSelectSetting(selectVal) {
|
||||
@ -128,6 +188,11 @@ function moveTab(type){
|
||||
if(type == "addrApply") location.href="/web/mjon/addragency/selectAddrAgencyList.do";
|
||||
}
|
||||
|
||||
function addrGroupLoadAjax(){
|
||||
$("#addrRegistSelect").load("/web/addr/selectAddrGroupAjax.do", function(response, status, xhr){});
|
||||
$("#funcAddrGroupSelect").load("/web/addr/selectAddrGroupAjax.do", function(response, status, xhr){});
|
||||
}
|
||||
|
||||
|
||||
|
||||
//#############################################################################################
|
||||
@ -210,6 +275,8 @@ $(document).on('click', '#btnAddrMassClose', function() {
|
||||
|
||||
// 대량등록 닫기
|
||||
function setAddrMassClose() {
|
||||
$('#btnAddrMassClose').click();
|
||||
|
||||
var $objTabul = fn_utils_getTabulator();
|
||||
$objTabul.clearData();
|
||||
|
||||
@ -322,6 +389,9 @@ function SetAddrMassSave(){
|
||||
if (!isAddrPhoneNoSelected) {
|
||||
// isPhoneSelected = true;
|
||||
alert('휴대폰이 선택되지 않았습니다.');
|
||||
// $('.field-selector[data-group="tableExcel"]').focus().click();
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
@ -736,13 +806,8 @@ function fn_tabToggle(tabNum){
|
||||
<!-- send top -->
|
||||
<div class="send_top">
|
||||
<!-- tab button -->
|
||||
<ul class="tabType4">
|
||||
<li class="tab active"><button type="button" onclick="TabType5(this,'1'); moveTab('addr');">주소록관리</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'2'); moveTab('fax');">팩스 주소록관리</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'3'); moveTab('block');">수신거부</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'4'); moveTab('addrMob');">폰주소록 등록</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'5'); moveTab('addrApply');">주소록 입력 대행(무료)</button></li>
|
||||
</ul><!--// tab button -->
|
||||
<%@include file="/WEB-INF/jsp/web/addr/include/topMenu.jsp" %>
|
||||
<!--// tab button -->
|
||||
<!-- 주소록 관리 - 주소록 관리 -->
|
||||
<div class="adr_cont current" id="tab5_1">
|
||||
<div class="heading">
|
||||
|
||||
@ -175,14 +175,6 @@ function linkPage(pageNo){
|
||||
addrGroupLoadAjax();
|
||||
}
|
||||
|
||||
function moveTab(type){
|
||||
if(type == "addr") location.href="/web/mjon/addr/selectAddrList.do";
|
||||
if(type == "fax") location.href="/web/mjon/fax/addr/selectFaxAddrList.do";
|
||||
if(type == "block") location.href="/web/mjon/addrBlock/selectBlockList.do";
|
||||
if(type == "addrMob") location.href="/web/mjon/addr/addrMobGuide.do";
|
||||
if(type == "addrApply") location.href="/web/mjon/addragency/selectAddrAgencyList.do";
|
||||
}
|
||||
|
||||
|
||||
|
||||
//#############################################################################################
|
||||
|
||||
@ -15,13 +15,8 @@ function moveTab(type){
|
||||
<!-- send top -->
|
||||
<div class="send_top">
|
||||
<!-- tab button -->
|
||||
<ul class="tabType4">
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'1'); moveTab('addr');">주소록관리</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'2'); moveTab('fax');">팩스 주소록관리</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'3'); moveTab('block');">수신거부</button></li>
|
||||
<li class="tab active"><button type="button" onclick="TabType5(this,'4'); moveTab('addrMob');">폰주소록 등록</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'5'); moveTab('addrApply');">주소록 입력 대행(무료)</button></li>
|
||||
</ul><!--// tab button -->
|
||||
<%@include file="/WEB-INF/jsp/web/addr/include/topMenu.jsp" %>
|
||||
<!--// tab button -->
|
||||
<!-- 주소록 관리 - 폰주소록 등록 -->
|
||||
<div class="adr_cont current" id="tab5_3">
|
||||
<div class="heading">
|
||||
|
||||
@ -17,11 +17,6 @@ $(document).ready(function(){
|
||||
|
||||
|
||||
|
||||
function addrGroupLoadAjax(){
|
||||
$("#addrRegistSelect").load("/web/addr/selectAddrGroupAjax.do", function(response, status, xhr){});
|
||||
$("#funcAddrGroupSelect").load("/web/addr/selectAddrGroupAjax.do", function(response, status, xhr){});
|
||||
}
|
||||
|
||||
// 주소록그룹 콤보박스 유지
|
||||
function setSelectSetting(selectVal) {
|
||||
$("#addrRegistSelect").val(selectVal).prop("selected", true);
|
||||
|
||||
@ -16,11 +16,6 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
|
||||
function addrGroupLoadAjax(){
|
||||
$("#addrRegistSelect").load("/web/addr/selectAddrGroupAjax.do", function(response, status, xhr){});
|
||||
$("#funcAddrGroupSelect").load("/web/addr/selectAddrGroupAjax.do", function(response, status, xhr){});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 주소록그룹 콤보박스 유지
|
||||
|
||||
50
src/main/webapp/WEB-INF/jsp/web/addr/include/topMenu.jsp
Normal file
50
src/main/webapp/WEB-INF/jsp/web/addr/include/topMenu.jsp
Normal file
@ -0,0 +1,50 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<script type="text/javascript" src="<c:url value='/publish/js/content.js'/>"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function(){ // 현재 URL 확인
|
||||
// 현재 URL 확인
|
||||
const currentPath = window.location.pathname;
|
||||
|
||||
// URL과 ID 매핑
|
||||
const tabMapping = {
|
||||
"/web/mjon/addr/selectAddrList.do": "addr",
|
||||
"/web/mjon/fax/addr/selectFaxAddrList.do": "fax",
|
||||
"/web/mjon/addrBlock/selectBlockList.do": "block",
|
||||
"/web/mjon/addr/addrMobGuide.do": "addrMob",
|
||||
"/web/mjon/addragency/selectAddrAgencyList.do": "addrApply"
|
||||
};
|
||||
|
||||
// 현재 URL에 해당하는 ID 찾기
|
||||
const activeId = tabMapping[currentPath];
|
||||
|
||||
// activeId에 해당하는 li에 active 클래스 추가
|
||||
if (activeId) {
|
||||
$('#'+activeId).parent().addClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function moveTab(type){
|
||||
if(type == "addr") location.href="/web/mjon/addr/selectAddrList.do";
|
||||
if(type == "fax") location.href="/web/mjon/fax/addr/selectFaxAddrList.do";
|
||||
if(type == "block") location.href="/web/mjon/addrBlock/selectBlockList.do";
|
||||
if(type == "addrMob") location.href="/web/mjon/addr/addrMobGuide.do";
|
||||
if(type == "addrApply") location.href="/web/mjon/addragency/selectAddrAgencyList.do";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<ul class="tabType4">
|
||||
<li class="tab"><button type="button" id="addr" onclick="TabType5(this,'1'); moveTab('addr');">문자 주소록관리</button></li>
|
||||
<li class="tab"><button type="button" id="fax" onclick="TabType5(this,'2'); moveTab('fax');">팩스 주소록관리</button></li>
|
||||
<li class="tab"><button type="button" id="block" onclick="TabType5(this,'3'); moveTab('block');">수신거부</button></li>
|
||||
<li class="tab"><button type="button" id="addrMob" onclick="TabType5(this,'4'); moveTab('addrMob');">폰주소록 등록</button></li>
|
||||
<li class="tab"><button type="button" id="addrApply" onclick="TabType5(this,'5'); moveTab('addrApply');">주소록 입력 대행(무료)</button></li>
|
||||
</ul>
|
||||
@ -1360,13 +1360,8 @@ function addrMassTab(tabIdx) {
|
||||
<!-- send top -->
|
||||
<div class="send_top">
|
||||
<!-- tab button -->
|
||||
<ul class="tabType4">
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'1'); moveTab('addr');">주소록관리</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'2'); moveTab('fax');">팩스 주소록관리</button></li>
|
||||
<li class="tab active"><button type="button" onclick="TabType5(this,'3'); moveTab('block');">수신거부</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'4'); moveTab('addrMob');">폰주소록 등록</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'5'); moveTab('addrApply');">주소록 입력 대행(무료)</button></li>
|
||||
</ul><!--// tab button -->
|
||||
<%@include file="/WEB-INF/jsp/web/addr/include/topMenu.jsp" %>
|
||||
<!--// tab button -->
|
||||
<!-- 주소록 관리 - 주소록 관리 -->
|
||||
<div class="adr_cont current" id="tab5_1">
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('ul.tabType4 li').eq(4).addClass('active');
|
||||
// $('ul.tabType4 li').eq(4).addClass('active');
|
||||
|
||||
listLoad(); //Load list
|
||||
});
|
||||
@ -145,7 +145,9 @@ function infoPop(pageUrl){
|
||||
<div class="send_top">
|
||||
|
||||
<!-- tabtype -->
|
||||
<%@include file="/WEB-INF/jsp/web/addragency/include/addrTabType.jsp"%>
|
||||
<!-- tab button -->
|
||||
<%@include file="/WEB-INF/jsp/web/addr/include/topMenu.jsp" %>
|
||||
<!--// tab button -->
|
||||
|
||||
<!-- 주소록 관리 - 주소록 입력 대행(무료) -->
|
||||
<div class="adr_cont current" id="tab5_4">
|
||||
|
||||
@ -867,13 +867,7 @@ function fn_tabToggle(tabNum){
|
||||
<!-- send top -->
|
||||
<div class="send_top">
|
||||
<!-- tab button -->
|
||||
<ul class="tabType4">
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'1'); moveTab('addr');">주소록관리</button></li>
|
||||
<li class="tab active"><button type="button" onclick="TabType5(this,'2'); moveTab('fax');">팩스 주소록관리</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'3'); moveTab('block');">수신거부</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'4'); moveTab('addrMob');">폰주소록 등록</button></li>
|
||||
<li class="tab"><button type="button" onclick="TabType5(this,'5'); moveTab('addrApply');">주소록 입력 대행(무료)</button></li>
|
||||
</ul>
|
||||
<%@include file="/WEB-INF/jsp/web/addr/include/topMenu.jsp" %>
|
||||
<!--// tab button -->
|
||||
<!-- 주소록 관리 - 주소록 관리 -->
|
||||
<div class="adr_cont current" id="tab5_1">
|
||||
|
||||
@ -47,20 +47,20 @@ $(document).ready(function(){
|
||||
// {formatter:"rownum", align:"center", title:"No", hozAlign:"center", headerHozAlign:"center", field:"No", width:30},
|
||||
{formatter:"rownum", align:"center" ,title:"No", hozAlign:"center", headerHozAlign:"center", width:40},
|
||||
{title:"이름", field:"name", editor:false, validator:["maxLength:12"], cellEdited:function(cell){
|
||||
fnReplCell();
|
||||
fnReplCell_advc();
|
||||
}},
|
||||
{title:"휴대폰", field:"phone", width:100, editor:false, validator:["required","minLength:10", "maxLength:12"]},
|
||||
{title:"[*1*]", field:"rep1", minWidth:60, editor:false, validator:["maxLength:40"], cellEdited:function(cell){
|
||||
fnReplCell();
|
||||
fnReplCell_advc();
|
||||
}},
|
||||
{title:"[*2*]", field:"rep2", minWidth:60, editor:false, validator:["maxLength:40"], cellEdited:function(cell){
|
||||
fnReplCell();
|
||||
fnReplCell_advc();
|
||||
}},
|
||||
{title:"[*3*]", field:"rep3", minWidth:60, editor:false, validator:["maxLength:40"], cellEdited:function(cell){
|
||||
fnReplCell();
|
||||
fnReplCell_advc();
|
||||
}},
|
||||
{title:"[*4*]", field:"rep4", minWidth:60, editor:false, validator:["maxLength:40"], cellEdited:function(cell){
|
||||
fnReplCell();
|
||||
fnReplCell_advc();
|
||||
}},
|
||||
|
||||
],
|
||||
@ -324,7 +324,7 @@ function addPhoneInfo(data){
|
||||
|| smsTxtArea.indexOf("[*3*]") > -1
|
||||
|| smsTxtArea.indexOf("[*4*]") > -1){
|
||||
|
||||
fnReplCell();
|
||||
fnReplCell_advc();
|
||||
|
||||
}else{
|
||||
|
||||
@ -603,7 +603,7 @@ function imgExport(event){
|
||||
|| contents.indexOf("[*3*]") > -1
|
||||
|| contents.indexOf("[*4*]") > -1){
|
||||
|
||||
fnReplCell();
|
||||
fnReplCell_advc();
|
||||
|
||||
}else{
|
||||
|
||||
@ -757,36 +757,17 @@ $(document).ready(function (){
|
||||
|
||||
|
||||
|
||||
|
||||
let debounceTimer;
|
||||
//문자 내용 입력시 바이트수 계산하기
|
||||
$('#smsTxtArea').keyup(function(e){
|
||||
// console.log("11$('.preview_auto').test() :: ",$('.realtime').html())
|
||||
// console.log("11$('.preview_auto').test() :: ",$('.realtime').text())
|
||||
|
||||
var contents = $(this).val();
|
||||
var adrYn = $("input[name=send_adYn]:checked").val();
|
||||
|
||||
/* if(adrYn == 'N'){
|
||||
|
||||
if((contents.indexOf("(광고)") > -1 && (contents.indexOf("무료거부") > -1 || contents.indexOf("무료 거부") > -1))
|
||||
|| contents.indexOf("(광고)") > -1){
|
||||
|
||||
alert("광고 내용이 인식되어 광고 문자로 전환됩니다.");
|
||||
$('#smsTxtArea').val(""); //입력 내용 지워주기
|
||||
$('#send_adYnY').prop('checked', true);
|
||||
//광고 상하단 내용 넣어주기
|
||||
advMsgInsert();
|
||||
|
||||
}
|
||||
|
||||
fnByteString(contents);
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
} */
|
||||
|
||||
fnByteString(contents);
|
||||
clearTimeout(debounceTimer); // 기존 타이머를 초기화
|
||||
debounceTimer = setTimeout(() => {
|
||||
fnByteString(contents); // 일정 시간 후에만 문자 내용 처리 실행
|
||||
}, 300); // 300ms 지연
|
||||
});//문자 바이트수 계산하기 끝
|
||||
|
||||
|
||||
@ -837,7 +818,7 @@ $(document).ready(function (){
|
||||
|
||||
//받는사람 목록에 복사/붙여넣기 기능 처리
|
||||
$('.callList_box').on('paste', function (e) {
|
||||
console.log(' :: callList_box :: ');
|
||||
console.log(' :: callList _box :: ');
|
||||
|
||||
var element = e.originalEvent.clipboardData.getData('text'); // 클립보드에 복사한 데이터 가져오기
|
||||
|
||||
@ -1002,7 +983,7 @@ $(document).ready(function (){
|
||||
|| smsTxtArea.indexOf("[*3*]") > -1
|
||||
|| smsTxtArea.indexOf("[*4*]") > -1){
|
||||
|
||||
fnReplCell();
|
||||
fnReplCell_advc();
|
||||
}else{
|
||||
//결제 금액 구하기
|
||||
totalPriceSum(totRows);
|
||||
@ -1012,8 +993,12 @@ $(document).ready(function (){
|
||||
alert("올바르지 않은 휴대폰 번호가 "+ tableErrorData.length +" 건 있습니다.");
|
||||
}
|
||||
|
||||
|
||||
// 미리보기 버튼 활성화
|
||||
updateButtons(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
//받는사람 번호 버튼 클릭시 Tabulator에 데이터 넣어주기
|
||||
@ -1114,7 +1099,7 @@ $(document).ready(function (){
|
||||
|| smsTxtArea.indexOf("[*3*]") > -1
|
||||
|| smsTxtArea.indexOf("[*4*]") > -1){
|
||||
|
||||
fnReplCell();
|
||||
fnReplCell_advc();
|
||||
}else{
|
||||
//결제 금액 구하기
|
||||
totalPriceSum(totRows);
|
||||
@ -1538,7 +1523,7 @@ $(document).ready(function (){
|
||||
|| contents.indexOf("[*3*]") > -1
|
||||
|| contents.indexOf("[*4*]") > -1){
|
||||
|
||||
fnReplCell();
|
||||
fnReplCell_advc();
|
||||
|
||||
}else{
|
||||
|
||||
@ -1626,7 +1611,7 @@ $(document).ready(function (){
|
||||
|| contents.indexOf("[*3*]") > -1
|
||||
|| contents.indexOf("[*4*]") > -1){
|
||||
|
||||
fnReplCell();
|
||||
fnReplCell_advc();
|
||||
|
||||
}else{
|
||||
|
||||
@ -2947,12 +2932,19 @@ function addrToList(){
|
||||
|
||||
//주소록 불러오기에서 수신자 리스트 추가해 주기
|
||||
function addrToList_advc(type){
|
||||
console.log('tableAddr.getDataCount() : ', tableAddr.getDataCount());
|
||||
// 선택된 데이터 또는 전체 데이터 변수 초기화
|
||||
let selectedData = type === 'select' ? tableAddr.getSelectedRows() : tableAddr.getData();
|
||||
|
||||
// 데이터가 비어있으면 경고 후 종료
|
||||
if (!selectedData || selectedData.length < 1) {
|
||||
alert("주소록을 선택해 주세요.");
|
||||
|
||||
if(tableAddr.getDataCount() < 1){
|
||||
alert("주소록을 선택해 주세요.");
|
||||
}else{
|
||||
alert("전화번호를 선택해 주세요.");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -343,6 +343,7 @@ $(document).ready(function(){
|
||||
setAddrMassClose();
|
||||
$('.field-selector').each(function() { $(this).val(''); });
|
||||
$('#closeBtn').click();
|
||||
fnReplCell_advc();
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -1,58 +1,35 @@
|
||||
|
||||
function fnReplCell_advc(){
|
||||
console.log(':: fnReplCell_advc :: ');
|
||||
console.log(':: fnReplCell_advc ::'); // 함수 실행 로그
|
||||
|
||||
var smsTxtArea = $('#smsTxtArea').val();
|
||||
console.log('smsTxtArea : ', smsTxtArea);
|
||||
var orgSmsTxt = smsTxtArea; // 광고문자 뺀 문자내용
|
||||
let smsTxtArea = $('#smsTxtArea').val(); // 문자 내용을 가져옴
|
||||
const adTxt = $('.ad_txt').text(); // 광고 문구
|
||||
const denyTxt = $('.deny_txt').text(); // 수신 거부 문구
|
||||
const recTableData = tableL.getRows(); // 받는사람 리스트
|
||||
|
||||
var recTableData = tableL.getRows(); // 받는사람 리스트의 전체 목록을 저장
|
||||
|
||||
var smsTxt = smsTxtArea;
|
||||
|
||||
var data = recTableData[0].getData();
|
||||
|
||||
if(typeof data.name != 'undefined'
|
||||
&& data.name != null
|
||||
&& data.name != ""){
|
||||
|
||||
var name = data.name;
|
||||
smsTxt = stringReplaceAll(smsTxt, "[*이름*]", name);
|
||||
|
||||
|
||||
}
|
||||
if(typeof data.rep1 != 'undefined' && data.rep1 != null && data.rep1 != ""){
|
||||
|
||||
var rep1 = data.rep1;
|
||||
smsTxt = stringReplaceAll(smsTxt, "[*1*]", rep1);
|
||||
|
||||
// 광고 문구와 수신 거부 문구를 문자 내용에 추가
|
||||
if (adTxt && denyTxt) {
|
||||
smsTxtArea = `${adTxt}\n${smsTxtArea}\n${denyTxt}`;
|
||||
}
|
||||
|
||||
if(typeof data.rep2 != 'undefined' && data.rep2 != null && data.rep2 != ""){
|
||||
|
||||
var rep2 = data.rep2;
|
||||
smsTxt = stringReplaceAll(smsTxt, "[*2*]", rep2);
|
||||
|
||||
// 문자 내용에 치환 문자열이 포함되어 있는지 확인
|
||||
if (!SmsTextProcessor.hasPlaceholders(smsTxtArea)) return;
|
||||
|
||||
$('#txtReplYn').val("Y"); // 치환 여부 상태값 설정
|
||||
|
||||
// 받는사람 데이터가 없는 경우 종료
|
||||
if (!recTableData.length) return;
|
||||
|
||||
try {
|
||||
// 문자 내용을 처리하고 단문/장문 카운트를 얻음
|
||||
const msgCount = SmsTextProcessor.processSmsText(smsTxtArea, recTableData);
|
||||
|
||||
// 총 가격 계산 및 업데이트
|
||||
replTotalPriceSum(msgCount.short, msgCount.long, recTableData.length);
|
||||
$('#txtReplYn').val("Y"); // 일괄변환문자 포함 여부 설정
|
||||
} catch (error) {
|
||||
console.error(error.message); // 오류 메시지 로그
|
||||
}
|
||||
|
||||
if(typeof data.rep3 != 'undefined' && data.rep3 != null && data.rep3 != ""){
|
||||
|
||||
var rep3 = data.rep3;
|
||||
smsTxt = stringReplaceAll(smsTxt, "[*3*]", rep3);
|
||||
|
||||
}
|
||||
|
||||
if(typeof data.rep4 != 'undefined' && data.rep4 != null && data.rep4 != ""){
|
||||
|
||||
var rep4 = data.rep4;
|
||||
smsTxt = stringReplaceAll(smsTxt, "[*4*]", rep4);
|
||||
|
||||
}
|
||||
|
||||
console.log('smsTxt : ', smsTxt);
|
||||
$('.realtime').text(smsTxt);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//특정문구 일괄변환 문자길이 체크 하기
|
||||
@ -320,6 +297,97 @@ function fnReplCell(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 문자 처리 객체
|
||||
const SmsTextProcessor = {
|
||||
// 치환 문자열 배열
|
||||
placeholders: ["[*이름*]", "[*1*]", "[*2*]", "[*3*]", "[*4*]"],
|
||||
|
||||
// 치환 문자열이 포함되어 있는지 확인
|
||||
hasPlaceholders(smsTxt) {
|
||||
// smsTxt에서 placeholders 중 하나라도 포함되면 true 반환
|
||||
return this.placeholders.some(ph => smsTxt.includes(ph));
|
||||
},
|
||||
|
||||
// 문자 내용을 치환하는 함수
|
||||
replacePlaceholders(text, data) {
|
||||
// 치환 문자열 키와 값을 매핑하여 처리
|
||||
return this.placeholders.reduce((result, ph, index) => {
|
||||
// 치환 키 설정 (예: [*1*], [*2*])
|
||||
const key = index === 0 ? "name" : `rep${index}`;
|
||||
// 데이터 값이 없으면 치환 문자열 그대로 유지
|
||||
const value = data[key] !== undefined && data[key] !== null ? data[key] : ph;
|
||||
|
||||
// console.log(`Replacing ${ph} with ${value}:`); // 디버깅 로그
|
||||
// 현재 치환 문자열만 교체
|
||||
// return result.replace(new RegExp(`\\${ph}(?!\\[)`, "g"), value);
|
||||
return stringReplaceAll(result, ph, value)
|
||||
}, text);
|
||||
}
|
||||
,
|
||||
|
||||
// 문자 길이를 계산하고 메시지 유형(단문/장문) 카운트
|
||||
processMessageLength(smsTxt, msgCount) {
|
||||
// 문자 길이(byte) 계산
|
||||
const msgLen = conByteLeng(smsTxt);
|
||||
//console.log('msgLen : ', msgLen);
|
||||
//console.log('smsTxt : ', smsTxt);
|
||||
|
||||
// 2000byte 초과시 오류 발생
|
||||
if (msgLen > 2000) {
|
||||
alert("문자 내용은 2000byte를 넘을 수 없습니다.");
|
||||
throw new Error("문자 내용 초과");
|
||||
}
|
||||
|
||||
// 길이에 따라 장문/단문 카운트 증가
|
||||
if (msgLen > 90) {
|
||||
msgCount.long++;
|
||||
} else {
|
||||
msgCount.short++;
|
||||
}
|
||||
|
||||
return msgCount; // 업데이트된 카운트 반환
|
||||
},
|
||||
|
||||
// 문자 내용 처리 함수
|
||||
processSmsText(smsTxtArea, rowData) {
|
||||
const msgCount = { short: 0, long: 0 }; // 단문/장문 초기화
|
||||
|
||||
|
||||
// 수신자 데이터가 없는 경우 원본 문자 유지
|
||||
if (!rowData || rowData.length === 0) {
|
||||
$('.realtime').text(smsTxtArea);
|
||||
return msgCount;
|
||||
}
|
||||
|
||||
// 받는사람 데이터 순회
|
||||
rowData.forEach((row, index) => {
|
||||
// 문자 내용을 개별 데이터로 치환
|
||||
let smsTxt = this.replacePlaceholders(smsTxtArea, row.getData());
|
||||
// 문자 길이를 계산하고 카운트를 업데이트
|
||||
this.processMessageLength(smsTxt, msgCount);
|
||||
|
||||
// 첫 번째 수신자의 변환 결과를 미리보기로 설정
|
||||
if (index === 0) {
|
||||
// console.log('smsTxt : ',smsTxt);
|
||||
$('.realtime').text(smsTxt); // 화면에 표시
|
||||
}
|
||||
});
|
||||
|
||||
return msgCount; // 최종 카운트 반환
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//특정문구 일괄변환 문자길이 체크 하기
|
||||
function fnReplCellExcel(){
|
||||
console.log('fnReplCellExcel');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user