|  |  |  | 
|---|
|  |  |  | import com.mzl.flower.dto.response.coupon.CouponTemplateVO; | 
|---|
|  |  |  | import com.mzl.flower.dto.response.coupon.CouponTemplateVipVO; | 
|---|
|  |  |  | import com.mzl.flower.entity.coupon.CouponTemplateDO; | 
|---|
|  |  |  | import com.mzl.flower.entity.menber.Member; | 
|---|
|  |  |  | import com.mzl.flower.enums.CouponCategoryEnum; | 
|---|
|  |  |  | import com.mzl.flower.enums.CouponTypeEnum; | 
|---|
|  |  |  | import com.mzl.flower.service.coupon.CouponTemplateService2; | 
|---|
|  |  |  | import com.mzl.flower.service.menber.MemberService; | 
|---|
|  |  |  | import com.mzl.flower.utils.ConverterUtil; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | CouponTemplateService2 couponTemplateService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | MemberService memberService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("") | 
|---|
|  |  |  | @ApiOperation(value = "新增", notes = "新增") | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private void valid(CreateCouponTemplateVipDTO dto){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | final Member member = memberService.getById(dto.getMemberId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(null==member){ | 
|---|
|  |  |  | throw new ValidationException("会员等级不存在"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (StringUtils.isNotBlank(dto.getCouponDiscountType()) | 
|---|
|  |  |  | && dto.getCouponDiscountType().equals(CouponTypeEnum.DISCOUNT.getType()) | 
|---|
|  |  |  | && dto.getMinOrderAmount().compareTo(dto.getCouponDiscountValue()) < 0) { | 
|---|