| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.CompletableFuture; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | * 三:可修改 |
| | | * 1、优惠券名称 |
| | | * 2、宣传海报 |
| | | * 3、分享文案、分享图片 |
| | | * 四:发放对象 |
| | | * 1、未到发放时间都可以修改 |
| | | * 2、已到发放时间,只有自定义时可修改,且只能增加用户 |
| | |
| | | coupon.setRelationActivityType(mgtCouponEditDto.getRelationActivityType()); |
| | | coupon.setRelationActivityId(mgtCouponEditDto.getRelationActivityId()); |
| | | coupon.setPropagandaPoster(mgtCouponEditDto.getPropagandaPoster()); |
| | | coupon.setSharePassage(mgtCouponEditDto.getSharePassage()); |
| | | coupon.setSharePic(mgtCouponEditDto.getSharePic()); |
| | | //指定发放优惠券不做发放数限制 |
| | | if(coupon.getSendType()==2){ |
| | | mgtCouponEditDto.setSendLimitFlag(0); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void endImmediately(MgtBaseGetDto mgtBaseGetDto) { |
| | | public R endImmediately(MgtBaseGetDto mgtBaseGetDto) { |
| | | // 将优惠券状态置为禁用 定时发放类型每小时会检查启用中的没发放的 发送了的、立即发送类型的优惠券不管 |
| | | Coupon coupon = couponMapper.selectById(mgtBaseGetDto.getId()); |
| | | if (coupon == null || coupon.getDelFlag() != 0) { |
| | | return R.fail("该优惠券不存在"); |
| | | } |
| | | if (coupon.getCouponStatus()!=1){ |
| | | return R.fail("状态错误,该优惠券未在启用中"); |
| | | } |
| | | coupon.setCouponStatus(0);//设置为禁用 |
| | | coupon.setUpdateUserId(mgtBaseGetDto.getUserId()); |
| | | coupon.setUpdateTime(new Date()); |
| | | this.updateById(coupon); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public List<LotteryEventCouponListVO> getLotteryEventCouponList() { |
| | | return this.getBaseMapper().getLotteryEventCouponList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<LotteryEventCouponListVO> getLotteryEventCouponListByShopId(String shopId) { |
| | | return this.getBaseMapper().getLotteryEventCouponListByShopId(shopId); |
| | | } |
| | | } |