|
@@ -17,6 +17,7 @@ import org.springblade.business.feign.ImageClassificationFileClient;
|
|
|
import org.springblade.business.feign.InformationQueryClient;
|
|
|
import org.springblade.business.vo.TreeVoTwo;
|
|
|
import org.springblade.business.vo.TrialSelfInspectionRecordFileVO;
|
|
|
+import org.springblade.common.utils.CommonUtil;
|
|
|
import org.springblade.common.utils.ForestNodeMergerEx;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
@@ -32,12 +33,14 @@ import org.springblade.manager.service.*;
|
|
|
import org.springblade.manager.utils.ForestNodeMerger;
|
|
|
import org.springblade.manager.vo.*;
|
|
|
import org.springblade.resource.entity.Attach;
|
|
|
+import org.springblade.resource.feign.CommonFileClient;
|
|
|
import org.springblade.system.entity.DictBiz;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.ZoneId;
|
|
@@ -79,6 +82,8 @@ public class ArchiveTreeContractSyncImpl {
|
|
|
|
|
|
private final JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
+ private final CommonFileClient commonFileClient;
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -617,7 +622,9 @@ public class ArchiveTreeContractSyncImpl {
|
|
|
}
|
|
|
//生成新增的归档文件
|
|
|
ArchiveFile archiveFile = getArchiveFile(info,nodeId,info.getWbsId(),contractIndfo,classify);
|
|
|
- newArchiveFiles.add(archiveFile);
|
|
|
+ if (archiveFile != null) {
|
|
|
+ newArchiveFiles.add(archiveFile);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//刷新文件
|
|
@@ -751,8 +758,32 @@ public class ArchiveTreeContractSyncImpl {
|
|
|
archiveFile.setClassify(classify);
|
|
|
|
|
|
//
|
|
|
- archiveFile.setEVisaFile(query.getEVisaPdfUrl());
|
|
|
- archiveFile.setPdfFileUrl(query.getEVisaPdfUrl());
|
|
|
+ if (StringUtils.isNotEmpty(query.getNodePdfUrl())) {
|
|
|
+ archiveFile.setEVisaFile(query.getNodePdfUrl());
|
|
|
+ archiveFile.setPdfFileUrl(query.getNodePdfUrl());
|
|
|
+ }else {
|
|
|
+ archiveFile.setEVisaFile(query.getEVisaPdfUrl());
|
|
|
+ archiveFile.setPdfFileUrl(query.getEVisaPdfUrl());
|
|
|
+ }
|
|
|
+
|
|
|
+ //没有地址的不同步
|
|
|
+ if (StringUtils.isEmpty(archiveFile.getPdfFileUrl())) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(archiveFile.getPdfFileUrl()) && (archiveFile.getFileSize()== null || archiveFile.getFileSize()==0L)) {
|
|
|
+ try {
|
|
|
+ String pdfPage = "";
|
|
|
+ Long pdfSize = 0L;
|
|
|
+ pdfPage = commonFileClient.getPdfNum(archiveFile.getPdfFileUrl());
|
|
|
+ pdfSize = CommonUtil.getResourceLength(archiveFile.getPdfFileUrl());
|
|
|
+ archiveFile.setFileSize(pdfSize);
|
|
|
+ archiveFile.setFilePage(Integer.valueOf(pdfPage));
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
archiveFile.setSort(query.getSort());
|
|
|
return archiveFile;
|
|
|
}
|