admin
2021-03-02 4011b8d0b377af33e2bc435f7726329630d706cb
src/main/java/com/yeshi/buwan/job/AdJob.java
@@ -54,6 +54,34 @@
        return ReturnT.SUCCESS;
    }
    //打开vivo应用市场广告
    //打开华为应用市场的广告
    @XxlJob("ad-vivo-check")
    public ReturnT<String> openVIVOAd(String params) throws Exception {
        JSONObject paramsJson = JSONObject.fromObject(params);
        String appId = paramsJson.optString("appId");
        String systemId = paramsJson.optString("detailSystemId");
        //应用市场的版本
        Integer onLineVersion = AppMarketUtil.getVIVOLatestVersionCode(appId);
        if (onLineVersion == null) {
            throw new Exception("应用市场版本获取失败:" + appId);
        }
        //获取正在上线的版本
        DetailSystem detailSystem = systemService.getDetailSystemById(systemId);
        Map<String, String> map = configService.getConfigAsMap(detailSystem, 1);
        //正在上线的版本
        String onLiningVersionCode = map.get("ad_click_download_version");
        //是否已经上线完成
        if (onLineVersion >= Integer.parseInt(onLiningVersionCode)) {
            //已经上线,设置
            showAd("vivo", detailSystem, onLineVersion + 1);
        }
        return ReturnT.SUCCESS;
    }
    /**
     * 打开广告
     *
@@ -71,14 +99,18 @@
        }
        config = configService.getConfigByKey("ad_play_video_pre", detailSystem, version);
        updateVersionConfig(channel, config, version);
        config = configService.getConfigByKey("ad_exit_app", detailSystem, version);
        updateVersionConfig(channel, config, version);
        config = configService.getConfigByKey("ad_video_detail_full_video", detailSystem, version);
        updateVersionConfig(channel, config, version);
        config = configService.getConfigByKey("ad_video_search", detailSystem, version);
        updateVersionConfig(channel, config, version);
        //删除缓存
        ehCacheManager.removeCacheByCacheName("configCache");
        ehCacheManager.clearCacheByCacheName("configCache");
    }
    /**