|
@@ -80,7 +80,7 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
|
|
|
private final WmDaDistributionService wmDaDistributionService;
|
|
|
private final WmDaPharmacyService wmDaPharmacyService;
|
|
|
private final WmDaHospitalService wmDaHospitalService;
|
|
|
- private final RedisTemplate<String,Object> redisTemplate;
|
|
|
+ private final RedisTemplate<String,String> redisTemplate;
|
|
|
|
|
|
@Override
|
|
|
public IPage<WmReport> getReportListPage(Page page, WmReport wmReport, String scoreId, String name){
|
|
@@ -94,14 +94,27 @@ public class WmReportServiceImpl extends ServiceImpl<WmReportMapper, WmReport> i
|
|
|
|
|
|
// 获取生成记录
|
|
|
String key = String.format(CacheConstants.EXPORT_NB_REPORT_CACHE, report.getScoreId());
|
|
|
- String o = (String) redisTemplate.opsForValue().get(key);
|
|
|
+ String o = redisTemplate.opsForValue().get(key);
|
|
|
|
|
|
if (StrUtil.isNotEmpty(o)) {
|
|
|
|
|
|
- Long expire = redisTemplate.opsForValue().getOperations().getExpire(key, TimeUnit.SECONDS);
|
|
|
- opt.setStatus(WmReportOpt.WmReportOptStatus.GENERATED);
|
|
|
- opt.setTtl(LocalDateTime.now().plusSeconds(expire));
|
|
|
- opt.setLatestUrl(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]);
|
|
|
+ }
|
|
|
+ // 成功的
|
|
|
+ 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 {
|