|
|
@@ -25,6 +25,7 @@ import com.cyksj.model.response.ExternalContact;
|
|
|
import com.cyksj.model.response.FollowedUser;
|
|
|
import com.cyksj.service.corp.WxCorpOps;
|
|
|
import com.cyksj.service.corp.msg.CorpEventActionService;
|
|
|
+import com.cyksj.service.mange.coupon.CouponCommonService;
|
|
|
import com.cyksj.service.market.MarketFrontService;
|
|
|
import com.cyksj.service.relation.GroupRelationFrontService;
|
|
|
import com.cyksj.service.sys.SysConfigService;
|
|
|
@@ -78,6 +79,8 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
|
|
|
private final GlobalThreadPoolTaskExecutor THREAD_POOL;
|
|
|
|
|
|
+ private final CouponCommonService couponCommonService;
|
|
|
+
|
|
|
private static final String DEFAULT_MSG = "您好,欢迎加入银河录像局";
|
|
|
|
|
|
/**
|
|
|
@@ -114,6 +117,8 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
groupRelationFrontService.isJoinCorpWx(user.getId(), true, false);
|
|
|
//发放抽奖机会
|
|
|
sendSpecificChanceNum(user.getId());
|
|
|
+ //添加固定客服发放优惠券
|
|
|
+ isJoinFixedCustomer(user.getId(), userId);
|
|
|
}
|
|
|
corpUserMapper.insert(corpUser);
|
|
|
} else {
|
|
|
@@ -145,6 +150,27 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ private void isJoinFixedCustomer(Long userId, String followId) {
|
|
|
+ SysConfig corpConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class)
|
|
|
+ .eq(SysConfig::getSysKey, Constant.CORP_FIXED_CUSTOMER)
|
|
|
+ .eq(SysConfig::getSysValue, followId)
|
|
|
+ .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);
|
|
|
+ if (followIds.contains(followId)) {
|
|
|
+ //发放添加固定客服优惠券
|
|
|
+ couponCommonService.sendCouponToUser(userId, 38l, 0l, 0l, 0l, CouponUser.Channel.wxCorp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void sendSpecificChanceNum(Long userId) throws Exception {
|
|
|
SysConfig lottery_specific_goods = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, Constant.LOTTERY_SPECIFIC_GOODS).last("limit 1"));
|
|
|
if (lottery_specific_goods == null) {
|