Commit fbd7cd14 by shenjunjie

Merge branch 'feature' into 'release'

配置自定义简报后立刻开始任务

See merge request !201
parents 5d9d307e 8313d494
......@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps;
import com.zhiwei.brandkbs2.auth.UserThreadLocal;
import com.zhiwei.brandkbs2.common.RedisKeyPrefix;
import com.zhiwei.brandkbs2.config.Constant;
import com.zhiwei.brandkbs2.dao.EventDao;
import com.zhiwei.brandkbs2.dao.EventDataDao;
import com.zhiwei.brandkbs2.dao.ReportDao;
......@@ -16,7 +15,10 @@ import com.zhiwei.brandkbs2.enmus.response.ReportCodeEnum;
import com.zhiwei.brandkbs2.exception.ExceptionCast;
import com.zhiwei.brandkbs2.listener.ApplicationProjectListener;
import com.zhiwei.brandkbs2.model.CommonCodeEnum;
import com.zhiwei.brandkbs2.pojo.*;
import com.zhiwei.brandkbs2.pojo.AbstractProject;
import com.zhiwei.brandkbs2.pojo.BaseMap;
import com.zhiwei.brandkbs2.pojo.Report;
import com.zhiwei.brandkbs2.pojo.ReportSettings;
import com.zhiwei.brandkbs2.pojo.dto.ReportDTO;
import com.zhiwei.brandkbs2.pojo.dto.ReportSearchDTO;
import com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO;
......@@ -286,7 +288,12 @@ public class ReportServiceImpl implements ReportService {
@Override
public void addCustomReport(ReportDTO reportDTO) {
reportDao.insertOneWithoutId(Report.createFromReportDTO(reportDTO));
Report report = Report.createFromReportDTO(reportDTO);
reportDao.insertOneWithoutId(report);
ApplicationProjectListener.getThreadPool().execute(() -> {
getPcReportAnalyze(report.getId(), false);
switchReportStatus(report.getId(), true);
});
}
@Override
......@@ -302,6 +309,7 @@ public class ReportServiceImpl implements ReportService {
* @return 月报结果
*/
private JSONObject getPcReportResult(Report report) throws IOException {
log.info("getPcReportResult-生成报告开始,id:{}", report.getId());
Long startTime = report.getStartTime();
Long endTime = report.getEndTime();
Long lastStartTimeStr = startTime - (endTime - startTime);
......@@ -327,6 +335,7 @@ public class ReportServiceImpl implements ReportService {
return json;
}).collect(Collectors.toList());
result.put("contendCompare", contendCompare);
log.info("getPcReportResult-生成报告结束,id:{}", report.getId());
return result;
}
......
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