Commit 345f928d by 李传峰

Merge branch 'feature/1007338' into 'master'

feat: [1007338] 【优化】扫码量头部书刊 RAYS码落地页 样式优化

See merge request rays/pcloud-book!1604
parents ba5167f2 12a80cfb
...@@ -593,4 +593,9 @@ public interface ResourcePageBiz { ...@@ -593,4 +593,9 @@ public interface ResourcePageBiz {
* @Date 15:59 2022/3/24 * @Date 15:59 2022/3/24
**/ **/
List<MessagServeDTO> getServeListBySceneId4QrUpdate(Long sceneId); List<MessagServeDTO> getServeListBySceneId4QrUpdate(Long sceneId);
/**
* 根据rays码id查资源页菜单栏数量
*/
Integer getNavigationCount(Long bookGroupId, Long wechatUserId, Long sceneId);
} }
...@@ -4633,4 +4633,43 @@ public class ResourcePageBizImpl implements ResourcePageBiz { ...@@ -4633,4 +4633,43 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
return resourcePageItemDao.mapQrServeCount(sceneIds); return resourcePageItemDao.mapQrServeCount(sceneIds);
} }
@Override
public Integer getNavigationCount(Long bookGroupId, Long wechatUserId, Long sceneId) {
if (null == bookGroupId && null == sceneId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL,"参数缺失");
}
Long bookId = null;
if (null != bookGroupId) {
bookId = resourcePageDao.getBookIdByBookGroupId(bookGroupId);
} else if (null != sceneId) {
bookId = resourcePageDao.getBookIdBySceneId(sceneId);
}
//上邮临时处理方案
if (null != bookId && null != JedisClusterUtils.hget(nftReleaseLockKey, bookId.toString())) {
if (null != bookGroupId) {
bookGroupId = JedisClusterUtils.hgetJson2Class(nftReleaseLockKey, bookId.toString(), NftBookState.class).getNftBookGroupId();
} else if (null != sceneId) {
sceneId = JedisClusterUtils.hgetJson2Class(nftReleaseLockKey, bookId.toString(), NftBookState.class).getNftSceneId();;
}
}
ResourcePage resourcePage = new ResourcePage();
if (null != bookGroupId) {
resourcePage = resourcePageDao.getByBookGroupId(bookGroupId);
} else if (null != sceneId) {
resourcePage = resourcePageDao.getBySceneId(sceneId);
}
if(resourcePage == null || resourcePage.getId() == null){
return 0;
}
Long resourcePageId = resourcePage.getId();
//进本书服务页 查导航
Integer count=0;
if (PageLandingPageTypeEnum.RESOURCE.getCode().equals(resourcePage.getLandingPageType())) {
count = resourcePageNavigationDao.countByPageId(resourcePageId);
if (null==count || count<1) {
count=1;
}
}
return count;
}
} }
package com.pcloud.book.group.dao; package com.pcloud.book.group.dao;
import com.pcloud.book.applet.enums.IntroduceTypeEnum;
import com.pcloud.book.group.entity.ResourcePageNavigation; import com.pcloud.book.group.entity.ResourcePageNavigation;
import com.pcloud.common.core.dao.BaseDao; import com.pcloud.common.core.dao.BaseDao;
...@@ -32,4 +33,6 @@ public interface ResourcePageNavigationDao extends BaseDao<ResourcePageNavigatio ...@@ -32,4 +33,6 @@ public interface ResourcePageNavigationDao extends BaseDao<ResourcePageNavigatio
ResourcePageNavigation getNavigationByMoveType(String moveType, Long resourcePageId, Integer navigationSeq); ResourcePageNavigation getNavigationByMoveType(String moveType, Long resourcePageId, Integer navigationSeq);
void updateNavigationSeqNum(Long navigationId, Integer navigationSeq); void updateNavigationSeqNum(Long navigationId, Integer navigationSeq);
Integer countByPageId(Long resourcePageId);
} }
\ No newline at end of file
...@@ -81,4 +81,11 @@ public class ResourcePageNavigationDaoImpl extends BaseDaoImpl<ResourcePageNavig ...@@ -81,4 +81,11 @@ public class ResourcePageNavigationDaoImpl extends BaseDaoImpl<ResourcePageNavig
map.put("navigationSeq", navigationSeq); map.put("navigationSeq", navigationSeq);
getSessionTemplate().update(getStatement("updateNavigationSeqNum"), map); getSessionTemplate().update(getStatement("updateNavigationSeqNum"), map);
} }
@Override
public Integer countByPageId(Long resourcePageId) {
Map<String, Object> map = new HashMap<>();
map.put("resourcePageId", resourcePageId);
return getSessionTemplate().selectOne(getStatement("countByPageId"), map);
}
} }
...@@ -493,4 +493,20 @@ public class ResourcePageFacade { ...@@ -493,4 +493,20 @@ public class ResourcePageFacade {
Long wechatUserId = Cookie.getId(userInfo,Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
return new ResponseDto<>(resourcePageBiz.listQrOneResourceByBook(sceneId,wechatUserId)); return new ResponseDto<>(resourcePageBiz.listQrOneResourceByBook(sceneId,wechatUserId));
} }
@ApiOperation("客户端-根据rays码id查资源页菜单栏数量")
@GetMapping("getNavigationCount")
public ResponseDto<?> getNavigationCount(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookGroupId", required = false) Long bookGroupId,
@RequestParam(value = "sceneId", required = false) String sceneId){
Long wechatUserId = Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
if (StringUtils.isBlank(sceneId)) {
return new ResponseDto<>(resourcePageBiz.getNavigationCount(bookGroupId, wechatUserId, null));
} else if (NumberUtils.isDigits(sceneId)) {
return new ResponseDto<>(resourcePageBiz.getNavigationCount(bookGroupId, wechatUserId, Long.parseLong(sceneId)));
} else {
return new ResponseDto<>(resourcePageBiz.getNavigationCount(bookGroupId, wechatUserId, AESUtil.fixedLongDecrypt(sceneId)));
}
}
} }
...@@ -176,4 +176,11 @@ ...@@ -176,4 +176,11 @@
update_time = now() update_time = now()
where id = #{id} where id = #{id}
</update> </update>
<select id="countByPageId" parameterType="map" resultType="Integer">
select
ifnull(count(1),0)
from book.resource_page_navigation
where resource_page_id = #{resourcePageId}
</select>
</mapper> </mapper>
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