|
|
@@ -2,11 +2,13 @@ package com.iformall.controller.market; |
|
|
|
|
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.iformall.annotation.SystemControllerLog; |
|
|
import com.iformall.annotation.SystemControllerLog; |
|
|
|
|
|
import com.iformall.common.ErrorCode; |
|
|
import com.iformall.common.Result; |
|
|
import com.iformall.common.Result; |
|
|
import com.iformall.common.ResultData; |
|
|
import com.iformall.common.ResultData; |
|
|
import com.iformall.controller.base.BaseController; |
|
|
import com.iformall.controller.base.BaseController; |
|
|
import com.iformall.domain.po.WxCoupon; |
|
|
import com.iformall.domain.po.WxCoupon; |
|
|
import com.iformall.domain.vo.WxCouponStatisVo; |
|
|
import com.iformall.domain.vo.WxCouponStatisVo; |
|
|
|
|
|
import com.iformall.enums.EnumCouponValidType; |
|
|
import com.iformall.service.WxCouponService; |
|
|
import com.iformall.service.WxCouponService; |
|
|
import com.iformall.utils.DateUtils; |
|
|
import com.iformall.utils.DateUtils; |
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.Api; |
|
|
@@ -70,6 +72,21 @@ public class WxCouponController extends BaseController { |
|
|
if (wxCoupon.getId() == null) { |
|
|
if (wxCoupon.getId() == null) { |
|
|
return new ResultData(ResultData.ERROR, "缺少id"); |
|
|
return new ResultData(ResultData.ERROR, "缺少id"); |
|
|
} |
|
|
} |
|
|
|
|
|
if(wxCoupon.getRemainInventory() == null || wxCoupon.getInventory() == null) { |
|
|
|
|
|
return new ResultData(ErrorCode.COUPON_STOCK_ERR); |
|
|
|
|
|
} |
|
|
|
|
|
if(wxCoupon.getValidType() == null) { |
|
|
|
|
|
return new ResultData(ErrorCode.COUPON_VALID_DATE_ERR); |
|
|
|
|
|
} |
|
|
|
|
|
if(wxCoupon.getValidType().equals(EnumCouponValidType.BETWEEN_TWO_TIME.getCode())) { |
|
|
|
|
|
if(wxCoupon.getValidEndDate() == null) { |
|
|
|
|
|
return new ResultData(ErrorCode.COUPON_VALID_DATE_ERR); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
if(wxCoupon.getValidDays() == null) { |
|
|
|
|
|
return new ResultData(ErrorCode.COUPON_VALID_DATE_ERR); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
wxCoupon.setTenantId(getTenantId()); |
|
|
wxCoupon.setTenantId(getTenantId()); |
|
|
return wxCouponService.updateCouponStockAndEndTime(wxCoupon); |
|
|
return wxCouponService.updateCouponStockAndEndTime(wxCoupon); |
|
|
} |
|
|
} |
|
|
|