feat(企业微信): 添加资产领用审批消息跳转链接
新增企业微信推送消息中资产领用审批的跳转链接处理逻辑,包括/wechatAuth/asset和/approvalAssetRedirect两个接口,用于完成从消息点击到审批页面的完整跳转流程
This commit is contained in:
parent
2ca926771c
commit
39f4e421d3
|
@ -187,6 +187,45 @@ public class ShopController {
|
||||||
return new RedirectView(builder.build().encode().toUriString());
|
return new RedirectView(builder.build().encode().toUriString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业微信推送消息点击商品图片后跳转的地址
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/qy/wechatAuth/asset")
|
||||||
|
public RedirectView qyWechatAuthAssetRedirect(HttpServletRequest request) {
|
||||||
|
String authUrl = "https://open.weixin.qq.com/connect/oauth2/authorize"
|
||||||
|
+ "?appid=" + WeixinConstants.corpid
|
||||||
|
+ "&redirect_uri=http%3A%2F%2Fwxshop.ab98.cn%2Fshop-api%2Fapi%2Fshop%2FapprovalAssetRedirect"
|
||||||
|
+ "&response_type=code"
|
||||||
|
+ "&scope=snsapi_base"
|
||||||
|
+ "&state=STATE"
|
||||||
|
+ "&agentid=" + WeixinConstants.agentid
|
||||||
|
+ "#wechat_redirect";
|
||||||
|
return new RedirectView(authUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业微信推送消息点击商品图片后跳转的地址
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/approvalAssetRedirect")
|
||||||
|
public RedirectView approvalAssetRedirect(HttpServletRequest request) {
|
||||||
|
UriComponentsBuilder builder = UriComponentsBuilder
|
||||||
|
.fromHttpUrl("http://wxshop.ab98.cn/shop#/approvalAsset/list")
|
||||||
|
.queryParam("corpid", WeixinConstants.corpid)
|
||||||
|
.queryParam("device", "APP");
|
||||||
|
|
||||||
|
request.getParameterMap().forEach((key, values) -> {
|
||||||
|
if (!"corpid".equals(key) && !"device".equals(key)) {
|
||||||
|
builder.queryParam(key, (Object[]) values);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return new RedirectView(builder.build().encode().toUriString());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业微信聊天界面点击进入主页后跳转的地址
|
* 企业微信聊天界面点击进入主页后跳转的地址
|
||||||
* @param request
|
* @param request
|
||||||
|
|
|
@ -199,7 +199,7 @@ public class AssetApplicationService {
|
||||||
article.setDescription(postAssetApprovalCommand.getName() + " 申请领用" + firstGoods.getGoodsName());
|
article.setDescription(postAssetApprovalCommand.getName() + " 申请领用" + firstGoods.getGoodsName());
|
||||||
}
|
}
|
||||||
article.setPicurl(firstGoods.getCoverImg());
|
article.setPicurl(firstGoods.getCoverImg());
|
||||||
article.setUrl("http://wxshop.ab98.cn/shop-api/api/shop/qy/wechatAuth");
|
article.setUrl("http://wxshop.ab98.cn/shop-api/api/shop/qy/wechatAuth/asset");
|
||||||
articles.add(article);
|
articles.add(article);
|
||||||
|
|
||||||
QywxApiUtil.sendNewsMessage(accessToken.getAccessToken(), Integer.valueOf(authCorpInfo.getAgentid()),
|
QywxApiUtil.sendNewsMessage(accessToken.getAccessToken(), Integer.valueOf(authCorpInfo.getAgentid()),
|
||||||
|
|
Loading…
Reference in New Issue