Commit 3ea431fa by 田超

Merge branch 'fixbug/fixshangyou' into 'master'

bug: [none] nft

See merge request rays/pcloud-book!1415
parents ee0ca50c 50c29b83
...@@ -82,6 +82,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -82,6 +82,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -175,6 +176,17 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -175,6 +176,17 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
@Autowired @Autowired
private TradeConsr tradeConsr; private TradeConsr tradeConsr;
@Value("${nft.book}")
private List<Long> nftBookId;
@Value("${nft.resourcePageId}")
private Long pageId;
@Value("${nft.naviId}")
private Long naviId;
@Value("${nft.sceneId}")
private Long nftSceneId;
@Value("${nft.bookGroupId}")
private Long nftBookGroupId;
@Override @Override
public Long updateResourcePage(UpdateResourcePageVO updateResourcePageVO) { public Long updateResourcePage(UpdateResourcePageVO updateResourcePageVO) {
if (null == updateResourcePageVO.getBookGroupId() && null == updateResourcePageVO.getSceneId()) { if (null == updateResourcePageVO.getBookGroupId() && null == updateResourcePageVO.getSceneId()) {
...@@ -638,6 +650,22 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -638,6 +650,22 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
throw new BookBizException(BookBizException.PARAM_IS_NULL,"参数缺失"); throw new BookBizException(BookBizException.PARAM_IS_NULL,"参数缺失");
} }
ResourcePageVO resourcePageVO = new ResourcePageVO(); ResourcePageVO resourcePageVO = new ResourcePageVO();
ResourcePage bySceneId = null;
if (null != bookGroupId) {
bySceneId = resourcePageDao.getByBookGroupId(bookGroupId);
} else if (null != sceneId) {
bySceneId = resourcePageDao.getBySceneId(sceneId);
}
//上邮临时处理方案
if (null != bySceneId && null != bySceneId.getBookId() && nftBookId.contains(bySceneId.getBookId())) {
if (null != bookGroupId) {
bookGroupId = nftBookGroupId;
} else if (null != sceneId) {
sceneId = nftSceneId;
}
}
if (null != bookGroupId) { if (null != bookGroupId) {
ResourcePage resourcePage = resourcePageDao.getByBookGroupId(bookGroupId); ResourcePage resourcePage = resourcePageDao.getByBookGroupId(bookGroupId);
if (null == resourcePage) { if (null == resourcePage) {
...@@ -700,6 +728,16 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -700,6 +728,16 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
@Override @Override
public List<ResourceColumnAndServeVO> getColumnAndServeListByPageId(Long resourcePageId, Long wechatUserId, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId) { public List<ResourceColumnAndServeVO> getColumnAndServeListByPageId(Long resourcePageId, Long wechatUserId, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId) {
//上邮临时处理方案
ResourcePage byId = resourcePageDao.getById(resourcePageId);
if (null == byId) {
throw new BizException(BizException.PARAM_IS_NULL.getCode(), "找不到资源配置");
}
if (nftBookId.contains(byId.getBookId())) {
resourcePageId = pageId;
navigationId = naviId;
}
List<ResourceColumnAndServeVO> serveVOS = resourcePageColumnDao.getColumnListByPageId(resourcePageId, navigationId); List<ResourceColumnAndServeVO> serveVOS = resourcePageColumnDao.getColumnListByPageId(resourcePageId, navigationId);
if (CollUtil.isNotEmpty(serveVOS)) { if (CollUtil.isNotEmpty(serveVOS)) {
List<ResourcePageItemVO> itemVOList; List<ResourcePageItemVO> itemVOList;
...@@ -1442,6 +1480,16 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -1442,6 +1480,16 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
} else if (null != sceneId) { } else if (null != sceneId) {
resourcePageVO = getResourcePageBySceneId4Wechat(sceneId); resourcePageVO = getResourcePageBySceneId4Wechat(sceneId);
} }
//上邮临时处理方案
if (null != resourcePageVO && null != resourcePageVO.getBookId() && nftBookId.contains(resourcePageVO.getBookId())) {
if (null != bookGroupId) {
bookGroupId = nftBookGroupId;
resourcePageVO = getResourcePageByBookGroupId4Wechat(bookGroupId, wechatUserId);
} else if (null != sceneId) {
sceneId = nftSceneId;
resourcePageVO = getResourcePageBySceneId4Wechat(sceneId);
}
}
if (null != resourcePageVO.getId()) { if (null != resourcePageVO.getId()) {
//查收藏状态 //查收藏状态
ResourcePageCollect collect = resourcePageCollectDao.getCollectRecordByUser(wechatUserId, resourcePageVO.getId()); ResourcePageCollect collect = resourcePageCollectDao.getCollectRecordByUser(wechatUserId, resourcePageVO.getId());
......
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