Commit be015bbc by 阮思源

Merge branch 'feat-1002157' into 'master'

【ID1002157】个人号可配置资源入口开关需求

See merge request rays/pcloud-book!303
parents 7925b1d7 2a5acb31
...@@ -462,6 +462,15 @@ public interface BookGroupBiz { ...@@ -462,6 +462,15 @@ public interface BookGroupBiz {
List<BookGroupServe> getBookGroupServeList(Long bookGroupId); List<BookGroupServe> getBookGroupServeList(Long bookGroupId);
/** /**
* 客户端获取资源配置集合
* @param bookGroupId
* @param currentPage
* @param numPerPage
* @return
*/
PageBeanNew<BookGroupServe> getBookGroupServeList4Wechat(Long bookGroupId, Integer currentPage, Integer numPerPage);
/**
* 获取社群码暗号 * 获取社群码暗号
*/ */
String getBookGroupCipher(); String getBookGroupCipher();
......
...@@ -1479,6 +1479,7 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1479,6 +1479,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
ownAltQrcodeInfoDTO.setAltNickName(selfRobotDTO.getNickName()); ownAltQrcodeInfoDTO.setAltNickName(selfRobotDTO.getNickName());
ownAltQrcodeInfoDTO.setAltQrcodeUrl(selfRobotDTO.getQrcodeUrl()); ownAltQrcodeInfoDTO.setAltQrcodeUrl(selfRobotDTO.getQrcodeUrl());
ownAltQrcodeInfoDTO.setAltHeadUrl(selfRobotDTO.getHeadPic()); ownAltQrcodeInfoDTO.setAltHeadUrl(selfRobotDTO.getHeadPic());
ownAltQrcodeInfoDTO.setResourceOpen(selfRobotDTO.getResourceOpen());
if (selfRobotDTO.getAgentRobot()!=null&&selfRobotDTO.getAgentRobot()) { if (selfRobotDTO.getAgentRobot()!=null&&selfRobotDTO.getAgentRobot()) {
//先查询有没有重复的 //先查询有没有重复的
BookGroupAgentRecord old = bookGroupAgentRecordDao.getByAltIdAndBookGroupId(selfRobotDTO.getWxId(), bookGroupId); BookGroupAgentRecord old = bookGroupAgentRecordDao.getByAltIdAndBookGroupId(selfRobotDTO.getWxId(), bookGroupId);
...@@ -2393,13 +2394,38 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -2393,13 +2394,38 @@ public class BookGroupBizImpl implements BookGroupBiz {
if (ListUtils.isEmpty(list)) { if (ListUtils.isEmpty(list)) {
return new ArrayList<>(); return new ArrayList<>();
} }
fillServeInfo(list);
return list;
}
@ParamLog("客户端获取资源配置集合")
@Override
public PageBeanNew<BookGroupServe> getBookGroupServeList4Wechat(Long bookGroupId, Integer currentPage, Integer numPerPage) {
if (bookGroupId == null) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数不能为空!");
}
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage <= 0) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "分页参数有误!");
}
Map<String, Object> map = new HashMap<>();
map.put("bookGroupId", bookGroupId);
PageBeanNew<BookGroupServe> pageBeanNew = bookGroupServeDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getListByBookGroupId");
fillServeInfo(pageBeanNew.getRecordList());
return pageBeanNew;
}
@ParamLog("填充资源信息")
private void fillServeInfo(List<BookGroupServe> list) {
if (ListUtils.isEmpty(list)){
return;
}
List<Long> productIds = new ArrayList<>(); List<Long> productIds = new ArrayList<>();
List<Long> appIds = new ArrayList<>(); List<Long> appIds = new ArrayList<>();
for (BookGroupServe bookGroupServe : list) { for (BookGroupServe bookGroupServe : list) {
if ("PRODUCT".equals(bookGroupServe.getServeType())) { if (AppAndProductTypeEnum.PRODUCT.value.equals(bookGroupServe.getServeType())) {
productIds.add(bookGroupServe.getServeId()); productIds.add(bookGroupServe.getServeId());
} }
if ("APP".equals(bookGroupServe.getServeType())) { if (AppAndProductTypeEnum.APP.value.equals(bookGroupServe.getServeType())) {
appIds.add(bookGroupServe.getServeId()); appIds.add(bookGroupServe.getServeId());
} }
} }
...@@ -2414,7 +2440,7 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -2414,7 +2440,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
appDtoMap = appConsr.mapByIds(appIds); appDtoMap = appConsr.mapByIds(appIds);
} }
for (BookGroupServe bookGroupServe : list) { for (BookGroupServe bookGroupServe : list) {
if ("PRODUCT".equals(bookGroupServe.getServeType())) { if (AppAndProductTypeEnum.PRODUCT.value.equals(bookGroupServe.getServeType())) {
ProductDto productDto = productDtoMap.get(bookGroupServe.getServeId()); ProductDto productDto = productDtoMap.get(bookGroupServe.getServeId());
if (productDto != null) { if (productDto != null) {
bookGroupServe.setServeName(productDto.getProductName()); bookGroupServe.setServeName(productDto.getProductName());
...@@ -2424,7 +2450,7 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -2424,7 +2450,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
bookGroupServe.setIsSuper(isSuperMap.get(bookGroupServe.getServeId())); bookGroupServe.setIsSuper(isSuperMap.get(bookGroupServe.getServeId()));
} }
} }
if ("APP".equals(bookGroupServe.getServeType())) { if (AppAndProductTypeEnum.APP.value.equals(bookGroupServe.getServeType())) {
AppDto appDto = appDtoMap.get(bookGroupServe.getServeId()); AppDto appDto = appDtoMap.get(bookGroupServe.getServeId());
if (appDto != null) { if (appDto != null) {
bookGroupServe.setServeName(appDto.getTitle()); bookGroupServe.setServeName(appDto.getTitle());
...@@ -2432,7 +2458,6 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -2432,7 +2458,6 @@ public class BookGroupBizImpl implements BookGroupBiz {
} }
} }
} }
return list;
} }
@ParamLog("获取社群码暗号") @ParamLog("获取社群码暗号")
......
...@@ -34,6 +34,9 @@ public class OwnAltQrcodeInfoDTO implements Serializable { ...@@ -34,6 +34,9 @@ public class OwnAltQrcodeInfoDTO implements Serializable {
@ApiModelProperty("加好友宣传语") @ApiModelProperty("加好友宣传语")
private String addFriendGuide; private String addFriendGuide;
@ApiModelProperty("资源是否开启")
private Boolean resourceOpen;
public String getAltId() { public String getAltId() {
return altId; return altId;
} }
...@@ -90,6 +93,14 @@ public class OwnAltQrcodeInfoDTO implements Serializable { ...@@ -90,6 +93,14 @@ public class OwnAltQrcodeInfoDTO implements Serializable {
this.addFriendGuide = addFriendGuide; this.addFriendGuide = addFriendGuide;
} }
public Boolean getResourceOpen() {
return resourceOpen;
}
public void setResourceOpen(Boolean resourceOpen) {
this.resourceOpen = resourceOpen;
}
@Override @Override
public String toString() { public String toString() {
return "OwnAltQrcodeInfoDTO{" + return "OwnAltQrcodeInfoDTO{" +
...@@ -100,6 +111,7 @@ public class OwnAltQrcodeInfoDTO implements Serializable { ...@@ -100,6 +111,7 @@ public class OwnAltQrcodeInfoDTO implements Serializable {
", cipher='" + cipher + '\'' + ", cipher='" + cipher + '\'' +
", customerServiceName='" + customerServiceName + '\'' + ", customerServiceName='" + customerServiceName + '\'' +
", addFriendGuide='" + addFriendGuide + '\'' + ", addFriendGuide='" + addFriendGuide + '\'' +
", resourceOpen=" + resourceOpen +
'}'; '}';
} }
} }
...@@ -456,6 +456,15 @@ public interface BookGroupFacade { ...@@ -456,6 +456,15 @@ public interface BookGroupFacade {
@RequestParam("bookGroupId") Long bookGroupId @RequestParam("bookGroupId") Long bookGroupId
) throws BizException, PermissionException, JsonParseException; ) throws BizException, PermissionException, JsonParseException;
@ApiOperation("客户端获取资源配置集合")
@GetMapping("getBookGroupServeList4Wechat")
ResponseDto<?> getBookGroupServeList4Wechat(
@CookieValue("userInfo") String userInfo,
@RequestParam("bookGroupId") Long bookGroupId,
@RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage
) throws BizException, PermissionException, JsonParseException;
@ApiOperation("获取社群码暗号") @ApiOperation("获取社群码暗号")
@GetMapping("getBookGroupCipher") @GetMapping("getBookGroupCipher")
ResponseDto<?> getBookGroupCipher( ResponseDto<?> getBookGroupCipher(
......
...@@ -649,6 +649,19 @@ public class BookGroupFacadeImpl implements BookGroupFacade { ...@@ -649,6 +649,19 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
return new ResponseDto<>(bookGroupBiz.getBookGroupServeList(bookGroupId)); return new ResponseDto<>(bookGroupBiz.getBookGroupServeList(bookGroupId));
} }
@ApiOperation("客户端获取资源配置集合")
@GetMapping("getBookGroupServeList4Wechat")
@Override
public ResponseDto<?> getBookGroupServeList4Wechat(
@CookieValue("userInfo") String userInfo,
@RequestParam("bookGroupId") Long bookGroupId,
@RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage
) throws BizException, PermissionException, JsonParseException {
Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
return new ResponseDto<>(bookGroupBiz.getBookGroupServeList4Wechat(bookGroupId,currentPage,numPerPage));
}
@ApiOperation("获取社群码暗号") @ApiOperation("获取社群码暗号")
@GetMapping("getBookGroupCipher") @GetMapping("getBookGroupCipher")
@Override @Override
......
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