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
948e7ff4
Commit
948e7ff4
authored
May 31, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加公众号订单模板通知,保洁模板通知
parent
d9e410fe
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
6 deletions
+23
-6
WeChatController.java
...in/java/share/web/controller/system/WeChatController.java
+0
-1
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+7
-0
WechatNewService.java
.../src/main/java/share/system/service/WechatNewService.java
+1
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+4
-0
WechatNewServiceImpl.java
.../java/share/system/service/impl/WechatNewServiceImpl.java
+11
-4
No files found.
share-front/src/main/java/share/web/controller/system/WeChatController.java
View file @
948e7ff4
...
@@ -16,7 +16,6 @@ import share.system.request.WxBindingPhoneRequest;
...
@@ -16,7 +16,6 @@ import share.system.request.WxBindingPhoneRequest;
import
share.system.request.WxRegisterPhoneRequest
;
import
share.system.request.WxRegisterPhoneRequest
;
import
share.system.response.LoginResponse
;
import
share.system.response.LoginResponse
;
import
share.system.service.SConsumerCenterService
;
import
share.system.service.SConsumerCenterService
;
import
share.system.service.SystemNotificationService
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
...
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
948e7ff4
...
@@ -84,6 +84,9 @@ public class RedisTask {
...
@@ -84,6 +84,9 @@ public class RedisTask {
@Autowired
@Autowired
private
RoomLabelService
roomLabelService
;
private
RoomLabelService
roomLabelService
;
@Autowired
private
WechatNewService
wechatNewService1
;
//15分钟的常量
//15分钟的常量
final
long
FIFTEEN_MINUTES
=
60
*
15
;
final
long
FIFTEEN_MINUTES
=
60
*
15
;
...
@@ -209,6 +212,8 @@ public class RedisTask {
...
@@ -209,6 +212,8 @@ public class RedisTask {
if
(!
tiktok
)
{
if
(!
tiktok
)
{
tiktokService
.
clientToken
();
tiktokService
.
clientToken
();
}
}
wechatNewService
.
getPublicAccessToken
();
}
}
//自动添加保洁记录
//自动添加保洁记录
...
@@ -264,6 +269,8 @@ public class RedisTask {
...
@@ -264,6 +269,8 @@ public class RedisTask {
sConsumerService
.
selectListByStoreId
(
sOrder
.
getStoreId
()).
stream
().
forEach
(
item
->
{
sConsumerService
.
selectListByStoreId
(
sOrder
.
getStoreId
()).
stream
().
forEach
(
item
->
{
// 循环发送短信提示门店保洁打扫卫生
// 循环发送短信提示门店保洁打扫卫生
smsService
.
sendSmsCleanRecordsRemind15
(
item
.
getPhone
(),
sStore
,
sRoom
);
smsService
.
sendSmsCleanRecordsRemind15
(
item
.
getPhone
(),
sStore
,
sRoom
);
//公众号发送保洁工单派单通知
// wechatNewService.sendPublicTemplateMessage(finalSOrder,MessageReminderEnum.CLEANING,item.getId());
});
});
return
;
return
;
}
}
...
...
share-system/src/main/java/share/system/service/WechatNewService.java
View file @
948e7ff4
...
@@ -89,7 +89,7 @@ public interface WechatNewService {
...
@@ -89,7 +89,7 @@ public interface WechatNewService {
*/
*/
Boolean
sendPublicTemplateMessage
(
OfficialAccountTemplate
templateMessage
);
Boolean
sendPublicTemplateMessage
(
OfficialAccountTemplate
templateMessage
);
Boolean
sendPublicTemplateMessage
(
SOrder
byOrderNo
,
MessageReminderEnum
messageReminderEnum
);
Boolean
sendPublicTemplateMessage
(
SOrder
byOrderNo
,
MessageReminderEnum
messageReminderEnum
,
Long
consumerId
);
UserOpenIdVo
getWechatUSERList
();
UserOpenIdVo
getWechatUSERList
();
/**
/**
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
948e7ff4
...
@@ -951,6 +951,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -951,6 +951,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
consumers
.
size
()
>
0
)
{
if
(
consumers
.
size
()
>
0
)
{
consumers
.
forEach
(
o
->
{
consumers
.
forEach
(
o
->
{
phones
.
add
(
o
.
getPhone
());
phones
.
add
(
o
.
getPhone
());
//公众号发送订单预订成功通知
// wechatNewService.sendPublicTemplateMessage(sOrder,MessageReminderEnum.ORDER_RESERVE,o.getId());
});
});
smsService
.
sendSmsOrderPredetermine
(
phones
,
sOrder
,
sStore
,
room
);
smsService
.
sendSmsOrderPredetermine
(
phones
,
sOrder
,
sStore
,
room
);
}
}
...
@@ -1459,6 +1461,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -1459,6 +1461,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if
(
consumers
.
size
()
>
0
)
{
if
(
consumers
.
size
()
>
0
)
{
consumers
.
forEach
(
o
->{
consumers
.
forEach
(
o
->{
phones
.
add
(
o
.
getPhone
());
phones
.
add
(
o
.
getPhone
());
//公众号发送订单预订成功通知
// wechatNewService.sendPublicTemplateMessage(sOrder,MessageReminderEnum.ORDER_RESERVE,o.getId());
});
});
smsService
.
sendSmsOrderPredetermine
(
phones
,
sOrder
,
sStore
,
sRoom
);
smsService
.
sendSmsOrderPredetermine
(
phones
,
sOrder
,
sStore
,
sRoom
);
}
}
...
...
share-system/src/main/java/share/system/service/impl/WechatNewServiceImpl.java
View file @
948e7ff4
...
@@ -93,11 +93,11 @@ public class WechatNewServiceImpl implements WechatNewService {
...
@@ -93,11 +93,11 @@ public class WechatNewServiceImpl implements WechatNewService {
}
}
String
appId
=
officialAccountConfig
.
getAppId
();
String
appId
=
officialAccountConfig
.
getAppId
();
if
(
StrUtil
.
isBlank
(
appId
))
{
if
(
StrUtil
.
isBlank
(
appId
))
{
throw
new
BaseException
(
"微信
小程序
appId未设置"
);
throw
new
BaseException
(
"微信
公众号
appId未设置"
);
}
}
String
secret
=
officialAccountConfig
.
getAppSecret
();
String
secret
=
officialAccountConfig
.
getAppSecret
();
if
(
StrUtil
.
isBlank
(
secret
))
{
if
(
StrUtil
.
isBlank
(
secret
))
{
throw
new
BaseException
(
"微信
小程序
secret未设置"
);
throw
new
BaseException
(
"微信
公众号
secret未设置"
);
}
}
WeChatAccessTokenVo
accessTokenVo
=
getAccessToken
(
appId
,
secret
,
"public"
);
WeChatAccessTokenVo
accessTokenVo
=
getAccessToken
(
appId
,
secret
,
"public"
);
// 缓存accessToken
// 缓存accessToken
...
@@ -518,11 +518,13 @@ public class WechatNewServiceImpl implements WechatNewService {
...
@@ -518,11 +518,13 @@ public class WechatNewServiceImpl implements WechatNewService {
if
(
ObjectUtil
.
isNull
(
data
))
{
if
(
ObjectUtil
.
isNull
(
data
))
{
throw
new
BaseException
(
"微信平台接口异常,没任何数据返回!"
);
throw
new
BaseException
(
"微信平台接口异常,没任何数据返回!"
);
}
}
if
(
data
.
containsKey
(
"errcode"
)
&&
!
data
.
getString
(
"errcode"
).
equals
(
"0"
))
{
if
(
data
.
containsKey
(
"errcode"
)
&&
!
data
.
getString
(
"errcode"
).
equals
(
"0"
)
&&
!
data
.
getString
(
"errcode"
).
equals
(
"40014"
)
)
{
if
(
data
.
containsKey
(
"errmsg"
))
{
if
(
data
.
containsKey
(
"errmsg"
))
{
wxExceptionDispose
(
data
,
"微信公众号发送模板消息异常"
);
wxExceptionDispose
(
data
,
"微信公众号发送模板消息异常"
);
throw
new
BaseException
(
"微信接口调用失败:"
+
data
.
getString
(
"errcode"
)
+
data
.
getString
(
"errmsg"
));
throw
new
BaseException
(
"微信接口调用失败:"
+
data
.
getString
(
"errcode"
)
+
data
.
getString
(
"errmsg"
));
}
}
}
else
if
(
data
.
getString
(
"errcode"
).
equals
(
"40014"
))
{
return
sendPublicTemplateMessage
(
templateMessage
);
}
}
return
Boolean
.
TRUE
;
return
Boolean
.
TRUE
;
}
}
...
@@ -575,7 +577,7 @@ public class WechatNewServiceImpl implements WechatNewService {
...
@@ -575,7 +577,7 @@ public class WechatNewServiceImpl implements WechatNewService {
* 微信公众号发送模板消息
* 微信公众号发送模板消息
*/
*/
@Override
@Override
public
Boolean
sendPublicTemplateMessage
(
SOrder
byOrderNo
,
MessageReminderEnum
messageReminderEnum
)
{
public
Boolean
sendPublicTemplateMessage
(
SOrder
byOrderNo
,
MessageReminderEnum
messageReminderEnum
,
Long
consumerId
)
{
OfficialAccountTemplate
officialAccountTemplate
=
new
OfficialAccountTemplate
();
OfficialAccountTemplate
officialAccountTemplate
=
new
OfficialAccountTemplate
();
officialAccountTemplate
.
setAppid
(
weChatConfig
.
getAppId
());
officialAccountTemplate
.
setAppid
(
weChatConfig
.
getAppId
());
String
pagepath
=
"/pages/orderResult/orderResult?orderNo="
+
byOrderNo
.
getOrderNo
();
String
pagepath
=
"/pages/orderResult/orderResult?orderNo="
+
byOrderNo
.
getOrderNo
();
...
@@ -583,6 +585,11 @@ public class WechatNewServiceImpl implements WechatNewService {
...
@@ -583,6 +585,11 @@ public class WechatNewServiceImpl implements WechatNewService {
HashMap
<
String
,
SendTemplateMessageItemVo
>
data
=
new
HashMap
<>();
HashMap
<
String
,
SendTemplateMessageItemVo
>
data
=
new
HashMap
<>();
SStore
sStore
=
storeService
.
getById
(
byOrderNo
.
getStoreId
());
SStore
sStore
=
storeService
.
getById
(
byOrderNo
.
getStoreId
());
SRoomVo
sRoomVo
=
roomService
.
selectSRoomById
(
byOrderNo
.
getRoomId
());
SRoomVo
sRoomVo
=
roomService
.
selectSRoomById
(
byOrderNo
.
getRoomId
());
SConsumerToken
tokenByUserId
=
sConsumerTokenService
.
getTokenByUserId
(
consumerId
);
if
(
StringUtils
.
isEmpty
(
tokenByUserId
.
getOpenId
()))
{
return
false
;
}
officialAccountTemplate
.
setTouser
(
tokenByUserId
.
getOpenId
());
//拼接开始和结束时间
//拼接开始和结束时间
Date
preStartDate
=
byOrderNo
.
getPreStartDate
();
Date
preStartDate
=
byOrderNo
.
getPreStartDate
();
Date
preEndDate
=
byOrderNo
.
getPreEndDate
();
Date
preEndDate
=
byOrderNo
.
getPreEndDate
();
...
...
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