|
@@ -117,6 +117,7 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
|
|
|
|
|
|
for (WmReport report : records){
|
|
for (WmReport report : records){
|
|
|
|
|
|
|
|
+ // word报告状态
|
|
WmReportOpt opt = new WmReportOpt();
|
|
WmReportOpt opt = new WmReportOpt();
|
|
|
|
|
|
// 获取生成记录
|
|
// 获取生成记录
|
|
@@ -134,6 +135,11 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
|
|
opt.setStatus(WmReportOpt.WmReportOptStatus.ERROR);
|
|
opt.setStatus(WmReportOpt.WmReportOptStatus.ERROR);
|
|
opt.setErrorMsg(o.split(StrUtil.UNDERLINE)[1]);
|
|
opt.setErrorMsg(o.split(StrUtil.UNDERLINE)[1]);
|
|
}
|
|
}
|
|
|
|
+ // 生成失败的2
|
|
|
|
+ else if (!o.startsWith("http")) {
|
|
|
|
+ opt.setStatus(WmReportOpt.WmReportOptStatus.ERROR);
|
|
|
|
+ opt.setErrorMsg(o);
|
|
|
|
+ }
|
|
// 成功的
|
|
// 成功的
|
|
else {
|
|
else {
|
|
Long expire = redisTemplate.opsForValue().getOperations().getExpire(key, TimeUnit.SECONDS);
|
|
Long expire = redisTemplate.opsForValue().getOperations().getExpire(key, TimeUnit.SECONDS);
|
|
@@ -149,6 +155,45 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
|
|
}
|
|
}
|
|
report.setReportOpt(opt);
|
|
report.setReportOpt(opt);
|
|
|
|
|
|
|
|
+
|
|
|
|
+ // excel报告状态
|
|
|
|
+ WmReportOpt excelPpt = new WmReportOpt();
|
|
|
|
+
|
|
|
|
+ // 获取生成记录
|
|
|
|
+ String excelKey = String.format(CacheConstants.EXCEL_EXPORT_NB_REPORT_CACHE, report.getId());
|
|
|
|
+ String excelO = redisTemplate.opsForValue().get(excelKey);
|
|
|
|
+
|
|
|
|
+ if (StrUtil.isNotEmpty(excelO)) {
|
|
|
|
+
|
|
|
|
+ // 生成中的
|
|
|
|
+ if ("GENERATING".equals(excelO)) {
|
|
|
|
+ excelPpt.setStatus(WmReportOpt.WmReportOptStatus.GENERATING);
|
|
|
|
+ }
|
|
|
|
+ // 生成失败的
|
|
|
|
+ else if (excelO.startsWith("ERROR")) {
|
|
|
|
+ excelPpt.setStatus(WmReportOpt.WmReportOptStatus.ERROR);
|
|
|
|
+ excelPpt.setErrorMsg(excelO.split(StrUtil.UNDERLINE)[1]);
|
|
|
|
+ }
|
|
|
|
+ // 生成失败的2
|
|
|
|
+ else if (!excelO.startsWith("http")) {
|
|
|
|
+ excelPpt.setStatus(WmReportOpt.WmReportOptStatus.ERROR);
|
|
|
|
+ excelPpt.setErrorMsg(excelO);
|
|
|
|
+ }
|
|
|
|
+ // 成功的
|
|
|
|
+ else {
|
|
|
|
+ Long expire = redisTemplate.opsForValue().getOperations().getExpire(excelKey, TimeUnit.SECONDS);
|
|
|
|
+ excelPpt.setStatus(WmReportOpt.WmReportOptStatus.GENERATED);
|
|
|
|
+ excelPpt.setTtl(LocalDateTime.now().plusSeconds(expire));
|
|
|
|
+ // o = "https://pre.yaoyi.net/admin/sys-file/wmkj/兼职学术信息沟通专员业绩报告(2249)-20211116191527.doc";
|
|
|
|
+ excelPpt.setLatestUrl(excelO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ excelPpt.setStatus(WmReportOpt.WmReportOptStatus.NOT_GENERATE);
|
|
|
|
+ }
|
|
|
|
+ report.setExcelReportOpt(excelPpt);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
return reportListPage;
|
|
return reportListPage;
|