Commit 791182bb by 田超

Merge branch 'feature/1006021' into 'master'

feat:[1006021]域名合并

See merge request rays/pcloud-book!1463
parents 9192443b f267b98a
......@@ -3032,8 +3032,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
AccountSettingDto accountSettingDto = map.get(channelId);
if (null != accountSettingDto) {
recommendServeVO.setAccountSettingId(accountSettingDto.getAccountSettingId());
recommendServeVO.setAppDomain("app" + (accountSettingDto.getRandom() == null ? "" : accountSettingDto.getRandom())
+ "." + accountSettingDto.getFirstDomain());
recommendServeVO.setAppDomain("weixin" + (accountSettingDto.getRandom() == null ? accountSettingDto.getAccountSettingId() : accountSettingDto.getRandom()) + "." + accountSettingDto.getFirstDomain());
recommendServeVO.setDomain(accountSettingDto.getDomain());
recommendServeVO.setFirstDomain(accountSettingDto.getFirstDomain());
recommendServeVO.setRandom(accountSettingDto.getRandom());
......
......@@ -15,11 +15,11 @@ import com.pcloud.book.keywords.dto.SendMessageDTO;
import com.pcloud.book.keywords.enums.ReplyTypeEnum;
import com.pcloud.book.keywords.vo.ReplyMessageVO;
import com.pcloud.book.util.properties.BookProps;
import com.pcloud.channelcenter.base.constants.ChannelConstants;
import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.utils.BeanUtils;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.ServeLinkUtils;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.common.utils.httpclient.UrlUtils;
import com.pcloud.common.utils.string.StringUtil;
......@@ -250,29 +250,8 @@ public class SendWeixinRequestTools {
LOGGER.error("运营平台未配置公众号,url"+url);
return url;
}
String protocol = accountSettingDto.getProtocol();
if (StringUtils.isEmpty(protocol)) {
protocol = ChannelConstants.HTTP;
}
String resultUrl = "";
if (!StringUtils.isEmpty(url)) {
if (url.startsWith("http")) {
return url;
}
if (url.startsWith("*")) {
String endUrl = url.substring(url.indexOf("/"));
if (accountSettingDto.getRandom() == null) {
resultUrl = protocol + "app." + accountSettingDto.getFirstDomain() + "/" + url.substring(1, url.indexOf("/")) + "/W"
+ accountSettingDto.getAccountSettingId() + endUrl;
} else {
resultUrl = protocol + "app" + accountSettingDto.getRandom() + "." + accountSettingDto.getFirstDomain() + "/" + url.substring(1, url.indexOf("/")) + "/W"
+ accountSettingDto.getAccountSettingId() + endUrl;
}
} else {
resultUrl = protocol + accountSettingDto.getDomain() + "/W" + accountSettingDto.getAccountSettingId() + url;
}
}
return resultUrl;
return ServeLinkUtils.splitUrl(url,accountSettingDto.getAccountSettingId(),accountSettingDto.getProtocol(),
accountSettingDto.getDomain(),accountSettingDto.getFirstDomain(),accountSettingDto.getRandom());
}
@ParamLog("群欢迎语中推送关键词信息")
......
......@@ -655,29 +655,4 @@ public class TaskSubscribeBizImpl implements TaskSubscribeBiz {
}
}
private String splitUrl(AccountSettingDto accountSettingDto, String url) {
String protocol = accountSettingDto.getProtocol();
if (StringUtils.isEmpty(protocol)) {
protocol = ChannelConstants.HTTP;
}
String resultUrl = "";
if (!StringUtils.isEmpty(url)) {
if (url.startsWith("http")) {
return url;
}
if (url.startsWith("*")) {
String endUrl = url.substring(url.indexOf("/"));
if (accountSettingDto.getRandom() == null) {
resultUrl = protocol + "app." + accountSettingDto.getFirstDomain() + "/" + url.substring(1, url.indexOf("/")) + "/W"
+ accountSettingDto.getAccountSettingId() + endUrl;
} else {
resultUrl = protocol + "app" + accountSettingDto.getRandom() + "." + accountSettingDto.getFirstDomain() + "/" + url.substring(1, url.indexOf("/")) + "/W"
+ accountSettingDto.getAccountSettingId() + endUrl;
}
} else {
resultUrl = protocol + accountSettingDto.getDomain() + "/W" + accountSettingDto.getAccountSettingId() + url;
}
}
return resultUrl;
}
}
......@@ -509,19 +509,16 @@ public class WeixinClockBizImpl implements WeixinClockBiz {
if (StringUtils.isEmpty(protocol)) {
protocol = ChannelConstants.HTTP;
}
if(accountSettingDto.getRandom() != null) {
sbu.append(protocol).append("app").append(accountSettingDto.getRandom()).append(".").append(accountSettingDto.getFirstDomain())
.append("/luck").append("/W").append(accountSettingDto.getAccountSettingId()).append("/C").append(appDto.getChannelId())
.append("/A").append(appDto.getAppId())
.append("/luckPage?isPreview=1&adviserId=").append(appDto.getCreatedUser()).append("&appType==").append(appDto.getTypeCode())
.append("&origin=wxGroup");
}else{
sbu.append(protocol).append("app.").append(accountSettingDto.getFirstDomain())
.append("/luck").append("/W").append(accountSettingDto.getAccountSettingId()).append("/C").append(appDto.getChannelId())
.append("/A").append(appDto.getAppId())
.append("/luckPage?isPreview=1&adviserId=").append(appDto.getCreatedUser()).append("&appType==").append(appDto.getTypeCode())
.append("&origin=wxGroup");
Long random = accountSettingDto.getRandom();
if (null == random) {
random = accountSettingDto.getAccountSettingId();
}
sbu.append(protocol).append("weixin").append(random).append(".").append(accountSettingDto.getFirstDomain())
.append("/luck").append("/W").append(accountSettingDto.getAccountSettingId()).append("/C").append(appDto.getChannelId())
.append("/A").append(appDto.getAppId())
.append("/luckPage?isPreview=1&adviserId=").append(appDto.getCreatedUser()).append("&appType==").append(appDto.getTypeCode())
.append("&origin=wxGroup");
LOGGER.info("抽奖的跳转链接=====" + sbu.toString() + "================s");
return UrlUtils.getShortUrl4Own(sbu.toString());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment