이지우 - 카카오 환불 오류 시 슬랙 알림 추가

This commit is contained in:
JIWOO 2025-08-18 11:45:55 +09:00
parent 91a2e68ee5
commit 573a019b4b
3 changed files with 35 additions and 10 deletions

View File

@ -1557,18 +1557,30 @@ public class KakaoAlimTalkSendController {
public void kakaoRefundSingleTransaction() throws Exception{
System.out.println("=============카카오 환불 싱글 트랜잭션 수행 =============");
/* 회원 money 업데이트 처리 트랜잭션 분리를 위하여 impl이 아닌 현재 위치에서 반복문 실행 */
System.out.println("=============SchedulerUtil=====runKakaoOneTime =============>");
List<KakaoVO> kakaoRefundList = kakaoAlimTalkService.selectKakaoSentRefundListForSingle();
Set<String> targetIdSet = new HashSet<>();
for(KakaoVO kakaoVO : kakaoRefundList) {
kakaoAlimTalkService.kakaoSingleRefund(kakaoVO);
targetIdSet.add(kakaoVO.getUserId());
try {
kakaoAlimTalkService.kakaoSingleRefund(kakaoVO);
targetIdSet.add(kakaoVO.getUserId());
} catch (Exception e) {
String msg = "[문자온] 환불 실패 - " + kakaoVO.getMsgId() +"("+ kakaoVO.getUserId() + ")";
mjonCommon.sendSimpleSlackMsg(msg);;
}
}
MjonPayVO mjonPayVO = new MjonPayVO();
for(String userId : targetIdSet) {
try {
mjonPayVO.setUserId(userId);
mjonPayService.updateMemberCash(mjonPayVO); //회원정보 업데이트
} catch(Exception e) {
String msg = "[문자온] 환불 후 잔액 갱신 실패 - " + userId;
mjonCommon.sendSimpleSlackMsg(msg);;
}
}
}

View File

@ -1,7 +1,6 @@
package itn.let.schdlr.service;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
@ -10,7 +9,6 @@ import java.util.Set;
import javax.annotation.Resource;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;
@ -32,11 +30,12 @@ import itn.let.kakao.kakaoComm.KakaoVO;
import itn.let.kakao.user.kakaoAt.service.KakaoAlimTalkService;
import itn.let.lett.service.LetterService;
import itn.let.mail.service.MailTemplateService;
import itn.let.mjo.mjocommon.MjonCommon;
import itn.let.mjo.msg.service.MjonMsgService;
import itn.let.mjo.msg.service.MjonMsgStatVO;
import itn.let.mjo.msgdata.service.impl.MjonMsgDataDAO;
import itn.let.mjo.pay.service.MjonPayService;
import itn.let.mjo.pay.service.MjonPayVO;
import itn.let.mjo.pay.service.impl.MjonPayDAO;
import itn.let.sts.com.StatsVO;
import itn.let.sts.cst.service.EgovConectStatsService;
import itn.let.uss.umt.service.EgovUserManageService;
@ -92,8 +91,11 @@ public class SchedulerUtil {
@Resource(name="kakaoAlimTalkService")
private KakaoAlimTalkService kakaoAlimTalkService;
@Autowired
private MjonPayDAO mjonPayDAO;
@Resource(name="MjonCommon")
private MjonCommon mjonCommon;
@Resource(name = "mjonPayService")
private MjonPayService mjonPayService;
/** 설정값 가져오기 */
@Value("#{globalSettings['Globals.Env']}")
@ -489,14 +491,24 @@ public class SchedulerUtil {
Set<String> targetIdSet = new HashSet<>();
for(KakaoVO kakaoVO : kakaoRefundList) {
kakaoAlimTalkService.kakaoSingleRefund(kakaoVO);
targetIdSet.add(kakaoVO.getUserId());
try {
kakaoAlimTalkService.kakaoSingleRefund(kakaoVO);
targetIdSet.add(kakaoVO.getUserId());
} catch (Exception e) {
String msg = "[문자온] 환불 실패 - " + kakaoVO.getMsgId() +"("+ kakaoVO.getUserId() + ")";
mjonCommon.sendSimpleSlackMsg(msg);;
}
}
MjonPayVO mjonPayVO = new MjonPayVO();
for(String userId : targetIdSet) {
try {
mjonPayVO.setUserId(userId);
mjonPayDAO.updateMemberCash(mjonPayVO); //회원정보 업데이트
mjonPayService.updateMemberCash(mjonPayVO); //회원정보 업데이트
} catch(Exception e) {
String msg = "[문자온] 환불 후 잔액 갱신 실패 - " + userId;
mjonCommon.sendSimpleSlackMsg(msg);;
}
}
}

View File

@ -209,6 +209,7 @@
SELECT
MMD.USER_ID AS userId
, MMD.MSG_GROUP_ID AS msgGroupId
, MMD.MSG_ID AS msgId
, MMD.MSG_SEQ AS msgSeq
, MMGD.BIZ_KAKAO_IMAGE_TYPE AS bizKakaoImageType
, MMGD.EACH_PRICE AS eachPrice