|
@@ -17,6 +17,7 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
@@ -33,9 +34,12 @@ public class RankServiceImpl implements RankService {
|
|
|
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss");
|
|
|
@Autowired
|
|
|
FeatureRemoteService featureRemoteService;
|
|
|
-
|
|
|
@Autowired
|
|
|
RankServiceThompsonImpl rankServiceThompson;
|
|
|
+ @Value("${ad.model.cpm.max:200}")
|
|
|
+ Double cpmMax=200d;
|
|
|
+ @Value("${ad.model.cpm.min:30}")
|
|
|
+ Double cpmMin=30d;
|
|
|
|
|
|
public AdRankItem adItemRank(RankRecommendRequestParam request){
|
|
|
ScoreParam param= RequestConvert.requestConvert(request);
|
|
@@ -158,12 +162,20 @@ public class RankServiceImpl implements RankService {
|
|
|
result.setPctr(topItem.getCtr());
|
|
|
result.setPcvr(topItem.getCvr());
|
|
|
result.setCreativeCode(groupMap.get(topItem.getAdId()+"").get(0).getCreativeCode());
|
|
|
+ double realECpm=0d;
|
|
|
if(rankResult.size()<=1){
|
|
|
//经验值 待定
|
|
|
- result.setEcpm2(topItem.getEcpm1()*0.9);
|
|
|
+ realECpm=topItem.getEcpm1()*0.9;
|
|
|
}else {
|
|
|
- result.setEcpm2(rankResult.get(1).getEcpm1());
|
|
|
+ realECpm=rankResult.get(1).getEcpm1();
|
|
|
+ }
|
|
|
+ if(realECpm>cpmMax/1000d){
|
|
|
+ realECpm=cpmMax/1000d;
|
|
|
+ }
|
|
|
+ if(realECpm<cpmMin/1000d){
|
|
|
+ realECpm=cpmMin/1000d;
|
|
|
}
|
|
|
+ result.setEcpm2(realECpm);
|
|
|
JSONObject object=new JSONObject();
|
|
|
object.put("mid",request.getMid());
|
|
|
object.put("adid",result.getCreativeId());
|