Commit 330e0b1c by zhouhaibao

feat(merchant): 添加门店分析相关接口

- 新增门店经营概况主机厂版本接口 merchantDetailSummaryZJ
- 新增门店商品品类分析主机厂版本接口 merchantGoodsSummaryWithWarmZJ
- 实现兜底预警目标配置功能,从目标配置表获取交付数
- 添加电池转化率、渗透率等指标的兜底配置处理
- 集成延保转化率、安心包转化率等预警阈值配置
- 完善异常处理和日志记录机制
1 parent c85dd63a
...@@ -359,4 +359,70 @@ public class MerchantAnalysisController { ...@@ -359,4 +359,70 @@ public class MerchantAnalysisController {
} }
} }
@ApiOperation("策略中心-门店分析-门店经营概况-主机厂")
@ServiceMethod(method = "dj.api.strategy.merchant.analysis.store.detail.zjsummary", needInSession = NeedInSessionType.YES)
public RopResponse<StoreDetailSummaryResponse> merchantDetailSummaryZJ(SceneMerchantBaseRequest request) {
try {
SceneBaseReq req = CommonUtil.convertRequest(SceneBaseReq.class);
RpcResponse<StoreDetailSummaryResponse> response = businessSceneAnalysisRemote.storeDetailSummaryZj(req);
if (response.isSuccess()) {
return RopResponse.success(response.getResult());
}
return RopResponse.error(response.getMessage());
} catch (Exception e) {
log.error("接口异常", e);
return RopResponse.error(e.getMessage());
}
}
@ApiOperation("策略中心-门店商品品类分析-主机厂")
@ServiceMethod(method = "dj.api.strategy.merchant.analysis.goods.summary.withWarnZJ", needInSession = NeedInSessionType.YES)
public RopResponse<GoodsCategorySummaryResponse> merchantGoodsSummaryWithWarmZJ(SceneMerchantBaseRequest request) {
try {
SceneBaseReq req = CommonUtil.convertRequest(SceneBaseReq.class);
// 调用主机厂版方法,交付数从目标配置表获取
RpcResponse<GoodsCategorySummaryResponse> response = businessSceneAnalysisRemote.goodsSummaryZj(req);
if (response.isSuccess()) {
GoodsCategorySummaryResponse result = Optional.ofNullable(response.getResult()).orElse(new GoodsCategorySummaryResponse());
// 处理兜底指标
Optional.ofNullable(req.getMerchantIds())
.filter(CollUtil::isNotEmpty)
.flatMap(list -> Optional.ofNullable(list.get(0)).map(ObjectUtil::toString))
.filter(StrUtil::isNotEmpty)
.ifPresent(merchantId -> {
RpcResponse<EarlyWarningThresholdConfig> warningConfigRes = warningMsgRemote.findByMerchantNo(merchantId);
if (!warningConfigRes.hasResult()) {
log.error("兜底预警目标配置查询异常: {}", warningConfigRes);
return;
}
EarlyWarningThresholdConfig warningConfig = warningConfigRes.getResult();
// 电池转化率
result.setBatteryWarrantyConversionBottomTarget(warningConfig.getBatteryConversionRate());
// 电池渗透率
result.setBatteryWarrantyPenetrationBottomTarget(warningConfig.getBatteryPenetrationRate());
// 延保转化率
result.setVehicleWarrantyConversionBottomTarget(warningConfig.getEwConRate());
// 延保渗透率
result.setVehicleWarrantyPenetrationBottomTarget(warningConfig.getEwPenetrationRate());
// 延保安心包转化率
result.setSafetyPackageConversionBottomTarget(warningConfig.getEwAxbConRate());
// 安心包渗透率
result.setSafetyPackagePenetrationBottomTarget(warningConfig.getEwAxbPenetrationRate());
// 延保轮胎转化率
result.setTireWarrantyConversionBottomTarget(warningConfig.getEwLtConRate());
// 轮胎渗透率
result.setTireWarrantyPenetrationBottomTarget(warningConfig.getEwLtPenetrationRate());
});
return RopResponse.success(result);
}
return RopResponse.error(response.getMessage());
} catch (Exception e) {
log.error("接口异常", e);
return RopResponse.error(e.getMessage());
}
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!