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