|
@@ -70,6 +70,10 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
@Value("${correct.cpa.view.day:300}")
|
|
|
protected Integer correctCpaViewDay;
|
|
|
|
|
|
+ @Value("${correct.cpa.min.ctcvr:0.000001}")
|
|
|
+ protected Double minCtcvr;
|
|
|
+
|
|
|
+
|
|
|
@Value("${exclude.exp:772}")
|
|
|
protected String excludeExp;
|
|
|
|
|
@@ -108,8 +112,6 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
|
|
|
private static final double DEFAULT_CORRECTION = 1.0;
|
|
|
|
|
|
- private static final double MIN_POSITIVE = 0.000001;
|
|
|
-
|
|
|
|
|
|
protected static final List<String> hasChannelScenes = new ArrayList<String>() {{
|
|
|
add("DaiTou");
|
|
@@ -429,10 +431,10 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
// 安全获取值
|
|
|
Integer viewsHour = jsonObject.getInteger("viewsHour");
|
|
|
Integer viewsDay = jsonObject.getInteger("viewsDay");
|
|
|
- double realCtcvrHour = safeDouble(jsonObject.getDouble("realCtcvrHour"));
|
|
|
- double pCtcvrHour = safeDouble(jsonObject.getDouble("pCtcvrHour"));
|
|
|
- double realCtcvrDay = safeDouble(jsonObject.getDouble("realCtcvrDay"));
|
|
|
- double pCtcvrDay = safeDouble(jsonObject.getDouble("pCtcvrDay"));
|
|
|
+ double realCtcvrHour = safeDouble(jsonObject.getDouble("realCtcvrHour"), minCtcvr);
|
|
|
+ double pCtcvrHour = safeDouble(jsonObject.getDouble("pCtcvrHour"), minCtcvr);
|
|
|
+ double realCtcvrDay = safeDouble(jsonObject.getDouble("realCtcvrDay"), minCtcvr);
|
|
|
+ double pCtcvrDay = safeDouble(jsonObject.getDouble("pCtcvrDay"), minCtcvr);
|
|
|
|
|
|
if (scoreParam.getExpCodeSet().contains(correctCpaExp2)) {
|
|
|
double alpha = isValidViews(viewsHour, correctCpaViewHour) ? correctCpaAlpha2 : 0;
|
|
@@ -675,8 +677,8 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
}
|
|
|
|
|
|
// 安全的数值转换
|
|
|
- private double safeDouble(Double value) {
|
|
|
- return (value == null || value == 0) ? MIN_POSITIVE : value;
|
|
|
+ private double safeDouble(Double value, Double min) {
|
|
|
+ return (value == null || value == 0) ? min : value;
|
|
|
}
|
|
|
|
|
|
// 视图数校验封装
|