Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-yunqueyilian
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.wechat
pica-cloud-yunqueyilian
提交
33e35b75
提交
33e35b75
编写于
7月 03, 2020
作者:
yongbo.wang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'release' into 'master'
Release See merge request
!11
上级
498bb8c5
2599f6d6
变更
6
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
33 行增加
和
20 行删除
+33
-20
BeanConfiguration.java
.../yunqueyilian/server/configuration/BeanConfiguration.java
+8
-0
CoreServiceImpl.java
...hat/yunqueyilian/server/service/impl/CoreServiceImpl.java
+8
-3
MenuManagerServiceImpl.java
...queyilian/server/service/impl/MenuManagerServiceImpl.java
+11
-11
bootstrap-dev.properties
server/src/main/resources/bootstrap-dev.properties
+2
-2
bootstrap-test1.properties
server/src/main/resources/bootstrap-test1.properties
+2
-2
bootstrap-uat.properties
server/src/main/resources/bootstrap-uat.properties
+2
-2
未找到文件。
server/src/main/java/com/pica/cloud/wechat/yunqueyilian/server/configuration/BeanConfiguration.java
浏览文件 @
33e35b75
...
@@ -3,6 +3,7 @@ package com.pica.cloud.wechat.yunqueyilian.server.configuration;
...
@@ -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.CacheClient
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.cloud.context.config.annotation.RefreshScope
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -13,6 +14,13 @@ public class BeanConfiguration {
...
@@ -13,6 +14,13 @@ public class BeanConfiguration {
@Autowired
@Autowired
SpringContextAware
springContextAware
;
SpringContextAware
springContextAware
;
@Value
(
"${wechat_url}"
)
private
String
wechatUrl
;
public
String
getWechatUrl
()
{
return
wechatUrl
;
}
@Bean
@Bean
public
ICacheClient
cacheClient
()
{
public
ICacheClient
cacheClient
()
{
return
new
CacheClient
(
springContextAware
.
getActiveProfile
());
return
new
CacheClient
(
springContextAware
.
getActiveProfile
());
...
...
server/src/main/java/com/pica/cloud/wechat/yunqueyilian/server/service/impl/CoreServiceImpl.java
浏览文件 @
33e35b75
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
server
.
service
.
impl
;
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.PicaException
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
...
@@ -9,6 +10,7 @@ import com.pica.cloud.wechat.yunqueyilian.common.CommonUtils;
...
@@ -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.Constants
;
import
com.pica.cloud.wechat.yunqueyilian.common.req.TextMessage
;
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.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.entity.PWechatUser
;
import
com.pica.cloud.wechat.yunqueyilian.server.mapper.PWechatUserMapper
;
import
com.pica.cloud.wechat.yunqueyilian.server.mapper.PWechatUserMapper
;
import
com.pica.cloud.wechat.yunqueyilian.server.service.CoreService
;
import
com.pica.cloud.wechat.yunqueyilian.server.service.CoreService
;
...
@@ -37,6 +39,9 @@ public class CoreServiceImpl implements CoreService {
...
@@ -37,6 +39,9 @@ public class CoreServiceImpl implements CoreService {
@Autowired
@Autowired
PWechatUserMapper
wechatUserMapper
;
PWechatUserMapper
wechatUserMapper
;
@Autowired
BeanConfiguration
beanConfigurationl
;
@Override
@Override
public
String
requestCheck
(
HttpServletRequest
request
)
{
public
String
requestCheck
(
HttpServletRequest
request
)
{
// 微信加密签名
// 微信加密签名
...
@@ -86,7 +91,7 @@ public class CoreServiceImpl implements CoreService {
...
@@ -86,7 +91,7 @@ public class CoreServiceImpl implements CoreService {
mapIn
.
put
(
"openId"
,
openId
);
mapIn
.
put
(
"openId"
,
openId
);
PWechatUser
userGet
=
wechatUserMapper
.
queryByOpenId
(
mapIn
);
//从wechat表中获取数据
PWechatUser
userGet
=
wechatUserMapper
.
queryByOpenId
(
mapIn
);
//从wechat表中获取数据
PicaResponse
<
Map
<
String
,
Object
>>
response
=
userServiceClient
.
users
(
Constants
.
WECHAT_NAME_YQYL
,
openId
);
//调用微信的接口,获取微信用户的详细信息
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
()))
{
if
(!
PicaResultCode
.
SUCCESS
.
code
().
equals
(
response
.
getCode
()))
{
throw
new
PicaException
(
response
.
getCode
(),
response
.
getMessage
());
throw
new
PicaException
(
response
.
getCode
(),
response
.
getMessage
());
}
}
...
@@ -114,7 +119,7 @@ public class CoreServiceImpl implements CoreService {
...
@@ -114,7 +119,7 @@ public class CoreServiceImpl implements CoreService {
return
respMessage
;
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"
);
String
eventType
=
requestMap
.
get
(
"Event"
);
if
(
eventType
.
equals
(
Constants
.
EVENT_TYPE_SUBSCRIBE
))
{
//关注
if
(
eventType
.
equals
(
Constants
.
EVENT_TYPE_SUBSCRIBE
))
{
//关注
boolean
newFlag
=
false
;
boolean
newFlag
=
false
;
...
@@ -150,7 +155,7 @@ public class CoreServiceImpl implements CoreService {
...
@@ -150,7 +155,7 @@ public class CoreServiceImpl implements CoreService {
}
}
String
url
=
"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxcf79dbdc24cb684b"
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"
;
+
"&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect"
;
String
resContent
=
"您好!欢迎关注云鹊医联公众号。\n绑定个人资料后可以预约挂号、查看随访记录;还可以收到公众号推送患教和通知。\n<a href='"
+
url
+
"'>立即去绑定</a>"
;
String
resContent
=
"您好!欢迎关注云鹊医联公众号。\n绑定个人资料后可以预约挂号、查看随访记录;还可以收到公众号推送患教和通知。\n<a href='"
+
url
+
"'>立即去绑定</a>"
;
...
...
server/src/main/java/com/pica/cloud/wechat/yunqueyilian/server/service/impl/MenuManagerServiceImpl.java
浏览文件 @
33e35b75
...
@@ -24,7 +24,7 @@ public class MenuManagerServiceImpl {
...
@@ -24,7 +24,7 @@ public class MenuManagerServiceImpl {
public
static
void
main
(
String
[]
args
)
throws
IOException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
// CloudPropertiesUtil.read("dev");
// CloudPropertiesUtil.read("dev");
CloudPropertiesUtil
.
read
(
"
test1
"
);
CloudPropertiesUtil
.
read
(
"
pro
"
);
AccessToken
accessToken
=
WeChatToolUtil
.
getAccessToken
(
CloudPropertiesUtil
.
getValue
(
"AppID"
),
CloudPropertiesUtil
.
getValue
(
"AppSecret"
));
AccessToken
accessToken
=
WeChatToolUtil
.
getAccessToken
(
CloudPropertiesUtil
.
getValue
(
"AppID"
),
CloudPropertiesUtil
.
getValue
(
"AppSecret"
));
Boolean
flag
=
WeChatToolUtil
.
createMenu
(
getMenu
(),
accessToken
.
getAccess_token
());
Boolean
flag
=
WeChatToolUtil
.
createMenu
(
getMenu
(),
accessToken
.
getAccess_token
());
if
(
flag
)
{
if
(
flag
)
{
...
@@ -42,18 +42,18 @@ public class MenuManagerServiceImpl {
...
@@ -42,18 +42,18 @@ public class MenuManagerServiceImpl {
*/
*/
private
static
Menu
getMenu
()
throws
UnsupportedEncodingException
{
private
static
Menu
getMenu
()
throws
UnsupportedEncodingException
{
//test1
//test1
String
btn11Url
=
"https://test1-yunqueyilian.yunqueyi.com/message"
;
//
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 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 btn31Url = "https://test1-yunqueyilian.yunqueyi.com/goBind";
String
btn32Url
=
"https://test1-yunqueyilian.yunqueyi.com/applyIndex"
;
//
String btn32Url = "https://test1-yunqueyilian.yunqueyi.com/applyIndex";
String
btn33Url
=
"https://test1-yunqueyilian.yunqueyi.com/followUp"
;
//
String btn33Url = "https://test1-yunqueyilian.yunqueyi.com/followUp";
//pro
//pro
//
String btn11Url = "https://yunqueyilian.yunqueyi.com/message";
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
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
btn31Url
=
"https://yunqueyilian.yunqueyi.com/goBind"
;
//
String btn32Url = "https://yunqueyilian.yunqueyi.com/applyIndex";
String
btn32Url
=
"https://yunqueyilian.yunqueyi.com/applyIndex"
;
//
String btn33Url = "https://yunqueyilian.yunqueyi.com/followUp";
String
btn33Url
=
"https://yunqueyilian.yunqueyi.com/followUp"
;
String
utl_end
=
"&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect"
;
String
utl_end
=
"&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect"
;
...
...
server/src/main/resources/bootstrap-dev.properties
浏览文件 @
33e35b75
...
@@ -25,8 +25,8 @@ spring.rabbitmq.username=appuser
...
@@ -25,8 +25,8 @@ spring.rabbitmq.username=appuser
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
#\u5FAE\u4FE1\u767B\u5F55\u4FE1\u606F
#\u5FAE\u4FE1\u767B\u5F55\u4FE1\u606F
AppID
=
wx
1ee39338694703b0
AppID
=
wx
cf79dbdc24cb684b
AppSecret
=
69e2c741d0cf8fd7eb8877ab9f3a236b
AppSecret
=
febe33eec4d0c05d62a2393be35c35c4
#local settings
#local settings
#feign.hystrix.enabled=true
#feign.hystrix.enabled=true
...
...
server/src/main/resources/bootstrap-test1.properties
浏览文件 @
33e35b75
...
@@ -25,8 +25,8 @@ spring.rabbitmq.username=appuser
...
@@ -25,8 +25,8 @@ spring.rabbitmq.username=appuser
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
#\u5FAE\u4FE1\u767B\u5F55\u4FE1\u606F \u5411\u6587
#\u5FAE\u4FE1\u767B\u5F55\u4FE1\u606F \u5411\u6587
AppID
=
wx
b23b6ab41e13da6d
AppID
=
wx
cf79dbdc24cb684b
AppSecret
=
0ddc5f4d893663d07885d0f99e61b097
AppSecret
=
febe33eec4d0c05d62a2393be35c35c4
#local settings
#local settings
#feign.hystrix.enabled=true
#feign.hystrix.enabled=true
...
...
server/src/main/resources/bootstrap-uat.properties
浏览文件 @
33e35b75
...
@@ -25,8 +25,8 @@ spring.rabbitmq.username=picacloud
...
@@ -25,8 +25,8 @@ spring.rabbitmq.username=picacloud
spring.rabbitmq.password
=
123456
spring.rabbitmq.password
=
123456
#\u5FAE\u4FE1\u767B\u5F55\u4FE1\u606F \u54F2\u6D69
#\u5FAE\u4FE1\u767B\u5F55\u4FE1\u606F \u54F2\u6D69
AppID
=
wx
1ee39338694703b0
AppID
=
wx
cf79dbdc24cb684b
AppSecret
=
69e2c741d0cf8fd7eb8877ab9f3a236b
AppSecret
=
febe33eec4d0c05d62a2393be35c35c4
#local settings
#local settings
#feign.hystrix.enabled=true
#feign.hystrix.enabled=true
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录