알림톡 api 진행중
This commit is contained in:
parent
60602a31bc
commit
95707e8965
@ -47,6 +47,7 @@ public class KakaoSendAdvcVO implements Serializable {
|
||||
|
||||
private String jsonStr; // jsonStr
|
||||
|
||||
private String sendKind; //문자전송 타입(H:홈페이지, A:API)
|
||||
// =====
|
||||
// =====
|
||||
|
||||
@ -89,6 +90,7 @@ public class KakaoSendAdvcVO implements Serializable {
|
||||
"\n , subMsgType=[" + subMsgType + "]" +
|
||||
"\n , reqDate=[" + reqDate + "]" +
|
||||
"\n , jsonStr=[" + jsonStr + "]" +
|
||||
"\n , sendKind=[" + sendKind + "]" +
|
||||
"\n , ==== MJ_MSG_DATA INSERT DATA END =======" +
|
||||
"\n " +
|
||||
"\n , eachPrice=[" + eachPrice + "]" +
|
||||
|
||||
@ -218,7 +218,8 @@ public class KakaoSendUtil {
|
||||
sendVO.setSubMsgType(sendType);
|
||||
|
||||
if ("INVALID".equals(sendType)) {
|
||||
statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "전송 문자 길이를 초과하였습니다.");return kakaoSendAdvcListVO;
|
||||
// statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "전송 문자 길이를 초과하였습니다.");return kakaoSendAdvcListVO;
|
||||
StatusResponse.statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "전송 문자 길이를 초과하였습니다.", "STAT_1080");return kakaoSendAdvcListVO;
|
||||
}
|
||||
|
||||
boolean isMms = "MMS".equals(sendType);
|
||||
|
||||
@ -870,17 +870,25 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
// KakaoSendAdvcVO
|
||||
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
Map<String, Object> apiReturnMap = new HashMap<>();
|
||||
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()
|
||||
? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser()
|
||||
: null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
String userId = "";
|
||||
if("A".equals(kakaoVO.getSendKind()))
|
||||
{
|
||||
userId = kakaoVO.getMberId();
|
||||
}else {
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()
|
||||
? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser()
|
||||
: null;
|
||||
userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if (userId.equals("")) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용이 가능합니다.");
|
||||
}
|
||||
|
||||
if (userId.equals("")) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용이 가능합니다.");
|
||||
}
|
||||
|
||||
kakaoVO.setUserId(userId);
|
||||
kakaoVO.setUserId(userId);
|
||||
|
||||
/**
|
||||
* 회원 정지된 상태이면 문자 발송이 안되도록 처리함 현재 로그인 세션도 만료 처리함
|
||||
@ -890,7 +898,7 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
request.getSession().invalidate();
|
||||
// UNAUTHORIZED : 인증되지 않은 사용자가 접근하려고 할 때
|
||||
return new StatusResponse(HttpStatus.UNAUTHORIZED,
|
||||
"현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 알림톡을 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다.");
|
||||
"현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 알림톡을 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다.", "STAT_1070");
|
||||
}
|
||||
|
||||
|
||||
@ -915,7 +923,7 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
/** @전송금액 확인 --------------------------------------------------*/
|
||||
if (!isCashSufficient(userId, kakaoSendAdvcListVO)) {
|
||||
log.error("Insufficient balance for message sending.");
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 발송에 필요한 보유 잔액이 부족 합니다.");
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 발송에 필요한 보유 잔액이 부족 합니다.", "STAT_1060");
|
||||
}
|
||||
|
||||
|
||||
@ -931,6 +939,8 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
// 임시
|
||||
List<String> nextMsgGroupIdA = new ArrayList<>();
|
||||
// 대안: entrySet() 직접 사용
|
||||
String apiMsgGroupId = "";
|
||||
String apiMsgType = "";
|
||||
for (Map.Entry<String, List<KakaoSendAdvcVO>> entry : priceGroupedMessages.entrySet()) {
|
||||
// entry 사용
|
||||
|
||||
@ -940,6 +950,14 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
groupedMsgList.forEach(t -> t.setMsgGroupId(nextMsgGroupId));
|
||||
|
||||
|
||||
// api 전달 값
|
||||
apiMsgGroupId = StringUtils.isNotEmpty(apiMsgGroupId)
|
||||
? apiMsgGroupId + "," + nextMsgGroupId
|
||||
: nextMsgGroupId;
|
||||
|
||||
apiMsgType = StringUtils.isNotEmpty(apiMsgType)
|
||||
? apiMsgType + "," + kakaoSendAdvcListVO.get(0).getMsgType()
|
||||
: kakaoSendAdvcListVO.get(0).getMsgType();
|
||||
// 발송 데이터 삽입
|
||||
int instCnt = this.insertKakaoData_advc(groupedMsgList);
|
||||
// int instCnt = 6;
|
||||
@ -995,7 +1013,14 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
}
|
||||
|
||||
apiReturnMap.put("resultSts", instTotalCnt);
|
||||
// 그룹 ID
|
||||
apiReturnMap.put("msgGroupId", apiMsgGroupId);
|
||||
// 메세지 타입
|
||||
apiReturnMap.put("msgType", apiMsgType);
|
||||
|
||||
returnMap.put("resultSts", instTotalCnt);
|
||||
|
||||
returnMap.put("reserYn", kakaoVO.getReserveYn());
|
||||
returnMap.put("groupIds", nextMsgGroupIdA);
|
||||
|
||||
@ -1025,6 +1050,9 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
statusResponse.setStatus(HttpStatus.OK);
|
||||
statusResponse.setObject(returnMap);
|
||||
apiReturnMap.put("result", HttpStatus.OK);
|
||||
apiReturnMap.put("message", "전송이 완료되었습니다.");
|
||||
statusResponse.setApiReturn(apiReturnMap);
|
||||
|
||||
return statusResponse;
|
||||
}
|
||||
@ -1061,7 +1089,8 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
Float totPrice = eachPrice * instCnt;
|
||||
sendVO.setTotPrice(String.format("%.1f", totPrice));
|
||||
|
||||
sendVO.setAtDelayYn(kakaoVO.getAtSmishingYn());
|
||||
sendVO.setAtDelayYn(StringUtils.isEmpty(kakaoVO.getAtSmishingYn()) ? "N" : kakaoVO.getAtSmishingYn());
|
||||
sendVO.setSendKind(StringUtils.isEmpty(kakaoVO.getSendKind()) ? "H" : kakaoVO.getSendKind());
|
||||
sendVO.setBizKakaoResendOrgnlTxt(kakaoVO.getSubMsgTxt());
|
||||
sendVO.setBizKakaoResendType(sendVO.getSubMsgType());
|
||||
|
||||
|
||||
@ -4139,7 +4139,7 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
* */
|
||||
if (!isCashSufficient(mjonMsgVO, mjonMsgSendVOList)) {
|
||||
log.error("Insufficient balance for message sending.");
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 발송에 필요한 보유 잔액이 부족 합니다.");
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 발송에 필요한 보유 잔액이 부족 합니다.", "STAT_1060");
|
||||
}
|
||||
|
||||
System.out.println("==================== insert 시작 ====================");
|
||||
|
||||
@ -139,6 +139,7 @@
|
||||
BEF_POINT,
|
||||
|
||||
TOT_PRICE,
|
||||
SEND_KIND,
|
||||
|
||||
AT_DELAY_YN,
|
||||
BIZ_KAKAO_RESEND_ORGNL_TXT,
|
||||
@ -161,6 +162,7 @@
|
||||
#befPoint#,
|
||||
|
||||
#totPrice#,
|
||||
#sendKind#,
|
||||
|
||||
#atDelayYn#,
|
||||
#bizKakaoResendOrgnlTxt#,
|
||||
|
||||
@ -2319,6 +2319,7 @@
|
||||
EVENT_YN,
|
||||
DELAY_YN,
|
||||
AT_DELAY_YN,
|
||||
SEND_KIND,
|
||||
BIZ_KAKAO_RESEND_ORGNL_TXT,
|
||||
SUBJECT_CHK_YN
|
||||
)
|
||||
@ -2346,6 +2347,7 @@
|
||||
#eventYn#,
|
||||
#delayYn#,
|
||||
#atDelayYn#,
|
||||
#sendKind#,
|
||||
#kakaoSubMagOrgnlTxt#,
|
||||
#subjectChkYn#
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user