陶杰
2025-01-08 ae1471f378f399f76518539ec8992e64a3673436
src/main/java/com/mzl/flower/schedule/PointScheduleService.java
@@ -40,7 +40,7 @@
    /**
     * 定时计算用户过期积分
     */
    @Scheduled(cron = "0 10 1 * * ?")
    @Scheduled(cron = "0 10 0 * * ?")
    public void calculatingExpiredPoint() {
        log.info("过期积分计算开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
        LocalDate now = LocalDate.now().minusDays(1);//前一天
@@ -58,7 +58,7 @@
                    customerPointDetail.setPoint(expiredPoint);
                    customerPointDetail.setRecordDate(lastYear);
                    customerPointDetail.create("sys");
                    customerPointDetail.setRemarks(DateUtils.toString(now,"yyyy-MM-dd")+"过期积分结算");
                    customerPointDetail.setRemarks(DateUtils.toString(now,"yyyy-MM-dd")+"过期积分结算,过期积分"+expiredPoint);
                    customerPointDetailMapper.insert(customerPointDetail);
                    //更新用户积分记录
@@ -68,7 +68,8 @@
                    if(customerPoint == null ){
                        log.error("用户积分记录不存在,userId={},customerId={}",pointDTO.getUserId(),pointDTO.getCustomerId());
                    }else {
                        customerPoint.setExpiredPoint(expiredPoint);
                        Integer expiredPointTotal = customerPoint.getExpiredPoint()==null?0:customerPoint.getExpiredPoint();
                        customerPoint.setExpiredPoint(expiredPoint+expiredPointTotal);
                        customerPointMapper.updateById(customerPoint);
                    }
@@ -84,7 +85,7 @@
    /**
     * 积分兑换券过期
     */
    @Scheduled(cron = "0 46 11 * * ?")
    @Scheduled(cron = "0 5 0 * * ?")
    public void expiredPointGoodsRecord() {
        log.info("积分兑换券过期计算开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
        pointGoodsRecordMapper.updateExpiredPointGoodsRecord();