提交 33e35b75 编写于 作者: yongbo.wang's avatar yongbo.wang

Merge branch 'release' into 'master'

Release



See merge request !11
......@@ -3,6 +3,7 @@ package com.pica.cloud.wechat.yunqueyilian.server.configuration;
import com.pica.cloud.foundation.redis.CacheClient;
import com.pica.cloud.foundation.redis.ICacheClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......@@ -13,6 +14,13 @@ public class BeanConfiguration {
@Autowired
SpringContextAware springContextAware;
@Value("${wechat_url}")
private String wechatUrl;
public String getWechatUrl() {
return wechatUrl;
}
@Bean
public ICacheClient cacheClient() {
return new CacheClient(springContextAware.getActiveProfile());
......
package com.pica.cloud.wechat.yunqueyilian.server.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.pica.cloud.foundation.entity.PicaException;
import com.pica.cloud.foundation.entity.PicaResponse;
import com.pica.cloud.foundation.entity.PicaResultCode;
......@@ -9,6 +10,7 @@ import com.pica.cloud.wechat.yunqueyilian.common.CommonUtils;
import com.pica.cloud.wechat.yunqueyilian.common.Constants;
import com.pica.cloud.wechat.yunqueyilian.common.req.TextMessage;
import com.pica.cloud.wechat.yunqueyilian.server.client.IWechatsServiceClient;
import com.pica.cloud.wechat.yunqueyilian.server.configuration.BeanConfiguration;
import com.pica.cloud.wechat.yunqueyilian.server.entity.PWechatUser;
import com.pica.cloud.wechat.yunqueyilian.server.mapper.PWechatUserMapper;
import com.pica.cloud.wechat.yunqueyilian.server.service.CoreService;
......@@ -37,6 +39,9 @@ public class CoreServiceImpl implements CoreService {
@Autowired
PWechatUserMapper wechatUserMapper;
@Autowired
BeanConfiguration beanConfigurationl;
@Override
public String requestCheck(HttpServletRequest request) {
// 微信加密签名
......@@ -86,7 +91,7 @@ public class CoreServiceImpl implements CoreService {
mapIn.put("openId", openId);
PWechatUser userGet = wechatUserMapper.queryByOpenId(mapIn);//从wechat表中获取数据
PicaResponse<Map<String, Object>> response = userServiceClient.users(Constants.WECHAT_NAME_YQYL, openId); //调用微信的接口,获取微信用户的详细信息
logger.info("调用微信接口获取用户信息:" + response);
logger.info("调用微信接口获取用户信息:" + JSONObject.toJSONString(response));
if (!PicaResultCode.SUCCESS.code().equals(response.getCode())) {
throw new PicaException(response.getCode(), response.getMessage());
}
......@@ -114,7 +119,7 @@ public class CoreServiceImpl implements CoreService {
return respMessage;
}
private String insertOrUpdataWechatUser(Map<String, String> requestMap, Map map, PWechatUser wechatUser) throws UnsupportedEncodingException{
private String insertOrUpdataWechatUser(Map<String, String> requestMap, Map map, PWechatUser wechatUser) throws UnsupportedEncodingException {
String eventType = requestMap.get("Event");
if (eventType.equals(Constants.EVENT_TYPE_SUBSCRIBE)) {//关注
boolean newFlag = false;
......@@ -150,7 +155,7 @@ public class CoreServiceImpl implements CoreService {
}
String url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxcf79dbdc24cb684b"
+ "&redirect_uri=https://yunqueyilian.yunqueyi.com/goBind"
+ "&redirect_uri=" + beanConfigurationl.getWechatUrl() + "/goBind"
+ "&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";
String resContent = "您好!欢迎关注云鹊医联公众号。\n绑定个人资料后可以预约挂号、查看随访记录;还可以收到公众号推送患教和通知。\n<a href='" + url + "'>立即去绑定</a>";
......
......@@ -24,7 +24,7 @@ public class MenuManagerServiceImpl {
public static void main(String[] args) throws IOException {
// CloudPropertiesUtil.read("dev");
CloudPropertiesUtil.read("test1");
CloudPropertiesUtil.read("pro");
AccessToken accessToken = WeChatToolUtil.getAccessToken(CloudPropertiesUtil.getValue("AppID"), CloudPropertiesUtil.getValue("AppSecret"));
Boolean flag = WeChatToolUtil.createMenu(getMenu(), accessToken.getAccess_token());
if (flag) {
......@@ -42,18 +42,18 @@ public class MenuManagerServiceImpl {
*/
private static Menu getMenu() throws UnsupportedEncodingException {
//test1
String btn11Url = "https://test1-yunqueyilian.yunqueyi.com/message";
String btn21Url = "http://mp.weixin.qq.com/mp/homepage?__biz=MzIzNjM5NDA1OQ==&hid=2&sn=f52aa8659aa75f32aae5ea62d23e64ca&scene=18#wechat_redirect";
String btn31Url = "https://test1-yunqueyilian.yunqueyi.com/goBind";
String btn32Url = "https://test1-yunqueyilian.yunqueyi.com/applyIndex";
String btn33Url = "https://test1-yunqueyilian.yunqueyi.com/followUp";
// String btn11Url = "https://test1-yunqueyilian.yunqueyi.com/message";
// String btn21Url = "http://mp.weixin.qq.com/mp/homepage?__biz=MzIzNjM5NDA1OQ==&hid=2&sn=f52aa8659aa75f32aae5ea62d23e64ca&scene=18#wechat_redirect";
// String btn31Url = "https://test1-yunqueyilian.yunqueyi.com/goBind";
// String btn32Url = "https://test1-yunqueyilian.yunqueyi.com/applyIndex";
// String btn33Url = "https://test1-yunqueyilian.yunqueyi.com/followUp";
//pro
// String btn11Url = "https://yunqueyilian.yunqueyi.com/message";
// String btn21Url = "http://mp.weixin.qq.com/mp/homepage?__biz=MzIzNjM5NDA1OQ==&hid=2&sn=f52aa8659aa75f32aae5ea62d23e64ca&scene=18#wechat_redirect";
// String btn31Url = "https://yunqueyilian.yunqueyi.com/goBind";
// String btn32Url = "https://yunqueyilian.yunqueyi.com/applyIndex";
// String btn33Url = "https://yunqueyilian.yunqueyi.com/followUp";
String btn11Url = "https://yunqueyilian.yunqueyi.com/message";
String btn21Url = "http://mp.weixin.qq.com/mp/homepage?__biz=MzIzNjM5NDA1OQ==&hid=2&sn=f52aa8659aa75f32aae5ea62d23e64ca&scene=18#wechat_redirect";
String btn31Url = "https://yunqueyilian.yunqueyi.com/goBind";
String btn32Url = "https://yunqueyilian.yunqueyi.com/applyIndex";
String btn33Url = "https://yunqueyilian.yunqueyi.com/followUp";
String utl_end = "&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";
......
......@@ -25,8 +25,8 @@ spring.rabbitmq.username=appuser
spring.rabbitmq.password=AqLfvyWOvLQEUzdI
#\u5FAE\u4FE1\u767B\u5F55\u4FE1\u606F
AppID=wx1ee39338694703b0
AppSecret=69e2c741d0cf8fd7eb8877ab9f3a236b
AppID=wxcf79dbdc24cb684b
AppSecret=febe33eec4d0c05d62a2393be35c35c4
#local settings
#feign.hystrix.enabled=true
......
......@@ -25,8 +25,8 @@ spring.rabbitmq.username=appuser
spring.rabbitmq.password=AqLfvyWOvLQEUzdI
#\u5FAE\u4FE1\u767B\u5F55\u4FE1\u606F \u5411\u6587
AppID=wxb23b6ab41e13da6d
AppSecret=0ddc5f4d893663d07885d0f99e61b097
AppID=wxcf79dbdc24cb684b
AppSecret=febe33eec4d0c05d62a2393be35c35c4
#local settings
#feign.hystrix.enabled=true
......
......@@ -25,8 +25,8 @@ spring.rabbitmq.username=picacloud
spring.rabbitmq.password=123456
#\u5FAE\u4FE1\u767B\u5F55\u4FE1\u606F \u54F2\u6D69
AppID=wx1ee39338694703b0
AppSecret=69e2c741d0cf8fd7eb8877ab9f3a236b
AppID=wxcf79dbdc24cb684b
AppSecret=febe33eec4d0c05d62a2393be35c35c4
#local settings
#feign.hystrix.enabled=true
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册