Commit 8e85a6d9 by shenjunjie

Merge branch 'feature' into 'release'

调整简报竞品格式2

See merge request !205
parents d6ea0dc4 b60202fc
package com.zhiwei.brandkbs2.controller.app;
import com.alibaba.fastjson.JSONObject;
import com.zhiwei.brandkbs2.auth.Auth;
import com.zhiwei.brandkbs2.auth.UserThreadLocal;
import com.zhiwei.brandkbs2.controller.BaseController;
......@@ -53,9 +54,10 @@ public class AppContendController extends BaseController {
@ApiOperation("竞品库-竞品对比-传播分析页面")
@PostMapping("/spread/analyze")
public ResponseResult getSpreadAnalyze(@RequestParam(value = "startTime", required = false) Long startTime,
@RequestParam(value = "endTime", required = false) Long endTime,
@RequestParam(value = "contendId") String contendId) throws IOException {
public ResponseResult getSpreadAnalyze(@RequestBody JSONObject json) throws IOException {
Long startTime = json.getLong("startTime");
Long endTime = json.getLong("endTime");
String contendId = json.getString("contendId");
return ResponseResult.success(markDataService.getContendSpreadAnalyze(startTime, endTime, UserThreadLocal.getProjectId(), contendId, 5, true));
}
......
......@@ -213,7 +213,6 @@ public class ReportServiceImpl implements ReportService {
@Override
public JSONObject getPcReportAnalyze(String id, boolean cache) {
switchReportStatus(id, false);
return getPcReportAnalyze(reportDao.findOneById(id), cache);
}
......@@ -295,7 +294,6 @@ public class ReportServiceImpl implements ReportService {
reportDao.insertOneWithoutId(report);
ApplicationProjectListener.getThreadPool().execute(() -> {
getPcReportAnalyze(report.getId(), false);
switchReportStatus(report.getId(), true);
});
}
......@@ -336,6 +334,7 @@ public class ReportServiceImpl implements ReportService {
* @return 月报结果
*/
private JSONObject getPcReportResult(Report report) throws IOException {
switchReportStatus(report.getId(), false);
log.info("getPcReportResult-生成报告开始,id:{}", report.getId());
Long startTime = report.getStartTime();
Long endTime = report.getEndTime();
......@@ -367,6 +366,7 @@ public class ReportServiceImpl implements ReportService {
}).collect(Collectors.toList());
result.put("contendCompare", contendCompare);
log.info("getPcReportResult-生成报告结束,id:{}", report.getId());
switchReportStatus(report.getId(), true);
return result;
}
......
......@@ -306,7 +306,6 @@ public class TaskServiceImpl implements TaskService {
Report report = booleanReportPair.getRight();
// 用作生成缓存
reportService.getPcReportAnalyze(report.getId(), false);
reportService.switchReportStatus(report.getId(), true);
}
flag = true;
}
......@@ -315,7 +314,6 @@ public class TaskServiceImpl implements TaskService {
for (Report report : reportService.getCustomReportByStatus(project.getId(), false)) {
// 用作生成缓存
reportService.getPcReportAnalyze(report.getId(), false);
reportService.switchReportStatus(report.getId(), true);
}
return flag;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment