diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index 8f7a0c492..2faa64fbb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -149,9 +149,10 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { WxMall mall = wxMallMapper.getByTenantId(tenantEntity.getTenantId()); if (mall.getSaleType().intValue() == 4 ) { if (null != type && (type.equals(String.valueOf(EnumCouponType.COUPON_PRESS.getCode().intValue())) - || type.equals(String.valueOf(EnumCouponType.COUPON_GROUP.getCode().intValue())))) { + || type.equals(String.valueOf(EnumCouponType.COUPON_GROUP.getCode().intValue())) + || type.equals(String.valueOf(EnumCouponType.COUPON_PREORDER.getCode().intValue())))) { if (null != ids && ids.length > 1) { - return new ResultData(ErrorCode.COUPON_CHANNEL_IS_EXISTED.getCode(),"该版本【拼团】、【砍价】线上只能投放一个,请勾选一个。"); + return new ResultData(ErrorCode.COUPON_CHANNEL_IS_EXISTED.getCode(),"该版本【拼团】、【砍价】、【限时抢购】、【预售】线上只能投放一个,请勾选一个。"); } WxCouponChannel record = new WxCouponChannel(); @@ -160,9 +161,27 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { record.setType(Integer.parseInt(type)); List list = wxCouponChannelMapper.findVoList(record); if (null != list && list.size() > 0 ) { - return new ResultData(ErrorCode.COUPON_CHANNEL_IS_EXISTED.getCode(),"该版本【拼团】、【砍价】线上只能投放一个,已经存在已上线的活动,不能再投放。"); + return new ResultData(ErrorCode.COUPON_CHANNEL_IS_EXISTED.getCode(),"该版本【拼团】、【砍价】、【限时抢购】、【预售】线上只能投放一个,已经存在已上线的活动,不能再投放。"); } } + //限时抢购 + if (null != channelId && channelId.length == 1) { + String cid = channelId[0]; + if (cid.equals(String.valueOf(EnumCouponChannelType.COUPON_CHANNEL_ID_TIMED.getCode()))) { + if (null != ids && ids.length > 1) { + return new ResultData(ErrorCode.COUPON_CHANNEL_IS_EXISTED.getCode(),"该版本【拼团】、【砍价】、【限时抢购】、【预售】线上只能投放一个,请勾选一个。"); + } + WxCouponChannel record = new WxCouponChannel(); + record.updateTenantInfo(tenantEntity); + record.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); + record.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_TIMED.getCode()); + List list = wxCouponChannelMapper.findVoList(record); + if (null != list && list.size() > 0 ) { + return new ResultData(ErrorCode.COUPON_CHANNEL_IS_EXISTED.getCode(),"该版本【拼团】、【砍价】、【限时抢购】、【预售】线上只能投放一个,已经存在已上线的活动,不能再投放。"); + } + + } + } } List errorList = new ArrayList<>();