| | |
| | | import cc.mrbird.febs.server.hr.util.PoiExportExcel; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | @Override |
| | | public IPage<EmpBaseInfo> findZsEmpBaseInfos(QueryRequest request, EmpBaseInfo empBaseInfo) { |
| | | Page<EmpBaseInfo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | SortUtil.handlePageSort(request, page, "createTime", FebsConstant.ORDER_DESC, true); |
| | | SortUtil.handlePageSort(request, page, "entryDate", FebsConstant.ORDER_ASC, true); |
| | | IPage<EmpBaseInfo> iPage = empBaseInfoMapper.selectPageVo(page, createQueryWrapper(empBaseInfo)); |
| | | //设置部门 |
| | | // List<EmpBaseInfo> list = setDeptName(iPage.getRecords()); |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateEmpBaseInfo(EmpBaseInfo empBaseInfo) { |
| | | String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1"); |
| | | if (StrUtil.isNotBlank(empBaseInfo.getImagePath())) { |
| | | if (StrUtil.isNotBlank(empBaseInfo.getImagePath())&&empBaseInfo.getImagePath().indexOf(",")>0) { |
| | | String path = properties.getEmpBaseInfoPath() + empBaseInfo.getEmpId() + ".png"; |
| | | if (MyUtil.generateImage(empBaseInfo.getImagePath(), path)) { |
| | | empBaseInfo.setImagePath(empBaseInfo.getEmpId() + ".png"); |
| | |
| | | empBaseInfo.setJobId(position.getPositionId()); |
| | | empBaseInfo.setJobName(list.get(3).toString()); |
| | | empBaseInfo.setEmpName(list.get(4).toString()); |
| | | empBaseInfo.setCertificateNumb(list.get(5).toString()); |
| | | try { |
| | | if(StrUtil.isNotBlank(list.get(5).toString())){ |
| | | empBaseInfo.setCertificateNumb(list.get(5).toString()); |
| | | if (IdcardUtil.isValidCard(list.get(5).toString())){ |
| | | empBaseInfo.setAge(IdcardUtil.getAgeByIdCard(list.get(5).toString())); |
| | | empBaseInfo.setBirthdate(IdcardUtil.getBirthDate(list.get(5).toString())); |
| | | } |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | log.error("导入人员身份证异常:{}",e); |
| | | returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}检查身份证是否正确", listObject.indexOf(list) + 1, list.get(5).toString())); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | empBaseInfo.setSex("男".equals(list.get(6).toString()) ? "1" : "2"); |
| | | |
| | | //民族 |