Commit 420cdcf7 by 田超

Merge branch 'feature/1006651' into 'master'

feat: [1006651] 外链优化

See merge request rays/pcloud-book!1521
parents 36cad71a d7dc9be8
...@@ -77,7 +77,7 @@ public interface AppletRecordBiz { ...@@ -77,7 +77,7 @@ public interface AppletRecordBiz {
*/ */
Map<Long, AppletAppOrProductDTO> getAppOrProductBrowseCount(Integer recordType, List<Long> serveIds); Map<Long, AppletAppOrProductDTO> getAppOrProductBrowseCount(Integer recordType, List<Long> serveIds);
void fillAppletRecord(List<AppletRecordDTO> recordList, Integer bookType); void fillAppletRecord(List<AppletRecordDTO> recordList, Integer bookType, Long wechatUserId);
Object handleAppletRecordTypeCode(Long lastAppletRecordId); Object handleAppletRecordTypeCode(Long lastAppletRecordId);
......
...@@ -148,7 +148,7 @@ public class AppletRecordAggrStatisBizImpl implements AppletRecordAggrStatisBiz ...@@ -148,7 +148,7 @@ public class AppletRecordAggrStatisBizImpl implements AppletRecordAggrStatisBiz
aggrStatis = appletRecordCHMapper.getAggrStatis(paramMap); aggrStatis = appletRecordCHMapper.getAggrStatis(paramMap);
} }
// 加载其它数据 // 加载其它数据
appletRecordBiz.fillAppletRecord(aggrStatis, YesOrNoNumEnum.NO.getValue()); appletRecordBiz.fillAppletRecord(aggrStatis, YesOrNoNumEnum.NO.getValue(), null);
// 删除部分不存在的数据 // 删除部分不存在的数据
aggrStatis = aggrStatis.stream().filter(x->x.getSourceDelete() == 0).collect(Collectors.toList()); aggrStatis = aggrStatis.stream().filter(x->x.getSourceDelete() == 0).collect(Collectors.toList());
// 设置缓存 // 设置缓存
...@@ -354,7 +354,7 @@ public class AppletRecordAggrStatisBizImpl implements AppletRecordAggrStatisBiz ...@@ -354,7 +354,7 @@ public class AppletRecordAggrStatisBizImpl implements AppletRecordAggrStatisBiz
//7天内扫码量高的资源的总扫码量 //7天内扫码量高的资源的总扫码量
List<AppletRecordDTO> sourceAggrStatis = appletRecordCHMapper.getAggrStatis4H5(map); List<AppletRecordDTO> sourceAggrStatis = appletRecordCHMapper.getAggrStatis4H5(map);
appletRecordBiz.fillAppletRecord(sourceAggrStatis, YesOrNoNumEnum.NO.getValue()); appletRecordBiz.fillAppletRecord(sourceAggrStatis, YesOrNoNumEnum.NO.getValue(), null);
sourceAggrStatis = sourceAggrStatis.stream().filter(x -> x.getSourceDelete() == 0).collect(Collectors.toList()); sourceAggrStatis = sourceAggrStatis.stream().filter(x -> x.getSourceDelete() == 0).collect(Collectors.toList());
if (ListUtils.isEmpty(sourceAggrStatis)) { if (ListUtils.isEmpty(sourceAggrStatis)) {
continue; continue;
...@@ -423,7 +423,7 @@ public class AppletRecordAggrStatisBizImpl implements AppletRecordAggrStatisBiz ...@@ -423,7 +423,7 @@ public class AppletRecordAggrStatisBizImpl implements AppletRecordAggrStatisBiz
if (ListUtils.isEmpty(countList)) { if (ListUtils.isEmpty(countList)) {
return new PageBeanNew(currentPage, numPerPage, 0, Lists.newArrayList()); return new PageBeanNew(currentPage, numPerPage, 0, Lists.newArrayList());
} }
appletRecordBiz.fillAppletRecord(countList, YesOrNoNumEnum.NO.getValue()); appletRecordBiz.fillAppletRecord(countList, YesOrNoNumEnum.NO.getValue(), wechatUserId);
countList = countList.stream().filter(x -> x.getSourceDelete() == 0).collect(Collectors.toList()); countList = countList.stream().filter(x -> x.getSourceDelete() == 0).collect(Collectors.toList());
dealServeNamePic(countList, isDefaultList, sourceFrom); dealServeNamePic(countList, isDefaultList, sourceFrom);
if (ListUtils.isEmpty(countList)) { if (ListUtils.isEmpty(countList)) {
......
...@@ -50,11 +50,12 @@ import com.pcloud.book.group.tools.SendWeixinRequestTools; ...@@ -50,11 +50,12 @@ import com.pcloud.book.group.tools.SendWeixinRequestTools;
import com.pcloud.book.rightsSetting.biz.RightsSettingBiz; import com.pcloud.book.rightsSetting.biz.RightsSettingBiz;
import com.pcloud.book.skill.biz.PcloudGroupActivityBiz; import com.pcloud.book.skill.biz.PcloudGroupActivityBiz;
import com.pcloud.book.applet.dto.GroupActivity4AppletDTO; import com.pcloud.book.applet.dto.GroupActivity4AppletDTO;
import com.pcloud.book.skill.remind.RedisTool; import com.pcloud.book.util.common.CommonUtils;
import com.pcloud.book.util.common.ThreadPoolUtils; import com.pcloud.book.util.common.ThreadPoolUtils;
import com.pcloud.book.util.properties.BookProps;
import com.pcloud.channelcenter.wechat.dto.AccountSettingDto; import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
import com.pcloud.common.core.aspect.ParamLog; import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.core.mybatis.cache.redis.RedisCache; import com.pcloud.common.enums.AppTypeEnum;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam; import com.pcloud.common.page.PageParam;
...@@ -62,7 +63,6 @@ import com.pcloud.common.utils.BeanUtils; ...@@ -62,7 +63,6 @@ import com.pcloud.common.utils.BeanUtils;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.NumberUtil; import com.pcloud.common.utils.NumberUtil;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils; import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.common.utils.cache.redis.RedisSessionUtils;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.readercenter.common.enums.YesOrNoNumEnum; import com.pcloud.readercenter.common.enums.YesOrNoNumEnum;
import com.pcloud.resourcecenter.product.dto.ProductDto; import com.pcloud.resourcecenter.product.dto.ProductDto;
...@@ -73,8 +73,8 @@ import org.slf4j.Logger; ...@@ -73,8 +73,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.net.URLEncoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
...@@ -137,6 +137,8 @@ public class AppletRecordBizImpl implements AppletRecordBiz { ...@@ -137,6 +137,8 @@ public class AppletRecordBizImpl implements AppletRecordBiz {
private AppletTrackMapper appletTrackMapper; private AppletTrackMapper appletTrackMapper;
@Autowired @Autowired
private ReaderConsr readerConsr; private ReaderConsr readerConsr;
@Autowired
private BookProps bookProps;
@Override @Override
@ParamLog("通过ID查询单条数据") @ParamLog("通过ID查询单条数据")
...@@ -267,7 +269,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz { ...@@ -267,7 +269,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz {
} }
recordList = listAppletRecord.getRecordList(); recordList = listAppletRecord.getRecordList();
fillAppletRecord(recordList, bookType); fillAppletRecord(recordList, bookType, wechatUserId);
return listAppletRecord; return listAppletRecord;
} }
...@@ -440,7 +442,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz { ...@@ -440,7 +442,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz {
} }
private void fillTypeCode(List<AppletRecordDTO> recordList) { private void fillTypeCode(List<AppletRecordDTO> recordList) {
fillAppletRecord(recordList, YesOrNoNumEnum.YES.getValue()); fillAppletRecord(recordList, YesOrNoNumEnum.YES.getValue(), null);
recordList.stream().forEach(appletRecordDTO -> { recordList.stream().forEach(appletRecordDTO -> {
if (Objects.equals(AppletRecordTypeEnum.NEWS.value, appletRecordDTO.getRecordType()) && null != appletRecordDTO.getAppletNewsDTO()) { if (Objects.equals(AppletRecordTypeEnum.NEWS.value, appletRecordDTO.getRecordType()) && null != appletRecordDTO.getAppletNewsDTO()) {
//填充资讯信息 //填充资讯信息
...@@ -458,7 +460,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz { ...@@ -458,7 +460,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz {
} }
@Override @Override
public void fillAppletRecord(List<AppletRecordDTO> recordList, Integer bookType) { public void fillAppletRecord(List<AppletRecordDTO> recordList, Integer bookType, Long wechatUserId) {
if (ListUtils.isEmpty(recordList)) { if (ListUtils.isEmpty(recordList)) {
return; return;
} }
...@@ -587,7 +589,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz { ...@@ -587,7 +589,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz {
appletRecordDTO.setCoverImg(Optional.ofNullable(bookDtoMap.get(appletRecordDTO.getBookId())).map(BookDto::getCoverImg).orElse("")); appletRecordDTO.setCoverImg(Optional.ofNullable(bookDtoMap.get(appletRecordDTO.getBookId())).map(BookDto::getCoverImg).orElse(""));
} }
//填充应用信息 //填充应用信息
fillApp4Record(appDtoMap, appDtoMappFuture, appletRecordDTO); fillApp4Record(appDtoMap, appDtoMappFuture, appletRecordDTO, wechatUserId);
} else if (Objects.equals(AppletRecordTypeEnum.BOOK.value, appletRecordDTO.getRecordType())) { } else if (Objects.equals(AppletRecordTypeEnum.BOOK.value, appletRecordDTO.getRecordType())) {
//填充书籍信息 //填充书籍信息
fillBook4Record(appletUserBookcaseDTOMap, appletUserBookcaseDTOMapFuture, appletRecordDTO); fillBook4Record(appletUserBookcaseDTOMap, appletUserBookcaseDTOMapFuture, appletRecordDTO);
...@@ -722,7 +724,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz { ...@@ -722,7 +724,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz {
appletRecordDTO.setIsDelete(appletNewsDTO.getIsDelete()); appletRecordDTO.setIsDelete(appletNewsDTO.getIsDelete());
} }
private void fillApp4Record(Map<Long, AppDto> appDtoMap, Future<Map<Long, AppDto>> appDtoMappFuture, AppletRecordDTO appletRecordDTO) { private void fillApp4Record(Map<Long, AppDto> appDtoMap, Future<Map<Long, AppDto>> appDtoMappFuture, AppletRecordDTO appletRecordDTO, Long wechatUserId) {
try { try {
appDtoMap = appDtoMappFuture.get(); appDtoMap = appDtoMappFuture.get();
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
...@@ -764,6 +766,25 @@ public class AppletRecordBizImpl implements AppletRecordBiz { ...@@ -764,6 +766,25 @@ public class AppletRecordBizImpl implements AppletRecordBiz {
} }
appletAppOrProductDTO.setServeType(AppAndProductTypeEnum.APP.value); appletAppOrProductDTO.setServeType(AppAndProductTypeEnum.APP.value);
appletAppOrProductDTO.setServeId(appletRecordDTO.getFromId()); appletAppOrProductDTO.setServeId(appletRecordDTO.getFromId());
//优化跳转
if (AppTypeEnum.ARTICLE.value.equals(appletAppOrProductDTO.getServeTypeCode())) {
if (appDto != null && !StringUtil.isEmpty(appDto.getTurnUrl())) {
if (appDto.getTurnUrl().contains("5rs.me/") || appDto.getTurnUrl().contains("raysgo.com/") || appDto.getTurnUrl().contains("raysyun.com/")
|| null == wechatUserId) {
appletAppOrProductDTO.setResultUrl(appDto.getTurnUrl());
} else {
Long sceneId = CommonUtils.getSceneId(appletAppOrProductDTO.getResultUrl());
if (null != sceneId) {
//外链跳转到指定中间页
String jumpUrl = BookProps.getProductDomain() + "transfer?offId" + accountSettingDto.getAccountSettingId() + "&appId=" + appDto.getAppId() + "&url=" +
URLEncoder.encode(appDto.getTurnUrl()) + "&sceneId=" + sceneId + "&wechatUserId=" + wechatUserId;
appletAppOrProductDTO.setResultUrl(jumpUrl);
}
}
}
}
appletRecordDTO.setAppletAppOrProductDTO(appletAppOrProductDTO); appletRecordDTO.setAppletAppOrProductDTO(appletAppOrProductDTO);
} }
...@@ -880,7 +901,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz { ...@@ -880,7 +901,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz {
} }
private void fillTypeCode4List(List<AppletRecordDTO> recordList) { private void fillTypeCode4List(List<AppletRecordDTO> recordList) {
fillAppletRecord(recordList, YesOrNoNumEnum.YES.getValue()); fillAppletRecord(recordList, YesOrNoNumEnum.YES.getValue(), null);
recordList.stream().forEach(appletRecordDTO -> { recordList.stream().forEach(appletRecordDTO -> {
if (Objects.equals(AppletRecordTypeEnum.PRODUCT.value, appletRecordDTO.getRecordType()) && null != appletRecordDTO.getAppletAppOrProductDTO()) { if (Objects.equals(AppletRecordTypeEnum.PRODUCT.value, appletRecordDTO.getRecordType()) && null != appletRecordDTO.getAppletAppOrProductDTO()) {
// 填充作品信息 // 填充作品信息
...@@ -909,7 +930,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz { ...@@ -909,7 +930,7 @@ public class AppletRecordBizImpl implements AppletRecordBiz {
if (ListUtils.isEmpty(recordList)) { if (ListUtils.isEmpty(recordList)) {
return new AppletRecordDTO(); return new AppletRecordDTO();
} }
fillAppletRecord(recordList, YesOrNoNumEnum.NO.getValue()); fillAppletRecord(recordList, YesOrNoNumEnum.NO.getValue(), wechatUserId);
recordList = recordList.stream().filter(x -> x.getSourceDelete() == 0).collect(Collectors.toList()); recordList = recordList.stream().filter(x -> x.getSourceDelete() == 0).collect(Collectors.toList());
if (ListUtils.isEmpty(recordList)) { if (ListUtils.isEmpty(recordList)) {
return new AppletRecordDTO(); return new AppletRecordDTO();
......
...@@ -531,9 +531,10 @@ public interface ResourcePageBiz { ...@@ -531,9 +531,10 @@ public interface ResourcePageBiz {
* @param channelId * @param channelId
* @param enableAdverting * @param enableAdverting
* @param navigationId * @param navigationId
* @param officialAccountsId
* @return * @return
*/ */
List<ResourceColumnAndServeVO> getColumnAndServeListByPageId4Wechat(Long resourcePageId, Long wechatUserId, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId); List<ResourceColumnAndServeVO> getColumnAndServeListByPageId4Wechat(Long resourcePageId, Long wechatUserId, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId, Long officialAccountsId);
List<Integer> getColumnTypeByPageId4Wechat(Long resourcePageId, Long wechatUserId, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId); List<Integer> getColumnTypeByPageId4Wechat(Long resourcePageId, Long wechatUserId, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId);
......
...@@ -129,6 +129,7 @@ import com.pcloud.common.core.constant.AdviserTaskConstants; ...@@ -129,6 +129,7 @@ import com.pcloud.common.core.constant.AdviserTaskConstants;
import com.pcloud.common.core.constant.MQTopicProducer; import com.pcloud.common.core.constant.MQTopicProducer;
import com.pcloud.common.core.constant.ProductTypeConstant; import com.pcloud.common.core.constant.ProductTypeConstant;
import com.pcloud.common.core.constant.SystemCode; import com.pcloud.common.core.constant.SystemCode;
import com.pcloud.common.enums.AppTypeEnum;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam; import com.pcloud.common.page.PageParam;
...@@ -163,6 +164,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -163,6 +164,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.File; import java.io.File;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
...@@ -3629,8 +3631,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -3629,8 +3631,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
} }
@Override @Override
public List<ResourceColumnAndServeVO> getColumnAndServeListByPageId4Wechat(Long resourcePageId, Long wechatUserId, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId) { public List<ResourceColumnAndServeVO> getColumnAndServeListByPageId4Wechat(Long resourcePageId, Long wechatUserId, Long bookId,
List<ResourceColumnAndServeVO> resourceColumnAndServeVOS = this.getColumnAndServeListByPageId(resourcePageId, wechatUserId, bookId, adviserId, channelId, enableAdverting, navigationId); Long adviserId, Long channelId, Integer enableAdverting,
Long navigationId, Long officialAccountsId) {
List<ResourceColumnAndServeVO> resourceColumnAndServeVOS = this.getColumnAndServeListByPageId(resourcePageId, wechatUserId, bookId,
adviserId, channelId, enableAdverting, navigationId);
//填充自定义图片 //填充自定义图片
if (ListUtils.isEmpty(resourceColumnAndServeVOS)) { if (ListUtils.isEmpty(resourceColumnAndServeVOS)) {
return new ArrayList<>(); return new ArrayList<>();
...@@ -3645,9 +3650,44 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -3645,9 +3650,44 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
return new ArrayList<>(); return new ArrayList<>();
} }
fillSelfPic(resourcePageItemVOList); fillSelfPic(resourcePageItemVOList);
//填充跳转地址
fillJumpUrl(resourcePageItemVOList, wechatUserId, resourcePageId, officialAccountsId);
return resourceColumnAndServeVOS; return resourceColumnAndServeVOS;
} }
private void fillJumpUrl(List<ResourcePageItemVO> resourcePageItemVOList, Long wechatUserId, Long resourcePageId, Long officialAccountsId) {
if (CollUtil.isEmpty(resourcePageItemVOList)) {
return;
}
List<ResourcePageItemVO> resourcePageItemVOS = resourcePageItemVOList.stream().filter(e -> AppTypeEnum.ARTICLE.value.equals(e.getTypeCode())).collect(Collectors.toList());
if (CollUtil.isNotEmpty(resourcePageItemVOS)) {
ResourcePage byId = resourcePageDao.getById(resourcePageId);
if (null == byId || null == byId.getSceneId()) {
return;
}
List<Long> appIds = resourcePageItemVOS.stream().map(e -> e.getServeId()).collect(Collectors.toList());
Map<Long, AppDto> appDtoMap = appConsr.mapByIds(appIds);
resourcePageItemVOS.stream().forEach(e -> {
if (AppTypeEnum.ARTICLE.value.equals(e.getTypeCode()) && CollUtil.isNotEmpty(appDtoMap) && null != appDtoMap.get(e.getServeId())) {
AppDto appDto = appDtoMap.get(e.getServeId());
if (appDto != null && !StringUtil.isEmpty(appDto.getTurnUrl())) {
if (appDto.getTurnUrl().contains("5rs.me/") || appDto.getTurnUrl().contains("raysgo.com/") || appDto.getTurnUrl().contains("raysyun.com/")
|| null == wechatUserId) {
e.setResultUrl(appDto.getTurnUrl());
} else {
//外链跳转到指定中间页
String jumpUrl = BookProps.getProductDomain() + "transfer?offId" + officialAccountsId + "&appId=" + appDto.getAppId() + "&url=" +
URLEncoder.encode(appDto.getTurnUrl()) + "&sceneId=" + byId.getSceneId() + "&wechatUserId=" + wechatUserId;
e.setResultUrl(jumpUrl);
}
}
}
});
}
}
@Override @Override
public List<Integer> getColumnTypeByPageId4Wechat(Long resourcePageId, Long wechatUserId, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId) { public List<Integer> getColumnTypeByPageId4Wechat(Long resourcePageId, Long wechatUserId, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId) {
List<Integer> columnIdList = resourcePageColumnDao.getColumnIdListByPageId(resourcePageId, navigationId); List<Integer> columnIdList = resourcePageColumnDao.getColumnIdListByPageId(resourcePageId, navigationId);
......
...@@ -108,7 +108,9 @@ public class ResourcePageFacade { ...@@ -108,7 +108,9 @@ public class ResourcePageFacade {
@RequestParam(value = "enableAdverting", required = false) Integer enableAdverting, @RequestParam(value = "enableAdverting", required = false) Integer enableAdverting,
@RequestParam(value = "navigationId", required = false) Long navigationId){ @RequestParam(value = "navigationId", required = false) Long navigationId){
Long wechatUserId = Cookie.getId(userInfo,Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
return new ResponseDto<>(resourcePageBiz.getColumnAndServeListByPageId4Wechat(resourcePageId, wechatUserId, bookId, adviserId, channelId, enableAdverting, navigationId)); Long officialAccountsId = Cookie.getId(userInfo, Cookie._OFFICIAL_ACCOUNTS_ID);
return new ResponseDto<>(resourcePageBiz.getColumnAndServeListByPageId4Wechat(resourcePageId, wechatUserId, bookId, adviserId,
channelId, enableAdverting, navigationId, officialAccountsId));
} }
//优化 此处把模块分开调接口 //优化 此处把模块分开调接口
......
...@@ -2,6 +2,7 @@ package com.pcloud.book.util.common; ...@@ -2,6 +2,7 @@ package com.pcloud.book.util.common;
import java.util.*; import java.util.*;
import cn.hutool.core.util.StrUtil;
import com.pcloud.common.utils.DateNewUtils; import com.pcloud.common.utils.DateNewUtils;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
...@@ -166,4 +167,22 @@ public class CommonUtils { ...@@ -166,4 +167,22 @@ public class CommonUtils {
calendar.set(14, 0); calendar.set(14, 0);
return calendar.getTime(); return calendar.getTime();
} }
public static Long getSceneId(String url) {
if (StrUtil.isEmpty(url) || !url.contains("sceneId")) {
return null;
}
String sceneIdStr = null;
Long sceneId = null;
try {
sceneIdStr = url.substring( url.indexOf("sceneId") + 8 , url.indexOf("&", url.indexOf("sceneId")));
} catch (Exception e) {
e.printStackTrace();
}
if (StrUtil.isNotEmpty(sceneIdStr)) {
sceneId = Long.valueOf(sceneIdStr);
}
return sceneId;
}
} }
...@@ -161,4 +161,16 @@ public class BookProps { ...@@ -161,4 +161,16 @@ public class BookProps {
public void setMiniOfficialAccountsId(Long miniOfficialAccountsId) { public void setMiniOfficialAccountsId(Long miniOfficialAccountsId) {
BookProps.miniOfficialAccountsId = miniOfficialAccountsId; BookProps.miniOfficialAccountsId = miniOfficialAccountsId;
} }
private static String productDomain;
public static String getProductDomain() {
return productDomain;
}
@Value("${PRODUCT_DOMAIN}")
public void setProductDomain(String productDomain) {
BookProps.productDomain = productDomain;
}
} }
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