문자 받는사람 체크

This commit is contained in:
hehihoho3@gmail.com 2024-12-16 20:33:25 +09:00
parent 5378514a8e
commit b06cc7e71e
5 changed files with 27 additions and 31 deletions

View File

@ -4119,7 +4119,7 @@
ON MC.ORDER_ID = MMD.USERDATA
AND MC.USER_ID = MMD.USER_ID
WHERE 1=1
AND MMD.SENT_DATE > date_add(now(), interval -7 day)
/* AND MMD.SENT_DATE > date_add(now(), interval -7 day)*/
AND MMD.CUR_STATE = '3'
AND MMD.REFUND_YN = 'N'
AND MMD.RESERVE_C_YN = 'N'

View File

@ -1055,7 +1055,7 @@ $(document).ready(function (){
// 총 30만건이 넘으면 false
if (!validateRowLimit(result.count)) {
if (!validateRowLimit(result.uniqueCount)) {
return false;
}

View File

@ -291,7 +291,6 @@ $(document).ready(function(){
}
var addrData = $tableExcel.getData().map((row, index) => ({
name: row.addrNm,
phone: removeDash(row.addrPhoneNo),
@ -301,11 +300,13 @@ $(document).ready(function(){
rep4: row.addrInfo4,
}));
// 기존 tableL의 데이터를 가져옵니다.
var existingData = tableL.getData();
// 기존 데이터와 새로운 데이터를 합칩니다.
var combinedData = existingData.concat(addrData);
/**
* @ phone을 기준으로 중복 제거 및 갯수 계산
@ -318,9 +319,11 @@ $(document).ready(function(){
* };
*/
const result = removeDuplicatesAndCount(combinedData, 'phone');
console.table('result : ', result);
// 총 30만건이 넘으면 false
if (!validateRowLimit(result.count)) {
if (!validateRowLimit(result.uniqueCount)) {
return false;
}
@ -336,23 +339,7 @@ $(document).ready(function(){
var totRows = tableL.getRows().length;
updateTotCnt(totRows); //전체 데이터 갯수 구하기
console.log('totRows : ', totRows);
var smsTxtArea = $('#smsTxtArea').val();
if(smsTxtArea.indexOf("[*이름*]") > -1
|| smsTxtArea.indexOf("[*1*]") > -1
|| smsTxtArea.indexOf("[*2*]") > -1
|| smsTxtArea.indexOf("[*3*]") > -1
|| smsTxtArea.indexOf("[*4*]") > -1){
// fnReplCell();
}else{
//결제 금액 구하기
// totalPriceSum(totRows);
}
totalPriceSum(totRows);
totalPriceSum(totRows);
setAddrMassClose();
$('.field-selector').each(function() { $(this).val(''); });

View File

@ -986,15 +986,22 @@ function getTabulatorLAddrGrpCnt(){
* };
*/
function removeDuplicatesAndCount(array, key) {
// 중복을 제거한 배열 생성
const uniqueArray = array.filter((item, index, self) =>
index === self.findIndex((t) => t[key] === item[key])
);
// 중복 체크를 위한 Map 사용
const seen = new Map();
const uniqueArray = [];
const duplicateArray = [];
// 중복된 데이터만 추출
const duplicateArray = array.filter((item, index, self) =>
index !== self.findIndex((t) => t[key] === item[key])
);
array.forEach(item => {
const value = item[key];
if (seen.has(value)) {
// 중복된 데이터는 중복 배열에 추가
duplicateArray.push(item);
} else {
// 처음 본 데이터는 고유 배열에 추가하고 Map에 기록
uniqueArray.push(item);
seen.set(value, true);
}
});
// 결과 반환
return {
@ -1022,6 +1029,8 @@ function validateRowLimit(totalRows, limit = 300000) {
// 숫자 변환
const totalRowsNum = Number(totalRows);
const limitNum = Number(limit);
console.log('totalRowsNum : ', totalRowsNum);
console.log('limitNum : ', limitNum);
// 변환 후 값 확인

View File

@ -4,7 +4,7 @@
function isValidPhoneNumber(phone) {
// 숫자만 추출
const numberOnly = phone.replace(/\D/g, '');
console.log('numberOnly : ' ,numberOnly);
// console.log('numberOnly : ' ,numberOnly);
// 유효한 형식 체크
return (