1.优惠券-活动优惠券-定时任务-领取时间小于当前时间,自动下架
2.优惠券-优惠券使用记录-定时任务-使用时间小于当前时间,自动过期
3.优惠券-积分优惠券-增加已领取数和未领取数
已修改12个文件
78 ■■■■ 文件已修改
src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplatePointDTO.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateUserDTO.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/dto/response/coupon/CouponTemplatePointVO.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/coupon/CouponRecordMapperCustom.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/coupon/CouponTemplateMapperCustom.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/schedule/ScheduleService.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/coupon/CouponRecordService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/coupon/CouponTemplateService2.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/impl/coupon/CouponRecordServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/impl/coupon/CouponTemplateServiceImpl2.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/coupon/CouponRecordMapperCustom.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplatePointDTO.java
@@ -4,10 +4,7 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.*;
import java.math.BigDecimal;
/**
@@ -71,7 +68,7 @@
     */
    @ApiModelProperty(value = "优惠券面值")
    @NotNull(message = "优惠券面值不能为空")
    @Min(value = 1,message = "优惠券面值大于0")
    @DecimalMin(value = "0.01", inclusive = true,message = "优惠券面值大于0")
    @Max(value = 99999999,message = "优惠券面值不能超过99999999")
    private BigDecimal couponDiscountValue;
src/main/java/com/mzl/flower/dto/request/coupon/CreateCouponTemplateUserDTO.java
@@ -4,10 +4,7 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.List;
@@ -69,7 +66,7 @@
     */
    @ApiModelProperty(value = "优惠券面值")
    @NotNull(message = "优惠券面值不能为空")
    @Min(value = 1,message = "优惠券面值大于0")
    @DecimalMin(value = "0.01", inclusive = true,message = "优惠券面值大于0")
    @Max(value = 99999999,message = "优惠券面值不能超过99999999")
    private BigDecimal couponDiscountValue;
src/main/java/com/mzl/flower/dto/response/coupon/CouponTemplatePointVO.java
@@ -132,4 +132,18 @@
    private LocalDateTime createTime;
    /**
     * 已经领取数
     */
    @ApiModelProperty(value = "已经领取数")
    private Integer getNum;
    /**
     * 未领取数
     */
    @ApiModelProperty(value = "未领取数")
    private Integer unGetNum;
}
src/main/java/com/mzl/flower/mapper/coupon/CouponRecordMapperCustom.java
@@ -34,4 +34,6 @@
    List<CouponRecordVO> getMineCouponRecordList(@Param("param") QueryMineCouponRecordDTO dto);
    void checkCouponExpired(@Param("param") QueryMineCouponRecordDTO dto);
    boolean expireCouponRecordAll();
}
src/main/java/com/mzl/flower/mapper/coupon/CouponTemplateMapperCustom.java
@@ -65,4 +65,6 @@
    CouponTemplateVO getHomeActivityEffectAlert(@Param("param") QueryActivityEffectCouponDTO dto);
    void expireHomeActivityCouponTemplate();
    int expireActivityCouponTemplateAll();
}
src/main/java/com/mzl/flower/schedule/ScheduleService.java
@@ -12,6 +12,7 @@
import com.mzl.flower.mapper.partner.PartnerMapper;
import com.mzl.flower.mapper.payment.OrderMapper;
import com.mzl.flower.service.coupon.CouponRecordService;
import com.mzl.flower.service.coupon.CouponTemplateService2;
import com.mzl.flower.service.flower.FlowerCategoryService;
import com.mzl.flower.service.flower.FlowerService;
import com.mzl.flower.service.menber.impl.GrowthValueDealService;
@@ -70,6 +71,9 @@
    @Autowired
    private MemberGrowthRecordMapper memberGrowthRecordMapper;
    @Autowired
    private CouponTemplateService2 couponTemplateService2;
    @Scheduled(cron = "1 0/30 * * * ?")
    public void calculateAvePrice() {
@@ -240,4 +244,26 @@
    }
    @Scheduled(cron = "0 0/5 * * * ?")
    public void expireActivityCouponTemplateAll() {
        log.info("优惠券模版过期下架开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
        // 下架有所的过期的优惠券
        couponTemplateService2.expireActivityCouponTemplateAll();
        log.info("优惠券模版过期下架开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
    }
    @Scheduled(cron = "0 0/5 * * * ?")
    public void expireCouponRecordAll() {
        log.info("优惠券记录过期开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
        // 下架有所的过期的优惠券
        couponRecordService.expireCouponRecordAll();
        log.info("优惠券记录过期开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
    }
}
src/main/java/com/mzl/flower/service/coupon/CouponRecordService.java
@@ -120,4 +120,5 @@
    boolean checkUserCouponExists(String couponId, Long customId);
    boolean expireCouponRecordAll();
}
src/main/java/com/mzl/flower/service/coupon/CouponTemplateService2.java
@@ -100,4 +100,5 @@
     */
    CouponTemplateVO getHomeActivityEffectAlert(QueryActivityEffectCouponDTO dto);
    boolean expireActivityCouponTemplateAll();
}
src/main/java/com/mzl/flower/service/impl/coupon/CouponRecordServiceImpl.java
@@ -549,4 +549,10 @@
        ;
        return baseMapper.selectCount(queryWrapper)>0;
    }
    @Override
    public boolean expireCouponRecordAll() {
        return couponRecordMapperCustom.expireCouponRecordAll();
    }
}
src/main/java/com/mzl/flower/service/impl/coupon/CouponTemplateServiceImpl2.java
@@ -489,6 +489,12 @@
    }
    @Override
    public boolean expireActivityCouponTemplateAll() {
        return couponTemplateMapperCustom.expireActivityCouponTemplateAll()>0;
    }
    @Override
    public List<CouponTemplateVO> getActivityEffectList(QueryActivityEffectCouponDTO dto) {
        return couponTemplateMapperCustom.getActivityEffectList(dto);
src/main/resources/mapper/coupon/CouponRecordMapperCustom.xml
@@ -39,6 +39,9 @@
            AND customer_id =  #{param.customerId}
        </if>
    </update>
    <update id="expireCouponRecordAll">
        update t_coupon_record  set `status`='expired' where `status`='unused' and effective_end &lt; NOW()
    </update>
    <select id="statisCouponTemplateCount" resultType="java.lang.Integer">
        select IFNULL(count(1),0) as cnt from t_coupon_record where deleted=false and category=#{param.category}
src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml
@@ -59,6 +59,9 @@
    <update id="expireHomeActivityCouponTemplate">
        update t_coupon_template set status='expired'  where  category='activity' and get_type='home' and status='active'
    </update>
    <update id="expireActivityCouponTemplateAll">
        update t_coupon_template set status='expired'  where category='activity' and  get_end_date &lt; NOW()
    </update>
    <select id="getCouponTemplatePage" resultType="com.mzl.flower.dto.response.coupon.CouponTemplateVO">
        <include refid="QuerySql2"/>