|
@@ -1,6 +1,9 @@
|
|
|
package com.cyksj.web.controller.channel;
|
|
package com.cyksj.web.controller.channel;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
+import com.cyksj.common.constant.Constant;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.util.Jsons;
|
|
import com.cyksj.common.util.Jsons;
|
|
|
import com.cyksj.dto.Result;
|
|
import com.cyksj.dto.Result;
|
|
@@ -9,8 +12,11 @@ import com.cyksj.mapper.channel.ChannelPopularizeMapper;
|
|
|
import com.cyksj.mapper.channel.ChannelPopularizeVisitMapper;
|
|
import com.cyksj.mapper.channel.ChannelPopularizeVisitMapper;
|
|
|
import com.cyksj.mapper.channel.MoviesVisitRecordMapper;
|
|
import com.cyksj.mapper.channel.MoviesVisitRecordMapper;
|
|
|
import com.cyksj.mapper.manage.coupon.CouponSkuMapper;
|
|
import com.cyksj.mapper.manage.coupon.CouponSkuMapper;
|
|
|
|
|
+import com.cyksj.mapper.sys.SysConfigMapper;
|
|
|
import com.cyksj.model.entity.ChannelPopularizeVisit;
|
|
import com.cyksj.model.entity.ChannelPopularizeVisit;
|
|
|
import com.cyksj.model.entity.MoviesVisitRecord;
|
|
import com.cyksj.model.entity.MoviesVisitRecord;
|
|
|
|
|
+import com.cyksj.model.entity.SysConfig;
|
|
|
|
|
+import com.cyksj.model.manage.dto.ChannelBaiDuDiscountDto;
|
|
|
import com.cyksj.model.views.ChannelPopularizeFrontView;
|
|
import com.cyksj.model.views.ChannelPopularizeFrontView;
|
|
|
import com.cyksj.model.views.CouponTfPopularizeView;
|
|
import com.cyksj.model.views.CouponTfPopularizeView;
|
|
|
import com.cyksj.service.corp.CorpCustomerAcquistionService;
|
|
import com.cyksj.service.corp.CorpCustomerAcquistionService;
|
|
@@ -50,10 +56,12 @@ public class ChannelController {
|
|
|
|
|
|
|
|
private final CorpCustomerAcquistionService corpCustomerAcquistionService;
|
|
private final CorpCustomerAcquistionService corpCustomerAcquistionService;
|
|
|
|
|
|
|
|
|
|
+ private final SysConfigMapper sysConfigMapper;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/get/{id}")
|
|
@GetMapping("/get/{id}")
|
|
|
- public Result<ChannelPopularizeFrontView> getById(@PathVariable Long id, Boolean isLogin) {
|
|
|
|
|
|
|
+ public Result<ChannelPopularizeFrontView> getById(@PathVariable Long id) {
|
|
|
ChannelPopularizeFrontView channelPopularize = beanSearcher.searchFirst(ChannelPopularizeFrontView.class, MapUtils.builder()
|
|
ChannelPopularizeFrontView channelPopularize = beanSearcher.searchFirst(ChannelPopularizeFrontView.class, MapUtils.builder()
|
|
|
.put("id", String.format("id = %s", id))
|
|
.put("id", String.format("id = %s", id))
|
|
|
.build());
|
|
.build());
|
|
@@ -79,6 +87,29 @@ public class ChannelController {
|
|
|
System.out.println(e.getMessage());
|
|
System.out.println(e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if (Constant.NO_SIGN_CHANNEL_NAMES.contains(channelPopularize.getChannelName())) {
|
|
|
|
|
+ String key;
|
|
|
|
|
+ if (StrUtil.equals(Constant.NO_SIGN_CHANNEL_NAMES.get(0), channelPopularize.getChannelName())) {
|
|
|
|
|
+ key = Constant.CHANNEL_BAIDU_DISCOUNT_KEY;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ key = Constant.CHANNEL_DY_DISCOUNT_KEY;
|
|
|
|
|
+ }
|
|
|
|
|
+ SysConfig baiduConfig = sysConfigMapper.selectOne(Wrappers.lambdaQuery(SysConfig.class)
|
|
|
|
|
+ .eq(SysConfig::getSysKey, key).last("limit 1"));
|
|
|
|
|
+ if (baiduConfig != null) {
|
|
|
|
|
+ String sysValue = baiduConfig.getSysValue();
|
|
|
|
|
+ if (StrUtil.isNotBlank(sysValue)) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ ChannelBaiDuDiscountDto baiDuDiscountDto = Jsons.parseObject(sysValue, ChannelBaiDuDiscountDto.class);
|
|
|
|
|
+ if (baiDuDiscountDto != null && CollUtil.isNotEmpty(baiDuDiscountDto.getPopularizeIds()) && baiDuDiscountDto.getPopularizeIds().contains(id)) {
|
|
|
|
|
+ channelPopularize.setIsSign(true);
|
|
|
|
|
+ channelPopularize.setDiscount(baiDuDiscountDto.getDiscount());
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
ChannelPopularizeVisit channelPopularizeVisit = new ChannelPopularizeVisit();
|
|
ChannelPopularizeVisit channelPopularizeVisit = new ChannelPopularizeVisit();
|
|
|
channelPopularizeVisit.setPopularizeId(id);
|
|
channelPopularizeVisit.setPopularizeId(id);
|
|
|
channelPopularizeVisitMapper.insert(channelPopularizeVisit);
|
|
channelPopularizeVisitMapper.insert(channelPopularizeVisit);
|