|
|
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.cyksj.common.constant.Constant;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
|
|
|
-import com.cyksj.common.util.Jsons;
|
|
|
import com.cyksj.config.WeChatConfig;
|
|
|
import com.cyksj.mapper.UserMapper;
|
|
|
import com.cyksj.mapper.UserTransferLogMapper;
|
|
|
@@ -17,21 +16,17 @@ import com.cyksj.mapper.channel.ChannelPopularizeMapper;
|
|
|
import com.cyksj.model.dto.GzhOAuth2UserInfo;
|
|
|
import com.cyksj.model.dto.UserWhoami;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
-import com.cyksj.model.views.CorpUserFollowView;
|
|
|
import com.cyksj.service.distribute.DistributeService;
|
|
|
import com.cyksj.service.distribute.equipment.EquipmentDistributeService;
|
|
|
import com.cyksj.service.mange.coupon.CouponCommonService;
|
|
|
import com.cyksj.service.sys.SysConfigService;
|
|
|
import com.cyksj.service.user.UserService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
-import com.ejlchina.searcher.param.Operator;
|
|
|
-import com.ejlchina.searcher.util.MapUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
|
-import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
|
|
|
/**
|
|
|
@@ -172,27 +167,28 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
//若是百度渠道 添加固定客服 注册后直接发放优惠券
|
|
|
ChannelPopularize channelPopularize = channelPopularizeMapper.selectById(popularizeId);
|
|
|
if (channelPopularize != null && channelPopularize.getChannelId() == 34) {
|
|
|
- SysConfig corpConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class)
|
|
|
- .eq(SysConfig::getSysKey, Constant.CORP_FIXED_CUSTOMER)
|
|
|
- .last("limit 1"));
|
|
|
- if (corpConfig != null) {
|
|
|
- Optional.ofNullable(corpConfig.getSysValue()).ifPresent(value -> {
|
|
|
- try {
|
|
|
- if (StrUtil.isNotBlank(value)) {
|
|
|
- List<String> followIds = Jsons.parseList(value, String.class);
|
|
|
- //添加固定客服发放优惠券
|
|
|
- CorpUserFollowView corpUserFollowView = beanSearcher.searchFirst(CorpUserFollowView.class, MapUtils.builder()
|
|
|
- .field(CorpUserFollowView::getUnionId, unionId)
|
|
|
- .field(CorpUserFollowView::getFollowId, followIds).op(Operator.InList).build());
|
|
|
- if (corpUserFollowView != null) {
|
|
|
- Constant.FIXED_CUSTOMER_COUPON_IDS.forEach(couponId -> couponCommonService.sendCouponToUser(userId, couponId, 0l, 0l, 0l, CouponUser.Channel.wxCorp));
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
+// SysConfig corpConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class)
|
|
|
+// .eq(SysConfig::getSysKey, Constant.CORP_FIXED_CUSTOMER)
|
|
|
+// .last("limit 1"));
|
|
|
+// if (corpConfig != null) {
|
|
|
+// Optional.ofNullable(corpConfig.getSysValue()).ifPresent(value -> {
|
|
|
+// try {
|
|
|
+// if (StrUtil.isNotBlank(value)) {
|
|
|
+// List<String> followIds = Jsons.parseList(value, String.class);
|
|
|
+// //添加固定客服发放优惠券
|
|
|
+// CorpUserFollowView corpUserFollowView = beanSearcher.searchFirst(CorpUserFollowView.class, MapUtils.builder()
|
|
|
+// .field(CorpUserFollowView::getUnionId, unionId)
|
|
|
+// .field(CorpUserFollowView::getFollowId, followIds).op(Operator.InList).build());
|
|
|
+// if (corpUserFollowView != null) {
|
|
|
+// Constant.FIXED_CUSTOMER_COUPON_IDS.forEach(couponId -> couponCommonService.sendCouponToUser(userId, couponId, 0l, 0l, 0l, CouponUser.Channel.wxCorp));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// } catch (Exception e) {
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// }
|
|
|
+ Constant.FIXED_CUSTOMER_COUPON_IDS.forEach(couponId -> couponCommonService.sendCouponToUser(userId, couponId, 0l, 0l, 0l, CouponUser.Channel.wxCorp));
|
|
|
}
|
|
|
}
|
|
|
}
|