Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
1fbe9582
Commit
1fbe9582
authored
Dec 04, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加小程序订阅消息跳转类型
parent
42c18c3f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
13 deletions
+21
-13
application-prod.yml
share-admin/src/main/resources/application-prod.yml
+8
-1
TemplateMessageVo.java
...c/main/java/share/system/domain/vo/TemplateMessageVo.java
+3
-0
WechatNewServiceImpl.java
.../java/share/system/service/impl/WechatNewServiceImpl.java
+10
-12
No files found.
share-admin/src/main/resources/application-prod.yml
View file @
1fbe9582
...
...
@@ -22,7 +22,14 @@ wechat:
signKey
:
ZEKu56XCezuESfNEdM4zVZEN3cz2PuHz
certPath
:
/var/gxpt/wechat_ssl/apiclient_cert.p12
token
:
coujio
wx
:
miniapp
:
configs
:
-
appid
:
wxdd170b8783edf7a0
secret
:
7339f117e85876a0dfe10ea1ed47340e
token
:
coujio
aesKey
:
zf8vTHbI0ZDPTkkCXHEuwh9EbtVtOn6n4vQjMb9OFrS
msgDataFormat
:
XML
# 开发环境配置
server
:
# 服务器的HTTP端口,默认为8080
...
...
share-system/src/main/java/share/system/domain/vo/TemplateMessageVo.java
View file @
1fbe9582
...
...
@@ -25,6 +25,9 @@ public class TemplateMessageVo {
@ApiModelProperty
(
value
=
"模板跳转链接(海外帐号没有跳转能力)"
)
private
String
page
;
@ApiModelProperty
(
value
=
"跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版"
)
private
String
miniprogram_state
;
@ApiModelProperty
(
value
=
"发送内容"
)
private
HashMap
<
String
,
SendTemplateMessageItemVo
>
data
;
}
share-system/src/main/java/share/system/service/impl/WechatNewServiceImpl.java
View file @
1fbe9582
...
...
@@ -529,8 +529,9 @@ public class WechatNewServiceImpl implements WechatNewService {
public
Boolean
sendMiniSubscribeMessage
(
SOrder
byOrderNo
,
MessageReminderEnum
messageReminderEnum
)
{
//发送模板消息 预约提醒到期
TemplateMessageVo
templateMessageVo
=
new
TemplateMessageVo
();
String
url
=
"
https://www.coujio.com/front-api/order
/"
+
byOrderNo
.
getOrderNo
();
String
url
=
"
pages/orderResult
/"
+
byOrderNo
.
getOrderNo
();
templateMessageVo
.
setPage
(
url
);
templateMessageVo
.
setMiniprogram_state
(
"trial"
);
HashMap
<
String
,
SendTemplateMessageItemVo
>
data
=
new
HashMap
<>();
SStore
sStore
=
storeService
.
getById
(
byOrderNo
.
getStoreId
());
SRoomVo
sRoomVo
=
roomService
.
selectSRoomById
(
byOrderNo
.
getRoomId
());
...
...
@@ -543,6 +544,11 @@ public class WechatNewServiceImpl implements WechatNewService {
SConsumerToken
tokenByUserId
=
sConsumerTokenService
.
getTokenByUserId
(
byOrderNo
.
getConsumerId
());
String
date
=
preStartDateStr
+
"~"
+
preEndDateStr
;
templateMessageVo
.
setTouser
(
tokenByUserId
.
getToken
());
//截取20个字符
String
address
=
sStore
.
getAddress
();
if
(
address
.
length
()
>
20
)
{
address
=
address
.
substring
(
0
,
20
);
}
if
(
messageReminderEnum
.
equals
(
MessageReminderEnum
.
RESERVER
))
{
templateMessageVo
.
setTemplate_id
(
MessageReminderEnum
.
RESERVER
.
getValue
());
//添加门店名称
...
...
@@ -552,9 +558,7 @@ public class WechatNewServiceImpl implements WechatNewService {
//预约时间
data
.
put
(
"date3"
,
new
SendTemplateMessageItemVo
(
date
));
//地址
String
address
=
sStore
.
getAddress
();
String
substring
=
address
.
substring
(
0
,
20
);
data
.
put
(
"thing5"
,
new
SendTemplateMessageItemVo
(
substring
));
data
.
put
(
"thing5"
,
new
SendTemplateMessageItemVo
(
address
));
}
else
if
(
messageReminderEnum
.
equals
(
MessageReminderEnum
.
START
))
{
templateMessageVo
.
setTemplate_id
(
MessageReminderEnum
.
START
.
getValue
());
//预约门店
...
...
@@ -564,10 +568,7 @@ public class WechatNewServiceImpl implements WechatNewService {
//预约时间
data
.
put
(
"time8"
,
new
SendTemplateMessageItemVo
(
date
));
//地址
//截取20个字符
String
address
=
sStore
.
getAddress
();
String
substring
=
address
.
substring
(
0
,
20
);
data
.
put
(
"thing9"
,
new
SendTemplateMessageItemVo
(
substring
));
data
.
put
(
"thing9"
,
new
SendTemplateMessageItemVo
(
address
));
//订单金额
data
.
put
(
"amount4"
,
new
SendTemplateMessageItemVo
(
String
.
valueOf
(
byOrderNo
.
getPackPrice
())));
}
else
if
(
messageReminderEnum
.
equals
(
MessageReminderEnum
.
END
))
{
...
...
@@ -579,10 +580,7 @@ public class WechatNewServiceImpl implements WechatNewService {
//订单时间
data
.
put
(
"time7"
,
new
SendTemplateMessageItemVo
(
date
));
//地址
//截取20个字符
String
address
=
sStore
.
getAddress
();
String
substring
=
address
.
substring
(
0
,
20
);
data
.
put
(
"thing8"
,
new
SendTemplateMessageItemVo
(
substring
));
data
.
put
(
"thing8"
,
new
SendTemplateMessageItemVo
(
address
));
}
templateMessageVo
.
setData
(
data
);
return
sendMiniSubscribeMessage
(
templateMessageVo
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment