|
@@ -2723,6 +2723,9 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
// 封装excel报告状态
|
|
// 封装excel报告状态
|
|
this.getExcelReportOpt(wmScorePackage, CacheConstants.EXCEL_EXPORT_NBA_REPORT_CACHE);
|
|
this.getExcelReportOpt(wmScorePackage, CacheConstants.EXCEL_EXPORT_NBA_REPORT_CACHE);
|
|
|
|
|
|
|
|
+ // 封装新版报告状态
|
|
|
|
+ this.getNewReportOpt(wmScorePackage, CacheConstants.NEW_NBA_REPORT_CACHE);
|
|
|
|
+
|
|
// 企业大包终止条件判断
|
|
// 企业大包终止条件判断
|
|
int relatedPackageCount = this.count(Wrappers.<WmScorePackage>lambdaQuery()
|
|
int relatedPackageCount = this.count(Wrappers.<WmScorePackage>lambdaQuery()
|
|
.eq(WmScorePackage::getRelationScoreId, wmScorePackage.getId())
|
|
.eq(WmScorePackage::getRelationScoreId, wmScorePackage.getId())
|
|
@@ -2832,6 +2835,53 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 查询新版报告导出状态
|
|
|
|
+ *
|
|
|
|
+ * @param wmScorePackage 积分包
|
|
|
|
+ * @param reportCacheKey 缓存key
|
|
|
|
+ * @return 状态结果
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public WmReportOpt getNewReportOpt(WmScorePackage wmScorePackage, String reportCacheKey) {
|
|
|
|
+ WmReportOpt opt = new WmReportOpt();
|
|
|
|
+
|
|
|
|
+ // 获取生成记录
|
|
|
|
+ String key = String.format(reportCacheKey, wmScorePackage.getId());
|
|
|
|
+ String o = redisTemplate.opsForValue().get(key);
|
|
|
|
+
|
|
|
|
+ if (StrUtil.isNotEmpty(o)) {
|
|
|
|
+
|
|
|
|
+ // 生成中的
|
|
|
|
+ if ("GENERATING".equals(o)) {
|
|
|
|
+ opt.setStatus(WmReportOpt.WmReportOptStatus.GENERATING);
|
|
|
|
+ }
|
|
|
|
+ // 生成失败的
|
|
|
|
+ else if (o.startsWith("ERROR")) {
|
|
|
|
+ opt.setStatus(WmReportOpt.WmReportOptStatus.ERROR);
|
|
|
|
+ opt.setErrorMsg(o.split(StrUtil.UNDERLINE)[1]);
|
|
|
|
+ }
|
|
|
|
+ // 生成失败的2
|
|
|
|
+ else if (!o.startsWith("http")) {
|
|
|
|
+ opt.setStatus(WmReportOpt.WmReportOptStatus.ERROR);
|
|
|
|
+ opt.setErrorMsg(o);
|
|
|
|
+ }
|
|
|
|
+ // 成功的
|
|
|
|
+ else {
|
|
|
|
+ Long expire = redisTemplate.opsForValue().getOperations().getExpire(key, TimeUnit.SECONDS);
|
|
|
|
+ opt.setStatus(WmReportOpt.WmReportOptStatus.GENERATED);
|
|
|
|
+ opt.setTtl(LocalDateTime.now().plusSeconds(expire));
|
|
|
|
+ // o = "https://pre.yaoyi.net/admin/sys-file/wmkj/兼职学术信息沟通专员业绩报告(2249)-20211116191527.doc";
|
|
|
|
+ opt.setLatestUrl(o);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ opt.setStatus(WmReportOpt.WmReportOptStatus.NOT_GENERATE);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return opt;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 校验积分包是否可以结算
|
|
* 校验积分包是否可以结算
|
|
*
|
|
*
|