|
|
@@ -18,8 +18,10 @@ import com.cyksj.common.util.StringUtil;
|
|
|
import com.cyksj.config.wxlogin.WxOpenPlatYHLXLoginConfig;
|
|
|
import com.cyksj.mapper.*;
|
|
|
import com.cyksj.mapper.channel.ChannelPopularizeMapper;
|
|
|
+import com.cyksj.mapper.corp.CorpCustomerAcquisitionLinkMapper;
|
|
|
import com.cyksj.mapper.corp.CorpFollowActiveCodeMapper;
|
|
|
import com.cyksj.mapper.corp.CorpUserMapper;
|
|
|
+import com.cyksj.mapper.corp.CorpWelcomeTemplateMapper;
|
|
|
import com.cyksj.mapper.manage.cps.UserDistributePopularizeMapper;
|
|
|
import com.cyksj.mapper.market.task.UserBindDetailMapper;
|
|
|
import com.cyksj.model.dto.*;
|
|
|
@@ -105,6 +107,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
|
|
|
private final CorpFollowActiveCodeMapper corpFollowActiveCodeMapper;
|
|
|
|
|
|
+ private final CorpCustomerAcquisitionLinkMapper corpCustomerAcquisitionLinkMapper;
|
|
|
+
|
|
|
+ private final CorpWelcomeTemplateMapper corpWelcomeTemplateMapper;
|
|
|
+
|
|
|
private static final GlobalThreadPoolTaskExecutor TASK_POOL = GlobalThreadPoolTaskExecutor.getInstance();
|
|
|
|
|
|
@Override
|
|
|
@@ -670,14 +676,30 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
private void relateCorpUserAndSengWelfare(Long fUid, String unionid) {
|
|
|
CorpUser corpUser = corpUserMapper.selectOne(Wrappers.lambdaQuery(CorpUser.class)
|
|
|
.eq(CorpUser::getUnionid, unionid).last("limit 1"));
|
|
|
+ Long msgId = null;
|
|
|
+ CouponUser.Channel channel = null;
|
|
|
if (corpUser != null) {
|
|
|
corpUser.setUserId(fUid);
|
|
|
corpUserMapper.updateById(corpUser);
|
|
|
//活码福利
|
|
|
if (corpUser.getAcId() != null && corpUser.getAcId() > 0) {
|
|
|
CorpFollowActiveCode corpFollowActiveCode = corpFollowActiveCodeMapper.selectById(corpUser.getAcId());
|
|
|
- if (corpFollowActiveCode != null && corpFollowActiveCode.getCouponId() > 0) {
|
|
|
- couponCommonService.sendCouponToUser(fUid, corpFollowActiveCode.getCouponId(), 0l, 0l, 0l, CouponUser.Channel.corp_active_code);
|
|
|
+ if (corpFollowActiveCode != null) {
|
|
|
+ msgId = corpFollowActiveCode.getMsgId();
|
|
|
+ channel = CouponUser.Channel.corp_active_code;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (corpUser.getCustomerAcquisitionLinkId() != null && corpUser.getCustomerAcquisitionLinkId() > 0) {
|
|
|
+ CorpCustomerAcquisitionLink corpCustomerAcquisitionLink = corpCustomerAcquisitionLinkMapper.selectById(corpUser.getCustomerAcquisitionLinkId());
|
|
|
+ if (corpCustomerAcquisitionLink != null) {
|
|
|
+ msgId = corpCustomerAcquisitionLink.getMsgId();
|
|
|
+ channel = CouponUser.Channel.customer_link;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (msgId != null) {
|
|
|
+ CorpWelcomeTemplate corpWelcomeTemplate = corpWelcomeTemplateMapper.selectById(msgId);
|
|
|
+ if (corpWelcomeTemplate != null && corpWelcomeTemplate.getCouponId() != null) {
|
|
|
+ couponCommonService.sendCouponToUser(fUid, corpWelcomeTemplate.getCouponId(), 0l, 0l, 0l, channel);
|
|
|
}
|
|
|
}
|
|
|
}
|