| | |
| | | package com.ruoyi.staff.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.staff.dto.StaffLeaveDto; |
| | | import com.ruoyi.staff.dto.StaffOnJobDto; |
| | | import com.ruoyi.staff.mapper.StaffLeaveMapper; |
| | | import com.ruoyi.staff.mapper.StaffOnJobMapper; |
| | | import com.ruoyi.staff.pojo.StaffContract; |
| | | import com.ruoyi.staff.pojo.StaffJoinLeaveRecord; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.staff.service.StaffLeaveService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.staff.pojo.StaffLeave; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @AllArgsConstructor |
| | | @Service |
| | | public class StaffLeaveServiceImpl extends ServiceImpl<StaffLeaveMapper, StaffLeave> implements StaffLeaveService { |
| | | @Autowired |
| | | private StaffLeaveMapper staffLeaveMapper; |
| | | |
| | | @Autowired |
| | | private StaffOnJobMapper staffOnJobMapper; |
| | | |
| | | //新增离职列表分页查询 |
| | |
| | | // 新增离职记录 |
| | | StaffLeave staffLeave = new StaffLeave(); |
| | | staffLeave.setStaffOnJobId(staffLeaveDto.getStaffOnJobId()); |
| | | staffLeave.setReason(staffLeaveDto.getReason()); |
| | | String reason = staffLeaveDto.getReason(); |
| | | if (!StaffLeaveReasonOther.getCode().equals(reason)){ |
| | | staffLeave.setRemark(""); |
| | | if (StaffLeaveReasonOther.getCode().equals(reason)){ |
| | | staffLeave.setRemark(staffLeaveDto.getRemark()); |
| | | } |
| | | staffLeaveMapper.insert(staffLeave); |
| | | |
| | |
| | | ExcelUtil<StaffLeaveDto> util = new ExcelUtil<StaffLeaveDto>(StaffLeaveDto.class); |
| | | util.exportExcel(response, staffLeaves, "员工离职导出"); |
| | | } |
| | | |
| | | } |
| | | |