|
@@ -604,8 +604,13 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
|
|
if (strategy.getClickTrackUrl().contains(CHANNEL_STR)) {
|
|
if (strategy.getClickTrackUrl().contains(CHANNEL_STR)) {
|
|
channelStrategy.setClickTrackUrl(strategy.getClickTrackUrl().replace(CHANNEL_STR, channelCode).trim());
|
|
channelStrategy.setClickTrackUrl(strategy.getClickTrackUrl().replace(CHANNEL_STR, channelCode).trim());
|
|
}
|
|
}
|
|
- if (strategy.getAppVersion().contains(CHANNEL_STR)) {
|
|
|
|
- channelStrategy.setAppVersion(strategy.getAppVersion().replace(CHANNEL_STR, channelCode).trim());
|
|
|
|
|
|
+ String appVersion = strategy.getAppVersion();
|
|
|
|
+ if (appVersion.contains(CHANNEL_STR)) {
|
|
|
|
+ appVersion = appVersion.replace(CHANNEL_STR, channelCode).trim();
|
|
|
|
+ if (appVersion.endsWith("-")) {
|
|
|
|
+ appVersion = appVersion.substring(0, appVersion.length() - 1);
|
|
|
|
+ }
|
|
|
|
+ channelStrategy.setAppVersion(appVersion);
|
|
}
|
|
}
|
|
return channelStrategy;
|
|
return channelStrategy;
|
|
}
|
|
}
|
|
@@ -913,10 +918,10 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
|
|
return doAccountRangeAccountLevel(accountId, strategys, appName);
|
|
return doAccountRangeAccountLevel(accountId, strategys, appName);
|
|
} else if ("plan".equals(usageLevel) && usageLevel.equals(level)) {
|
|
} else if ("plan".equals(usageLevel) && usageLevel.equals(level)) {
|
|
//---------------------计划层级---------------------
|
|
//---------------------计划层级---------------------
|
|
- return doPlanLevel(accountId, strategys, appName);
|
|
|
|
|
|
+ return doPlanLevel(accountId, strategys, appName, 0);
|
|
} else if ("group".equals(usageLevel)) {
|
|
} else if ("group".equals(usageLevel)) {
|
|
//---------------------组层级---------------------
|
|
//---------------------组层级---------------------
|
|
- return doGroupLevel(accountId, strategys, appName);
|
|
|
|
|
|
+ return doGroupLevel(accountId, strategys, appName, 0);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
/**============================项目范围============================*/
|
|
/**============================项目范围============================*/
|
|
@@ -925,10 +930,10 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
|
|
return doAccountRangeAccountLevel(accountId, strategys, appName);
|
|
return doAccountRangeAccountLevel(accountId, strategys, appName);
|
|
} else if ("plan".equals(usageLevel) && usageLevel.equals(level)) {
|
|
} else if ("plan".equals(usageLevel) && usageLevel.equals(level)) {
|
|
//---------------------计划层级---------------------
|
|
//---------------------计划层级---------------------
|
|
- return doPlanLevel(accountId, strategys, appName);
|
|
|
|
|
|
+ return doPlanLevel(accountId, strategys, appName, 0);
|
|
} else if ("group".equals(usageLevel)) {
|
|
} else if ("group".equals(usageLevel)) {
|
|
//---------------------组层级---------------------
|
|
//---------------------组层级---------------------
|
|
- return doGroupLevel(accountId, strategys, appName);
|
|
|
|
|
|
+ return doGroupLevel(accountId, strategys, appName, 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return Result.error("未查到渠道号");
|
|
return Result.error("未查到渠道号");
|
|
@@ -1015,7 +1020,7 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
|
|
}
|
|
}
|
|
|
|
|
|
//通过账户范围计划层级查询
|
|
//通过账户范围计划层级查询
|
|
- private Result<Object> doPlanLevel(Long accountId, List<KuaishouChannelCreateStrategy> strategys, String appName) throws
|
|
|
|
|
|
+ private Result<Object> doPlanLevel(Long accountId, List<KuaishouChannelCreateStrategy> strategys, String appName, int count) throws
|
|
Exception {
|
|
Exception {
|
|
List<Integer> haveCycleTimesList = channelMapper.queryUsedLevel(strategys);
|
|
List<Integer> haveCycleTimesList = channelMapper.queryUsedLevel(strategys);
|
|
if (Check.isNull(haveCycleTimesList)) {
|
|
if (Check.isNull(haveCycleTimesList)) {
|
|
@@ -1062,11 +1067,14 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (count == 0) {
|
|
|
|
+ return doPlanLevel(accountId, strategys, appName, 1);
|
|
|
|
+ }
|
|
return Result.ok("未查询到渠道号");
|
|
return Result.ok("未查询到渠道号");
|
|
}
|
|
}
|
|
|
|
|
|
//通过项目范围广告组层级查询
|
|
//通过项目范围广告组层级查询
|
|
- private Result<Object> doGroupLevel(Long accountId, List<KuaishouChannelCreateStrategy> strategys, String appName) throws Exception {
|
|
|
|
|
|
+ private Result<Object> doGroupLevel(Long accountId, List<KuaishouChannelCreateStrategy> strategys, String appName, int count) throws Exception {
|
|
List<Integer> haveCycleTimesList = channelMapper.queryUsedLevel(strategys);
|
|
List<Integer> haveCycleTimesList = channelMapper.queryUsedLevel(strategys);
|
|
if (Check.isNull(haveCycleTimesList)) {
|
|
if (Check.isNull(haveCycleTimesList)) {
|
|
return Result.error("渠道号已无效");
|
|
return Result.error("渠道号已无效");
|
|
@@ -1112,6 +1120,9 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (count == 0) {
|
|
|
|
+ return doGroupLevel(accountId, strategys, appName, 1);
|
|
|
|
+ }
|
|
return Result.ok("未查询到渠道号");
|
|
return Result.ok("未查询到渠道号");
|
|
}
|
|
}
|
|
|
|
|