Commit a5bc3788 by 田超

Merge branch 'feature/1005387' into 'master'

feat:[1005387]本书服务页优化

See merge request rays/pcloud-book!1409
parents debe368e 4cd4f800
...@@ -6,6 +6,7 @@ import com.pcloud.appcenter.app.dto.AppDto; ...@@ -6,6 +6,7 @@ import com.pcloud.appcenter.app.dto.AppDto;
import com.pcloud.appcenter.app.dto.AppIdTypeDTO; import com.pcloud.appcenter.app.dto.AppIdTypeDTO;
import com.pcloud.appcenter.app.dto.AppRaysDTO; import com.pcloud.appcenter.app.dto.AppRaysDTO;
import com.pcloud.appcenter.app.dto.AppTypeDto; import com.pcloud.appcenter.app.dto.AppTypeDto;
import com.pcloud.appcenter.app.dto.app.MapBaseStatusDTO;
import com.pcloud.appcenter.app.service.AppService; import com.pcloud.appcenter.app.service.AppService;
import com.pcloud.appcenter.app.service.AppTypeService; import com.pcloud.appcenter.app.service.AppTypeService;
import com.pcloud.appcenter.base.dto.AppPriceCacheDTO; import com.pcloud.appcenter.base.dto.AppPriceCacheDTO;
...@@ -293,4 +294,16 @@ public class AppConsr { ...@@ -293,4 +294,16 @@ public class AppConsr {
} }
return new HashMap<>(); return new HashMap<>();
} }
@ParamLog(description = "获取应用状态与价格", isAfterReturn = false)
public Map<Long, MapBaseStatusDTO> mapBaseStatusById(List<Long> appIds){
if(ListUtils.isEmpty(appIds)) return null;
try{
Map<Long, MapBaseStatusDTO> appBaseStatus = ResponseHandleUtil.parseMap(appService.mapBaseStatusById(appIds), Long.class, MapBaseStatusDTO.class);
return appBaseStatus;
}catch (Exception e){
LOGGER.error("获取应用状态与价格失败"+ e.getMessage(), e);
}
return null;
}
} }
...@@ -329,4 +329,46 @@ public class TradeConsr { ...@@ -329,4 +329,46 @@ public class TradeConsr {
} }
return new HashMap<>(); return new HashMap<>();
} }
/**
* 应用作品购买状态
* @author:zhuyajie
* @date:2021/9/6 15:48
* * @param null
*/
public Map<Long, Boolean> mapAppProductBuyState(Long wechatUserId, List<Long> appIds, List<Long> productIds) {
if (null == wechatUserId || (ListUtils.isEmpty(appIds) && ListUtils.isEmpty(productIds))) {
return new HashMap<>();
}
OrderSearchDto orderSearchDto = new OrderSearchDto();
orderSearchDto.setAppIds(appIds);
orderSearchDto.setProductIds(productIds);
orderSearchDto.setWechatUserId(wechatUserId);
try {
return ResponseHandleUtil.parseMap(orderFormService.mapAppProductBuyState(orderSearchDto),Long.class,Boolean.class);
} catch (Exception e) {
LOGGER.error("调用orderFormService.mapAppProductBuyState失败"+e.getMessage(), e);
}
return null;
}
/**
* 课程单节课购买状态
* @author:zhuyajie
* @date:2021/9/7 12:37
* * @param null
*/
public Map<Long, Boolean> mapCourseProductBuyState(Long wechatUserId, List<Long> productIds) {
if (null == wechatUserId || ListUtils.isEmpty(productIds)) {
return new HashMap<>();
}
OrderSearchDto orderSearchDto = new OrderSearchDto();
orderSearchDto.setProductIds(productIds);
orderSearchDto.setWechatUserId(wechatUserId);
try {
return ResponseHandleUtil.parseMap(orderFormService.mapCourseProductBuyState(orderSearchDto),Long.class,Boolean.class);
} catch (Exception e) {
LOGGER.error("调用orderFormService.mapCourseProductBuyState失败"+e.getMessage(), e);
}
return null;
}
} }
...@@ -66,7 +66,7 @@ public interface ResourcePageBiz { ...@@ -66,7 +66,7 @@ public interface ResourcePageBiz {
* @date:2021/3/29 11:49 * @date:2021/3/29 11:49
* * @param null * * @param null
*/ */
List<ResourceColumnAndServeVO> getColumnAndServeListByPageId(Long resourcePageId, Boolean isWechat, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId); List<ResourceColumnAndServeVO> getColumnAndServeListByPageId(Long resourcePageId, Long wechatUserId, Long bookId, Long adviserId, Long channelId, Integer enableAdverting, Long navigationId);
/** /**
* 根据书刊查资源页基本配置 * 根据书刊查资源页基本配置
* @author:zhuyajie * @author:zhuyajie
...@@ -81,7 +81,7 @@ public interface ResourcePageBiz { ...@@ -81,7 +81,7 @@ public interface ResourcePageBiz {
* @date:2021/3/31 19:06 * @date:2021/3/31 19:06
* * @param null * * @param null
*/ */
PageBeanNew<ResourcePageItemVO> listPageResourcePageItem(Integer currentPage, Integer numPerPage, Long resourcePageColumnId); PageBeanNew<ResourcePageItemVO> listPageResourcePageItem(Integer currentPage, Integer numPerPage, Long resourcePageColumnId, Long wechatUserId);
/** /**
* 根据社群码id查询 * 根据社群码id查询
...@@ -173,7 +173,7 @@ public interface ResourcePageBiz { ...@@ -173,7 +173,7 @@ public interface ResourcePageBiz {
* @date:2021/4/21 15:09 * @date:2021/4/21 15:09
* * @param null * * @param null
*/ */
ResourcePageOneServe hasOneResource(Long bookGroupId, Long sceneId); ResourcePageOneServe hasOneResource(Long bookGroupId, Long sceneId, Long wechatUserId);
/** /**
* 自有码配置的资源列表 * 自有码配置的资源列表
......
...@@ -75,7 +75,7 @@ public class ResourcePageFacade { ...@@ -75,7 +75,7 @@ public class ResourcePageFacade {
@RequestParam("resourcePageId") Long resourcePageId, @RequestParam("resourcePageId") Long resourcePageId,
@RequestParam(value = "navigationId", required = false) Long navigationId){ @RequestParam(value = "navigationId", required = false) Long navigationId){
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(resourcePageBiz.getColumnAndServeListByPageId(resourcePageId, false, null, null, null, null, navigationId)); return new ResponseDto<>(resourcePageBiz.getColumnAndServeListByPageId(resourcePageId, null, null, null, null, null, navigationId));
} }
@ApiOperation("客户端-根据书刊查资源页基本配置") @ApiOperation("客户端-根据书刊查资源页基本配置")
...@@ -97,8 +97,8 @@ public class ResourcePageFacade { ...@@ -97,8 +97,8 @@ public class ResourcePageFacade {
@RequestParam(value = "channelId", required = false) Long channelId, @RequestParam(value = "channelId", required = false) Long channelId,
@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){
Cookie.getId(userInfo,Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
return new ResponseDto<>(resourcePageBiz.getColumnAndServeListByPageId(resourcePageId, true, bookId, adviserId, channelId, enableAdverting, navigationId)); return new ResponseDto<>(resourcePageBiz.getColumnAndServeListByPageId(resourcePageId, wechatUserId, bookId, adviserId, channelId, enableAdverting, navigationId));
} }
@ApiOperation("客户端分页查栏目资源") @ApiOperation("客户端分页查栏目资源")
...@@ -107,8 +107,8 @@ public class ResourcePageFacade { ...@@ -107,8 +107,8 @@ public class ResourcePageFacade {
@RequestParam("currentPage") Integer currentPage, @RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage, @RequestParam("numPerPage") Integer numPerPage,
@RequestParam("resourcePageColumnId") Long resourcePageColumnId) { @RequestParam("resourcePageColumnId") Long resourcePageColumnId) {
Cookie.getId(userInfo,Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
return new ResponseDto<>(resourcePageBiz.listPageResourcePageItem(currentPage, numPerPage, resourcePageColumnId)); return new ResponseDto<>(resourcePageBiz.listPageResourcePageItem(currentPage, numPerPage, resourcePageColumnId, wechatUserId));
} }
@ApiOperation("获取栏目及资源类型") @ApiOperation("获取栏目及资源类型")
...@@ -163,9 +163,11 @@ public class ResourcePageFacade { ...@@ -163,9 +163,11 @@ public class ResourcePageFacade {
@ApiOperation("是否只有一个资源") @ApiOperation("是否只有一个资源")
@GetMapping("hasOneResource") @GetMapping("hasOneResource")
public ResponseDto<?> hasOneResource(@RequestParam(value = "bookGroupId", required = false) Long bookGroupId, public ResponseDto<?> hasOneResource(@CookieValue("userInfo") String userInfo,
@RequestParam(value = "bookGroupId", required = false) Long bookGroupId,
@RequestParam(value = "sceneId", required = false) Long sceneId) { @RequestParam(value = "sceneId", required = false) Long sceneId) {
return new ResponseDto<>(resourcePageBiz.hasOneResource(bookGroupId, sceneId)); Long wechatUserId = Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
return new ResponseDto<>(resourcePageBiz.hasOneResource(bookGroupId, sceneId, wechatUserId));
} }
@ApiOperation("添加收藏记录") @ApiOperation("添加收藏记录")
......
...@@ -116,4 +116,8 @@ public class ResourcePageItemVO extends BaseDto{ ...@@ -116,4 +116,8 @@ public class ResourcePageItemVO extends BaseDto{
* 二维码公众号弹出状态 * 二维码公众号弹出状态
*/ */
private Boolean popupState; private Boolean popupState;
/**
* 是否购买
*/
private Boolean buyState;
} }
...@@ -1201,7 +1201,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1201,7 +1201,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if (null == resourcePageVO || null == resourcePageVO.getId()) { if (null == resourcePageVO || null == resourcePageVO.getId()) {
return; return;
} }
List<ResourceColumnAndServeVO> serveVOList = resourcePageBiz.getColumnAndServeListByPageId(resourcePageVO.getId(), false, null, null, null, null, null); List<ResourceColumnAndServeVO> serveVOList = resourcePageBiz.getColumnAndServeListByPageId(resourcePageVO.getId(), null, null, null, null, null, null);
UpdateResourceColumnVO columnVO = new UpdateResourceColumnVO(); UpdateResourceColumnVO columnVO = new UpdateResourceColumnVO();
columnVO.setColumnFormat(3); columnVO.setColumnFormat(3);
columnVO.setColumnName("精品资讯"); columnVO.setColumnName("精品资讯");
......
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