|
@@ -55,18 +55,27 @@ public class PredictModelServiceImpl implements PredictModelService {
|
|
private String adPredictBreakExpCode;
|
|
private String adPredictBreakExpCode;
|
|
|
|
|
|
public Map<String, Object> adPredict(ThresholdPredictModelRequestParam requestParam) {
|
|
public Map<String, Object> adPredict(ThresholdPredictModelRequestParam requestParam) {
|
|
- JSONObject object = requestParam.getAbExpInfo();
|
|
|
|
|
|
+
|
|
boolean isHit = false;
|
|
boolean isHit = false;
|
|
- if (object != null) {
|
|
|
|
- List<Map<String, String>> abExps = JSONUtils.fromJson(object.getString("ab_test002"),
|
|
|
|
- new TypeToken<List<Map<String, String>>>() {
|
|
|
|
- }, Collections.emptyList());
|
|
|
|
- for (Map<String, String> abExpMap : abExps) {
|
|
|
|
- if (StringUtils.equals(abExpMap.get("abExpCode"), adPredictBreakExpCode)) {
|
|
|
|
- isHit = true;
|
|
|
|
- break;
|
|
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ JSONObject object = requestParam.getAbExpInfo();
|
|
|
|
+ if (object != null) {
|
|
|
|
+ JSONArray array = object.getJSONArray("ab_test002");
|
|
|
|
+ if (array != null) {
|
|
|
|
+ List<Map<String, String>> abExps = JSONUtils.fromJson(array.toJSONString(),
|
|
|
|
+ new TypeToken<List<Map<String, String>>>() {
|
|
|
|
+ }, Collections.emptyList());
|
|
|
|
+ for (Map<String, String> abExpMap : abExps) {
|
|
|
|
+ if (StringUtils.equals(abExpMap.get("abExpCode"), adPredictBreakExpCode)) {
|
|
|
|
+ isHit = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("adPredict hit error", e);
|
|
}
|
|
}
|
|
|
|
|
|
if (adPredictBreakSwitch || isHit) {
|
|
if (adPredictBreakSwitch || isHit) {
|