|
@@ -56,22 +56,28 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
@Async
|
|
@Async
|
|
@Override
|
|
@Override
|
|
public void pushStatusBySocket(Long userId,Long id) throws IOException, InterruptedException {
|
|
public void pushStatusBySocket(Long userId,Long id) throws IOException, InterruptedException {
|
|
- Integer status;
|
|
|
|
- //获取检测状态,如果正在检测,则一直推送
|
|
|
|
|
|
+ Integer status=1;
|
|
|
|
+ Date date = new Date();
|
|
|
|
+ //获取检测状态,如果正在检测,则数据变化时发送
|
|
do {
|
|
do {
|
|
- Thread.sleep(5000L);
|
|
|
|
- //获取最新检测的状态
|
|
|
|
|
|
+ Thread.sleep(4000L);
|
|
|
|
+ //判断报告状态
|
|
ArchiveExaminingReport report = this.getById(id);
|
|
ArchiveExaminingReport report = this.getById(id);
|
|
- status = report.getStatus();
|
|
|
|
- //获取检测详情
|
|
|
|
- List<ArchiveExaminingReportDetail> list = detailService.list(new LambdaQueryWrapper<ArchiveExaminingReportDetail>()
|
|
|
|
- .eq(ArchiveExaminingReportDetail::getReportId, id));
|
|
|
|
- for (ArchiveExaminingReportDetail detail : list) {
|
|
|
|
- detail.setExaminingItem(detail.getExaminingType()+":"+detail.getExaminingItem());
|
|
|
|
|
|
+ Integer reportStatus = report.getStatus();
|
|
|
|
+ //判断详情状态
|
|
|
|
+ ArchiveExaminingReportDetail detail = detailService.getOne(new LambdaQueryWrapper<ArchiveExaminingReportDetail>()
|
|
|
|
+ .eq(ArchiveExaminingReportDetail::getReportId, id)
|
|
|
|
+ .orderByDesc(ArchiveExaminingReportDetail::getCreateTime)
|
|
|
|
+ .last("limit 1"));
|
|
|
|
+ if (detail == null){
|
|
|
|
+ detail = new ArchiveExaminingReportDetail();
|
|
|
|
+ detail.setCreateTime(date);
|
|
|
|
+ }
|
|
|
|
+ if (reportStatus != status || detail.getCreateTime() != date){
|
|
|
|
+ webSocketServer.sendMessagesToArchive(userId+"","true");
|
|
|
|
+ status = reportStatus;
|
|
|
|
+ date = detail.getCreateTime();
|
|
}
|
|
}
|
|
- ArchiveExaminingSocketVo vo = new ArchiveExaminingSocketVo(status,list);
|
|
|
|
- webSocketServer.sendMessagesToArchive(userId+"", JSON.toJSONString(vo));
|
|
|
|
- status = report.getStatus();
|
|
|
|
}while (status != 4);
|
|
}while (status != 4);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -90,7 +96,7 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
//检测中
|
|
//检测中
|
|
//真实性
|
|
//真实性
|
|
if (StringUtils.isNotBlank(vo.getAuthenticity()) && "1".equals(vo.getAuthenticity())) {
|
|
if (StringUtils.isNotBlank(vo.getAuthenticity()) && "1".equals(vo.getAuthenticity())) {
|
|
- Thread.sleep(7000L);
|
|
|
|
|
|
+ Thread.sleep(5000L);
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测", 0, "无", 0));
|
|
ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对固化信息有效性检测", 0, "无", 0));
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_AUTHENTICITY,
|
|
@@ -117,7 +123,7 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子档案封装包电子前面有效性检测", 0, "无", 0));
|
|
ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对电子档案封装包电子前面有效性检测", 0, "无", 0));
|
|
}
|
|
}
|
|
if (StringUtils.isNotBlank(vo.getIntegrality()) && "1".equals(vo.getIntegrality())) {
|
|
if (StringUtils.isNotBlank(vo.getIntegrality()) && "1".equals(vo.getIntegrality())) {
|
|
- Thread.sleep(7000L);
|
|
|
|
|
|
+ Thread.sleep(5000L);
|
|
//完整性
|
|
//完整性
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_INTEGRALITY,
|
|
ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对总件数相符性检测", 0, "无", 0));
|
|
ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对总件数相符性检测", 0, "无", 0));
|
|
@@ -144,7 +150,7 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
}
|
|
}
|
|
//可用性
|
|
//可用性
|
|
if (StringUtils.isNotBlank(vo.getUsability()) && "1".equals(vo.getUsability())) {
|
|
if (StringUtils.isNotBlank(vo.getUsability()) && "1".equals(vo.getUsability())) {
|
|
- Thread.sleep(7000L);
|
|
|
|
|
|
+ Thread.sleep(5000L);
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包中元数据的可读性检测", 0, "无", 0));
|
|
ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对信息包中元数据的可读性检测", 0, "无", 0));
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_USABILITY,
|
|
@@ -164,7 +170,7 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
}
|
|
}
|
|
//安全性
|
|
//安全性
|
|
if (StringUtils.isNotBlank(vo.getSecurity()) && "1".equals(vo.getSecurity())) {
|
|
if (StringUtils.isNotBlank(vo.getSecurity()) && "1".equals(vo.getSecurity())) {
|
|
- Thread.sleep(7000L);
|
|
|
|
|
|
+ Thread.sleep(5000L);
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
|
|
ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对系统环境中是否安装杀毒软件检测", 0, "无", 0));
|
|
ArchiveConstant.ARCHIVE_EXAMINING_STANDARD + "对系统环境中是否安装杀毒软件检测", 0, "无", 0));
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
|
|
detailService.save(new ArchiveExaminingReportDetail(vo.getProjectId(), id, ArchiveConstant.ARCHIVE_EXAMINING_SECURITY,
|
|
@@ -174,13 +180,32 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
report.setStatus(3);
|
|
report.setStatus(3);
|
|
this.updateById(report);
|
|
this.updateById(report);
|
|
String url = this.generateReportPdf(id);
|
|
String url = this.generateReportPdf(id);
|
|
- Thread.sleep(7000L);
|
|
|
|
|
|
+ Thread.sleep(3000L);
|
|
//完成
|
|
//完成
|
|
report.setReportPdfUrl(url);
|
|
report.setReportPdfUrl(url);
|
|
report.setStatus(4);
|
|
report.setStatus(4);
|
|
this.updateById(report);
|
|
this.updateById(report);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取最新的文档状态和详情
|
|
|
|
+ * @param reportId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public ArchiveExaminingSocketVo getCurrentExaminingInfo(Long reportId) {
|
|
|
|
+ //获取最新检测的状态
|
|
|
|
+ ArchiveExaminingReport report = this.getById(reportId);
|
|
|
|
+ //获取检测详情
|
|
|
|
+ List<ArchiveExaminingReportDetail> list = detailService.list(new LambdaQueryWrapper<ArchiveExaminingReportDetail>()
|
|
|
|
+ .eq(ArchiveExaminingReportDetail::getReportId, reportId));
|
|
|
|
+ for (ArchiveExaminingReportDetail detail : list) {
|
|
|
|
+ detail.setExaminingItem(detail.getExaminingType()+":"+detail.getExaminingItem());
|
|
|
|
+ }
|
|
|
|
+ ArchiveExaminingSocketVo vo = new ArchiveExaminingSocketVo(report.getStatus(),report.getReportPdfUrl(),list);
|
|
|
|
+ return vo;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 生成检测报告PDF
|
|
* 生成检测报告PDF
|
|
*/
|
|
*/
|
|
@@ -189,6 +214,7 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
int widthPercentage = 100;
|
|
int widthPercentage = 100;
|
|
String uuid = StringUtil.randomUUID();
|
|
String uuid = StringUtil.randomUUID();
|
|
String localUrl = "/www/wwwroot/Users/hongchuangyanfa/Desktop/archiveExaminingPdf/";
|
|
String localUrl = "/www/wwwroot/Users/hongchuangyanfa/Desktop/archiveExaminingPdf/";
|
|
|
|
+// String localUrl = "D:\\develop\\test\\";
|
|
//新建一个pdf文档对象,前一个参数是纸张大小,后四个为边距
|
|
//新建一个pdf文档对象,前一个参数是纸张大小,后四个为边距
|
|
Document document = new Document(PageSize.A4, 5, 5, 30, 30);
|
|
Document document = new Document(PageSize.A4, 5, 5, 30, 30);
|
|
//建立一个书写器
|
|
//建立一个书写器
|
|
@@ -255,7 +281,11 @@ public class ArchiveExaminingReportImpl extends BaseServiceImpl<ArchiveExamining
|
|
document.close();
|
|
document.close();
|
|
writer.close();
|
|
writer.close();
|
|
BladeFile bladeFile = iossClient.uploadFile(uuid+".pdf", localUrl+uuid+".pdf");
|
|
BladeFile bladeFile = iossClient.uploadFile(uuid+".pdf", localUrl+uuid+".pdf");
|
|
- return bladeFile.getLink();
|
|
|
|
|
|
+ if (bladeFile != null && StringUtils.isNotBlank(bladeFile.getLink())){
|
|
|
|
+ return bladeFile.getLink();
|
|
|
|
+ }else {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|