package com.ylx.massage.task;

import com.ylx.massage.service.MerchantDailyAttendanceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 商户考勤定时任务。
 */
@Slf4j
@Component("merchantDailyAttendanceTask")
public class MerchantDailyAttendanceTask {

    @Resource
    private MerchantDailyAttendanceService merchantDailyAttendanceService;

    /**
     * 刷新昨日考勤扣款金额。
     * <p>
     * Quartz配置建议：0 0 0 * * ?
     */
    public void refreshYesterdayDeductionAmount() {
        log.info("开始刷新昨日商户考勤扣款金额");
        merchantDailyAttendanceService.refreshYesterdayDeductionAmount();
        log.info("刷新昨日商户考勤扣款金额完成");
    }
}
