| | |
| | | throw new FebsException(message); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("image/{accessoryid}") |
| | | public void getImage(@PathVariable String accessoryid, HttpServletResponse response) throws FebsException { |
| | | try { |
| | | this.empAccessoryService.getImage(accessoryid,response); |
| | | } catch (Exception e) { |
| | | String message = "获取员工图片异常"; |
| | | log.error(message, e); |
| | | throw new FebsException(message); |
| | | } |
| | | } |
| | | } |
| | |
| | | throw new FebsException(message); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("image/{filesid}") |
| | | public void getImage(@PathVariable String filesid, HttpServletResponse response) throws FebsException { |
| | | try { |
| | | this.filesUploadService.getImage(filesid,response); |
| | | } catch (Exception e) { |
| | | String message = "获取员工图片异常"; |
| | | log.error(message, e); |
| | | throw new FebsException(message); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | void autoInstall(String fileids); |
| | | |
| | | void getImage(String accessoryid,HttpServletResponse response) throws Exception; |
| | | } |
| | |
| | | void download(String fileids, HttpServletRequest request, HttpServletResponse response); |
| | | |
| | | void mvFiles(String fileids,Long folderid); |
| | | |
| | | void getImage(String filesid,HttpServletResponse response) throws Exception; |
| | | } |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.*; |
| | | import java.util.*; |
| | | import java.util.logging.Logger; |
| | | |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void getImage(String accessoryid, HttpServletResponse response) throws Exception { |
| | | EmpAccessory empAccessory = this.getById(accessoryid); |
| | | if (StrUtil.isBlank(empAccessory.getFilesaddress())) { |
| | | return; |
| | | } |
| | | EmpBaseInfo empBaseInfo = empBaseInfoService.getById(empAccessory.getEmpid()); |
| | | String nameAndCertificateNumb = empBaseInfo.getEmpName() + "_" + empBaseInfo.getCertificateNumb() + "/"; |
| | | String path = properties.getUploadSinglePath() + nameAndCertificateNumb + empAccessory.getFilesaddress(); |
| | | try (InputStream inputStream = new FileInputStream(path); OutputStream out = response.getOutputStream()) { |
| | | //byte数组用于存放图片字节数据 |
| | | byte[] buff = new byte[inputStream.available()]; |
| | | inputStream.read(buff); |
| | | inputStream.close(); |
| | | if (empAccessory.getFilesformat().equals("tif")){ |
| | | //设置发送到客户端的响应内容类型 |
| | | response.setContentType("image/tiff"); |
| | | }else if (empAccessory.getFilesformat().equals("bmp")){ |
| | | response.setContentType("application/x-bmp"); |
| | | }else if (empAccessory.getFilesformat().equals("jpg")){ |
| | | response.setContentType("image/jpeg"); |
| | | }else if (empAccessory.getFilesformat().equals("png")){ |
| | | response.setContentType("image/png"); |
| | | }else if (empAccessory.getFilesformat().equals("gif")){ |
| | | response.setContentType("image/gif"); |
| | | } |
| | | out.write(buff); |
| | | } |
| | | } |
| | | } |
| | |
| | | List<EmpBaseInfo> exportList = this.findZsEmpBaseInfos(request, empBaseinfo).getRecords(); |
| | | List<Map<String, Object>> listMapDicItem = new ArrayList(); |
| | | listMapDicItem.add(map); |
| | | String exportField = FebsUtil.reflectAnnotation(EmpBaseInfo.class); |
| | | List<Map<String, Object>> allList = PoiExportExcel.getDataList(exportField, exportList, listMapDicItem); |
| | | String exportField = "archivesNumb, deptName, jobName, empName, certificateNumb, certificateValidity, sexName, nationName, age, marriageName, stature, birthdate, politicsName, empTypeName, educationName, nativePlaceName, censusAddress, currentAddress, guardNumb, returnReceipt, archivesStatusName, bankName, bankNumb, telePhone, entryDate, InsuranceTypeName, socialNumb, introducer, seniority, empCardStatusName, certificateList, urgencyPhone, handbookStatusName, family, empStatusName, dimissionDate"; |
| | | List<Map<String, Object>> allList = PoiExportExcel.getDataList(exportField, exportList, null); |
| | | Page<EmpBaseInfo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | List<Long> empIds = exportList.stream().map(i -> i.getEmpId()).collect(Collectors.toList()); |
| | | |
| | |
| | | this.update(wapper); |
| | | |
| | | } |
| | | @Override |
| | | public void getImage(String filesid, HttpServletResponse response) throws Exception { |
| | | FilesUpload filesUpload = this.getById(filesid); |
| | | if (StrUtil.isBlank(filesUpload.getFilesaddress())) { |
| | | return; |
| | | } |
| | | Folder folder = iFolderService.getById(filesUpload.getFolderid()); |
| | | String path = properties.getUploadCommonPath() + folder.getFoldername() + "/" + filesUpload.getFilesaddress(); |
| | | try (InputStream inputStream = new FileInputStream(path); OutputStream out = response.getOutputStream()) { |
| | | //byte数组用于存放图片字节数据 |
| | | byte[] buff = new byte[inputStream.available()]; |
| | | inputStream.read(buff); |
| | | inputStream.close(); |
| | | if (filesUpload.getFilesformat().equals("tif")){ |
| | | //设置发送到客户端的响应内容类型 |
| | | response.setContentType("image/tiff"); |
| | | }else if (filesUpload.getFilesformat().equals("bmp")){ |
| | | response.setContentType("application/x-bmp"); |
| | | }else if (filesUpload.getFilesformat().equals("jpg")){ |
| | | response.setContentType("image/jpeg"); |
| | | }else if (filesUpload.getFilesformat().equals("png")){ |
| | | response.setContentType("image/png"); |
| | | }else if (filesUpload.getFilesformat().equals("gif")){ |
| | | response.setContentType("image/gif"); |
| | | } |
| | | out.write(buff); |
| | | } |
| | | } |
| | | |
| | | |
| | | |