|
|
|
@@ -59,11 +59,12 @@ public class WxScreenAdServiceImpl implements WxScreenAdService { |
|
|
|
@Override |
|
|
|
public ResultData saveOrUpdate(WxScreenAd record) { |
|
|
|
if (record.getId() == null) { |
|
|
|
if (record.getType() == null || record.getTargetId() == null) { |
|
|
|
if (record.getType() == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
} |
|
|
|
if (record.getType().equals(EnumScreenAdType.COUPON.getCode())) { |
|
|
|
|
|
|
|
if (record.getTargetId() == null) |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
WxCouponCVo wxCouponCVo = wxCouponChannelMapper.findVoDetail(record.getTargetId()); |
|
|
|
if (wxCouponCVo == null) |
|
|
|
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); |
|
|
|
@@ -71,12 +72,17 @@ public class WxScreenAdServiceImpl implements WxScreenAdService { |
|
|
|
record.setSubType(wxCouponCVo.getTargetAd()); |
|
|
|
record.setTitle(wxCouponCVo.getTitle()); |
|
|
|
|
|
|
|
} else if (record.getType().equals(EnumScreenAdType.COUPON.getCode())){ |
|
|
|
} else if (record.getType().equals(EnumScreenAdType.CAMPAIGN.getCode())){ |
|
|
|
if (record.getTargetId() == null) |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
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()); |
|
|
|
} else if (record.getType().equals(EnumScreenAdType.PICTURE.getCode())) { |
|
|
|
if (record.getCoverImg() == null) |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
} |
|
|
|
|
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
|