Commit 2df13a14 by 吴博

feat: [1005512] 上邮二期黄河项目 处理资源跳转

parent 3ea431fa
......@@ -60,6 +60,7 @@ import com.pcloud.channelcenter.qrcode.dto.BookSceneIdListDTO;
import com.pcloud.channelcenter.qrcode.dto.GroupQrcodeVO;
import com.pcloud.channelcenter.qrcode.dto.OwnMessageDTO;
import com.pcloud.channelcenter.qrcode.dto.QrcodeSceneDto;
import com.pcloud.channelcenter.qrcode.entity.NftBookState;
import com.pcloud.channelcenter.qrcode.entity.QrcodeTemp;
import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
import com.pcloud.channelcenter.wechat.entity.AccountSetting;
......@@ -71,8 +72,10 @@ import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam;
import com.pcloud.common.utils.*;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.message.common.enums.YesNoEnums;
import com.pcloud.readercenter.common.enums.YesOrNoNumEnum;
import com.pcloud.readercenter.userlabel.dto.UserGradeLabelIdDTO;
import com.pcloud.resourcecenter.product.dto.ProductDto;
import com.pcloud.resourcecenter.product.dto.ProductLabelDto;
......@@ -186,12 +189,24 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
private Long nftSceneId;
@Value("${nft.bookGroupId}")
private Long nftBookGroupId;
public static final String nftReleaseLockKey = "CHANNELCENTER:NFT:RELEASE";
@Override
public Long updateResourcePage(UpdateResourcePageVO updateResourcePageVO) {
if (null == updateResourcePageVO.getBookGroupId() && null == updateResourcePageVO.getSceneId()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL,"参数缺失");
}
//处理上邮项目 不更新
ResourcePage bySceneId = null;
if (null != updateResourcePageVO.getBookGroupId()) {
bySceneId = resourcePageDao.getByBookGroupId(updateResourcePageVO.getBookGroupId());
} else if (null != updateResourcePageVO.getSceneId()) {
bySceneId = resourcePageDao.getBySceneId(updateResourcePageVO.getSceneId());
}
//上邮临时处理方案
if (null != bySceneId && null != bySceneId.getBookId() && null != JedisClusterUtils.hget(nftReleaseLockKey, bySceneId.getBookId().toString())) {
throw new BizException(BizException.PARAM_IS_NULL.getCode(), "此二维码需统一配置资源, 请勿单独配置");
}
if (null != updateResourcePageVO.getBookGroupId()) {
return this.updatePageByBookGroupId(updateResourcePageVO);
} else if (null != updateResourcePageVO.getSceneId()) {
......@@ -657,13 +672,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
bySceneId = resourcePageDao.getBySceneId(sceneId);
}
//上邮临时处理方案
if (null != bySceneId && null != bySceneId.getBookId() && nftBookId.contains(bySceneId.getBookId())) {
if (null != bySceneId && null != bySceneId.getBookId() && null != JedisClusterUtils.hget(nftReleaseLockKey, bySceneId.getBookId().toString())) {
if (null != bookGroupId) {
bookGroupId = nftBookGroupId;
bookGroupId = JedisClusterUtils.hgetJson2Class(nftReleaseLockKey, bySceneId.getBookId().toString(), NftBookState.class).getNftBookGroupId();
} else if (null != sceneId) {
sceneId = nftSceneId;
sceneId = JedisClusterUtils.hgetJson2Class(nftReleaseLockKey, bySceneId.getBookId().toString(), NftBookState.class).getNftSceneId();;
}
}
if (null != bookGroupId) {
......@@ -728,7 +741,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
@Override
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(), "找不到资源配置");
......@@ -736,8 +749,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
if (nftBookId.contains(byId.getBookId())) {
resourcePageId = pageId;
navigationId = naviId;
}
}*/
List<ResourceColumnAndServeVO> serveVOS = resourcePageColumnDao.getColumnListByPageId(resourcePageId, navigationId);
if (CollUtil.isNotEmpty(serveVOS)) {
List<ResourcePageItemVO> itemVOList;
......@@ -1474,22 +1486,26 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
if (null == bookGroupId && null == sceneId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL,"参数缺失");
}
ResourcePageVO resourcePageVO = new ResourcePageVO();
ResourcePage bySceneId = null;
if (null != bookGroupId) {
resourcePageVO = getResourcePageByBookGroupId4Wechat(bookGroupId, wechatUserId);
bySceneId = resourcePageDao.getByBookGroupId(bookGroupId);
} else if (null != sceneId) {
resourcePageVO = getResourcePageBySceneId4Wechat(sceneId);
bySceneId = resourcePageDao.getBySceneId(sceneId);
}
//上邮临时处理方案
if (null != resourcePageVO && null != resourcePageVO.getBookId() && nftBookId.contains(resourcePageVO.getBookId())) {
if (null != bySceneId && null != bySceneId.getBookId() && null != JedisClusterUtils.hget(nftReleaseLockKey, bySceneId.getBookId().toString())) {
if (null != bookGroupId) {
bookGroupId = nftBookGroupId;
resourcePageVO = getResourcePageByBookGroupId4Wechat(bookGroupId, wechatUserId);
bookGroupId = JedisClusterUtils.hgetJson2Class(nftReleaseLockKey, bySceneId.getBookId().toString(), NftBookState.class).getNftBookGroupId();
} else if (null != sceneId) {
sceneId = nftSceneId;
resourcePageVO = getResourcePageBySceneId4Wechat(sceneId);
sceneId = JedisClusterUtils.hgetJson2Class(nftReleaseLockKey, bySceneId.getBookId().toString(), NftBookState.class).getNftSceneId();;
}
}
ResourcePageVO resourcePageVO = new ResourcePageVO();
if (null != bookGroupId) {
resourcePageVO = getResourcePageByBookGroupId4Wechat(bookGroupId, wechatUserId);
} else if (null != sceneId) {
resourcePageVO = getResourcePageBySceneId4Wechat(sceneId);
}
if (null != 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