| | |
| | | List<AppVersionInfo> versionList = null;
|
| | | if (!StringUtil.isNullOrEmpty(version) || !StringUtil.isNullOrEmpty(platform)) {
|
| | | versionList = new ArrayList<>();
|
| | | if (!StringUtil.isNullOrEmpty(version) && !StringUtil.isNullOrEmpty(platform)) {
|
| | | AppVersionInfo appVersion = appVersionService.getByPlatformAndVersion(platform, version);
|
| | | if (!StringUtil.isNullOrEmpty(version)) {
|
| | | AppVersionInfo appVersion = appVersionService.selectByPrimaryKey(Long.parseLong(version));
|
| | | if (appVersion != null)
|
| | | versionList.add(appVersion);
|
| | | } else if (!StringUtil.isNullOrEmpty(version)) {
|
| | | List<AppVersionInfo> appVersionList = appVersionService.listByVersion(version);
|
| | | if (appVersionList != null) {
|
| | | versionList.addAll(appVersionList);
|
| | | }
|
| | | } else {
|
| | | List<AppVersionInfo> appVersionList = appVersionService.getAppVersionInfoListByPlatform(platform);
|
| | | if (appVersionList != null) {
|
| | |
| | | List<Long> versionIdList = new ArrayList<>();
|
| | | for (AppVersionInfo versionInfo : versionList)
|
| | | versionIdList.add(versionInfo.getId());
|
| | | List<Long> sourceIds = adActivityVersionControlService.filterSourceIdByVersion(sourceIdList,
|
| | | Set<Long> sets = adActivityVersionControlService.filterSourceIdByVersion(sourceIdList,
|
| | | AdActivityType.special, versionIdList);
|
| | | Set<Long> sets = new HashSet<>();
|
| | | if (sourceIds != null)
|
| | | for (Long sourceId : sourceIds) {
|
| | | sets.add(sourceId);
|
| | | }
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | if (!sets.contains(list.get(i).getId())) {
|
| | | list.remove(i--);
|
| | |
| | | List<Long> versionList = new ArrayList<>();
|
| | | if (list != null)
|
| | | for (AdActivityVersionControl control : list)
|
| | | versionList.add(control.getId());
|
| | | versionList.add(control.getVersion().getId());
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(versionList));
|
| | | }
|
| | |
|