mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-06 18:13:18 +09:00
발신번호 반려문자 추가
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package kr.co.uplus.ez.api.comm;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -16,4 +17,8 @@ public interface CommMapper {
|
||||
public List<Code> getCommCode(CodeReqDto codeReqDto);
|
||||
|
||||
public List<Auth> getAuthCode();
|
||||
|
||||
public void insertWebMsgCli(Map<Object, Object> newezMsgMap);
|
||||
|
||||
public void insertNotiHst(Map<Object, Object> newMsgHistMap);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package kr.co.uplus.ez.api.comm;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
@@ -26,7 +27,10 @@ import kr.co.uplus.ez.api.comm.dto.MenuResDto;
|
||||
import kr.co.uplus.ez.api.comm.dto.RefreshTokenReqDto;
|
||||
import kr.co.uplus.ez.api.comm.dto.RefreshTokenResDto;
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.Const;
|
||||
import kr.co.uplus.ez.common.jwt.JwtService;
|
||||
import kr.co.uplus.ez.common.utils.CommonUtils;
|
||||
import kr.co.uplus.ez.common.utils.DateUtil;
|
||||
import kr.co.uplus.ez.common.utils.SpringUtils;
|
||||
|
||||
@Service
|
||||
@@ -176,4 +180,63 @@ public class CommService {
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
//알림문자 발송테이블
|
||||
public static String WEB_REQ_ID = "WEB_REQ_ID";
|
||||
public Map<Object, Object> sendMsg(Map<Object, Object> ezMsgMap) {
|
||||
|
||||
CommMapper commMapper = sqlSessionMaster.getMapper(CommMapper.class);
|
||||
// webReqId 채번
|
||||
String prefix = DateUtil.getCurrentDate("yyyyMMdd");
|
||||
String webReqId = prefix + ezMsgMap.get(WEB_REQ_ID);
|
||||
|
||||
Map<Object, Object> newezMsgMap = new HashMap<Object, Object>();
|
||||
|
||||
newezMsgMap.put("tableName", Const.LineTpCd.LINE_TP_REAL);
|
||||
newezMsgMap.put("trafficType", Const.LineTpCd.LINE_TP_REAL);
|
||||
String clientKey = generateClientKey("R", 10);
|
||||
newezMsgMap.put("clientKey", clientKey);
|
||||
newezMsgMap.put("reqProduct", "LMS");
|
||||
newezMsgMap.put("msgStatus", "ready");
|
||||
newezMsgMap.put("callbackNumber", "15445992");
|
||||
newezMsgMap.put("phone", ezMsgMap.get("phone"));
|
||||
newezMsgMap.put("webReqId", webReqId);
|
||||
newezMsgMap.put("orderId", "2");
|
||||
newezMsgMap.put("msg", ezMsgMap.get("msg"));
|
||||
|
||||
commMapper.insertWebMsgCli(newezMsgMap);
|
||||
|
||||
return ezMsgMap ;
|
||||
|
||||
}
|
||||
|
||||
public Map<Object, Object> sendMsgHist(Map<Object, Object>msgHistMap) {
|
||||
CommMapper commMapper = sqlSessionMaster.getMapper(CommMapper.class);
|
||||
// webReqId 채번
|
||||
String prefix = DateUtil.getCurrentDate("yyyyMMdd");
|
||||
String webReqId = prefix + msgHistMap.get(WEB_REQ_ID);
|
||||
|
||||
//알림 이력 insert
|
||||
Map<Object, Object> newMsgHistMap = new HashMap<Object, Object>();
|
||||
newMsgHistMap.put("userSeq", msgHistMap.get("userSeq"));
|
||||
newMsgHistMap.put("notiSeq", msgHistMap.get("notiSeq"));
|
||||
newMsgHistMap.put("notiMsg", msgHistMap.get("notiMsg"));
|
||||
newMsgHistMap.put("webReqId", webReqId);
|
||||
newMsgHistMap.put("notiDiv", msgHistMap.get("notiDiv"));
|
||||
|
||||
commMapper.insertNotiHst(newMsgHistMap);
|
||||
|
||||
return msgHistMap;
|
||||
|
||||
}
|
||||
|
||||
// clientKey 생성
|
||||
public String generateClientKey(String lineTpCdKey, int length) {
|
||||
String prefix = DateUtil.getCurrentDate("yyyyMMddHHmmss") + lineTpCdKey;
|
||||
String clientKey = "";
|
||||
|
||||
clientKey = CommonUtils.getCommonId(prefix, length);
|
||||
|
||||
return clientKey;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package kr.co.uplus.ez.api.sendNumMgt;
|
||||
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.*;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
@@ -64,4 +65,11 @@ interface SendNumMgtMapper {
|
||||
String selectApiAuthToken(String apiApplicationId);
|
||||
|
||||
String selectUserEmailByAdminId(String adminId);
|
||||
|
||||
String selectSequence(String wEB_REQ_ID);
|
||||
|
||||
String selectUserPhoneByAdminId(String adminId);
|
||||
|
||||
String selectNotiSeq();
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
|
||||
import kr.co.uplus.ez.api.comm.CommService;
|
||||
import kr.co.uplus.ez.api.custMgt.CustMgtService;
|
||||
import kr.co.uplus.ez.api.custMgt.dto.InsertUserResDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.DeleteNumberReqDto;
|
||||
@@ -70,6 +71,7 @@ import kr.co.uplus.ez.common.components.HubeasyApiComponents;
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.Const;
|
||||
import kr.co.uplus.ez.common.data.Paging;
|
||||
import kr.co.uplus.ez.common.utils.CommonUtils;
|
||||
import kr.co.uplus.ez.common.utils.DateUtils;
|
||||
import kr.co.uplus.ez.common.utils.FileIoUtils;
|
||||
import kr.co.uplus.ez.common.utils.FileUtil;
|
||||
@@ -106,6 +108,11 @@ public class SendNumMgtService {
|
||||
private String fromEmail;
|
||||
|
||||
private static int BUFFERSIZE = 1024;
|
||||
|
||||
@Autowired
|
||||
private CommService commService;
|
||||
|
||||
|
||||
/**
|
||||
* date : 2022. 4. 25.
|
||||
* auth : ckr
|
||||
@@ -700,7 +707,35 @@ public class SendNumMgtService {
|
||||
}
|
||||
}
|
||||
logger.debug("############## [Email Send End] ###############");
|
||||
|
||||
|
||||
//4. 메시지 발송
|
||||
String WEB_REQ_ID =sendNumMgtMapper.selectSequence(commService.WEB_REQ_ID);
|
||||
|
||||
//알림문자 발송테이블 insert
|
||||
Map<Object, Object> ezMsgMap = new HashMap<Object, Object>();
|
||||
ezMsgMap.put("WEB_REQ_ID", WEB_REQ_ID);
|
||||
String userPhone = sendNumMgtMapper.selectUserPhoneByAdminId(adminId);
|
||||
ezMsgMap.put("phone", userPhone);
|
||||
|
||||
String msg = "[LG U+메시지허브이지]\\n허브이지 발신번호 신청 내역 반려 되었습니다. 자세한 내용은 메일 확인 부탁드립니다.*";
|
||||
ezMsgMap.put("msg", msg);
|
||||
|
||||
|
||||
|
||||
commService.sendMsg(ezMsgMap);
|
||||
|
||||
//알람이력에 insert
|
||||
Map<Object, Object> msgHistMap = new HashMap<Object, Object>();
|
||||
msgHistMap.put("WEB_REQ_ID", WEB_REQ_ID);
|
||||
String notiSeq = sendNumMgtMapper.selectNotiSeq();
|
||||
String userSeq = sendNumMgtMapper.selectUserSeqByAdminId(adminId);
|
||||
msgHistMap.put("userSeq", userSeq);
|
||||
msgHistMap.put("notiSeq", notiSeq);
|
||||
msgHistMap.put("notiMsg", msg);
|
||||
msgHistMap.put("notiDiv", Const.NOTI_DIV_CD_05);
|
||||
|
||||
commService.sendMsgHist(msgHistMap);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
// TODO: handle exception
|
||||
|
||||
@@ -157,4 +157,39 @@ public class Const {
|
||||
public static final String TMPL_CODE_005 = "E0005"; //U+메시지허브이지 이메일 인증
|
||||
public static final String TMPL_CODE_007 = "E0007"; //발신번호 반려 메일
|
||||
|
||||
/*********************************************************************************
|
||||
* 발송채널 코드, 발송클라이언트 요청상품코드
|
||||
*********************************************************************************/
|
||||
public static final String SND_CH_SMS = "SMS";
|
||||
public static final String SND_CH_LMS = "LMS";
|
||||
public static final String SND_CH_MMS = "MMS";
|
||||
public static final String SND_CH_ALIMTALK = "ALIMTALK";
|
||||
|
||||
public static final String REQ_PRODUCT_SMS = "SMS";
|
||||
public static final String REQ_PRODUCT_LMS = "LMS";
|
||||
public static final String REQ_PRODUCT_MMS = "MMS";
|
||||
public static final String REQ_PRODUCT_KKO_NOTI = "KKO_NOTI";
|
||||
|
||||
/* 테이블명 */
|
||||
public static class TableName {
|
||||
public static final String EZ_MSG_NORMAL = "EZ_MSG_NORMAL"; //일반
|
||||
public static final String EZ_MSG_REAL = "EZ_MSG_REAL"; //실시간보장
|
||||
public static final String EZ_MSG_BATCH = "EZ_MSG_BATCH"; //예약
|
||||
}
|
||||
|
||||
/* 라인유형 */
|
||||
public static class LineTpCd {
|
||||
public static final String LINE_TP_NORMAL = "normal"; //일반
|
||||
public static final String LINE_TP_REAL = "real"; //실시간보장
|
||||
public static final String LINE_TP_BATCH = "batch"; //예약
|
||||
}
|
||||
|
||||
/* 알림이력 */
|
||||
public static final String NOTI_DIV_CD_01 = "01"; // 종량전환알림
|
||||
public static final String NOTI_DIV_CD_02 = "02"; // 이월소멸예정알림
|
||||
public static final String NOTI_DIV_CD_03 = "03"; // 이월소멸알림
|
||||
public static final String NOTI_DIV_CD_04 = "04"; // 충전금알림
|
||||
public static final String NOTI_DIV_CD_05 = "05"; // 발신번호반려알림
|
||||
public static final String NOTI_DIV_CD_06 = "06"; // 알림톡템플릿반려알림
|
||||
|
||||
}
|
||||
|
||||
@@ -66,4 +66,112 @@
|
||||
ORDER BY
|
||||
AUT_CD
|
||||
</select>
|
||||
|
||||
<insert id="insertWebMsgCli" parameterType="String">
|
||||
/* extCarryOverAmtNoti.insertWebMsgCli - 메시지 원장 등록 */
|
||||
INSERT INTO hubez_send.EZ_MSG_REAL
|
||||
(
|
||||
CLIENT_KEY,
|
||||
REQ_PRODUCT,
|
||||
TRAFFIC_TYPE,
|
||||
MSG_STATUS,
|
||||
REQ_DATE,
|
||||
MSG_BIZ_KEY,
|
||||
TEMPLATE_CODE,
|
||||
SEND_GROUP_KEY,
|
||||
CALLBACK_NUMBER,
|
||||
DEPT_CODE,
|
||||
MSG,
|
||||
PHONE,
|
||||
MERGE_DATA,
|
||||
TITLE,
|
||||
FILE_LIST,
|
||||
FB_PRODUCT,
|
||||
FB_TITLE,
|
||||
FB_MSG,
|
||||
FB_FILE_ID,
|
||||
RCS_MSGBASE_ID,
|
||||
RCS_HEADER,
|
||||
RCS_FOOTER,
|
||||
RCS_COPY_ALLOWED,
|
||||
RCS_EXPIRY_OPTION,
|
||||
RCS_AGENCY_ID,
|
||||
RCS_BUTTON,
|
||||
KAKAO_SENDER_KEY,
|
||||
KAKAO_TEMPLATE_KEY,
|
||||
KAKAO_BUTTON,
|
||||
KAKAO_IMAGE_WIDE_YN,
|
||||
KAKAO_IMAGE_URL,
|
||||
KAKAO_IMAGE_LINK,
|
||||
PUSH_APP_ID,
|
||||
PUSH_PROVIDER,
|
||||
PUSH_APP_USER_ID,
|
||||
WEB_REQ_ID,
|
||||
ORDER_ID
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{clientKey},
|
||||
#{reqProduct},
|
||||
#{trafficType},
|
||||
#{msgStatus},
|
||||
NOW(),
|
||||
#{msgBizKey},
|
||||
#{templateCode},
|
||||
#{sendGroupKey},
|
||||
#{callbackNumber},
|
||||
#{deptCode},
|
||||
#{msg},
|
||||
#{phone},
|
||||
#{mergeData},
|
||||
#{title},
|
||||
#{fileList},
|
||||
#{fbProduct},
|
||||
#{fbTitle},
|
||||
#{fbMsg},
|
||||
#{fbFileId},
|
||||
#{rcsMsgbaseId},
|
||||
#{rcsHeader},
|
||||
#{rcsFooter},
|
||||
#{rcsCopyAllowed},
|
||||
#{rcsExpiryOption},
|
||||
#{rcsAgencyId},
|
||||
#{rcsButton},
|
||||
#{kakaoSenderKey},
|
||||
#{kakaoTemplateKey},
|
||||
#{kakaoButton},
|
||||
#{kakaoImageWideYn},
|
||||
#{kakaoImageUrl},
|
||||
#{kakaoImageLink},
|
||||
#{pushAppId},
|
||||
#{pushProvider},
|
||||
#{pushAppUserId},
|
||||
#{webReqId},
|
||||
#{orderId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertNotiHst" parameterType="String">
|
||||
/* extCarryOverAmtNoti.insertNotiHst - 알림 이력 등록 */
|
||||
INSERT INTO hubez_common.EZ_NOTI_HIST
|
||||
(
|
||||
SND_YMD,
|
||||
USER_SEQ,
|
||||
NOTI_SEQ,
|
||||
NOTI_DIV,
|
||||
NOTI_MSG,
|
||||
WEB_REQ_ID,
|
||||
REG_DT
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
DATE_FORMAT(NOW(), '%Y%m%d'),
|
||||
#{userSeq},
|
||||
#{notiSeq},
|
||||
#{notiDiv},
|
||||
#{notiMsg},
|
||||
#{webReqId},
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -720,5 +720,25 @@
|
||||
FROM hubez_common.EZ_IFSYS_INFO
|
||||
WHERE SYS_ID = #{apiApplicationId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectSequence" parameterType="String" resultType="String">
|
||||
/* sendNumMgt.selectSequence -- sequence 채번 일반 */
|
||||
SELECT hubez_common.FUN_NEXT_SEQ(#{seqKey})
|
||||
</select>
|
||||
|
||||
<select id="selectUserPhoneByAdminId" parameterType="String" resultType="String">
|
||||
/* sendNumMgt-mapper.xml(selectUserPhoneByAdminId) */
|
||||
SELECT
|
||||
HP_NO
|
||||
FROM
|
||||
hubez_common.EZ_SVC_USER
|
||||
WHERE
|
||||
USER_ID = #{adminId}
|
||||
</select>
|
||||
|
||||
<select id="selectNotiSeq" resultType="String">
|
||||
/* sendNumMgt.selectNotiSeq 노티 알림 시퀀스 채번 */
|
||||
SELECT hubez_common.FUN_NEXT_SEQ('NOTI_SEQ') AS notiSeq
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user