Commit 3fc7e0b8 by 田超

Merge branch 'feature/1003172' into 'master'

feat: [1003172] 运营平台优化

See merge request rays/pcloud-book!976
parents 8c93513f efcd4c7c
......@@ -590,7 +590,7 @@ public interface BookFacade {
@GetMapping("getBookListByChannelId4Adviser")
ResponseDto<PageBean> getBookListByChannelId4Adviser(
@RequestHeader("token") String token, @RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage, @RequestParam(value = "channelId") Long channelId,
@RequestParam(value = "numPerPage") Integer numPerPage, @RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "name", required = false) String name) throws PermissionException, JsonParseException, BizException;
@RequestMapping(value = "listNoAuthBook", method = RequestMethod.POST)
......
......@@ -796,7 +796,7 @@ public class BookFacadeImpl implements BookFacade {
public ResponseDto<PageBean> getBookListByChannelId4Adviser( @RequestHeader("token") String token,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage,
@RequestParam(value = "channelId") Long channelId,
@RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam(value = "name", required = false) String name ) throws PermissionException, BizException {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
PageParam pageParam = new PageParam(currentPage, numPerPage);
......
......@@ -302,12 +302,16 @@ public class QrcodeSceneConsr {
@ParamLog(description = "获取公众号基本信息")
public AccountSettingDto getWechatInfo(Long channelId) throws BizException {
if (channelId == null) return null;
AccountSettingDto accountSettingDto = null;
try {
return ResponseHandleUtil.parseResponse(accountSettingService.getWechat(channelId, SystemCode.channel.code), AccountSettingDto.class);
accountSettingDto = ResponseHandleUtil.parseResponse(accountSettingService.getWechat(channelId, SystemCode.channel.code), AccountSettingDto.class);
} catch (BizException e) {
LOGGER.error("【渠道(消)】 获取公众号基本信息,<ERROR>.[getById]:" + e.getMessage(), e);
}
return null;
if (null == accountSettingDto){
LOGGER.error("运营平台未配置公众号,channelId=" + channelId);
}
return accountSettingDto;
}
......
......@@ -651,7 +651,7 @@ public interface BookGroupFacade {
@RequestParam(value = "name", required = false) String name,
@RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage,
@RequestParam("channelId") Long channelId,
@RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam("serveId") Long serveId,
@RequestParam("serveType") String serveType)
throws BizException, PermissionException;
......
......@@ -1054,7 +1054,7 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
@RequestParam(value = "name", required = false) String name,
@RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage,
@RequestParam("channelId") Long channelId,
@RequestParam(value = "channelId", required = false) Long channelId,
@RequestParam("serveId") Long serveId,
@RequestParam("serveType") String serveType )
throws BizException, PermissionException {
......
......@@ -246,6 +246,10 @@ public class SendWeixinRequestTools {
@ParamLog("补充域名")
public static String splitUrl(AccountSettingDto accountSettingDto, String url) {
if (null == accountSettingDto){
LOGGER.error("运营平台未配置公众号,url"+url);
return url;
}
String protocol = accountSettingDto.getProtocol();
if (StringUtils.isEmpty(protocol)) {
protocol = ChannelConstants.HTTP;
......
......@@ -1486,6 +1486,9 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
if (null != channelId) {
accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId);
if (null == accountSettingDto){
throw new BookBizException(BookBizException.PARAM_IS_NULL, "运营平台未配置公众号");
}
String resultLinkUrl = SendWeixinRequestTools.splitUrl(accountSettingDto, item.getLinkUrl());
item.setResultUrl(resultLinkUrl);
} else {
......@@ -1509,6 +1512,9 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
item.setServeTypeCode(appDto.getTypeCode());
item.setServeTypeName(appDto.getTypeName());
accountSettingDto = qrcodeSceneConsr.getWechatInfo(appDto.getChannelId());
if (null == accountSettingDto){
throw new BookBizException(BookBizException.PARAM_IS_NULL, "运营平台未配置公众号");
}
String resultLinkUrl = SendWeixinRequestTools.splitUrl(accountSettingDto, item.getLinkUrl());
item.setResultUrl(resultLinkUrl);
if (!StringUtil.isEmpty(appDto.getTurnUrl())){
......
......@@ -895,6 +895,9 @@
<if test="joinGroupType !=null">
AND G.join_group_type=#{joinGroupType}
</if>
<if test="channelId != null">
and G.CHANNEL_ID = #{channelId}
</if>
GROUP BY
G.ID
ORDER BY
......
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