| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.api.R; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.Charset; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | List<File> fileList = new ArrayList<>(); |
| | | List<Multifile> multifileList = multifileJoinMapper.selectList(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .eq(Multifile::getObjId,id) |
| | | .isNotNull(Multifile::getFileurl) |
| | | .in(Multifile::getObjType, Arrays.asList(new Integer[]{ |
| | |
| | | if(fileList == null || fileList.size() == 0){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | String fileName = model.getInformantName() +"理赔资料下_"+System.currentTimeMillis()+".zip" ; |
| | | String encodeFileName = URLEncoder.encode(fileName); |
| | | String fileName = model.getInformantName() +"-理赔资料-" +System.currentTimeMillis(); |
| | | String encodeFileName =URLEncoder.encode(fileName, Charset.forName("UTF-8").toString())+".zip"; |
| | | response.setHeader("Content-Disposition","attachment;filename=" + encodeFileName); |
| | | response.setContentType("application/octet-stream"); |
| | | response.setHeader("eva-opera-type", "download"); |
| | | response.setHeader("eva-download-filename", encodeFileName); |
| | | Constants.packFilesToZip(fileList,response.getOutputStream()); |
| | | } catch (IOException e) { |
| | | } catch (Exception e) { |
| | | throw new BusinessException(ResponseStatus.EXPORT_EXCEL_ERROR, e); |
| | | } |
| | | } |