문자전송 로직 리펙토링 중
This commit is contained in:
parent
07800e4543
commit
b7fe16bddf
@ -3241,267 +3241,262 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
|||||||
@Override
|
@Override
|
||||||
public StatusResponse sendMsgData_advc(MjonMsgVO mjonMsgVO, HttpServletRequest request) throws Exception {
|
public StatusResponse sendMsgData_advc(MjonMsgVO mjonMsgVO, HttpServletRequest request) throws Exception {
|
||||||
|
|
||||||
String resultSts = "0";
|
String resultSts = "0";
|
||||||
String resultBlockSts = "0";
|
String resultBlockSts = "0";
|
||||||
String userId = "";
|
String userId = "";
|
||||||
|
|
||||||
|
|
||||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||||
userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||||
|
|
||||||
if(userId.equals("")) {
|
if(userId.equals("")) {
|
||||||
// Map<String, String> returnMap = new HashMap<>();
|
return new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용이 가능합니다.");
|
||||||
// returnMap.put("message", "로그인 후 이용이 가능합니다.");
|
}
|
||||||
// returnMap.put("result", "loginFail");
|
|
||||||
// returnMap.put("resultSts", resultSts);
|
|
||||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용이 가능합니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
mjonMsgVO.setUserId(userId);
|
mjonMsgVO.setUserId(userId);
|
||||||
|
|
||||||
//발신번호가 등록된 유효한 번호인지 확인
|
//발신번호가 등록된 유효한 번호인지 확인
|
||||||
int sendCallFromCnt = mjonMsgDAO.selectCallFromNumberChk(mjonMsgVO);
|
int sendCallFromCnt = mjonMsgDAO.selectCallFromNumberChk(mjonMsgVO);
|
||||||
log.info("sendCallFromCnt :: [{}]", sendCallFromCnt);
|
log.info("sendCallFromCnt :: [{}]", sendCallFromCnt);
|
||||||
if(sendCallFromCnt < 1) {
|
if(sendCallFromCnt < 1) {
|
||||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "등록된 발신번호를 찾을 수 없습니다.");
|
return new StatusResponse(HttpStatus.BAD_REQUEST, "등록된 발신번호를 찾을 수 없습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 회원 정지된 상태이면 문자 발송이 안되도록 처리함
|
* 회원 정지된 상태이면 문자 발송이 안되도록 처리함
|
||||||
* 현재 로그인 세션도 만료 처리함
|
* 현재 로그인 세션도 만료 처리함
|
||||||
* */
|
* */
|
||||||
boolean mberSttus = userManageService.selectUserStatusInfo(userId);
|
boolean mberSttus = userManageService.selectUserStatusInfo(userId);
|
||||||
if(!mberSttus) {
|
if(!mberSttus) {
|
||||||
request.getSession().invalidate();
|
request.getSession().invalidate();
|
||||||
// UNAUTHORIZED : 인증되지 않은 사용자가 접근하려고 할 때
|
// UNAUTHORIZED : 인증되지 않은 사용자가 접근하려고 할 때
|
||||||
return new StatusResponse(HttpStatus.UNAUTHORIZED, "현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 문자를 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다.");
|
return new StatusResponse(HttpStatus.UNAUTHORIZED, "현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 문자를 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 어디에 사용하는지 모르겠음
|
* 어디에 사용하는지 모르겠음
|
||||||
* //회원정보에서 스미싱 회원 여부 정보 조회
|
* set 후에 사용하는 곳이 없음
|
||||||
UserManageVO userManageVO = new UserManageVO();
|
* //회원정보에서 스미싱 회원 여부 정보 조회
|
||||||
|
UserManageVO userManageVO = new UserManageVO();
|
||||||
|
|
||||||
userManageVO.setMberId(userId);
|
userManageVO.setMberId(userId);
|
||||||
UserManageVO resultUserVO = userManageService.selectSmishingYnUserInfo(userManageVO);
|
UserManageVO resultUserVO = userManageService.selectSmishingYnUserInfo(userManageVO);
|
||||||
String smishingYn = resultUserVO.getSmishingYn();
|
String smishingYn = resultUserVO.getSmishingYn();
|
||||||
mjonMsgVO.setSmishingYn(smishingYn);
|
mjonMsgVO.setSmishingYn(smishingYn);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int smsTxtByte = MsgSendUtils.getSmsTxtBytes(mjonMsgVO.getSmsTxt());
|
int smsTxtByte = MsgSendUtils.getSmsTxtBytes(mjonMsgVO.getSmsTxt());
|
||||||
if(smsTxtByte > 2000) {
|
if(smsTxtByte > 2000) {
|
||||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 내용은 2000Byte를 넘을 수 없습니다.");
|
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 내용은 2000Byte를 넘을 수 없습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// MSG_TYPE 설정
|
// MSG_TYPE 설정
|
||||||
String msgType = MsgSendUtils.getMsgType(mjonMsgVO, smsTxtByte);
|
String msgType = MsgSendUtils.getMsgType(mjonMsgVO, smsTxtByte);
|
||||||
if ("INVALID".equals(msgType)) {
|
if ("INVALID".equals(msgType)) {
|
||||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 내용은 2000Byte를 넘을 수 없습니다.");
|
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 내용은 2000Byte를 넘을 수 없습니다.");
|
||||||
}
|
}
|
||||||
mjonMsgVO.setMsgType(msgType);
|
mjonMsgVO.setMsgType(msgType);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//장문 메세지일 경우
|
//장문 메세지일 경우
|
||||||
int fileCount = 0;
|
int fileCount = 0;
|
||||||
if(msgType.equals("6")) {
|
if(msgType.equals("6")) {
|
||||||
|
|
||||||
//그림 이미지가 첨부된 경우
|
//그림 이미지가 첨부된 경우
|
||||||
if(mjonMsgVO.getImgFilePath() != null || mjonMsgVO.getImgFilePath().length > 0) {
|
if(mjonMsgVO.getImgFilePath() != null || mjonMsgVO.getImgFilePath().length > 0) {
|
||||||
|
|
||||||
String[] path = mjonMsgVO.getImgFilePath();
|
String[] path = mjonMsgVO.getImgFilePath();
|
||||||
String[] fileId = mjonMsgVO.getImgFileId();
|
String[] fileId = mjonMsgVO.getImgFileId();
|
||||||
String[] templateYn = mjonMsgVO.getTemplateYn();
|
String[] templateYn = mjonMsgVO.getTemplateYn();
|
||||||
|
|
||||||
for(int i=0; i<path.length; i++) {
|
for(int i=0; i<path.length; i++) {
|
||||||
|
|
||||||
if("Y".equals(templateYn[i])) {
|
if("Y".equals(templateYn[i])) {
|
||||||
//템플릿 사용누계 증가
|
//템플릿 사용누계 증가
|
||||||
letterDAO.updateTemplateUseCount(fileId[i]);
|
letterDAO.updateTemplateUseCount(fileId[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
String imgFilePath = mjonMsgDAO.selectPhotoImgFileRealPath(fileId[i]);
|
String imgFilePath = mjonMsgDAO.selectPhotoImgFileRealPath(fileId[i]);
|
||||||
|
|
||||||
// 아이하트, 현대퓨쳐넷 두 중계사는 이미지 경로는 풀패스 경로로 넘겨주면 됨
|
// 아이하트, 현대퓨쳐넷 두 중계사는 이미지 경로는 풀패스 경로로 넘겨주면 됨
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0:
|
case 0:
|
||||||
mjonMsgVO.setFileName1(imgFilePath);
|
mjonMsgVO.setFileName1(imgFilePath);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
mjonMsgVO.setFileName2(imgFilePath);
|
mjonMsgVO.setFileName2(imgFilePath);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mjonMsgVO.setFileName3(imgFilePath);
|
mjonMsgVO.setFileName3(imgFilePath);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fileCount ++;
|
fileCount ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//첨부파일 갯수 셋팅해주기
|
//첨부파일 갯수 셋팅해주기
|
||||||
mjonMsgVO.setFileCnt(Integer.toString(fileCount));
|
mjonMsgVO.setFileCnt(Integer.toString(fileCount));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//파일 갯수는 있는데 파일 경로가 없는 경우 문자발송이 안되도록 튕겨내도록 함 - 20220520 우영두
|
// 파일 갯수는 있는데 파일 경로가 없는 경우 문자발송이 안되도록 튕겨내도록 함 - 20220520 우영두
|
||||||
if(fileCount > 0) {
|
// 리펙토링 20240930 이호영
|
||||||
|
if(fileCount > 0) {
|
||||||
|
|
||||||
// if(mjonMsgVO.getFileName1() == null && mjonMsgVO.getFileName2() == null && mjonMsgVO.getFileName3() == null) {
|
//if(mjonMsgVO.getFileName1() == null && mjonMsgVO.getFileName2() == null && mjonMsgVO.getFileName3() == null) {
|
||||||
|
|
||||||
boolean allFilesAreNull = Stream.of(
|
boolean allFilesAreNull = Stream.of(
|
||||||
mjonMsgVO.getFileName1(),
|
mjonMsgVO.getFileName1(),
|
||||||
mjonMsgVO.getFileName2(),
|
mjonMsgVO.getFileName2(),
|
||||||
mjonMsgVO.getFileName3()
|
mjonMsgVO.getFileName3()
|
||||||
).allMatch(Objects::isNull);
|
).allMatch(Objects::isNull);
|
||||||
|
|
||||||
|
if (allFilesAreNull) {
|
||||||
if (allFilesAreNull) {
|
return new StatusResponse(HttpStatus.NO_CONTENT
|
||||||
return new StatusResponse(HttpStatus.NO_CONTENT
|
, "문자 메세지 이미지 추가에 오류가 발생하여 문자 발송이 취소 되었습니다."
|
||||||
, "문자 메세지 이미지 추가에 오류가 발생하여 문자 발송이 취소 되었습니다."
|
);
|
||||||
);
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 화면에서 넘어오는 단가 금액 및 총 결제 캐시 금액 체크 해주기
|
* 화면에서 넘어오는 단가 금액 및 총 결제 캐시 금액 체크 해주기
|
||||||
* 검증을 위해서 시스템 단가, 회원 협의 단가, 이벤트 단가 정보 조회
|
* 검증을 위해서 시스템 단가, 회원 협의 단가, 이벤트 단가 정보 조회
|
||||||
* 조회 단가를 이용하여 총 결제 캐시 금액 계산
|
* 조회 단가를 이용하여 총 결제 캐시 금액 계산
|
||||||
* 파라미터로 넘어온 개별단가(eachPrice), 총 결제캐시(totPrice)를 비요하여 동일하지 않으면 컨트롤러에서 계산한 금액으로 입력해줌.
|
* 파라미터로 넘어온 개별단가(eachPrice), 총 결제캐시(totPrice)를 비요하여 동일하지 않으면 컨트롤러에서 계산한 금액으로 입력해줌.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
MjonEventVO mjonEventVO = new MjonEventVO();
|
MjonEventVO mjonEventVO = new MjonEventVO();
|
||||||
mjonEventVO.setMberId(userId);
|
mjonEventVO.setMberId(userId);
|
||||||
|
|
||||||
//1.시스템 기본 단가 정보 불러오기
|
//1.시스템 기본 단가 정보 불러오기
|
||||||
JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo();
|
JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo();
|
||||||
|
|
||||||
// 등급제 단가 추출 => 시스템 단가에 적용
|
// 등급제 단가 추출 => 시스템 단가에 적용
|
||||||
// sysJoinSetVO = mberGrdService.selectMberGrdDefaultInfo(sysJoinSetVO, userId);
|
// sysJoinSetVO = mberGrdService.selectMberGrdDefaultInfo(sysJoinSetVO, userId);
|
||||||
|
|
||||||
//2.사용자 개인 단가 정보 불러오기
|
//2.사용자 개인 단가 정보 불러오기
|
||||||
MberManageVO mberManageVO = mjonMsgDataDAO.selectMberManageInfo(userId);
|
MberManageVO mberManageVO = mjonMsgDataDAO.selectMberManageInfo(userId);
|
||||||
|
|
||||||
|
|
||||||
// 3. 사용자 단가 정보 설정
|
// 3. 사용자 단가 정보 설정
|
||||||
//협의 단가가 없는 경우 시스템 단가 적용해 주기
|
//협의 단가가 없는 경우 시스템 단가 적용해 주기
|
||||||
float shortPrice = MsgSendUtils.getValidPrice(mberManageVO.getShortPrice(), sysJoinSetVO.getShortPrice());
|
float shortPrice = MsgSendUtils.getValidPrice(mberManageVO.getShortPrice(), sysJoinSetVO.getShortPrice());
|
||||||
float longPrice = MsgSendUtils.getValidPrice(mberManageVO.getLongPrice(), sysJoinSetVO.getLongPrice());
|
float longPrice = MsgSendUtils.getValidPrice(mberManageVO.getLongPrice(), sysJoinSetVO.getLongPrice());
|
||||||
float picturePrice = MsgSendUtils.getValidPrice(mberManageVO.getPicturePrice(), sysJoinSetVO.getPicturePrice());
|
float picturePrice = MsgSendUtils.getValidPrice(mberManageVO.getPicturePrice(), sysJoinSetVO.getPicturePrice());
|
||||||
float picture2Price = MsgSendUtils.getValidPrice(mberManageVO.getPicture2Price(), sysJoinSetVO.getPicture2Price());
|
float picture2Price = MsgSendUtils.getValidPrice(mberManageVO.getPicture2Price(), sysJoinSetVO.getPicture2Price());
|
||||||
float picture3Price = MsgSendUtils.getValidPrice(mberManageVO.getPicture3Price(), sysJoinSetVO.getPicture3Price());
|
float picture3Price = MsgSendUtils.getValidPrice(mberManageVO.getPicture3Price(), sysJoinSetVO.getPicture3Price());
|
||||||
|
|
||||||
|
|
||||||
// 기존 소수점 2째자리에서 반올림하였으나, 정책 변경으로 소수점 버림 처리함
|
// 기존 소수점 2째자리에서 반올림하였으나, 정책 변경으로 소수점 버림 처리함
|
||||||
// boolean compareEndDate = false;
|
// boolean compareEndDate = false;
|
||||||
float paramEachPrice = Float.parseFloat(mjonMsgVO.getEachPrice());
|
float paramEachPrice = Float.parseFloat(mjonMsgVO.getEachPrice());
|
||||||
|
|
||||||
|
|
||||||
MjonEventVO eventMberInfo = mjonEventService.selectEventMsgMberDefaultInfo(mjonEventVO);
|
MjonEventVO eventMberInfo = mjonEventService.selectEventMsgMberDefaultInfo(mjonEventVO);
|
||||||
// 호출부에서 handleEventStatus를 호출하고 예외 처리를 추가
|
// 호출부에서 handleEventStatus를 호출하고 예외 처리를 추가
|
||||||
if (eventMberInfo != null) {
|
|
||||||
String eventEndDate = eventMberInfo.getEventEndDate();
|
|
||||||
boolean compareEndDate = MJUtil.getCompareDate(eventEndDate);
|
|
||||||
boolean isSuccess = handleEventStatus(eventMberInfo, paramEachPrice, mjonEventVO, compareEndDate);
|
|
||||||
|
|
||||||
if (!isSuccess) {
|
// 기존 컨트롤러 2352 라인
|
||||||
// 예외가 발생했을 때의 리턴 처리
|
if (eventMberInfo != null) {
|
||||||
return new StatusResponse(HttpStatus.INTERNAL_SERVER_ERROR, "이벤트 상태 처리 중 오류가 발생했습니다.");
|
String eventEndDate = eventMberInfo.getEventEndDate();
|
||||||
}
|
boolean compareEndDate = MJUtil.getCompareDate(eventEndDate);
|
||||||
// 이벤트 진행 회원의 발송 단가 처리
|
boolean isSuccess = handleEventStatus(eventMberInfo, paramEachPrice, mjonEventVO, compareEndDate);
|
||||||
if(eventMberInfo != null && "Y".equals(eventMberInfo.getEventStatus()) && compareEndDate) {
|
|
||||||
shortPrice = Float.parseFloat(eventMberInfo.getEventShortPrice());
|
if (!isSuccess) {
|
||||||
longPrice = Float.parseFloat(eventMberInfo.getEventLongPrice());
|
// 예외가 발생했을 때의 리턴 처리
|
||||||
picturePrice = Float.parseFloat(eventMberInfo.getEventPicturePrice());
|
return new StatusResponse(HttpStatus.INTERNAL_SERVER_ERROR, "이벤트 상태 처리 중 오류가 발생했습니다.");
|
||||||
picture2Price = Float.parseFloat(eventMberInfo.getEventPicture2Price());
|
}
|
||||||
picture3Price = Float.parseFloat(eventMberInfo.getEventPicture3Price());
|
// 이벤트 진행 회원의 발송 단가 처리
|
||||||
}
|
if(eventMberInfo != null && "Y".equals(eventMberInfo.getEventStatus()) && compareEndDate) {
|
||||||
}
|
shortPrice = Float.parseFloat(eventMberInfo.getEventShortPrice());
|
||||||
|
longPrice = Float.parseFloat(eventMberInfo.getEventLongPrice());
|
||||||
|
picturePrice = Float.parseFloat(eventMberInfo.getEventPicturePrice());
|
||||||
|
picture2Price = Float.parseFloat(eventMberInfo.getEventPicture2Price());
|
||||||
|
picture3Price = Float.parseFloat(eventMberInfo.getEventPicture3Price());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 토탈금액 "," 리플레이스 처리
|
// 토탈금액 "," 리플레이스 처리
|
||||||
mjonMsgVO.setTotPrice(mjonMsgVO.getTotPrice().replaceAll(",", ""));
|
mjonMsgVO.setTotPrice(mjonMsgVO.getTotPrice().replaceAll(",", ""));
|
||||||
|
|
||||||
float tmpOrgEachPrice = Float.parseFloat(mjonMsgVO.getEachPrice());
|
float tmpOrgEachPrice = Float.parseFloat(mjonMsgVO.getEachPrice());
|
||||||
float tmpOrgTotPrice = Float.parseFloat(mjonMsgVO.getTotPrice());
|
float tmpOrgTotPrice = Float.parseFloat(mjonMsgVO.getTotPrice());
|
||||||
|
|
||||||
// 각 문자 종류별 단가 설정
|
// 각 문자 종류별 단가 설정
|
||||||
float tmpEachPrice = MsgSendUtils.determinePriceByMsgType(mjonMsgVO, shortPrice, longPrice, picturePrice, picture2Price, picture3Price);
|
float tmpEachPrice = MsgSendUtils.determinePriceByMsgType(mjonMsgVO, shortPrice, longPrice, picturePrice, picture2Price, picture3Price);
|
||||||
mjonMsgVO.setEachPrice(Float.toString(tmpEachPrice));
|
mjonMsgVO.setEachPrice(Float.toString(tmpEachPrice));
|
||||||
|
|
||||||
// 수신자 총 수 * 단가를 통해 총 결제 금액 계산
|
// 수신자 총 수 * 단가를 통해 총 결제 금액 계산
|
||||||
int tmpTotCallCnt = mjonMsgVO.getCallToList().length;
|
int tmpTotCallCnt = mjonMsgVO.getCallToList().length;
|
||||||
float tmpTotPrice = tmpTotCallCnt * tmpEachPrice;
|
float tmpTotPrice = tmpTotCallCnt * tmpEachPrice;
|
||||||
|
|
||||||
// 화면에서 넘어온 파라미터 개별 단가와 컨트롤러에서 계산한 단가를 비교하여 맞지 않으면 컨트롤러 계산 단가 입력
|
// 화면에서 넘어온 파라미터 개별 단가와 컨트롤러에서 계산한 단가를 비교하여 맞지 않으면 컨트롤러 계산 단가 입력
|
||||||
if (tmpOrgEachPrice != tmpEachPrice) {
|
if (tmpOrgEachPrice != tmpEachPrice) {
|
||||||
mjonMsgVO.setEachPrice(Float.toString(tmpEachPrice));
|
mjonMsgVO.setEachPrice(Float.toString(tmpEachPrice));
|
||||||
log.info("화면 : tmpOrgEachPrice ::: [{}]", tmpOrgEachPrice);
|
log.info("화면 : tmpOrgEachPrice ::: [{}]", tmpOrgEachPrice);
|
||||||
log.info("컨트롤러 : tmpEachPrice ::: [{}]", tmpEachPrice);
|
log.info("컨트롤러 : tmpEachPrice ::: [{}]", tmpEachPrice);
|
||||||
} else {
|
} else {
|
||||||
log.info("tmpOrgEachPrice ::: [{}]", tmpOrgEachPrice);
|
log.info("tmpOrgEachPrice ::: [{}]", tmpOrgEachPrice);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmpOrgTotPrice != tmpTotPrice) {
|
if (tmpOrgTotPrice != tmpTotPrice) {
|
||||||
mjonMsgVO.setTotPrice(Float.toString(tmpTotPrice));
|
mjonMsgVO.setTotPrice(Float.toString(tmpTotPrice));
|
||||||
log.info("화면 : tmpOrgTotPrice ::: [{}]", tmpOrgTotPrice);
|
log.info("화면 : tmpOrgTotPrice ::: [{}]", tmpOrgTotPrice);
|
||||||
log.info("컨트롤러 : tmpTotPrice ::: [{}]", tmpTotPrice);
|
log.info("컨트롤러 : tmpTotPrice ::: [{}]", tmpTotPrice);
|
||||||
} else {
|
} else {
|
||||||
log.info("tmpOrgTotPrice ::: [{}]", tmpOrgTotPrice);
|
log.info("tmpOrgTotPrice ::: [{}]", tmpOrgTotPrice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
// 치환 여부
|
// 치환 여부
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
StatusResponse statusResponse = new StatusResponse();
|
StatusResponse statusResponse = new StatusResponse();
|
||||||
if (MsgSendUtils.isReplacementRequired(mjonMsgVO)) {
|
if (MsgSendUtils.isReplacementRequired(mjonMsgVO)) {
|
||||||
|
|
||||||
if (!MsgSendUtils.isReplacementDataValid(mjonMsgVO)) {
|
if (!MsgSendUtils.isReplacementDataValid(mjonMsgVO)) {
|
||||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "특정문구 일괄변환 치환문자 데이터가 없습니다.");
|
return new StatusResponse(HttpStatus.BAD_REQUEST, "특정문구 일괄변환 치환문자 데이터가 없습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!MsgSendUtils.checkReplacementDataValidity(mjonMsgVO, statusResponse)) {
|
if (!MsgSendUtils.checkReplacementDataValidity(mjonMsgVO, statusResponse)) {
|
||||||
return statusResponse;
|
return statusResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 치환 문자 리스트 생성
|
// 치환 문자 리스트 생성
|
||||||
ReplacementListsVO intiLists = MsgSendUtils.createReplacementLists(mjonMsgVO);
|
ReplacementListsVO intiLists = MsgSendUtils.createReplacementLists(mjonMsgVO);
|
||||||
MsgSendUtils.populateReplacementLists(mjonMsgVO ,intiLists, statusResponse);
|
MsgSendUtils.populateReplacementLists(mjonMsgVO ,intiLists, statusResponse);
|
||||||
// 에러가 발생했는지 상태를 확인
|
// 에러가 발생했는지 상태를 확인
|
||||||
if (statusResponse.getStatus() == HttpStatus.BAD_REQUEST) {
|
if (statusResponse.getStatus() == HttpStatus.BAD_REQUEST) {
|
||||||
// 에러 메시지 처리
|
// 에러 메시지 처리
|
||||||
return statusResponse;
|
return statusResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 발송 처리
|
||||||
|
statusResponse = processMessageSending(mjonMsgVO, intiLists, statusResponse);
|
||||||
|
} else {
|
||||||
|
// 일반 문자 발송
|
||||||
|
statusResponse = fncSendMsg(mjonMsgVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
return statusResponse;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 그림 문자 발송 처리 메서드
|
||||||
// 발송 처리
|
private StatusResponse processMessageSending(MjonMsgVO mjonMsgVO, ReplacementListsVO lists, StatusResponse statusResponse) {
|
||||||
statusResponse = processMessageSending(mjonMsgVO, intiLists, statusResponse);
|
|
||||||
} else {
|
|
||||||
// 일반 문자 발송
|
|
||||||
statusResponse = fncSendMsg(mjonMsgVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
return statusResponse;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 그림 문자 발송 처리 메서드
|
|
||||||
private StatusResponse processMessageSending(MjonMsgVO mjonMsgVO, ReplacementListsVO lists, StatusResponse statusResponse) {
|
|
||||||
|
|
||||||
Map<String, String> resultMap = new HashMap<String, String>();
|
Map<String, String> resultMap = new HashMap<String, String>();
|
||||||
// 단문 문자 발송
|
// 단문 문자 발송
|
||||||
@ -3543,10 +3538,6 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
|||||||
|
|
||||||
statusResponse.setMessage(returnMessage);
|
statusResponse.setMessage(returnMessage);
|
||||||
statusResponse.setObject(resultMap);
|
statusResponse.setObject(resultMap);
|
||||||
// modelAndView.addObject("message", returnMessage);
|
|
||||||
// modelAndView.addObject("result", returnStatus);
|
|
||||||
// modelAndView.addObject("resultSts", "0");
|
|
||||||
// modelAndView.addObject("resultBlockSts", "0");
|
|
||||||
|
|
||||||
return statusResponse;
|
return statusResponse;
|
||||||
}
|
}
|
||||||
@ -3556,10 +3547,6 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
|||||||
Map<String, String> returnMap = new HashMap<String, String>();
|
Map<String, String> returnMap = new HashMap<String, String>();
|
||||||
returnMap.put("msgType", mjonMsgVO.getMsgType());
|
returnMap.put("msgType", mjonMsgVO.getMsgType());
|
||||||
returnMap.put("msgGroupId", mjonMsgVO.getMsgGroupId());
|
returnMap.put("msgGroupId", mjonMsgVO.getMsgGroupId());
|
||||||
// returnMap.put("message", returnMessage);
|
|
||||||
// returnMap.put("result", returnStatus);
|
|
||||||
// returnMap.put("resultSts", resultSts);
|
|
||||||
// returnMap.put("resultBlockSts", resultBlockSts);
|
|
||||||
|
|
||||||
|
|
||||||
statusResponse.setObject(returnMap);
|
statusResponse.setObject(returnMap);
|
||||||
@ -4273,7 +4260,7 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
|||||||
// 이벤트 상태를 종료로 변경
|
// 이벤트 상태를 종료로 변경
|
||||||
mjonEventVO.setEventInfoId(eventMberInfo.getEventInfoId());
|
mjonEventVO.setEventInfoId(eventMberInfo.getEventInfoId());
|
||||||
mjonEventVO.setEventStatus("E");
|
mjonEventVO.setEventStatus("E");
|
||||||
mjonEventVO.setEventMemo("발송 최소 금액(" + paramEachPrice + ") 부족 혹은 이벤트 종료일 초과로 종료");
|
mjonEventVO.setEventMemo("발송 최소 금액("+ paramEachPrice +") 부족 혹은 이벤트 종료일 초과되어 이벤트 종료 시킴");
|
||||||
mjonEventVO.setEventRemainCash(eventRemainCash);
|
mjonEventVO.setEventRemainCash(eventRemainCash);
|
||||||
mjonEventService.updateEventEndStatus(mjonEventVO);
|
mjonEventService.updateEventEndStatus(mjonEventVO);
|
||||||
eventMberInfo.setEventStatus("E");
|
eventMberInfo.setEventStatus("E");
|
||||||
|
|||||||
@ -3165,6 +3165,7 @@ public class MjonMsgDataController {
|
|||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
ModelMap model) throws Exception{
|
ModelMap model) throws Exception{
|
||||||
|
|
||||||
|
|
||||||
return ResponseEntity.ok().body(mjonMsgDataService.sendMsgData_advc(mjonMsgVO, request)) ;
|
return ResponseEntity.ok().body(mjonMsgDataService.sendMsgData_advc(mjonMsgVO, request)) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user