|
|
@@ -318,10 +318,9 @@ public class StoreOperationalStatisticsServiceImpl implements StoreOperationalSt
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public StoreOperationalStatisticsComparisonVo getStatisticsComparisonNew(Integer storeId, String currentStartTime, String currentEndTime,
|
|
|
- String previousStartTime, String previousEndTime) {
|
|
|
-
|
|
|
- log.info("StoreOperationalStatisticsServiceImpl.getStatisticsComparison - storeId={}, currentStartTime={}, currentEndTime={}, previousStartTime={}, previousEndTime={}",
|
|
|
+ public boolean getStatisticsComparisonNew(Integer storeId, String currentStartTime, String currentEndTime,
|
|
|
+ String previousStartTime, String previousEndTime) {
|
|
|
+ log.info("StoreOperationalStatisticsServiceImpl.getStatisticsComparisonNew - storeId={}, currentStartTime={}, currentEndTime={}, previousStartTime={}, previousEndTime={}",
|
|
|
storeId, currentStartTime, currentEndTime, previousStartTime, previousEndTime);
|
|
|
|
|
|
// 参数校验
|
|
|
@@ -359,29 +358,11 @@ public class StoreOperationalStatisticsServiceImpl implements StoreOperationalSt
|
|
|
comparison.setServiceQualityData(buildServiceQualityDataComparison(currentStatistics.getServiceQualityData(), previousStatistics.getServiceQualityData()));
|
|
|
comparison.setPriceListRanking(buildPriceListRankingComparison(currentStatistics.getPriceListRanking(), previousStatistics.getPriceListRanking(), storeId));
|
|
|
|
|
|
- // 当comparison中所有对比数据的current和previous都为0或为空时,不抛异常,返回 null(由 Controller 返回失败提示)
|
|
|
+ // 当comparison中所有对比数据的current和previous都为0或为空时,返回 false(失败)
|
|
|
if (!hasComparisonData(comparison)) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- // 保存历史记录(不包含PDF URL,PDF URL只在 generateStatisticsComparisonPdf 接口中保存)
|
|
|
- Integer historyId = saveStatisticsHistory(storeId, currentStartTime, currentEndTime,
|
|
|
- previousStartTime, previousEndTime, comparison, null);
|
|
|
-
|
|
|
- // 将历史记录ID设置到返回对象中
|
|
|
- comparison.setHistoryId(historyId);
|
|
|
-
|
|
|
- // 异步调用AI接口进行数据分析
|
|
|
- if (historyId != null) {
|
|
|
- try {
|
|
|
- callAiAnalysisAsync(historyId, storeId, comparison);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("调用AI分析接口失败 - historyId={}, error={}", historyId, e.getMessage(), e);
|
|
|
- // AI分析失败不影响主流程,只记录日志
|
|
|
- }
|
|
|
+ return false;
|
|
|
}
|
|
|
-
|
|
|
- return comparison;
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
/**
|