Commit fa8208f1 by zhuht

[chg]修改滞留时间任务的调用顺序,放到tool建表后;

1 parent de687c5b
...@@ -3,7 +3,6 @@ package com.viontech.keliu.consumer; ...@@ -3,7 +3,6 @@ package com.viontech.keliu.consumer;
import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.viontech.keliu.constants.KafkaConstants;
import com.viontech.keliu.entity.MallDataStatisticsInfo; import com.viontech.keliu.entity.MallDataStatisticsInfo;
import com.viontech.keliu.utils.DateUtil; import com.viontech.keliu.utils.DateUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -54,7 +53,7 @@ public class MallDataStatisticsConsumer { ...@@ -54,7 +53,7 @@ public class MallDataStatisticsConsumer {
try { try {
MallDataStatisticsInfo mallDataStatisticsInfo = objectMapper.readValue(consumerRecord.value(), MallDataStatisticsInfo.class); MallDataStatisticsInfo mallDataStatisticsInfo = objectMapper.readValue(consumerRecord.value(), MallDataStatisticsInfo.class);
executorService.execute(() -> { executorService.execute(() -> {
log.info("处理storeDataStatisticsInfo,mallId:{},countDate:{}, 开始", mallDataStatisticsInfo.getMallId(), mallDataStatisticsInfo.getCountDate()); log.info("处理storeDataStatisticsInfo,mallId:{},countDate:{}, 开始", mallDataStatisticsInfo.getMallId(), mallDataStatisticsInfo.getCountDate());
execDataStatistics(mallDataStatisticsInfo); execDataStatistics(mallDataStatisticsInfo);
}); });
} catch (Exception ee) { } catch (Exception ee) {
...@@ -92,15 +91,8 @@ public class MallDataStatisticsConsumer { ...@@ -92,15 +91,8 @@ public class MallDataStatisticsConsumer {
log.info("开始执行mallId:{} ,countDate:{} 统计任务", mallDataStatisticsInfo.getMallId(), mallDataStatisticsInfo.getCountDate()); log.info("开始执行mallId:{} ,countDate:{} 统计任务", mallDataStatisticsInfo.getMallId(), mallDataStatisticsInfo.getCountDate());
String date = DateUtil.format(mallDataStatisticsInfo.getCountDate(), "yyyy-MM-dd"); String date = DateUtil.format(mallDataStatisticsInfo.getCountDate(), "yyyy-MM-dd");
String url = reidUrl + "/reid/tool/residenceByMall?mallId=" + mallDataStatisticsInfo.getMallId() + "&countDate=" + date;
try {
String result = HttpUtil.get(url);
log.info("调用mallId:{} 平均滞留时间 执行结果:{}", mallDataStatisticsInfo.getMallId(), result);
} catch (Exception e) {
log.error("平均滞留时间计算异常:{}", url, e);
}
url = reidUrl + "/reid/tool/faceResidence?mallIds=" + mallDataStatisticsInfo.getMallId() + "&startDate=" + date + "&endDate=" + date; String url = reidUrl + "/reid/tool/faceResidence?mallIds=" + mallDataStatisticsInfo.getMallId() + "&startDate=" + date + "&endDate=" + date;
try { try {
String result = HttpUtil.get(url); String result = HttpUtil.get(url);
log.info("调用mallId:{} 滞留时间 执行结果:{}", mallDataStatisticsInfo.getMallId(), result); log.info("调用mallId:{} 滞留时间 执行结果:{}", mallDataStatisticsInfo.getMallId(), result);
...@@ -124,6 +116,14 @@ public class MallDataStatisticsConsumer { ...@@ -124,6 +116,14 @@ public class MallDataStatisticsConsumer {
log.error("客流数据重汇异常:{}", url, e); log.error("客流数据重汇异常:{}", url, e);
} }
url = reidUrl + "/reid/tool/residenceByMall?mallId=" + mallDataStatisticsInfo.getMallId() + "&countDate=" + date;
try {
String result = HttpUtil.get(url);
log.info("调用mallId:{} 平均滞留时间 执行结果:{}", mallDataStatisticsInfo.getMallId(), result);
} catch (Exception e) {
log.error("平均滞留时间计算异常:{}", url, e);
}
url = reidUrl + "/reid/tool/faceRecognition/aggregation?mallIds=" + mallDataStatisticsInfo.getMallId() + "&startDate=" + date + "&endDate=" + date; url = reidUrl + "/reid/tool/faceRecognition/aggregation?mallIds=" + mallDataStatisticsInfo.getMallId() + "&startDate=" + date + "&endDate=" + date;
try { try {
String result = HttpUtil.get(url); String result = HttpUtil.get(url);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!