Commit 8e85a6d9 by shenjunjie

Merge branch 'feature' into 'release'

调整简报竞品格式2

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