+ 문자발송 테스트중 batch 50000
This commit is contained in:
parent
5f33722e1b
commit
16eed13939
@ -186,12 +186,19 @@ public final class MsgSendUtils {
|
||||
* @author : 이호영
|
||||
* @date : 2024.09.26
|
||||
* @description : 배열에 데이터를 채우는 메서드
|
||||
* 1. 치환 문자열 데이터 확인 및 문자 치환
|
||||
* 2. 스팸 문자 체크
|
||||
* 3. 메세지 타입 구하기
|
||||
* 4. 제목 셋팅 : 타입에 따라 분기
|
||||
* 5. 이미지 갯수 셋팅
|
||||
* 6. 예약 및 분할에 따른 시간 설정
|
||||
* 7. 전송사 코드 셋팅
|
||||
* @param mjonMsgVO
|
||||
* @param lists
|
||||
* @param statusResponse
|
||||
* @param agentSendCounts
|
||||
* @param sendRateList
|
||||
* @return
|
||||
* @return call by reference
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Boolean populateSendLists(MjonMsgVO mjonMsgVO, List<MjonMsgSendVO> mjonMsgSendListVO
|
||||
@ -208,6 +215,7 @@ public final class MsgSendUtils {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
|
||||
// ReqDate가 비어 있으면 현재 시간으로 설정, 그렇지 않으면 ReqDate로 설정
|
||||
// 화면에서 예약문자면 예약시간을 regDate로 설정한다.
|
||||
Date baseDate;
|
||||
if (StringUtils.isEmpty(mjonMsgVO.getReqDate())) {
|
||||
mjonMsgVO.setReqDate(sdf.format(now)); // ReqDate에 현재 시간 설정
|
||||
@ -236,9 +244,11 @@ public final class MsgSendUtils {
|
||||
|
||||
boolean hasPerformedSpamCheck = false; // 치환 문자가 없는 경우, 스팸 체크가 한 번만 수행되도록 제어
|
||||
boolean hasPerformedMsgType = false; // 치환 문자가 없는 경우, 스팸 체크가 한 번만 수행되도록 제어
|
||||
boolean hasSetSubject = false; // 치환 데이터가 아닐 때 제목 설정 플래그
|
||||
|
||||
String msgKind = mjonMsgVO.getMsgKind();
|
||||
String smsTxtTemp = mjonMsgVO.getSmsTxt();
|
||||
String mmsSubject = mjonMsgVO.getMmsSubject();
|
||||
Boolean replaceYN = getReplaceYN(smsTxtTemp);
|
||||
|
||||
String msgTypeResult = null;
|
||||
@ -307,8 +317,22 @@ public final class MsgSendUtils {
|
||||
sendVO.setMsgType(msgTypeResult);
|
||||
|
||||
// 제목 셋팅
|
||||
|
||||
|
||||
if (LONG_MSG_TYPE.equals(msgTypeResult) && (replaceYN || !hasSetSubject)) {
|
||||
String mmsTitleTemp = "";
|
||||
// 제목이 비어 있고 전송할 SMS 텍스트가 존재하는 경우에만 처리
|
||||
if (StringUtils.isEmpty(mmsSubject) && StringUtils.isNotEmpty(smsTxt)) {
|
||||
// SMS 텍스트를 줄 단위로 나누기
|
||||
mmsTitleTemp = getMmsgSubject(smsTxt, msgKind);
|
||||
|
||||
// 치환 데이터가 아닌 경우 제목 설정 완료 플래그를 true로 설정
|
||||
if (!replaceYN) {
|
||||
hasSetSubject = true; // 제목 설정 완료
|
||||
}
|
||||
}
|
||||
|
||||
// 설정된 제목을 현재 메시지 객체에 적용
|
||||
sendVO.setSubject(mmsTitleTemp);
|
||||
}
|
||||
|
||||
// 이미지 셋팅
|
||||
setImagePathsForMsgSendVO(mjonMsgVO, sendVO);
|
||||
@ -336,16 +360,14 @@ public final class MsgSendUtils {
|
||||
String agentCode = "00".equals(mjonMsgVO.getAgentCode())
|
||||
? MsgSendUtils.assignAgentBasedOnCount(agentSendCounts, sendRateList)
|
||||
: mjonMsgVO.getAgentCode();
|
||||
sendVO.setAgentCode(agentCode);
|
||||
sendVO.setAgentCode(agentCode);
|
||||
|
||||
sendVO.setMsgGroupId(nextMsgGroupId);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
// Group TB에 넣어줄 제목
|
||||
// 치환안된 sms 데이터로 넣어야함
|
||||
mjonMsgVO.setMmsSubject(getMmsgSubject(smsTxtTemp, msgKind));
|
||||
|
||||
return true;
|
||||
|
||||
@ -556,11 +578,35 @@ public final class MsgSendUtils {
|
||||
// 각 가격을 합산
|
||||
totalPrice += Float.parseFloat(eachPrice);
|
||||
}
|
||||
mjonMsgVO.setTotalPrice(totalPrice);
|
||||
mjonMsgVO.setTotPrice(String.valueOf(totalPrice));
|
||||
|
||||
// log.debug("총 단가 합계: [{}]", totalPrice);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : setPriceforVO
|
||||
* @author : 이호영
|
||||
* @date : 2024.12.02
|
||||
* @description : total금액 구하기
|
||||
* @param mjonMsgSendVOList
|
||||
* @return
|
||||
*/
|
||||
public static float setPriceforVO(List<MjonMsgSendVO> mjonMsgSendVOList) {
|
||||
|
||||
float totalPrice = 0.0f;
|
||||
for (MjonMsgSendVO sendVO : mjonMsgSendVOList) {
|
||||
String priceStr = sendVO.getEachPrice();
|
||||
if(StringUtils.isNotEmpty(priceStr)) {
|
||||
totalPrice += Float.parseFloat(priceStr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return totalPrice;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 이미지 파일 경로를 기준으로 적절한 가격을 반환하는 헬퍼 메소드.
|
||||
@ -622,11 +668,11 @@ public final class MsgSendUtils {
|
||||
}
|
||||
|
||||
// 단가 설정
|
||||
float shortPrice = Float.parseFloat(eventMberInfo.getEventShortPrice());
|
||||
float longPrice = Float.parseFloat(eventMberInfo.getEventLongPrice());
|
||||
float picturePrice = Float.parseFloat(eventMberInfo.getEventPicturePrice());
|
||||
float picture2Price = Float.parseFloat(eventMberInfo.getEventPicture2Price());
|
||||
float picture3Price = Float.parseFloat(eventMberInfo.getEventPicture3Price());
|
||||
float eventShortPrice = Float.parseFloat(eventMberInfo.getEventShortPrice());
|
||||
float eventLongPrice = Float.parseFloat(eventMberInfo.getEventLongPrice());
|
||||
float eventPicturePrice = Float.parseFloat(eventMberInfo.getEventPicturePrice());
|
||||
float eventPicture2Price = Float.parseFloat(eventMberInfo.getEventPicture2Price());
|
||||
float eventPicture3Price = Float.parseFloat(eventMberInfo.getEventPicture3Price());
|
||||
|
||||
// 최적의 메시지 리스트 생성
|
||||
double sum = 0.0;
|
||||
@ -636,7 +682,7 @@ public final class MsgSendUtils {
|
||||
MjonMsgSendVO msg = iterator.next();
|
||||
|
||||
// 단가 계산 및 예외 처리
|
||||
String eachPrice = getEachPriceOrThrow(msg, shortPrice, longPrice, picturePrice, picture2Price, picture3Price);
|
||||
String eachPrice = getEachPriceOrThrow(msg, eventShortPrice, eventLongPrice, eventPicturePrice, eventPicture2Price, eventPicture3Price);
|
||||
|
||||
float floatEachPrice = Float.parseFloat(eachPrice);
|
||||
|
||||
@ -816,10 +862,30 @@ public final class MsgSendUtils {
|
||||
return sendRateList.get(0).getRepAgent();
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : getMmsgSubject
|
||||
* @author : 이호영
|
||||
* @date : 2024.12.02
|
||||
* @description : 타이틀 생성
|
||||
* @param smsTxt
|
||||
* @param msgKind
|
||||
* @return
|
||||
*/
|
||||
public static String getMmsgSubject(String smsTxt, String msgKind) {
|
||||
String mmsTitleTemp = "";
|
||||
// SMS 텍스트를 줄 단위로 나누기
|
||||
String[] split = smsTxt.split("\n");
|
||||
log.info(" : split.length :: [{}]", split.length);
|
||||
|
||||
if (split.length > 0) {
|
||||
// "C" 메시지 종류인 경우 두 번째 줄, 그렇지 않으면 첫 번째 줄을 제목으로 설정
|
||||
mmsTitleTemp = "C".equals(msgKind) && split.length > 1 ? split[1].trim() : split[0].trim();
|
||||
|
||||
|
||||
|
||||
// 제목 글자 수를 20자로 제한 (초과 시 잘라냄)
|
||||
mmsTitleTemp = mmsTitleTemp.length() > 20 ? mmsTitleTemp.substring(0, 20) : mmsTitleTemp;
|
||||
}
|
||||
return mmsTitleTemp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@ -3984,17 +3985,14 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
return mjonMsgDataDAO.selectPayUserSumFaxList(mjonMsgVO);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see itn.let.mjo.msgdata.service.MjonMsgDataService#sendMsgData_advc(itn.let.mjo.msg.service.MjonMsgVO, javax.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
/* (non-Javadoc)
|
||||
* @see itn.let.mjo.msgdata.service.MjonMsgDataService#sendMsgData_advc(itn.let.mjo.msg.service.MjonMsgVO, javax.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
@Override
|
||||
public StatusResponse sendMsgData_advc(MjonMsgVO mjonMsgVO, HttpServletRequest request) throws Exception {
|
||||
|
||||
log.info(" :: sendMsgData_advc :: ");
|
||||
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
|
||||
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
@ -4044,19 +4042,19 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
|
||||
// 삭제 전 리스트 크기 저장
|
||||
int initialSize = mjonMsgSendVOList.size();
|
||||
|
||||
// 수신목록 셋팅
|
||||
List<String> userBlockList = mjonMsgDAO.selectUserBlockList(mjonMsgVO);
|
||||
|
||||
|
||||
|
||||
// 리스트 초기 크기
|
||||
mjonMsgSendVOList.removeIf(vo -> userBlockList.contains(vo.getPhone()));
|
||||
// log.info(" !! mjonMsgSendVOList.size() :: [{}]",mjonMsgSendVOList.size());
|
||||
// 삭제 후 리스트 크기 저장
|
||||
int finalSize = mjonMsgSendVOList.size();
|
||||
// 삭제된 건 수 계산
|
||||
int deletedCount = initialSize - finalSize;
|
||||
|
||||
|
||||
|
||||
|
||||
// 수신거부 목록
|
||||
returnMap.put("resultBlockSts", deletedCount);
|
||||
|
||||
|
||||
|
||||
@ -4093,6 +4091,21 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
List<String> resultSpamTxt = mjonMsgDataService.selectSpamKeywordList();
|
||||
// msgGroupId 생성
|
||||
String nextMsgGroupId = idgenMjonMsgGroupId.getNextStringId();
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : populateReplacementLists
|
||||
* @author : 이호영
|
||||
* @date : 2024.09.26
|
||||
* @description : 배열에 데이터를 채우는 메서드
|
||||
* 1. 치환 문자열 데이터 확인 및 문자 치환
|
||||
* 2. 스팸 문자 체크
|
||||
* 3. 메세지 타입 구하기
|
||||
* 4. 제목 셋팅 : 타입에 따라 분기
|
||||
* 5. 이미지 갯수 셋팅
|
||||
* 6. 예약 및 분할에 따른 시간 설정
|
||||
* 7. 전송사 코드 셋팅
|
||||
*/
|
||||
if(!MsgSendUtils.populateSendLists(mjonMsgVO, mjonMsgSendVOList, statusResponse, resultSpamTxt
|
||||
, agentSendCounts, sendRateList, nextMsgGroupId)) {;
|
||||
//문자 치환 후 전송 문자 길이를 초과하였습니다.
|
||||
@ -4100,6 +4113,9 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
return statusResponse;
|
||||
}
|
||||
|
||||
// group_data에 insert하기위해 추가
|
||||
mjonMsgVO.setReqDate(mjonMsgSendVOList.get(0).getReqDate());
|
||||
|
||||
|
||||
//1.시스템 기본 단가 정보 불러오기
|
||||
JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo();
|
||||
@ -4107,35 +4123,24 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
MberManageVO mberManageVO = mjonMsgDataDAO.selectMberManageInfo(userId);
|
||||
MsgSendUtils.setPriceforVO(mjonMsgVO, mjonMsgSendVOList, sysJoinSetVO, mberManageVO);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*mjonMsgSendVOList.parallelStream().forEach(t -> {
|
||||
try {
|
||||
t.setMsgId(idgenMsgId.getNextStringId());
|
||||
} catch (FdlException e) {
|
||||
log.error("MsgId 생성 중 오류 발생", e);
|
||||
}
|
||||
});*/
|
||||
// msg_id 대량 생성
|
||||
List<String> idList = idgenMsgCId.getNextStringId(mjonMsgSendVOList.size());
|
||||
// System.out.println(" idList.size() : " + idList.size());
|
||||
// System.out.println(" idList : " + idList);
|
||||
for (int i = 0; i < mjonMsgSendVOList.size(); i++) {
|
||||
mjonMsgSendVOList.get(i).setMsgId(idList.get(i));
|
||||
}
|
||||
|
||||
// mjonMsgSendVOList.stream().forEach(t-> System.out.print(t.toString()+"\n") );
|
||||
|
||||
|
||||
|
||||
// 이벤트 영역
|
||||
// 이벤트 영역
|
||||
|
||||
// 이벤트 정보 가져오기
|
||||
// 이벤트 상태가 "E"가 아닌 경우에만 호출
|
||||
// 이벤트 금액이 있을 시 발송 LIST에서 => optimalMsgList로 데이터 이동
|
||||
// 이동하면서 이벤트 금액으로 설정
|
||||
/*
|
||||
* 이벤트 영역
|
||||
* 이벤트 정보 가져오기
|
||||
* 이벤트 상태가 "E"가 아닌 경우에만 호출
|
||||
* 이벤트 금액이 있을 시 발송 LIST에서
|
||||
* => optimalMsgList로 데이터 이동
|
||||
* 이동하면서 이벤트 금액으로 설정
|
||||
*/
|
||||
MjonEventVO eventMberInfo = mjonEventService.selectEventMsgMberDefaultInfo_advc(userId);
|
||||
OptimalMsgResultDTO result = null;
|
||||
List<MjonMsgSendVO> optimalMsgList = new ArrayList<>();
|
||||
@ -4145,7 +4150,18 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
result = MsgSendUtils.getOptimalMsgList(eventMberInfo, mjonMsgSendVOList);
|
||||
optimalMsgList = result.getOptimalMsgList();
|
||||
MjonEventVO returnEventMberInfo = result.getEventInfo();
|
||||
|
||||
// 이벤트 list에 내역에 있으면
|
||||
if(CollectionUtils.isNotEmpty(optimalMsgList))
|
||||
{
|
||||
// group tb에 이벤트 발송인지 Y 입력해야함
|
||||
mjonMsgVO.setEventYn("Y");
|
||||
// 기존 리스트로 병합
|
||||
// 따로 분기 후 병합 하는 이유는 유지보수 및 기능 분리르 위함
|
||||
mjonMsgSendVOList.addAll(optimalMsgList);
|
||||
}
|
||||
|
||||
// 이벤트 금액이 끝났거나 종료상태로 전환되면 update해야함
|
||||
if (returnEventMberInfo != null && "E".equals(returnEventMberInfo.getEventStatus())) {
|
||||
returnEventMberInfo.setMberId(userId);
|
||||
mjonEventService.updateEventEndStatus(returnEventMberInfo);
|
||||
@ -4158,33 +4174,133 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
return statusResponse;
|
||||
}
|
||||
}
|
||||
log.info(" + optimalMsgList :: [{}]", optimalMsgList.size());
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
System.out.println("==================== insert 시작 ====================");
|
||||
|
||||
|
||||
// log.info("mj_msg_data insert start [{}]", mjonMsgSendVOList.size());
|
||||
float totalPrice = MsgSendUtils.setPriceforVO(mjonMsgSendVOList);
|
||||
// 합산 금액을 String으로 변환하여 설정
|
||||
mjonMsgVO.setTotPrice(String.valueOf(totalPrice));
|
||||
|
||||
log.info("mj_msg_data insert start [{}]", mjonMsgSendVOList.size());
|
||||
|
||||
// 분할 최대건수가 되면 디비에 입력하기
|
||||
// int instCnt = mjonMsgDataDAO.insertMsgDataInfo_advc(mjonMsgSendVOList);
|
||||
// int instCnt = mjonMsgDataDAO.insertMsgDataInfo_jdbc_advc(mjonMsgSendVOList);
|
||||
|
||||
// Batch 시작 시간 측정
|
||||
long insetStartTime = System.currentTimeMillis();
|
||||
// 총 발송 건수 = DB insert
|
||||
int instCnt = this.insertMsgData_advc(mjonMsgSendVOList);
|
||||
|
||||
// Batch 종료 시간 측정 및 실행 시간 계산
|
||||
long insetEndTime = System.currentTimeMillis();
|
||||
double insetExecutionTimeInSeconds = (insetEndTime - insetStartTime) / 1000.0;
|
||||
|
||||
// 수신거부 목록
|
||||
returnMap.put("resultSts", instCnt);
|
||||
returnMap.put("msg insert seconds :: ", insetExecutionTimeInSeconds);
|
||||
|
||||
log.debug("총 단가 합계: [{}]", mjonMsgVO.getTotPrice());
|
||||
//TODO: group 테이블에 저장
|
||||
if(instCnt > 0) {
|
||||
|
||||
// Group TB insert
|
||||
mjonMsgVO.setMsgGroupCnt(Integer.toString(instCnt));
|
||||
this.insertMsgGroupDataTb_advc(mjonMsgVO, mjonMsgSendVOList.get(0));
|
||||
|
||||
// 금액 및 포인트 insert
|
||||
// priceAndPoint.insertCashAndPoint(
|
||||
// userId
|
||||
// , -Float.parseFloat(mjonMsgVO.getTotPrice())
|
||||
// , "SMS 문자 총 " + mjonMsgVO.getMjonMsgSendVOList().size() + "건 중 " + instCnt + "건 발송"
|
||||
// , mjonMsgVO.getMsgGroupId()
|
||||
// );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//TODO : group tb insert 후 처리
|
||||
// handleSpamMsg_advc(mjonMsgVO, mjonMsgSendVOList.get(0));
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* // 1건 이상 발송이 있는 경우만 캐쉬를 차감 시킨다.
|
||||
if (resultCnt > 0) {
|
||||
|
||||
int totSendCnt = mjonMsgVO.getTotalCallCnt();
|
||||
Float eachPrice = Float.parseFloat(mjonMsgVO.getEachPrice());
|
||||
Float totPrice = eachPrice * resultCnt;
|
||||
String strTotPrice = String.format("%.1f", totPrice);
|
||||
|
||||
mjonMsgVO.setTotPrice(strTotPrice);// 현재 합산 금액 셋팅
|
||||
mjonPayVO.setCashId(idgenMjonCashId.getNextStringId());
|
||||
mjonPayVO.setUserId(mjonMsgVO.getUserId());
|
||||
mjonPayVO.setCash(-Float.parseFloat(strTotPrice));
|
||||
mjonPayVO.setFrstRegisterId(mjonMsgVO.getUserId());
|
||||
mjonPayVO.setMemo("SMS 문자 총 " + totSendCnt + "건 중 " + resultCnt + "건 발송");
|
||||
mjonPayVO.setMsgGroupId(mjonMsgVO.getMsgGroupId());
|
||||
|
||||
mjonPayService.insertCash(mjonPayVO); // 캐시차감
|
||||
mjonPayService.updateMemberCash(mjonPayVO); // 회원정보 업데이트
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
|
||||
// 강제로 IllegalArgumentException 발생시키기
|
||||
// if (true) {
|
||||
// throw new IllegalArgumentException("강제로 발생한 오류입니다.");
|
||||
// }
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
|
||||
|
||||
// 발송 처리
|
||||
// statusResponse = processMessageSending(mjonMsgVO, intiLists, statusResponse);
|
||||
// } else {
|
||||
// // 일반 문자 발송
|
||||
// statusResponse = fncSendMsg(mjonMsgVO);
|
||||
// }
|
||||
statusResponse.setStatus(HttpStatus.OK);
|
||||
statusResponse.setObject(returnMap);
|
||||
return statusResponse;
|
||||
|
||||
}
|
||||
|
||||
private void insertMsgGroupDataTb_advc(MjonMsgVO mjonMsgVO, MjonMsgSendVO mjonMsgSendVO) throws Exception {
|
||||
|
||||
mjonMsgVO.setAgentCode(mjonMsgSendVO.getAgentCode());// 전송사 코드 번호를 셋팅해 준다.
|
||||
// 지연 유무 코드가 Null 인경우 체크
|
||||
|
||||
mjonMsgVO.setBefCash(priceAndPoint.getBefCash(mjonMsgVO.getUserId()));
|
||||
mjonMsgVO.setBefPoint(priceAndPoint.getBefPoint(mjonMsgVO.getUserId()));
|
||||
|
||||
mjonMsgVO.setMsgGroupId(mjonMsgSendVO.getMsgGroupId());
|
||||
mjonMsgDAO.insertGroupMsgData(mjonMsgVO);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private int insertMsgData_advc(List<MjonMsgSendVO> mjonMsgSendVOList) {
|
||||
|
||||
|
||||
// 시작 시간 측정
|
||||
long totalStartTime = System.currentTimeMillis();
|
||||
|
||||
int totalSize = mjonMsgSendVOList.size(); // 총 데이터 개수
|
||||
int batchSize = 50000; // Batch 크기 설정 (고정값)
|
||||
|
||||
System.out.println("총 데이터 개수 :: " + totalSize);
|
||||
System.out.println("설정된 Batch 크기 :: " + batchSize);
|
||||
log.info("총 데이터 개수 :: [{}] ", totalSize);
|
||||
log.info("설정된 Batch 크기 :: [{}] ", batchSize);
|
||||
|
||||
// 총 insert 카운트
|
||||
int instCnt = 0;
|
||||
int batchCount = 0;
|
||||
|
||||
@ -4197,7 +4313,7 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
|
||||
// Batch 리스트 생성
|
||||
List<MjonMsgSendVO> batchList = mjonMsgSendVOList.subList(
|
||||
i, Math.min(i + batchSize, totalSize)
|
||||
i, Math.min(i + batchSize, totalSize)
|
||||
);
|
||||
System.out.println("Batch 시작 인덱스: " + i);
|
||||
|
||||
@ -4221,10 +4337,10 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
double totalExecutionTimeInSeconds = (totalEndTime - totalStartTime) / 1000.0;
|
||||
|
||||
// 실행 시간 출력
|
||||
System.out.println("총 배치 실행 횟수 :: " + batchCount);
|
||||
System.out.println("batchSize :: " + batchSize);
|
||||
System.out.println("총 실행 시간 :: " + totalExecutionTimeInSeconds + "초");
|
||||
System.out.println("총 삽입 건수 :: " + instCnt);
|
||||
log.info("총 배치 실행 횟수 :: [{}] ", batchCount);
|
||||
log.info("batchSize :: [{}] ", batchSize);
|
||||
log.info("총 실행 시간 :: [{}] ", totalExecutionTimeInSeconds + "초");
|
||||
log.info("총 삽입 건수 :: [{}] ", instCnt);
|
||||
|
||||
// 각 배치별 실행 시간 출력
|
||||
for (int k = 0; k < batchExecutionTimes.size(); k++) {
|
||||
@ -4233,63 +4349,10 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
|
||||
|
||||
|
||||
// 강제로 IllegalArgumentException 발생시키기
|
||||
if (true) {
|
||||
throw new IllegalArgumentException("강제로 발생한 오류입니다.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// log.info(" + optimalMsgList :: [{}]", optimalMsgList.size());
|
||||
// log.info(" + optimalMsgList :: [{}]", optimalMsgList.get(0).getEachPrice());
|
||||
// log.info(" + mjonMsgSendVOList :: [{}]", mjonMsgSendVOList.size());
|
||||
// log.info(" + mjonMsgSendVOList :: [{}]", mjonMsgSendVOList.get(0).getEachPrice());
|
||||
|
||||
|
||||
|
||||
|
||||
// log.info("mjonMsgVO.getTotalPrice() :: [{}]", mjonMsgVO.getTotalPrice());
|
||||
|
||||
// log.info(" + userId :: [{}]", userId);
|
||||
// log.info(" + priceAndPoint.getBefCash(userId) :: [{}]", priceAndPoint.getBefCash(userId));
|
||||
|
||||
|
||||
|
||||
// mjonMsgSendVOList.stream().forEach(t-> System.out.println(t.getEachPrice()));
|
||||
// mjonMsgSendVOList.stream().forEach(t-> System.out.println(t.toString()));
|
||||
|
||||
// mjonMsgSendVOList.stream()
|
||||
// .map(MjonMsgSendVO::getSmsTxt) // 각 객체의 getSmsTxt() 호출
|
||||
// .forEach(System.out::println); // 결과를 바로 출력
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
// if(true) {
|
||||
// return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 테스트 실패");
|
||||
// }
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
//////////////////////////////////
|
||||
|
||||
// 발송 처리
|
||||
// statusResponse = processMessageSending(mjonMsgVO, intiLists, statusResponse);
|
||||
// } else {
|
||||
// // 일반 문자 발송
|
||||
// statusResponse = fncSendMsg(mjonMsgVO);
|
||||
// }
|
||||
|
||||
return statusResponse;
|
||||
|
||||
return instCnt;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @methodName : handleHotlineAgent
|
||||
* @author : 이호영
|
||||
* @date : 2024.11.26
|
||||
@ -4519,6 +4582,30 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
System.err.println("스팸 문구 처리 중 오류 발생: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void handleSpamMsg_advc(MjonMsgVO mjonMsgVO, MjonMsgSendVO mjonMsgSendVO) {
|
||||
try {
|
||||
if ("Y".equals(mjonMsgVO.getSpamStatus()))
|
||||
{
|
||||
MjonMsgVO mjonSpamMsgVO = mjonMsgVO;
|
||||
mjonSpamMsgVO.setCallFrom(mjonMsgSendVO.getCallFrom());
|
||||
mjonSpamMsgVO.setMsgGroupCnt(mjonMsgSendVO.getMsgGroupId());
|
||||
|
||||
mjonSpamMsgVO.setSubject(null);
|
||||
mjonSpamMsgVO.setReqDate(null);
|
||||
mjonSpamMsgVO.setMsgType(null);
|
||||
mjonSpamMsgVO.setMsgType(null);
|
||||
mjonSpamMsgVO.setEachPrice(null);
|
||||
|
||||
|
||||
|
||||
int resultCnt = mjonSpamMsgService.insertSpamKeyWordMsgData(mjonMsgVO);
|
||||
System.out.println("스팸 문구 발송 내용 등록: " + resultCnt);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println("스팸 문구 처리 중 오류 발생: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// 예약 문자인 경우 처리하는 메서드
|
||||
private MjonMsgVO handleReserveMsg(MjonMsgVO mjonMsgVO) throws ParseException {
|
||||
|
||||
@ -1283,9 +1283,6 @@ function sendMsgAjax_advc(){
|
||||
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%)'});
|
||||
@ -1296,15 +1293,19 @@ function sendMsgAjax_advc(){
|
||||
|
||||
$('.pop_msg_success').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
|
||||
//예약발송 건의 경우 결과 팝업 문구 변경
|
||||
|
||||
var reserYn = $("input[name=reserYn]:checked").val();
|
||||
var resText = (reserYn === 'Y') ? '예약' : '발송';
|
||||
/*
|
||||
if(reserYn == 'Y')
|
||||
/* {
|
||||
{
|
||||
resText = "예약";
|
||||
}
|
||||
else
|
||||
{
|
||||
resText = "발송";
|
||||
} */
|
||||
}
|
||||
*/
|
||||
$('.pop_msg_success .msg_text').html(resText+" 성공 : <strong>"+ smsCnt + "</strong>건,수신거부 : <span>" + blockCnt + "</span>건의<br>문자가 "+resText+" 되었습니다.");
|
||||
|
||||
$('.mask').addClass('on');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user