|
|
|
@@ -9,6 +9,7 @@ import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.domain.po.WxCoupon; |
|
|
|
import com.iformall.domain.po.WxCouponChannel; |
|
|
|
import com.iformall.domain.po.WxMall; |
|
|
|
import com.iformall.domain.vo.WxCouponCVo; |
|
|
|
import com.iformall.domain.vo.WxCouponChannelAddVo; |
|
|
|
import com.iformall.domain.vo.WxCouponChannelVo; |
|
|
|
@@ -53,6 +54,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { |
|
|
|
WxCardInfoMapper wxCardInfoMapper; |
|
|
|
@Autowired |
|
|
|
WxFloatingLayerMapper wxFloatingLayerMapper; |
|
|
|
@Autowired |
|
|
|
WxMallMapper wxMallMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Qualifier("couponChannelRedisTemplate") |
|
|
|
@@ -141,8 +144,24 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData addBatch(String[] ids, String[] channelId, TenantEntity tenantEntity, Date showBeginTime, Date beginTime, Date endTime) { |
|
|
|
List<WxCouponChannelAddVo> errorList = new ArrayList<>(); |
|
|
|
public ResultData addBatch(Integer type,String[] ids, String[] channelId, TenantEntity tenantEntity, Date showBeginTime, Date beginTime, Date endTime) { |
|
|
|
//如果当前版本是推广版,则线上只能有一个拼团,一个砍价 |
|
|
|
WxMall mall = wxMallMapper.getByTenantId(tenantEntity.getTenantId()); |
|
|
|
if (mall.getSaleType().intValue() == 4 ) { |
|
|
|
if (null != type && (type.intValue() == EnumCouponType.COUPON_PRESS.getCode().intValue() |
|
|
|
|| type.intValue() == EnumCouponType.COUPON_GROUP.getCode().intValue())) { |
|
|
|
WxCouponChannel record = new WxCouponChannel(); |
|
|
|
record.updateTenantInfo(tenantEntity); |
|
|
|
record.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); |
|
|
|
record.setType(type); |
|
|
|
List<WxCouponChannelVo> list = wxCouponChannelMapper.findVoList(record); |
|
|
|
if (null != list && list.size() > 0 ) { |
|
|
|
return new ResultData(ErrorCode.COUPON_CHANNEL_IS_EXISTED,"该版本【拼团】、【砍价】线上只能发布一个。"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<WxCouponChannelAddVo> errorList = new ArrayList<>(); |
|
|
|
for (String targetIdstr:channelId) { |
|
|
|
Integer targetId = Integer.parseInt(targetIdstr); |
|
|
|
for (String couponidstr:ids) { |
|
|
|
|