| 对比新文件 |
| | |
| | | package com.ruoyi.staff.init; |
| | | |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceLocationConfigMapper; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | public class DataInitializer implements ApplicationRunner { |
| | | |
| | | private final PersonalAttendanceLocationConfigMapper configMapper; |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) { |
| | | initLeaveConfig(); |
| | | } |
| | | |
| | | private void initLeaveConfig() { |
| | | PersonalAttendanceLocationConfig config = configMapper.selectById(999); |
| | | if (config == null) { |
| | | config = new PersonalAttendanceLocationConfig(); |
| | | config.setId(999); |
| | | config.setShift("璇峰亣"); |
| | | configMapper.insert(config); |
| | | log.info("宸插垵濮嬪寲璇峰亣鐝閰嶇疆(id=999)"); |
| | | } |
| | | } |
| | | } |