|
|
@@ -2417,24 +2417,36 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
sendTelegramMsg(orderDon, goodsDon, sku);
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
if (orderDon.getPopularizeId() != null && orderDon.getPopularizeId() != 0 && StrUtil.isNotEmpty(orderDon.getPhone())) {
|
|
|
+ String name = channelPopularizeMapper.selectChannelByPid(orderDon.getPopularizeId());
|
|
|
//百度渠道 专门优惠链接
|
|
|
- SysConfig baiduConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class)
|
|
|
- .eq(SysConfig::getSysKey, Constant.CHANNEL_BAIDU_DISCOUNT_KEY).last("limit 1"));
|
|
|
- if (baiduConfig != null) {
|
|
|
- String sysValue = baiduConfig.getSysValue();
|
|
|
- if (StrUtil.isNotBlank(sysValue)) {
|
|
|
- try {
|
|
|
- ChannelBaiDuDiscountDto baiDuDiscountDto = Jsons.parseObject(sysValue, ChannelBaiDuDiscountDto.class);
|
|
|
- List<Long> couponIds = baiDuDiscountDto.getCouponIds();
|
|
|
- //下单成功后 发送优惠券
|
|
|
- if (CollUtil.isNotEmpty(couponIds)) {
|
|
|
- List<Long> baiduPopularizeIds = baiDuDiscountDto.getPopularizeIds();
|
|
|
- if (baiduPopularizeIds.contains(orderDon.getPopularizeId())) {
|
|
|
- couponIds.forEach(couponId -> couponCommonService.sendCouponToUser(orderDon.getUserId(), couponId, null, null, null, CouponUser.Channel.manual));
|
|
|
+ if (name.contains(Constant.NO_SIGN_CHANNEL_NAMES.get(0)) || name.contains(Constant.NO_SIGN_CHANNEL_NAMES.get(1))) {
|
|
|
+ String key;
|
|
|
+ if (name.contains(Constant.NO_SIGN_CHANNEL_NAMES.get(0))) {
|
|
|
+ //百度渠道 专门优惠链接
|
|
|
+ key = Constant.CHANNEL_BAIDU_DISCOUNT_KEY;
|
|
|
+ } else {
|
|
|
+ //抖音
|
|
|
+ key = Constant.CHANNEL_DY_DISCOUNT_KEY;
|
|
|
+ }
|
|
|
+ SysConfig channelNoSignConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class)
|
|
|
+ .eq(SysConfig::getSysKey, key).last("limit 1"));
|
|
|
+ if (channelNoSignConfig != null) {
|
|
|
+ String sysValue = channelNoSignConfig.getSysValue();
|
|
|
+ if (StrUtil.isNotBlank(sysValue)) {
|
|
|
+ try {
|
|
|
+ ChannelBaiDuDiscountDto baiDuDiscountDto = Jsons.parseObject(sysValue, ChannelBaiDuDiscountDto.class);
|
|
|
+ List<Long> couponIds = baiDuDiscountDto.getCouponIds();
|
|
|
+ //下单成功后 发送优惠券
|
|
|
+ if (CollUtil.isNotEmpty(couponIds)) {
|
|
|
+ List<Long> baiduPopularizeIds = baiDuDiscountDto.getPopularizeIds();
|
|
|
+ if (baiduPopularizeIds.contains(orderDon.getPopularizeId())) {
|
|
|
+ couponIds.forEach(couponId -> couponCommonService.sendCouponToUser(orderDon.getUserId(), couponId, null, null, null, CouponUser.Channel.manual));
|
|
|
+ }
|
|
|
}
|
|
|
+ } catch (Exception e) {
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
}
|
|
|
}
|
|
|
}
|