|
|
|
@@ -7,15 +7,19 @@ import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.controller.base.BaseController; |
|
|
|
import com.iformall.domain.po.WxCoupon; |
|
|
|
import com.iformall.domain.po.WxCouponChannel; |
|
|
|
import com.iformall.domain.vo.WxCouponStatisVo; |
|
|
|
import com.iformall.enums.EnumCouponChannelStatus; |
|
|
|
import com.iformall.enums.EnumCouponType; |
|
|
|
import com.iformall.enums.EnumCouponValidType; |
|
|
|
import com.iformall.mapper.WxCouponChannelMapper; |
|
|
|
import com.iformall.service.WxCouponService; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
import org.apache.commons.collections.map.HashedMap; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
@@ -31,6 +35,8 @@ public class WxCouponController extends BaseController { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxCouponService wxCouponService; |
|
|
|
@Autowired |
|
|
|
private WxCouponChannelMapper wxCouponChannelMapper; |
|
|
|
|
|
|
|
@ApiOperation("分页列表接口") |
|
|
|
@GetMapping("list") |
|
|
|
@@ -61,6 +67,16 @@ public class WxCouponController extends BaseController { |
|
|
|
if (wxCoupon.getId() == null) { |
|
|
|
return new ResultData(ResultData.ERROR, "缺少id"); |
|
|
|
} |
|
|
|
if(wxCoupon.getIsDel().equals(1)){ |
|
|
|
WxCouponChannel query = new WxCouponChannel(); |
|
|
|
query.setTenantId(wxCoupon.getTenantId()); |
|
|
|
query.setCouponId(wxCoupon.getId()); |
|
|
|
query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); |
|
|
|
if(CollectionUtils.isNotEmpty(wxCouponChannelMapper.findList(query))){ |
|
|
|
return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
wxCoupon.setTenantId(getTenantId()); |
|
|
|
return wxCouponService.saveOrUpdate(wxCoupon); |
|
|
|
} |
|
|
|
|