|
|
|
@@ -1,16 +1,14 @@ |
|
|
|
package com.iformall.service.impl; |
|
|
|
|
|
|
|
import cn.binarywang.wx.miniapp.api.WxMaService; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.IdWorker; |
|
|
|
|
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.WxAppinfo; |
|
|
|
import com.iformall.domain.po.WxCampaign; |
|
|
|
import com.iformall.domain.po.WxCouponChannel; |
|
|
|
import com.iformall.domain.po.WxScreenAd; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.domain.vo.WxCouponCVo; |
|
|
|
import com.iformall.enums.EnumCouponChannelType; |
|
|
|
import com.iformall.enums.EnumScreenAdType; |
|
|
|
@@ -18,6 +16,7 @@ import com.iformall.mapper.WxCampaignMapper; |
|
|
|
import com.iformall.mapper.WxCouponChannelMapper; |
|
|
|
import com.iformall.mapper.WxScreenAdMapper; |
|
|
|
import com.iformall.service.WxAppinfoService; |
|
|
|
import com.iformall.service.WxMerchantService; |
|
|
|
import com.iformall.service.WxScreenAdService; |
|
|
|
import com.iformall.service.wechat.FmOpenService; |
|
|
|
import com.iformall.utils.MaUtil; |
|
|
|
@@ -43,6 +42,9 @@ public class WxScreenAdServiceImpl implements WxScreenAdService { |
|
|
|
@Autowired |
|
|
|
WxCouponChannelMapper wxCouponChannelMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxMerchantService wxMerchantService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCampaignMapper wxCampaignMapper; |
|
|
|
|
|
|
|
@@ -83,6 +85,19 @@ public class WxScreenAdServiceImpl implements WxScreenAdService { |
|
|
|
} else if (record.getType().equals(EnumScreenAdType.PICTURE.getCode())) { |
|
|
|
if (record.getCoverImg() == null) |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
} else if (record.getType().equals(EnumScreenAdType.MERCHANT.getCode())) { |
|
|
|
if (record.getExtInfo() == null) |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
JSONObject jo = JSONObject.parseObject(record.getExtInfo()); |
|
|
|
if (jo == null) |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
if (jo.getInteger("executionIndex") == null || jo.getInteger("populationIndex") == null) |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
WxMerchant wxMerchant = wxMerchantService.getById(record.getTargetId()); |
|
|
|
if (wxMerchant == null) |
|
|
|
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); |
|
|
|
record.setCoverImg(wxMerchant.getImgUrl()); |
|
|
|
record.setTitle(wxMerchant.getName()); |
|
|
|
} |
|
|
|
|
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
|