From 012232edc4dac15517c69c2af3934f901e818b7c Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期四, 26 十二月 2019 15:57:53 +0800
Subject: [PATCH] 帮助中心 + 新人红包统计

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java
index 3e79d3b..63fa11f 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java
@@ -27,6 +27,7 @@
 import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
 import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
 import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
+import com.yeshi.fanli.log.LogHelper;
 import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
 import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
 import com.yeshi.fanli.service.inter.redpack.RedPackConfigService;
@@ -179,21 +180,25 @@
 		try {
 			redPackBalanceService.subRedPack(uid, amount, RedPackDetailFactory.createGiveOthers(giveRecord));
 		} catch (Exception e) {
+			LogHelper.errorDetailInfo(e);
 			throw new RedPackGiveRecordException(1, "绾㈠寘鍒涘缓澶辫触");
 		}
-
-		UserRedPackGiftMQMsg msg = new UserRedPackGiftMQMsg();
-		msg.setId(giveRecord.getId());
-		msg.setUid(uid);
-		Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.redPackGiftDrawback,
-				msg);
-		// 寤惰繜涓�鍒嗛挓
-		message.setStartDeliverTime(endTime.getTime() + 1000 * 60);
-		try {
-			producer.send(message);
-		} catch (Exception e) {
-			throw new RedPackGiveRecordException(1, "绾㈠寘鍒涘缓澶辫触");
+		
+		// 鍙戦�佹秷鎭�(闈炴祴璇曚笅)
+		if (!Constant.IS_TEST) {
+			UserRedPackGiftMQMsg msg = new UserRedPackGiftMQMsg();
+			msg.setId(giveRecord.getId());
+			msg.setUid(uid);
+			Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.redPackGiftDrawback,	msg);
+			message.setStartDeliverTime(endTime.getTime() + 1000 * 60); // 寤惰繜涓�鍒嗛挓
+			try {
+				producer.send(message);
+			} catch (Exception e) {
+				LogHelper.errorDetailInfo(e);
+				throw new RedPackGiveRecordException(1, "绾㈠寘鍒涘缓澶辫触");
+			}
 		}
+		
 		return tips;
 	}
 

--
Gitblit v1.8.0