package cn.iocoder.yudao.scheduled;

import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.staff.service.CompanyStaffService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 定时更新员工的工龄和司龄
 * @author 小李
 * @date 14:00 2024/8/13
**/
@Component
@TenantJob
@Slf4j
public class UpdateCompanyStaffWorkAndJoinedYearsJob implements JobHandler {

    @Resource
    private CompanyStaffService staffService;

    @Override
    public String execute(String param) throws Exception {
        // 执行更新
        staffService.updateStaffWorkAndJoinedYears();
        return null;
    }
}
