| | |
| | | import cc.mrbird.febs.server.hr.mapper.EmpLeaveInfoMapper; |
| | | import cc.mrbird.febs.server.hr.service.IEmpLeaveInfoService; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void importEmpLeaveInfo(List<List<Object>> listObject) { |
| | | public void importEmpLeaveInfo(List<List<Object>> listObject,List<String> returnList) { |
| | | for (List<Object> list : listObject) { |
| | | if (list.size()==0){ |
| | | continue; |
| | | } |
| | | EmpLeaveInfo leaveInfo = new EmpLeaveInfo(); |
| | | leaveInfo.setLeaveId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | leaveInfo.setEmpNumb(list.get(0).toString()); |
| | | List<Dept> depts = CastUtil.castList(redisService.get("depts"), Dept.class); |
| | | Long deptId = depts.stream().filter(d -> d.getDeptName().equals(list.get(1).toString())).findFirst().get() |
| | | .getDeptId(); |
| | | Dept dept = depts.stream().filter(d -> d.getDeptName().equals(list.get(3).toString())).findFirst().orElse(null); |
| | | if (null == dept) { |
| | | returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}部门不存在",listObject.indexOf(list),list.get(3).toString())); |
| | | continue; |
| | | } |
| | | leaveInfo.setDeptName(list.get(1).toString()); |
| | | leaveInfo.setDeptId(deptId); |
| | | leaveInfo.setDeptId(dept.getDeptId()); |
| | | leaveInfo.setJobName(list.get(2).toString()); |
| | | leaveInfo.setEmpName(list.get(3).toString()); |
| | | leaveInfo.setCertificateNumb(list.get(4).toString()); |
| | |
| | | |
| | | return list; |
| | | } |
| | | } |
| | | } |