package com.yuchen.saas.park.service.xxlJobThread;

import cn.hutool.core.date.DateUtil;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.yuchen.saas.park.service.mapper.property.PropertyBillMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Date;

@Slf4j
@Component
public class PropertyArrearsBillJob {
    @Resource
    private PropertyBillMapper propertyBillMapper;

    @XxlJob("propertyArrearsBillJob")
    public void handle() {
        XxlJobHelper.log("propertyArrearsBillJobStart date = " + DateUtil.formatDateTime(new Date()));
        int count = propertyBillMapper.updateArrearsBill();
        XxlJobHelper.log("共更新欠费账单数据 "+count+" 条");
        XxlJobHelper.log("propertyArrearsBillJobEnd date = " + DateUtil.formatDateTime(new Date()));
    }


}
