|
|
@@ -12,6 +12,7 @@ import com.lowagie.text.pdf.PdfPTable;
|
|
|
import com.lowagie.text.pdf.PdfWriter;
|
|
|
import com.xunmei.common.core.constant.CacheConstants;
|
|
|
import com.xunmei.common.core.domain.IdName;
|
|
|
+import com.xunmei.common.core.domain.SysOrgCacheVo;
|
|
|
import com.xunmei.common.core.domain.registerbook.dto.CoreRegisterBookPdfExportDto;
|
|
|
import com.xunmei.common.core.domain.registerbook.dto.ExportPdfDto;
|
|
|
import com.xunmei.common.core.domain.registerbook.vo.CoreRegisterBookPdfPageVo;
|
|
|
@@ -612,7 +613,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
|
|
|
response.setContentType("application/octet-stream");
|
|
|
response.setHeader("Content-Disposition", "attachment; filename=" + zipName);
|
|
|
List<PdfToZipTempVo> pdfToZipTempVoList = registerBookPdfList.parallelStream().map(pdf -> {
|
|
|
- return resolve(pdf, pdfDto, count);
|
|
|
+ return resolve(pdf, count);
|
|
|
}).filter(Objects::nonNull)
|
|
|
.collect(Collectors.toList());
|
|
|
count.await();
|
|
|
@@ -639,7 +640,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public PdfToZipTempVo resolve(CoreRegisterBookPdfPageVo pdf, ExportPdfDto pdfDto, CountDownLatch count) {
|
|
|
+ public PdfToZipTempVo resolve(CoreRegisterBookPdfPageVo pdf,CountDownLatch count) {
|
|
|
|
|
|
final File temp = new File(TEMP_DIR_NAME);
|
|
|
if (!temp.exists()) {
|
|
|
@@ -710,13 +711,13 @@ public class LocalSysFileServiceImpl implements ISysFileService {
|
|
|
|
|
|
@Override
|
|
|
public void cutFileCompress(CoreRegisterBookPdfExportDto pdfDto) {
|
|
|
- //List<SysOrgCacheVo> cacheList = RedisUtils.getCacheList(CacheConstants.ORG_CACHE_LIST_KEY);
|
|
|
+ List<SysOrgCacheVo> cacheList = pdfDto.getOrgList();
|
|
|
|
|
|
// String orgName = objectMapper.selectOrgNameById(pdfDto.getOrgId());
|
|
|
Date date = new Date();
|
|
|
|
|
|
|
|
|
- SysOrg org = getOrg(pdfDto.getOrgId());
|
|
|
+ SysOrgCacheVo org = pdfDto.getOrg();
|
|
|
String fileName = pdfDto.getIsRegisterBookPage() ? org.getName() + "_登记簿_" : org.getName() + "_数据报表_";
|
|
|
|
|
|
//判断需要分几片导出
|
|
|
@@ -731,7 +732,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
|
|
|
zipName = URLEncoder.encode(fileNameStr + ".zip", "UTF-8");
|
|
|
|
|
|
List<PdfToZipTempVo> pdfToZipTempVoList = list.parallelStream().map(pdf -> {
|
|
|
- return resolve(pdf, null, count);
|
|
|
+ return resolve(pdf, count);
|
|
|
}).filter(Objects::nonNull)
|
|
|
.collect(Collectors.toList());
|
|
|
pdfToZipTempVoList.removeIf(pdfToZipTempVo -> !FileUtil.exist(pdfToZipTempVo.getFile()));
|
|
|
@@ -789,12 +790,12 @@ public class LocalSysFileServiceImpl implements ISysFileService {
|
|
|
return list;
|
|
|
}
|
|
|
// List<SysOrg> orgList = orgService.selectSysOrgByParentId(pdfDto.getOrgId(), SecurityConstants.INNER);
|
|
|
- List<SysOrg> orgList = new ArrayList<>();
|
|
|
+ List<SysOrgCacheVo> orgList = pdfDto.getOrgList();
|
|
|
//大于3000条需要分片
|
|
|
return splitList(registerBookPdfList, orgList, 3000);
|
|
|
}
|
|
|
|
|
|
- public static List<List<CoreRegisterBookPdfPageVo>> splitList(List<CoreRegisterBookPdfPageVo> list, List<SysOrg> orgList, int size) {
|
|
|
+ public static List<List<CoreRegisterBookPdfPageVo>> splitList(List<CoreRegisterBookPdfPageVo> list, List<SysOrgCacheVo> orgList, int size) {
|
|
|
// 根据机构分组
|
|
|
List<List<CoreRegisterBookPdfPageVo>> collect = orgList.stream().map(org -> {
|
|
|
List<CoreRegisterBookPdfPageVo> arrayList = new ArrayList<>();
|