Преглед на файлове

fix 发送引流欢迎语失败 直接发送引流新人优惠券

zoujiajian преди 1 година
родител
ревизия
6655cbfc46
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpEventActionServiceImpl.java

+ 4 - 2
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpEventActionServiceImpl.java

@@ -995,7 +995,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 //				couponCommonService.sendCouponToUser(userId, couponId, null, null, null, CouponUser.Channel.yl);
 				if (couponId != null) {
 					String url = "https://nf.video?t=" + re.getT() + "&ylCid=" + couponId;
-					sendCorpWxYlWelcomeMsg(followId, username, welcomeCode, msg, tilte, url, picUlr);
+					sendCorpWxYlWelcomeMsg(followId, username, welcomeCode, msg, tilte, url, picUlr, userId, couponId);
 				}
 			}
 			return true;
@@ -1369,7 +1369,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 		});
 	}
 
-	public void sendCorpWxYlWelcomeMsg(String followId, String corpUserName, String welcomeCode, String msg, String title, String url, String picUrl) {
+	public void sendCorpWxYlWelcomeMsg(String followId, String corpUserName, String welcomeCode, String msg, String title, String url, String picUrl, Long userId, Long couponId) {
 		JSONObject params = new JSONObject();
 		HashMap<String, Object> text = new HashMap<>(1);
 		text.put("content", msg);
@@ -1390,11 +1390,13 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 			JSONObject jsonObject = Jsons.parseObject(res.body(), JSONObject.class);
 			if (jsonObject.getInt("errcode") != 0) {
 				log.info("{}成员,发送引流欢迎语至客户{}失败,msg:{}", followId, corpUserName, jsonObject.get("errmsg"));
+				couponCommonService.sendCouponToUser(userId, couponId, null, null, null, CouponUser.Channel.yl);
 				return;
 			}
 			log.info("{}成员,发送引流欢迎语至客户{}成功", followId, corpUserName);
 		} catch (Exception e) {
 			log.info("发送引流欢迎语过程异常,{}", e);
+			couponCommonService.sendCouponToUser(userId, couponId, null, null, null, CouponUser.Channel.yl);
 		}
 	}
 }