|
|
|
@@ -10,13 +10,16 @@ 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.vo.WxCouponCVo; |
|
|
|
import com.iformall.enums.EnumScreenAdType; |
|
|
|
import com.iformall.mapper.WxCampaignMapper; |
|
|
|
import com.iformall.mapper.WxCouponChannelMapper; |
|
|
|
import com.iformall.mapper.WxScreenAdMapper; |
|
|
|
import com.iformall.service.WxAppinfoService; |
|
|
|
import com.iformall.service.WxCampaignService; |
|
|
|
import com.iformall.service.WxScreenAdService; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
@@ -46,6 +49,9 @@ public class WxScreenAdServiceImpl implements WxScreenAdService { |
|
|
|
@Autowired |
|
|
|
WxCouponChannelMapper wxCouponChannelMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCampaignMapper wxCampaignMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxScreenAd> listAsPage(WxScreenAd record, Integer pageIndex, Integer pageSize) { |
|
|
|
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxScreenAdMapper.findList(record)); |
|
|
|
@@ -69,7 +75,14 @@ public class WxScreenAdServiceImpl implements WxScreenAdService { |
|
|
|
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); |
|
|
|
record.setCoverImg(wxCouponCVo.getCoverImg()); |
|
|
|
record.setSubType(wxCouponCVo.getTargetAd()); |
|
|
|
record.setTitle(wxCouponCVo.getTitle()); |
|
|
|
|
|
|
|
} else if (record.getType().equals(EnumScreenAdType.COUPON.getCode())){ |
|
|
|
WxCampaign wxCampaign = wxCampaignMapper.selectByPrimaryKey(record.getTargetId()); |
|
|
|
if (wxCampaign == null) |
|
|
|
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); |
|
|
|
record.setCoverImg(wxCampaign.getCoverImg()); |
|
|
|
record.setTitle(wxCampaign.getTitle()); |
|
|
|
} |
|
|
|
|
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
|