| | |
| | | import cc.mrbird.febs.server.hr.service.IEmpDimissionLogService; |
| | | import cc.mrbird.febs.server.hr.service.IEmpJobChangeService; |
| | | 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.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | */ |
| | | private List<EmpBaseInfo> setDeptName(List<EmpBaseInfo> empBaseInfoList) { |
| | | List<Dept> depts = CastUtil.castList(redisService.get("depts"), Dept.class); |
| | | if(null == depts){ |
| | | depts =remoteDeptService.setDeptRedis(); |
| | | } |
| | | for (EmpBaseInfo empBaseInfo : empBaseInfoList) { |
| | | // 设置部门 |
| | | empBaseInfo.setDeptName(depts.stream() |
| | |
| | | empBaseInfo.setEmpNumb(list.get(1).toString()); |
| | | |
| | | List<Dept> depts = CastUtil.castList(redisService.get("depts"), Dept.class); |
| | | if(null == depts){ |
| | | depts =remoteDeptService.setDeptRedis(); |
| | | } |
| | | if(null == depts){ |
| | | depts =remoteDeptService.setDeptRedis(); |
| | | } |
| | | empBaseInfo.setDeptName(list.get(2).toString()); |
| | | Dept dept = depts.stream().filter(d -> d.getDeptName().equals(list.get(2).toString())).findFirst().orElse(null); |
| | | if (null == dept) { |
| | |
| | | |
| | | empBaseInfo.setCensusAddress(list.get(15).toString()); |
| | | empBaseInfo.setCurrentAddress(list.get(16).toString()); |
| | | |
| | | //员工类型 |
| | | dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"empType")&&StrUtil.equals(j.getDicItemName(),list.get(17).toString())).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | empBaseInfo.setEmpType(dicItem.getDicItemCode()); |
| | |
| | | empBaseInfo.setEmpCardStatus(dicItem.getDicItemCode()); |
| | | } |
| | | |
| | | //相关证件 |
| | | List<DicItem> dicItemList = new ArrayList<>(); |
| | | String[] certificateList = list.get(30).toString().split(StringConstant.COMMA); |
| | | if (null != certificateList){ |
| | | for (String s : certificateList) { |
| | | dicItem = dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"certificateList")&&StrUtil.equals(j.getDicItemName(),s)).findFirst().orElse(null); |
| | | if (null!=dicItem){ |
| | | dicItemList.add(dicItem); |
| | | } |
| | | } |
| | | } |
| | | |
| | | empBaseInfo.setCertificateList(list.get(30).toString()); |
| | | if(CollUtil.isNotEmpty(dicItemList)){ |
| | | empBaseInfo.setCertificateList(dicItemList.stream().map(i->i.getDicItemCode()).collect(Collectors.joining(StringConstant.COMMA))); |
| | | } |
| | | |
| | | |
| | | empBaseInfo.setDelFlag(2); |
| | | //入职类型 |
| | | dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"lztype")&&StrUtil.equals(j.getDicItemName(),list.get(31).toString())).findFirst().orElse(null); |
| | |
| | | if (StrUtil.isBlank(empBaseInfo.getImagePath())) { |
| | | return; |
| | | } |
| | | String path = properties.getEmpBaseInfoPath() + empBaseInfo.getEmpId() + ".png"; |
| | | String path = properties.getEmpBaseInfoPath() + empBaseInfo.getImagePath(); |
| | | try (InputStream inputStream = new FileInputStream(path); OutputStream out = response.getOutputStream()) { |
| | | |
| | | //byte数组用于存放图片字节数据 |
| | |
| | | inputStream.read(buff); |
| | | inputStream.close(); |
| | | |
| | | //设置发送到客户端的响应内容类型 |
| | | response.setContentType("image/png"); |
| | | |
| | | String contentType = empBaseInfo.getImagePath().substring(empBaseInfo.getImagePath().indexOf(".")+1); |
| | | if (contentType.equals("tif")){ |
| | | //设置发送到客户端的响应内容类型 |
| | | response.setContentType("image/tiff"); |
| | | }else if (contentType.equals("bmp")){ |
| | | response.setContentType("application/x-bmp"); |
| | | }else if (contentType.equals("jpg")){ |
| | | response.setContentType("image/jpeg"); |
| | | }else if (contentType.equals("gif")){ |
| | | response.setContentType("image/gif"); |
| | | }else{ |
| | | response.setContentType("image/png"); |
| | | } |
| | | out.write(buff); |
| | | } |
| | | } |