| | |
| | | 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.collection.ListUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | 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); |
| | | } |
| | | } |