| | |
| | | import org.springframework.boot.CommandLineRunner; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | public void autoStopContract(){ |
| | | log.info("每天凌晨3点检查到期合同"); |
| | | empContractInfoService.autoStopContract("32"); |
| | | log.info("设置合同间隔的天数"); |
| | | empContractInfoService.updateContractRemindDay(); |
| | | |
| | | } |
| | | @Scheduled(cron = "0 0 4 * * ?") |
| | | public void autoCalculateAge(){ |
| | | log.info("每天凌晨4点自动更新年龄"); |
| | | String userId = ""; |
| | | empBaseInfoService.updateEmpAge(userId); |
| | | } |
| | | @Override |
| | | public void run(String... args) throws Exception { |
| | | calculateSeniority(); |
| | | autoStopContract(); |
| | | //calculateSeniority(); |
| | | // autoStopContract(); |
| | | //autoCalculateAge(); |
| | | // updateDeptName(); |
| | | //autoStopContract(); |
| | | } |
| | | } |