ソースを参照

fix 获客链接发放优惠券

zoujiajian 2 年 前
コミット
20afde25b6

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/mapper/corp/CorpCustomerAcquisitionLinkMapper.java

@@ -18,5 +18,5 @@ public interface CorpCustomerAcquisitionLinkMapper extends BaseMapper<CorpCustom
 
 	List<CorpCustomerAcquisitionLink> selectActiveCodeByFollowIndx(@Param("list") List<Integer> updateFollowIndx);
 
-	List<Long> selectAcLinkCorpTemplateCouponIdsByTagIds(@Param("tagIds") List<Long> tagIds);
+	List<String> selectAcLinkCorpTemplateCouponIdsByTagIds(@Param("tagIds") List<Long> tagIds);
 }

+ 1 - 1
netflix-dao/src/main/resources/mapper/CorpCustomerAcquisitionLinkMapper.xml

@@ -12,7 +12,7 @@
         </foreach>
     </select>
 
-    <select id="selectAcLinkCorpTemplateCouponIdsByTagIds" resultType="java.lang.Long">
+    <select id="selectAcLinkCorpTemplateCouponIdsByTagIds" resultType="java.lang.String">
         select distinct ct.coupon_ids from (select msg_id from corp_customer_acquisition_link
         where msg_id != 0 and tags != '[]' and
         <foreach collection="tagIds" item="item" open="(" separator="OR" close=")">

+ 1 - 0
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpWelcomeTemplateServiceImpl.java

@@ -1,6 +1,7 @@
 package com.cyksj.service.corp.impl;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.util.Jsons;

+ 8 - 3
netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java

@@ -701,10 +701,15 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 			//是否有对应获客链接的标签
 			List<Long> tagIds = corpUserTagMapper.getTagIdByCorpUserId(corpUser.getId());
 			if (CollUtil.isNotEmpty(tagIds)) {
-				List<Long> couponIds = corpCustomerAcquisitionLinkMapper.selectAcLinkCorpTemplateCouponIdsByTagIds(tagIds);
-				if (CollUtil.isNotEmpty(couponIds)) {
+				List<String> couponIdsStrList = corpCustomerAcquisitionLinkMapper.selectAcLinkCorpTemplateCouponIdsByTagIds(tagIds);
+				if (CollUtil.isNotEmpty(couponIdsStrList)) {
 					log.info("用户userId:{}存在获客链接标记的标签:{}", fUid, tagIds);
-					couponIds.forEach(couponId -> couponCommonService.sendCouponToUser(fUid, couponId, 0l, 0l, 0l, CouponUser.Channel.customer_link));
+					couponIdsStrList.forEach(couponIdsStr -> {
+						try {
+							Jsons.parseList(couponIdsStr, Long.class).forEach(couponId -> couponCommonService.sendCouponToUser(fUid, couponId, 0l, 0l, 0l, CouponUser.Channel.customer_link));
+						} catch (Exception e) {
+						}
+					});
 				}
 			}
 		}